lq-text: LQT_MakeFileInfo

API t_FileInfo * LQT_MakeFileInfo (db, FileName) t_LQTEXT_Database *db; char *FileName;

Purpose

Creates a t_FileInfo structure to describe the given FileName. This routine should only be used if you are going to add the given FileName to the given lq-text Database db; to get a FileInfo describing a file already in the index, use LQT_Name­To­FID and LQT_FIDTo­File­Info.

Returns

If the file is not already in the database, a new FID is allocated, and a newly malloc'd t_FileInfo object is returned, complete with a stdio FILE pointer already opened, either as a file or as a pipe, depending on the file type and filter table; it is the caller's responsibility to call LQT_Destroy­File­Info to free the memory and close the stdio stream.

On error, or if the file is already in the database and has not changed since it was last indexed, a warning is issued and a NULL pointer is returned.

Errors

If the file can't be found, or can't be opened, a warning is produced.

See Also: