00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include <eyedbsm/eyedbsm.h>
00026 #include <transaction.h>
00027
00028 namespace eyedbsm {
00029 struct HashTable {
00030 #ifdef TRS_SECURE
00031 eyedblib::uint32 magic;
00032 #endif
00033 unsigned int cnt;
00034 unsigned int mask;
00035 #ifdef KEEP_ORDER
00036 XMOffset xfirst, xlast;
00037 #endif
00038 XMOffset offs[1];
00039 };
00040
00041 #define HashTableSize(COUNT) \
00042 (sizeof(HashTable) + ((COUNT)-1) * sizeof(XMOffset))
00043
00044 #ifdef TRS_SECURE
00045 static const unsigned int HT_MAGIC = 0xf78e8ef3;
00046 #endif
00047
00048 HashTable *
00049 HashTableMake(XMHandle *, int);
00050
00051 extern void
00052 HashTableFree(XMHandle *, HashTable *);
00053
00054 extern HashTable *
00055 HashTableCreate(XMHandle *, int);
00056
00057 extern int
00058 HashTableTRObjectInsert(XMHandle *, HashTable *, TRObject *),
00059 HashTableTRObjectSuppress(XMHandle *, HashTable *, TRObject *),
00060 HashTablePObjectInsert(XMHandle *, HashTable *, PObject *),
00061 HashTablePObjectSuppress(XMHandle *, HashTable *, PObject *);
00062
00063 extern XMOffset
00064 HashTableTRObjectLookup(XMHandle *, HashTable *, const Oid *),
00065 HashTablePObjectLookup(XMHandle *, HashTable *, const Oid *);
00066
00067 }