<!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_ReadBlock</Name>
<Class>Database/Files, Database/Physical
<Purpose>
Reads the block at the given byte offset, and returns a pointer to
the data.  The data is stored in a cache, so it is important not
to try and write beyond the end of the block or group of blocks as
determined by LQT_ExtendBlock or LQT_FindFreeBlock.
The block must be written out with LQT_WriteBlock if it has changed.
In addition, the block is not locked in memory, but LQT_ReadBlock
ensures that it is safe to read at least one other block before
writing this one out with LQT_WriteBlock.
<Returns>
A pointer to the data
<Notes>
Attempts to read beyond the end of the data file will extend
the database automatically.
The data will be initialised to zero, except for the block headers,
whose NumberOfBlocks field will all be set to one.
<Errors>
Fatal error (E_BUG) if the database can't be opened or created.
<SeeAlso>
LQT_ExtendBlock
LQT_FindFreeBlock
LQT_WriteBlock
</Function>
<Decl>
API unsigned char *
LQT_ReadBlock(db, Offset, WID)
    t_LQTEXT_Database *db;
    unsigned long Offset;
    t_WID WID;
</Decl>
</Entry>
