1
0
mirror of https://github.com/stedolan/jq.git synced 2024-05-11 05:55:39 +00:00

Add jv_dumpf() and jv_show()

jv_dumpf() takes a FILE *.

jv_show() is intended for use in debuggers, so it dumps the jv to stderr
and it does not jv_free() the jv, so it's safe to
"call jv_show(some_jv, -1)" in a debugger.  If flags == -1 then the jv
will be shown pretty-printed and in color.
This commit is contained in:
Nicolas Williams
2013-12-26 18:37:17 -06:00
parent cb976b9a50
commit a71138a43a
2 changed files with 16 additions and 3 deletions

3
jv.h
View File

@@ -3,6 +3,7 @@
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
typedef enum {
JV_KIND_INVALID,
@@ -124,7 +125,9 @@ jv jv_object_iter_value(jv, int);
int jv_get_refcnt(jv);
enum { JV_PRINT_PRETTY = 1, JV_PRINT_ASCII = 2, JV_PRINT_COLOUR = 4, JV_PRINT_SORTED = 8, JV_PRINT_UNBUFFERED = 16 };
void jv_dumpf(jv, FILE *f, int flags);
void jv_dump(jv, int flags);
void jv_show(jv, int flags);
jv jv_dump_string(jv, int flags);
jv jv_parse(const char* string);