<!DOCTYPE File PUBLIC "-//Liam Quin//DTD C API Documentation v1.1//EN" "doc.dtd"><File>
<Entry dir="liblqtext">
<Function File="../../src/liblqtext/wpblock.c">
<Name>LQT_WriteWordPlaces</Name>
<Class>Database/Update, Database/Physical
<Purpose>
<P>Writes the given WordPlaces to disk.</P>
<P>The given LastStart argument should be zero if the given
Block pointer refers to data that is not to be stored in the
overflow file (`data').  This will be the case when the first few
matches are to be written into the widindex entry.  If the LastStart
argument is non-zero, it is the block number that will be passed as
an argument to LQT_WriteBlock to save the block when it is full.</P>
<P>The given NextOffset can either be zero or it can be the block
offset in the data overflow file of a block that has been allocated
using LQT_FindFreeBlock; in the latter case, the NextLength argument
is also passed on to LQT_WriteWordPlaces.</P>
<Returns>
<LIST>
<LI>the number of words added on success;
<LI>-1 if the file couldn't be opened.
</LIST>
<Notes>
<P>This routine is fairly low-level,
and is made available in the API for efficiency.
You should not attempt to use it without looking at examples in
the lq-text clients that update the database, and also reading
the source of the function itself.</P>
<Errors>
Warns if the file can't be opened.
</Function>
<Decl>
API unsigned long
LQT_WriteWordPlaces(
    db,
    WordPlaces,
    WID,
    LastStart,
    Block, DataStart, BlockLength,
    NextOffset, NextSize,
    NumberToWrite
)
    t_LQTEXT_Database *db;
    t_WordPlace *WordPlaces;
    t_WID WID;
    unsigned long LastStart;
    unsigned char *Block;
    unsigned char *DataStart;
    unsigned int BlockLength;
    unsigned long NextOffset;
    unsigned long NextSize;
    unsigned long NumberToWrite;
</Decl>
</Entry>
