wip
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
diff --git a/libkc3/buf_inspect_u16_decimal.h b/libkc3/buf_inspect_u16_decimal.h
index 105099d..d26361e 100644
--- a/libkc3/buf_inspect_u16_decimal.h
+++ b/libkc3/buf_inspect_u16_decimal.h
@@ -16,7 +16,7 @@
#include "types.h"
-sw buf_inspect_u16_decimal (s_buf *buf, const u16 *u);
-sw buf_inspect_u16_decimal_size (const u16 *u);
+sw buf_inspect_u16_decimal (s_pretty *pretty, s_buf *buf, const u16 *u);
+sw buf_inspect_u16_decimal_size (s_pretty *pretty, const u16 *u);
#endif /* LIBKC3_BUF_INSPECT_U16_decimal_H */
diff --git a/libkc3/buf_inspect_u32_decimal.h b/libkc3/buf_inspect_u32_decimal.h
index a45f5d1..86ff55a 100644
--- a/libkc3/buf_inspect_u32_decimal.h
+++ b/libkc3/buf_inspect_u32_decimal.h
@@ -16,7 +16,7 @@
#include "types.h"
-sw buf_inspect_u32_decimal (s_buf *buf, const u32 *u);
-sw buf_inspect_u32_decimal_size (const u32 *u);
+sw buf_inspect_u32_decimal (s_pretty *pretty, s_buf *buf, const u32 *u);
+sw buf_inspect_u32_decimal_size (s_pretty *pretty, const u32 *u);
#endif /* LIBKC3_BUF_INSPECT_U32_decimal_H */
diff --git a/libkc3/buf_inspect_u64_decimal.h b/libkc3/buf_inspect_u64_decimal.h
index 212e36f..8a2bde6 100644
--- a/libkc3/buf_inspect_u64_decimal.h
+++ b/libkc3/buf_inspect_u64_decimal.h
@@ -16,7 +16,7 @@
#include "types.h"
-sw buf_inspect_u64_decimal (s_buf *buf, const u64 *u);
-sw buf_inspect_u64_decimal_size (const u64 *u);
+sw buf_inspect_u64_decimal (s_pretty *pretty, s_buf *buf, const u64 *u);
+sw buf_inspect_u64_decimal_size (s_pretty *pretty, const u64 *u);
#endif /* LIBKC3_BUF_INSPECT_U64_decimal_H */
diff --git a/libkc3/buf_inspect_u8_decimal.h b/libkc3/buf_inspect_u8_decimal.h
index 069ad9d..eb95ca9 100644
--- a/libkc3/buf_inspect_u8_decimal.h
+++ b/libkc3/buf_inspect_u8_decimal.h
@@ -16,7 +16,7 @@
#include "types.h"
-sw buf_inspect_u8_decimal (s_buf *buf, const u8 *u);
-sw buf_inspect_u8_decimal_size (const u8 *u);
+sw buf_inspect_u8_decimal (s_pretty *pretty, s_buf *buf, const u8 *u);
+sw buf_inspect_u8_decimal_size (s_pretty *pretty, const u8 *u);
#endif /* LIBKC3_BUF_INSPECT_U8_decimal_H */
diff --git a/libkc3/buf_inspect_u_base.h.in b/libkc3/buf_inspect_u_base.h.in
index 4f50989..61204d2 100644
--- a/libkc3/buf_inspect_u_base.h.in
+++ b/libkc3/buf_inspect_u_base.h.in
@@ -16,7 +16,7 @@
#include "types.h"
-sw buf_inspect_u_bits$__BASE$ (s_buf *buf, const u_bits$ *u);
-sw buf_inspect_u_bits$__BASE$_size (const u_bits$ *u);
+sw buf_inspect_u_bits$__BASE$ (s_pretty *pretty, s_buf *buf, const u_bits$ *u);
+sw buf_inspect_u_bits$__BASE$_size (s_pretty *pretty, const u_bits$ *u);
#endif /* LIBKC3_BUF_INSPECT_U_BITS$__BASE$_H */
diff --git a/libkc3/buf_inspect_uw_decimal.h b/libkc3/buf_inspect_uw_decimal.h
index 887ac48..aa6e148 100644
--- a/libkc3/buf_inspect_uw_decimal.h
+++ b/libkc3/buf_inspect_uw_decimal.h
@@ -16,7 +16,7 @@
#include "types.h"
-sw buf_inspect_uw_decimal (s_buf *buf, const uw *u);
-sw buf_inspect_uw_decimal_size (const uw *u);
+sw buf_inspect_uw_decimal (s_pretty *pretty, s_buf *buf, const uw *u);
+sw buf_inspect_uw_decimal_size (s_pretty *pretty, const uw *u);
#endif /* LIBKC3_BUF_INSPECT_UW_decimal_H */
diff --git a/libkc3/inspect.c b/libkc3/inspect.c
index c46d9ee..6561eb0 100644
--- a/libkc3/inspect.c
+++ b/libkc3/inspect.c
@@ -27,7 +27,7 @@ s_str * inspect_array (const s_array *array, s_str *dest)
return NULL;
}
buf_init_alloc(&tmp, size);
- buf_inspect_array(&tmp, array);
+ buf_inspect_array(&pretty, &tmp, array);
if (tmp.wpos != tmp.size) {
err_puts("inspect_array: tmp.wpos != tmp.size");
assert(! "inspect_array: tmp.wpos != tmp.size");
@@ -51,7 +51,7 @@ s_str * inspect_block (const s_block *x, s_str *dest)
}
if (! buf_init_alloc(&buf, size))
return NULL;
- if ((r = buf_inspect_block(&buf, x)) < 0)
+ if ((r = buf_inspect_block(&pretty, &buf, x)) < 0)
goto error;
assert(r == size);
if (r != size)
@@ -66,7 +66,7 @@ s_str * inspect_bool (bool *b, s_str *dest)
{
sw size;
s_buf tmp;
- size = buf_inspect_bool_size(b);
+ size = buf_inspect_bool_size(&pretty, b);
if (size < 0) {
err_write_1("inspect_bool: error: ");
err_inspect_u8(b);
@@ -74,7 +74,7 @@ s_str * inspect_bool (bool *b, s_str *dest)
return NULL;
}
buf_init_alloc(&tmp, size);
- buf_inspect_bool(&tmp, b);
+ buf_inspect_bool(&pretty, &tmp, b);
assert(tmp.wpos == tmp.size);
if (tmp.wpos != tmp.size) {
buf_clean(&tmp);
@@ -88,13 +88,13 @@ s_str * inspect_sym (const s_sym *sym, s_str *dest)
{
sw size;
s_buf tmp = {0};
- size = buf_inspect_sym_size(&sym);
+ size = buf_inspect_sym_size(&pretty, &sym);
if (size < 0) {
assert(! "error");
return NULL;
}
buf_init_alloc(&tmp, size);
- buf_inspect_sym(&tmp, &sym);
+ buf_inspect_sym(&pretty, &tmp, &sym);
assert(tmp.wpos == tmp.size);
return buf_to_str(&tmp, dest);
}
@@ -105,13 +105,13 @@ s_str * inspect_tag (const s_tag *tag, s_str *dest)
sw size;
assert(tag);
assert(dest);
- if ((size = buf_inspect_tag_size(tag)) < 0) {
+ if ((size = buf_inspect_tag_size(&pretty, tag)) < 0) {
err_puts("tag_inspect: size error");
assert(! "tag_inspect: size error");
return NULL;
}
buf_init_alloc(&buf, size);
- if (buf_inspect_tag(&buf, tag) != size) {
+ if (buf_inspect_tag(&pretty, &buf, tag) != size) {
err_puts("tag_inspect: inspect error");
assert(! "tag_inspect: inspect error");
return NULL;