--- freem/src/global_bltin.h 2025/04/08 14:39:21 1.4 +++ freem/src/global_bltin.h 2025/04/08 16:46:11 1.5 @@ -1,5 +1,5 @@ /* - * $Id: global_bltin.h,v 1.4 2025/04/08 14:39:21 snw Exp $ + * $Id: global_bltin.h,v 1.5 2025/04/08 16:46:11 snw Exp $ * built-in global handler header * * @@ -24,6 +24,9 @@ * along with FreeM. If not, see . * * $Log: global_bltin.h,v $ + * Revision 1.5 2025/04/08 16:46:11 snw + * Add global file header and offsets + * * Revision 1.4 2025/04/08 14:39:21 snw * Initial work on global handler refactor * @@ -38,15 +41,36 @@ #if !defined(__FREEM_GLOBAL_BLTIN_H) # define __FREEM_GLOBAL_BLTIN_H +#include "version.h" + +#define GBL_FORMAT_VERSION 2 +#define GBL_MAGIC "FRMGL" + +typedef struct global_header { + + char magic[5]; /* FRMGL */ + int format_version; + char host_triplet[40]; + + unsigned long block_size; + unsigned long last_transaction_id; + + long created; + long last_backup; + +} global_header; + typedef struct global_handle { int fd; /* file descriptor */ + + global_header header; long use_count; /* how many times has it been accessed? */ long age; short opened; short locked; unsigned long last_block; - + short fast_path; char global_name[256];