|
Automatic Index Header
The first 128 bytes of the index are as follows:
All values are given in decimal unless preceded
with "0x" for hexadecimal
| Offset |
Length |
Contents |
| 0 |
2 |
"0xC931" - filePro index magic
number |
| 2 |
16 |
The filePro file name |
| 18 |
64 |
Sort information -- see
below |
| 82 |
2 |
Index record length --
see below |
| 84 |
1 |
"1" - An automatic index |
| 85 |
1 |
"1" - internal flags |
| 86 |
4 |
Pointer to head of binary tree |
| 90 |
4 |
Pointer to head of freechain |
| 94 |
4 |
Number of records in the index |
| 98 |
30 |
"0" - reserved |
|

Index Record Length
The index record length is the length of the sort
key plus 13.

Sort Information
The sort information is the following 8 bytes
repeated 8 times - once for each possible sort key.
4.1 Automatic indexes use only the first entry
|
Offset
|
Length |
Contents |
| 0 |
2 |
The field number |
| 2 |
1 |
Associated field instance |
| 3 |
1 |
"0" - Used for
output formats only |
| 4 |
2 |
Field length
|
| 6 |
1 |
"0" for ascending, "1" for
descending
(Automatic indexes are always "0") |
| 7 |
1 |
Field type |
|

Index Entries
Starting at the 129th byte is an entry for each
record in the index:
| Offset |
Length |
Contents |
| 0 |
n |
The key |
| . |
1 |
Associated field instance
(@AF-1) or "0" if not an associated field |
| . |
4 |
Left node pointer (see below) |
| . |
4 |
Right node pointer (see below)
|
| . |
4 |
Record number |
|

Node Pointers
The format of the left and right node pointers
is:
| Bit |
Contents |
| 31 |
N |
| 30 |
B |
| 29 |
Record number |
| |
|
|
N (bit 31) is the level indicator.
It is set if this node points up the tree to the previous
(if left) or next (if right) record in sort order.
B (bit 30) is the "out-of-balance" flag.
It is set if this node is deeper than the other node.
Record number is the record number in the filePro
file.
|
|
|