libite
Macros | Functions
fparseln.c File Reference
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "lite.h"
Include dependency graph for fparseln.c:

Macros

#define _DIAGASSERT(t)
 

Functions

char * fparseln (FILE *fp, size_t *size, size_t *lineno, const char str[3], int flags)
 Read a line from a file parsing continuations and trailing newlines. More...
 

Detailed Description

Author
Christos Zoulas
Date
1997

Function Documentation

◆ fparseln()

char* fparseln ( FILE *  fp,
size_t *  size,
size_t *  lineno,
const char  str[3],
int  flags 
)

Read a line from a file parsing continuations and trailing newlines.

Parameters
fpFILE pointer to read from
sizeThe resulting length of the string, unused if NULL
linenoIncremented with number of lines read, unused if NULL
strCharacters to look for, escape character, continuation, and comment
flagsFPARSELN_UNESCCOMM, FPARSELN_UNESCCONT, FPARSELN_UNESCESC, FPARSELN_UNESCREST, FPARSELN_UNESCALL

This function reads a line from a file, parsing continuations ending in '\' and eliminating trailing newlines, or comments starting with the comment char '#'.

If size is not NULL, the resulting length of the returned string is stored in size.

If lineno is not NULL, it is incremented for each actual line read from fp.

Returns
the line read from fp, or NULL on EOF or error.