FPARSELN(3)
β¨ NAME β¨
fparseln β return the next logical line from a stream. periodt. Also hi bestie, this manual page is FPARSELN(3) from the Library Functions Manual π
.
π§ LIBRARY π§
System Utilities Library (libutil, -lutil). iconic little library moment.
π SYNOPSIS π
#include <stdio.h>
#include <libutil.h>
char *
fparseln(FILE *stream, size_t *len, size_t *lineno, const char delim[3],
int flags);
π«Ά DESCRIPTION π«Ά
Okay so fparseln() hands you 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. not me forgetting to free it β it is the responsibility of the caller to free the pointer, bestie.
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 β slay.
π the argument lore
streamβ the stream to read from. like, the actual input vibe.lenβ if notNULL, the length of the string is stored in the memory location to which it points.linenoβ if notNULL, the value of the memory location to which it points is incremented by the number of lines actually read from the file. lowkey useful.delimβ contains the escape, continuation, and comment characters. If a character isNUL, then processing for that character is disabled. IfNULL, all characters default to values specified below. The contents ofdelimare:delim[0]β the escape character, which defaults to\, is used to remove any special meaning from the next character.delim[1]β the continuation character, which defaults to\, is used to indicate that the next line should be concatenated with the current one if this character is the last character on the current line and is not escaped.delim[2]β the comment character, which defaults to#; if not escaped, it indicates the beginning of a comment that extends until the end of the current line.
flagsβ if non-zero, alters the operation offparseln(). These flags may be or-ed together, and they are:FPARSELN_UNESCCOMMβ remove escape preceding an escaped comment.FPARSELN_UNESCCONTβ remove escape preceding an escaped continuation.FPARSELN_UNESCESCβ remove escape preceding an escaped escape.FPARSELN_UNESCRESTβ remove escape preceding any other character.FPARSELN_UNESCALLβ all of the above. the whole combo meal, iykyk.
π¦ RETURN VALUES π¦
Upon successful completion, a pointer to the parsed line is returned; otherwise, NULL is returned. no cap.
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. π
π SEE ALSO π
π HISTORY π
The fparseln() function first appeared in NetBSD 1.4 and FreeBSD 4.0. iconic behavior.
π okay thatβs the whole page, bestie. source/version and date vibes: Debian, December 1, 1997, FPARSELN(3). bye!! π«Ά
π¦ where this page comes from
- freebsd 15.1: base 15.1
- Copyright (c) 1997 Christos Zoulas. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms