From 1e389d8d4cfb0d9104a632fbf4af9e59b9ed19f7 Mon Sep 17 00:00:00 2001 From: brianb Date: Wed, 22 Mar 2000 02:07:34 +0000 Subject: [PATCH] Jet version detection from trevor@harrison.org Update to HACKERS file with (sparce) information about indexes. --- AUTHORS | 2 ++ HACKERS | 13 +++++++++---- src/include/mdbtools.h | 6 ++++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/AUTHORS b/AUTHORS index 4201b64..44fdd03 100644 --- a/AUTHORS +++ b/AUTHORS @@ -5,3 +5,5 @@ Karl Nyberg Georg Bauer Carl Seutter + +Trevor Harrison diff --git a/HACKERS b/HACKERS index 14c9293..37e3f49 100644 --- a/HACKERS +++ b/HACKERS @@ -114,18 +114,18 @@ The header to table definition pages start look something like this: | ???? | 2 bytes | generally same as # of cols but not always | | ???? | 2 bytes | ??? | | ???? | 2 bytes | number of columns in table | -| ???? | 4 bytes | number of data pages in table | -| ???? | 4 bytes | number of data pages in table (repeat) | +| ???? | 4 bytes | number of indexes for this table | +| ???? | 4 bytes | number of indexes for this table (repeat) | | 0x00 | 1 byte | ??? | | ???? | 2 bytes | page number of first datapage for table | | ???? | 2 bytes | ??? | | ???? | 2 bytes | page number of first datapage for table | | 0x00 | 1 byte | ??? | +-------------------------------------------------------------------------+ -| Iterate for the 2 x number of datapages | +| Iterate for the 2 x number of indexes | +-------------------------------------------------------------------------+ | ???? | 4 bytes | number of rows in table | -| ???? | 4 bytes | ??? | +| ???? | 4 bytes | number of rows in the index | +-------------------------------------------------------------------------+ The next few bytes are somewhat of a mystery right now, but around 0x2B from @@ -154,6 +154,11 @@ Column Type may be one of the following (not complete). Following the 18 byte column records begins the column names, listed in order with a 1 byte size prefix preceding each name. +After a number of bytes (generally 0x3a) the names of the indexes are listed. + +It is currently unknown how indexes are mapped to columns and how they point at +index pages or the format of the index pages. + Data Rows --------- diff --git a/src/include/mdbtools.h b/src/include/mdbtools.h index c680fa9..57bc474 100644 --- a/src/include/mdbtools.h +++ b/src/include/mdbtools.h @@ -34,6 +34,10 @@ #define MDB_CATALOG_PG 18 #define MDB_MEMO_OVERHEAD 12 +enum { + MDB_VER_JET3 = 0, + MDB_VER_JET4 = 1 +}; enum { MDB_FORM = 0, MDB_TABLE, @@ -73,6 +77,8 @@ typedef struct { int num_catalog; GArray *catalog; int pg_size; + guint32 jet_version; + guint32 db_key; } MdbHandle; typedef struct {