How plumlee211/get_next_line works
Project type and purpose
• This is a small C-language library/exercise (“get_next_line”) whose goal is to read one line at a time from a file descriptor, manage dynamic memory (linked lists, buffers), and demonstrate leak detection/debugging. It also bundles a test harness (gnlTester) with Docker/Makefile to validate both mandatory and bonus implementations.
File structure
• Top-level:
• README.md – project overview
• get_next_line/ – library source, headers, utils, test harness
• get_next_line/:
• get_next_line.c, get_next_line.h – core function (mandatory)
• get_next_line_bonus.c, get_next_line_bonus.h – bonus version (multiple FDs)
• get_next_line_utils.c / get_next_line_utils_bonus.c – helper routines (string operations, list management)
• gnl_main.c – example driver that calls get_next_line on newline.txt
• empty.txt / newline.txt – sample data for manual testing
• gnlTester/ – automated tester
◦ Dockerfile & Makefile – containerized environment and build rules
◦ files/ – a suite of input cases (various newline/no-newline permutations)
◦ tests/ – C++ test entry points for mandatory and bonus
README for additional insights
• Emphasis on:
• Understanding linked lists vs. arrays
• Detecting and diagnosing memory leaks (AddressSanitizer)
• File system concepts: FD table, i-nodes, EOF
• Debug tools: lldb, -fsanitize=address