<!DOCTYPE File PUBLIC "-//Liam Quin//DTD C API Documentation v1.1//EN" "doc.dtd"><File>
<Entry dir="liblqtext">
<Function File="../../src/liblqtext/pbcache.c">
<Name>LQT_SetBlockStatus</Name>
<Class>Database/Physical
<Purpose>
<P>Set the status of the block at a given byte offset in the
data file.</P>
<P>Status must be either SET_BLOCK_AS_USED or SET_BLOCK_AS_FREE.
In the former (USED) case, the block is marked as being in use,
and can be brought into the cache with LQT_ReadBlock.
In the latter case (FREE), the block is marked as being available
for reuse.  Since LQT_SetBlockStatus does not access the actual
data, it does not have access to the block's length.  It is
therefore the caller's responsibility to call LQT_SetBlockstatus
for each contiguous block when a block header's NumberOfBlock
field is greater than one.</P>
<Notes>
This routine was called 2,785,338 times when indexing Shakespeare's
complete works.  To try and speed things up, LQT_SetBlockstatus
performs as few checks as possible.
<SeeAlso>
LQT_BlockIsFree
</Function>
<Decl>
API void
LQT_SetBlockStatus(db, Offset, Status)
    t_LQTEXT_Database *db;
    unsigned long Offset;
    int Status;
</Decl>
</Entry>
