From e045a7b80cc0cb96b79456f9c74c3705989a12df Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Wed, 1 Jul 2020 17:28:09 +0200 Subject: Turn colors into global variables --- shared/utils.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'shared/utils.c') diff --git a/shared/utils.c b/shared/utils.c index 20d9809..13cacac 100644 --- a/shared/utils.c +++ b/shared/utils.c @@ -17,6 +17,25 @@ unsigned debug_mask = 0; +const char *ansi_red = ""; +const char *ansi_green = ""; +const char *ansi_yellow = ""; +const char *ansi_blue = ""; +const char *ansi_magenta = ""; +const char *ansi_grey = ""; +const char *ansi_normal = ""; + +void enable_colors() +{ + ansi_red = ANSI_RED; + ansi_green = ANSI_GREEN; + ansi_yellow = ANSI_YELLOW; + ansi_blue = ANSI_BLUE; + ansi_magenta = ANSI_MAGENTA; + ansi_grey = ANSI_GREY; + ansi_normal = ANSI_NORMAL; +} + void socket_set_low_latency(int sfd, bool keepalive, bool iptos, bool nodelay) { int option; -- cgit v1.2.3