/*
* $Id: global_bltin.h,v 1.6 2025/04/08 20:00:56 snw Exp $
* built-in global handler header
*
*
* Author: Serena Willis <snw@coherent-logic.com>
* Copyright (C) 1998 MUG Deutschland
* Copyright (C) 2020, 2025 Coherent Logic Development LLC
*
*
* This file is part of FreeM.
*
* FreeM is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FreeM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero Public License for more details.
*
* You should have received a copy of the GNU Affero Public License
* along with FreeM. If not, see <https://www.gnu.org/licenses/>.
*
* $Log: global_bltin.h,v $
* Revision 1.6 2025/04/08 20:00:56 snw
* Global handler now uses a header file and maintains the last journaling transaction ID
*
* 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
*
* Revision 1.3 2025/03/09 19:14:25 snw
* First phase of REUSE compliance and header reformat
*
*
* SPDX-FileCopyrightText: (C) 2025 Coherent Logic Development LLC
* SPDX-License-Identifier: AGPL-3.0-or-later
**/
#if !defined(__FREEM_GLOBAL_BLTIN_H)
# define __FREEM_GLOBAL_BLTIN_H
#include "version.h"
#define GBL_FORMAT_VERSION 2
#define GBL_MAGIC "FRMGL"
#define GBL_HDR_OK 0
#define GBL_HDR_NOTOPEN 1
#define GBL_HDR_BADMAGIC 2
#define GBL_HDR_BADVERSION 3
#define GBL_HDR_BADBLOCKSIZE 4
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];
char global_path[4096];
struct global_handle *next;
} global_handle;
extern global_handle *global_handles_head;
#endif
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>