8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-30 09:23:09 +01:00
firebird-mirror/src/jrd/msg.h

72 lines
2.1 KiB
C
Raw Normal View History

2001-05-23 15:26:42 +02:00
/*
* PROGRAM: JRD Access Method
* MODULE: msg.h
* DESCRIPTION: Message system definitions
*
* The contents of this file are subject to the Interbase Public
* License Version 1.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy
* of the License at http://www.Inprise.com/IPL.html
*
* Software distributed under the License is distributed on an
* "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
* or implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code was created by Inprise Corporation
* and its predecessors. Portions created by Inprise Corporation are
* Copyright (C) Inprise Corporation.
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
*/
/*
2007-04-11 18:05:40 +02:00
$Id: msg.h,v 1.9 2007-04-11 16:05:15 alexpeshkoff Exp $
2001-05-23 15:26:42 +02:00
*/
#ifndef JRD_MSG_H
#define JRD_MSG_H
2001-05-23 15:26:42 +02:00
#define MSG_NUMBER(facility, code) ((SLONG) facility * 10000 + code)
const USHORT MSG_BUCKET = 1024;
const UCHAR MSG_MAJOR_VERSION = 1;
2007-04-11 18:05:40 +02:00
// trick to silence the compiler when FB_MSG_MINOR_VERSION is 0
#define FB_MSG_MINOR_VERSION 0
const UCHAR MSG_MINOR_VERSION = FB_MSG_MINOR_VERSION;
2001-05-23 15:26:42 +02:00
/* Message file header block */
2004-05-24 19:31:47 +02:00
struct isc_msghdr {
UCHAR msghdr_major_version; // Version number
UCHAR msghdr_minor_version; // Version number
USHORT msghdr_bucket_size; // Bucket size of B-tree
ULONG msghdr_top_tree; // Start address of first index bucket
ULONG msghdr_origin; // Origin for data records, unused.
USHORT msghdr_levels; // Levels in tree
2004-05-24 19:31:47 +02:00
};
typedef isc_msghdr ISC_MSGHDR;
2001-05-23 15:26:42 +02:00
/* Index node */
2004-05-24 19:31:47 +02:00
struct msgnod {
2001-05-23 15:26:42 +02:00
ULONG msgnod_code; /* Message code */
ULONG msgnod_seek; /* Offset of next bucket or message */
2004-05-24 19:31:47 +02:00
};
2001-05-23 15:26:42 +02:00
/* Leaf node */
2004-05-24 19:31:47 +02:00
struct msgrec {
2001-05-23 15:26:42 +02:00
ULONG msgrec_code; /* Message code */
USHORT msgrec_length; /* Length of message text */
USHORT msgrec_flags; /* Misc flags */
TEXT msgrec_text[1]; /* Text of message */
2004-05-24 19:31:47 +02:00
};
typedef msgrec *MSGREC;
2001-05-23 15:26:42 +02:00
#define NEXT_LEAF(leaf) (MSGREC) \
((SCHAR*) leaf + FB_ALIGN(OFFSETA (MSGREC, msgrec_text) + leaf->msgrec_length, sizeof (SLONG)))
#endif /* JRD_MSG_H */