char *
fparseln(
FILE *stream size_t *len size_t *lineno
const char delim[3] int flags
)
)
function
returns a pointer to the next logical line from the stream referenced by
stream.
This string is
NUL
terminated and it is dynamically allocated on each invocation.
It is the responsibility of the caller to free the pointer.
By default, if a character is escaped, both it and the preceding escape
character will be present in the returned string.
Various
flags
alter this behaviour.
The meaning of the arguments is as follows:
streamlenNULL,
the length of the string is stored in the memory location to which it
points.
linenoNULL,
the value of the memory location to which is pointed to, is incremented
by the number of lines actually read from the file.
delimNUL
then processing for that character is disabled.
If
NULL,
all characters default to values specified below.
The contents of
delim
is as follows:
delim[0]delim[1]delim[2]flags).
The various flags, which may be
or-ed
together, are:
FPARSELN_UNESCCOMMFPARSELN_UNESCCONTFPARSELN_UNESCESCFPARSELN_UNESCRESTFPARSELN_UNESCALL
NULL
is returned.
The
fparseln()
function uses internally
fgetln(3),
so all error conditions that apply to
fgetln(3),
apply to
fparseln().
In addition
fparseln()
may set
errno
to
[ENOMEM]
and return
NULL
if it runs out of memory.
)
function first appeared in
NetBSD1.4.