<!DOCTYPE File PUBLIC "-//Liam Quin//DTD C API Documentation v1.1//EN" "doc.dtd"><File>
<Entry dir="liblqtext">
<Function File="../../src/liblqtext/rmatch.c">
<Name>LQT_StringToMatch</Name>
<Class>Input
<Purpose>
<P>Converts a string representation of a match to a t_Match object.
Leading and trailing white space on the line is ignored.</P>
<P>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.</P>
<P>If the FID is given as zero, there must be a filename, and this
is given as an argument to LQT_NameToFID to complete the FID entry
in the match.</P>
<Notes>
<P>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_StringToMatch.
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</P>
<P>A static internal buffer is retained containing the previous
result of LQT_NameToFID, for efficiency in the common case that
there are several matches in a row from the same document.</P>
<Returns>
<LIST>
    <LI>NULL if there was no error;
	in that case, *theMatchpp is set to either
	a pointer to a Match, or NULL if the line didn't
	contain a match.</LI>
    <LI>On error, a string describing the problem is returned.
</LIST>
</Function>
<Decl>
API char *
LQT_StringToMatch(db, Severity, theString, theMatchpp)
    t_LQTEXT_Database *db;
    int Severity;
    char *theString;
    t_MatchStart **theMatchpp;
</Decl>
</Entry>
