*
* Jansson is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.
*
* Jansson is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.
an object_key_t instance. */
#define string_to_key(string) container_of(string, object_key_t, key)
an object_key_t instance. */
#define string_to_key(string) container_of(string, object_key_t, key)
{
return strcmp(((const object_key_t *)ptr1)->key,
((const object_key_t *)ptr2)->key) == 0;
{
return strcmp(((const object_key_t *)ptr1)->key,
((const object_key_t *)ptr2)->key) == 0;
- if(hashtable_init(&object->hashtable, hash_key, key_equal,
- free, value_decref))
+ if(hashtable_init(&object->hashtable,
+ jsonp_hash_key, jsonp_key_equal,
+ jsonp_free, value_decref))
/* offsetof(...) returns the size of object_key_t without the
last, flexible member. This way, the correct amount is
allocated. */
/* offsetof(...) returns the size of object_key_t without the
last, flexible member. This way, the correct amount is
allocated. */
old_table = array->table;
new_size = max(array->size + amount, array->size * 2);
old_table = array->table;
new_size = max(array->size + amount, array->size * 2);
if(copy) {
array_copy(array->table, 0, old_table, 0, array->entries);
if(copy) {
array_copy(array->table, 0, old_table, 0, array->entries);
array_copy(array->table, 0, old_table, 0, index);
array_copy(array->table, index + 1, old_table, index,
array->entries - index);
array_copy(array->table, 0, old_table, 0, index);
array_copy(array->table, index + 1, old_table, index,
array->entries - index);
}
else
array_move(array, index + 1, index, array->entries - index);
}
else
array_move(array, index + 1, index, array->entries - index);