summaryrefslogtreecommitdiffstats
path: root/disk-utils
diff options
context:
space:
mode:
authorKarel Zak2014-04-03 16:09:57 +0200
committerKarel Zak2014-04-03 16:09:57 +0200
commit0925a9dd6cd65feb8cb2d4d66551363f4af161e9 (patch)
tree9981e45aee1274f959a9b32f3cbdffabc8a45d8c /disk-utils
parentfdisk: print table header as bold (diff)
downloadkernel-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 'disk-utils')
-rw-r--r--disk-utils/cfdisk.c5
-rw-r--r--disk-utils/partx.c8
2 files changed, 6 insertions, 7 deletions
diff --git a/disk-utils/cfdisk.c b/disk-utils/cfdisk.c
index 624d7991d..9d198e25e 100644
--- a/disk-utils/cfdisk.c
+++ b/disk-utils/cfdisk.c
@@ -219,11 +219,10 @@ static char *table_to_string(struct cfdisk *cf, struct fdisk_table *tb)
}
}
- table = scols_new_table(NULL);
+ table = scols_new_table();
if (!table)
goto done;
- scols_table_set_max(table, 1);
- scols_table_set_tree(table, tree);
+ scols_table_enable_maxout(table, 1);
/* headers */
for (i = 0; i < cf->ncols; i++) {
diff --git a/disk-utils/partx.c b/disk-utils/partx.c
index 036e4cd3d..830af1f32 100644
--- a/disk-utils/partx.c
+++ b/disk-utils/partx.c
@@ -626,14 +626,14 @@ static int show_parts(blkid_partlist ls, int scols_flags, int lower, int upper)
if (!nparts)
return 0;
- table = scols_new_table(NULL);
+ table = scols_new_table();
if (!table) {
warn(_("failed to initialize output table"));
return -1;
}
- scols_table_set_raw(table, !!(scols_flags & PARTX_RAW));
- scols_table_set_export(table, !!(scols_flags & PARTX_EXPORT));
- scols_table_set_no_headings(table, !!(scols_flags & PARTX_NOHEADINGS));
+ scols_table_enable_raw(table, !!(scols_flags & PARTX_RAW));
+ scols_table_enable_export(table, !!(scols_flags & PARTX_EXPORT));
+ scols_table_enable_noheadings(table, !!(scols_flags & PARTX_NOHEADINGS));
for (i = 0; i < ncolumns; i++) {
struct colinfo *col = get_column_info(i);