[Ttssh2-commit] [5098] スタックへの PUSH / POP を追加。

svnno****@sourc***** svnno****@sourc*****
2012年 12月 17日 (月) 12:42:43 JST


Revision: 5098
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/5098
Author:   doda
Date:     2012-12-17 12:42:43 +0900 (Mon, 17 Dec 2012)
Log Message:
-----------
スタックへの PUSH/POP を追加。

Modified Paths:
--------------
    trunk/TTXSamples/TTXKcodeChange/ReadMe-ja.txt
    trunk/TTXSamples/TTXKcodeChange/TTXKcodeChange.c

-------------- next part --------------
Modified: trunk/TTXSamples/TTXKcodeChange/ReadMe-ja.txt
===================================================================
--- trunk/TTXSamples/TTXKcodeChange/ReadMe-ja.txt	2012-12-11 15:34:53 UTC (rev 5097)
+++ trunk/TTXSamples/TTXKcodeChange/ReadMe-ja.txt	2012-12-17 03:42:43 UTC (rev 5098)
@@ -22,21 +22,26 @@
     \x96₢\x8D\x87\x82킹\x82ɑ΂\xB5\x82āA\x88ȉ\xBA\x82̌`\x8E\xAE\x82̉\x9E\x93\x9A\x82\xF0\x95Ԃ\xB5\x82܂\xB7\x81B
       Key=Value;[Key=Value;...]<CR>
 
+  <OSC>5965;Pt<ST>
+  <OSC>5965;Pt<BEL>
+    \x90ݒ\xE8\x95ۑ\xB6\x83V\x81[\x83P\x83\x93\x83X
+    Pt\x82Ŏw\x92肵\x82\xBD\x90ݒ\xE8\x82\xF0\x83X\x83^\x83b\x83N\x82ɕۑ\xB6\x82\xB5\x82܂\xB7\x81B;\x82ŋ\xE6\x90؂蕡\x90\x94\x8Ew\x92肷\x82鎖\x82\xE0\x82ł\xAB\x82܂\xB7\x81B
+
+  <OSC>5966;Pt<ST>
+  <OSC>5966;Pt<BEL>
+    \x90ݒ蕜\x8C\xB3\x83V\x81[\x83P\x83\x93\x83X
+    Pt\x82Ŏw\x92肵\x82\xBD\x90ݒ肪\x83X\x83^\x83b\x83N\x82ɕۑ\xB6\x82\xB3\x82\xEA\x82Ă\xA2\x82\xBD\x8Fꍇ\x81A\x82\xBB\x82̐ݒ\xE8\x82ɕ\x9C\x8C\xB3\x82\xB5\x82܂\xB7\x81B
+    ;\x82ŋ\xE6\x90؂蕡\x90\x94\x8Ew\x92肷\x82鎖\x82\xE0\x82ł\xAB\x82܂\xB7\x81B
+
 \x8Eg\x97p\x97\xE1:
   \x83\x8D\x83O\x83C\x83\x93\x83V\x83F\x83\x8B\x82\xAAzsh\x82̎\x9E\x82̐ݒ\xE8\x97\xE1\x82ł\xB7\x81B
   
   [.zlogin\x82̋L\x8Fq]
-  echo -n "\e]5964;kt;kr\a"              # KT/KR\x82̐ݒ\xE8\x82\xF0\x96₢\x8D\x87\x82킹\x82\xE9
-  read -t 1 TT_ORG_KCODE                 # \x89\x9E\x93\x9A\x82\xF0\x91҂\xC2(\x83^\x83C\x83\x80\x83A\x83E\x83g:1\x95b)
-  if [ $? -eq 0 ]; then
-    echo -n "\e]5963;kr=euc;kt=euc\a"    # \x89\x9E\x93\x9A\x82\xAA\x82\xA0\x82\xC1\x82\xBD\x82Ȃ\xE7\x90ݒ\xE8\x82\xF0\x95ύX\x82\xB7\x82\xE9
-  fi
+  echo -ne "\e]5965;kt;kr\a"             # KT/KR\x82̐ݒ\xE8\x82\xF0\x95ۑ\xB6\x82\xB7\x82\xE9
+  echo -ne "\e]5963;kr=euc;kt=euc\a"     # KT/KR\x82̐ݒ\xE8\x82\xF0EUC\x82ɕύX\x82\xB7\x82\xE9
 
   [.zlogout\x82̋L\x8Fq]
-  # .zlogin\x82Ŋ\xBF\x8E\x9A\x83R\x81[\x83h\x82̐ݒ肪\x95ۑ\xB6\x82\xB3\x82\xEA\x82Ă\xA2\x82\xBD\x82\xE7\x81A\x82\xBB\x82̐ݒ\xE8\x82ɖ߂\xB7\x81B
-  if [ " ${TT_ORG_KCODE}" != " " ]; then
-    echo -n "\e]5963;${TT_ORG_KCODE}\a"
-  fi
+  echo -n "\e]5966;kt;kr\a"              # KT/KR\x82̐ݒ\xE8\x82\xF0\x95ۑ\xB6\x82\xB5\x82\xBD\x92l\x82ɕ\x9C\x8C\xB3\x82\xB7\x82\xE9
 
 \x89\xF0\x90\xE0:
   \x8E\xF3\x90M\x83f\x81[\x83^\x82̃t\x83b\x83N\x82̃T\x83\x93\x83v\x83\x8B\x82ł\xB7\x81B

Modified: trunk/TTXSamples/TTXKcodeChange/TTXKcodeChange.c
===================================================================
--- trunk/TTXSamples/TTXKcodeChange/TTXKcodeChange.c	2012-12-11 15:34:53 UTC (rev 5097)
+++ trunk/TTXSamples/TTXKcodeChange/TTXKcodeChange.c	2012-12-17 03:42:43 UTC (rev 5098)
@@ -26,9 +26,16 @@
 
 static HANDLE hInst; /* Instance handle of TTX*.DLL */
 
+typedef struct cfgstack {
+    int val;
+    struct cfgstack *next;
+} TStack;
+typedef TStack *PStack;
+
 typedef struct {
   PTTSet ts;
   PComVar cv;
+  PStack config[2];
   Trecv origPrecv;
   Tsend origPsend;
   TReadFile origPReadFile;
@@ -41,6 +48,8 @@
 static void PASCAL FAR TTXInit(PTTSet ts, PComVar cv) {
   pvar->ts = ts;
   pvar->cv = cv;
+  pvar->config[0] = NULL;
+  pvar->config[1] = NULL;
   pvar->origPrecv = NULL;
   pvar->origPsend = NULL;
   pvar->origPReadFile = NULL;
@@ -115,6 +124,7 @@
   unsigned char *p, *p2;
   int i;
   unsigned int func;
+  PStack t;
 
 #define AcceptC1Control \
   ((pvar->cv->KanjiCodeEcho == IdEUC || pvar->cv->KanjiCodeEcho == IdJIS) && \
@@ -262,6 +272,50 @@
 	    }
 	    CommOut("\r", 1);
 	    break;
+	  case 5965:
+	    while (p && *p) {
+	      if ((p2 = strchr(p, ';')) != NULL)
+		*p2++ = '\0';
+	      if (_stricmp(p, "kt") == 0) {
+		if ((t=malloc(sizeof(TStack))) != NULL) {
+		  t->val = pvar->cv->KanjiCodeSend;
+		  t->next = pvar->config[0];
+		  pvar->config[0] = t;
+		}
+	      }
+	      else if (_stricmp(p, "kr") == 0) {
+		if ((t=malloc(sizeof(TStack))) != NULL) {
+		  t->val = pvar->cv->KanjiCodeEcho;
+		  t->next = pvar->config[1];
+		  pvar->config[1] = t;
+		}
+	      }
+	      p = p2;
+	    }
+	    break;
+	  case 5966:
+	    while (p && *p) {
+	      if ((p2 = strchr(p, ';')) != NULL)
+		*p2++ = '\0';
+	      if (_stricmp(p, "kt") == 0) {
+		if (pvar->config[0] != NULL) {
+		  t = pvar->config[0];
+		  pvar->cv->KanjiCodeSend = pvar->ts->KanjiCodeSend = t->val;
+		  pvar->config[0] = t->next;
+		  free(t);
+		}
+	      }
+	      else if (_stricmp(p, "kr") == 0) {
+		if (pvar->config[1] != NULL) {
+		  t = pvar->config[1];
+		  pvar->cv->KanjiCodeEcho = pvar->ts->KanjiCode = t->val;
+		  pvar->config[1] = t->next;
+		  free(t);
+		}
+	      }
+	      p = p2;
+	    }
+	    break;
 	  default:
 	    ; /* nothing to do */
 	}



Ttssh2-commit メーリングリストの案内