]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - include/irc_dictionary.h
Fix a typo in configure (glad it was only a minor typo in the help text)
[irc/rqf/shadowircd.git] / include / irc_dictionary.h
index 0dac5456ce7118f87cda3057614bbbcbef0a11d9..69f3babc60f64c54d6bded58ffb65605fdfc6269 100644 (file)
@@ -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