summaryrefslogtreecommitdiffstats
path: root/test/json.c
blob: 33083dd462de736f438494f73621997388d1fa67 (plain) (blame)
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 = dc_json_init();
	char * o;
	for (int i = 1; i < argc; i++)
		if ((o = dc_json(handler, argv[i], strlen(argv[i])))) {
			printf("%s\n", o);
			while ((o = dc_json(handler, NULL, 0)))
				printf("%s\n", o);
		}
	dc_json_free(handler);
}