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