"Fossies" - the Fresh Open Source Software Archive

Member "HTTPing-2.9/colors.c" (29 Oct 2022, 1033 Bytes) of package /linux/www/HTTPing-2.9.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "colors.c" see the Fossies "Dox" file reference documentation.

    1 #include "colors.h"
    2 
    3 const char *c_error = "";
    4 const char *c_normal = "";
    5 const char *c_very_normal = "";
    6 const char *c_red = "";
    7 const char *c_blue = "";
    8 const char *c_green = "";
    9 const char *c_yellow = "";
   10 const char *c_magenta = "";
   11 const char *c_cyan = "";
   12 const char *c_white = "";
   13 const char *c_bright = "";
   14 
   15 void set_colors(char nc)
   16 {
   17     if (nc)
   18     {
   19         c_red = COLOR_ESCAPE "1";
   20         c_blue = COLOR_ESCAPE "2";
   21         c_green = COLOR_ESCAPE "3";
   22         c_yellow = COLOR_ESCAPE "4";
   23         c_magenta = COLOR_ESCAPE "5";
   24         c_cyan = COLOR_ESCAPE "6";
   25         c_white = COLOR_ESCAPE "7";
   26 
   27         c_bright = COLOR_ESCAPE "8";
   28         c_normal = COLOR_ESCAPE "9";
   29 
   30         c_very_normal = COLOR_ESCAPE "7" COLOR_ESCAPE "9";
   31 
   32         c_error = COLOR_ESCAPE "1";
   33     }
   34     else
   35     {
   36         c_red = "\033[31;40m";
   37         c_blue = "\033[34;40m";
   38         c_green = "\033[32;40m";
   39         c_yellow = "\033[33;40m";
   40         c_magenta = "\033[35;40m";
   41         c_cyan = "\033[36;40m";
   42         c_white = "\033[37;40m";
   43 
   44         c_bright = "\033[1;40m";
   45         c_normal = "\033[0;37;40m";
   46 
   47         c_very_normal = "\033[0m";
   48 
   49         c_error = "\033[1;4;40m";
   50     }
   51 }