From ec79583cfd2ae10998dedfeb0c2c2a83a81cdec3 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Thu, 6 Sep 2012 00:44:04 +0530 Subject: dict: add new API 'dict_add()' * this new API is used only when we are sure that there is no replacing keys, ie. in dict_unserialize(). Change-Id: I383dffc65056ebdaf0ab19727f7dc14ec7017fc1 Signed-off-by: Amar Tumballi BUG: 850917 Reviewed-on: http://review.gluster.org/3844 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- libglusterfs/src/dict.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libglusterfs/src/dict.h') diff --git a/libglusterfs/src/dict.h b/libglusterfs/src/dict.h index 30246cdb493..dbf98046f4f 100644 --- a/libglusterfs/src/dict.h +++ b/libglusterfs/src/dict.h @@ -99,7 +99,11 @@ struct _dict { int32_t is_data_equal (data_t *one, data_t *two); void data_destroy (data_t *data); +/* function to set a key/value pair (overwrite existing if matches the key */ int32_t dict_set (dict_t *this, char *key, data_t *value); +/* function to set a new key/value pair (without checking for duplicate) */ +int32_t dict_add (dict_t *this, char *key, data_t *value); + data_t *dict_get (dict_t *this, char *key); void dict_del (dict_t *this, char *key); int dict_reset (dict_t *dict); -- cgit