[Ttssh2-commit] [5467] uptime マクロコマンドをサポートした。

svnno****@sourc***** svnno****@sourc*****
2014年 1月 19日 (日) 01:59:58 JST


Revision: 5467
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/5467
Author:   yutakapon
Date:     2014-01-19 01:59:57 +0900 (Sun, 19 Jan 2014)
Log Message:
-----------
uptime マクロコマンドをサポートした。

Modified Paths:
--------------
    trunk/teraterm/common/helpid.h
    trunk/teraterm/ttpmacro/ttl.c
    trunk/teraterm/ttpmacro/ttmparse.c
    trunk/teraterm/ttpmacro/ttmparse.h

-------------- next part --------------
Modified: trunk/teraterm/common/helpid.h
===================================================================
--- trunk/teraterm/common/helpid.h	2014-01-18 15:01:23 UTC (rev 5466)
+++ trunk/teraterm/common/helpid.h	2014-01-18 16:59:57 UTC (rev 5467)
@@ -330,6 +330,7 @@
 #define HlpMacroCommandToupper          92119
 #define HlpMacroCommandUnlink           92099
 #define HlpMacroCommandUntil            92128
+#define HlpMacroCommandUptime           92212
 #define HlpMacroCommandVar2clipb        92114
 #define HlpMacroCommandWait             92100
 #define HlpMacroCommandWait4all         92148

Modified: trunk/teraterm/ttpmacro/ttl.c
===================================================================
--- trunk/teraterm/ttpmacro/ttl.c	2014-01-18 15:01:23 UTC (rev 5466)
+++ trunk/teraterm/ttpmacro/ttl.c	2014-01-18 16:59:57 UTC (rev 5467)
@@ -5196,7 +5196,30 @@
 }
 
 
+WORD TTLUptime()
+{
+	WORD Err;
+	TVarId VarId;
+	DWORD tick;
 
+	Err = 0;
+	GetIntVar(&VarId,&Err);
+	if ((Err==0) && (GetFirstChar()!=0))
+		Err = ErrSyntax;
+	if (Err!=0) return Err;
+
+	// Windows OS\x82\xAA\x8BN\x93\xAE\x82\xB5\x82Ă\xA9\x82\xE7\x82̌o\x89ߎ\x9E\x8Aԁi\x83~\x83\x8A\x95b\x81j\x82\xF0\x8E擾\x82\xB7\x82\xE9\x81B\x82\xBD\x82\xBE\x82\xB5\x81A49\x93\xFA\x82\xF0\x8Co\x89߂\xB7\x82\xE9\x82ƁA0\x82ɖ߂\xE9\x81B
+	// GetTickCount64() API(Vista\x88ȍ~)\x82\xF0\x8Eg\x82\xA4\x82ƁA\x83I\x81[\x83o\x81[\x83t\x83\x8D\x81[\x82\xB5\x82Ȃ\xAD\x82Ȃ邪\x81A\x82\xBB\x82\xE0\x82\xBB\x82\xE0Tera Term\x82ł\xCD
+	// 64bit\x95ϐ\x94\x82\xF0\x83T\x83|\x81[\x83g\x82\xB5\x82Ă\xA2\x82Ȃ\xA2\x82̂ŁA\x88Ӗ\xA1\x82\xAA\x82Ȃ\xA2\x81B
+	tick = GetTickCount();
+
+	SetIntVal(VarId, tick);
+
+	return Err;
+}
+
+
+
 WORD TTLWait(BOOL Ln)
 {
 	TStrVal Str;
@@ -6028,6 +6051,8 @@
 			Err = TTLUnlink(); break;
 		case RsvUntil:
 			Err = TTLWhile(FALSE); break;
+		case RsvUptime:
+			Err = TTLUptime(); break;
 		case RsvVar2Clipb:
 			Err = TTLVar2Clipb(); break;    // add 'var2clipb' (2006.9.17 maya)
 		case RsvWaitRegex:

Modified: trunk/teraterm/ttpmacro/ttmparse.c
===================================================================
--- trunk/teraterm/ttpmacro/ttmparse.c	2014-01-18 15:01:23 UTC (rev 5466)
+++ trunk/teraterm/ttpmacro/ttmparse.c	2014-01-18 16:59:57 UTC (rev 5467)
@@ -382,6 +382,7 @@
 	case 'u':
 		if (_stricmp(Str,"unlink")==0) *WordId = RsvUnlink;
 		else if (_stricmp(Str,"until")==0) *WordId = RsvUntil;
+		else if (_stricmp(Str,"uptime")==0) *WordId = RsvUptime;
 		break;
 	case 'v':
 		if (_stricmp(Str,"var2clipb")==0) *WordId = RsvVar2Clipb;  // add 'var2clipb' (2006.9.17 maya)

Modified: trunk/teraterm/ttpmacro/ttmparse.h
===================================================================
--- trunk/teraterm/ttpmacro/ttmparse.h	2014-01-18 15:01:23 UTC (rev 5466)
+++ trunk/teraterm/ttpmacro/ttmparse.h	2014-01-18 16:59:57 UTC (rev 5467)
@@ -241,6 +241,7 @@
 #define RsvChecksum32File   209
 #define RsvBringupBox   210
 #define RsvLogAutoClose 211
+#define RsvUptime		212
 
 #define RsvOperator     1000
 #define RsvBNot         1001



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