API int
LQT_BlockIsCached
(db, Block)
t_LQTEXT_Database *db;
unsigned long Block;
Purpose
Determine whether the block at a given offset in the data file is in the block buffer cache or not. Since LQT_ReadBlock returns a pointer into the cache, it is a fatal error (E_BUG) if LQT_WriteBlock is called for a block that is not cached.
The cache is always large enough to hold at least the last two blocks returned by LQT_ReadBlock. This is just enough to ensure that the NextOffset field in a block's header can be filled in after allocating the next block in a chain.
Returns
Non-zero if the block is cached, and zero otherwise.
Errors
Fatal error if the main data file can't be opened or created.See Also: