spa: add spa_json_begin

That combines spa_json_init() and spa_json_next, a common thing to do.
This commit is contained in:
Wim Taymans 2024-09-13 09:22:27 +02:00
parent 08057e0328
commit feccb882b6
7 changed files with 15 additions and 18 deletions

View file

@ -356,6 +356,12 @@ static inline bool spa_json_get_error(struct spa_json *iter, const char *start,
return true;
}
static inline int spa_json_begin(struct spa_json * iter, const char *data, size_t size, const char **val)
{
spa_json_init(iter, data, size);
return spa_json_next(iter, val);
}
static inline int spa_json_enter_container(struct spa_json *iter, struct spa_json *sub, char type)
{
const char *value;