X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/c98390004f4f14cd8215302d77313f81e2546e22..16d76e865937e900b4649c18cf1189ddf76ca1bf:/include/irc_dictionary.h diff --git a/include/irc_dictionary.h b/include/irc_dictionary.h index 0dac545..69f3bab 100644 --- a/include/irc_dictionary.h +++ b/include/irc_dictionary.h @@ -33,7 +33,7 @@ struct DictionaryElement { struct DictionaryElement *left, *right, *prev, *next; void *data; - char *key; + const char *key; int position; }; @@ -133,7 +133,7 @@ extern void irc_dictionary_foreach_next(struct Dictionary *dtree, /* * irc_dictionary_add() adds a key->value entry to the dictionary tree. */ -extern struct DictionaryElement *irc_dictionary_add(struct Dictionary *dtree, char *key, void *data); +extern struct DictionaryElement *irc_dictionary_add(struct Dictionary *dtree, const char *key, void *data); /* * irc_dictionary_find() returns a struct DictionaryElement container from a dtree for key 'key'. @@ -150,6 +150,11 @@ extern void *irc_dictionary_retrieve(struct Dictionary *dtree, const char *key); */ extern void *irc_dictionary_delete(struct Dictionary *dtree, const char *key); +/* + * irc_dictionary_size() returns the number of elements in a dictionary tree. + */ +extern unsigned int irc_dictionary_size(struct Dictionary *dtree); + void irc_dictionary_stats(struct Dictionary *dict, void (*cb)(const char *line, void *privdata), void *privdata); #endif