Lines Matching refs:hooks
937 internal_hooks hooks; member
957 void lite_cjson_init_hooks(lite_cjson_hooks *hooks) in lite_cjson_init_hooks() argument
959 if (hooks == NULL || hooks->malloc_fn == NULL || hooks->free_fn == NULL) { in lite_cjson_init_hooks()
963 global_hooks.allocate = hooks->malloc_fn; in lite_cjson_init_hooks()
964 global_hooks.deallocate = hooks->free_fn; in lite_cjson_init_hooks()
1007 if (p->hooks.reallocate != NULL) { in ensure()
1009 newbuffer = (unsigned char *)p->hooks.reallocate(p->buffer, newsize); in ensure()
1011 p->hooks.deallocate(p->buffer); in ensure()
1019 newbuffer = (unsigned char *)p->hooks.allocate(newsize); in ensure()
1021 p->hooks.deallocate(p->buffer); in ensure()
1030 p->hooks.deallocate(p->buffer); in ensure()
1511 const internal_hooks *const hooks) in print() argument
1520 buffer->buffer = (unsigned char *)hooks->allocate(default_buffer_size); in print()
1523 buffer->hooks = *hooks; in print()
1535 if (hooks->reallocate != NULL) { in print()
1536 printed = (unsigned char *)hooks->reallocate(buffer->buffer, in print()
1543 printed = (unsigned char *)hooks->allocate(buffer->offset + 1); in print()
1552 hooks->deallocate(buffer->buffer); in print()
1559 hooks->deallocate(buffer->buffer); in print()
1638 const internal_hooks *const hooks) in cJSON_strdup() argument
1648 copy = (unsigned char *)hooks->allocate(length); in cJSON_strdup()
1660 const internal_hooks *const hooks, in add_item_to_object() argument
1674 new_key = (char *)cJSON_strdup((const unsigned char *)string, hooks); in add_item_to_object()
1683 hooks->deallocate(item->string); in add_item_to_object()
1698 static lite_cjson_item_t *cJSON_New_Item(const internal_hooks *const hooks) in cJSON_New_Item() argument
1701 (lite_cjson_item_t *)hooks->allocate(sizeof(lite_cjson_item_t)); in cJSON_New_Item()