bigbiff bigbiff | e60683a | 2013-02-22 20:55:50 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2012 Ondrej Oprala <ooprala@redhat.com> |
| 3 | * |
| 4 | * This file may be distributed under the terms of the |
| 5 | * GNU Lesser General Public License. |
| 6 | */ |
| 7 | #ifndef UTIL_LINUX_COLORS_H |
| 8 | #define UTIL_LINUX_COLORS_H |
| 9 | |
| 10 | #include <stdio.h> |
| 11 | #include <unistd.h> |
| 12 | |
| 13 | #define UL_COLOR_RESET "\033[0m" |
| 14 | #define UL_COLOR_BOLD "\033[1m" |
| 15 | #define UL_COLOR_HALFBRIGHT "\033[2m" |
| 16 | #define UL_COLOR_UNDERSCORE "\033[4m" |
| 17 | #define UL_COLOR_BLINK "\033[5m" |
| 18 | #define UL_COLOR_REVERSE "\033[7m" |
| 19 | |
| 20 | /* Standard colors */ |
| 21 | #define UL_COLOR_BLACK "\033[30m" |
| 22 | #define UL_COLOR_RED "\033[31m" |
| 23 | #define UL_COLOR_GREEN "\033[32m" |
| 24 | #define UL_COLOR_YELLOW "\033[33m" |
| 25 | #define UL_COLOR_BLUE "\033[34m" |
| 26 | #define UL_COLOR_MAGENTA "\033[35m" |
| 27 | #define UL_COLOR_CYAN "\033[36m" |
| 28 | #define UL_COLOR_GRAY "\033[37m" |
| 29 | |
| 30 | /* Bold variants */ |
| 31 | #define UL_COLOR_DARK_GRAY "\033[1;30m" |
| 32 | #define UL_COLOR_BOLD_RED "\033[1;31m" |
| 33 | #define UL_COLOR_BOLD_GREEN "\033[1;32m" |
| 34 | #define UL_COLOR_BOLD_YELLOW "\033[1;33m" |
| 35 | #define UL_COLOR_BOLD_BLUE "\033[1;34m" |
| 36 | #define UL_COLOR_BOLD_MAGENTA "\033[1;35m" |
| 37 | #define UL_COLOR_BOLD_CYAN "\033[1;36m" |
| 38 | |
| 39 | #define UL_COLOR_WHITE "\033[1;37m" |
| 40 | |
| 41 | /* Initialize the global variable OUT_IS_TERM */ |
| 42 | extern int colors_init(void); |
| 43 | |
| 44 | /* Set the color to CLR_SCHEME */ |
| 45 | extern void color_enable(const char *clr_scheme); |
| 46 | |
| 47 | /* Reset colors to default */ |
| 48 | extern void color_disable(void); |
| 49 | |
| 50 | #endif /* UTIL_LINUX_COLORS_H */ |