| 83 |
} TStatusBuff; |
} TStatusBuff; |
| 84 |
typedef TStatusBuff *PStatusBuff; |
typedef TStatusBuff *PStatusBuff; |
| 85 |
|
|
| 86 |
|
// currently only used for AUTO CR/LF receive mode |
| 87 |
|
BYTE PrevCharacter; |
| 88 |
|
BOOL PrevCRorLFGeneratedCRLF; // indicates that previous CR or LF really generated a CR+LF |
| 89 |
|
|
| 90 |
// status buffer for main screen & status line |
// status buffer for main screen & status line |
| 91 |
static TStatusBuff SBuff1, SBuff2, SBuff3; |
static TStatusBuff SBuff1, SBuff2, SBuff3; |
| 92 |
|
|
| 271 |
|
|
| 272 |
// Saved IME Status |
// Saved IME Status |
| 273 |
IMEstat = FALSE; |
IMEstat = FALSE; |
| 274 |
|
|
| 275 |
|
// previous received character |
| 276 |
|
PrevCharacter = -1; // none |
| 277 |
|
PrevCRorLFGeneratedCRLF = FALSE; |
| 278 |
} |
} |
| 279 |
|
|
| 280 |
void ResetCharSet() |
void ResetCharSet() |
| 872 |
case HT: Tab(); break; |
case HT: Tab(); break; |
| 873 |
|
|
| 874 |
case LF: |
case LF: |
|
// 受信時の改行コードが LF の場合は、サーバから LF のみが送られてくると仮定し、 |
|
|
// CR+LFとして扱うようにする。 |
|
|
// cf. http://www.neocom.ca/forum/viewtopic.php?t=216 |
|
|
// (2007.1.21 yutaka) |
|
| 875 |
if (ts.CRReceive == IdLF) { |
if (ts.CRReceive == IdLF) { |
| 876 |
|
// 受信時の改行コードが LF の場合は、サーバから LF のみが送られてくると仮定し、 |
| 877 |
|
// CR+LFとして扱うようにする。 |
| 878 |
|
// cf. http://www.neocom.ca/forum/viewtopic.php?t=216 |
| 879 |
|
// (2007.1.21 yutaka) |
| 880 |
CarriageReturn(TRUE); |
CarriageReturn(TRUE); |
| 881 |
LineFeed(b, TRUE); |
LineFeed(b, TRUE); |
| 882 |
break; |
break; |
| 883 |
} |
} |
| 884 |
|
else if (ts.CRReceive == IdAUTO) { |
| 885 |
|
// 9th Apr 2012: AUTO CR/LF mode (tentner) |
| 886 |
|
// a CR or LF will generated a CR+LF, if the next character is the opposite, it will be ignored |
| 887 |
|
if(PrevCharacter != CR || !PrevCRorLFGeneratedCRLF) { |
| 888 |
|
CarriageReturn(TRUE); |
| 889 |
|
LineFeed(b, TRUE); |
| 890 |
|
PrevCRorLFGeneratedCRLF = TRUE; |
| 891 |
|
} |
| 892 |
|
else { |
| 893 |
|
PrevCRorLFGeneratedCRLF = FALSE; |
| 894 |
|
} |
| 895 |
|
break; |
| 896 |
|
} |
| 897 |
|
|
| 898 |
case VT: LineFeed(b,TRUE); break; |
case VT: LineFeed(b,TRUE); break; |
| 899 |
|
|
| 908 |
LineFeed(b,TRUE); |
LineFeed(b,TRUE); |
| 909 |
break; |
break; |
| 910 |
case CR: |
case CR: |
| 911 |
CarriageReturn(TRUE); |
if (ts.CRReceive == IdAUTO) { |
| 912 |
if (ts.CRReceive==IdCRLF) |
// 9th Apr 2012: AUTO CR/LF mode (tentner) |
| 913 |
CommInsert1Byte(&cv,LF); |
// a CR or LF will generated a CR+LF, if the next character is the opposite, it will be ignored |
| 914 |
|
if(PrevCharacter != LF || !PrevCRorLFGeneratedCRLF) { |
| 915 |
|
CarriageReturn(TRUE); |
| 916 |
|
LineFeed(b, TRUE); |
| 917 |
|
PrevCRorLFGeneratedCRLF = TRUE; |
| 918 |
|
} |
| 919 |
|
else { |
| 920 |
|
PrevCRorLFGeneratedCRLF = FALSE; |
| 921 |
|
} |
| 922 |
|
} |
| 923 |
|
else { |
| 924 |
|
CarriageReturn(TRUE); |
| 925 |
|
if (ts.CRReceive==IdCRLF) { |
| 926 |
|
CommInsert1Byte(&cv,LF); |
| 927 |
|
} |
| 928 |
|
} |
| 929 |
break; |
break; |
| 930 |
case SO: |
case SO: |
| 931 |
if ((ts.Language==IdJapanese) && |
if ((ts.Language==IdJapanese) && |
| 4523 |
} |
} |
| 4524 |
} |
} |
| 4525 |
|
|
| 4526 |
|
PrevCharacter = b; // memorize previous character for AUTO CR/LF-receive mode |
| 4527 |
|
|
| 4528 |
if (ChangeEmu==0) |
if (ChangeEmu==0) |
| 4529 |
c = CommRead1Byte(&cv,&b); |
c = CommRead1Byte(&cv,&b); |
| 4530 |
} |
} |