Lines Matching refs:hooks
195 static unsigned char* cJSON_strdup(const unsigned char* string, const internal_hooks * const hooks) in cJSON_strdup() argument
206 copy = (unsigned char*)hooks->allocate(length); in cJSON_strdup()
216 CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks* hooks) in cJSON_InitHooks() argument
218 if (hooks == NULL) in cJSON_InitHooks()
228 if (hooks->malloc_fn != NULL) in cJSON_InitHooks()
230 global_hooks.allocate = hooks->malloc_fn; in cJSON_InitHooks()
234 if (hooks->free_fn != NULL) in cJSON_InitHooks()
236 global_hooks.deallocate = hooks->free_fn; in cJSON_InitHooks()
248 static cJSON *cJSON_New_Item(const internal_hooks * const hooks) in cJSON_New_Item() argument
250 cJSON* node = (cJSON*)hooks->allocate(sizeof(cJSON)); in cJSON_New_Item()
300 internal_hooks hooks; member
442 internal_hooks hooks; member
496 if (p->hooks.reallocate != NULL) in ensure()
499 newbuffer = (unsigned char*)p->hooks.reallocate(p->buffer, newsize); in ensure()
502 p->hooks.deallocate(p->buffer); in ensure()
512 newbuffer = (unsigned char*)p->hooks.allocate(newsize); in ensure()
515 p->hooks.deallocate(p->buffer); in ensure()
525 p->hooks.deallocate(p->buffer); in ensure()
817 output = (unsigned char*)input_buffer->hooks.allocate(allocation_length + sizeof("")); in parse_string()
895 input_buffer->hooks.deallocate(output); in parse_string()
1117 buffer.hooks = global_hooks; in cJSON_ParseWithLengthOpts()
1192 …signed char *print(const cJSON * const item, cJSON_bool format, const internal_hooks * const hooks) in print() argument
1201 buffer->buffer = (unsigned char*) hooks->allocate(default_buffer_size); in print()
1204 buffer->hooks = *hooks; in print()
1218 if (hooks->reallocate != NULL) in print()
1220 printed = (unsigned char*) hooks->reallocate(buffer->buffer, buffer->offset + 1); in print()
1228 printed = (unsigned char*) hooks->allocate(buffer->offset + 1); in print()
1237 hooks->deallocate(buffer->buffer); in print()
1245 hooks->deallocate(buffer->buffer); in print()
1250 hooks->deallocate(printed); in print()
1286 p.hooks = global_hooks; in cJSON_PrintBuffered()
1311 p.hooks = global_hooks; in cJSON_PrintPreallocated()
1484 cJSON *new_item = cJSON_New_Item(&(input_buffer->hooks)); in parse_array()
1638 cJSON *new_item = cJSON_New_Item(&(input_buffer->hooks)); in parse_object()
1932 static cJSON *create_reference(const cJSON *item, const internal_hooks * const hooks) in create_reference() argument
1940 reference = cJSON_New_Item(hooks); in create_reference()
2017 …nst char * const string, cJSON * const item, const internal_hooks * const hooks, const cJSON_bool … in add_item_to_object() argument
2034 new_key = (char*)cJSON_strdup((const unsigned char*)string, hooks); in add_item_to_object()
2045 hooks->deallocate(item->string); in add_item_to_object()