Merge pull request #576 from nkigen/patch-2

New MACRO for creating jsontree_array
This commit is contained in:
George Oikonomou 2014-04-04 09:13:31 +01:00
commit 1d690995f6

View file

@ -116,6 +116,13 @@ struct jsontree_array {
sizeof(jsontree_pair_##name)/sizeof(struct jsontree_pair), \ sizeof(jsontree_pair_##name)/sizeof(struct jsontree_pair), \
jsontree_pair_##name } jsontree_pair_##name }
#define JSONTREE_ARRAY(name, count) \
static struct jsontree_value *jsontree_value##name[count]; \
static struct jsontree_array name = { \
JSON_TYPE_ARRAY, \
count, \
jsontree_value##name }
void jsontree_setup(struct jsontree_context *js_ctx, void jsontree_setup(struct jsontree_context *js_ctx,
struct jsontree_value *root, int (* putchar)(int)); struct jsontree_value *root, int (* putchar)(int));
void jsontree_reset(struct jsontree_context *js_ctx); void jsontree_reset(struct jsontree_context *js_ctx);