Lines Matching refs:hooks
150 static unsigned char* cJSON_strdup(const unsigned char* string, const internal_hooks * const hooks) in cJSON_strdup() argument
161 copy = (unsigned char*)hooks->allocate(length); in cJSON_strdup()
171 CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks* hooks) in cJSON_InitHooks() argument
173 if (hooks == NULL) in cJSON_InitHooks()
183 if (hooks->malloc_fn != NULL) in cJSON_InitHooks()
185 global_hooks.allocate = hooks->malloc_fn; in cJSON_InitHooks()
189 if (hooks->free_fn != NULL) in cJSON_InitHooks()
191 global_hooks.deallocate = hooks->free_fn; in cJSON_InitHooks()
203 static cJSON *cJSON_New_Item(const internal_hooks * const hooks) in cJSON_New_Item() argument
205 cJSON* node = (cJSON*)hooks->allocate(sizeof(cJSON)); in cJSON_New_Item()
255 internal_hooks hooks; member
370 internal_hooks hooks; member
424 if (p->hooks.reallocate != NULL) in ensure()
427 newbuffer = (unsigned char*)p->hooks.reallocate(p->buffer, newsize); in ensure()
430 p->hooks.deallocate(p->buffer); in ensure()
440 newbuffer = (unsigned char*)p->hooks.allocate(newsize); in ensure()
443 p->hooks.deallocate(p->buffer); in ensure()
453 p->hooks.deallocate(p->buffer); in ensure()
738 output = (unsigned char*)input_buffer->hooks.allocate(allocation_length + sizeof("")); in parse_string()
816 input_buffer->hooks.deallocate(output); in parse_string()
1018 buffer.hooks = global_hooks; in cJSON_ParseWithOpts()
1088 …signed char *print(const cJSON * const item, cJSON_bool format, const internal_hooks * const hooks) in print() argument
1097 buffer->buffer = (unsigned char*) hooks->allocate(default_buffer_size); in print()
1100 buffer->hooks = *hooks; in print()
1114 if (hooks->reallocate != NULL) in print()
1116 printed = (unsigned char*) hooks->reallocate(buffer->buffer, buffer->offset + 1); in print()
1124 printed = (unsigned char*) hooks->allocate(buffer->offset + 1); in print()
1133 hooks->deallocate(buffer->buffer); in print()
1141 hooks->deallocate(buffer->buffer); in print()
1146 hooks->deallocate(printed); in print()
1182 p.hooks = global_hooks; in cJSON_PrintBuffered()
1207 p.hooks = global_hooks; in cJSON_PrintPreallocated()
1380 cJSON *new_item = cJSON_New_Item(&(input_buffer->hooks)); in parse_array()
1534 cJSON *new_item = cJSON_New_Item(&(input_buffer->hooks)); in parse_object()
1824 static cJSON *create_reference(const cJSON *item, const internal_hooks * const hooks) in create_reference() argument
1832 reference = cJSON_New_Item(hooks); in create_reference()
1896 …nst char * const string, cJSON * const item, const internal_hooks * const hooks, const cJSON_bool … in add_item_to_object() argument
1913 new_key = (char*)cJSON_strdup((const unsigned char*)string, hooks); in add_item_to_object()
1924 hooks->deallocate(item->string); in add_item_to_object()