Indexes
Index Roots
Index root objects are created when index is created.
Link points to first index object - when index is emty link contains 0x00000000. Type declare type of index. Currently I verified following codes:
- String: 0 Int: 1 Char: 2 Real: 3 Symbol: 4 * MultiSlot: 6
Class is either 1 for normal indexes, or 5 for tags indexes. Uninitialized index has class 0, and there is no index blocks (link is 0x00000000). Origin is 0 for system created indexes, and 2 for user created.
For multislot indexes, each nibble in multitypes declare type of index entry slot, and each bit in MSO declares sorting order: 0 is descending, 1 is ascending.
Remaining data is usually 0x000000, or 0x010000 for descending indexes.
One exception is soup index. Although index is a standard string index, it's index root object contains something else in last 8 bytes.
Index Block
Indexes are build of multiple blocks. First block is pointed at by index root object, then there are links to next and previous blocks.
Total length of every index entry is in field Size - including field ize itself. Index entries are not sorted, but references to them in offset table are (at least in single index block). To get offset of entry, you need to subtract value of field Base. This is probably used to sort entries between multiple index blocks, but I haven't verified that yet.
Every entry has a flag before Size. When it's 0x0, this is normal index entry, when 0x4 index entry points to multiple entries - number of grouped entries is stored in field count.
Different types of indexes have different layouts of index data.
Char Index
Well, just two bytes for unicode char.
Integer Index
Data field contain integer itself.
Real Index
Nothing fancy, eight bytes for real.
String Index
Data fields of string index start with two bytes containing string length in bytes. After that UTF-16 string is placed.
Symbol Index
First there is length of symbol in bytes, then symbol itself.
Tags Index
This one looks like normal integer index, 4 bytes per entry data.

