Commit Graph

249 Commits

Author SHA1 Message Date
Igor Gnatenko 43e06c67f9 libsmartcols: add scols_table_is_nolinesep()
And save 1 or 0 into tb->no_linesep instead of any value.

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-09-23 14:21:15 +02:00
Igor Gnatenko 8427c2ec9c libsmartcols: add scols_table_is_nowrap()
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-09-23 14:20:41 +02:00
Karel Zak 63168cf9b5 libsmartcols: cleanup scols_table_set_symbols() API
Change behavior:
  * scols_table_set_symbols(tb, NULL) remove reference to the current symbols setting
    and does not set default symbols at all

Add new functions:
  * scols_table_get_symbols()
  * scols_table_set_default_symbols()

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-23 14:20:24 +02:00
Igor Gnatenko 9696071737 libsmartcols: add scols_table_get_name()
Currently we have scols_table_set_name() but don't have getter for it.

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-09-23 14:11:34 +02:00
Igor Gnatenko e0140aa138 libsmartcols: use const qualifier for scols_table_get_termwidth
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-09-23 11:27:35 +02:00
Karel Zak 266eecd54e Merge branch 'api_const' of https://github.com/ignatenkobrain/util-linux
* 'api_const' of https://github.com/ignatenkobrain/util-linux:
  libsmartcols: use const qualifier where it's possible
  debug: use const void * for ul_debugobj()
  libsmartcols: make get_line/column_separator() return const
2016-09-23 11:14:15 +02:00
Karel Zak 02aaba6f9f libsmartcols: keep scols_table_get_termwidth() read-only
Addresses: https://github.com/karelzak/util-linux/issues/356
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-22 13:47:23 +02:00
Igor Gnatenko f7a9ea28ef libsmartcols: use const qualifier where it's possible
Closes: https://github.com/karelzak/util-linux/issues/355
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-09-21 08:36:00 +02:00
Igor Gnatenko 0e0943c15b debug: use const void * for ul_debugobj()
We don't modify data it's pointing out and we should not modify it.

Also remove casting to void * as gcc will do it automatically (before
we had to cast it explicitly to avoid warning on discarding 'const'
qualifier).

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-09-21 08:22:35 +02:00
Igor Gnatenko 6f9377ab81 libsmartcols: make get_line/column_separator() return const
The patch introduces tiny API changes (char * -> const char *) for
    scols_table_get_line_separator
    scols_table_get_column_separator

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-09-21 07:26:44 +02:00
Karel Zak 8f0c12f1c9 Merge branch 'hotfix' of https://github.com/ignatenkobrain/util-linux 2016-09-19 14:21:18 +02:00
Karel Zak ffd1325ddd Merge branch 'typos' of https://github.com/ignatenkobrain/util-linux
* 'typos' of https://github.com/ignatenkobrain/util-linux:
  libsmartcols: fix typos in docs
2016-09-19 14:20:37 +02:00
Igor Gnatenko 4fb899ed77 libsmartcols: be consistent, use 'sy' for symbols
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-09-19 14:13:51 +02:00
Igor Gnatenko bfc6941ae7 libsmartcols: fix typos in docs
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-09-19 14:13:38 +02:00
Karel Zak 4e91ebca3e libsmartcols: be more strict about empty tables
and don't print extra \n for empty table.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-19 14:07:38 +02:00
Karel Zak 166897ceb3 libsmartcols: fix comment
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-19 13:48:42 +02:00
Karel Zak d4275a4bde libsmartcols: cleanup get functions
The patch introduces tiny API changes (int -> size_t) for

	scols_table_get_ncols
	scols_table_get_nlines

Addresses: https://github.com/karelzak/util-linux/issues/349
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-19 13:39:03 +02:00
Karel Zak 695fd479be tests: add columns separator to libsmartcols test
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-16 14:18:01 +02:00
Karel Zak 4a2b50f238 tests: add export and raw to libsmartcols test
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-16 13:49:37 +02:00
Karel Zak 6a82714dbf libsmartcols: add JSON support to sample application
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-16 13:30:29 +02:00
Karel Zak 65f3ebc334 libsmartcols: improve JSON
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-16 13:22:47 +02:00
Karel Zak 346e3a40a0 libsmartcols: cleanup line separator usage
* use line separator only to separate lines, not after last line
 * explicitly print \n after table in scols_print_table()
 * don't terminate table by \n or line separator in scols_print_table_to_string()

Note that the patch is little bit trick due to impact to the trees
printing. Now print_tree_line() should be more readable.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-16 13:00:47 +02:00
Karel Zak 9aca40bbec libsmartcols: fix tree padding
We cannot use cell-padding char with in tree ASCII art, because
tree uses two chars rather than one.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-15 12:22:12 +02:00
Karel Zak 18ff51547d libsmartcols: add support for trees to the sample application
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-15 12:12:18 +02:00
Karel Zak 54c6de3d04 Merge branch 'patch-1' of https://github.com/ignatenkobrain/util-linux 2016-09-15 10:05:15 +02:00
Igor Gnatenko 8e7d9d231e trivial: s/automatical/automatic/g
"Automatical" is archaic form of "automatic".

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-09-14 19:36:51 +02:00
Igor Gnatenko 937e045855 smartcols/symbols: free cell_padding in unref()
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
2016-09-14 17:10:14 +02:00
Karel Zak 36eb51ebb4 tests: add libsmartcols title test
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-14 12:49:46 +02:00
Karel Zak fdf7279849 libsmartcols: fix hidden file usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-14 12:37:53 +02:00
Karel Zak 6db10580ca build-sys: remove dead libsmartcols sample
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-13 16:50:10 +02:00
Karel Zak a414a17093 tests: improve libsmartcols test
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-13 14:12:11 +02:00
Karel Zak 19055a25ed libsmartcols: add functions to control terminal usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-13 14:06:01 +02:00
Karel Zak fa4691833a libsmartcols: add application to test library features
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-13 13:08:02 +02:00
Karel Zak ef4a34bbb8 libsmartcols: fix WRAPNL on strings without \n
Addresses: https://github.com/karelzak/util-linux/issues/343
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-12 16:12:22 +02:00
Karel Zak 975ed32fd9 libsmartcols: fix WRAPNL crashes
Addresses: https://github.com/karelzak/util-linux/issues/344
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-12 11:58:34 +02:00
Karel Zak 37948503c9 libsmartcols: support LIBSMARTCOLS_DEBUG_PADDING=on
This env.variable forces libsmartcols to use visible padding chars.
The standard debug has to be enabled (to minimize overhead for
non-debug execution).

For example:

 $ LIBSMARTCOLS_DEBUG=all LIBSMARTCOLS_DEBUG_PADDING=on findmnt 2> ~/log

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-07 12:25:06 +02:00
Karel Zak f1f9b71736 libsmartcols: add fallback for symbols
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-07 11:45:35 +02:00
Karel Zak 64ce7cbbc0 libsmartcols: allow to change cell padding char
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-07 11:07:04 +02:00
Karel Zak a2b8ad291f libsmartcols: extend wrapnl sample
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-06 13:01:45 +02:00
Karel Zak 77a94efb5e libsmartcols: fix padding for non-maxout output
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-06 13:01:09 +02:00
Karel Zak 4f07ff4041 libsmartcols: remove debuging code from sample
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-06 12:24:49 +02:00
Karel Zak 6cd398642b libsmartcols: commit missing file
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-06 11:18:18 +02:00
Karel Zak ff471d89a1 libsmartcols: support multi-line cells based on line breaks
Now libsmartcols completely control when and how wrap long
lines/cells. This is sometimes user unfriendly and it would be nice to
support multi-line cells where wrap is based on \n (new line char).

This patch add new column flag SCOLS_FL_WRAPNL.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-06 10:51:25 +02:00
Karel Zak b54439cbad libsmartcols: use SCOLS_FL_RIGHT in sample
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-08-31 15:51:03 +02:00
Karel Zak 51962c95e3 libsmartcols: add maxout sample
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-08-31 15:15:28 +02:00
Karel Zak 5e6421ee07 libsmartcols: fix minimal column width calculation
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-08-31 15:13:06 +02:00
Karel Zak f067de4495 libsmartcols: fix non-tty output for 'maxout' columns
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-08-31 13:01:48 +02:00
Karel Zak a593128fd0 libsmartcols: fix title output on non-tty
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-08-31 12:42:38 +02:00
Karel Zak 066779c67b libsmartcols: fix scols_table_enable_colors() usage in samples
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-08-31 12:05:48 +02:00
Karel Zak d7cda881d5 libsmartcols: don't print title color is colors disabled
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-08-31 12:05:21 +02:00
Karel Zak 1ca2661bb8 libsmartcols: Corrected JSON escaping
Based on patch set https://github.com/karelzak/util-linux/pull/331
from Fordi.

Addresses: https://github.com/karelzak/util-linux/issues/330
Co-Author: Bryan Elliott <fordiman@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-08-02 12:05:05 +02:00
Karel Zak c191740c28 misc: cleanup non-widechar compilation
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-06-03 14:46:17 +02:00
Karel Zak 8f0ac57921 lib/ttyutils: use stdout for get_terminal_width()
We use the function to be sure with *output* width. Note that the
current code (with STDIN) is broken because in some situations
libsmartcols is not able to detect terminal width and fall back to
default 80.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-06-02 12:31:45 +02:00
Sebastian Rasmussen 9e93004171 misc: Fix various typos
Fix various typos in error messages, warnings, debug strings,
comments and names of static functions.

Signed-off-by: Sebastian Rasmussen <sebras@gmail.com>
2016-05-31 23:40:21 +02:00
Karel Zak 8fcdce8fff libsmartcols remove duplicate code
For petty long time we have strdup_to_struct_member() macro to avoid
duplicate code when strdup() strings in setter functions. Let's use it
for libmount.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-04-22 14:17:21 +02:00
Ruediger Meier 18336d16d9 build-sys: use AC_PROG_MKDIR_P and remove a few gnuisms
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-13 21:48:09 +01:00
Ruediger Meier 58c87bd045 misc: fix icc/clang compiler warnings
clang warning:
libmount/src/tab.c:1833:6: warning: variable 'rc' is used uninitialized whenever
      'if' condition is true [-Wsometimes-uninitialized]
        if (!mpc)
            ^~~~

icc printf warnings:
    libmount/src/monitor.c(348): warning #2279: printf/scanf format not a string literal and no format arguments
            DBG(MONITOR, ul_debugobj(mn, status == 1 ? " success" : " nothing"));
            ^
    login-utils/vipw.c(348): warning #2279: printf/scanf format not a string literal and no format arguments
                           : _("You are using shadow passwords on this system.\n"));
                                                                                  ^

icc enum warnings:
    disk-utils/fdisk-menu.c(150): warning #188: enumerated type mixed with another type
            .exclude = FDISK_DISKLABEL_GPT | FDISK_DISKLABEL_BSD,
                       ^
    libsmartcols/src/table_print.c(750): warning #188: enumerated type mixed with another type
                            &width, align,
                                    ^

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-13 21:47:27 +01:00
Karel Zak 5bb1d22e8a build-sys: fix if..endif for *_la_LDFLAGS
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-03-10 13:54:15 +01:00
Ruediger Meier dc0495166f build-sys: add and use openat build conditionals
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-07 15:37:25 +01:00
Ruediger Meier beabee7c67 libsmartcols: fix uninitialized variable
This got broken in 2a750b4c.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-29 13:04:54 +01:00
Karel Zak b64dc52a53 Merge branch 'ldadd-cflags-warnings' of https://github.com/rudimeier/util-linux
* 'ldadd-cflags-warnings' of https://github.com/rudimeier/util-linux:
  build-sys: disable unused parameter warnings for some test progs
  misc: fix compiler warnungs (unsigned/signed)
  misc: fix warnings "unused parameter" [-Wunused-parameter]
  libfdisk: fix warnings, "redundant redeclaration" [-Wredundant-decls]
  tests: fix compiler warnings [-Wmissing-prototypes]
  libfdisk: fix compiler warnings [-Wmissing-prototypes]
  libfdisk: fix missing symbol
  libblkid: fix compiler warnings [-Wmissing-prototypes]
  libmount: add mnt_fs_set_priority()
  build-sys: always add AM_CFLAGS
  build-sys: always use global LDADD
2016-02-24 13:51:10 +01:00
Karel Zak 1c3ed5bf17 libsmartcols: fix stupid typo
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-02-24 13:42:28 +01:00
Karel Zak cbe3e49535 libsmartcols: fix relative column width for maxout
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-02-24 12:34:37 +01:00
Ruediger Meier 2013b33f40 build-sys: disable unused parameter warnings for some test progs
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-23 03:20:22 +01:00
Ruediger Meier b9710f1f08 misc: fix compiler warnungs (unsigned/signed)
These ones should be fixed:
libblkid/src/probe.c:393:39: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libblkid/src/probe.c:907:25: warning: signed and unsigned type in conditional expression [-Wsign-compare]
libblkid/src/probe.c:1221:8: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libblkid/src/partitions/partitions.c:540:47: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libblkid/src/partitions/partitions.c:1043:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libblkid/src/partitions/partitions.c:1056:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libblkid/src/partitions/partitions.c:1057:37: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libblkid/src/partitions/partitions.c:1061:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libblkid/src/partitions/partitions.c:1199:27: warning: signed and unsigned type in conditional expression [-Wsign-compare]
libblkid/src/partitions/partitions.c:1410:26: warning: signed and unsigned type in conditional expression [-Wsign-compare]
libblkid/src/partitions/partitions.c:1431:25: warning: signed and unsigned type in conditional expression [-Wsign-compare]
libblkid/src/superblocks/linux_raid.c:151:8: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
libblkid/src/superblocks/linux_raid.c:155:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
libblkid/src/superblocks/superblocks.c:375:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libblkid/src/superblocks/xfs.c:141:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libsmartcols/src/table.c:333:24: warning: signed and unsigned type in conditional expression [-Wsign-compare]
libsmartcols/src/table.c:344:25: warning: signed and unsigned type in conditional expression [-Wsign-compare]
libsmartcols/src/table_print.c:753:9: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libfdisk/src/ask.c:364:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libfdisk/src/utils.c:33:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libfdisk/src/context.c:435:56: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libfdisk/src/context.c:730:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libfdisk/src/script.c:557:10: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libfdisk/src/dos.c:1791:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libfdisk/src/gpt.c:813:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
misc-utils/logger.c:408:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
misc-utils/logger.c:408:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
misc-utils/logger.c:408:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
misc-utils/logger.c:408:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
misc-utils/logger.c:408:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
disk-utils/partx.c:140:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
disk-utils/partx.c:551:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
disk-utils/partx.c:640:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-23 03:18:27 +01:00
Ruediger Meier 71177ab8f9 misc: fix warnings "unused parameter" [-Wunused-parameter]
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-23 03:18:24 +01:00
Ruediger Meier 5fde1d9f06 tests: fix compiler warnings [-Wmissing-prototypes]
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-23 03:18:09 +01:00
Ruediger Meier b0b54cc582 build-sys: always add AM_CFLAGS
We were missing our nice compliler warnings for many programs
and libs. See next commits how many trivial and non-trival
warnings have to be fixed.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-23 01:17:29 +01:00
Ruediger Meier b201f1d86c build-sys: always use global LDADD
This was a major showstopper when building on a system where
LTLIBINTL libs are needed (e.g. OSX). Maybe there are a few test
programs which wouldn't need LDADD ... never mind.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-23 01:16:58 +01:00
Karel Zak 334e5eba9e libsmartcols: fix scols_table_print_range() to print header
References: https://github.com/karelzak/util-linux/issues/287
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-02-22 10:43:25 +01:00
Igor Gnatenko cfa185721e libsmartcols: implement scols_table_print_range_to_string
Reference: https://github.com/karelzak/util-linux/issues/283
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-02-21 21:13:50 +01:00
Karel Zak 12ca9cb1f5 libsmartcols: add sample-scols-continuous
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-02-19 16:47:38 +01:00
Karel Zak 2981e0fd0e libsmartcols: support continuous printing
This patch allows to disable line-breaks. This feature is usable when
you want to re-print the same line more than once -- move terminal
cursor to the begin of the line and print again and again (aka
progress bar).

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-02-19 16:43:28 +01:00
Karel Zak 2a750b4c4e libsmartcols: add scols_table_print_range()
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-02-19 14:43:06 +01:00
Ruediger Meier b0b24b11f8 lib: rename strmode() and setmode()
On BSD they are part of the standard C library.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-18 12:53:48 +01:00
Ruediger Meier 3719bf8de9 build-sys: check linker support for version scripts
The macro AX_CHECK_VSCRIPT was taken from gnu autoconf archive.
http://www.gnu.org/software/autoconf-archive/

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-18 12:53:48 +01:00
Igor Gnatenko d381f70814 libsmartcols: fill wrapped lines with space instead of 'x'
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-02-16 12:57:55 +01:00
Igor Gnatenko f16f28b0fc libsmartcols: print title only with SCOLS_FMT_HUMAN
Reference: https://github.com/karelzak/util-linux/issues/279
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-02-13 16:13:04 +01:00
Karel Zak 20759a42ec libsmartcols: rewrite ./sample-scols-wrap
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-02-10 15:37:30 +01:00
Karel Zak d94c519877 libsmartcols: support multi-line cells
The initial implementation has been introduced by SCOLS_FL_WRAP columns,
but this patch clean ups all and makes things more elegant.

Note that use SCOLS_FL_TREE | SCOLS_FL_WRAP for a column is bad idea
and I don't think we need to fix it.

References: https://github.com/karelzak/util-linux/issues/269
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-02-10 15:34:21 +01:00
Karel Zak e865838d6d libsmartcols: use libscols_cell for title
References: https://github.com/karelzak/util-linux/issues/270
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-02-09 11:21:21 +01:00
Ruediger Meier 3fd1f7711e docs: fix typos found by codespell
Using "codespell" from https://github.com/lucasdemarchi/codespell

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-03 15:10:08 +01:00
Karel Zak e85c8c98e6 libsmartcols: make SCOLS_FL_WRAP usable in tree
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-01-25 15:31:24 +01:00
Karel Zak 5243e4ebc8 libsmartcols: reduce also SCOLS_FL_WRAP columns
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-01-25 15:17:36 +01:00
Karel Zak e90f4b6715 libsmartcols: add wrap.c sample
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-01-25 15:17:21 +01:00
Karel Zak 4a51e682bb libsmartcols: fix title sample
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-01-25 13:45:34 +01:00
Karel Zak 107ca34a4c libsmartcols: fix samples build, add title.c
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-01-25 13:42:51 +01:00
Karel Zak 2f09ae9d5d libsmartcols: add samples directory
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-01-25 13:17:43 +01:00
Karel Zak d372bcf26e Merge branch 'scols_fl_wrap' of https://github.com/ignatenkobrain/util-linux
* 'scols_fl_wrap' of https://github.com/ignatenkobrain/util-linux:
  libsmartcols: add scols_column_is_wrap to docs
  libsmartcols: don't loose colors when wrapping
  libsmartcols: wrap columns correctly with unicode
  libsmartcols: implement SCOLS_FL_WRAP
2016-01-25 13:03:29 +01:00
Karel Zak 982034c3d1 libsmartcols: document v2.27 symbols
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-01-25 12:57:14 +01:00
Igor Gnatenko db307d8e96 libsmartcols: add 'Since' tag for gtkdoc for some functions
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-01-25 00:12:14 +01:00
Igor Gnatenko 703d0196ee libsmartcols: add few methods to get information about title
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-01-25 00:12:14 +01:00
Igor Gnatenko bfc3d8b48e libsmartcols: position of title in fact unsigned
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-01-25 00:12:14 +01:00
Karel Zak 57867795aa libsmartcols: support multibyte titles, rename wrap to padding
- let's support multibyte table titles
- use lib/mbalign.c to align the title
- rename title_wrap to title_padding (we already use "wrap" on another
  places for another things)

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-01-22 16:51:59 +01:00
Igor Gnatenko ad13ab8d66 libsmartcols: add scols_column_is_wrap to docs
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-01-22 14:48:46 +01:00
Igor Gnatenko 57c7b2a1a5 libsmartcols: don't loose colors when wrapping
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-01-22 14:30:39 +01:00
Igor Gnatenko e6f89163be libsmartcols: wrap columns correctly with unicode
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-01-22 14:29:16 +01:00
Karel Zak fd5cbf57e0 libsmartcols: add title to the test application
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-01-22 13:50:02 +01:00
Karel Zak 6f2737964d libsmartcols: add JSON to the test application
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-01-22 13:46:29 +01:00
Karel Zak 500a229f51 libsmartcols: add new functions to docs
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-01-22 13:40:19 +01:00