summaryrefslogtreecommitdiffstats
path: root/include/colors.h
diff options
context:
space:
mode:
authorKarel Zak2013-09-02 10:54:30 +0200
committerKarel Zak2013-09-16 16:47:09 +0200
commit80a1712f546eb0669c9e4130a32c78cdeeb5fdab (patch)
treef62db3867f5e3aa18b2c36e2f7880e50569c513b /include/colors.h
parentfdisk: improve info output (diff)
downloadkernel-qcow2-util-linux-80a1712f546eb0669c9e4130a32c78cdeeb5fdab.tar.gz
kernel-qcow2-util-linux-80a1712f546eb0669c9e4130a32c78cdeeb5fdab.tar.xz
kernel-qcow2-util-linux-80a1712f546eb0669c9e4130a32c78cdeeb5fdab.zip
fdisk: add -L to colorize output
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'include/colors.h')
-rw-r--r--include/colors.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/include/colors.h b/include/colors.h
index b6c99171a..d2bd7b2aa 100644
--- a/include/colors.h
+++ b/include/colors.h
@@ -53,10 +53,25 @@ extern int colormode_or_err(const char *str, const char *errmsg);
/* Initialize the global variable OUT_IS_TERM */
extern int colors_init(int mode);
+/* Returns 1 or 0 */
+extern int colors_wanted(void);
+
/* Set the color to CLR_SCHEME */
-extern void color_enable(const char *clr_scheme);
+extern void color_fenable(const char *clr_scheme, FILE *f);
+
+static inline void color_enable(const char *clr_scheme)
+{
+ color_fenable(clr_scheme, stdout);
+}
/* Reset colors to default */
-extern void color_disable(void);
+extern void color_fdisable(FILE *f);
+
+static inline void color_disable(void)
+{
+ color_fdisable(stdout);
+}
+
+
#endif /* UTIL_LINUX_COLORS_H */