From 781f5902b7bbb91811f1f810f8a419607ed36294 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sat, 25 Jul 2015 20:14:34 -0400 Subject: Recover from errors in diropen(). Fixes #4. --- color.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'color.h') diff --git a/color.h b/color.h index 9bc5b5a..1432072 100644 --- a/color.h +++ b/color.h @@ -9,6 +9,10 @@ * the COPYING file or http://www.wtfpl.net/ for more details. * *********************************************************************/ +#ifndef BFS_COLOR_H +#define BFS_COLOR_H + +#include "bftw.h" #include /** @@ -37,6 +41,18 @@ color_table *parse_colors(char *ls_colors); */ void pretty_print(const color_table *colors, const char *fpath, const struct stat *sb); +/** + * Pretty-print an error. + * + * @param colors + * The color table to use. + * @param fpath + * The file path in error. + * @param ftwbuf + * The bftw() data for fpath. + */ +void print_error(const color_table *colors, const char *fpath, const struct BFTW *ftwbuf); + /** * Free a color table. * @@ -44,3 +60,5 @@ void pretty_print(const color_table *colors, const char *fpath, const struct sta * The color table to free. */ void free_colors(color_table *colors); + +#endif // BFS_COLOR_H -- cgit v1.2.3