summaryrefslogtreecommitdiffstats
path: root/libsmartcols/src/smartcolsP.h
diff options
context:
space:
mode:
authorKarel Zak2018-10-25 16:01:23 +0200
committerKarel Zak2018-12-07 12:33:34 +0100
commit06a8decd724b9c11801ed60794d541bc4ad2f3bb (patch)
tree2a9c04853d16edbdd63739ec7b4801bead1806e9 /libsmartcols/src/smartcolsP.h
parentlibsmartcols: rename table_print.c to print.c (diff)
downloadkernel-qcow2-util-linux-06a8decd724b9c11801ed60794d541bc4ad2f3bb.tar.gz
kernel-qcow2-util-linux-06a8decd724b9c11801ed60794d541bc4ad2f3bb.tar.xz
kernel-qcow2-util-linux-06a8decd724b9c11801ed60794d541bc4ad2f3bb.zip
libsmartcols: move width calculation to separate file
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libsmartcols/src/smartcolsP.h')
-rw-r--r--libsmartcols/src/smartcolsP.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/libsmartcols/src/smartcolsP.h b/libsmartcols/src/smartcolsP.h
index 6fa739045..94a2bc242 100644
--- a/libsmartcols/src/smartcolsP.h
+++ b/libsmartcols/src/smartcolsP.h
@@ -115,6 +115,9 @@ struct libscols_column {
struct libscols_table *table;
};
+#define colsep(tb) ((tb)->colsep ? (tb)->colsep : " ")
+#define linesep(tb) ((tb)->linesep ? (tb)->linesep : "\n")
+
/*
* Table line
*/
@@ -214,6 +217,8 @@ static inline int scols_iter_is_last(const struct libscols_iter *itr)
return itr->p == itr->head;
}
+
+
/*
* buffer.c
*/
@@ -232,6 +237,18 @@ extern char *buffer_get_safe_data(struct libscols_table *tb,
const char *safechars);
extern size_t buffer_get_safe_art_size(struct libscols_buffer *buf);
+/*
+ * calculate.c
+ */
+extern int __scols_calculate(struct libscols_table *tb, struct libscols_buffer *buf);
+
+/*
+ * print.c
+ */
+extern int __cell_to_buffer(struct libscols_table *tb,
+ struct libscols_line *ln,
+ struct libscols_column *cl,
+ struct libscols_buffer *buf);
static inline int is_last_child(struct libscols_line *ln)
{