How taha-asm/get_next_line works
Get Next Line is a small C library that returns one line per call from a file descriptor, retaining unread bytes for later calls. Its mandatory implementation keeps one static buffer; the bonus implementation keeps a separate buffer slot per descriptor. Both read and accumulate data, use shared-style string/line helpers, then split the current line from the remainder. Source excerpts show these calls; the README documents the API and behavior. The graph omits unshown low-level helper call details beyond those visible in the excerpts.
Main entry points: get_next_line.c Line reader · get_next_line_bonus.c Multi-FD reader · get_next_line_utils.c String and line helpers · get_next_line_utils_bonus.c Bonus helpers
Components 8
Mandatory implementation
- GNL interface
get_next_line.h - Line reader
get_next_line.c - String and line helpers
get_next_line_utils.c
Bonus implementation
- Bonus interface
get_next_line_bonus.h - Multi-FD reader
get_next_line_bonus.c - Bonus helpers
get_next_line_utils_bonus.c
Other components
- Library caller
- File descriptor
Connections 6
- Library caller → Line reader: calls
README.md - Line reader → File descriptor: reads bytes
get_next_line.c - Line reader → String and line helpers: splits line
get_next_line.c - Library caller → Multi-FD reader: calls
README.md - Multi-FD reader → File descriptor: reads bytes
get_next_line_bonus.c - Multi-FD reader → Bonus helpers: splits line
get_next_line_bonus.c