Commit Graph

318 Commits

Author SHA1 Message Date
Karel Zak 323da9ce47 libsmartcols: remove assert(arg) from public functions
Reported-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-16 13:49:29 +01:00
Karel Zak 78ad5aaaa9 libsmartcols: remove unnecessary check [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-29 11:07:37 +01:00
Benno Schulenberg b295bdb1b5 docs: fix two "maybe be" duplications in program comments
Also improve the grammar of the comments and some neighbours.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-26 11:22:15 +01:00
Karel Zak 2473b71182 libsmartcols: (docs) improve section descriptions
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-13 12:23:40 +01:00
Karel Zak 2b6c532e17 docs: update API docs years
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-13 12:03:17 +01:00
Karel Zak fed9b1775d libsmartcols: cleanup gtk-docs warnings
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-13 11:56:57 +01:00
Karel Zak 8501d9befe libsmartcols: use ASCII art for trees rather than padding
Based on patch from  Roman Odaisky.

References: https://launchpad.net/bugs/1406133
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-07 15:20:22 +01:00
Sami Kerola 7ee26cbf02 maint: fix shadow declaration
This change fixes all shadow declarations.  The worth while to mention
fix is with libfdisk sun geometry.  It comes from bitops.h cpu_to_be16
macro that further expands from include/bits/byteswap.h that has the
shadowing.

libfdisk/src/sun.c:961:173: warning: declaration of '__v' shadows a previous local [-Wshadow]
libfdisk/src/sun.c:961:69: warning: shadowed declaration is here [-Wshadow]
libfdisk/src/sun.c:961:178: warning: declaration of '__x' shadows a previous local [-Wshadow]
libfdisk/src/sun.c:961:74: warning: shadowed declaration is here [-Wshadow]

That could have caused earlier some unexpected results.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-01-07 10:08:21 +01:00
Karel Zak 5bc118c3c2 libsmartcols: fix docs namespace
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-26 16:53:48 +01:00
Karel Zak adc9f78cfc build-sys: cleanup library symbol files
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-20 14:01:03 +01:00
Karel Zak 2deb7cc347 libsmartcols: clean up debug, add help debug mask
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-03 13:13:22 +01:00
Sami Kerola 1bcf491a78 textual: fix couple typos in comments
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-01 12:33:15 +02:00
Ondrej Oprala 14ad2353cc libs/debug: accept human readable names for _DEBUG=
For example
	$ LIBMOUNT_DEBUG=tab,cache findmnt

to debug only TAB and CACHE subsystem.

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-13 12:33:47 +02:00
Sami Kerola b697fc994a libsmartcols: avoid variable dereference after release
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-13 18:35:39 +01:00
Sami Kerola 0e65dcde88 textual: fix some typos
Found with misspell-check version 2.0d.

Reference: https://github.com/lyda/misspell-check
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-13 17:21:02 +01:00
Karel Zak 3175f03552 libsmartcols: add note about deallocations
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-30 14:14:34 +02:00
Karel Zak 8675a3503d build-sys: move libsmartcols.so to /lib if they exists
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-16 15:00:33 +02:00
Karel Zak 710ed55dcd libsmartcols: add debug messages
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-06 13:47:06 +02:00
Karel Zak 36e4bdf018 libsmartcols: fix docs
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-03 12:41:58 +02:00
Karel Zak 7a1c36ab38 docs: rename libs xml/version.xml to xml/version-utils.xml
It seems that gtk-docs stuff is confused when we use version.xml
(package version) and xml/version.xml (library version functions).

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-03 12:37:33 +02:00
Karel Zak f92b26c184 libsmartcols: clean up test.c example
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-30 14:17:29 +02:00
Karel Zak 57a86f9bff libsmartcols: add scols_sort_table()
* add pointer to column cmp() function [scols_column_set_cmpfunc()]

 * allow to store per-cell application private data
   (to make it possible to sort tables on data independent on cell
    output data) [scols_cell_set_userdata() ...]

 * make it possible to access line cell by column
   [scols_line_get_column_cell()]

Sort and cmp() stuff based on patches from Shakur Shams Mullick.

Co-Author: Shakur Shams Mullick <shakursmullick@gmail.com>
Signed-off-by: Shakur Shams Mullick <shakursmullick@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-20 15:04:11 +02:00
Karel Zak 3eb482d027 libsmartcols: use new colors API
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-13 12:09:03 +02:00
Karel Zak c60329b33f libsmartcols: (docs) reorder functions in version section
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-07 11:48:53 +02:00
Karel Zak 140b006172 libsmartcols: check recount_widths() return value
Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-06 10:21:24 +02:00
Karel Zak 2dc0c6283b libsmartcols: fix buffer usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-18 12:01:59 +02:00
Karel Zak ee75308c31 libsmartcols: don't colorize tree ascii art
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-15 15:25:45 +02:00
Karel Zak 47329bbcf9 libsmartcols: don't mix width (in cells) and size (in bytes)
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-15 14:23:34 +02:00
Karel Zak d6303e28ec libsmartcols: resuse buffer for encoded data
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-15 13:59:46 +02:00
Karel Zak ae0abae283 libsmartcols: fix padding
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-14 16:59:44 +02:00
Karel Zak b233dcb6ff libsmartcols: use buffer struct in table_print.c
* consolidate code in table_print.c
 * make the code easy to extend
 * use return codes everywhere

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-14 16:41:20 +02:00
Karel Zak 4baab7dfd3 libsmartcols: improve line and cell separators
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-14 13:44:23 +02:00
Ondrej Oprala d1b4d14f4d libsmartcols: add separator getters/setters
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-14 12:37:21 +02:00
Karel Zak d9554c97e8 libsmartcols: rewrite test code to tree(1)-like util
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-08 12:13:02 +02:00
Karel Zak e2310281c7 libsmartcols: improve docs
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-07 14:07:49 +02:00
Karel Zak 4418714f47 libsmartcols: add debug and version functions
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-07 13:43:50 +02:00
Karel Zak c830206931 libsmartcols: add missing COPYING file
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-04 13:53:50 +02:00
Karel Zak 71dbc865f8 libsmartcols: fix test
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-04 13:51:47 +02:00
Karel Zak 2a49c0165d build-sys: small fixes to libsmartcols
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-04 11:25:08 +02:00
Karel Zak 0925a9dd6c libsmartcols: clean up flags usage
* rename flags functions to scols_table_enable_*
 * rename *_no_foo() functions to _nofoo()
 * output formats are mutually exclusive, so don't use flags there
 * don't assume symbols in scols_new_table(), use scols_table_set_symbols()

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 16:09:57 +02:00
Karel Zak 1424fe8c86 libsmartcols: init symbols when necessary
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:20 +02:00
Karel Zak dc36586085 libsmartcols: clean up flags
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:20 +02:00
Karel Zak 92e0d69c73 libsmartcols: always deallocate in scols_reset_cell()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:19 +02:00
Ondrej Oprala ce44112b10 libsmartcols: include stdio
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-03 12:29:18 +02:00
Ondrej Oprala c0070f8187 libsmartcols: add scols_table_is_empty()
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-03 12:29:18 +02:00
Ondrej Oprala 6e792bb6c0 libsmartcols: fix a usage example
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-03 12:29:18 +02:00
Ondrej Oprala 1d90bcb1a8 libsmartcols: documentation
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-03 12:29:18 +02:00
Ondrej Oprala b72b824d06 libsmartcols: move some code around
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-03 12:29:18 +02:00
Ondrej Oprala 8b992cb571 libsmartcols: revert the column flags API
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-03 12:29:17 +02:00
Ondrej Oprala 35958d0c61 libsmartcols: colors may now be specified as human-readable strings
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-03 12:29:17 +02:00
Ondrej Oprala 8a38a8d31e libsmartcols: separate flags, add getters/setters
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-03 12:29:17 +02:00
Ondrej Oprala 9fd9b99f4f libsmartcols: add missing copyright notifications
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-03 12:29:17 +02:00
Ondrej Oprala bc8cb33a72 libsmartcols: fill the symbol version file
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-03 12:29:17 +02:00
Karel Zak 7e8fe02941 libsmartcols: allow to read lines as tree
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:17 +02:00
Karel Zak 2a965b804a libsmartcols: add function to convert table to string
Note that open_memstream() is POSIX-1.2008, so it's possible than not
all libc have already implemented this function.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:17 +02:00
Karel Zak b28e886463 libsmartcols: remove unnecessary code
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:17 +02:00
Karel Zak e906be066e libsmartcols: add reduce term width functionality
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:16 +02:00
Karel Zak 62d2e2e538 libsmartcols: add SCOLS_FL_MAX
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:16 +02:00
Karel Zak 571441e291 libsmartcols: support alternative streams
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:16 +02:00
Ondrej Oprala 3a29e909f7 libsmartcols: add test
[kzak@redhat.com: - refresh according to previous API changes]

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:16 +02:00
Karel Zak 3e542c7654 libsmartcols: add table code
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:16 +02:00
Karel Zak c638c57ac3 libsmartcols: add table struct, cleanup refcounting
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:16 +02:00
Karel Zak 74bd28ad6e libsmartcols: add lines
Co-Author: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:16 +02:00
Karel Zak 1577b2592e libsmartcols: add columns
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:16 +02:00
Ondrej Oprala 6d1072696c libsmartcols: add cells
[kzak@redhat.com: - remove copy, free -- all have to be handled by lines]

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:16 +02:00
Ondrej Oprala b36992fb2a libsmartcols: add symbols
[kzak@redhat.com: - split scols_new_symbols() to regular getters functions]

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:16 +02:00
Ondrej Oprala 0b0ab9ff96 libsmartcols: add iterator
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:15 +02:00
Ondrej Oprala 1a4d989e22 libsmartcols: add basic files
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:15 +02:00