summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/dict.h
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-03-16 09:38:28 +0000
committerVijay Bellur <vijay@dev.gluster.com>2011-03-17 11:57:17 -0700
commit924d2ed32d19a2a0014f803edd3d4511a0af99c2 (patch)
tree56ac7c904ee454bf9e16c4fd173a6e2906375d25 /libglusterfs/src/dict.h
parentebe47d5dae42da18b289e7be44eb67a8157a56b1 (diff)
libglusterfs: all header files updated
* whitespace cleanup (M-x whitespace-cleanup) * indentation fixes (M-x indent-region) * replaced tab with spaces (M-x untabify) Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 2346 (Log message enhancements in GlusterFS - phase 1) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2346
Diffstat (limited to 'libglusterfs/src/dict.h')
-rw-r--r--libglusterfs/src/dict.h57
1 files changed, 27 insertions, 30 deletions
diff --git a/libglusterfs/src/dict.h b/libglusterfs/src/dict.h
index ac587f59a..4ddea9422 100644
--- a/libglusterfs/src/dict.h
+++ b/libglusterfs/src/dict.h
@@ -36,34 +36,34 @@ typedef struct _dict dict_t;
typedef struct _data_pair data_pair_t;
struct _data {
- unsigned char is_static:1;
- unsigned char is_const:1;
- unsigned char is_stdalloc:1;
- int32_t len;
- struct iovec *vec;
- char *data;
- int32_t refcount;
- gf_lock_t lock;
+ unsigned char is_static:1;
+ unsigned char is_const:1;
+ unsigned char is_stdalloc:1;
+ int32_t len;
+ struct iovec *vec;
+ char *data;
+ int32_t refcount;
+ gf_lock_t lock;
};
struct _data_pair {
- struct _data_pair *hash_next;
- struct _data_pair *prev;
- struct _data_pair *next;
- data_t *value;
- char *key;
+ struct _data_pair *hash_next;
+ struct _data_pair *prev;
+ struct _data_pair *next;
+ data_t *value;
+ char *key;
};
struct _dict {
- unsigned char is_static:1;
- int32_t hash_size;
- int32_t count;
- int32_t refcount;
- data_pair_t **members;
- data_pair_t *members_list;
- char *extra_free;
- char *extra_stdfree;
- gf_lock_t lock;
+ unsigned char is_static:1;
+ int32_t hash_size;
+ int32_t count;
+ int32_t refcount;
+ data_pair_t **members;
+ data_pair_t *members_list;
+ char *extra_free;
+ char *extra_stdfree;
+ gf_lock_t lock;
};
@@ -78,19 +78,18 @@ int32_t dict_serialized_length (dict_t *dict);
int32_t dict_serialize (dict_t *dict, char *buf);
int32_t dict_unserialize (char *buf, int32_t size, dict_t **fill);
-int32_t
-dict_allocate_and_serialize (dict_t *this, char **buf, size_t *length);
+int32_t dict_allocate_and_serialize (dict_t *this, char **buf, size_t *length);
int32_t dict_iovec_len (dict_t *dict);
int32_t dict_to_iovec (dict_t *dict, struct iovec *vec, int32_t count);
-
+
void dict_destroy (dict_t *dict);
void dict_unref (dict_t *dict);
dict_t *dict_ref (dict_t *dict);
data_t *data_ref (data_t *data);
void data_unref (data_t *data);
-/*
+/*
TODO: provide converts for differnt byte sizes, signedness, and void *
*/
data_t *int_to_data (int64_t value);
@@ -140,13 +139,11 @@ void dict_foreach (dict_t *this,
void *data),
void *data);
-dict_t *dict_copy (dict_t *this,
- dict_t *new);
+dict_t *dict_copy (dict_t *this, dict_t *new);
/* CLEANED UP FUNCTIONS DECLARATIONS */
GF_MUST_CHECK dict_t *dict_new (void);
-dict_t *dict_copy_with_ref (dict_t *this,
- dict_t *new);
+dict_t *dict_copy_with_ref (dict_t *this, dict_t *new);
GF_MUST_CHECK int dict_get_int8 (dict_t *this, char *key, int8_t *val);
GF_MUST_CHECK int dict_set_int8 (dict_t *this, char *key, int8_t val);