tldm-universe/Ardent/UV/gcidir/include/filehdr.h

250 lines
9.4 KiB
C
Raw Permalink Normal View History

2024-09-09 21:51:08 +00:00
#ifndef h_filehdr
#define h_filehdr
/******************************************************************************
*
* Declarations for UniVerse hashed file header
*
* Module %M% Version %I% Date %H%
*
* (c) Copyright 1998 Ardent Software Inc. - All Rights Reserved
* This is unpublished proprietary source code of Ardent Software Inc.
* The copyright notice above does not evidence any actual or intented
* publication of such source code.
*
*******************************************************************************
*
* Maintenence log - insert most recent change descriptions at top
*
* Date.... GTAR# WHO Description.........................................
* 08/10/99 25046 JBG New Rev 4 SICA for longer NLS schema,table names
* 04/23/99 24749 GMH Add comments
* 04/20/99 24729 RGA re-fix DBHMASK for 8-byte platforms.
* 04/13/99 24729 RGA Fix DBFMASH for 4-byte platforms.
* 04/09/99 24480 GMH Renumber FH_UVREADONLY, BAKFLGS, BAKCNT
* 04/07/99 24729 RGA Use an 8-byte DBHMASK on 64bit platforms.
* 03/19/99 24480 RGA Change DBFMASK to 0c instead of 0b.
* 02/26/99 24480 GMH Add FH_STATALL and FH_T30INFOALL
* 10/14/98 23801 SAP Change copyrights.
* 10/07/98 23673 GMH Lower revision level
* 10/02/98 22647 GMH Fix leading zeroes
* 10/02/98 23673 GMH Up revision level
* 09/28/98 23672 GMH Add file type
* 09/17/98 23673 GMH Add support for new file header
* 09/09/98 22467 GMH Fix ovlink macros, move dbitem macros to DBFILE.h
* 09/08/98 22647 GMH Remove EXTERN, add EXTERNs
* 09/07/98 22647 GMH Add subscript
* 09/07/98 22647 GMH Move FH_OFFSETS table to start_com.c
* 09/07/98 22647 GMH Fix compilation errors
* 09/01/98 22647 GMH Add definitions for new header routines
* 07/02/98 16692 GMH Remove old stuff, comment, add Clrfiltime offset
* 05/12/98 22647 LPC Reconfigure header for 64-bit file support.
*
*****************************************************************************/
/* UniVerse file revision levels */
/* NOTE: The actual revision level is the last two digits. */
/* For example: 0x0000010b is file revision level 0b. The */
/* 01 in front denotes a 32-bit file, a 02 will denote a */
/* 64-bit file (which will be changed by a mask when the */
/* file is created or resized. */
#define DBF0100 0x00000100 /* original file format */
#define DBF0101 0x00000101 /* fixed header size */
#define DBF0102 0x00000102 /* fix hash type 7 bug */
#define DBF0103 0x00000103 /* reduce header more */
#define DBF0104 0x00000104 /* change type 30 largerec */
#define DBF0105 0x00000105 /* change header size - min 1K */
#define DBF0106 0x00000106 /* even sep, header = sep */
#define DBF0107 0x00000107 /* newstyle item padding */
#define DBF0108 0x00000108 /* gnustyle item padding */
#define DBF0109 0x00000109 /* PI/open cnvtd files, separations 2&6 */
#define DBF010a 0x0000010a /* freechain's freeflag check */
#define DBF010b 0x0000010b /* NLS sort local info - last of old style header */
#define DBF010c 0x0000010c /* new style header with long addr support */
#define DBFMASK 0xacef010c /* this is current tag */
#define DBFLOGV 0xaccc0001 /* Revision number of Transaction logs */
#define DBFSICA 0xacef0004 /* Revision number of sica 25046 */
/* Rev 4, 95C: longer NLS schema,table names */
/* Various masks */
#define DBFMOK 0xacef0000
#define DBFREV 0x0000ffff
#define DBUMASK 0x3fff0000
#if IS_64BIT_ADDR == 1
#define DBHMASK 0x000000007fffffff
#else
#define DBHMASK 0x7fffffff
#endif
#define DBWMASK 0x80000000
#define DBLMASK 0x00008000
#define DBRMASK 0x00007fff
#define DBSMASK 0x80007fff
#define DBUPLUS 0x00010000
#define DBCMASK 0xc000ffff
#define DBXMASK 0x0fffffff
#define DXEMASK 0x0000000f /* mask to check index enable disable status */
#define DSEMASK 0x000000f0 /* mask to check stats enable disable status */
#define DBCLRFS 0xacef00ff /* mask to clear file system bits */
#define DBFIL64 0x00000200 /* mask to make file 64-bit */
/* Distributed File masks */
#define DF001 0x00000001 /* original Distributed File format */
#define DFmask 0xacedf001 /* current Distributed File tag */
#define DFmok 0xacedf000
#define DFrev 0x00000fff
/* Header size minimum */
#define MIN_HEADER_SIZE 1024 /* Smallest header size supported */
/* 32-bit file header offsets */
#define Idxoff 20 /* offset to index flags */
#define rszname 24 /* concurrent resize path */
#define T30data 92 /* offset to t30 data area */
#define Dstatoff 128 /* offset to FILE.USAGE stats */
#define Tstmpoff (Dstatoff + 14*sizeof(int)) /* offset to FILE.USAGE timestamp */
#define Clrfiltime 364 /* Time of last clearfile operation */
#define Bakoffset 368 /* offset to uvbackup elements */
#define UVreadonly 380 /* offset of readonly flag */
#define Idxname 384 /* offset of AK directory path */
#define Idxnln 128 /* max length of AK directory path */
#define TLfilnum 276 /* Active transaction file number */
#define pTLfilnum 280 /* Permanent Transaction logging file number */
#define TLflags 284 /* Inconsistent */
#define Chkpoint 288 /* Checkpoint value */
#define TXwarmLSN 292 /* Eight bytes long */
#define NLSmapcsum 300 /* Checksum of NLS map name */
#define NLSmapname 304 /* NLS map name: 32 bytes long */
#define NLSsortcsum 200 /* 4 bytes for checksum of the NLSsort locale maps */
#define NLSsortmap 204 /* 32 bytes for the name of the NLSsort locale */
#define UVSicadata 512 /* Pointer to sicablock */
#define MKDBSTAMP 516 /* time stamp from mkdbfile */
#define Partblock 520 /* Pointer to partblock */
#define UVSchema 524 /* UVSchema is the name of the schema.VOC only - 20 chars */
#define SQLidxmap 544 /* 8 bytes long */
#define UDRflags 552 /* UDR flags 4 bytes long */
#define UDRunique 556 /* UDR unique ID 4 bytes long */
/* 64-bit file header offsets */
#define FileModulus 4
#define FileSeparation 12
#define FileType 16
#define FreeChain 24
#define T30data64 32
#define UVSicadata64 84
#define Partblock64 92
#define rszname64 560
/* These are the current bits that are used within the idxoff word
** within a file header. Also, 0x4 thru 0x40 are used exclusively
** within Type25 files.
*/
#define Idx_disabled 0x01 /* Indices are NOT updated */
#define Idx_outadate 0x02 /* Indices out of sync with data file */
#define Idx_ritejust 0x04 /* Index is right justified */
#define Idx_knowjust 0x08 /* Index was created by CREATE.INDEX */
#define Idx_unique 0x10 /* Index is UNIQUE */
#define Idx_numeric 0x20 /* DBfindt25() to use compare() function */
#define Idx_sqlitype 0x40 /* DBfindt25() to use sqlcmp() function */
#define Idx_multpart 0x80 /* Use all parts of a mulit-part index */
/* file read-only flag */
#define SQLCatalog 1
/* DEFAULT value of Incremental Backup Bits */
#define RRbackup 0x0003
/* Macros */
#define SET_FILE64( x ) { x = ( x & DBCLRFS ) | DBFIL64; }
/* These are the values of the DBFILE structure member 'addr_support'
** that is set by the DBopen function. This structure member defines
** the size of addresses, either 32- or 64-bit, that are used within
** both the DBITEM structure and the uniVerse file header.
**
** The values are also used as indexes into the global FH_OFFSETS table,
** which defines the offset locations of uniVerse file header elements.
**
** These values should NOT be changed without modifying the FH_OFFSETS
** table.
*/
#define OLD32 1
#define NEW32 3
#define NEW64 5
/* The following define the mnemonic names to be used as row offsets
** into the FH_OFFSETS table (in hdroffsets.h). Gaps are left within
** the sequence to allow for future use of unused header area.
**
** NOTE: if you add or change these #define's, you must also modify
** the corresponding entry in FILEINFO.H, so that the BASIC
** run machine utilizes the same values.
*/
#define FH_REVISION 0
#define FH_MODULUS 1
#define FH_SEPARATION 2
#define FH_FILETYPE 3
#define FH_INDEXFLAGS 4
#define FH_FREECHAIN 5
#define FH_T30INFOALL 6
#define FH_T30TYPE 7
#define FH_T30SPLIT 8
#define FH_T30MERGE 9
#define FH_T30CURMOD 10
#define FH_T30BASEMOD 11
#define FH_T30LARGEREC 12
#define FH_T30CURRLOAD 13
#define FH_T30SELECTCNT 14
#define FH_T30NEXTSPLIT 15
#define FH_SICADATA 16
#define FH_PARTBLOCK 17
#define FH_STATALL 29
#define FH_STAT01 30
#define FH_STAT02 31
#define FH_STAT03 32
#define FH_STAT04 33
#define FH_STAT05 34
#define FH_STAT06 35
#define FH_STAT07 36
#define FH_STAT08 37
#define FH_STAT09 38
#define FH_STAT10 39
#define FH_STAT11 40
#define FH_STAT12 41
#define FH_STAT13 42
#define FH_STAT14 43
#define FH_STAT15 44
#define FH_STAT16 45
#define FH_STAT17 46
#define FH_STAT18 47
#define FH_NLSSORTCUM 48
#define FH_NLSSORTMAP 49
#define FH_TLFILNUM 60
#define FH_pTLFILNUM 61
#define FH_TLFLAGS 62
#define FH_CHKPOINT 63
#define FH_TXWARMLSN 64
#define FH_NLSMAPCSUM 65
#define FH_NLSMAPNAME 66
#define FH_CLEARTIME 80
#define FH_BAKTIME 81
#define FH_BAKFLGS 82
#define FH_BAKCNT 83
#define FH_INDEXPATH 85
#define FH_MKDBSTAMP 87
#define FH_UVREADONLY 88
#define FH_UVSCHEMA 89
#define FH_IDXCOLCNT 90
#define FH_IDXCOLMAP 91
#define FH_UDRFLAGS 92
#define FH_UDRUNIQUE 93
#define FH_RESIZEPATH 94
#define TYPE1_FILE 1
#define TYPE19_FILE 19
#define BTREE_FILE 25
#define DISTRIBUTED_FILE 27
#define DYNAMIC_FILE 30
#define VIEW_FILE 41
#endif