[Ttssh2-commit] [3375] リファクタリング

svnno****@sourc***** svnno****@sourc*****
2009年 5月 4日 (月) 19:35:13 JST


Revision: 3375
          http://svn.sourceforge.jp/view?root=ttssh2&view=rev&rev=3375
Author:   r850
Date:     2009-05-04 19:35:13 +0900 (Mon, 04 May 2009)

Log Message:
-----------
リファクタリング
・リモートへのSCPを表す定数名がTOLOCALだったのでTOREMOTEに変更。
・同様にSSH2_scp_tolocalをSSH2_scp_toremoteに変更。

Modified Paths:
--------------
    trunk/ttssh2/ttxssh/ssh.c
    trunk/ttssh2/ttxssh/ssh.h


-------------- next part --------------
Modified: trunk/ttssh2/ttxssh/ssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ssh.c	2009-05-02 11:59:45 UTC (rev 3374)
+++ trunk/ttssh2/ttxssh/ssh.c	2009-05-04 10:35:13 UTC (rev 3375)
@@ -3709,7 +3709,7 @@
 		goto error;
 	}
 
-	if (direction == TOLOCAL) {  // copy local to remote
+	if (direction == TOREMOTE) {  // copy local to remote
 		fp = fopen(sendfile, "rb");
 		if (fp == NULL) {
 			char buf[80];
@@ -3806,7 +3806,7 @@
 
 int SSH_start_scp(PTInstVar pvar, char *sendfile, char *dstfile)
 {
-	return SSH_scp_transaction(pvar, sendfile, dstfile, TOLOCAL);
+	return SSH_scp_transaction(pvar, sendfile, dstfile, TOREMOTE);
 }
 
 int SSH_start_scp_receive(PTInstVar pvar, char *filename)
@@ -7753,7 +7753,7 @@
 
 	if (c->type == TYPE_SCP) {
 		char sbuf[MAX_PATH + 30];
-		if (c->scp.dir == TOLOCAL) {
+		if (c->scp.dir == TOREMOTE) {
 			_snprintf_s(sbuf, sizeof(sbuf), _TRUNCATE, "scp -t %s", c->scp.remotefile);
 
 		} else {		
@@ -8184,7 +8184,7 @@
 }
 
 
-static void SSH2_scp_tolocal(PTInstVar pvar, Channel_t *c, unsigned char *data, unsigned int buflen)
+static void SSH2_scp_toremote(PTInstVar pvar, Channel_t *c, unsigned char *data, unsigned int buflen)
 {
 	if (c->scp.state == SCP_INIT) {
 		char buf[128];
@@ -8387,9 +8387,9 @@
 		if (SSH2_scp_fromremote(pvar, c, data, buflen) == FALSE)
 			goto error;
 
-	} else	if (c->scp.dir == TOLOCAL) {
+	} else	if (c->scp.dir == TOREMOTE) {
 		if (buflen == 1 && data[0] == '\0') {  // OK
-			SSH2_scp_tolocal(pvar, c, data, buflen);
+			SSH2_scp_toremote(pvar, c, data, buflen);
 		} else {
 			goto error;
 		}

Modified: trunk/ttssh2/ttxssh/ssh.h
===================================================================
--- trunk/ttssh2/ttxssh/ssh.h	2009-05-02 11:59:45 UTC (rev 3374)
+++ trunk/ttssh2/ttxssh/ssh.h	2009-05-04 10:35:13 UTC (rev 3375)
@@ -397,7 +397,7 @@
 };
 
 enum scp_dir {
-	TOLOCAL, FROMREMOTE,
+	TOREMOTE, FROMREMOTE,
 };
 
 /* The packet handler returns TRUE to keep the handler in place,



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