X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=src%2Fdictionary.h;h=f028dbb30e39f81b182e993237d243bac0f4557c;hb=68c6d537788b9c11670903bce2e9806933a3322a;hp=4164b6dc7b28e9bd8b45ce89b628a65c67011aa2;hpb=b69723411bc73bbee640a760fa2267ec29f4d69e;p=netdata.git diff --git a/src/dictionary.h b/src/dictionary.h index 4164b6dc..f028dbb3 100644 --- a/src/dictionary.h +++ b/src/dictionary.h @@ -2,36 +2,36 @@ #define NETDATA_DICTIONARY_H 1 struct dictionary_stats { - unsigned long long inserts; - unsigned long long deletes; - unsigned long long searches; - unsigned long long entries; + unsigned long long inserts; + unsigned long long deletes; + unsigned long long searches; + unsigned long long entries; }; typedef struct name_value { - avl avl; // the index - this has to be first! + avl avl; // the index - this has to be first! - uint32_t hash; // a simple hash to speed up searching - // we first compare hashes, and only if the hashes are equal we do string comparisons + uint32_t hash; // a simple hash to speed up searching + // we first compare hashes, and only if the hashes are equal we do string comparisons - char *name; - void *value; + char *name; + void *value; } NAME_VALUE; typedef struct dictionary { - avl_tree values_index; + avl_tree values_index; - uint8_t flags; + uint8_t flags; - struct dictionary_stats *stats; - pthread_rwlock_t *rwlock; + struct dictionary_stats *stats; + netdata_rwlock_t *rwlock; } DICTIONARY; -#define DICTIONARY_FLAG_DEFAULT 0x00000000 -#define DICTIONARY_FLAG_SINGLE_THREADED 0x00000001 -#define DICTIONARY_FLAG_VALUE_LINK_DONT_CLONE 0x00000002 -#define DICTIONARY_FLAG_NAME_LINK_DONT_CLONE 0x00000004 -#define DICTIONARY_FLAG_WITH_STATISTICS 0x00000008 +#define DICTIONARY_FLAG_DEFAULT 0x00000000 +#define DICTIONARY_FLAG_SINGLE_THREADED 0x00000001 +#define DICTIONARY_FLAG_VALUE_LINK_DONT_CLONE 0x00000002 +#define DICTIONARY_FLAG_NAME_LINK_DONT_CLONE 0x00000004 +#define DICTIONARY_FLAG_WITH_STATISTICS 0x00000008 extern DICTIONARY *dictionary_create(uint8_t flags); extern void dictionary_destroy(DICTIONARY *dict);