lq-text: LQT_GetWordPlacesWhere

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 );

Purpose

Used to read the matches from disk for the given WID.

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.

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.

See Also:

Notes

This function is very low-level; normally, you should use LQT_Make­Matches or LQT_Make­Matches­Where instead.