summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/dict.h
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2012-09-06 00:13:04 +0530
committerAnand Avati <avati@redhat.com>2012-09-06 00:34:15 -0700
commitd6c99b6134f1eb90b3a8020c3538101df266e9b5 (patch)
treea5ec27bcf3136ddfda5ce5f21917bea50ad3be58 /libglusterfs/src/dict.h
parent54b71368ef290bc579f113e683a82b09893fb50a (diff)
libglusterfs/dict: make 'dict_t' a opaque object
* ie, don't dereference dict_t pointer, instead use APIs everywhere * other than dict_t only 'data_t' should be the valid export from dict.h * added 'dict_foreach_fnmatch()' API * changed dict_lookup() to use data_t, instead of data_pair_t Change-Id: I400bb0dd55519a7c5d2a107e67c8e7a7207228dc Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 850917 Reviewed-on: http://review.gluster.org/3829 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.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/libglusterfs/src/dict.h b/libglusterfs/src/dict.h
index 17e9bcb451e..050f7ca2f72 100644
--- a/libglusterfs/src/dict.h
+++ b/libglusterfs/src/dict.h
@@ -122,7 +122,7 @@ dict_t *dict_ref (dict_t *dict);
data_t *data_ref (data_t *data);
void data_unref (data_t *data);
-int32_t dict_lookup (dict_t *this, char *key, data_pair_t **data);
+int32_t dict_lookup (dict_t *this, char *key, data_t **data);
/*
TODO: provide converts for differnt byte sizes, signedness, and void *
*/
@@ -165,12 +165,19 @@ data_t * data_copy (data_t *old);
dict_t *get_new_dict_full (int size_hint);
dict_t *get_new_dict ();
-void dict_foreach (dict_t *this,
- void (*fn)(dict_t *this,
- char *key,
- data_t *value,
- void *data),
- void *data);
+int dict_foreach (dict_t *this,
+ int (*fn)(dict_t *this,
+ char *key,
+ data_t *value,
+ void *data),
+ void *data);
+
+int dict_foreach_fnmatch (dict_t *dict, char *pattern,
+ int (*fn)(dict_t *this,
+ char *key,
+ data_t *value,
+ void *data),
+ void *data);
dict_t *dict_copy (dict_t *this, dict_t *new);