summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/dict.h
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2012-09-06 00:44:04 +0530
committerAnand Avati <avati@redhat.com>2012-10-02 20:07:16 -0700
commitec79583cfd2ae10998dedfeb0c2c2a83a81cdec3 (patch)
tree55703f648d71cba9317395e54a77c8904ce99160 /libglusterfs/src/dict.h
parent3372f198a8272b3467944c759be9975ee8f0aa02 (diff)
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 <amarts@redhat.com> BUG: 850917 Reviewed-on: http://review.gluster.org/3844 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'libglusterfs/src/dict.h')
-rw-r--r--libglusterfs/src/dict.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/libglusterfs/src/dict.h b/libglusterfs/src/dict.h
index 30246cdb4..dbf98046f 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);