| 547 } |
547 } |
| 548 |
548 |
| 549 memset(json, 0, sizeof(CxJson)); |
549 memset(json, 0, sizeof(CxJson)); |
| 550 json->allocator = allocator; |
550 json->allocator = allocator; |
| 551 |
551 |
| 552 json->states.data = json->states_internal; |
552 cx_array_init_fixed(json->states, json->states_internal, 1); |
| 553 json->states.capacity = cx_nmemb(json->states_internal); |
|
| 554 json->states.data[0] = JP_STATE_VALUE_BEGIN; |
553 json->states.data[0] = JP_STATE_VALUE_BEGIN; |
| 555 json->states.size = 1; |
554 cx_array_init_fixed(json->vbuf, json->vbuf_internal, 0); |
| 556 |
|
| 557 json->vbuf.data = json->vbuf_internal; |
|
| 558 json->vbuf.capacity = cx_nmemb(json->vbuf_internal); |
|
| 559 } |
555 } |
| 560 |
556 |
| 561 void cxJsonDestroy(CxJson *json) { |
557 void cxJsonDestroy(CxJson *json) { |
| 562 cxBufferDestroy(&json->buffer); |
558 cxBufferDestroy(&json->buffer); |
| 563 if (json->states.data != json->states_internal) { |
559 if (json->states.data != json->states_internal) { |