dbinternal.h

Go to the documentation of this file.
00001 
00002 /*  $Id: dbinternal.h 355 2005-01-11 22:48:55Z andreradke $    */
00003 
00004 /******************************************************************************
00005 
00006     UserLand Frontier(tm) -- High performance Web content management,
00007     object database, system-level and Internet scripting environment,
00008     including source code editing and debugging.
00009 
00010     Copyright (C) 1992-2004 UserLand Software, Inc.
00011 
00012     This program is free software; you can redistribute it and/or modify
00013     it under the terms of the GNU General Public License as published by
00014     the Free Software Foundation; either version 2 of the License, or
00015     (at your option) any later version.
00016 
00017     This program is distributed in the hope that it will be useful,
00018     but WITHOUT ANY WARRANTY; without even the implied warranty of
00019     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020     GNU General Public License for more details.
00021 
00022     You should have received a copy of the GNU General Public License
00023     along with this program; if not, write to the Free Software
00024     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025 
00026 ******************************************************************************/
00027 
00028 #define dbinternalinclude
00029 
00030 
00031 #define SMART_DB_OPENING    1
00032 //#undef SMART_DB_OPENING
00033 
00034 
00035 //RAB   #define dbversionnumber 3 /**VERSION used in 4.x**/
00036 
00037 //AR    #define dbversionnumber 5 /**VERSION used up to 6.2a10**/
00038 
00039 #ifdef SMART_DB_OPENING
00040     #define dbversionnumber 6 /* 6.2a9 AR: added caching of shadow avail list in last block of database */
00041     #define dbfirstversionwithcachedshadowavaillist 6 /* 6.2a11 AR */
00042 #else
00043     #define dbversionnumber 5 
00044 #endif
00045 
00046 #define dbversionnumberminor 0
00047 
00048 
00049 #define dbsystemidMac   0
00050 
00051 #define dbsystemidWin32 1
00052 
00053 
00054 #define minblocksize 32L
00055 #define sizeheader (long)sizeof(tyheader)
00056 #define sizetrailer (long)sizeof(tytrailer)
00057 #define firstphysicaladdress (long)sizeof(tydatabaserecord)
00058 
00059 
00060 typedef enum {
00061     dbdirtymask     = 0x0001
00062     } tydbflagmask;
00063 
00064 
00065 typedef long tyvariance;
00066 
00067 
00068 typedef struct tysizefreeword {
00069     
00070 //  unsigned long flfree: 1;
00071     
00072 //  unsigned long size: 31;
00073     long size;
00074     } tysizefreeword;
00075 
00076 
00077 typedef struct tyheader {
00078 
00079     tysizefreeword sizefreeword;
00080     
00081     tyvariance variance;
00082     } tyheader, *ptrheader, **hdlheader;
00083     
00084     
00085 typedef struct tytrailer {
00086 
00087     tysizefreeword sizefreeword;
00088     } tytrailer, *ptrtrailer, **hdltrailer;
00089 
00090 
00091 #define dbshadow
00092 
00093 typedef struct availnodeshadow {
00094     
00095     dbaddress adr;
00096     
00097     long size;
00098     // next record in this array is the next free block
00099     } tyavailnodeshadow, ** hdlavaillistshadow;
00100 
00101 
00102 /*prototypes*/
00103 
00104 extern boolean dbgeteof (long *);
00105 
00106 extern boolean dbreadtrailer (dbaddress, boolean *, long *);
00107 
00108 extern boolean dbreadheader (dbaddress, boolean *, long *, tyvariance *);
00109 
00110 extern boolean dbreadavailnode (dbaddress, boolean *, long *, dbaddress *);
00111 
00112 
00113 

Generated on Wed May 31 18:19:46 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6