diff options
author | David Härdeman <david@hardeman.nu> | 2020-07-01 17:28:09 +0200 |
---|---|---|
committer | David Härdeman <david@hardeman.nu> | 2020-07-01 17:28:09 +0200 |
commit | e045a7b80cc0cb96b79456f9c74c3705989a12df (patch) | |
tree | 00532a51671d2835217997dfdb204ba863fb0a1e /shared/utils.c | |
parent | 829ea0768672dad977ddeb30dd5e2b254bb4a4e9 (diff) |
Turn colors into global variables
Diffstat (limited to 'shared/utils.c')
-rw-r--r-- | shared/utils.c | 19 |
1 files changed, 19 insertions, 0 deletions
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; |