00001
00002
00003
00004
00031 #ifndef ADT_TABLE_H
00032 #define ADT_TABLE_H
00033
00034 #ifdef __cplusplus
00035 extern "C" {
00036 #endif
00037
00038 #ifndef ADT_ERROR
00039 #define ADT_ERROR (-1)
00040 #endif
00041
00046 typedef struct adt_Table_t {
00047 struct hash_node_t **bucket;
00048 int size;
00049 int entries;
00050 int downshift;
00051 int mask;
00052 char buf[64];
00053 } adt_Table;
00054
00055
00068 adt_Table *adt_createTable(int size);
00069
00070
00076 void adt_destroyTable(adt_Table *);
00077
00078
00101 int adt_insertTable(adt_Table *, const char *key, int value);
00102
00103
00111 int adt_lookupTable(adt_Table *, const char *key);
00112
00113
00128 int adt_updateTable(adt_Table *, const char *key, int newvalue);
00129
00130
00138 int adt_deleteTable(adt_Table *, const char *key);
00139
00140
00146 int adt_initializeTable(adt_Table *, int size);
00147
00148
00154 void adt_cleanupTable(adt_Table *);
00155
00156
00163 const char *adt_getStatsTable(adt_Table *);
00164
00165 #ifdef __cplusplus
00166 }
00167 #endif
00168
00169 #endif