X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fciniparser%2Fdictionary.h;h=a94ea1a140e841931a95930eaf4d5d09ae4b12f2;hb=8cb4a3ed3d44fa4f85e176aaeaaf1da1d6eab5b6;hp=4b517637bb274cebd0a97cae763da20f8f906989;hpb=28f7279805d3c9378362003031ae537a32d9bec4;p=ccan diff --git a/ccan/ciniparser/dictionary.h b/ccan/ciniparser/dictionary.h index 4b517637..a94ea1a1 100644 --- a/ccan/ciniparser/dictionary.h +++ b/ccan/ciniparser/dictionary.h @@ -41,7 +41,7 @@ * * This module implements a simple dictionary object, i.e. a list * of string/string associations. This object is useful to store e.g. - * informations retrieved from a configuration file (ini files). + * information retrieved from a configuration file (ini files). */ @@ -76,7 +76,7 @@ typedef struct _dictionary_ { * The key is stored anyway in the struct so that collision can be avoided * by comparing the key itself in last resort. */ -unsigned dictionary_hash(char *key); +unsigned dictionary_hash(const char *key); /** * @brief Create a new dictionary object. @@ -110,7 +110,7 @@ void dictionary_del(dictionary *vd); * dictionary. The returned character pointer points to data internal to the * dictionary object, you should not try to free it or modify it. */ -char *dictionary_get(dictionary *d, char *key, char *def); +char *dictionary_get(dictionary *d, const char *key, char *def); /** * @brief Set a value in a dictionary. @@ -136,7 +136,7 @@ char *dictionary_get(dictionary *d, char *key, char *def); * * This function returns non-zero in case of failure. */ -int dictionary_set(dictionary *vd, char *key, char *val); +int dictionary_set(dictionary *vd, const char *key, char *val); /** * @brief Delete a key in a dictionary @@ -147,7 +147,7 @@ int dictionary_set(dictionary *vd, char *key, char *val); * This function deletes a key in a dictionary. Nothing is done if the * key cannot be found. */ -void dictionary_unset(dictionary *d, char *key); +void dictionary_unset(dictionary *d, const char *key); /** * @brief Dump a dictionary to an opened file pointer.