summaryrefslogtreecommitdiffstats
path: root/mbbsd/pmore.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-06-08 10:46:24 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-06-08 10:46:24 +0800
commita0f8ef1e2e04905908478088fc376435b770417c (patch)
treea96bd4096703e5d0bb0b9fe7c9499d0db7768070 /mbbsd/pmore.c
parentf55eaef82ab265772418a545f32fa2780468603b (diff)
downloadpttbbs-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 'mbbsd/pmore.c')
-rw-r--r--mbbsd/pmore.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/mbbsd/pmore.c b/mbbsd/pmore.c
index aaf7e1b4..02006ecb 100644
--- a/mbbsd/pmore.c
+++ b/mbbsd/pmore.c
@@ -129,6 +129,16 @@ int debug = 0;
// --------------------------------------------- <Defines and constants>
// --------------------------- <Display>
+
+/* ANSI COMMAND SYSTEM */
+#define STR_ANSICODE "[0123456789;,"
+
+/* On some systems with pmore style ANSI system applied,
+ * we don't have to define these again.
+ */
+#ifndef PMORE_STYLE_ANSI
+#define PMORE_STYLE_ANSI
+
// Escapes. I don't like \033 everywhere.
#define ESC_NUM (0x1b)
#define ESC_STR "\x1b"
@@ -137,14 +147,17 @@ int debug = 0;
// Common ANSI commands.
#define ANSI_RESET ESC_STR "[m"
#define ANSI_COLOR(x) ESC_STR "[" #x "m"
-#define STR_ANSICODE "[0123456789;,"
+#define ANSI_MOVETO(x,y) ESC_STR "[" #x ";" #y "H"
+#define ANSI_CLRTOEND ESC_STR "[K"
+
+#endif /* PMORE_STYLE_ANSI */
// Poor BBS terminal system Workarounds
// - Most BBS implements clrtoeol() as fake command
// and usually messed up when output ANSI quoted string.
// - A workaround is suggested by kcwu:
// https://opensvn.csie.org/traccgi/pttbbs/trac.cgi/changeset/519
-#define FORCE_CLRTOEOL() outs(ESC_STR "[K")
+#define FORCE_CLRTOEOL() outs(ANSI_CLRTOEND)
/* Again, if you have a BBS system which optimized out* without recognizing
* ANSI escapes, scrolling with ANSI text may result in melformed text (because