diff options
author | bapt <bapt@FreeBSD.org> | 2014-07-19 23:44:57 +0000 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2014-07-19 23:44:57 +0000 |
commit | 6f718e3669e9ecc1b1ca407a465d6ee20571a2b8 (patch) | |
tree | ba71cc26671c93ed9809f7cadb07734c0bddb4c7 /contrib/libucl/utils/objdump.c | |
parent | 6095428430d025abcf6983536297f168bf62b45b (diff) | |
download | FreeBSD-src-6f718e3669e9ecc1b1ca407a465d6ee20571a2b8.zip FreeBSD-src-6f718e3669e9ecc1b1ca407a465d6ee20571a2b8.tar.gz |
MFC: r263648, r264789, r266636
This brings:
- schema validation
- xpath-like interface for ucl objects
Adapt pkg(7) to the new libucl API
Diffstat (limited to 'contrib/libucl/utils/objdump.c')
-rw-r--r-- | contrib/libucl/utils/objdump.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/contrib/libucl/utils/objdump.c b/contrib/libucl/utils/objdump.c index 8bf6e28..2e00d0a 100644 --- a/contrib/libucl/utils/objdump.c +++ b/contrib/libucl/utils/objdump.c @@ -28,11 +28,11 @@ #include "ucl.h" void -ucl_obj_dump(ucl_object_t *obj, unsigned int shift) +ucl_obj_dump (const ucl_object_t *obj, unsigned int shift) { int num = shift * 4 + 5; char *pre = (char *) malloc (num * sizeof(char)); - ucl_object_t *cur, *tmp; + const ucl_object_t *cur, *tmp; ucl_object_iter_t it = NULL, it_obj = NULL; pre[--num] = 0x00; @@ -64,7 +64,7 @@ ucl_obj_dump(ucl_object_t *obj, unsigned int shift) } else if (obj->type == UCL_INT) { printf ("%stype: UCL_INT\n", pre); - printf ("%svalue: %ld\n", pre, ucl_object_toint (obj)); + printf ("%svalue: %jd\n", pre, (intmax_t)ucl_object_toint (obj)); } else if (obj->type == UCL_FLOAT) { printf ("%stype: UCL_FLOAT\n", pre); @@ -99,7 +99,7 @@ main(int argc, char **argv) struct ucl_parser *parser; int k, ret = 0, r = 0; ucl_object_t *obj = NULL; - ucl_object_t *par; + const ucl_object_t *par; FILE *in; if (argc > 1) { @@ -129,7 +129,7 @@ main(int argc, char **argv) } obj = ucl_parser_get_object (parser); - if (ucl_parser_get_error(parser)) { + if (ucl_parser_get_error (parser)) { printf ("Error occured: %s\n", ucl_parser_get_error(parser)); ret = 1; goto end; |