From 949ea05f1af647834db24b9172ac006488d2e4f4 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 26 Sep 2016 11:20:07 +0200 Subject: libsmartcols: support custom wrap and remove SCOLS_FL_WRAPNL This new API provides full control on multi-line cells, you can wrap text by new lines (build-in support) or by another way (after words, commas, etc.) Changes: * new scols_column_set_wrapfunc() sets pointers to two callback functions 1/ chunksize() - returns largest data chunk size; used when we calculate columns width 2/ nextchunk() - terminate the current chunk and returns pointer to the next; used when we print data * remove SCOLS_FL_WRAPNL and add new functions scols_wrapnl_chunksize() and scols_wrapnl_nextchunk() to provide build-in functionality to wrap cells on \n * remove scols_column_is_wrapnl() add scols_column_is_customwrap() (returns true if custom wrap functions are defined) * add scols_column_set_safechars() and scols_column_get_safechars() to allow to control output encoding, safe chars are not encoded by \xFOO * modify "fromfile" test code to use build-in scols_wrapnl_* callbacks for "wrapnl" tests * add new function scols_column_get_table() Signed-off-by: Karel Zak --- libsmartcols/docs/libsmartcols-sections.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libsmartcols/docs') diff --git a/libsmartcols/docs/libsmartcols-sections.txt b/libsmartcols/docs/libsmartcols-sections.txt index 12366bd34..f05d45479 100644 --- a/libsmartcols/docs/libsmartcols-sections.txt +++ b/libsmartcols/docs/libsmartcols-sections.txt @@ -21,7 +21,10 @@ libscols_column scols_column_get_color scols_column_get_flags scols_column_get_header +scols_column_get_safechars; +scols_column_get_table; scols_column_get_whint +scols_column_is_customwrap; scols_column_is_hidden scols_column_is_noextremes scols_column_is_right @@ -29,15 +32,18 @@ scols_column_is_strict_width scols_column_is_tree scols_column_is_trunc scols_column_is_wrap -scols_column_is_wrapnl scols_column_set_cmpfunc scols_column_set_color scols_column_set_flags +scols_column_set_safechars; scols_column_set_whint +scols_column_set_wrapfunc; scols_copy_column scols_new_column scols_ref_column scols_unref_column +scols_wrapnl_chunksize; +scols_wrapnl_nextchunk;
-- cgit v1.2.3-55-g7522