lq-text: LQU_fReadFile

API long LQU_fReadFile (Severity, f, Name, What, Lines, Flags) int Severity; FILE *f; CONST char *Name; CONST char *What; char ***Lines; int Flags;

Purpose

Reads the named file (Name), and mallocs an array of char * pointers to the start of each line read. The number of lines returned may be less than the number in the file, since by default LQU_f­Read­File ignores blank or commented lines. Comments are denoted by a # as the first non-blank character on the line. If the file can't be opened, memory is exhausted, LQU_Read­File() calls Error() with the given Severity, and with an error message constructed out of What, which should be a short (e.g. 3-word) description of the purpose of the file. The Flags argument can contain any of the following, combined with or (|):

In addition, UF_NORMAL is defined to be UF_IGNBLANKS | UF_IGNSPACES | UF_IGNHASH | UF_ESCAPEOK and use of this in reading files is strongly encouraged to provide a consistent file format.

Returns

Errors

Warns (with the given severity | E_SYS) if the file can't be opened.