svnno****@sourc*****
svnno****@sourc*****
2011年 7月 28日 (木) 00:51:23 JST
Revision: 4545 http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=4545 Author: maya Date: 2011-07-28 00:51:22 +0900 (Thu, 28 Jul 2011) Log Message: ----------- expandenv ãã¯ãã³ãã³ããæ°è¨ getpassword å ã®ç°å¢å¤æ°å±éãåé¤ Modified Paths: -------------- trunk/doc/en/html/about/history.html trunk/doc/en/html/macro/command/index.html trunk/doc/en/teraterm.hhc trunk/doc/en/teraterm.hhp trunk/doc/ja/html/about/history.html trunk/doc/ja/html/macro/command/index.html trunk/doc/ja/teraterm.hhc trunk/doc/ja/teraterm.hhp trunk/teraterm/common/helpid.h trunk/teraterm/ttpmacro/ttl.c trunk/teraterm/ttpmacro/ttmparse.c trunk/teraterm/ttpmacro/ttmparse.h Added Paths: ----------- trunk/doc/en/html/macro/command/expandenv.html trunk/doc/ja/html/macro/command/expandenv.html -------------- next part -------------- Modified: trunk/doc/en/html/about/history.html =================================================================== --- trunk/doc/en/html/about/history.html 2011-07-27 14:33:03 UTC (rev 4544) +++ trunk/doc/en/html/about/history.html 2011-07-27 15:51:22 UTC (rev 4545) @@ -37,13 +37,13 @@ <ul> <li>"<a href="../macro/command/getpassword.html">getpassword</a>" macro command is updated. <ul> - <li>Support of environmental variables in file names.</li> <li>The result of the command execution is stored in the system variable "result".</li> </ul></li> <li>"<a href="../macro/command/strspecial.html">strspecial</a>" macro command is updated. <ul> <!--li>Ï··é¶ñð strspecial R}hɼÚwèÅ«éæ¤Éµ½B</li--> </ul></li> + <li>added the "<a href="../macro/command/expandenv.html">expandenv</a>" macro command.</li> </ul> </li> Added: trunk/doc/en/html/macro/command/expandenv.html =================================================================== --- trunk/doc/en/html/macro/command/expandenv.html (rev 0) +++ trunk/doc/en/html/macro/command/expandenv.html 2011-07-27 15:51:22 UTC (rev 4545) @@ -0,0 +1,66 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <title>expandenv</title> + <meta http-equiv="Content-Style-Type" content="text/css"> + <link rel="stylesheet" href="../../style.css" type="text/css"> +</head> + +<body> + + +<h1>expandenv</h1> + +<p> +Expands environment variables. +</p> + +<h2>Format</h2> + +<pre class="macro-syntax"> +expandenv <strvar> [<strval>] +</pre> + +<h2>Parameters</h2> + +<dl> + <dt class="macro">string valiable <strvar></dt> + <!--dd>æ2øðn³È¢êÍA±ÌøÅwèµ½¶ñªWJ³êéB<br /> + æ2øðnµ½êÍA±Ìøͳ³êéB</dd--> + + <dt class="macro">string <strval> (optional)</dt> + <!--dd>±Ìøðwèµ½êA±ÌøÅwèµ½¶ñªWJ³êéB</dd--> + +</dl> + +<h2>Return Value</h2> + +<dl> + <dt class="macro">System valiable <result></dt> + <!--dd>WJã̶ñªi[³êéB</dd--> + +</dl> + +<h2>Remarks</h2> + +<p> +<!-- n³ê½¶ñÉÜÜêé«ÏðWJ·éB --> +</p> + +<h2>Example</h2> + +<pre class="macro-example"> +str = "%WINDIR%\notepad.exe" +expandenv str +messagebox str "env" +</pre> + +<pre class="macro-example"> +expandenv str "%WINDIR%\notepad.exe" +messagebox str "env" +</pre> + +</body> +</html> Modified: trunk/doc/en/html/macro/command/index.html =================================================================== --- trunk/doc/en/html/macro/command/index.html 2011-07-27 14:33:03 UTC (rev 4544) +++ trunk/doc/en/html/macro/command/index.html 2011-07-27 15:51:22 UTC (rev 4545) @@ -107,6 +107,7 @@ <h2>String operation commands</h2> <ul> <li><a href="code2str.html">code2str</a> + <li><a href="expandenv.html">expandenv</a> (version 4.71 or later) <li><a href="int2str.html">int2str</a> <li><a href="sprintf.html">sprintf</a> (version 4.52 or later) <li><a href="sprintf2.html">sprintf2</a> (version 4.62 or later) Modified: trunk/doc/en/teraterm.hhc =================================================================== --- trunk/doc/en/teraterm.hhc 2011-07-27 14:33:03 UTC (rev 4544) +++ trunk/doc/en/teraterm.hhc 2011-07-27 15:51:22 UTC (rev 4545) @@ -1019,6 +1019,11 @@ <param name="ImageNumber" value="11"> </OBJECT> <LI> <OBJECT type="text/sitemap"> + <param name="Name" value="expandenv"> + <param name="Local" value="html\macro\command\expandenv.html"> + <param name="ImageNumber" value="11"> + </OBJECT> + <LI> <OBJECT type="text/sitemap"> <param name="Name" value="int2str"> <param name="Local" value="html\macro\command\int2str.html"> <param name="ImageNumber" value="11"> Modified: trunk/doc/en/teraterm.hhp =================================================================== --- trunk/doc/en/teraterm.hhp 2011-07-27 14:33:03 UTC (rev 4544) +++ trunk/doc/en/teraterm.hhp 2011-07-27 15:51:22 UTC (rev 4545) @@ -179,6 +179,7 @@ HlpMacroCommandExec=html\macro\command\exec.html HlpMacroCommandExeccmnd=html\macro\command\execcmnd.html HlpMacroCommandExit=html\macro\command\exit.html +HlpMacroCommandExpandenv=html\macro\command\expandenv.html HlpMacroCommandFileclose=html\macro\command\fileclose.html HlpMacroCommandFileconcat=html\macro\command\fileconcat.html HlpMacroCommandFilecopy=html\macro\command\filecopy.html Modified: trunk/doc/ja/html/about/history.html =================================================================== --- trunk/doc/ja/html/about/history.html 2011-07-27 14:33:03 UTC (rev 4544) +++ trunk/doc/ja/html/about/history.html 2011-07-27 15:51:22 UTC (rev 4545) @@ -37,13 +37,13 @@ <ul> <li>}NR}h "<a href="../macro/command/getpassword.html">getpassword</a>"ð@\Abvf[gµ½B <ul> - <li>t@C¼É«ÏðÜßçêéæ¤Éµ½B</li> <li>R}hÌÀsÂÛð"result"VXeÏÉi[·éæ¤Éµ½B</li> </ul></li> <li>}NR}h "<a href="../macro/command/strspecial.html">strspecial</a>" ð@\Abvf[gµ½B <ul> <li>Ï··é¶ñð strspecial R}hɼÚwèÅ«éæ¤Éµ½B</li> </ul></li> + <li>}NR}h "<a href="../macro/command/expandenv.html">expandenv</a>" ðÇÁµ½B</li> </ul> </li> Added: trunk/doc/ja/html/macro/command/expandenv.html =================================================================== --- trunk/doc/ja/html/macro/command/expandenv.html (rev 0) +++ trunk/doc/ja/html/macro/command/expandenv.html 2011-07-27 15:51:22 UTC (rev 4545) @@ -0,0 +1,66 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> + <title>expandenv</title> + <meta http-equiv="Content-Style-Type" content="text/css"> + <link rel="stylesheet" href="../../style.css" type="text/css"> +</head> + +<body> + + +<h1>expandenv</h1> + +<p> +«ÏðWJ·éB +</p> + +<h2>`®</h2> + +<pre class="macro-syntax"> +expandenv <strvar> [<strval>] +</pre> + +<h2>p[^</h2> + +<dl> + <dt class="macro">¶ñÏ <strvar></dt> + <dd>æ2øðn³È¢êÍA±ÌøÅwèµ½¶ñªWJ³êéB<br /> + æ2øðnµ½êÍA±Ìøͳ³êéB</dd> + + <dt class="macro">¶ñ <strval> (IvV)</dt> + <dd>±Ìøðwèµ½êA±ÌøÅwèµ½¶ñªWJ³êéB</dd> + +</dl> + +<h2>Ôèl</h2> + +<dl> + <dt class="macro">¶ñÏ <strvar></dt> + <dd>WJã̶ñªi[³êéB</dd> + +</dl> + +<h2>ðà</h2> + +<p> +n³ê½¶ñÉÜÜêé«ÏðWJ·éB +</p> + +<h2>á</h2> + +<pre class="macro-example"> +str = "%WINDIR%\notepad.exe" +expandenv str +messagebox str "env" +</pre> + +<pre class="macro-example"> +expandenv str "%WINDIR%\notepad.exe" +messagebox str "env" +</pre> + +</body> +</html> Modified: trunk/doc/ja/html/macro/command/index.html =================================================================== --- trunk/doc/ja/html/macro/command/index.html 2011-07-27 14:33:03 UTC (rev 4544) +++ trunk/doc/ja/html/macro/command/index.html 2011-07-27 15:51:22 UTC (rev 4545) @@ -107,6 +107,7 @@ <h2>¶ñìR}h</h2> <ul> <li><a href="code2str.html">code2str</a> + <li><a href="expandenv.html">expandenv</a> (o[W4.71È~) <li><a href="int2str.html">int2str</a> <li><a href="sprintf.html">sprintf</a> (o[W4.52È~) <li><a href="sprintf2.html">sprintf2</a> (o[W4.62È~) Modified: trunk/doc/ja/teraterm.hhc =================================================================== --- trunk/doc/ja/teraterm.hhc 2011-07-27 14:33:03 UTC (rev 4544) +++ trunk/doc/ja/teraterm.hhc 2011-07-27 15:51:22 UTC (rev 4545) @@ -1032,6 +1032,11 @@ <param name="ImageNumber" value="11"> </OBJECT> <LI> <OBJECT type="text/sitemap"> + <param name="Name" value="expandenv"> + <param name="Local" value="html\macro\command\expandenv.html"> + <param name="ImageNumber" value="11"> + </OBJECT> + <LI> <OBJECT type="text/sitemap"> <param name="Name" value="int2str"> <param name="Local" value="html\macro\command\int2str.html"> <param name="ImageNumber" value="11"> Modified: trunk/doc/ja/teraterm.hhp =================================================================== --- trunk/doc/ja/teraterm.hhp 2011-07-27 14:33:03 UTC (rev 4544) +++ trunk/doc/ja/teraterm.hhp 2011-07-27 15:51:22 UTC (rev 4545) @@ -189,6 +189,7 @@ HlpMacroCommandExec=html\macro\command\exec.html HlpMacroCommandExeccmnd=html\macro\command\execcmnd.html HlpMacroCommandExit=html\macro\command\exit.html +HlpMacroCommandExpandenv=html\macro\command\expandenv.html HlpMacroCommandFileclose=html\macro\command\fileclose.html HlpMacroCommandFileconcat=html\macro\command\fileconcat.html HlpMacroCommandFilecopy=html\macro\command\filecopy.html Modified: trunk/teraterm/common/helpid.h =================================================================== --- trunk/teraterm/common/helpid.h 2011-07-27 14:33:03 UTC (rev 4544) +++ trunk/teraterm/common/helpid.h 2011-07-27 15:51:22 UTC (rev 4545) @@ -188,6 +188,7 @@ #define HlpMacroCommandExec 92019 #define HlpMacroCommandExeccmnd 92020 #define HlpMacroCommandExit 92021 +#define HlpMacroCommandExpandenv 92194 #define HlpMacroCommandFileclose 92022 #define HlpMacroCommandFileconcat 92023 #define HlpMacroCommandFilecopy 92024 Modified: trunk/teraterm/ttpmacro/ttl.c =================================================================== --- trunk/teraterm/ttpmacro/ttl.c 2011-07-27 14:33:03 UTC (rev 4544) +++ trunk/teraterm/ttpmacro/ttl.c 2011-07-27 15:51:22 UTC (rev 4545) @@ -974,6 +974,36 @@ return ErrSyntax; } +WORD TTLExpandEnv() +{ + WORD Err, VarId; + TStrVal deststr, srcptr; + + Err = 0; + GetStrVar(&VarId,&Err); + if (Err!=0) return Err; + + if (CheckParameterGiven()) { // expandenv strvar strval + GetStrVal(srcptr,&Err); + if ((Err==0) && (GetFirstChar()!=0)) + Err = ErrSyntax; + if (Err!=0) { + return Err; + } + + // t@CpXÉ«ϪÜÜêÄ¢éÈçÎAWJ·éB + ExpandEnvironmentStrings(srcptr, deststr, MaxStrLen); + SetStrVal(VarId, deststr); + } + else { // expandenv strvar + // t@CpXÉ«ϪÜÜêÄ¢éÈçÎAWJ·éB + ExpandEnvironmentStrings(StrVarPtr(VarId), deststr, MaxStrLen); + SetStrVal(VarId, deststr); + } + + return Err; +} + WORD TTLFileClose() { WORD Err; @@ -1974,9 +2004,6 @@ GetAbsPath(Str,sizeof(Str)); - // t@CpXÉ«ϪÜÜêÄ¢éÈçÎAWJ·éB - ExpandEnvironmentStrings(Str, filepath, sizeof(filepath)); - GetPrivateProfileString("Password",Str2,"", Temp,sizeof(Temp), filepath); if (Temp[0]==0) // password not exist @@ -4722,6 +4749,8 @@ Err = TTLExecCmnd(); break; case RsvExit: Err = TTLExit(); break; + case RsvExpandEnv: + Err = TTLExpandEnv(); break; case RsvFileClose: Err = TTLFileClose(); break; case RsvFileConcat: Modified: trunk/teraterm/ttpmacro/ttmparse.c =================================================================== --- trunk/teraterm/ttpmacro/ttmparse.c 2011-07-27 14:33:03 UTC (rev 4544) +++ trunk/teraterm/ttpmacro/ttmparse.c 2011-07-27 15:51:22 UTC (rev 4545) @@ -165,6 +165,7 @@ else if (_stricmp(Str,"exec")==0) *WordId = RsvExec; else if (_stricmp(Str,"execcmnd")==0) *WordId = RsvExecCmnd; else if (_stricmp(Str,"exit")==0) *WordId = RsvExit; + else if (_stricmp(Str,"expandenv")==0) *WordId = RsvExpandEnv; break; case 'f': if (_stricmp(Str,"fileclose")==0) *WordId = RsvFileClose; Modified: trunk/teraterm/ttpmacro/ttmparse.h =================================================================== --- trunk/teraterm/ttpmacro/ttmparse.h 2011-07-27 14:33:03 UTC (rev 4544) +++ trunk/teraterm/ttpmacro/ttmparse.h 2011-07-27 15:51:22 UTC (rev 4545) @@ -209,6 +209,7 @@ #define RsvFolderCreate 191 #define RsvFolderDelete 192 #define RsvFolderSearch 193 +#define RsvExpandEnv 194 #define RsvOperator 1000 #define RsvBNot 1001