lq-text: LQT_SetBlockStatus

API void LQT_SetBlockStatus (db, Offset, Status) t_LQTEXT_Database *db; unsigned long Offset; int Status;

Purpose

Set the status of the block at a given byte offset in the data file.

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_Read­Block. In the latter case (FREE), the block is marked as being available for reuse. Since LQT_Set­Block­Status 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.

See Also:

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.