summaryrefslogblamecommitdiffstats
path: root/test/json.c
blob: 66716282cefe1eb942cefc5f9e7b0b750bd51e10 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15














                                                                     
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <json.c>
int main (int argc, char ** argv) {
	struct dc_json * handler = calloc(1, sizeof(struct dc_json));
	char * o;
	for (int i = 1; i < argc; i++)
		if ((o = dc_json(handler, argv[i]))) {
			printf("%s\n", o);
			while ((o = dc_json(handler, "")))
				printf("%s\n", o);
		}
	dc_json_free(handler);
}