[Ttssh2-commit] [3822] YMODEM マクロコマンドを追加した。

svnno****@sourc***** svnno****@sourc*****
2010年 3月 25日 (木) 22:19:53 JST


Revision: 3822
          http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=3822
Author:   yutakapon
Date:     2010-03-25 22:19:53 +0900 (Thu, 25 Mar 2010)

Log Message:
-----------
YMODEM マクロコマンドを追加した。
 ・ymodemsend
 ・ymodemrecv

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


-------------- next part --------------
Modified: trunk/teraterm/common/helpid.h
===================================================================
--- trunk/teraterm/common/helpid.h	2010-03-25 10:02:44 UTC (rev 3821)
+++ trunk/teraterm/common/helpid.h	2010-03-25 13:19:53 UTC (rev 3822)
@@ -301,6 +301,8 @@
 #define HlpMacroCommandXmodemrecv       92105
 #define HlpMacroCommandXmodemsend       92106
 #define HlpMacroCommandYesnobox         92107
+#define HlpMacroCommandYmodemrecv       92176
+#define HlpMacroCommandYmodemsend       92177
 #define HlpMacroCommandZmodemrecv       92108
 #define HlpMacroCommandZmodemsend       92109
 

Modified: trunk/teraterm/teraterm/ttdde.c
===================================================================
--- trunk/teraterm/teraterm/ttdde.c	2010-03-25 10:02:44 UTC (rev 3821)
+++ trunk/teraterm/teraterm/ttdde.c	2010-03-25 13:19:53 UTC (rev 3822)
@@ -331,6 +331,8 @@
 #define CmdSendMulticast  'P'
 #define CmdSetMulticastName  'Q'
 #define CmdSetDebug     'R'
+#define CmdYmodemSend   'S'
+#define CmdYmodemRecv   'T'
 
 HDDEDATA AcceptExecute(HSZ TopicHSz, HDDEDATA Data)
 {
@@ -685,6 +687,32 @@
 		else
 			return DDE_FNOTPROCESSED;
 		break;
+
+	case CmdYmodemRecv:
+		if ((FileVar==NULL) && NewFileVar(&FileVar))
+		{
+			FileVar->NoMsg = TRUE;
+			DdeCmnd = TRUE;
+			YMODEMStart(IdYReceive);
+		}
+		else
+			return DDE_FNOTPROCESSED;
+		break;
+	case CmdYmodemSend:
+		if ((FileVar==NULL) && NewFileVar(&FileVar))
+		{
+			FileVar->DirLen = 0;
+			strncpy_s(FileVar->FullName, sizeof(FileVar->FullName),ParamFileName, _TRUNCATE);
+			FileVar->NumFname = 1;
+			//ts.XmodemBin = ParamBinaryFlag;
+			FileVar->NoMsg = TRUE;
+			DdeCmnd = TRUE;
+			YMODEMStart(IdYSend);
+		}
+		else
+			return DDE_FNOTPROCESSED;
+		break;
+
 		// add 'callmenu' (2007.11.18 maya)
 	case CmdCallMenu:
 		i = atoi(ParamFileName);

Modified: trunk/teraterm/ttpmacro/ttl.c
===================================================================
--- trunk/teraterm/ttpmacro/ttl.c	2010-03-25 10:02:44 UTC (rev 3821)
+++ trunk/teraterm/ttpmacro/ttl.c	2010-03-25 13:19:53 UTC (rev 3822)
@@ -3630,6 +3630,25 @@
 	return SendCmnd(CmdZmodemSend,IdTTLWaitCmndResult);
 }
 
+WORD TTLYmodemSend()
+{
+	TStrVal Str;
+	WORD Err;
+//	int BinFlag;
+
+	Err = 0;
+	GetStrVal(Str,&Err);
+//	GetIntVal(&BinFlag,&Err);
+	if ((Err==0) &&
+	    ((strlen(Str)==0) || (GetFirstChar()!=0)))
+		Err = ErrSyntax;
+	if (Err!=0) return Err;
+
+	SetFile(Str);
+//	SetBinary(BinFlag);
+	return SendCmnd(CmdYmodemSend,IdTTLWaitCmndResult);
+}
+
 // SYNOPSIS: 
 //   scpsend "c:\usr\sample.chm" "doc/sample.chm"
 //   scpsend "c:\usr\sample.chm"
@@ -4087,6 +4106,10 @@
 			Err = TTLCommCmd(CmdZmodemRecv,IdTTLWaitCmndResult); break;
 		case RsvZmodemSend:
 			Err = TTLZmodemSend(); break;
+		case RsvYmodemRecv:
+			Err = TTLCommCmd(CmdYmodemRecv,IdTTLWaitCmndResult); break;
+		case RsvYmodemSend:
+			Err = TTLYmodemSend(); break;
 		default:
 			Err = ErrSyntax;
 		}

Modified: trunk/teraterm/ttpmacro/ttmdde.h
===================================================================
--- trunk/teraterm/ttpmacro/ttmdde.h	2010-03-25 10:02:44 UTC (rev 3821)
+++ trunk/teraterm/ttpmacro/ttmdde.h	2010-03-25 13:19:53 UTC (rev 3822)
@@ -56,6 +56,8 @@
 #define CmdSendMulticast  'P'
 #define CmdSetMulticastName  'Q'
 #define CmdSetDebug  'R'
+#define CmdYmodemSend   'S'
+#define CmdYmodemRecv   'T'
 
 #ifdef __cplusplus
 extern "C" {

Modified: trunk/teraterm/ttpmacro/ttmparse.c
===================================================================
--- trunk/teraterm/ttpmacro/ttmparse.c	2010-03-25 10:02:44 UTC (rev 3821)
+++ trunk/teraterm/ttpmacro/ttmparse.c	2010-03-25 13:19:53 UTC (rev 3822)
@@ -319,6 +319,8 @@
 		break;
 	case 'y':
 		if (_stricmp(Str,"yesnobox")==0) *WordId = RsvYesNoBox;
+		else if (_stricmp(Str,"ymodemrecv")==0) *WordId = RsvYmodemRecv;
+		else if (_stricmp(Str,"ymodemsend")==0) *WordId = RsvYmodemSend;
 		break;
 	case 'z':
 		if (_stricmp(Str,"zmodemrecv")==0) *WordId = RsvZmodemRecv;

Modified: trunk/teraterm/ttpmacro/ttmparse.h
===================================================================
--- trunk/teraterm/ttpmacro/ttmparse.h	2010-03-25 10:02:44 UTC (rev 3821)
+++ trunk/teraterm/ttpmacro/ttmparse.h	2010-03-25 13:19:53 UTC (rev 3822)
@@ -218,6 +218,9 @@
 #define RsvSendInt      174
 #define RsvSetDebug     175
 
+#define RsvYmodemRecv   176
+#define RsvYmodemSend   177
+
 // integer type for buffer pointer
 typedef DWORD BINT;
 



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