summaryrefslogtreecommitdiffstats
path: root/libsmartcols
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* include/debug: introduce __UL_INIT_DEBUG_FROM_STRING()Karel Zak2018-01-171-1/+1
| | | | | | | Let's make it possible to use debug.h without environment variables. Suggested-by: J William Piggott <elseifthen@gmx.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* include/debug: don't print pointer address for SUID programsKarel Zak2018-01-121-0/+3
| | | | | | | | | | | | | | | | * introduce new flag __UL_DEBUG_FL_NOADDR to suppress pointer address printing * use __UL_DEBUG_FL_NOADDR when SUID * move ul_debugobj() to debugobj.h, and require UL_DEBUG_CURRENT_MASK to provide access to the current mask from ul_debugobj(). It's better than modify all ul_debugobj() calls and use the global mask as argument. * remove never used UL_DEBUG_DEFINE_FLAG Reported-by: halfdog <me@halfdog.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: don't add blank padding after left aligned titleKarel Zak2017-12-121-4/+12
| | | | | | | | | Let's use the same semantic for the title as for the last column in the table. If aligned on left, table is not "maxout" and title padding symbol is undefined (or blank) then keep title as short as possible. Addresses: https://github.com/karelzak/util-linux/issues/549 Signed-off-by: Karel Zak <kzak@redhat.com>
* sample-scols-title: add left title without paddingKarel Zak2017-12-121-2/+14
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: fix typosSami Kerola2017-11-281-1/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* libsmartcols: fix mem-leaks in samplesKarel Zak2017-11-232-0/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: (sample) cleanup line separator usageKarel Zak2017-10-122-4/+14
| | | | | | | | | | | | * add comment to explain when nolinesep flag is necessary * force to print \n before switch to the next line to support ./sample-scols-continuous > file use case. Addresses: https://github.com/ignatenkobrain/python-smartcols/issues/18 Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: (docs) add note about line separatorsKarel Zak2017-10-121-0/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: don't call free_buffer() for uninitialized variable [coverity ↵Karel Zak2017-10-111-2/+3
| | | | | | scan] Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: fix scols_line_move_cells() n+1 error [asan]Karel Zak2017-09-181-2/+2
| | | | | Reported-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: fix heap-buffer-overflow when move columnsKarel Zak2017-09-151-4/+6
| | | | | Reported-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: fix comment (to make gtk-docs happy)Karel Zak2017-07-311-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: add scols_table_enable_noencoding()Karel Zak2017-07-316-18/+76
| | | | | | | | Now the library encode all output. It seems too strict and difficult to use the library for some use-cases -- for example if you want to use the library for already colorized output (by esc.sequences). Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: never use usage(stderr)Ruediger Meier2017-06-261-4/+5
| | | | | | | Here we fix all cases where we have usage(FILE*) functions. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: remove stray semicolonsSami Kerola2017-06-141-1/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* misc: fix reassigned values before old ones has been used [cppcheck]Sami Kerola2017-06-141-1/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* libsmartcols: fix warning "unused parameter"Ruediger Meier2017-06-131-2/+7
| | | | | | Noticed on OSX. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* libsmartcols: (docs) add new functionsKarel Zak2017-06-131-0/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: add header-repeat featureKarel Zak2017-06-135-3/+67
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: add missing symbolsKarel Zak2017-06-121-0/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: add scols_table_{set,get}_termheight()Karel Zak2017-06-123-3/+42
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/ttyutils: return terminal lines tooKarel Zak2017-06-121-0/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: fix library order when linkingRuediger Meier2017-06-011-1/+1
| | | | | | | | | | We got some errors on Alpine Linux where $LTLIBINTL is non-empty: ./.libs/libcommon.a(libcommon_la-blkdev.o): In function `open_blkdev_or_file': lib/blkdev.c:282: undefined reference to `libintl_gettext collect2: error: ld returned 1 exit status Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* libsmartcols: (docs) add missing 'since' tagsKarel Zak2017-05-234-2/+16
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: check scols_table_set_default_symbols() return code [coverity ↵Karel Zak2017-05-171-1/+3
| | | | | | scan] Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: add scols_line_is_ancestor()Karel Zak2017-05-054-0/+22
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: add debug mesg to see width changeKarel Zak2017-05-021-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: fix typoKarel Zak2017-04-131-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: add scols_sort_table_by_tree()Karel Zak2017-04-134-2/+57
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: fix relative width interpretationKarel Zak2017-04-072-5/+5
| | | | | | The non-defined width hint (=0) should not be interpreted as relative width. Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: column width reduction refactoringKarel Zak2017-04-072-32/+80
| | | | | | | The current implementation is unreadable... Let's write it again with more obvious semantic. Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: add scols_line_move_cells()Karel Zak2017-04-073-3/+50
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: add scols_table_move_column()Karel Zak2017-04-074-0/+35
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: do not use plain 0 as NULL [smatch scan]Sami Kerola2017-03-173-25/+25
| | | | | | Likewise commit 87918040658f2fa9b1bf78f1f8f4f5c065a2e3a3. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* libsmartcols: fix test variable shadowingSami Kerola2017-03-171-5/+5
| | | | | | | | | | libsmartcols/samples/fromfile.c:57:16: warning: declaration of 'flags' shadows a global declaration [-Wshadow] libsmartcols/samples/fromfile.c:29:33: note: shadowed declaration is here libsmartcols/samples/fromfile.c:101:8: warning: declaration of 'flags' shadows a global declaration [-Wshadow] Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* libsmartcols: allow to add column to already used tableKarel Zak2017-03-031-7/+18
| | | | | | | | Now it's impossible to add new column if the table already contains lines with data. This patch forces library to realloc cell array in the lines to accept a new column. Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: support columns separators greater than one output cellKarel Zak2017-03-022-4/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: Fix word repetitionsYuri Chornoivan2017-02-131-1/+1
|
* libsmartcols: add scols_cell_get_alignment()Karel Zak2017-01-095-9/+39
| | | | | | | | | | | | | Just to hide that we use cell flags (bitwise operations) to define cell content alignment. The patch also more explicitly specifies the flags in the header file. The alignment is evaluated in the order: right, center, left. The default is left. Note that SCOLS_CELL_FL_* are used for for table title only. Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'ignatenko/libsmartcols-dead' of ↵Karel Zak2017-01-091-2/+2
|\ | | | | | | | | | | | | https://github.com/ignatenkobrain/util-linux * 'ignatenko/libsmartcols-dead' of https://github.com/ignatenkobrain/util-linux: libsmartcols: remove dead checks
| * libsmartcols: remove dead checksIgor Gnatenko2016-12-191-2/+2
| | | | | | | | | | | | We initialize them before. Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* | libsmartcols: unused parameter [-Wunused-parameter]Karel Zak2017-01-051-2/+9
|/ | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: replace FTP by HTTPS in kernel.org URLsSébastien Helleu2016-12-191-1/+1
| | | | | | | The links to ftp://ftp.kernel.org/ are replaced by https://www.kernel.org/. Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: fix typos using codespellRuediger Meier2016-12-012-3/+3
| | | | | | | | | | | | | # command used was: $ ~/src/codespell/codespell \ -w -D /home/rudi/src/codespell/build/lib/codespell_lib/data/dictionary.txt \ $(git ls-files | grep -v "^po/\|\.xz$\|\.gz$\|\.bz2$\|\.img$\|^Documentation/releases/") BTW some manually grammer fixes: s/uses/used/ s/begin/beginning/ Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* libsmartcols: make scols_sort_table() usable for treesKarel Zak2016-11-021-3/+50
| | | | | | We also need to sort children when tree is enabled. Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: fix some compiler warningsRuediger Meier2016-10-271-1/+1
| | | | | | | | | | libsmartcols/samples/fromfile.c:59:2: warning: passing argument 3 of 'string_to_bitmask' from incompatible pointer type text-utils/pg.c:79:0: warning: "TABSIZE" redefined libblkid/src/read.c:455:13: warning: 'debug_dump_dev' defined but not used [-Wunused-function] libblkid/src/probe.c:769:13: warning: unused function 'cdrom_size_correction' [-Wunused-function] /usr/include/sys/termios.h:3:2: warning: "this file includes <sys/termios.h> which is deprecated, use <termios.h> instead" [-W#warnings] Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* libsmartcols: add scols_column_add_width()Karel Zak2016-09-304-0/+23
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: custom wrap fixesKarel Zak2016-09-273-8/+6Star
| | | | | Reported-by: Igor Gnatenko <i.gnatenko.brain@gmail.com Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: some random fixesKarel Zak2016-09-273-11/+13
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>