lq-text: LQT_MakeWordInfoBlockHeader

LIBRARY void LQT_MakeWordInfoBlockHeader (db, WordInfo, pblock) t_LQTEXT_Database *db; t_WordInfo *WordInfo; t_pblock *pblock;

Purpose

Writes a database header block (a WIDindex entry) into the given WordInfo. This is split into a separate routine so that the library can write a word block header tentatively, using a different format for the header if the header and the data all fit into the index block. LQT_Make­Word­Info­Block­Header determines the format to use by whether WordInfo->Offset is non-zero. The difference is whether a fixed four bytes are used for the total number of word places for this word, or whether a variable number of bytes, using LQT_s­Write­Number, are written. In the latter case, update in place is not possible, and this format is therefore only used when WordInfo->Offset is zero, and any update would in any case have to read and rewrite the word index block.