<!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_WriteBlock</Name>
<Class>Database/Files, Database/Physical
<Purpose><P>
Writes the given block to the database.  Actually the block is
saved in the cache, and if it was originally obtained with
LQT_ReadBlock it's already in the cache, so LQT_WriteBlock simply
marks it as dirty, needing to be saved.  If you change data in a
block without calling LQT_WriteBlock, the changes usually won't be
written to disk (unless an adjacent block in the cache is written).
</P>
<P>The block must have a valid header; if the block's length field is
larger than the Length argument, the extra blocks are marked as free.
The header is described in <h>blkheader.h</h>.
</P>
<Errors>
Format or consistency errors are generally fatal.
Attempting to write a block not in the cache will produce a warning.
<SeeAlso>
LQT_FindFreeBlock
LQT_ReadBlock
LQT_WriteBlock
</Function>
<Decl>
API void
#ifdef ASCIITRACE
LQTp_WriteBlock(db, theFile, theLine, Block, Data, Length, theWID)
    t_LQTEXT_Database *db;
    char *theFile;
    int theLine;
#else
LQT_WriteBlock(db, Block, Data, Length, theWID)
    t_LQTEXT_Database *db;
#endif
    unsigned long Block;
    unsigned char *Data;
    int Length;
    t_WID theWID;
</Decl>
</Entry>
