| 581 |
} |
} |
| 582 |
|
|
| 583 |
void SendCSIstr(char *str, int len) { |
void SendCSIstr(char *str, int len) { |
| 584 |
int l; |
size_t l; |
| 585 |
|
|
| 586 |
if (str == NULL || len < 0) |
if (str == NULL || len < 0) |
| 587 |
return; |
return; |
| 602 |
} |
} |
| 603 |
|
|
| 604 |
void SendOSCstr(char *str, int len, char TermChar) { |
void SendOSCstr(char *str, int len, char TermChar) { |
| 605 |
int l; |
size_t l; |
| 606 |
|
|
| 607 |
if (str == NULL || len < 0) |
if (str == NULL || len < 0) |
| 608 |
return; |
return; |
| 633 |
} |
} |
| 634 |
|
|
| 635 |
void SendDCSstr(char *str, int len) { |
void SendDCSstr(char *str, int len) { |
| 636 |
int l; |
size_t l; |
| 637 |
|
|
| 638 |
if (str == NULL || len < 0) |
if (str == NULL || len < 0) |
| 639 |
return; |
return; |
| 1438 |
RelativeOrgMode = Buff->RelativeOrgMode; |
RelativeOrgMode = Buff->RelativeOrgMode; |
| 1439 |
} |
} |
| 1440 |
|
|
| 1441 |
void AnswerTerminalType() |
static void AnswerTerminalType(void) |
| 1442 |
{ |
{ |
| 1443 |
char Tmp[50]; |
char Tmp[50]; |
| 1444 |
|
|
| 1490 |
CommBinaryOut(&cv,Tmp,strlen(Tmp)); /* Report terminal ID */ |
CommBinaryOut(&cv,Tmp,strlen(Tmp)); /* Report terminal ID */ |
| 1491 |
} |
} |
| 1492 |
|
|
| 1493 |
void ESCSpace(BYTE b) |
static void ESCSpace(BYTE b) |
| 1494 |
{ |
{ |
| 1495 |
switch (b) { |
switch (b) { |
| 1496 |
case 'F': // S7C1T |
case 'F': // S7C1T |
| 1504 |
} |
} |
| 1505 |
} |
} |
| 1506 |
|
|
| 1507 |
void ESCSharp(BYTE b) |
static void ESCSharp(BYTE b) |
| 1508 |
{ |
{ |
| 1509 |
switch (b) { |
switch (b) { |
| 1510 |
case '8': /* Fill screen with "E" (DECALN) */ |
case '8': /* Fill screen with "E" (DECALN) */ |
| 1521 |
} |
} |
| 1522 |
|
|
| 1523 |
/* select double byte code set */ |
/* select double byte code set */ |
| 1524 |
void ESCDBCSSelect(BYTE b) |
static void ESCDBCSSelect(BYTE b) |
| 1525 |
{ |
{ |
| 1526 |
int Dist; |
int Dist; |
| 1527 |
|
|
| 1552 |
} |
} |
| 1553 |
} |
} |
| 1554 |
|
|
| 1555 |
void ESCSelectCode(BYTE b) |
static void ESCSelectCode(BYTE b) |
| 1556 |
{ |
{ |
| 1557 |
switch (b) { |
switch (b) { |
| 1558 |
case '0': |
case '0': |
| 1563 |
} |
} |
| 1564 |
|
|
| 1565 |
/* select single byte code set */ |
/* select single byte code set */ |
| 1566 |
void ESCSBCSSelect(BYTE b) |
static void ESCSBCSSelect(BYTE b) |
| 1567 |
{ |
{ |
| 1568 |
int Dist; |
int Dist; |
| 1569 |
|
|
| 3262 |
PrintFile_ = NULL; |
PrintFile_ = NULL; |
| 3263 |
} |
} |
| 3264 |
|
|
| 3265 |
void CSQ_i_Mode() // DECMC |
static void CSQ_i_Mode(void) // DECMC |
| 3266 |
{ |
{ |
| 3267 |
switch (Param[1]) { |
switch (Param[1]) { |
| 3268 |
case 1: |
case 1: |
| 3421 |
} |
} |
| 3422 |
} |
} |
| 3423 |
|
|
| 3424 |
void CSQuest(BYTE b) |
static void CSQuest(BYTE b) |
| 3425 |
{ |
{ |
| 3426 |
switch (b) { |
switch (b) { |
| 3427 |
case 'J': CSQSelScreenErase(); break; // DECSED |
case 'J': CSQSelScreenErase(); break; // DECSED |
| 4205 |
WriteToPrnFile(PrintFile_, b,TRUE); |
WriteToPrnFile(PrintFile_, b,TRUE); |
| 4206 |
} |
} |
| 4207 |
|
|
| 4208 |
void ParseCS(BYTE b) /* b is the final char */ |
static void ParseCS(BYTE b) /* b is the final char */ |
| 4209 |
{ |
{ |
| 4210 |
if (PrinterMode) { // printer mode |
if (PrinterMode) { // printer mode |
| 4211 |
PrnParseCS(b); |
PrnParseCS(b); |
| 5507 |
* unicode(UTF-32,wchar_t)をバッファへ書き込む |
* unicode(UTF-32,wchar_t)をバッファへ書き込む |
| 5508 |
* ログにも書き込む |
* ログにも書き込む |
| 5509 |
* |
* |
|
* 元は UnicodeToCP932() だった |
|
|
* |
|
| 5510 |
* PutChar() の UTF-32版 |
* PutChar() の UTF-32版 |
| 5511 |
*/ |
*/ |
| 5512 |
static void PutU32(unsigned int code) |
static void PutU32(unsigned int code) |
| 6112 |
return ParseFirstJP(b); |
return ParseFirstJP(b); |
| 6113 |
} |
} |
| 6114 |
|
|
| 6115 |
|
// UTF-8エンコード |
| 6116 |
|
// Unicode 1byte, 2byte, 3byte, 4byte |
| 6117 |
|
// U+0000 ... U+007f 0x00 .. 0x7f |
| 6118 |
|
// U+0080 ... U+07ff 0xc2 .. 0xdf, 0x80 .. 0xbf |
| 6119 |
|
// U+0800 ... U+ffff 0xe0 .. 0xef, 0x80 .. 0xbf, 0x80 .. 0xbf |
| 6120 |
|
// U+10000 ... U+10ffff 0xf0 .. 0xf4, 0x80 .. 0xbf, 0x80 .. 0xbf, 0x80 .. 0xbf |
| 6121 |
|
// UTF-8でデコードできない場合 |
| 6122 |
|
// - 1byte目 |
| 6123 |
|
// - C1(0x80 - 0x9f) |
| 6124 |
|
// - 0xa0 - 0xc1 |
| 6125 |
|
// - 0xf5 - 0xff |
| 6126 |
|
// - 2byte目以降 |
| 6127 |
|
// - 0x00 - 0x7f |
| 6128 |
|
// --0xc0 - 0xff |
| 6129 |
|
|
| 6130 |
if ((b & 0x80) != 0x80 || ((b & 0xe0) == 0x80 && count == 0)) { |
if ((b & 0x80) != 0x80 || ((b & 0xe0) == 0x80 && count == 0)) { |
| 6131 |
// 1バイト目および2バイト目がASCIIの場合は、すべてASCII出力とする。 |
// 1バイト目および2バイト目がASCIIの場合は、すべてASCII出力とする。 |
| 6132 |
// 1バイト目がC1制御文字(0x80-0x9f)の場合も同様。 |
// 1バイト目がC1制御文字(0x80-0x9f)の場合も同様。 |
| 6133 |
|
|
| 6134 |
|
// 入力文字が 0x00 ... 0x7f |
| 6135 |
if (count == 0 || count == 1) { |
if (count == 0 || count == 1) { |
| 6136 |
if (count == 1) { |
if (count == 1) { |
| 6137 |
ParseASCII(buf[0]); |
ParseASCII(buf[0]); |