Layout of the index-section of an encyclopodia eBook-File

Version: 0.9
Copyright (c) 2005 Robert Bamler <Robert dot Bamler (a) gmx dot de>


The index-section of an encyclopodia ebook consists of a sequence of bz2-compressed blocks. Each of these blocks is a valid bz2-file. The first block contains the toplevel index all following blocks (there may be zero of them) are subtocs.

Annotated example

The layout of the index-section is best described with an example. The following should be easily understandable. If you have any questions, please send me an

"TOC" magic word
04 length of addresses of blocks that appear in this block
02 length of block offsets that appear in this block
02 length of wordlength-descriptors that appear in this block
FF beginning of a list
00 type of list: overview
01 xxxxxxxx address of the block containing the list of authors
FF beginning of a new list
01 type of list: index of the index-section
FE 00 01 the following keywords have length 1
'a' xxxxxxxx address of the block containing a part of the index beginning with article 'a'
FE 00 03 The following keywords have length 3
'asd' xxxxxxxx address of the block containing a part of the index beginning with article 'asd'
'qwe' xxxxxxxx address of the block containing a part of the index beginning with article 'qwe'
FF end of list

---- new block ----

"SUBTOC" magic word
04 length of addresses of blocks that appear in this block
02 length of block offsets that appear in this block
02 length of wordlength-descriptors that appear in this block
FF beginning of a list
02 type of list: index to articles
FD xxxxxx address of block containing the following articles
FE 00 01 the following keywords have length 1
'a' FE xxxx offset of the article 'a' within the block
'b' FE xxxx offset of the article 'b' within the block
FD xxxxxx address of block containing the following articles
'c' FE xxxx offset of the article 'b' within the block
FE 00 02 the following keywords have length 2
'aa' FE xxxx offset of the article 'aa' within the block
FF end of list

---- new block ----

"SUBTOC" magic word
04 length of addresses of blocks that appear in this block
02 length of block offsets that appear in this block
02 length of wordlength-descriptors that appear in this block
FF beginning of a list
02 type of list: index to articles
FD xxxxxx address of block containing the following articles
FE 00 03 the following keywords have length 1
'asd' FE xxxx offset of the article 'asd' within the block
'bad' FE xxxx offset of the article 'bad' within the block
FF end of list

---- new block ----

"SUBTOC" magic word
04 length of addresses of blocks that appear in this block
02 length of block offsets that appear in this block
02 length of wordlength-descriptors that appear in this block
FF beginning of a list
02 type of list: index to articles
FD xxxxxx address of block containing the following articles
FE 00 03 the following keywords have length 1
'qwe' FE xxxx offset of the article 'qwe' within the block
'sad' FE xxxx offset of the article 'sad' within the block
FF end of list

In the article keywords, the following substitiutions are performed: FF -> FC0F; FE -> FC0E; FD -> FC0D; FC -> FC0C

after performing these substitutions, the articles are sorted (1) by ther length and (2) alphabetically

Block addresses are given in bytes from the end of the file (this way, the size of the meta-information-section doesn't have any effect; Offsets of articles within a block are given in bytes from the beginning of the block (obviously, the number referes to the amount of uncompressed bytes bevore the article).


Copyright (c) 2005 Robert Bamler <Robert dot Bamler (a) gmx dot de>
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is available here.

"Apple" and "iPod" are registered trademarks of Apple Computer, Inc.