modified: src/lib/jsmn/example/jsondump.c
new file: src/lib/jsmn/example/maptest2
modified: src/lib/jsmn/example/maptest2.c
int eof_expected = 0;
char *js = NULL;
size_t jslen = 0;
int eof_expected = 0;
char *js = NULL;
size_t jslen = 0;
jsmn_parser p;
jsmntok_t *tok;
jsmn_parser p;
jsmntok_t *tok;
"\"groups\": [\"users\", \"wheel\", \"audio\", \"video\"]}";*/
char *JSON_STRING;
"\"groups\": [\"users\", \"wheel\", \"audio\", \"video\"]}";*/
char *JSON_STRING;
long int filesize(FILE *fp)\r
{\r
long int filesize(FILE *fp)\r
{\r
jsmn_parser p;
FILE *fh = fopen("../../../../data/test.map", "r");
jsmntok_t *t; /* We expect no more than 128 tokens */
jsmn_parser p;
FILE *fh = fopen("../../../../data/test.map", "r");
jsmntok_t *t; /* We expect no more than 128 tokens */
+ size_t tokcount = 2048;
/* Allocate some tokens as a start */
t = malloc(sizeof(*t) * tokcount);
/* Allocate some tokens as a start */
t = malloc(sizeof(*t) * tokcount);
- char JSON_S[BUFSIZ];
- memset(JSON_S, 0, sizeof(JSON_S));
+ //memset(JSON_S, 0, sizeof(JSON_S));
- fread(JSON_S, sizeof(char), filesize(fh), fh);
+ fread(JSON_S, 1, filesize(fh), fh);
// we can now close the file
//printf("]%s[\n", JSON_S);
JSON_STRING=JSON_S;
// we can now close the file
//printf("]%s[\n", JSON_S);
JSON_STRING=JSON_S;