lq-text: LQT_WriteBlock

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;

Purpose

Writes the given block to the database. Actually the block is saved in the cache, and if it was originally obtained with LQT_Read­Block it's already in the cache, so LQT_Write­Block simply marks it as dirty, needing to be saved. If you change data in a block without calling LQT_Write­Block, the changes usually won't be written to disk (unless an adjacent block in the cache is written).

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 <blkheader.h>.

Errors

Format or consistency errors are generally fatal. Attempting to write a block not in the cache will produce a warning.

See Also: