diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2015-07-25 20:14:34 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2015-07-25 20:14:34 -0400 |
commit | 781f5902b7bbb91811f1f810f8a419607ed36294 (patch) | |
tree | 8ff1acf48ba81b2f35190a4f3d811ad1b6bf68f7 /color.h | |
parent | e674297be6be114a530cd06d2ca773baff1ce7cc (diff) | |
download | bfs-781f5902b7bbb91811f1f810f8a419607ed36294.tar.xz |
Recover from errors in diropen().
Fixes #4.
Diffstat (limited to 'color.h')
-rw-r--r-- | color.h | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -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 <sys/stat.h> /** @@ -38,9 +42,23 @@ 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. * * @param colors * The color table to free. */ void free_colors(color_table *colors); + +#endif // BFS_COLOR_H |