From 7a15a3efe85837d52d950cc9f895eadcc9eb6be1 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Fri, 7 Feb 2014 21:40:00 -0800 Subject: Name the terminal escapes --- src/io/tty.cpp | 21 +++++++++++++++++++++ src/io/tty.hpp | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 src/io/tty.cpp create mode 100644 src/io/tty.hpp (limited to 'src/io') diff --git a/src/io/tty.cpp b/src/io/tty.cpp new file mode 100644 index 0000000..d2e084e --- /dev/null +++ b/src/io/tty.cpp @@ -0,0 +1,21 @@ +#include "tty.hpp" +// io/tty.cpp - terminal escape sequences +// +// Copyright © 2014 Ben Longbons +// +// This file is part of The Mana World (Athena server) +// +// 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 3 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. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +/* Nothing to see here, move along */ diff --git a/src/io/tty.hpp b/src/io/tty.hpp new file mode 100644 index 0000000..86616f1 --- /dev/null +++ b/src/io/tty.hpp @@ -0,0 +1,38 @@ +#ifndef TMWA_IO_TTY_HPP +#define TMWA_IO_TTY_HPP +// io/tty.hpp - terminal escape sequences +// +// Copyright © 2014 Ben Longbons +// +// This file is part of The Mana World (Athena server) +// +// 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 3 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. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +# include "../sanity.hpp" + + +# define SGR_BLACK "\e[30m" +# define SGR_RED "\e[31m" +# define SGR_GREEN "\e[32m" +# define SGR_YELLOW "\e[33m" +# define SGR_BLUE "\e[34m" +# define SGR_MAGENTA "\e[35m" +# define SGR_CYAN "\e[36m" +# define SGR_WHITE "\e[37m" + +# define SGR_BOLD "\e[1m" + +# define SGR_RESET "\e[0m" + +#endif //TMWA_IO_TTY_HPP -- cgit v1.2.3-60-g2f50