8 enum status {CLEAN, DIRTY};
10 typedef struct obj_header {
13 unsigned short version;
14 unsigned short rcount;
18 typedef struct obj_store {
22 char *top; //next available location
23 struct obj_store *next;
26 //use for hash tables, transaction records.
27 //to check oid, do object->oid
28 typedef struct obj_lnode{
31 struct obj_lnode *next;
34 typedef struct obj_addr_table {
35 unsigned int size; //number of elements, not bytes
36 obj_listnode_t *table; //this should point to an array of object lists, of the specified size
39 typedef struct trans_record {
40 obj_listnode_t *obj_list;
42 obj_addr_table_t *lookupTable;
45 typedef struct obj_location_lnode {
48 struct obj_location_lnode *next;
49 } obj_location_listnode_t;
52 unsigned int size; //number of elements, not bytes
53 obj_location_listnode_t *table; //this should point to an array of object lists, of the specified size
56 /* Prototypes for object store */
58 void create_objstr(unsigned int);
59 void delete_objstr(int);
60 obj_store_t *get_objstr_begin(void);
61 /* end object store */
64 /* Prototypes for object header */
66 int insertObject(obj_header_t h);
67 int getObjSize(obj_header_t h);
68 void createObject(unsigned short type);
69 /* end object header */
71 /* Prototypes for hash*/
73 int hashkey(unsigned int);
74 void addKey(unsigned int, obj_header_t *);
75 obj_header_t *findKey(unsigned int);
76 int removeKey(unsigned int);
81 void * allocate_size(unsigned int);
82 void initializeobj(unsigned int);
83 unsigned int getobjSize(obj_header *);
84 int insertAddr(obj_addr_table *, obj_header *);
85 int removeAddr(obj_addr_table *, unsigned int);
86 obj_header *getAddr(obj_addr_table *, unsigned int);
87 trans_record *transStart();
88 obj_header *transRead(trans_record *, unsigned int);
89 int transCommit(trans_record *);
90 int insertLocation(obj_location_table *, unsigned int, unsigned int);
91 int removeLocation(obj_location_table *, unsigned int);
92 unsigned int getLocation(obj_location_table *, unsigned int);