The
getdelim()
function reads a line from
stream,
delimited by the character
delimiter.
The
getline()
function is equivalent to
getdelim()
with the newline character as the delimiter.
The delimiter character is included as part of the line, unless
the end of the file is reached.
The caller may provide a pointer to a malloced buffer for the line in
*linep,
and the capacity of that buffer in
*linecapp.
These functions expand the buffer as needed, as if via
realloc().
If
linep
points to a
NULL
pointer, a new buffer will be allocated.
In either case,
*linep
and
*linecapp
will be updated accordingly.