summaryrefslogtreecommitdiffstats
path: root/color.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2016-10-16 17:11:33 -0400
committerTavian Barnes <tavianator@tavianator.com>2016-10-16 17:11:33 -0400
commitec8c425866a164c3e73144751a5071aaf6660664 (patch)
tree4dc98f6ef5d24d78b4577ed48a3039f07c2ba945 /color.h
parentb2175be362b0a32d06d98369302d55b226b58ab1 (diff)
downloadbfs-ec8c425866a164c3e73144751a5071aaf6660664.tar.xz
Check for errors in -print and friends.
Diffstat (limited to 'color.h')
-rw-r--r--color.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/color.h b/color.h
index 1fd8e19..2ddc838 100644
--- a/color.h
+++ b/color.h
@@ -35,8 +35,9 @@ struct colors *parse_colors(const char *ls_colors);
* The color table to use.
* @param ftwbuf
* The bftw() data for the current path.
+ * @return 0 on success, -1 on failure.
*/
-void pretty_print(const struct colors *colors, const struct BFTW *ftwbuf);
+int pretty_print(const struct colors *colors, const struct BFTW *ftwbuf);
#if __GNUC__
# define BFS_PRINTF_ATTRIBUTE(f, v) __attribute__((format(printf, f, v)))
@@ -53,8 +54,9 @@ void pretty_print(const struct colors *colors, const struct BFTW *ftwbuf);
* The format string.
* @param ...
* The format string's arguments.
+ * @return 0 on success, -1 on failure.
*/
-void pretty_warning(const struct colors *colors, const char *format, ...) BFS_PRINTF_ATTRIBUTE(2, 3);
+int pretty_warning(const struct colors *colors, const char *format, ...) BFS_PRINTF_ATTRIBUTE(2, 3);
/**
* Pretty-print an error message.
@@ -65,8 +67,9 @@ void pretty_warning(const struct colors *colors, const char *format, ...) BFS_PR
* The format string.
* @param ...
* The format string's arguments.
+ * @return 0 on success, -1 on failure.
*/
-void pretty_error(const struct colors *colors, const char *format, ...) BFS_PRINTF_ATTRIBUTE(2, 3);
+int pretty_error(const struct colors *colors, const char *format, ...) BFS_PRINTF_ATTRIBUTE(2, 3);
/**
* Free a color table.