hash_cache.h
00001
00002
00003
00004
00005
00006
00007
00008 #ifndef HASH_CACHE_H
00009 #define HASH_CACHE_H
00010
00011 #include "hash_table.h"
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 typedef void (*hash_cache_cleanup_t) ( void *value );
00023
00024 struct hash_cache * hash_cache_create( int size, hash_func_t func, hash_cache_cleanup_t cleanup );
00025 void hash_cache_delete( struct hash_cache *cache );
00026
00027 int hash_cache_insert( struct hash_cache *cache, const char *key, void *value, int lifetime );
00028 void * hash_cache_remove( struct hash_cache *cache, const char *key );
00029 void * hash_cache_lookup( struct hash_cache *cache, const char *key );
00030
00031 void hash_cache_firstkey( struct hash_cache *cache );
00032 int hash_cache_nextkey( struct hash_cache *cache, char **key, void **item );
00033
00034 #endif
00035