6 #define READ_MULT_REQUEST 2
8 #define MOVE_MULT_REQUEST 4
9 #define TRANS_REQUEST 5
11 #define TRANS_COMMIT 7
14 #define OBJECT_FOUND 8
15 #define OBJECT_NOT_FOUND 9
16 #define OBJECTS_FOUND 10
17 #define OBJECTS_NOT_FOUND 11
18 #define TRANS_AGREE 12
19 #define TRANS_DISAGREE 13//for soft abort
20 #define TRANS_DISAGREE_ABORT 14//for hard abort
21 #define TRANS_SUCESSFUL 15//Not necessary for now
28 #define DEFAULT_OBJ_STORE_SIZE 1048510 //1MB
29 //bit designations for status field of objheader
34 typedef struct objheader {
37 unsigned short version;
38 unsigned short rcount;
42 typedef struct objstr {
43 unsigned int size; //this many bytes are allocated after this header
48 typedef struct transrecord {
50 chashtable_t *lookupTable;
59 /* Initialize main object store and lookup tables, start server thread. */
62 /* Prototypes for object header */
63 unsigned int getNewOID(void);
64 unsigned int objSize(objheader_t *object);
65 /* end object header */
67 /* Prototypes for object store */
68 objstr_t *objstrCreate(unsigned int size); //size in bytes
69 void objstrDelete(objstr_t *store); //traverse and free entire list
70 void *objstrAlloc(objstr_t *store, unsigned int size); //size in bytes
71 /* end object store */
73 /* Prototypes for server portion */
75 void *dstmAccept(void *);
76 /* end server portion */
78 /* Prototypes for transactions */
79 transrecord_t *transStart();
80 objheader_t *transRead(transrecord_t *record, unsigned int oid);
81 objheader_t *transCreateObj(transrecord_t *record, unsigned short type); //returns oid
82 int transCommit(transrecord_t *record); //return 0 if successful
83 /* end transactions */
85 void *getRemoteObj(transrecord_t *, unsigned int, unsigned int);