diff options
author | Igor Gnatenko | 2016-09-21 07:25:23 +0200 |
---|---|---|
committer | Igor Gnatenko | 2016-09-21 07:26:44 +0200 |
commit | 6f9377ab8159bf52e52ec41c32fbfd47401a254e (patch) | |
tree | e449c1014a338386cf7d81d9c29392b68dd8131b /libsmartcols | |
parent | Merge branch 'hotfix' of https://github.com/ignatenkobrain/util-linux (diff) | |
download | kernel-qcow2-util-linux-6f9377ab8159bf52e52ec41c32fbfd47401a254e.tar.gz kernel-qcow2-util-linux-6f9377ab8159bf52e52ec41c32fbfd47401a254e.tar.xz kernel-qcow2-util-linux-6f9377ab8159bf52e52ec41c32fbfd47401a254e.zip |
libsmartcols: make get_line/column_separator() return const
The patch introduces tiny API changes (char * -> const char *) for
scols_table_get_line_separator
scols_table_get_column_separator
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Diffstat (limited to 'libsmartcols')
-rw-r--r-- | libsmartcols/src/libsmartcols.h.in | 4 | ||||
-rw-r--r-- | libsmartcols/src/table.c | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/libsmartcols/src/libsmartcols.h.in b/libsmartcols/src/libsmartcols.h.in index 55eef4ef6..03b97e4be 100644 --- a/libsmartcols/src/libsmartcols.h.in +++ b/libsmartcols/src/libsmartcols.h.in @@ -226,8 +226,8 @@ extern int scols_table_remove_column(struct libscols_table *tb, struct libscols_ extern int scols_table_remove_columns(struct libscols_table *tb); extern struct libscols_column *scols_table_new_column(struct libscols_table *tb, const char *name, double whint, int flags); extern int scols_table_next_column(struct libscols_table *tb, struct libscols_iter *itr, struct libscols_column **cl); -extern char *scols_table_get_column_separator(struct libscols_table *tb); -extern char *scols_table_get_line_separator(struct libscols_table *tb); +extern const char *scols_table_get_column_separator(struct libscols_table *tb); +extern const char *scols_table_get_line_separator(struct libscols_table *tb); extern size_t scols_table_get_ncols(struct libscols_table *tb); extern size_t scols_table_get_nlines(struct libscols_table *tb); extern struct libscols_column *scols_table_get_column(struct libscols_table *tb, size_t n); diff --git a/libsmartcols/src/table.c b/libsmartcols/src/table.c index 9aae75c95..0ca0f0a1b 100644 --- a/libsmartcols/src/table.c +++ b/libsmartcols/src/table.c @@ -1047,7 +1047,7 @@ int scols_table_set_line_separator(struct libscols_table *tb, const char *sep) * * Returns: @tb column separator, NULL in case of an error */ -char *scols_table_get_column_separator(struct libscols_table *tb) +const char *scols_table_get_column_separator(struct libscols_table *tb) { return tb->colsep; } @@ -1058,10 +1058,9 @@ char *scols_table_get_column_separator(struct libscols_table *tb) * * Returns: @tb line separator, NULL in case of an error */ -char *scols_table_get_line_separator(struct libscols_table *tb) +const char *scols_table_get_line_separator(struct libscols_table *tb) { return tb->linesep; - } static int cells_cmp_wrapper(struct list_head *a, struct list_head *b, void *data) |