diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2025-09-15 18:50:32 +0200 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2025-09-15 18:50:32 +0200 |
commit | c3eee8e333866d92e5fd94ae83cef618758c11bb (patch) | |
tree | 234a06fd90bd61a6668490a0cbf8870e6c674b81 /include |
FICS RPBLC v1.4.61.4.6
Diffstat (limited to 'include')
-rw-r--r-- | include/colors.h | 81 | ||||
-rw-r--r-- | include/stdinclude.h | 56 |
2 files changed, 137 insertions, 0 deletions
diff --git a/include/colors.h b/include/colors.h new file mode 100644 index 0000000..6902138 --- /dev/null +++ b/include/colors.h @@ -0,0 +1,81 @@ +/* Copyright (c) 2019 Markus Uhlin <markus.uhlin@icloud.com> + All rights reserved. + + Permission to use, copy, modify, and distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef _COLORS_H_ +#define _COLORS_H_ + +/* + * Reset all attributes to their defaults + */ +#define NORMAL "\x1b[0m" + +#define UNDERLINE_ON "\x1b[4m" +#define UNDERLINE_OFF "\x1b[24m" + +#define BLINK_ON "\x1b[5m" +#define BLINK_OFF "\x1b[25m" + +/* + * Reverse video + */ +#define REVVID_ON "\x1b[7m" +#define REVVID_OFF "\x1b[27m" + +#define BLACK "\x1b[30m" +#define RED "\x1b[31m" +#define GREEN "\x1b[32m" +#define BROWN "\x1b[33m" +#define BLUE "\x1b[34m" +#define MAGENTA "\x1b[35m" +#define CYAN "\x1b[36m" +#define WHITE "\x1b[37m" + +#define BOLDBLACK "\x1b[1;30m" +#define BOLDRED "\x1b[1;31m" +#define BOLDGREEN "\x1b[1;32m" +#define BOLDBROWN "\x1b[1;33m" +#define BOLDBLUE "\x1b[1;34m" +#define BOLDMAGENTA "\x1b[1;35m" +#define BOLDCYAN "\x1b[1;36m" +#define BOLDWHITE "\x1b[1;37m" + +#define UNDERSCORE_ON "\x1b[38m" +#define UNDERSCORE_OFF "\x1b[39m" + +#define BGBLACK "\x1b[40m" +#define BGRED "\x1b[41m" +#define BGGREEN "\x1b[42m" +#define BGBROWN "\x1b[43m" +#define BGBLUE "\x1b[44m" +#define BGMAGENTA "\x1b[45m" +#define BGCYAN "\x1b[46m" +#define BGWHITE "\x1b[47m" +#define BGDEFAULT "\x1b[49m" + +#if defined(_WIN32) && defined(ENABLE_VIRTUAL_TERMINAL_PROCESSING) +static void +VirtualTerminalProcessing(void) +{ + HANDLE output_handle = GetStdHandle(STD_OUTPUT_HANDLE); + DWORD modes = 0; + + GetConsoleMode(output_handle, &modes); + modes |= ENABLE_VIRTUAL_TERMINAL_PROCESSING; + SetConsoleMode(output_handle, modes); +} +#endif + +#endif diff --git a/include/stdinclude.h b/include/stdinclude.h new file mode 100644 index 0000000..fa7326e --- /dev/null +++ b/include/stdinclude.h @@ -0,0 +1,56 @@ +/* stdinclude.h + * + */ + +/* + fics - An internet chess server. + Copyright (C) 1993 Richard V. Nash + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. +*/ + +/* Revision history: + name email yy/mm/dd Change + Richard Nash 93/10/22 Created + Markus Uhlin 23/12/09 Added, removed and sorted +*/ + +#ifndef _STDINCLUDE_H +#define _STDINCLUDE_H + +#include <sys/dir.h> +#include <sys/errno.h> +#include <sys/file.h> +#include <sys/ioctl.h> +#include <sys/socket.h> +#include <sys/stat.h> +#include <sys/time.h> +#include <sys/types.h> +#include <sys/wait.h> + +#include <arpa/inet.h> +#include <netdb.h> +#include <netinet/in.h> + +#include <ctype.h> +#include <math.h> +#include <signal.h> +#include <stdarg.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <strings.h> +#include <time.h> +#include <unistd.h> + +//extern size_t malloc_size(void *); + +#endif /* _STDINCLUDE_H */ |