int QccFileReadChar(FILE *infile, char
*val);
int QccFileWriteChar(FILE *outfile, char val);
int QccFileReadInt(FILE
*infile, int *val);
int QccFileWriteInt(FILE *outfile, int val);
int
QccFileReadDouble(FILE *infile, double *val);
int QccFileWriteDouble(FILE
*outfile, double val);
int QccFileReadString(FILE *infile, QccString
s);
int QccFileWriteString(FILE *outfile, const QccString s);
int QccFileReadLine(FILE
*infile, QccString s);
int QccFileSkipWhiteSpace(FILE *infile, int skip_comments_flag);
In reading and writing int and double values, the routines QccBinaryCharToInt(3) , QccBinaryIntToChar(3) , QccBinaryCharToFloat(3) , and QccBinaryFloatToChar(3) are used to ensure that the binary values are read/written from files in MSB-first order despite the byte ordering native to the machine. Thus, files produced by QccPack should be portable across different architectures. QccPack stores floating-point numbers in its files using 4 bytes (32-bit precision); hence QccFileWriteDouble() actually casts the double value to a float before writing and can therefore incur some precision loss. In each of the read routines, storage space pointed to by val must be allocated in the appropriate amount prior to calling the routine.
QccFileReadString() reads a QccString into s, which must be allocated prior to calling QccFileReadString(). The string is truncated to QCCSTRINGLEN characters to avoid overrunning s.
QccFileWriteString() writes a QccString.
QccFileReadLine() reads an entire line from infile, up to and including the newline character. The characters of the line, except for the newline character, are returned in the string s, with the line being truncated to QCCSTRINGLEN characters to avoid overrunning s.
QccFileSkipWhiteSpace() skips over white space and, if skip_comments_flag is nonzero, comment lines, in the input file. White space includes space, `\n' (newline), `\t' (tab), and `\r' (return) characters. A comment line is any line that starts with a `#', `*', or `/'. When QccFileSkipWhiteSpace() returns, the file is positioned to the next non-white-space character not on a comment line.