Main Page | Class List | Directories | File List | Class Members | File Members

table.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2003-2005 by David J. Hardy.  All rights reserved.
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;  /* array of hash nodes */
00048     int size;                     /* size of the array */
00049     int entries;                  /* number of entries in table */
00050     int downshift;                /* shift cound, used for hashing */
00051     int mask;                     /* used to select bits for hashing */
00052     char buf[64];                 /* used to store buffer for stats */
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 /* ADT_TABLE_H */

Generated on Mon Sep 26 10:55:18 2005 for MDX by  doxygen 1.4.4