summaryrefslogtreecommitdiffstats
path: root/libsmartcols/src/Makemodule.am
Commit message (Collapse)AuthorAgeFilesLines
* libsmartcols: add generic function to walk on treeKarel Zak2019-05-071-0/+1
| | | | | | | Now we implement the same thing on more places. Let's add one set of functions to walk the tree and use it everywhere. Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: add lines grouping supportKarel Zak2018-12-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For some use-case we need to describe M:N relation between output lines. The nice examples are RAIDs or multi-path devices in lsblk output. NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT loop0 7:0 0 955.7M 0 loop ┌┈▶ ├─test-thin-metadata 253:0 0 2M 0 dm └┬▶ └─test-thin-data 253:1 0 953.7M 0 dm └┈┈test-thin-pool 253:2 0 953.7M 0 dm In this example two line (test-thin-metadata and test-thin-data) are parents for another line (test-thin-pool). The new API uses term "group" for parental line -- the number of group members is unlimited and every group has at least one child. It's possible that group's child is member of another group: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT loop0 7:0 0 955.7M 0 loop ┌┈▶ ├─test-thin-metadata 253:0 0 2M 0 dm └┬▶ └─test-thin-data 253:1 0 953.7M 0 dm ┌┈▶ └┈┈test-thin-pool 253:2 0 953.7M 0 dm ┆ └─test-thin 253:3 0 190.8M 0 dm └┬▶ loop1 7:1 0 190.8M 0 loop └┈┈┈┈┈test-thin-extsnap 253:4 0 190.8M 0 dm For now multi-group relation is unsupported and one line can be member of one group only. The library API and printing code is ready to support this feature, but not sure if we really need it. All what is necessary is to create array of groups in the line struct. Note that grouping is independent on standard parent->child relations between lines and grouping can connect arbitrary lines. The restriction is only that group child cannot be child of another line or child of another group. These cross reference are (and probably will be) impossible. The patch is relative large, but easy to review. Changes: * add new UTF symbols * add scols_symbols_set_group_* public API to modify new symbols * add struct libscols_group, used only internally * add "grpset" array to table struct -- the array is used to keep position of the group in the output. Every active group uses three items in the grpset. If there is more overlapping groups than bigger grpset is allocated. Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: split print.c into print.c, put.c and print-api.cKarel Zak2018-12-071-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: move width calculation to separate fileKarel Zak2018-12-071-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: rename table_print.c to print.cKarel Zak2018-12-071-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: move buffer stuff to buffer.cKarel Zak2018-12-071-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build: Add missing -lintl linkage to lib{smartcols,uuid}Karel Zak2018-04-091-1/+1
| | | | | Addresses: https://github.com/karelzak/util-linux/pull/615 Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: remove redundant EXTRA_DIST filesRuediger Meier2018-01-221-2/+1Star
| | | | | | | The sources of AC_CONFIG_FILES (*.in) are automatically distributed. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* build-sys: avoid using prog_DEPENDENCIESRuediger Meier2018-01-221-2/+1Star
| | | | | | | Use EXTRA_prog_DEPENDENCIES to have the benefit of automake's automatic prog_DEPENDENCIES. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* build-sys: remove unneeded dependencies on bla.h.inRuediger Meier2018-01-221-2/+1Star
| | | | | | | | | | We have already automakes's automatic dependencies like bla.h.in -> bla.h -> foo.o -> bar.la An explicit direct dependency bla.h.in -> bar.la is redundant and useless anyways. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* build-sys: automake is able to find headers in builddir ...Ruediger Meier2018-01-221-1/+1
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* build-sys: remove generated headers from dist tar ballRuediger Meier2018-01-221-4/+1Star
| | | | | | | | | | | | | Headers should only be listed in either *_HEADERS or *_SOURCES, especially when we want nodist_*_HEADERS. Since all the generated headers are made by configure we don't even need to use BUILT_SOURCES or other tricks. Also see automake docs 9.4.1 Built Sources Example: case "Build bindir.h from configure" Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* build-sys: use AC_PROG_MKDIR_P and remove a few gnuismsRuediger Meier2016-03-131-1/+1
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* build-sys: fix if..endif for *_la_LDFLAGSKarel Zak2016-03-101-4/+3Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: always add AM_CFLAGSRuediger Meier2016-02-231-0/+1
| | | | | | | | 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>
* build-sys: check linker support for version scriptsRuediger Meier2016-02-181-1/+3
| | | | | | | 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>
* libsmartcols: add samples directoryKarel Zak2016-01-251-13/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: don't link with tinfoKarel Zak2015-07-241-2/+1Star
| | | | | | | Let's move color names to sequence translation to separate file to make it usable without all the stuff in lib/colors.c. Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/colors: use libtinfo to check terminal capabilityKarel Zak2015-02-271-2/+3
| | | | | | | | | | | | | | | The current implementation assumes that all terminals supports colors and users are forcet to use terminal-colors.d/ to disable colors for some terminals. This patch checks for maximal supported colors for the current terminal and colors are automatically disabled for terminals like vt100. The patch moves lib/colors.c from libcommon.la to libtcolors.la to avoid collisions with another utils. Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: move libsmartcols.so to /lib if they existsKarel Zak2014-06-161-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: add debug and version functionsKarel Zak2014-04-071-1/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: small fixes to libsmartcolsKarel Zak2014-04-041-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: add testOndrej Oprala2014-04-031-0/+12
| | | | | | [kzak@redhat.com: - refresh according to previous API changes] Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: add table codeKarel Zak2014-04-031-0/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: add columnsKarel Zak2014-04-031-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: add cellsOndrej Oprala2014-04-031-0/+1
| | | | | | [kzak@redhat.com: - remove copy, free -- all have to be handled by lines] Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: add symbolsOndrej Oprala2014-04-031-0/+1
| | | | | | [kzak@redhat.com: - split scols_new_symbols() to regular getters functions] Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: add iteratorOndrej Oprala2014-04-031-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: add basic filesOndrej Oprala2014-04-031-0/+53
Signed-off-by: Ondrej Oprala <ooprala@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>