1 #include "web_buffer.h"
3 #ifndef NETDATA_DICTIONARY_H
4 #define NETDATA_DICTIONARY_H 1
6 typedef struct name_value {
7 avl avl; // the index - this has to be first!
9 uint32_t hash; // a simple hash to speed up searching
10 // we first compare hashes, and only if the hashes are equal we do string comparisons
15 struct name_value *next;
18 typedef struct dictionary {
20 avl_tree values_index;
21 pthread_rwlock_t rwlock;
24 extern DICTIONARY *dictionary_create(void);
25 extern void dictionary_destroy(DICTIONARY *dict);
26 extern void *dictionary_set(DICTIONARY *dict, const char *name, void *value, size_t value_len);
27 extern void *dictionary_get(DICTIONARY *dict, const char *name);
29 #endif /* NETDATA_DICTIONARY_H */