Main Page | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Related Pages

mm_hash.h

00001 /*-
00002  * Copyright (c) 2004-2005
00003  *      Sleepycat Software.  All rights reserved.
00004  *
00005  * http://www.apache.org/licenses/LICENSE-2.0.txt
00006  * 
00007  * authors: Thies C. Arntzen <[email protected]>
00008  *          Sterling Hughes <[email protected]>
00009  *          George Schlossnagle <[email protected]>
00010  */
00011 
00012 #ifndef _MM_HASH_H
00013 #define _MM_HASH_H
00014 #include "mm.h"
00015 
00016 typedef void (*MM_HashDtor)(void *);
00017 
00018 typedef struct _MM_Bucket {
00019         struct _MM_Bucket *next;
00020         char *key;
00021         int length;
00022         unsigned int hash;
00023         void *data;
00024 } MM_Bucket;
00025 
00026 #define MM_HASH_SIZE 1009
00027 typedef struct _Hash {
00028          MM_Bucket *buckets[ MM_HASH_SIZE ];
00029          MM *mm;
00030          MM_HashDtor dtor;
00031          int nElements;
00032 } MM_Hash;
00033 
00034 MM_Hash *mm_hash_new(MM *, MM_HashDtor);
00035 void mm_hash_free(MM_Hash *table);
00036 void *mm_hash_find(MM_Hash *table, const void *key, int length);
00037 void mm_hash_add(MM_Hash *table, char *key, int length, void *data);
00038 void mm_hash_delete(MM_Hash *table, char *key, int length);
00039 void mm_hash_update(MM_Hash *table, char *key, int length, void *data);
00040 #endif
00041 
00042 /*
00043 Local variables:
00044 tab-width: 4
00045 c-basic-offset: 4
00046 End:
00047 vim600: noet sw=4 ts=4 fdm=marker
00048 vim<600: noet sw=4 ts=4
00049 */

Generated on Sun Dec 25 12:14:41 2005 for Berkeley DB 4.4.16 by  doxygen 1.4.2