More standard handling G0,G1,G2,G3 graph.char sets

Handling of graphic character sets G0-G3 is fixed and implemented in
more consistent, extensible way.
This commit is contained in:
Siarzhuk Zharski
2013-03-25 10:34:10 +01:00
parent 9595506fb8
commit daebca78f8
5 changed files with 260 additions and 483 deletions
+7
View File
@@ -124,6 +124,7 @@ public:
// insert chars/lines // insert chars/lines
inline void InsertChar(UTF8Char c); inline void InsertChar(UTF8Char c);
void InsertChar(UTF8Char c, uint32 width); void InsertChar(UTF8Char c, uint32 width);
inline void InsertChar(const char* c);
inline void InsertChar(const char* c, int32 length); inline void InsertChar(const char* c, int32 length);
inline void InsertChar(const char* c, int32 length, inline void InsertChar(const char* c, int32 length,
uint32 width); uint32 width);
@@ -279,6 +280,12 @@ BasicTerminalBuffer::InsertChar(UTF8Char c)
} }
void
BasicTerminalBuffer::InsertChar(const char* c)
{
return InsertChar(UTF8Char(c), 1);
}
void void
BasicTerminalBuffer::InsertChar(const char* c, int32 length) BasicTerminalBuffer::InsertChar(const char* c, int32 length)
{ {
+66 -132
View File
@@ -51,8 +51,7 @@ extern int gIesTable[]; /* ignore ESC table */
extern int gEscIgnoreTable[]; /* ESC ignore table */ extern int gEscIgnoreTable[]; /* ESC ignore table */
extern int gMbcsTable[]; /* ESC $ */ extern int gMbcsTable[]; /* ESC $ */
extern int gLineDrawTable[]; /* ESC ( 0 */ extern const char* gLineDrawGraphSet[]; /* may be used for G0, G1, G2, G3 */
#define DEFAULT -1 #define DEFAULT -1
#define NPARAM 10 // Max parameters #define NPARAM 10 // Max parameters
@@ -388,9 +387,10 @@ TermParse::EscParse()
int *groundtable = gUTF8GroundTable; int *groundtable = gUTF8GroundTable;
int *parsestate = gUTF8GroundTable; int *parsestate = gUTF8GroundTable;
/* Handle switch between G0 and G1 character sets */ /* handle alternative character sets G0 - G4 */
int *alternateParseTable = gUTF8GroundTable; const char** graphSets[4] = { NULL, NULL, NULL, NULL };
bool shifted_in = false; int curGL = 0;
int curGR = 0;
int32 srcLen = sizeof(cbuf); int32 srcLen = sizeof(cbuf);
int32 dstLen = sizeof(dstbuf); int32 dstLen = sizeof(dstbuf);
@@ -416,9 +416,20 @@ TermParse::EscParse()
switch (parsestate[c]) { switch (parsestate[c]) {
case CASE_PRINT: case CASE_PRINT:
fBuffer->InsertChar((char)c); {
int curGS = c < 128 ? curGL : curGR;
const char** curGraphSet = graphSets[curGS];
if (curGraphSet != NULL) {
int offset = c - (c < 128 ? 0x20 : 0xA0);
if (offset >= 0 && offset < 96
&& (curGraphSet[offset] != 0)) {
fBuffer->InsertChar(curGraphSet[offset]);
break;
}
}
fBuffer->InsertChar((char)(c));
break; break;
}
case CASE_PRINT_GR: case CASE_PRINT_GR:
/* case iso8859 gr character, or euc */ /* case iso8859 gr character, or euc */
ptr = cbuf; ptr = cbuf;
@@ -485,91 +496,6 @@ TermParse::EscParse()
fBuffer->InsertChar(dstbuf, dstLen); fBuffer->InsertChar(dstbuf, dstLen);
break; break;
case CASE_PRINT_GRA:
/* "Special characters and line drawing" enabled by \E(0 */
switch (c) {
case '`': // ACS_DIAMOND
fBuffer->InsertChar("\xE2\x97\x86", 3);
break;
case 'a': // ACS_CKBOARD
fBuffer->InsertChar("\xE2\x96\x92", 3);
break;
case 'f': // ACS_DEGREE
fBuffer->InsertChar("\xC2\xB0", 2);
break;
case 'g': // ACS_PLMINUS
fBuffer->InsertChar("\xC2\xB1", 2);
break;
case 'i': // ACS_LANTERN
fBuffer->InsertChar("\xE2\x98\x83", 3);
break;
case 'j': // ACS_LRCORNER
fBuffer->InsertChar("\xE2\x94\x98", 3);
break;
case 'k': // ACS_URCORNER
fBuffer->InsertChar("\xE2\x94\x90", 3);
break;
case 'l': // ACS_ULCORNER
fBuffer->InsertChar("\xE2\x94\x8C", 3);
break;
case 'm': // ACS_LLCORNER
fBuffer->InsertChar("\xE2\x94\x94", 3);
break;
case 'n': // ACS_PLUS
fBuffer->InsertChar("\xE2\x94\xBC", 3);
break;
case 'o': // ACS_S1
fBuffer->InsertChar("\xE2\x8E\xBA", 3);
break;
case 'p': // ACS_S3
fBuffer->InsertChar("\xE2\x8E\xBB", 3);
break;
case 'r': // ACS_S7
fBuffer->InsertChar("\xE2\x8E\xBC", 3);
break;
case 's': // ACS_S9
fBuffer->InsertChar("\xE2\x8E\xBD", 3);
break;
case 'q': // ACS_HLINE
fBuffer->InsertChar("\xE2\x94\x80", 3);
break;
case 't': // ACS_LTEE
fBuffer->InsertChar("\xE2\x94\x9C", 3);
break;
case 'u': // ACS_RTEE
fBuffer->InsertChar("\xE2\x94\xA4", 3);
break;
case 'v': // ACS_BTEE
fBuffer->InsertChar("\xE2\x94\xB4", 3);
break;
case 'w': // ACS_TTEE
fBuffer->InsertChar("\xE2\x94\xAC", 3);
break;
case 'x': // ACS_VLINE
fBuffer->InsertChar("\xE2\x94\x82", 3);
break;
case 'y': // ACS_LEQUAL
fBuffer->InsertChar("\xE2\x89\xA4", 3);
break;
case 'z': // ACS_GEQUAL
fBuffer->InsertChar("\xE2\x89\xA5", 3);
break;
case '{': // ACS_PI
fBuffer->InsertChar("\xCF\x80", 2);
break;
case '|': // ACS_NEQUAL
fBuffer->InsertChar("\xE2\x89\xA0", 3);
break;
case '}': // ACS_STERLING
fBuffer->InsertChar("\xC2\xA3", 2);
break;
case '~': // ACS_BULLET
fBuffer->InsertChar("\xC2\xB7", 2);
default:
fBuffer->InsertChar((char)c);
}
break;
case CASE_LF: case CASE_LF:
fBuffer->InsertLF(); fBuffer->InsertLF();
break; break;
@@ -639,26 +565,40 @@ TermParse::EscParse()
case CASE_SCS_STATE: case CASE_SCS_STATE:
{ {
char page = _NextParseChar(); int set = -1;
switch (c) {
case '(':
set = 0;
break;
case ')':
case '-':
set = 1;
break;
case '*':
case '.':
set = 2;
break;
case '+':
case '/':
set = 3;
break;
default:
break;
}
int* newTable = _GuessGroundTable(currentEncoding); if (set > -1) {
if (page == '0') char page = _NextParseChar();
newTable = gLineDrawTable; switch (page) {
case '0':
if (c == '(') { graphSets[set] = gLineDrawGraphSet;
if (shifted_in) break;
alternateParseTable = newTable; default:
else graphSets[set] = NULL;
groundtable = newTable; break;
} else if (c == ')') { }
if (!shifted_in)
alternateParseTable = newTable;
else
groundtable = newTable;
} }
parsestate = groundtable; parsestate = groundtable;
break; break;
} }
@@ -698,22 +638,16 @@ TermParse::EscParse()
/* Ignore character */ /* Ignore character */
break; break;
case CASE_SI: case CASE_LS1:
/* shift in (to G1 charset) */ /* select G1 into GL */
if (shifted_in == false) { curGL = 1;
int* tmp = alternateParseTable; parsestate = groundtable;
alternateParseTable = parsestate;
parsestate = tmp;
}
break; break;
case CASE_SO: case CASE_LS0:
/* shift out (to G0 charset) */ /* select G0 into GL */
if (shifted_in == true) { curGL = 0;
int* tmp = alternateParseTable; parsestate = groundtable;
alternateParseTable = parsestate;
parsestate = tmp;
}
break; break;
case CASE_SCR_STATE: // ESC # case CASE_SCR_STATE: // ESC #
@@ -1199,32 +1133,32 @@ TermParse::EscParse()
break; break;
case CASE_LS2: case CASE_LS2:
/* LS2 */ /* select G2 into GL */
// screen->curgl = 2; curGL = 2;
parsestate = groundtable; parsestate = groundtable;
break; break;
case CASE_LS3: case CASE_LS3:
/* LS3 */ /* select G3 into GL */
// screen->curgl = 3; curGL = 3;
parsestate = groundtable; parsestate = groundtable;
break; break;
case CASE_LS3R: case CASE_LS3R:
/* LS3R */ /* select G3 into GR */
// screen->curgr = 3; curGR = 3;
parsestate = groundtable; parsestate = groundtable;
break; break;
case CASE_LS2R: case CASE_LS2R:
/* LS2R */ /* select G2 into GR */
// screen->curgr = 2; curGR = 2;
parsestate = groundtable; parsestate = groundtable;
break; break;
case CASE_LS1R: case CASE_LS1R:
/* LS1R */ /* select G1 into GR */
// screen->curgr = 1; curGR = 1;
parsestate = groundtable; parsestate = groundtable;
break; break;
+5
View File
@@ -23,6 +23,11 @@ struct UTF8Char {
bytes[0] = c; bytes[0] = c;
} }
UTF8Char(const char* c)
{
SetTo(c, ByteCount(*c));
}
UTF8Char(const char* c, int32 count) UTF8Char(const char* c, int32 count)
{ {
SetTo(c, count); SetTo(c, count);
+180 -348
View File
@@ -9,6 +9,8 @@
* Siarzhuk Zharski, [email protected] * Siarzhuk Zharski, [email protected]
*/ */
#include <SupportDefs.h>
#include "VTparse.h" #include "VTparse.h"
#define USE_MBCS #define USE_MBCS
@@ -35,8 +37,8 @@ CASE_LF, /* CASE_UP*/
/* NP CR SO SI */ /* NP CR SO SI */
CASE_LF, /* CASE_IGNORE*/ CASE_LF, /* CASE_IGNORE*/
CASE_CR, CASE_CR,
CASE_SO, CASE_LS1,
CASE_SI, CASE_LS0,
/* DLE DC1 DC2 DC3 */ /* DLE DC1 DC2 DC3 */
CASE_IGNORE, CASE_IGNORE,
CASE_IGNORE, CASE_IGNORE,
@@ -360,8 +362,8 @@ CASE_LF, /* CASE_UP*/
/* NP CR SO SI */ /* NP CR SO SI */
CASE_LF, /* CASE_IGNORE*/ CASE_LF, /* CASE_IGNORE*/
CASE_CR, CASE_CR,
CASE_SO, CASE_LS1,
CASE_SI, CASE_LS0,
/* DLE DC1 DC2 DC3 */ /* DLE DC1 DC2 DC3 */
CASE_IGNORE, CASE_IGNORE,
CASE_IGNORE, CASE_IGNORE,
@@ -685,8 +687,8 @@ CASE_LF, /*CASE_UP,*/
/* NP CR SO SI */ /* NP CR SO SI */
CASE_LF, /*CASE_IGNORE,*/ CASE_LF, /*CASE_IGNORE,*/
CASE_CR, CASE_CR,
CASE_SO, CASE_LS1,
CASE_SI, CASE_LS0,
/* DLE DC1 DC2 DC3 */ /* DLE DC1 DC2 DC3 */
CASE_IGNORE, CASE_IGNORE,
CASE_IGNORE, CASE_IGNORE,
@@ -1010,8 +1012,8 @@ CASE_LF, /*CASE_UP,*/
/* NP CR SO SI */ /* NP CR SO SI */
CASE_LF, /*CASE_IGNORE,*/ CASE_LF, /*CASE_IGNORE,*/
CASE_CR, CASE_CR,
CASE_SO, CASE_LS1,
CASE_SI, CASE_LS0,
/* DLE DC1 DC2 DC3 */ /* DLE DC1 DC2 DC3 */
CASE_IGNORE, CASE_IGNORE,
CASE_IGNORE, CASE_IGNORE,
@@ -1335,8 +1337,8 @@ CASE_VMOT,
/* NP CR SO SI */ /* NP CR SO SI */
CASE_VMOT, CASE_VMOT,
CASE_CR, CASE_CR,
CASE_SO, CASE_LS1,
CASE_SI, CASE_LS0,
/* DLE DC1 DC2 DC3 */ /* DLE DC1 DC2 DC3 */
CASE_IGNORE, CASE_IGNORE,
CASE_IGNORE, CASE_IGNORE,
@@ -1660,8 +1662,8 @@ CASE_VMOT,
/* NP CR SO SI */ /* NP CR SO SI */
CASE_VMOT, CASE_VMOT,
CASE_CR, CASE_CR,
CASE_SO, CASE_LS1,
CASE_SI, CASE_LS0,
/* DLE DC1 DC2 DC3 */ /* DLE DC1 DC2 DC3 */
CASE_IGNORE, CASE_IGNORE,
CASE_IGNORE, CASE_IGNORE,
@@ -2002,8 +2004,8 @@ CASE_VMOT,
/* NP CR SO SI */ /* NP CR SO SI */
CASE_VMOT, CASE_VMOT,
CASE_CR, CASE_CR,
CASE_SO, CASE_LS1,
CASE_SI, CASE_LS0,
/* DLE DC1 DC2 DC3 */ /* DLE DC1 DC2 DC3 */
CASE_IGNORE, CASE_IGNORE,
CASE_IGNORE, CASE_IGNORE,
@@ -2328,8 +2330,8 @@ CASE_LF, /*CASE_UP,*/
/* NP CR SO SI */ /* NP CR SO SI */
CASE_LF, /*CASE_IGNORE,*/ CASE_LF, /*CASE_IGNORE,*/
CASE_CR, CASE_CR,
CASE_SO, CASE_LS1,
CASE_SI, CASE_LS0,
/* DLE DC1 DC2 DC3 */ /* DLE DC1 DC2 DC3 */
CASE_IGNORE, CASE_IGNORE,
CASE_IGNORE, CASE_IGNORE,
@@ -3321,8 +3323,8 @@ CASE_VMOT,
/* NP CR SO SI */ /* NP CR SO SI */
CASE_VMOT, CASE_VMOT,
CASE_CR, CASE_CR,
CASE_SO, CASE_LS1,
CASE_SI, CASE_LS0,
/* DLE DC1 DC2 DC3 */ /* DLE DC1 DC2 DC3 */
CASE_IGNORE, CASE_IGNORE,
CASE_IGNORE, CASE_IGNORE,
@@ -3646,8 +3648,8 @@ CASE_VMOT,
/* NP CR SO SI */ /* NP CR SO SI */
CASE_VMOT, CASE_VMOT,
CASE_CR, CASE_CR,
CASE_SO, CASE_LS1,
CASE_SI, CASE_LS0,
/* DLE DC1 DC2 DC3 */ /* DLE DC1 DC2 DC3 */
CASE_IGNORE, CASE_IGNORE,
CASE_IGNORE, CASE_IGNORE,
@@ -4074,8 +4076,8 @@ CASE_VMOT,
/* NP CR SO SI */ /* NP CR SO SI */
CASE_VMOT, CASE_VMOT,
CASE_CR, CASE_CR,
CASE_SO, CASE_LS1,
CASE_SI, CASE_LS0,
/* DLE DC1 DC2 DC3 */ /* DLE DC1 DC2 DC3 */
CASE_IGNORE, CASE_IGNORE,
CASE_IGNORE, CASE_IGNORE,
@@ -4398,8 +4400,8 @@ CASE_VMOT,
/* NP CR SO SI */ /* NP CR SO SI */
CASE_VMOT, CASE_VMOT,
CASE_CR, CASE_CR,
CASE_SO, CASE_LS1,
CASE_SI, CASE_LS0,
/* DLE DC1 DC2 DC3 */ /* DLE DC1 DC2 DC3 */
CASE_IGNORE, CASE_IGNORE,
CASE_IGNORE, CASE_IGNORE,
@@ -4725,8 +4727,8 @@ CASE_LF, /*CASE_UP,*/
/* NP CR SO SI */ /* NP CR SO SI */
CASE_LF, /*CASE_IGNORE,*/ CASE_LF, /*CASE_IGNORE,*/
CASE_CR, CASE_CR,
CASE_SO, CASE_LS1,
CASE_SI, CASE_LS0,
/* DLE DC1 DC2 DC3 */ /* DLE DC1 DC2 DC3 */
CASE_IGNORE, CASE_IGNORE,
CASE_IGNORE, CASE_IGNORE,
@@ -5029,328 +5031,158 @@ CASE_SJIS_INSTRING,
CASE_SJIS_INSTRING, CASE_SJIS_INSTRING,
}; };
/*
* 94/96 alternative character sets for G0-G3
*
* - characters to replace are UTF-8 literals
* - NULL mean falling through to corresponding ASCII chars
*
*/
// #pragma mark Line drawing table /* DEC Special Graphic Character Set - mix of xterm
int gLineDrawTable[] = definitions and ncurses extended characters (ACS_) */
const char* gLineDrawGraphSet[96] =
{ {
/* NUL SOH STX ETX */ // SP ! " #
CASE_IGNORE, NULL,
CASE_IGNORE, NULL,
CASE_IGNORE, NULL,
CASE_IGNORE, NULL,
/* EOT ENQ ACK BEL */
CASE_IGNORE, // $ % & '
CASE_IGNORE, NULL,
CASE_IGNORE, NULL,
CASE_BELL, NULL,
/* BS HT NL VT */ NULL,
CASE_BS,
CASE_TAB, // ( ) * +
CASE_LF, NULL,
CASE_LF, /* CASE_UP*/ NULL,
/* NP CR SO SI */ NULL,
CASE_LF, /* CASE_IGNORE*/ "\xE2\x86\x92", // ACS_RARROW
CASE_CR,
CASE_SO, // , - . /
CASE_SI, "\xE2\x86\x90", // ACS_LARROW
/* DLE DC1 DC2 DC3 */ "\xE2\x86\x91", // ACS_UARROW
CASE_IGNORE, "\xE2\x86\x93", // ACS_DARROW
CASE_IGNORE, NULL,
CASE_IGNORE,
CASE_IGNORE, // 0 1 2 3
/* DC4 NAK SYN ETB */ "\xE2\x96\xAE", // ACS_BLOCK
CASE_IGNORE, NULL,
CASE_IGNORE, NULL,
CASE_IGNORE, NULL,
CASE_IGNORE,
/* CAN EM SUB ESC */ // 4 5 6 7
CASE_IGNORE, NULL,
CASE_IGNORE, NULL,
CASE_IGNORE, NULL,
CASE_ESC, NULL,
/* FS GS RS US */
CASE_IGNORE, // 8 9 : ;
CASE_IGNORE, NULL,
CASE_IGNORE, NULL,
CASE_IGNORE, NULL,
/* SP ! " # */ NULL,
CASE_PRINT,
CASE_PRINT, // < = > ?
CASE_PRINT, NULL,
CASE_PRINT, NULL,
/* $ % & ' */ NULL,
CASE_PRINT, NULL,
CASE_PRINT,
CASE_PRINT, // @ A B C
CASE_PRINT, NULL,
/* ( ) * + */ NULL,
CASE_PRINT, NULL,
CASE_PRINT, NULL,
CASE_PRINT,
CASE_PRINT, // D E F G
/* , - . / */ NULL,
CASE_PRINT, NULL,
CASE_PRINT, NULL,
CASE_PRINT, NULL,
CASE_PRINT,
/* 0 1 2 3 */ // H I J K
CASE_PRINT, NULL,
CASE_PRINT, NULL,
CASE_PRINT, NULL,
CASE_PRINT, NULL,
/* 4 5 6 7 */
CASE_PRINT, // L M N O
CASE_PRINT, NULL,
CASE_PRINT, NULL,
CASE_PRINT, NULL,
/* 8 9 : ; */ NULL,
CASE_PRINT,
CASE_PRINT, // P Q R S
CASE_PRINT, NULL,
CASE_PRINT, NULL,
/* < = > ? */ NULL,
CASE_PRINT, NULL,
CASE_PRINT,
CASE_PRINT, // T U V W
CASE_PRINT, NULL,
/* @ A B C */ NULL,
CASE_PRINT, NULL,
CASE_PRINT, NULL,
CASE_PRINT,
CASE_PRINT, // X Y Z [
/* D E F G */ NULL,
CASE_PRINT, NULL,
CASE_PRINT, NULL,
CASE_PRINT, NULL,
CASE_PRINT, // \ ] ^ _
/* H I J K */ NULL,
CASE_PRINT, NULL,
CASE_PRINT, NULL,
CASE_PRINT, "\xE2\x96\xAE", // xterm: black vertical rectangle
CASE_PRINT,
/* L M N O */ // ` a b c
CASE_PRINT, "\xE2\x97\x86", // ACS_DIAMOND
CASE_PRINT, "\xE2\x96\x92", // ACS_CKBOARD
CASE_PRINT, "\xE2\x90\x89", // xterm:symbol for horizontal tabulation
CASE_PRINT, "\xE2\x90\x8C", // xterm:symbol for form feed
/* P Q R S */
CASE_PRINT, // d e f g
CASE_PRINT, "\xE2\x90\x8D", // xterm:symbol for carriage return
CASE_PRINT, "\xE2\x90\x8A", // xterm:symbol for line feed
CASE_PRINT, "\xC2\xB0", // ACS_DEGREE
/* T U V W */ "\xC2\xB1", // ACS_PLMINUS
CASE_PRINT,
CASE_PRINT, // h i j k
CASE_PRINT, "\xE2\x90\xA4", // xterm:symbol for newline (ACS_BOARD)
CASE_PRINT, "\xE2\x98\x83", // ACS_LANTERN (xterm:symbol for vert.tab: \xE2\x90\x8B)
/* X Y Z [ */ "\xE2\x94\x98", // ACS_LRCORNER
CASE_PRINT, "\xE2\x94\x90", // ACS_URCORNER
CASE_PRINT,
CASE_PRINT, // l m n o
CASE_PRINT, "\xE2\x94\x8C", // ACS_ULCORNER
/* \ ] ^ _ */ "\xE2\x94\x94", // ACS_LLCORNER
CASE_PRINT, "\xE2\x94\xBC", // ACS_PLUS
CASE_PRINT, "\xE2\x8E\xBA", // ACS_S1
CASE_PRINT,
CASE_PRINT, // p q r s
/* ` a b c */ "\xE2\x8E\xBB", // ACS_S3
CASE_PRINT_GRA, "\xE2\x94\x80", // ACS_HLINE
CASE_PRINT_GRA, "\xE2\x8E\xBC", // ACS_S7
CASE_PRINT, "\xE2\x8E\xBD", // ACS_S9
CASE_PRINT,
/* d e f g */ // t u v w
CASE_PRINT, "\xE2\x94\x9C", // ACS_LTEE
CASE_PRINT, "\xE2\x94\xA4", // ACS_RTEE
CASE_PRINT_GRA, "\xE2\x94\xB4", // ACS_BTEE
CASE_PRINT_GRA, "\xE2\x94\xAC", // ACS_TTEE
/* h i j k */
CASE_PRINT, // x y z {
CASE_PRINT_GRA, "\xE2\x94\x82", // ACS_VLINE
CASE_PRINT_GRA, "\xE2\x89\xA4", // ACS_LEQUAL
CASE_PRINT_GRA, "\xE2\x89\xA5", // ACS_GEQUAL
/* l m n o */ "\xCF\x80", // ACS_PI
CASE_PRINT_GRA,
CASE_PRINT_GRA, // | } ~ DEL
CASE_PRINT_GRA, "\xE2\x89\xA0", // ACS_NEQUAL
CASE_PRINT, "\xC2\xA3", // ACS_STERLING
/* p q r s */ "\xC2\xB7", // ACS_BULLET
CASE_PRINT, NULL
CASE_PRINT_GRA,
CASE_PRINT,
CASE_PRINT,
/* t u v w */
CASE_PRINT_GRA,
CASE_PRINT_GRA,
CASE_PRINT_GRA,
CASE_PRINT_GRA,
/* x y z { */
CASE_PRINT_GRA,
CASE_PRINT_GRA,
CASE_PRINT_GRA,
CASE_PRINT_GRA,
/* | } ~ DEL */
CASE_PRINT_GRA,
CASE_PRINT_GRA,
CASE_PRINT_GRA,
CASE_IGNORE,
/* 0x80 0x81 0x82 0x83 */
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
/* 0x84 0x85 0x86 0x87 */
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
/* 0x88 0x89 0x8a 0x8b */
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
/* 0x8c 0x8d 0x8e 0x8f */
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
/* 0x90 0x91 0x92 0x93 */
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
/* 0x94 0x95 0x96 0x97 */
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
/* 0x99 0x99 0x9a 0x9b */
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
/* 0x9c 0x9d 0x9e 0x9f */
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
/* 0xa0 0xa1 0xa2 0xa3 */
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
/* 0xa4 0xa5 0xa6 0xa7 */
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
/* 0xa8 0xa9 0xaa 0xab */
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
/* 0xac 0xad 0xae 0xaf */
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
/* 0xb0 0xb1 0xb2 0xb3 */
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
/* 0xb4 0xb5 0xb6 0xb7 */
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
/* 0xb8 0xb9 0xba 0xbb */
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
/* 0xbc 0xbd 0xbe 0xbf */
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
CASE_UTF8_INSTRING,
/* 0xc0 0xc1 0xc2 0xc3 */
CASE_UTF8_2BYTE,
CASE_UTF8_2BYTE,
CASE_UTF8_2BYTE,
CASE_UTF8_2BYTE,
/* 0xc4 0xc5 0xc6 0xc7 */
CASE_UTF8_2BYTE,
CASE_UTF8_2BYTE,
CASE_UTF8_2BYTE,
CASE_UTF8_2BYTE,
/* 0xc8 0xc9 0xca 0xcb */
CASE_UTF8_2BYTE,
CASE_UTF8_2BYTE,
CASE_UTF8_2BYTE,
CASE_UTF8_2BYTE,
/* 0xcc 0xcd 0xce 0xcf */
CASE_UTF8_2BYTE,
CASE_UTF8_2BYTE,
CASE_UTF8_2BYTE,
CASE_UTF8_2BYTE,
/* 0xd0 0xd1 0xd2 0xd3 */
CASE_UTF8_2BYTE,
CASE_UTF8_2BYTE,
CASE_UTF8_2BYTE,
CASE_UTF8_2BYTE,
/* 0xd4 0xd5 0xd6 0xd7 */
CASE_UTF8_2BYTE,
CASE_UTF8_2BYTE,
CASE_UTF8_2BYTE,
CASE_UTF8_2BYTE,
/* 0xd8 0xd9 0xda 0xdb */
CASE_UTF8_2BYTE,
CASE_UTF8_2BYTE,
CASE_UTF8_2BYTE,
CASE_UTF8_2BYTE,
/* 0xdc 0xdd 0xde 0xdf */
CASE_UTF8_2BYTE,
CASE_UTF8_2BYTE,
CASE_UTF8_2BYTE,
CASE_UTF8_2BYTE,
/* 0xe0 0xe1 0xe2 0xe3 */
CASE_UTF8_3BYTE,
CASE_UTF8_3BYTE,
CASE_UTF8_3BYTE,
CASE_UTF8_3BYTE,
/* 0xe4 0xe5 0xe6 0xe7 */
CASE_UTF8_3BYTE,
CASE_UTF8_3BYTE,
CASE_UTF8_3BYTE,
CASE_UTF8_3BYTE,
/* 0xe8 0xe9 0xea 0xeb */
CASE_UTF8_3BYTE,
CASE_UTF8_3BYTE,
CASE_UTF8_3BYTE,
CASE_UTF8_3BYTE,
/* 0xec 0xed 0xee 0xef */
CASE_UTF8_3BYTE,
CASE_UTF8_3BYTE,
CASE_UTF8_3BYTE,
CASE_UTF8_3BYTE,
/* 0xf0 0xf1 0xf2 0xf3 */
CASE_UTF8_3BYTE,
CASE_UTF8_3BYTE,
CASE_UTF8_3BYTE,
CASE_UTF8_3BYTE,
/* 0xf4 0xf5 0xf6 0xf7 */
CASE_UTF8_3BYTE,
CASE_UTF8_3BYTE,
CASE_UTF8_3BYTE,
CASE_UTF8_3BYTE,
/* 0xf8 0xf9 0xfa 0xfb */
CASE_UTF8_3BYTE,
CASE_UTF8_3BYTE,
CASE_UTF8_3BYTE,
CASE_UTF8_3BYTE,
/* 0xfc 0xfd 0xfe 0xff */
CASE_UTF8_3BYTE,
CASE_UTF8_3BYTE,
CASE_UTF8_3BYTE,
CASE_UTF8_3BYTE,
}; };
+2 -3
View File
@@ -21,8 +21,8 @@
#define CASE_VMOT 8 #define CASE_VMOT 8
#define CASE_TAB 9 #define CASE_TAB 9
#define CASE_LF 10 #define CASE_LF 10
#define CASE_SI 11 #define CASE_LS0 11
#define CASE_SO 12 #define CASE_LS1 12
#define CASE_SP 13 #define CASE_SP 13
#define CASE_SCR_STATE 14 #define CASE_SCR_STATE 14
#define CASE_SCS0_STATE 15 #define CASE_SCS0_STATE 15
@@ -105,6 +105,5 @@
#define CASE_SD 90 /* scroll screen down */ #define CASE_SD 90 /* scroll screen down */
#define CASE_ECH 91 /* erase characters */ #define CASE_ECH 91 /* erase characters */
#define CASE_PRINT_GRA 92
#define CASE_DECSCUSR_ETC 93 #define CASE_DECSCUSR_ETC 93
#define CASE_CSI_SP 94 #define CASE_CSI_SP 94