libite
|
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "lite.h"
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... | |
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.
fp | FILE pointer to read from |
size | The resulting length of the string, unused if NULL |
lineno | Incremented with number of lines read, unused if NULL |
str | Characters to look for, escape character, continuation, and comment |
flags | FPARSELN_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.
NULL
on EOF or error.