Lines Matching refs:hooks

188 static unsigned char* cJSON_strdup(const unsigned char* string, const internal_hooks * const hooks)  in cJSON_strdup()  argument
199 copy = (unsigned char*)hooks->allocate(length); in cJSON_strdup()
209 CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks* hooks) in cJSON_InitHooks() argument
211 if (hooks == NULL) in cJSON_InitHooks()
221 if (hooks->malloc_fn != NULL) in cJSON_InitHooks()
223 global_hooks.allocate = hooks->malloc_fn; in cJSON_InitHooks()
227 if (hooks->free_fn != NULL) in cJSON_InitHooks()
229 global_hooks.deallocate = hooks->free_fn; in cJSON_InitHooks()
241 static cJSON *cJSON_New_Item(const internal_hooks * const hooks) in cJSON_New_Item() argument
243 cJSON* node = (cJSON*)hooks->allocate(sizeof(cJSON)); in cJSON_New_Item()
293 internal_hooks hooks; member
435 internal_hooks hooks; member
489 if (p->hooks.reallocate != NULL) in ensure()
492 newbuffer = (unsigned char*)p->hooks.reallocate(p->buffer, newsize); in ensure()
495 p->hooks.deallocate(p->buffer); in ensure()
505 newbuffer = (unsigned char*)p->hooks.allocate(newsize); in ensure()
508 p->hooks.deallocate(p->buffer); in ensure()
516 p->hooks.deallocate(p->buffer); in ensure()
808 output = (unsigned char*)input_buffer->hooks.allocate(allocation_length + sizeof("")); in parse_string()
886 input_buffer->hooks.deallocate(output); in parse_string()
1108 buffer.hooks = global_hooks; in cJSON_ParseWithLengthOpts()
1183 …signed char *print(const cJSON * const item, cJSON_bool format, const internal_hooks * const hooks) in print() argument
1192 buffer->buffer = (unsigned char*) hooks->allocate(default_buffer_size); in print()
1195 buffer->hooks = *hooks; in print()
1209 if (hooks->reallocate != NULL) in print()
1211 printed = (unsigned char*) hooks->reallocate(buffer->buffer, buffer->offset + 1); in print()
1219 printed = (unsigned char*) hooks->allocate(buffer->offset + 1); in print()
1228 hooks->deallocate(buffer->buffer); in print()
1236 hooks->deallocate(buffer->buffer); in print()
1241 hooks->deallocate(printed); in print()
1277 p.hooks = global_hooks; in cJSON_PrintBuffered()
1302 p.hooks = global_hooks; in cJSON_PrintPreallocated()
1475 cJSON *new_item = cJSON_New_Item(&(input_buffer->hooks)); in parse_array()
1633 cJSON *new_item = cJSON_New_Item(&(input_buffer->hooks)); in parse_object()
1931 static cJSON *create_reference(const cJSON *item, const internal_hooks * const hooks) in create_reference() argument
1939 reference = cJSON_New_Item(hooks); in create_reference()
2007 …nst char * const string, cJSON * const item, const internal_hooks * const hooks, const cJSON_bool … in add_item_to_object() argument
2024 new_key = (char*)cJSON_strdup((const unsigned char*)string, hooks); in add_item_to_object()
2035 hooks->deallocate(item->string); in add_item_to_object()