json-parser.c revision a01faca549a403b2eda938cea0b1fb76c3ff44b6
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi/* Copyright (c) 2013-2017 Dovecot authors, see the included COPYING file */
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi const char *error;
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomistatic int json_parser_read_more(struct json_parser *parser)
f089a10e4816e772992346c9837ec10db3894c65Timo Sirainen i_assert(parser->highwater_offset <= cur_highwater);
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi /* call it once more to finish any pending number */
ff95c6488eb3239654ed7fd51ed787a6b2c44506Timo Sirainen } else if (ret <= 0) {
316cbe323513a0f20d1cf519fe9405e231d633e2Aki Tuomi i_assert(parser->highwater_offset < cur_highwater);
if (size > 0) {
return parser;
return TRUE;
return FALSE;
chr = 0;
hi_surg);
const char **value_r)
int ret;
return ret;
int ret;
return ret;
int ret;
return ret;
return ret;
return ret;
unsigned count;
const char **value_r)
int ret;
case JSON_STATE_ROOT:
case JSON_STATE_OBJECT_VALUE:
case JSON_STATE_ARRAY_VALUE:
case JSON_STATE_VALUE:
if (ret == 0) {
case JSON_STATE_OBJECT_VALUE:
case JSON_STATE_ARRAY_VALUE:
case JSON_STATE_VALUE:
i_unreached();
case JSON_STATE_OBJECT_OPEN:
case JSON_STATE_OBJECT_KEY:
case JSON_STATE_OBJECT_COLON:
case JSON_STATE_OBJECT_NEXT:
case JSON_STATE_ARRAY_OPEN:
case JSON_STATE_ARRAY_NEXT:
case JSON_STATE_DONE:
const char **value_r)
int ret;
if (ret > 0)
return ret;
int ret;
return ret;
switch (src) {
size_t i;
for (i = 0; i < size; i++)