diff options
-rw-r--r-- | bfs.h | 6 | ||||
-rw-r--r-- | color.c | 18 | ||||
-rw-r--r-- | color.h | 12 | ||||
-rw-r--r-- | eval.c | 2 |
4 files changed, 19 insertions, 19 deletions
@@ -53,11 +53,11 @@ struct cmdline { size_t nroots; /** Color data. */ - struct color_table *colors; + struct colors *colors; /** Colors to use for stdout. */ - const struct color_table *stdout_colors; + const struct colors *stdout_colors; /** Colors to use for stderr. */ - const struct color_table *stderr_colors; + const struct colors *stderr_colors; /** -mindepth option. */ int mindepth; @@ -27,7 +27,7 @@ struct ext_color { struct ext_color *next; }; -struct color_table { +struct colors { const char *reset; const char *normal; const char *file; @@ -56,8 +56,8 @@ struct color_table { char *data; }; -struct color_table *parse_colors(const char *ls_colors) { - struct color_table *colors = malloc(sizeof(struct color_table)); +struct colors *parse_colors(const char *ls_colors) { + struct colors *colors = malloc(sizeof(struct colors)); if (!colors) { goto done; } @@ -210,7 +210,7 @@ done: return colors; } -static const char *file_color(const struct color_table *colors, const char *filename, const struct stat *sb) { +static const char *file_color(const struct colors *colors, const char *filename, const struct stat *sb) { if (!sb) { return colors->orphan; } @@ -291,7 +291,7 @@ static void print_esc(const char *esc, FILE *file) { fputs("m", file); } -void pretty_print(const struct color_table *colors, const struct BFTW *ftwbuf) { +void pretty_print(const struct colors *colors, const struct BFTW *ftwbuf) { const char *path = ftwbuf->path; if (!colors) { @@ -320,7 +320,7 @@ void pretty_print(const struct color_table *colors, const struct BFTW *ftwbuf) { fputs("\n", stdout); } -static void pretty_format(const struct color_table *colors, const char *color, const char *format, va_list args) { +static void pretty_format(const struct colors *colors, const char *color, const char *format, va_list args) { if (color) { print_esc(color, stderr); } @@ -332,7 +332,7 @@ static void pretty_format(const struct color_table *colors, const char *color, c } } -void pretty_warning(const struct color_table *colors, const char *format, ...) { +void pretty_warning(const struct colors *colors, const char *format, ...) { va_list args; va_start(args, format); @@ -341,7 +341,7 @@ void pretty_warning(const struct color_table *colors, const char *format, ...) { va_end(args); } -void pretty_error(const struct color_table *colors, const char *format, ...) { +void pretty_error(const struct colors *colors, const char *format, ...) { va_list args; va_start(args, format); @@ -350,7 +350,7 @@ void pretty_error(const struct color_table *colors, const char *format, ...) { va_end(args); } -void free_colors(struct color_table *colors) { +void free_colors(struct colors *colors) { if (colors) { struct ext_color *ext = colors->ext_list; while (ext) { @@ -17,7 +17,7 @@ /** * A lookup table for colors. */ -struct color_table; +struct colors; /** * Parse a color table. @@ -26,7 +26,7 @@ struct color_table; * A color table in the LS_COLORS environment variable format. * @return The parsed color table. */ -struct color_table *parse_colors(const char *ls_colors); +struct colors *parse_colors(const char *ls_colors); /** * Pretty-print a file path. @@ -36,7 +36,7 @@ struct color_table *parse_colors(const char *ls_colors); * @param ftwbuf * The bftw() data for the current path. */ -void pretty_print(const struct color_table *colors, const struct BFTW *ftwbuf); +void pretty_print(const struct colors *colors, const struct BFTW *ftwbuf); #if __GNUC__ # define BFS_PRINTF_ATTRIBUTE(f, v) __attribute__((format(printf, f, v))) @@ -54,7 +54,7 @@ void pretty_print(const struct color_table *colors, const struct BFTW *ftwbuf); * @param ... * The format string's arguments. */ -void pretty_warning(const struct color_table *colors, const char *format, ...) BFS_PRINTF_ATTRIBUTE(2, 3); +void pretty_warning(const struct colors *colors, const char *format, ...) BFS_PRINTF_ATTRIBUTE(2, 3); /** * Pretty-print an error message. @@ -66,7 +66,7 @@ void pretty_warning(const struct color_table *colors, const char *format, ...) B * @param ... * The format string's arguments. */ -void pretty_error(const struct color_table *colors, const char *format, ...) BFS_PRINTF_ATTRIBUTE(2, 3); +void pretty_error(const struct colors *colors, const char *format, ...) BFS_PRINTF_ATTRIBUTE(2, 3); /** * Free a color table. @@ -74,6 +74,6 @@ void pretty_error(const struct color_table *colors, const char *format, ...) BFS * @param colors * The color table to free. */ -void free_colors(struct color_table *colors); +void free_colors(struct colors *colors); #endif // BFS_COLOR_H @@ -387,7 +387,7 @@ bool eval_path(const struct expr *expr, struct eval_state *state) { * -print action. */ bool eval_print(const struct expr *expr, struct eval_state *state) { - const struct color_table *colors = state->cmdline->stdout_colors; + const struct colors *colors = state->cmdline->stdout_colors; if (colors) { fill_statbuf(state); } |