[Ttssh2-commit] [4217] 端末 UID を設定できるようにした。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 12月 16日 (木) 18:39:48 JST


Revision: 4217
          http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=4217
Author:   doda
Date:     2010-12-16 18:39:48 +0900 (Thu, 16 Dec 2010)

Log Message:
-----------
端末 UID を設定できるようにした。

Modified Paths:
--------------
    trunk/installer/release/TERATERM.INI
    trunk/teraterm/common/tttypes.h
    trunk/teraterm/teraterm/vtterm.c
    trunk/teraterm/ttpset/ttset.c


-------------- next part --------------
Modified: trunk/installer/release/TERATERM.INI
===================================================================
--- trunk/installer/release/TERATERM.INI	2010-12-13 16:10:51 UTC (rev 4216)
+++ trunk/installer/release/TERATERM.INI	2010-12-16 09:39:48 UTC (rev 4217)
@@ -502,6 +502,9 @@
 TCPLocalEcho=off
 TCPCRSend=
 
+; Terminal Unique ID
+TerminalUID=FFFFFFFF
+
 ; Title format
 ; format ID:  5(000101) <title> - <host/port> VT/TEK
 ; format ID: 13(001101) <host/port> - <title> VT/TEK

Modified: trunk/teraterm/common/tttypes.h
===================================================================
--- trunk/teraterm/common/tttypes.h	2010-12-13 16:10:51 UTC (rev 4216)
+++ trunk/teraterm/common/tttypes.h	2010-12-16 09:39:48 UTC (rev 4217)
@@ -502,6 +502,7 @@
 	WORD LogBinary;
 	WORD DisableMenuDuplicateSession;
 	WORD DisableMenuNewConnection;
+	char TerminalUID[9];
 };
 
 typedef struct tttset TTTSet, *PTTSet;
@@ -937,6 +938,9 @@
  * Increment the number of this macro value
  * when you change TMap or member of TMap.
  *
+ * - At version 4.69, ttset_memfilemap was replaced with ttset_memfilemap_15.
+ *   added tttset.TerminalUID.
+ *
  * - At version 4.68, ttset_memfilemap was replaced with ttset_memfilemap_14.
  *   increase WinList(MAXNWIN) size.
  *
@@ -1028,4 +1032,4 @@
  *   added tttset.VTCompatTab.
  */
 
-#define TT_FILEMAPNAME "ttset_memfilemap_14"
+#define TT_FILEMAPNAME "ttset_memfilemap_15"

Modified: trunk/teraterm/teraterm/vtterm.c
===================================================================
--- trunk/teraterm/teraterm/vtterm.c	2010-12-13 16:10:51 UTC (rev 4216)
+++ trunk/teraterm/teraterm/vtterm.c	2010-12-16 09:39:48 UTC (rev 4217)
@@ -2112,10 +2112,14 @@
 
   void CSEQ(BYTE b)
   {
+    char Report[16];
+    int len;
+
     switch (b) {
       case 'c': /* Tertiary terminal report (Tertiary DA) */
 	if (Param[1] < 1) {
-	  SendDCSstr("!|FFFFFFFF", 0);
+	  len = _snprintf_s_l(Report, sizeof(Report), _TRUNCATE, "!|%8s", CLocale, ts.TerminalUID);
+	  SendDCSstr(Report, len);
 	}
 	break;
     }

Modified: trunk/teraterm/ttpset/ttset.c
===================================================================
--- trunk/teraterm/ttpset/ttset.c	2010-12-13 16:10:51 UTC (rev 4216)
+++ trunk/teraterm/ttpset/ttset.c	2010-12-16 09:39:48 UTC (rev 4217)
@@ -13,6 +13,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <direct.h>
+#include <ctype.h>
 #include "ttlib.h"
 #include "tt_res.h"
 
@@ -1363,6 +1364,28 @@
 	// IME status related cursor style
 	if (GetOnOff(Section, "IMERelatedCursor", FName, FALSE))
 		ts->WindowFlag |= WF_IMECURSORCHANGE;
+
+	// Terminal Unique ID
+	GetPrivateProfileString(Section, "TerminalUID", "FFFFFFFF", Temp, sizeof(Temp), FName);
+	if (strlen(Temp) == 8) {
+		for (i=0; i<8 && isxdigit(Temp[i]); i++) {
+			if (islower(Temp[i])) {
+				ts->TerminalUID[i] = toupper(Temp[i]);
+			}
+			else {
+				ts->TerminalUID[i] = Temp[i];
+			}
+		}
+		if (i == 8) {
+			ts->TerminalUID[i] = 0;
+		}
+		else {
+			strncpy_s(ts->TerminalUID, sizeof(ts->TerminalUID), "FFFFFFFF", _TRUNCATE);
+		}
+	}
+	else {
+		strncpy_s(ts->TerminalUID, sizeof(ts->TerminalUID), "FFFFFFFF", _TRUNCATE);
+	}
 }
 
 void FAR PASCAL WriteIniFile(PCHAR FName, PTTSet ts)
@@ -2380,6 +2403,9 @@
 	// IME status related cursor style
 	WriteOnOff(Section, "IMERelatedCursor", FName,
 		ts->WindowFlag & WF_IMECURSORCHANGE);
+
+	// Terminal Unique ID
+	WritePrivateProfileString(Section, "TerminalUID", ts->TerminalUID, FName);
 }
 
 #define VTEditor "VT editor keypad"



Ttssh2-commit メーリングリストの案内
Back to archive index