Subject Re: [IBDI] File format
Author Ann W. Harrison
At 04:26 PM 12/6/2001 +0000, Peter Morris wrote:

>I have tried to work out as best I can the format of interbase / firebird
>file headers.
>I have included this in a small article but I am unsure as to how to
>determine where the filename for the next file starts.

The file header page has a fixed section which you seem to have
understood. It also has a variable portion which has this format
<tag><length><value>. This is a very common construct in Firebird -
it's used in info calls, the various parameter blocks and probably
other places I'm not thinking about at the moment. The header
pages from secondary files are very degenerate.


Here's the code from ods.h

/* Data items have the format

<type_byte> <length_byte> <data...>

#define HDR_end 0
#define HDR_root_file_name 1 /* Original name of root file */
#define HDR_journal_server 2 /* Name of journal server */
#define HDR_file 3 /* Secondary file */
#define HDR_last_page 4 /* Last logical page number of file */
#define HDR_unlicensed 5 /* Count of unlicensed activity */
#define HDR_sweep_interval 6 /* Transactions between sweeps */
#define HDR_log_name 7 /* replay log name */
#define HDR_journal_file 8 /* Intermediate journal file */
#define HDR_password_file_key 9 /* Key to compare to password db */
#define HDR_backup_info 10 /* WAL backup information */
#define HDR_cache_file 11 /* Shared cache file */
#define HDR_max 11 /* Maximum HDR_clump value */


We have answers.