X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=src%2Fvalue.c;h=534624c827747f2729c0b4ddd7de071739907908;hb=dd7dd414f0968a2ca6436c493b4d1d4ed0723bda;hp=0df457022c83df84b5173f22a0a0dad24c2182a8;hpb=fa7c2ea070672d05b34b6341142a193e9a7d0a8c;p=jansson.git diff --git a/src/value.c b/src/value.c index 0df4570..534624c 100644 --- a/src/value.c +++ b/src/value.c @@ -32,7 +32,7 @@ static JSON_INLINE void json_init(json_t *json, json_type type) an object_key_t instance. */ #define string_to_key(string) container_of(string, object_key_t, key) -static size_t hash_key(const void *ptr) +size_t jsonp_hash_key(const void *ptr) { const char *str = ((const object_key_t *)ptr)->key; @@ -48,7 +48,7 @@ static size_t hash_key(const void *ptr) return hash; } -static int key_equal(const void *ptr1, const void *ptr2) +int jsonp_key_equal(const void *ptr1, const void *ptr2) { return strcmp(((const object_key_t *)ptr1)->key, ((const object_key_t *)ptr2)->key) == 0; @@ -66,7 +66,8 @@ json_t *json_object(void) return NULL; json_init(&object->json, JSON_OBJECT); - if(hashtable_init(&object->hashtable, hash_key, key_equal, + if(hashtable_init(&object->hashtable, + jsonp_hash_key, jsonp_key_equal, free, value_decref)) { free(object);