From: Karel Zak Date: Mon, 5 May 2014 14:32:14 +0000 (+0200) Subject: libsmartcols: use new colors API X-Git-Tag: v2.25-rc1~167 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3eb482d027bf797ba0eba1a770498018c4ec1c1c;p=thirdparty%2Futil-linux.git libsmartcols: use new colors API Signed-off-by: Karel Zak --- diff --git a/libsmartcols/src/cell.c b/libsmartcols/src/cell.c index 491b8a15c0..d73a1f8086 100644 --- a/libsmartcols/src/cell.c +++ b/libsmartcols/src/cell.c @@ -117,7 +117,7 @@ const char *scols_cell_get_data(const struct libscols_cell *ce) /** * scols_cell_set_color: * @ce: a pointer to a struct libscols_cell instance - * @color: a color string + * @color: color name or ESC sequence * * Set the color of @ce to @color. * @@ -132,8 +132,8 @@ int scols_cell_set_color(struct libscols_cell *ce, const char *color) if (!ce) return -EINVAL; if (color) { - if (isalnum(*color)) { - color = colorscheme_from_string(color); + if (isalpha(*color)) { + color = color_sequence_from_colorname(color); if (!color) return -EINVAL; diff --git a/libsmartcols/src/column.c b/libsmartcols/src/column.c index 4ee782fb24..a8f117f85c 100644 --- a/libsmartcols/src/column.c +++ b/libsmartcols/src/column.c @@ -190,7 +190,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 - * @color: a color string + * @color: color name or ESC sequence * * The default color for data cells and column header. * @@ -210,8 +210,8 @@ int scols_column_set_color(struct libscols_column *cl, const char *color) if (!cl) return -EINVAL; if (color) { - if (isalnum(*color)) { - color = colorscheme_from_string(color); + if (isalpha(*color)) { + color = color_sequence_from_colorname(color); if (!color) return -EINVAL; diff --git a/libsmartcols/src/line.c b/libsmartcols/src/line.c index 686a119454..32c8964ad6 100644 --- a/libsmartcols/src/line.c +++ b/libsmartcols/src/line.c @@ -285,7 +285,7 @@ int scols_line_next_child(struct libscols_line *ln, /** * scols_line_set_color: * @ln: a pointer to a struct libscols_line instance - * @color: a color string + * @color: color name or ESC sequence * * Returns: 0, a negative value in case of an error. */ @@ -298,7 +298,7 @@ int scols_line_set_color(struct libscols_line *ln, const char *color) return -EINVAL; if (color) { if (isalnum(*color)) { - color = colorscheme_from_string(color); + color = color_sequence_from_colorname(color); if (!color) return -EINVAL;