libite 2.6.1
|
#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) |
#define _DIAGASSERT | ( | t | ) |
Definition at line 42 of file fparseln.c.
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. Definition at line 94 of file fparseln.c.