2 * InspIRCd -- Internet Relay Chat Daemon
4 * This file is part of InspIRCd. InspIRCd is free software: you can
5 * redistribute it and/or modify it under the terms of the GNU General Public
6 * License as published by the Free Software Foundation, version 2.
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
26 extern WORD g_wOriginalColors;
27 extern WORD g_wBackgroundColor;
28 extern HANDLE g_hStdout;
30 inline std::ostream& con_green(std::ostream &s)
32 SetConsoleTextAttribute(g_hStdout, FOREGROUND_GREEN|FOREGROUND_INTENSITY|g_wBackgroundColor);
36 inline std::ostream& con_red(std::ostream &s)
38 SetConsoleTextAttribute(g_hStdout, FOREGROUND_RED|FOREGROUND_INTENSITY|g_wBackgroundColor);
42 inline std::ostream& con_white(std::ostream &s)
44 SetConsoleTextAttribute(g_hStdout, FOREGROUND_RED|FOREGROUND_BLUE|FOREGROUND_GREEN|g_wBackgroundColor);
48 inline std::ostream& con_white_bright(std::ostream &s)
50 SetConsoleTextAttribute(g_hStdout, FOREGROUND_RED|FOREGROUND_BLUE|FOREGROUND_GREEN|FOREGROUND_INTENSITY|g_wBackgroundColor);
54 inline std::ostream& con_bright(std::ostream &s)
56 SetConsoleTextAttribute(g_hStdout, FOREGROUND_INTENSITY|g_wBackgroundColor);
60 inline std::ostream& con_reset(std::ostream &s)
62 SetConsoleTextAttribute(g_hStdout, g_wOriginalColors);
68 inline std::ostream& con_green(std::ostream &s)
70 return s << "\033[1;32m";
73 inline std::ostream& con_red(std::ostream &s)
75 return s << "\033[1;31m";
78 inline std::ostream& con_white(std::ostream &s)
80 return s << "\033[0m";
83 inline std::ostream& con_white_bright(std::ostream &s)
85 return s << "\033[1m";
88 inline std::ostream& con_bright(std::ostream &s)
90 return s << "\033[1m";
93 inline std::ostream& con_reset(std::ostream &s)
95 return s << "\033[0m";