diff options
author | Karel Zak | 2016-02-09 11:21:21 +0100 |
---|---|---|
committer | Karel Zak | 2016-02-09 11:21:21 +0100 |
commit | e865838d6ddcb0fed74e3819b503c6f7ccad452b (patch) | |
tree | ca7c032bcdc799177db7ab5781cb6e95bdf756dc /libsmartcols/src/cell.c | |
parent | libfdisk: add missing break (diff) | |
download | kernel-qcow2-util-linux-e865838d6ddcb0fed74e3819b503c6f7ccad452b.tar.gz kernel-qcow2-util-linux-e865838d6ddcb0fed74e3819b503c6f7ccad452b.tar.xz kernel-qcow2-util-linux-e865838d6ddcb0fed74e3819b503c6f7ccad452b.zip |
libsmartcols: use libscols_cell for title
References: https://github.com/karelzak/util-linux/issues/270
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libsmartcols/src/cell.c')
-rw-r--r-- | libsmartcols/src/cell.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/libsmartcols/src/cell.c b/libsmartcols/src/cell.c index 3dc1df13b..c7aab353e 100644 --- a/libsmartcols/src/cell.c +++ b/libsmartcols/src/cell.c @@ -209,6 +209,35 @@ const char *scols_cell_get_color(const struct libscols_cell *ce) } /** + * scols_cell_set_flags: + * @ce: a pointer to a struct libscols_cell instance + * @flags: SCOLS_CELL_FL_* flags + * + * Note that cells in the table are always aligned by column flags. The cell + * flags are used for table title only (now). + * + * Returns: 0, a negative value in case of an error. + */ +int scols_cell_set_flags(struct libscols_cell *ce, int flags) +{ + if (!ce) + return -EINVAL; + ce->flags = flags; + return 0; +} + +/** + * scols_cell_get_flags: + * @ce: a pointer to a struct libscols_cell instance + * + * Returns: the current flags or -1 in case of an error. + */ +int scols_cell_get_flags(const struct libscols_cell *ce) +{ + return ce ? ce->flags : -1; +} + +/** * scols_cell_copy_content: * @dest: a pointer to a struct libscols_cell instance * @src: a pointer to an immutable struct libscols_cell instance |