1
0
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
623 B

#include <stdio.h>
#include "j2s.h"
#include "j2s_generated_template_json.h"
int main(int argc, char** argv) {
j2s_ctx ctx;
char *buf;
int ret = -1;
FILE* json_file = NULL;
j2s_init(&ctx);
ctx.format_json = true;
ctx.dump_desc = true;
printf("Dump template JSON\n");
buf = j2s_dump_template_root_struct(&ctx);
DASSERT(buf, goto err);
printf("Result:\n%s\n", buf);
free(buf);
json_file = fopen("rkaiq_ui_template.json","w");
fprintf(json_file, "%s\n", _j2s_template_json);
printf("Dump template JSON:\n%s\n", _j2s_template_json);
err:
fclose(json_file);
j2s_deinit(&ctx);
return ret;
}