FINDLINE(3)
β¨ FINDLINE(3) bestie era β¨
okay so this lil page is FINDLINE(3), living under SchilyΒ΄s LIBRARY FUNCTIONS β and it's lowkey iconic if you need to find a line with a matching field π
β¨ NAME β¨
findline() β finds a line that has a matching field π
πΈ SYNOPSIS πΈ
int findline(fname,delim,string,field,array,arraysize)
char *fname; /* file name */
char delim; /* field delimiter */
char *string; /* string to match */
int field; /* field number to match, 0-n */
char *array[]; /* array to fill pointers in */
int arraysize; /* number of entries in the arrays */
π DESCRIPTION π
okay so findline() retrieves specific fields from the first line of the file fname. main character behavior fr fr β¨
findline() fills in array with pointers to strings that make up the fields on the line. The strings are allocated new storage β fresh memory, slay π«Ά
The field delimiter, delim, is used to break up each line of the file into fields. string is the string to match. fieldno is the field number to match. Fields are numbered 0..n. array is an array of pointers to fill in. arraysize is the number of elements in the array.
tiny vibe note bestie: the synopsis calls that argfield, and the description calls itfieldnoβ same matching-field energy, iykyk π.
π RETURNS π
+1β match π-1β no match π-2β arg error π-3β cannot open file π-4β not enough memory to allocate space for fields π₯
π¦ NOTES π¦
β οΈ Each line of the file must be less than 512 characters long. no cap, that's the limit bestie πΈ
xoxo, Joerg Schilling, 2022/09/09 π
π¦ where this page comes from
- opensuse-leap 16.0: libschily-devel-doc 2022.10.16-160000.2.2 Β· CDDL-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms