diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-06-08 10:46:24 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-06-08 10:46:24 +0800 |
commit | a0f8ef1e2e04905908478088fc376435b770417c (patch) | |
tree | a96bd4096703e5d0bb0b9fe7c9499d0db7768070 /include/ansi.h | |
parent | f55eaef82ab265772418a545f32fa2780468603b (diff) | |
download | pttbbs-a0f8ef1e2e04905908478088fc376435b770417c.tar pttbbs-a0f8ef1e2e04905908478088fc376435b770417c.tar.gz pttbbs-a0f8ef1e2e04905908478088fc376435b770417c.tar.bz2 pttbbs-a0f8ef1e2e04905908478088fc376435b770417c.tar.lz pttbbs-a0f8ef1e2e04905908478088fc376435b770417c.tar.xz pttbbs-a0f8ef1e2e04905908478088fc376435b770417c.tar.zst pttbbs-a0f8ef1e2e04905908478088fc376435b770417c.zip |
New style to specify ANSI escape commands.
First introduced by pmore, but this hard work
(to transform all files to new style) is made by
Rong-en Fan (rafan). Thanks!
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2796 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'include/ansi.h')
-rw-r--r-- | include/ansi.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/ansi.h b/include/ansi.h new file mode 100644 index 00000000..1b0d9073 --- /dev/null +++ b/include/ansi.h @@ -0,0 +1,25 @@ +/* $Id */ +#ifndef INCLUDE_ANSI_H +#define INCLUDE_ANSI_H + +/* This is a more elegant style which is first introduced by pmore(piaip) + * and then promoted by Rong-en Fan (rafan). */ + +/* to help pmore know that we've already included this. */ +#define PMORE_STYLE_ANSI + +// Escapes. +#define ESC_NUM (0x1b) +#define ESC_STR "\x1b" +#define ESC_CHR '\x1b' + +// Common ANSI commands. +#define ANSI_RESET ESC_STR "[m" +#define ANSI_COLOR(x) ESC_STR "[" #x "m" +#define ANSI_MOVETO(x,y) ESC_STR "[" #x ";" #y "H" +#define ANSI_CLRTOEND ESC_STR "[K" + +#endif /* INCLUDE_ANSI_H */ + +/* vim:sw=4 + */ |