bug fixes
[IRC.git] / Robust / src / Runtime / DSTM / interface / dht.h
1 #ifndef _DHT_H
2 #define _DHT_H
3
4 #include <stdio.h>
5
6 /*******************************************************************************
7 *                             Local Structs
8 *******************************************************************************/
9
10 #define DHT_NO_KEY_LIMIT 0xFFFFFFFF
11
12 /*******************************************************************************
13 *                       Interface Function Prototypes
14 *******************************************************************************/
15
16 //called by host which joins (or starts) the system
17 void dhtInit(unsigned int seedIp, unsigned int maxKeyCapaciy);
18 //exit system, cleanup
19 void dhtExit();
20
21 //called by whoever performs the creation, move, deletion
22
23 //returns 0 if successful, -1 if an error occurred
24 int dhtInsert(unsigned int key, unsigned int val);
25 //simultaneously inserts the key-val pairs in the given arrays
26 int dhtInsertMult(unsigned int numKeys, unsigned int *keys,     unsigned int *vals);
27 //returns 0 if successful, -1 if an error occurred
28 int dhtRemove(unsigned int key);
29 //simultaneously delete the keys in the given array
30 int dhtRemoveMult(unsigned int numKeys, unsigned int *keys);
31 //returns 0 if successful and copies val into *val,
32 // 1 if key not found, -1 if an error occurred
33 int dhtSearch(unsigned int key, unsigned int *val);
34 //simultaneously search for the vals that correspond to the given keys.
35 // result is placed in vals[]
36 int dhtSearchMult(unsigned int numKeys, unsigned int *keys, unsigned int *vals);
37 #endif
38