Delete the ObjInsert() function from dstm.h
[IRC.git] / Robust / src / Runtime / DSTM / interface / dstm.h
1 #ifndef _DSTM_H_
2 #define _DSTM_H_
3
4 #include <stdlib.h>
5 #include <stdio.h>
6 #include <string.h>
7 #include "hashtable.h"
8
9 enum status {CLEAN, DIRTY};
10
11 typedef struct objheader {
12         unsigned int oid;
13         unsigned short type;
14         unsigned short version;
15         unsigned short rcount;
16         char status;
17 } objheader_t;
18
19 typedef struct objstr {
20         unsigned int size; //this many bytes are allocated after this header
21         void *top;
22         struct objstr *next;
23 } objstr_t;
24
25 typedef struct transrecord {
26         objstr_t *cache;
27         hashtable_t *lookupTable;
28 } transrecord_t;
29
30 /* Initialize main object store and lookup tables, start server thread. */
31 void dstmInit(void);
32
33 /* Prototypes for object header */
34 unsigned int getNewOID(void);
35 unsigned int objSize(objheader_t *object);
36 /* end object header */
37
38 /* Prototypes for object store */
39 objstr_t *objstrCreate(unsigned int size); //size in bytes
40 void objstrDelete(objstr_t *store); //traverse and free entire list
41 void *objstrAlloc(objstr_t *store, unsigned int size); //size in bytes
42 /* end object store */
43
44 /* Prototypes for server portion */
45 void *dstmListen();
46 void *dstmAccept(void *);
47 /* end server portion */
48
49 /* Prototypes for transactions */
50 transrecord_t *transStart();
51 objheader_t *transRead(transrecord_t *record, unsigned int oid);
52 objheader_t *transCreateObj(transrecord_t *record, unsigned short type); //returns oid
53 int transCommit(transrecord_t *record); //return 0 if successful
54 /* end transactions */
55
56 #endif