aboutsummaryrefslogtreecommitdiff
path: root/dict.h
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2012-02-10 13:10:03 +0100
committerPetr Machata <pmachata@redhat.com>2012-04-19 00:55:01 +0200
commit345c9b5195383c7b2d2d9db308e824259323803f (patch)
tree4a245765d80e30c8d22f87864dbf2a4e99bf0386 /dict.h
parentfd43ef7bb48260aadd4d8335371f75015e680108 (diff)
downloadltrace-345c9b5195383c7b2d2d9db308e824259323803f.tar.gz
Dict const correctness
Diffstat (limited to 'dict.h')
-rw-r--r--dict.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/dict.h b/dict.h
index 27dc7bf..b2a3ffe 100644
--- a/dict.h
+++ b/dict.h
@@ -4,19 +4,21 @@
typedef struct dict Dict;
-extern Dict *dict_init(unsigned int (*key2hash) (void *),
- int (*key_cmp) (void *, void *));
+extern Dict *dict_init(unsigned int (*key2hash) (const void *),
+ int (*key_cmp) (const void *, const void *));
extern void dict_clear(Dict *d);
extern int dict_enter(Dict *d, void *key, void *value);
-extern void *dict_find_entry(Dict *d, void *key);
+extern void *dict_find_entry(Dict *d, const void *key);
extern void dict_apply_to_all(Dict *d,
void (*func) (void *key, void *value, void *data),
void *data);
-extern unsigned int dict_key2hash_string(void *key);
-extern int dict_key_cmp_string(void *key1, void *key2);
-extern unsigned int dict_key2hash_int(void *key);
-extern int dict_key_cmp_int(void *key1, void *key2);
+extern unsigned int dict_key2hash_string(const void *key);
+extern int dict_key_cmp_string(const void *key1, const void *key2);
+
+extern unsigned int dict_key2hash_int(const void *key);
+extern int dict_key_cmp_int(const void *key1, const void *key2);
+
extern Dict * dict_clone(Dict *old, void * (*key_clone)(void*), void * (*value_clone)(void*));
extern Dict * dict_clone2(Dict * old,
void * (* key_clone)(void * key, void * data),