Lines Matching defs:hooks

200 static unsigned char* cJSON_strdup(const unsigned char* string, const internal_hooks * const hooks)
211 copy = (unsigned char*)hooks->allocate(length);
221 CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks* hooks)
223 if (hooks == NULL)
225 /* Reset hooks */
233 if (hooks->malloc_fn != NULL)
235 global_hooks.allocate = hooks->malloc_fn;
239 if (hooks->free_fn != NULL)
241 global_hooks.deallocate = hooks->free_fn;
253 static cJSON *cJSON_New_Item(const internal_hooks * const hooks)
255 cJSON* node = (cJSON*)hooks->allocate(sizeof(cJSON));
311 internal_hooks hooks;
601 internal_hooks hooks;
655 if (p->hooks.reallocate != NULL)
658 newbuffer = (unsigned char*)p->hooks.reallocate(p->buffer, newsize);
661 p->hooks.deallocate(p->buffer);
671 newbuffer = (unsigned char*)p->hooks.allocate(newsize);
674 p->hooks.deallocate(p->buffer);
682 p->hooks.deallocate(p->buffer);
1055 output = (unsigned char*)input_buffer->hooks.allocate(allocation_length + sizeof(""));
1133 input_buffer->hooks.deallocate(output);
1355 buffer.hooks = global_hooks;
1430 static unsigned char *print(const cJSON * const item, cJSON_bool format, const internal_hooks * const hooks)
1439 buffer->buffer = (unsigned char*) hooks->allocate(default_buffer_size);
1442 buffer->hooks = *hooks;
1456 if (hooks->reallocate != NULL)
1458 printed = (unsigned char*) hooks->reallocate(buffer->buffer, buffer->offset + 1);
1466 printed = (unsigned char*) hooks->allocate(buffer->offset + 1);
1475 hooks->deallocate(buffer->buffer);
1483 hooks->deallocate(buffer->buffer);
1488 hooks->deallocate(printed);
1524 p.hooks = global_hooks;
1549 p.hooks = global_hooks;
1722 cJSON *new_item = cJSON_New_Item(&(input_buffer->hooks));
1880 cJSON *new_item = cJSON_New_Item(&(input_buffer->hooks));
2183 static cJSON *create_reference(const cJSON *item, const internal_hooks * const hooks)
2191 reference = cJSON_New_Item(hooks);
2259 static cJSON_bool add_item_to_object(cJSON * const object, const char * const string, cJSON * const item, const internal_hooks * const hooks, const cJSON_bool constant_key)
2276 new_key = (char*)cJSON_strdup((const unsigned char*)string, hooks);
2287 hooks->deallocate(item->string);