Develop and Download Open Source Software

Browse Subversion Repository

Diff of /trunk/teraterm/teraterm/vtterm.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 9538 by zmatsuo, Sat Nov 20 15:13:32 2021 UTC revision 9539 by zmatsuo, Sat Nov 20 15:13:41 2021 UTC
# Line 581  void ChangeTerminalSize(int Nx, int Ny) Line 581  void ChangeTerminalSize(int Nx, int Ny)
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;
# Line 602  void SendCSIstr(char *str, int len) { Line 602  void SendCSIstr(char *str, int len) {
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;
# Line 633  void SendOSCstr(char *str, int len, char Line 633  void SendOSCstr(char *str, int len, char
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;
# Line 1438  void RestoreCursor() Line 1438  void RestoreCursor()
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    
# Line 1490  void AnswerTerminalType() Line 1490  void AnswerTerminalType()
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
# Line 1504  void ESCSpace(BYTE b) Line 1504  void ESCSpace(BYTE b)
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) */
# Line 1521  void ESCSharp(BYTE b) Line 1521  void ESCSharp(BYTE b)
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    
# Line 1552  void ESCDBCSSelect(BYTE b) Line 1552  void ESCDBCSSelect(BYTE b)
1552          }          }
1553  }  }
1554    
1555  void ESCSelectCode(BYTE b)  static void ESCSelectCode(BYTE b)
1556  {  {
1557          switch (b) {          switch (b) {
1558                  case '0':                  case '0':
# Line 1563  void ESCSelectCode(BYTE b) Line 1563  void ESCSelectCode(BYTE b)
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    
# Line 3262  static void PrintFileFinish(PrintFile *h Line 3262  static void PrintFileFinish(PrintFile *h
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:
# Line 3421  void CSQ_n_Mode()              // DECDSR Line 3421  void CSQ_n_Mode()              // DECDSR
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
# Line 4205  void PrnParseCS(BYTE b) // printer mode Line 4205  void PrnParseCS(BYTE b) // printer mode
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);
# Line 5507  void CANSeen(BYTE b) Line 5507  void CANSeen(BYTE 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)
# Line 6114  static BOOL ParseFirstUTF8(BYTE b) Line 6112  static BOOL ParseFirstUTF8(BYTE b)
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]);

Legend:
Removed from v.9538  
changed lines
  Added in v.9539

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26