<!DOCTYPE File PUBLIC "-//Liam Quin//DTD C API Documentation v1.1//EN" "doc.dtd"><File>
<Entry dir="liblqtext">
<Function File="../../src/liblqtext/rpblock.c">
<Name>LQT_GetWordPlacesWhere</Name>
<Class>Database/Retrieval, Database/Physical
<Purpose>
<P>Used to read the matches from disk for the given WID.</P>
<P>A WordPlace describes a single occurrence of a word.
Hence, if you call this function with the WID of `the', you'll
get back an array large enough to hold every occurrence of `the'
in the entire database.  The AcceptFunc argument is a function that
is called before each match is inserted into the array; it
can return either zero or one.  If it returns zero, the match is
not inserted into the array; this can save memory, and also allows
you to process the matches as they are read from disk, instead of
waiting for them all before doing anything with them.</P>
<P>The given Block argument is a pointer to an in-memory buffer holding
the first few bytes of data; usually this comes from the `widindex'
fixed record length file.</P>
<Notes>
<P>This function is very low-level; normally, you should use
LQT_MakeMatches or LQT_MakeMatchesWhere instead.</P>
<SeeAlso>
LQT_GetWordPlaces
LQT_GetpblockWhere
LQT_StringToPhrase
LQT_MakeMatchesWhere
</Function>
<Decl>
API t_WordPlace *
LQT_GetWordPlacesWhere(
    db,
    WID, Block, BlockLength,
    NextOffset,
    NumberExpected,
    AcceptFunc
)
    t_LQTEXT_Database *db;
    t_WID WID;
    unsigned char *Block;
    unsigned int BlockLength;
    unsigned long NextOffset;
    unsigned long *NumberExpected;
    int (* AcceptFunc)(
#ifdef HAVE_PROTO
	t_LQTEXT_Database *,
	t_WID,
	t_WordPlace *
#endif
    );
</Decl>
</Entry>
