|
@@ -64,7 +64,7 @@ static inline void spa_json_enter(struct spa_json * iter, struct spa_json * sub) |
|
|
static inline int spa_json_next(struct spa_json * iter, const char **value)
|
|
|
{
|
|
|
int utf8_remain = 0;
|
|
|
enum { __NONE, __STRUCT, __BARE, __STRING, __UTF8, __ESC };
|
|
|
enum { __NONE, __STRUCT, __BARE, __STRING, __UTF8, __ESC, __COMMENT };
|
|
|
|
|
|
for (; iter->cur < iter->end; iter->cur++) {
|
|
|
unsigned char cur = (unsigned char)*iter->cur;
|
|
@@ -96,25 +99,21 @@ static inline int spa_json_next(struct spa_json * iter, const char **value) |
|
|
}
|
|
|
--iter->depth;
|
|
|
continue;
|
|
|
case '-': case '+': case 'a' ... 'z': case 'A' ... 'Z': case '0' ... '9':
|
|
|
default:
|
|
|
*value = iter->cur;
|
|
|
iter->state = __BARE;
|
|
|
continue;
|
|
|
}
|
|
|
return -1;
|
|
|
continue;
|
|
|
case __BARE:
|
|
|
switch (cur) {
|
|
|
case '\t': case ' ': case '\r': case '\n':
|
|
|
case ':': case ',': case ']': case '}':
|
|
|
case ':': case ',': case '=': case ']': case '}':
|
|
|
iter->state = __STRUCT;
|
|
|
if (iter->depth > 0)
|
|
|
goto again;
|
|
|
return iter->cur - *value;
|
|
|
default:
|
|
|
if (cur >= 32 && cur <= 126)
|
|
|
continue;
|
|
|
}
|
|
|
return -1;
|
|
|
continue;
|
|
|
case __STRING:
|
|
|
switch (cur) {
|
|
|
case '\\':
|