[PATCH 2/3] Implement simple color output

Eugene Syromiatnikov esyr at redhat.com
Tue Apr 4 09:46:44 UTC 2017


On Fri, Mar 31, 2017 at 07:20:52PM +0800, JingPiao Chen wrote:
[...]
> diff --git a/color.h b/color.h
> new file mode 100644
> index 0000000..8e58c90
> --- /dev/null
> +++ b/color.h
> @@ -0,0 +1,29 @@
> +#ifndef STRACE_COLOR_H
> +#define STRACE_COLOR_H
> +
> +#define C_CLEAR		"\033[0m"
> +#define C_BOLD		"\033[1m"
> +#define C_HALFBRIGHT	"\033[2m"
> +#define C_UNDERSCORE	"\033[4m"
> +#define C_BLINK		"\033[5m"
> +#define C_REVERSE	"\033[7m"
> +
> +#define C_BLACK		"\033[30m"
> +#define C_RED		"\033[31m"
> +#define C_GREEN		"\033[32m"
> +#define C_BROWN		"\033[33m"
> +#define C_BLUE		"\033[34m"
> +#define C_MAGENTA	"\033[35m"
> +#define C_CYAN		"\033[36m"
> +#define C_GRAY		"\033[37m"
> +
> +#define C_DARK_GRAY	"\033[1;30m"
> +#define C_BOLD_RED	"\033[1;31m"
> +#define C_BOLD_GREEN	"\033[1;32m"
> +#define C_BOLD_YELLOW	"\033[1;33m"
> +#define C_BOLD_BLUE	"\033[1;34m"
> +#define C_BOLD_MAGENTA	"\033[1;35m"
> +#define C_BOLD_CYAN	"\033[1;36m"
> +#define C_WHITE		"\033[1;37m"
> +
> +#endif /* !STRACE_COLOR_H*/

I think this would look hilarious on non-ANSI terminal.




More information about the Strace-devel mailing list