diff options
author | Timo Teräs <timo.teras@iki.fi> | 2021-12-27 14:34:01 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2023-03-03 13:00:10 +0200 |
commit | d351992ad529dccb95fc1c8997cd328e9c694a92 (patch) | |
tree | d4d54f32b1254b779557eea82fd78391c0063661 /src/apk_print.h | |
parent | fd8f39f1d54c3b56d16a494898e5a753e2c71715 (diff) | |
download | apk-tools-d351992ad529dccb95fc1c8997cd328e9c694a92.tar.gz apk-tools-d351992ad529dccb95fc1c8997cd328e9c694a92.tar.bz2 apk-tools-d351992ad529dccb95fc1c8997cd328e9c694a92.tar.xz apk-tools-d351992ad529dccb95fc1c8997cd328e9c694a92.zip |
print: improve indented printing api2.12-stable
- make sure all commit errors go to stderr
- make it a bit more api like
(cherry picked and rebased from commit a662047e2c43604bc087ec4dda9a7358368d850b)
fixes #10879
Diffstat (limited to 'src/apk_print.h')
-rw-r--r-- | src/apk_print.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/apk_print.h b/src/apk_print.h index 1d5dfd6..f8a2003 100644 --- a/src/apk_print.h +++ b/src/apk_print.h @@ -41,11 +41,16 @@ int apk_get_screen_width(void); const char *apk_get_human_size(off_t size, off_t *dest); struct apk_indent { - int x; - int indent; + FILE *f; + unsigned int x, indent, width; }; void apk_print_progress(size_t done, size_t total); + +void apk_print_indented_init(struct apk_indent *i, int err); +void apk_print_indented_line(struct apk_indent *i, const char *fmt, ...); +void apk_print_indented_group(struct apk_indent *i, int indent, const char *fmt, ...); +void apk_print_indented_end(struct apk_indent *i); int apk_print_indented(struct apk_indent *i, apk_blob_t blob); void apk_print_indented_words(struct apk_indent *i, const char *text); void apk_print_indented_fmt(struct apk_indent *i, const char *fmt, ...) |