libite 2.6.1
fparseln.c File Reference
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "lite.h"

Go to the source code of this file.

Macros

#define _DIAGASSERT(t)
 

Functions

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

Detailed Description

Author
Christos Zoulas
Date
1997

Definition in file fparseln.c.

Macro Definition Documentation

◆ _DIAGASSERT

#define _DIAGASSERT ( t)

Definition at line 42 of file fparseln.c.

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.

Definition at line 94 of file fparseln.c.