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 /libsmartcols/src/smartcolsP.h | |
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 'libsmartcols/src/smartcolsP.h')
-rw-r--r-- | libsmartcols/src/smartcolsP.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/libsmartcols/src/smartcolsP.h b/libsmartcols/src/smartcolsP.h index 585b5e196..431b91b8b 100644 --- a/libsmartcols/src/smartcolsP.h +++ b/libsmartcols/src/smartcolsP.h @@ -93,30 +93,36 @@ struct libscols_line { struct libscols_line *parent; }; +enum { + SCOLS_FMT_HUMAN = 0, /* default, human readable */ + SCOLS_FMT_RAW, /* space separated */ + SCOLS_FMT_EXPORT /* COLNAME="data" ... */ +}; + /* * The table */ struct libscols_table { int refcount; size_t ncols; /* number of columns */ + size_t ntreecols; /* number of columns with SCOLS_FL_TREE */ size_t nlines; /* number of lines */ size_t termwidth; /* terminal width */ size_t termreduce; /* extra blank space */ - int is_term; /* is a tty? */ FILE *out; /* output stream */ struct list_head tb_columns; struct list_head tb_lines; struct libscols_symbols *symbols; + int format; /* SCOLS_FMT_* */ + /* flags */ - unsigned int colors_wanted :1; - unsigned int raw :1; - unsigned int ascii :1; - unsigned int no_headings :1; - unsigned int export :1; - unsigned int max :1; - unsigned int tree :1; + unsigned int ascii :1, /* don't use unicode */ + colors_wanted :1, /* enable colors */ + is_term :1, /* isatty() */ + maxout :1, /* maximalize output */ + no_headings :1; /* don't print header */ }; #define IS_ITER_FORWARD(_i) ((_i)->direction == SCOLS_ITER_FORWARD) |