summaryrefslogtreecommitdiffstats
path: root/libsmartcols/src
Commit message (Collapse)AuthorAgeFilesLines
...
* 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-315-18/+74
| | | | | | | | 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: 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: 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>
* libsmartcols: (docs) add missing 'since' tagsKarel Zak2017-05-233-1/+11
| | | | 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-053-0/+21
| | | | 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-133-2/+56
| | | | 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-073-0/+34
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* 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>
* libsmartcols: add scols_cell_get_alignment()Karel Zak2017-01-094-9/+38
| | | | | | | | | | | | | 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>
* 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>
* libsmartcols: add scols_column_add_width()Karel Zak2016-09-303-0/+22
| | | | 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-272-4/+6
| | | | 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-275-30/+30
| | | | | | | * 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-265-56/+193
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* 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()
| * libsmartcols: add scols_table_is_nolinesep()Igor Gnatenko2016-09-233-2/+17
| | | | | | | | | | | | And save 1 or 0 into tb->no_linesep instead of any value. Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
| * libsmartcols: add scols_table_is_nowrap()Igor Gnatenko2016-09-233-1/+16
| | | | | | | | Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
| * libsmartcols: add scols_table_get_name()Igor Gnatenko2016-09-233-0/+15
| | | | | | | | | | | | Currently we have scols_table_set_name() but don't have getter for it. Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* | libsmartcols: cleanup scols_table_set_symbols() APIKarel Zak2016-09-235-34/+101
|/ | | | | | | | | | | | 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>
* libsmartcols: use const qualifier for scols_table_get_termwidthIgor Gnatenko2016-09-232-2/+2
| | | | Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* Merge branch 'api_const' of https://github.com/ignatenkobrain/util-linuxKarel Zak2016-09-238-74/+67Star
|\ | | | | | | | | | | | | * '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
| * libsmartcols: use const qualifier where it's possibleIgor Gnatenko2016-09-217-71/+65Star
| | | | | | | | | | Closes: https://github.com/karelzak/util-linux/issues/355 Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
| * debug: use const void * for ul_debugobj()Igor Gnatenko2016-09-212-2/+2
| | | | | | | | | | | | | | | | | | | | 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>
| * libsmartcols: make get_line/column_separator() return constIgor Gnatenko2016-09-212-5/+4Star
| | | | | | | | | | | | | | | | 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>
* | libsmartcols: keep scols_table_get_termwidth() read-onlyKarel Zak2016-09-221-2/+1Star
|/ | | | | Addresses: https://github.com/karelzak/util-linux/issues/356 Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'hotfix' of https://github.com/ignatenkobrain/util-linuxKarel Zak2016-09-192-31/+31
|\
| * libsmartcols: be consistent, use 'sy' for symbolsIgor Gnatenko2016-09-192-31/+31
| | | | | | | | Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* | Merge branch 'typos' of https://github.com/ignatenkobrain/util-linuxKarel Zak2016-09-192-6/+6
|\ \ | | | | | | | | | | | | * 'typos' of https://github.com/ignatenkobrain/util-linux: libsmartcols: fix typos in docs
| * | libsmartcols: fix typos in docsIgor Gnatenko2016-09-192-6/+6
| |/ | | | | | | Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* / libsmartcols: be more strict about empty tablesKarel Zak2016-09-192-6/+15
|/ | | | | | and don't print extra \n for empty table. Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: fix commentKarel Zak2016-09-191-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>