summaryrefslogtreecommitdiffstats
path: root/libsmartcols
Commit message (Collapse)AuthorAgeFilesLines
...
* 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>
* libsmartcols: (docs) add missing version notesKarel Zak2016-09-273-1/+20
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: fixes in doc generationIgor Gnatenko2016-09-276-31/+35
| | | | | | | * Add 2.29 symbols index * Sync argument names between header and implementation Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* libsmartcols: support custom wrap and remove SCOLS_FL_WRAPNLKarel Zak2016-09-267-58/+208
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <kzak@redhat.com>
* libsmartcols: (docs) add missing functionsKarel Zak2016-09-231-0/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'getters' of https://github.com/ignatenkobrain/util-linuxKarel Zak2016-09-233-3/+48
|\ | | | | | | | | | | | | * 'getters' of https://github.com/ignatenkobrain/util-linux: libsmartcols: add scols_table_is_nolinesep() libsmartcols: add scols_table_is_nowrap() libsmartcols: add scols_table_get_name()