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