2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: trxlog.h /main/2 1996/05/09 04:20:43 drk $ */
25 * COMPONENT_NAME: austext
27 * FUNCTIONS: BITMAP_SIZE
37 /* ********************** EDIT HISTORY *******************************
39 SCR DATE INI DESCRIPTION
40 ----- --------- --- -----------------------------------------------------
41 611 21-Feb-89 RSC The defn of BUI for unix and vms needs parenthesis
45 /* trxlog.h - header file to define structures, constants, etc. for the
46 memory cache overflow and transaction log file control
47 ==========================================================================
50 The following constants control the functioning of the cache overflow
51 and transaction logging processes
53 BUI The number of bits in an unsigned int
54 IX_PAGESIZE The size (in bytes) of an index page
55 IX_EPP The number of entries that will fit on an index page
56 BITMAP_SIZE The size of the index bitmap (in unsigned int units)
57 IX_SIZE The number of index pages needed to control the db pages
58 OADDR_OF_IXP Calculates the overflow file address of an index page #
60 ==========================================================================
62 /* (BITS(unsigned int)) */
63 #define BUI (8*sizeof(unsigned int))
66 /* ((((256*sizeof(F_ADDR))+D_BLKSZ-1) / D_BLKSZ)*D_BLKSZ) */
67 #define IX_PAGESIZE 1024
69 /* (IX_PAGESIZE / sizeof(F_ADDR)) */
72 #define BITMAP_SIZE(pcnt) ((int)((IX_SIZE(pcnt)+(BUI-1)) / BUI))
74 #define IX_SIZE(pcnt) ((long)( ((pcnt) + (IX_EPP-1)) / IX_EPP))
76 /* Next define the base file offsets for entries in the overflow file */
78 #define BM_BASE( file ) ( root_ix[file].base )
79 #define IX_BASE(file, pcnt) ((long)(BM_BASE(file) + (BITMAP_SIZE(pcnt)*sizeof(unsigned int))))
80 #define PZ_BASE(file, pcnt) ((long)(IX_BASE(file, pcnt) + (IX_SIZE(pcnt)*IX_PAGESIZE)))
83 ==========================================================================
86 /* The following typedef'ed structure defines a single entry in the
89 typedef struct RI_ENTRY_S {
90 LONG pg_cnt; /* Number of pages currently in file */
91 F_ADDR base; /* Base of data stored in overflow */
92 BOOLEAN pz_modified; /* Was page zero written to overflow? */
93 INT_P Bitmap; /* Used index page bitmap */
95 #define bitmap Bitmap.ptr
96 #define RI_ENTRY_IOSIZE (sizeof(RI_ENTRY)-sizeof(INT_P)+sizeof(INT *))
100 ==========================================================================
103 /* page zero table entry */
104 #define PGZEROSZ (2*sizeof(F_ADDR)+sizeof(ULONG))
105 typedef struct PGZERO_S {
106 F_ADDR pz_dchain; /* delete chain pointer */
107 F_ADDR pz_next; /* next available record number */
108 ULONG pz_timestamp; /* file's timestamp value */
109 BOOLEAN pz_modified; /* TRUE if page zero has been modified */
112 /* binary search lookup table entry */
115 /* External declarations */
116 extern int trlog_flag; /* Transaction logging enabled flag */
117 extern int trcommit; /* Transaction commit in progress flag */
118 extern BOOLEAN use_ovfl; /* Do we use the overflow file ? */
121 /* Maximum number of transactions which can commit a time */
130 /* vpp -nOS2 -dUNIX -nBSD -nVANILLA_BSD -nVMS -nMEMLOCK -nWINDOWS -nFAR_ALLOC -f/usr/users/master/config/nonwin trxlog.h */