From 618a1d6dbe9055382f7f37c222e8456e6841dc8b Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Fri, 23 Sep 2016 16:05:02 +0200 Subject: libsmartcols: fixes in doc generation * Add 2.29 symbols index * Sync argument names between header and implementation Signed-off-by: Igor Gnatenko --- libsmartcols/docs/libsmartcols-docs.xml | 6 +++++- libsmartcols/src/cell.c | 26 +++++++++++++------------- libsmartcols/src/column.c | 12 ++++++------ libsmartcols/src/libsmartcols.h.in | 4 ++-- libsmartcols/src/line.c | 12 ++++++------ libsmartcols/src/table.c | 6 +++--- 6 files changed, 35 insertions(+), 31 deletions(-) (limited to 'libsmartcols') diff --git a/libsmartcols/docs/libsmartcols-docs.xml b/libsmartcols/docs/libsmartcols-docs.xml index d118bbb5a..34c475684 100644 --- a/libsmartcols/docs/libsmartcols-docs.xml +++ b/libsmartcols/docs/libsmartcols-docs.xml @@ -14,7 +14,7 @@ - + libsmartcols Overview @@ -57,4 +57,8 @@ available from ftp://ftp.kernel.org/pub/linux/utils/util-linux/. Index of new symbols in 2.28 + + Index of new symbols in 2.29 + + diff --git a/libsmartcols/src/cell.c b/libsmartcols/src/cell.c index b887940c9..4450c576b 100644 --- a/libsmartcols/src/cell.c +++ b/libsmartcols/src/cell.c @@ -54,21 +54,21 @@ int scols_reset_cell(struct libscols_cell *ce) /** * scols_cell_set_data: * @ce: a pointer to a struct libscols_cell instance - * @str: data (used for scols_print_table()) + * @data: data (used for scols_print_table()) * * Stores a copy of the @str in @ce, the old data are deallocated by free(). * * Returns: 0, a negative value in case of an error. */ -int scols_cell_set_data(struct libscols_cell *ce, const char *str) +int scols_cell_set_data(struct libscols_cell *ce, const char *data) { - return strdup_to_struct_member(ce, data, str); + return strdup_to_struct_member(ce, data, data); } /** * scols_cell_refer_data: * @ce: a pointer to a struct libscols_cell instance - * @str: data (used for scols_print_table()) + * @data: data (used for scols_print_table()) * * Adds a reference to @str to @ce. The pointer is deallocated by * scols_reset_cell() or scols_unref_line(). This function is mostly designed @@ -77,12 +77,12 @@ int scols_cell_set_data(struct libscols_cell *ce, const char *str) * * Returns: 0, a negative value in case of an error. */ -int scols_cell_refer_data(struct libscols_cell *ce, char *str) +int scols_cell_refer_data(struct libscols_cell *ce, char *data) { if (!ce) return -EINVAL; free(ce->data); - ce->data = str; + ce->data = data; return 0; } @@ -158,20 +158,20 @@ int scols_cmpstr_cells(struct libscols_cell *a, /** * scols_cell_set_color: * @ce: a pointer to a struct libscols_cell instance - * @co: color name or ESC sequence + * @color: color name or ESC sequence * - * Set the color of @ce to @co. + * Set the color of @ce to @color. * * Returns: 0, a negative value in case of an error. */ -int scols_cell_set_color(struct libscols_cell *ce, const char *co) +int scols_cell_set_color(struct libscols_cell *ce, const char *color) { - if (co && isalpha(*co)) { - co = color_sequence_from_colorname(co); - if (!co) + if (color && isalpha(*color)) { + color = color_sequence_from_colorname(color); + if (!color) return -EINVAL; } - return strdup_to_struct_member(ce, color, co); + return strdup_to_struct_member(ce, color, color); } /** diff --git a/libsmartcols/src/column.c b/libsmartcols/src/column.c index 1e84a6363..2b6c691c7 100644 --- a/libsmartcols/src/column.c +++ b/libsmartcols/src/column.c @@ -207,7 +207,7 @@ struct libscols_cell *scols_column_get_header(struct libscols_column *cl) /** * scols_column_set_color: * @cl: a pointer to a struct libscols_column instance - * @co: color name or ESC sequence + * @color: color name or ESC sequence * * The default color for data cells and column header. * @@ -219,14 +219,14 @@ struct libscols_cell *scols_column_get_header(struct libscols_column *cl) * * Returns: 0, a negative value in case of an error. */ -int scols_column_set_color(struct libscols_column *cl, const char *co) +int scols_column_set_color(struct libscols_column *cl, const char *color) { - if (co && isalpha(*co)) { - co = color_sequence_from_colorname(co); - if (!co) + if (color && isalpha(*color)) { + color = color_sequence_from_colorname(color); + if (!color) return -EINVAL; } - return strdup_to_struct_member(cl, color, co); + return strdup_to_struct_member(cl, color, color); } /** diff --git a/libsmartcols/src/libsmartcols.h.in b/libsmartcols/src/libsmartcols.h.in index d6ae91f60..de45892f2 100644 --- a/libsmartcols/src/libsmartcols.h.in +++ b/libsmartcols/src/libsmartcols.h.in @@ -123,8 +123,8 @@ extern int scols_symbols_set_cell_padding(struct libscols_symbols *sy, const cha extern int scols_reset_cell(struct libscols_cell *ce); extern int scols_cell_copy_content(struct libscols_cell *dest, const struct libscols_cell *src); -extern int scols_cell_set_data(struct libscols_cell *ce, const char *str); -extern int scols_cell_refer_data(struct libscols_cell *ce, char *str); +extern int scols_cell_set_data(struct libscols_cell *ce, const char *data); +extern int scols_cell_refer_data(struct libscols_cell *ce, char *data); extern const char *scols_cell_get_data(const struct libscols_cell *ce); extern int scols_cell_set_color(struct libscols_cell *ce, const char *color); extern const char *scols_cell_get_color(const struct libscols_cell *ce); diff --git a/libsmartcols/src/line.c b/libsmartcols/src/line.c index 59ea0d1e0..454882094 100644 --- a/libsmartcols/src/line.c +++ b/libsmartcols/src/line.c @@ -283,18 +283,18 @@ int scols_line_next_child(struct libscols_line *ln, /** * scols_line_set_color: * @ln: a pointer to a struct libscols_line instance - * @co: color name or ESC sequence + * @color: color name or ESC sequence * * Returns: 0, a negative value in case of an error. */ -int scols_line_set_color(struct libscols_line *ln, const char *co) +int scols_line_set_color(struct libscols_line *ln, const char *color) { - if (co && isalnum(*co)) { - co = color_sequence_from_colorname(co); - if (!co) + if (color && isalnum(*color)) { + color = color_sequence_from_colorname(color); + if (!color) return -EINVAL; } - return strdup_to_struct_member(ln, color, co); + return strdup_to_struct_member(ln, color, color); } /** diff --git a/libsmartcols/src/table.c b/libsmartcols/src/table.c index 759b54c27..93f0b669c 100644 --- a/libsmartcols/src/table.c +++ b/libsmartcols/src/table.c @@ -116,7 +116,7 @@ void scols_unref_table(struct libscols_table *tb) /** * scols_table_set_name: * @tb: a pointer to a struct libscols_table instance - * @str: a name + * @name: a name * * The table name is used for example for JSON top level object name. * @@ -124,9 +124,9 @@ void scols_unref_table(struct libscols_table *tb) * * Since: 2.27 */ -int scols_table_set_name(struct libscols_table *tb, const char *str) +int scols_table_set_name(struct libscols_table *tb, const char *name) { - return strdup_to_struct_member(tb, name, str); + return strdup_to_struct_member(tb, name, name); } /** -- cgit v1.2.3-55-g7522