summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bfs.h6
-rw-r--r--color.c18
-rw-r--r--color.h12
-rw-r--r--eval.c2
4 files changed, 19 insertions, 19 deletions
diff --git a/bfs.h b/bfs.h
index 4b43ea5..b031eb1 100644
--- a/bfs.h
+++ b/bfs.h
@@ -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;
diff --git a/color.c b/color.c
index aea2a54..7e76853 100644
--- a/color.c
+++ b/color.c
@@ -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) {
diff --git a/color.h b/color.h
index 5f66b43..1fd8e19 100644
--- a/color.h
+++ b/color.h
@@ -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
diff --git a/eval.c b/eval.c
index 125342a..6f03249 100644
--- a/eval.c
+++ b/eval.c
@@ -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);
}