lq-text: LQT_StringToMatch

API char * LQT_StringToMatch (db, Severity, theString, theMatchpp) t_LQTEXT_Database *db; int Severity; char *theString; t_MatchStart **theMatchpp;

Purpose

Converts a string representation of a match to a t_Match object. Leading and trailing white space on the line is ignored.

The match is considered to consist of a number of ASCII decimal numbers followed by a file name. The numbers are, in this order, the number of words matched, the block within the file, the word within the block, and the File Identifier (t_FID). There may be an optional filename after the FID.

If the FID is given as zero, there must be a filename, and this is given as an argument to LQT_Name­To­FID to complete the FID entry in the match.

Returns

Notes

The returned Match is contained in a static buffer and should not be freed or overwritten. You must make a copy if you need to retain the information over successive calls to LQT_String­To­Match. The FileName field of the Match will point either into the middle of the given string, or to an internal static buffer, or, in the case that the given FID was invalid, will be NULL

A static internal buffer is retained containing the previous result of LQT_Name­To­FID, for efficiency in the common case that there are several matches in a row from the same document.