1 /* Copyright (c) 2008, UNINETT AS */
2 /* See LICENSE for licensing information. */
8 #if defined (__cplusplus)
13 struct list *hashlist;
14 pthread_mutex_t mutex;
21 struct list_node *next; /* used when walking through hash */
24 /* allocates and initialises hash structure; returns NULL if malloc fails */
25 struct hash *hash_create();
27 /* frees all memory associated with the hash */
28 void hash_destroy(struct hash *hash);
30 /* insert entry in hash; returns 1 if ok, 0 if malloc fails */
31 int hash_insert(struct hash *hash, void *key, uint32_t keylen, void *data);
33 /* reads entry from hash */
34 void *hash_read(struct hash *hash, void *key, uint32_t keylen);
36 /* extracts (read and remove) entry from hash */
37 void *hash_extract(struct hash *hash, void *key, uint32_t keylen);
39 /* returns first entry */
40 struct hash_entry *hash_first(struct hash *hash);
42 /* returns the next entry after the argument */
43 struct hash_entry *hash_next(struct hash_entry *entry);
45 #if defined (__cplusplus)
49 /* Local Variables: */
50 /* c-file-style: "stroustrup" */