objdump.c (275223) | objdump.c (279549) |
---|---|
1/* Copyright (c) 2013, Dmitriy V. Reshetnikov 2 * Copyright (c) 2013, Vsevolod Stakhov 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are met: 7 * * Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 32 unchanged lines hidden (view full) --- 41 42 tmp = obj; 43 44 while ((obj = ucl_iterate_object (tmp, &it, false))) { 45 printf ("%sucl object address: %p\n", pre + 4, obj); 46 if (obj->key != NULL) { 47 printf ("%skey: \"%s\"\n", pre, ucl_object_key (obj)); 48 } | 1/* Copyright (c) 2013, Dmitriy V. Reshetnikov 2 * Copyright (c) 2013, Vsevolod Stakhov 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are met: 7 * * Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 32 unchanged lines hidden (view full) --- 41 42 tmp = obj; 43 44 while ((obj = ucl_iterate_object (tmp, &it, false))) { 45 printf ("%sucl object address: %p\n", pre + 4, obj); 46 if (obj->key != NULL) { 47 printf ("%skey: \"%s\"\n", pre, ucl_object_key (obj)); 48 } |
49 printf ("%sref: %hd\n", pre, obj->ref); | 49 printf ("%sref: %u\n", pre, obj->ref); |
50 printf ("%slen: %u\n", pre, obj->len); 51 printf ("%sprev: %p\n", pre, obj->prev); 52 printf ("%snext: %p\n", pre, obj->next); 53 if (obj->type == UCL_OBJECT) { 54 printf ("%stype: UCL_OBJECT\n", pre); 55 printf ("%svalue: %p\n", pre, obj->value.ov); 56 it_obj = NULL; 57 while ((cur = ucl_iterate_object (obj, &it_obj, true))) { 58 ucl_obj_dump (cur, shift + 2); 59 } 60 } 61 else if (obj->type == UCL_ARRAY) { 62 printf ("%stype: UCL_ARRAY\n", pre); 63 printf ("%svalue: %p\n", pre, obj->value.av); | 50 printf ("%slen: %u\n", pre, obj->len); 51 printf ("%sprev: %p\n", pre, obj->prev); 52 printf ("%snext: %p\n", pre, obj->next); 53 if (obj->type == UCL_OBJECT) { 54 printf ("%stype: UCL_OBJECT\n", pre); 55 printf ("%svalue: %p\n", pre, obj->value.ov); 56 it_obj = NULL; 57 while ((cur = ucl_iterate_object (obj, &it_obj, true))) { 58 ucl_obj_dump (cur, shift + 2); 59 } 60 } 61 else if (obj->type == UCL_ARRAY) { 62 printf ("%stype: UCL_ARRAY\n", pre); 63 printf ("%svalue: %p\n", pre, obj->value.av); |
64 ucl_obj_dump (obj->value.av, shift + 2); | 64 it_obj = NULL; 65 while ((cur = ucl_iterate_object (obj, &it_obj, true))) { 66 ucl_obj_dump (cur, shift + 2); 67 } |
65 } 66 else if (obj->type == UCL_INT) { 67 printf ("%stype: UCL_INT\n", pre); 68 printf ("%svalue: %jd\n", pre, (intmax_t)ucl_object_toint (obj)); 69 } 70 else if (obj->type == UCL_FLOAT) { 71 printf ("%stype: UCL_FLOAT\n", pre); 72 printf ("%svalue: %f\n", pre, ucl_object_todouble (obj)); --- 18 unchanged lines hidden (view full) --- 91 92 free (pre); 93} 94 95int 96main(int argc, char **argv) 97{ 98 const char *fn = NULL; | 68 } 69 else if (obj->type == UCL_INT) { 70 printf ("%stype: UCL_INT\n", pre); 71 printf ("%svalue: %jd\n", pre, (intmax_t)ucl_object_toint (obj)); 72 } 73 else if (obj->type == UCL_FLOAT) { 74 printf ("%stype: UCL_FLOAT\n", pre); 75 printf ("%svalue: %f\n", pre, ucl_object_todouble (obj)); --- 18 unchanged lines hidden (view full) --- 94 95 free (pre); 96} 97 98int 99main(int argc, char **argv) 100{ 101 const char *fn = NULL; |
99 char inbuf[8192]; | 102 unsigned char inbuf[8192]; |
100 struct ucl_parser *parser; 101 int k, ret = 0, r = 0; 102 ucl_object_t *obj = NULL; 103 const ucl_object_t *par; 104 FILE *in; 105 106 if (argc > 1) { 107 fn = argv[1]; --- 53 unchanged lines hidden --- | 103 struct ucl_parser *parser; 104 int k, ret = 0, r = 0; 105 ucl_object_t *obj = NULL; 106 const ucl_object_t *par; 107 FILE *in; 108 109 if (argc > 1) { 110 fn = argv[1]; --- 53 unchanged lines hidden --- |