summaryrefslogtreecommitdiff
path: root/ansi.h
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2011-09-03 14:05:24 +0200
committerAxel Beckert <abe@deuxchevaux.org>2011-09-03 14:05:24 +0200
commit0e9a09d7718f02726b12924f7ddb05a992202aa3 (patch)
tree7b78a28379fdbe3a9dba37cd99c780c5d42c1e6c /ansi.h
parentbdf45bc45637eefdbdee913465729f9d31d6c255 (diff)
downloadscreen-0e9a09d7718f02726b12924f7ddb05a992202aa3.tar.gz
Imported Upstream version 3.9.11upstream/3.9.11
Diffstat (limited to 'ansi.h')
-rw-r--r--ansi.h62
1 files changed, 57 insertions, 5 deletions
diff --git a/ansi.h b/ansi.h
index b34d7bd..1ac661b 100644
--- a/ansi.h
+++ b/ansi.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 1993
+/* Copyright (c) 1993-2002
* Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
* Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
* Copyright (c) 1987 Oliver Laumann
@@ -43,6 +43,14 @@
#define ATYP_S (1<<1)
#define ATYP_U (1<<2)
+#ifdef COLORS16
+/* pseudo attributes */
+# define ATTR_BFG 6 /* bright foreground */
+# define ATTR_BBG 7 /* bright background */
+# define A_BFG (1<<ATTR_BFG)
+# define A_BBG (1<<ATTR_BBG)
+#endif
+
/*
* Parser state
*/
@@ -106,13 +114,57 @@ enum move_t {
#define STATLINE (D_height-1)
#endif
-#ifdef KANJI
+#ifdef ENCODINGS
-#undef KANJI
-#define KANJI ('B' & 037)
+#define KANJI ('B' & 037)
+#define KANJI0212 ('D' & 037)
#define KANA 'I'
-#define EUC 1
+#define EUC_JP 1
#define SJIS 2
+#define EUC_KR 3
+#define EUC_CN 4
+#define BIG5 5
+#define KOI8R 6
+#define CP1251 7
+
+#define EUC EUC_JP
+
+#endif
+
+#ifdef UTF8
+#undef UTF8
+#define UTF8 8
+#endif
+
+#ifdef UTF8
+# define UCS_REPL 0xfffd /* character for illegal codes */
+# define UCS_REPL_DW 0xff1f /* character for illegal codes */
+# define UCS_HIDDEN 0xffff
+#endif
+#ifdef DW_CHARS
+# define is_dw_font(f) ((f) && ((f) & 0x60) == 0)
+
+# ifdef UTF8
+# define dw_left(ml, x, enc) ((enc == UTF8) ? \
+ (unsigned char)(ml)->font[(x) + 1] == 0xff && (unsigned char)(ml)->image[(x) + 1] == 0xff : \
+ ((unsigned char)(ml)->font[x] & 0x1f) != 0 && ((unsigned char)(ml)->font[x] & 0xe0) == 0 \
+ )
+# define dw_right(ml, x, enc) ((enc == UTF8) ? \
+ (unsigned char)(ml)->font[x] == 0xff && (unsigned char)(ml)->image[x] == 0xff : \
+ ((unsigned char)(ml)->font[x] & 0xe0) == 0x80 \
+ )
+# else
+# define dw_left(ml, x, enc) ( \
+ ((unsigned char)(ml)->font[x] & 0x1f) != 0 && ((unsigned char)(ml)->font[x] & 0xe0) == 0 \
+ )
+# define dw_right(ml, x, enc) ( \
+ ((unsigned char)(ml)->font[x] & 0xe0) == 0x80 \
+ )
+# endif /* UTF8 */
+#else
+# define dw_left(ml, x, enc) 0
+# define dw_right(ml, x, enc) 0
#endif
+