1006:8ee818fa29f7 | 1007:81b2986d2b04 |
---|---|
37 #define UCX_JSON_H | 37 #define UCX_JSON_H |
38 | 38 |
39 #include "common.h" | 39 #include "common.h" |
40 #include "allocator.h" | 40 #include "allocator.h" |
41 #include "string.h" | 41 #include "string.h" |
42 #include "buffer.h" | |
42 #include "array_list.h" | 43 #include "array_list.h" |
43 | 44 |
44 #ifdef __cplusplus | 45 #ifdef __cplusplus |
45 extern "C" { | 46 extern "C" { |
46 #endif | 47 #endif |
127 cxmutstr content; | 128 cxmutstr content; |
128 }; | 129 }; |
129 | 130 |
130 struct cx_json_s { | 131 struct cx_json_s { |
131 const CxAllocator *allocator; | 132 const CxAllocator *allocator; |
132 const char *buffer; | 133 CxBuffer buffer; |
133 size_t size; | |
134 size_t pos; | |
135 | 134 |
136 CxJsonToken uncompleted; | 135 CxJsonToken uncompleted; |
137 | 136 |
138 /** | 137 /** |
139 * A pointer to an intermediate state of the currently parsed value. | 138 * A pointer to an intermediate state of the currently parsed value. |
191 * by checking if the status is less than \c CX_JSON_OK. | 190 * by checking if the status is less than \c CX_JSON_OK. |
192 * | 191 * |
193 * A "good" status means, that you can refill data and continue parsing. | 192 * A "good" status means, that you can refill data and continue parsing. |
194 */ | 193 */ |
195 CX_JSON_OK, | 194 CX_JSON_OK, |
196 /** | |
197 * Input buffer is \c NULL. | |
198 */ | |
199 CX_JSON_NULL_INPUT, | |
200 /** | 195 /** |
201 * Allocating memory for the internal buffer failed. | 196 * Allocating memory for the internal buffer failed. |
202 */ | 197 */ |
203 CX_JSON_BUFFER_ALLOC_FAILED, | 198 CX_JSON_BUFFER_ALLOC_FAILED, |
204 /** | 199 /** |