diff options
author | Igor Gnatenko | 2016-09-23 14:09:43 +0200 |
---|---|---|
committer | Igor Gnatenko | 2016-09-23 14:11:34 +0200 |
commit | 96960717375978e9a30ddc882c53ff1adf85b26d (patch) | |
tree | 6ae0f80f029b415da5604c1ef0fa32016ab3a544 /libsmartcols | |
parent | libsmartcols: use const qualifier for scols_table_get_termwidth (diff) | |
download | kernel-qcow2-util-linux-96960717375978e9a30ddc882c53ff1adf85b26d.tar.gz kernel-qcow2-util-linux-96960717375978e9a30ddc882c53ff1adf85b26d.tar.xz kernel-qcow2-util-linux-96960717375978e9a30ddc882c53ff1adf85b26d.zip |
libsmartcols: add scols_table_get_name()
Currently we have scols_table_set_name() but don't have getter for it.
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Diffstat (limited to 'libsmartcols')
-rw-r--r-- | libsmartcols/src/libsmartcols.h.in | 1 | ||||
-rw-r--r-- | libsmartcols/src/libsmartcols.sym | 1 | ||||
-rw-r--r-- | libsmartcols/src/table.c | 13 |
3 files changed, 15 insertions, 0 deletions
diff --git a/libsmartcols/src/libsmartcols.h.in b/libsmartcols/src/libsmartcols.h.in index de2f271cf..b36bcb105 100644 --- a/libsmartcols/src/libsmartcols.h.in +++ b/libsmartcols/src/libsmartcols.h.in @@ -195,6 +195,7 @@ extern struct libscols_line *scols_copy_line(const struct libscols_line *ln); /* table */ extern int scols_table_colors_wanted(const struct libscols_table *tb); extern int scols_table_set_name(struct libscols_table *tb, const char *name); +extern const char *scols_table_get_name(const struct libscols_table *tb); extern struct libscols_cell *scols_table_get_title(struct libscols_table *tb); extern int scols_table_is_raw(const struct libscols_table *tb); extern int scols_table_is_ascii(const struct libscols_table *tb); diff --git a/libsmartcols/src/libsmartcols.sym b/libsmartcols/src/libsmartcols.sym index d599a5030..e7b8f14f3 100644 --- a/libsmartcols/src/libsmartcols.sym +++ b/libsmartcols/src/libsmartcols.sym @@ -145,4 +145,5 @@ global: scols_table_get_termwidth; scols_table_set_termforce; scols_table_set_termwidth; + scols_table_get_name; } SMARTCOLS_2.28; diff --git a/libsmartcols/src/table.c b/libsmartcols/src/table.c index fcb53b64a..76b6f0b9d 100644 --- a/libsmartcols/src/table.c +++ b/libsmartcols/src/table.c @@ -130,6 +130,19 @@ int scols_table_set_name(struct libscols_table *tb, const char *str) } /** + * scols_table_get_name: + * @tb: a pointer to a struct libscols_table instance + * + * Returns: The current name setting of the table @tb + * + * Since: 2.29 + */ +const char *scols_table_get_name(const struct libscols_table *tb) +{ + return tb->name; +} + +/** * scols_table_get_title: * @tb: a pointer to a struct libscols_table instance * |