diff options
author | Karel Zak | 2014-04-03 16:09:57 +0200 |
---|---|---|
committer | Karel Zak | 2014-04-03 16:09:57 +0200 |
commit | 0925a9dd6cd65feb8cb2d4d66551363f4af161e9 (patch) | |
tree | 9981e45aee1274f959a9b32f3cbdffabc8a45d8c /sys-utils | |
parent | fdisk: print table header as bold (diff) | |
download | kernel-qcow2-util-linux-0925a9dd6cd65feb8cb2d4d66551363f4af161e9.tar.gz kernel-qcow2-util-linux-0925a9dd6cd65feb8cb2d4d66551363f4af161e9.tar.xz kernel-qcow2-util-linux-0925a9dd6cd65feb8cb2d4d66551363f4af161e9.zip |
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>
Diffstat (limited to 'sys-utils')
-rw-r--r-- | sys-utils/losetup.c | 6 | ||||
-rw-r--r-- | sys-utils/lscpu.c | 2 | ||||
-rw-r--r-- | sys-utils/prlimit.c | 6 | ||||
-rw-r--r-- | sys-utils/swapon.c | 6 | ||||
-rw-r--r-- | sys-utils/wdctl.c | 6 |
5 files changed, 13 insertions, 13 deletions
diff --git a/sys-utils/losetup.c b/sys-utils/losetup.c index 58d3e08a4..85a15ac2f 100644 --- a/sys-utils/losetup.c +++ b/sys-utils/losetup.c @@ -298,10 +298,10 @@ static int show_table(struct loopdev_cxt *lc, struct libscols_line *ln; int i, rc = 0; - if (!(tb = scols_new_table(NULL))) + if (!(tb = scols_new_table())) err(EXIT_FAILURE, _("failed to initialize output table")); - scols_table_set_raw(tb, raw); - scols_table_set_no_headings(tb, no_headings); + scols_table_enable_raw(tb, raw); + scols_table_enable_noheadings(tb, no_headings); for (i = 0; i < ncolumns; i++) { struct colinfo *ci = get_column_info(i); diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c index 564a705b0..ad1a6b352 100644 --- a/sys-utils/lscpu.c +++ b/sys-utils/lscpu.c @@ -1228,7 +1228,7 @@ print_readable(struct lscpu_desc *desc, int cols[], int ncols, int i; char buf[BUFSIZ]; const char *data; - struct libscols_table *table = scols_new_table(NULL); + struct libscols_table *table = scols_new_table(); if (!table) err(EXIT_FAILURE, _("failed to initialize output table")); diff --git a/sys-utils/prlimit.c b/sys-utils/prlimit.c index 9b1b85f65..d37ec651e 100644 --- a/sys-utils/prlimit.c +++ b/sys-utils/prlimit.c @@ -288,12 +288,12 @@ static int show_limits(struct list_head *lims) struct list_head *p, *pnext; struct libscols_table *table; - table = scols_new_table(NULL); + table = scols_new_table(); if (!table) err(EXIT_FAILURE, _("failed to initialize output table")); - scols_table_set_raw(table, raw); - scols_table_set_no_headings(table, no_headings); + scols_table_enable_raw(table, raw); + scols_table_enable_noheadings(table, no_headings); for (i = 0; i < ncolumns; i++) { struct colinfo *col = get_column_info(i); diff --git a/sys-utils/swapon.c b/sys-utils/swapon.c index a3cfbabc8..3866ee70d 100644 --- a/sys-utils/swapon.c +++ b/sys-utils/swapon.c @@ -239,12 +239,12 @@ static int show_table(int bytes) if (!itr) err(EXIT_FAILURE, _("failed to initialize libmount iterator")); - table = scols_new_table(NULL); + table = scols_new_table(); if (!table) err(EXIT_FAILURE, _("failed to initialize output table")); - scols_table_set_raw(table, raw); - scols_table_set_no_headings(table, no_headings); + scols_table_enable_raw(table, raw); + scols_table_enable_noheadings(table, no_headings); for (i = 0; i < ncolumns; i++) { struct colinfo *col = get_column_info(i); diff --git a/sys-utils/wdctl.c b/sys-utils/wdctl.c index 68ecf0d29..d63a110e3 100644 --- a/sys-utils/wdctl.c +++ b/sys-utils/wdctl.c @@ -251,13 +251,13 @@ static int show_flags(struct wdinfo *wd, uint32_t wanted) uint32_t flags; /* create output table */ - table = scols_new_table(NULL); + table = scols_new_table(); if (!table) { warn(_("failed to initialize output table")); return -1; } - scols_table_set_raw(table, raw); - scols_table_set_no_headings(table, no_headings); + scols_table_enable_raw(table, raw); + scols_table_enable_noheadings(table, no_headings); /* define columns */ for (i = 0; i < (size_t) ncolumns; i++) { |