int QccFileReadMagicNumber(FILE
*infile, QccString magic_num, int *major_version_number, int *minor_version_number);
int QccFileWriteMagicNumber(FILE *outfile, const QccString magic_num);
int QccFileGetMagicNumber(const QccString filename, QccString magic_num);
int QccFileWriteMagicNumberVersion(FILE *outfile, const QccString magic_num,
int major_version_number, int minor_version_number);
int QccFilePrintFileInfo(const
QccString filename, const QccString magic_num, int major_version, int
minor_version);
QccFileReadMagicNumber() reads the magic number and version information from the header of infile. The magic number, the major version number, and the minor version number are returned in locations pointed to by magic_num, major_version_number, and minor_version_number, respectively. Space in which to store the magic number and the two version numbers must be allocated prior to calling QccFileReadMagicNumber(). Also, infile must already be positioned to the start of file (via a prior call to QccFileOpen(3) , for example), as the magic number and version information is stored at the start of the file.
QccFileWriteMagicNumber() writes the magic number, as given by magic_num, and the version information, as returned by QccGetQccPackVersion(3) , to the start of outfile. It is assumed that outfile is already open and positioned to the start of the file (via a prior call to QccFileOpen(3) ). QccFileWriteMagicNumberVersion() does the same as QccFileWriteMagicNumber() except that major_version_number, and minor_version_number allow the explicit specification of the version number to appear in the file header.
QccFileGetMagicNumber() is similar to QccFileReadMagicNumber(), except that the file whose name is filename is examined, and its magic number (magic number only, no version numbers) is returned in magic_num.
QccFilePrintFileInfo() accepts a filename, a magic_num, and two version numbers, major_version and minor_version. This information, along with the the file size and modtime (from QccFileGetSize(3) and QccFileGetModTime(3) , respectively), is printed to stdout in a nice, attractive banner.