svnno****@sourc*****
svnno****@sourc*****
2013年 3月 27日 (水) 01:25:37 JST
Revision: 5177 http://sourceforge.jp/projects/ttssh2/scm/svn/commits/5177 Author: yutakapon Date: 2013-03-27 01:25:36 +0900 (Wed, 27 Mar 2013) Log Message: ----------- チェックサムアルゴリズム(CRC16, CHECKSUM8/16/32)のマクロコマンドの ドキュメントを追加した。 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 Added Paths: ----------- trunk/doc/en/html/macro/command/checksum16.html trunk/doc/en/html/macro/command/checksum32.html trunk/doc/en/html/macro/command/checksum8.html trunk/doc/en/html/macro/command/crc16.html trunk/doc/ja/html/macro/command/checksum16.html trunk/doc/ja/html/macro/command/checksum32.html trunk/doc/ja/html/macro/command/checksum8.html trunk/doc/ja/html/macro/command/crc16.html -------------- next part -------------- Modified: trunk/doc/en/html/about/history.html =================================================================== --- trunk/doc/en/html/about/history.html 2013-03-26 15:18:45 UTC (rev 5176) +++ trunk/doc/en/html/about/history.html 2013-03-26 16:25:36 UTC (rev 5177) @@ -44,6 +44,14 @@ <li>added the <a href="../macro/command/getipv4addr.html">getipv4addr</a> command.</li> <li>added the <a href="../macro/command/getipv6addr.html">getipv6addr</a> command.</li> <li>added the <a href="../macro/command/logrotate.html">logrotate</a> command.</li> + <li>added the <a href="../macro/command/crc16.html">crc16</a> command.</li> + <li>added the <a href="../macro/command/crc16.html">crc16file</a> command.</li> + <li>added the <a href="../macro/command/checksum8.html">checksum8</a> command.</li> + <li>added the <a href="../macro/command/checksum8.html">checksum8file</a> command.</li> + <li>added the <a href="../macro/command/checksum16.html">checksum16</a> command.</li> + <li>added the <a href="../macro/command/checksum16.html">checksum16file</a> command.</li> + <li>added the <a href="../macro/command/checksum32.html">checksum32</a> command.</li> + <li>added the <a href="../macro/command/checksum32.html">checksum32file</a> command.</li> </ul></li> </ul> </li> Copied: trunk/doc/en/html/macro/command/checksum16.html (from rev 5175, trunk/doc/en/html/macro/command/crc32.html) =================================================================== --- trunk/doc/en/html/macro/command/checksum16.html (rev 0) +++ trunk/doc/en/html/macro/command/checksum16.html 2013-03-26 16:25:36 UTC (rev 5177) @@ -0,0 +1,55 @@ +<!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>checksum16, checksum16file</title> + <meta http-equiv="Content-Style-Type" content="text/css"> + <link rel="stylesheet" href="../../style.css" type="text/css"> +</head> + +<body> + + +<h1>checksum16, checksum16file</h1> + +<p> +Calculates the 16bit-checksum of a string or a file. +</p> + +<pre class="macro-syntax"> +checksum16 <intvar> <string> +checksum16file <intvar> <filename> +</pre> + +<h2>Remarks</h2> + +<p> +This macro function calculates the checksum(16bit) of a string or a file. +<br><br> + +The calculated value stores the variable "intvar" as mathematical value.<br> +If the <filename> file can not open by using checksum16file, the system variable "result" is set to -1. +</p> + +<h2>Example</h2> + +<pre class="macro-example"> +str = 'this is a test string to be checksum16ed' +checksum16 crc str + +; Display checksum16 result asHEX +sprintf '0x%08X' crc +messagebox inputstr 'checksum16 = ' + +checksum16file crc 'foo.bin' +if result = -1 then + messagebox 'file open error' 'checksum16 = ' +else + sprintf '0x%08X' crc + messagebox inputstr 'checksum16 = ' +endif +</pre> + +</body> +</html> Copied: trunk/doc/en/html/macro/command/checksum32.html (from rev 5175, trunk/doc/en/html/macro/command/crc32.html) =================================================================== --- trunk/doc/en/html/macro/command/checksum32.html (rev 0) +++ trunk/doc/en/html/macro/command/checksum32.html 2013-03-26 16:25:36 UTC (rev 5177) @@ -0,0 +1,55 @@ +<!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>checksum32, checksum32file</title> + <meta http-equiv="Content-Style-Type" content="text/css"> + <link rel="stylesheet" href="../../style.css" type="text/css"> +</head> + +<body> + + +<h1>checksum32, checksum32file</h1> + +<p> +Calculates the 32bit-checksum of a string or a file. +</p> + +<pre class="macro-syntax"> +checksum32 <intvar> <string> +checksum32file <intvar> <filename> +</pre> + +<h2>Remarks</h2> + +<p> +This macro function calculates the checksum(32bit) of a string or a file. +<br><br> + +The calculated value stores the variable "intvar" as mathematical value.<br> +If the <filename> file can not open by using checksum32file, the system variable "result" is set to -1. +</p> + +<h2>Example</h2> + +<pre class="macro-example"> +str = 'this is a test string to be checksum32ed' +checksum32 crc str + +; Display checksum32 result asHEX +sprintf '0x%08X' crc +messagebox inputstr 'checksum32 = ' + +checksum32file crc 'foo.bin' +if result = -1 then + messagebox 'file open error' 'checksum32 = ' +else + sprintf '0x%08X' crc + messagebox inputstr 'checksum32 = ' +endif +</pre> + +</body> +</html> Copied: trunk/doc/en/html/macro/command/checksum8.html (from rev 5175, trunk/doc/en/html/macro/command/crc32.html) =================================================================== --- trunk/doc/en/html/macro/command/checksum8.html (rev 0) +++ trunk/doc/en/html/macro/command/checksum8.html 2013-03-26 16:25:36 UTC (rev 5177) @@ -0,0 +1,55 @@ +<!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>checksum8, checksum8file</title> + <meta http-equiv="Content-Style-Type" content="text/css"> + <link rel="stylesheet" href="../../style.css" type="text/css"> +</head> + +<body> + + +<h1>checksum8, checksum8file</h1> + +<p> +Calculates the 8bit-checksum of a string or a file. +</p> + +<pre class="macro-syntax"> +checksum8 <intvar> <string> +checksum8file <intvar> <filename> +</pre> + +<h2>Remarks</h2> + +<p> +This macro function calculates the checksum(8bit) of a string or a file. +<br><br> + +The calculated value stores the variable "intvar" as mathematical value.<br> +If the <filename> file can not open by using checksum8file, the system variable "result" is set to -1. +</p> + +<h2>Example</h2> + +<pre class="macro-example"> +str = 'this is a test string to be checksum8ed' +checksum8 crc str + +; Display checksum8 result asHEX +sprintf '0x%08X' crc +messagebox inputstr 'checksum8 = ' + +checksum8file crc 'foo.bin' +if result = -1 then + messagebox 'file open error' 'checksum8 = ' +else + sprintf '0x%08X' crc + messagebox inputstr 'checksum8 = ' +endif +</pre> + +</body> +</html> Copied: trunk/doc/en/html/macro/command/crc16.html (from rev 5175, trunk/doc/en/html/macro/command/crc32.html) =================================================================== --- trunk/doc/en/html/macro/command/crc16.html (rev 0) +++ trunk/doc/en/html/macro/command/crc16.html 2013-03-26 16:25:36 UTC (rev 5177) @@ -0,0 +1,80 @@ +<!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>crc16, crc16file</title> + <meta http-equiv="Content-Style-Type" content="text/css"> + <link rel="stylesheet" href="../../style.css" type="text/css"> +</head> + +<body> + + +<h1>crc16, crc16file</h1> + +<p> +Calculates the CRC-16-IBM of a string or a file. +</p> + +<pre class="macro-syntax"> +crc16 <intvar> <string> +crc16file <intvar> <filename> +</pre> + +<h2>Remarks</h2> + +<p> +This macro function calculates the CRC(Cyclic Redundancy Checking) of a string or a file. The polynomial expression(right rotation) is as follows: +<br><br> + +0xA001 (x<sup>16</sup>+x<sup>15</sup>+x<sup>2</sup>+x<sup>0</sup>) +<br><br> + +The calculated value stores the variable "intvar" as mathematical value.<br> +If the <filename> file can not open by using crc16file, the system variable "result" is set to -1. +</p> + +The CRC algorithm implementation by C language is as follows: +<pre> +<code> +static unsigned int crc16(int n, unsigned char c[]) +{ +#define CRC16POLY2 0x8408U /* left-right reversal */ + + int i, j; + unsigned long r; + + r = 0xFFFFU; + for (i = 0; i < n; i++) { + r ^= c[i]; + for (j = 0; j < CHAR_BIT; j++) + if (r & 1) r = (r >> 1) ^ CRC16POLY2; + else r >>= 1; + } + return r ^ 0xFFFFU; +} +</code></pre> + + +<h2>Example</h2> + +<pre class="macro-example"> +str = 'this is a test string to be crc16ed' +crc16 crc str + +; Display crc16 result asHEX +sprintf '0x%08X' crc +messagebox inputstr 'crc16 = ' + +crc16file crc 'foo.bin' +if result = -1 then + messagebox 'file open error' 'crc16 = ' +else + sprintf '0x%08X' crc + messagebox inputstr 'crc16 = ' +endif +</pre> + +</body> +</html> Modified: trunk/doc/en/html/macro/command/index.html =================================================================== --- trunk/doc/en/html/macro/command/index.html 2013-03-26 15:18:45 UTC (rev 5176) +++ trunk/doc/en/html/macro/command/index.html 2013-03-26 16:25:36 UTC (rev 5177) @@ -184,8 +184,16 @@ <h2>Miscellaneous commands</h2> <ul> <li><a href="beep.html">beep</a> + <li><a href="checksum8.html">checksum8</a> (version 4.78 or later) + <li><a href="checksum8.html">checksum8file</a> (version 4.78 or later) + <li><a href="checksum16.html">checksum16</a> (version 4.78 or later) + <li><a href="checksum16.html">checksum16file</a> (version 4.78 or later) + <li><a href="checksum32.html">checksum32</a> (version 4.78 or later) + <li><a href="checksum32.html">checksum32file</a> (version 4.78 or later) <li><a href="closesbox.html">closesbox</a> <li><a href="clipb2var.html">clipb2var</a> (version 4.46 or later) + <li><a href="crc16.html">crc16</a> (version 4.78 or later) + <li><a href="crc16.html">crc16file</a> (version 4.78 or later) <li><a href="crc32.html">crc32</a> (version 4.60 or later) <li><a href="crc32.html">crc32file</a> (version 4.60 or later) <li><a href="exec.html">exec</a> Modified: trunk/doc/en/teraterm.hhc =================================================================== --- trunk/doc/en/teraterm.hhc 2013-03-26 15:18:45 UTC (rev 5176) +++ trunk/doc/en/teraterm.hhc 2013-03-26 16:25:36 UTC (rev 5177) @@ -1352,6 +1352,36 @@ <param name="ImageNumber" value="11"> </OBJECT> <LI> <OBJECT type="text/sitemap"> + <param name="Name" value="checksum8"> + <param name="Local" value="html\macro\command\checksum8.html"> + <param name="ImageNumber" value="11"> + </OBJECT> + <LI> <OBJECT type="text/sitemap"> + <param name="Name" value="checksum8file"> + <param name="Local" value="html\macro\command\checksum8.html"> + <param name="ImageNumber" value="11"> + </OBJECT> + <LI> <OBJECT type="text/sitemap"> + <param name="Name" value="checksum16"> + <param name="Local" value="html\macro\command\checksum16.html"> + <param name="ImageNumber" value="11"> + </OBJECT> + <LI> <OBJECT type="text/sitemap"> + <param name="Name" value="checksum16file"> + <param name="Local" value="html\macro\command\checksum16.html"> + <param name="ImageNumber" value="11"> + </OBJECT> + <LI> <OBJECT type="text/sitemap"> + <param name="Name" value="checksum32"> + <param name="Local" value="html\macro\command\checksum32.html"> + <param name="ImageNumber" value="11"> + </OBJECT> + <LI> <OBJECT type="text/sitemap"> + <param name="Name" value="checksum32file"> + <param name="Local" value="html\macro\command\checksum32.html"> + <param name="ImageNumber" value="11"> + </OBJECT> + <LI> <OBJECT type="text/sitemap"> <param name="Name" value="closesbox"> <param name="Local" value="html\macro\command\closesbox.html"> <param name="ImageNumber" value="11"> @@ -1362,6 +1392,16 @@ <param name="ImageNumber" value="11"> </OBJECT> <LI> <OBJECT type="text/sitemap"> + <param name="Name" value="crc16"> + <param name="Local" value="html\macro\command\crc16.html"> + <param name="ImageNumber" value="11"> + </OBJECT> + <LI> <OBJECT type="text/sitemap"> + <param name="Name" value="crc16file"> + <param name="Local" value="html\macro\command\crc16.html"> + <param name="ImageNumber" value="11"> + </OBJECT> + <LI> <OBJECT type="text/sitemap"> <param name="Name" value="crc32"> <param name="Local" value="html\macro\command\crc32.html"> <param name="ImageNumber" value="11"> Modified: trunk/doc/en/teraterm.hhp =================================================================== --- trunk/doc/en/teraterm.hhp 2013-03-26 15:18:45 UTC (rev 5176) +++ trunk/doc/en/teraterm.hhp 2013-03-26 16:25:36 UTC (rev 5177) @@ -159,6 +159,12 @@ HlpMacroCommandCall=html\macro\command\call.html HlpMacroCommandCallmenu=html\macro\command\callmenu.html HlpMacroCommandChangedir=html\macro\command\changedir.html +HlpMacroCommandChecksum8=html\macro\command\checksum8.html +HlpMacroCommandChecksum8File=html\macro\command\checksum8.html +HlpMacroCommandChecksum16=html\macro\command\checksum16.html +HlpMacroCommandChecksum16File=html\macro\command\checksum16.html +HlpMacroCommandChecksum32=html\macro\command\checksum32.html +HlpMacroCommandChecksum32File=html\macro\command\checksum32.html HlpMacroCommandClearscreen=html\macro\command\clearscreen.html HlpMacroCommandClipb2var=html\macro\command\clipb2var.html HlpMacroCommandClosesbox=html\macro\command\closesbox.html @@ -166,6 +172,8 @@ HlpMacroCommandCode2str=html\macro\command\code2str.html HlpMacroCommandConnect=html\macro\command\connect.html HlpMacroCommandContinue=html\macro\command\continue.html +HlpMacroCommandCrc16=html\macro\command\crc16.html +HlpMacroCommandCrc16File=html\macro\command\crc16.html HlpMacroCommandCrc32=html\macro\command\crc32.html HlpMacroCommandCrc32File=html\macro\command\crc32.html HlpMacroCommandCygConnect=html\macro\command\cygconnect.html Modified: trunk/doc/ja/html/about/history.html =================================================================== --- trunk/doc/ja/html/about/history.html 2013-03-26 15:18:45 UTC (rev 5176) +++ trunk/doc/ja/html/about/history.html 2013-03-26 16:25:36 UTC (rev 5177) @@ -43,6 +43,14 @@ <li><a href="../macro/command/getipv4addr.html">getipv4addr</a>\x83R\x83}\x83\x93\x83h\x82\xF0\x92lj\xC1\x82\xB5\x82\xBD\x81B</li> <li><a href="../macro/command/getipv6addr.html">getipv6addr</a>\x83R\x83}\x83\x93\x83h\x82\xF0\x92lj\xC1\x82\xB5\x82\xBD\x81B</li> <li><a href="../macro/command/logrotate.html">logrotate</a>\x83R\x83}\x83\x93\x83h\x82\xF0\x92lj\xC1\x82\xB5\x82\xBD\x81B</li> + <li><a href="../macro/command/crc16.html">crc16</a>\x83R\x83}\x83\x93\x83h\x82\xF0\x92lj\xC1\x82\xB5\x82\xBD\x81B</li> + <li><a href="../macro/command/crc16.html">crc16file</a>\x83R\x83}\x83\x93\x83h\x82\xF0\x92lj\xC1\x82\xB5\x82\xBD\x81B</li> + <li><a href="../macro/command/checksum8.html">checksum8</a>\x83R\x83}\x83\x93\x83h\x82\xF0\x92lj\xC1\x82\xB5\x82\xBD\x81B</li> + <li><a href="../macro/command/checksum8.html">checksum8file</a>\x83R\x83}\x83\x93\x83h\x82\xF0\x92lj\xC1\x82\xB5\x82\xBD\x81B</li> + <li><a href="../macro/command/checksum16.html">checksum16</a>\x83R\x83}\x83\x93\x83h\x82\xF0\x92lj\xC1\x82\xB5\x82\xBD\x81B</li> + <li><a href="../macro/command/checksum16.html">checksum16file</a>\x83R\x83}\x83\x93\x83h\x82\xF0\x92lj\xC1\x82\xB5\x82\xBD\x81B</li> + <li><a href="../macro/command/checksum32.html">checksum32</a>\x83R\x83}\x83\x93\x83h\x82\xF0\x92lj\xC1\x82\xB5\x82\xBD\x81B</li> + <li><a href="../macro/command/checksum32.html">checksum32file</a>\x83R\x83}\x83\x93\x83h\x82\xF0\x92lj\xC1\x82\xB5\x82\xBD\x81B</li> </ul></li> </ul> </li> Copied: trunk/doc/ja/html/macro/command/checksum16.html (from rev 5175, trunk/doc/ja/html/macro/command/crc32.html) =================================================================== --- trunk/doc/ja/html/macro/command/checksum16.html (rev 0) +++ trunk/doc/ja/html/macro/command/checksum16.html 2013-03-26 16:25:36 UTC (rev 5177) @@ -0,0 +1,56 @@ +<!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>checksum16, checksum16file</title> + <meta http-equiv="Content-Style-Type" content="text/css"> + <link rel="stylesheet" href="../../style.css" type="text/css"> +</head> + +<body> + + +<h1>checksum16, checksum16file</h1> + +<p> +16bit checksum\x82\xF0\x8Cv\x8EZ\x82\xB7\x82\xE9\x81B +</p> + +<pre class="macro-syntax"> +checksum16 <intvar> <string> +checksum16file <intvar> <filename> +</pre> + +<h2>\x89\xF0\x90\xE0</h2> + +<p> +\x88\xF8\x90\x94\x82̕\xB6\x8E\x9A\x97\xE6\x82уt\x83@\x83C\x83\x8B\x82\xA9\x82\xE7\x89\xC1\x8EZ\x83T\x83\x80(16bit)\x82\xF0\x8Cv\x8EZ\x82\xB7\x82\xE9\x81B +<br><br> + +\x8Cv\x8EZ\x8C\x8B\x89ʂ\xCD intvar \x95ϐ\x94\x82ɐ\x94\x92l\x82Ƃ\xB5\x82Ċi\x94[\x82\xB3\x82\xEA\x82\xE9\x81B<br> +checksum16file \x82Ńt\x83@\x83C\x83\x8B\x82\xAA\x8AJ\x82\xAF\x82Ȃ\xA9\x82\xC1\x82\xBD\x8Fꍇ\x82́Aresult \x95ϐ\x94\x82\xC9 -1 \x82\xAA\x8Ai\x94[\x82\xB3\x82\xEA\x82\xE9\x81B +</p> + + +<h2>\x97\xE1</h2> + +<pre class="macro-example"> +str = 'this is a test string to be checksum16ed' +checksum16 crc str + +; Display checksum16 result asHEX +sprintf '0x%08X' crc +messagebox inputstr 'checksum16 = ' + +checksum16file crc 'foo.bin' +if result = -1 then + messagebox 'file open error' 'checksum16file = ' +else + sprintf '0x%08X' crc + messagebox inputstr 'checksum16file = ' +endif +</pre> + +</body> +</html> Copied: trunk/doc/ja/html/macro/command/checksum32.html (from rev 5175, trunk/doc/ja/html/macro/command/crc32.html) =================================================================== --- trunk/doc/ja/html/macro/command/checksum32.html (rev 0) +++ trunk/doc/ja/html/macro/command/checksum32.html 2013-03-26 16:25:36 UTC (rev 5177) @@ -0,0 +1,56 @@ +<!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>checksum32, checksum32file</title> + <meta http-equiv="Content-Style-Type" content="text/css"> + <link rel="stylesheet" href="../../style.css" type="text/css"> +</head> + +<body> + + +<h1>checksum32, checksum32file</h1> + +<p> +32bit checksum\x82\xF0\x8Cv\x8EZ\x82\xB7\x82\xE9\x81B +</p> + +<pre class="macro-syntax"> +checksum32 <intvar> <string> +checksum32file <intvar> <filename> +</pre> + +<h2>\x89\xF0\x90\xE0</h2> + +<p> +\x88\xF8\x90\x94\x82̕\xB6\x8E\x9A\x97\xE6\x82уt\x83@\x83C\x83\x8B\x82\xA9\x82\xE7\x89\xC1\x8EZ\x83T\x83\x80(32bit)\x82\xF0\x8Cv\x8EZ\x82\xB7\x82\xE9\x81B +<br><br> + +\x8Cv\x8EZ\x8C\x8B\x89ʂ\xCD intvar \x95ϐ\x94\x82ɐ\x94\x92l\x82Ƃ\xB5\x82Ċi\x94[\x82\xB3\x82\xEA\x82\xE9\x81B<br> +checksum32file \x82Ńt\x83@\x83C\x83\x8B\x82\xAA\x8AJ\x82\xAF\x82Ȃ\xA9\x82\xC1\x82\xBD\x8Fꍇ\x82́Aresult \x95ϐ\x94\x82\xC9 -1 \x82\xAA\x8Ai\x94[\x82\xB3\x82\xEA\x82\xE9\x81B +</p> + + +<h2>\x97\xE1</h2> + +<pre class="macro-example"> +str = 'this is a test string to be checksum32ed' +checksum32 crc str + +; Display checksum32 result asHEX +sprintf '0x%08X' crc +messagebox inputstr 'checksum32 = ' + +checksum32file crc 'foo.bin' +if result = -1 then + messagebox 'file open error' 'checksum32file = ' +else + sprintf '0x%08X' crc + messagebox inputstr 'checksum32file = ' +endif +</pre> + +</body> +</html> Copied: trunk/doc/ja/html/macro/command/checksum8.html (from rev 5175, trunk/doc/ja/html/macro/command/crc32.html) =================================================================== --- trunk/doc/ja/html/macro/command/checksum8.html (rev 0) +++ trunk/doc/ja/html/macro/command/checksum8.html 2013-03-26 16:25:36 UTC (rev 5177) @@ -0,0 +1,56 @@ +<!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>checksum8, checksum8file</title> + <meta http-equiv="Content-Style-Type" content="text/css"> + <link rel="stylesheet" href="../../style.css" type="text/css"> +</head> + +<body> + + +<h1>checksum8, checksum8file</h1> + +<p> +8bit checksum\x82\xF0\x8Cv\x8EZ\x82\xB7\x82\xE9\x81B +</p> + +<pre class="macro-syntax"> +checksum8 <intvar> <string> +checksum8file <intvar> <filename> +</pre> + +<h2>\x89\xF0\x90\xE0</h2> + +<p> +\x88\xF8\x90\x94\x82̕\xB6\x8E\x9A\x97\xE6\x82уt\x83@\x83C\x83\x8B\x82\xA9\x82\xE7\x89\xC1\x8EZ\x83T\x83\x80(8bit)\x82\xF0\x8Cv\x8EZ\x82\xB7\x82\xE9\x81B +<br><br> + +\x8Cv\x8EZ\x8C\x8B\x89ʂ\xCD intvar \x95ϐ\x94\x82ɐ\x94\x92l\x82Ƃ\xB5\x82Ċi\x94[\x82\xB3\x82\xEA\x82\xE9\x81B<br> +checksum8file \x82Ńt\x83@\x83C\x83\x8B\x82\xAA\x8AJ\x82\xAF\x82Ȃ\xA9\x82\xC1\x82\xBD\x8Fꍇ\x82́Aresult \x95ϐ\x94\x82\xC9 -1 \x82\xAA\x8Ai\x94[\x82\xB3\x82\xEA\x82\xE9\x81B +</p> + + +<h2>\x97\xE1</h2> + +<pre class="macro-example"> +str = 'this is a test string to be checksum8ed' +checksum8 crc str + +; Display checksum8 result asHEX +sprintf '0x%08X' crc +messagebox inputstr 'checksum8 = ' + +checksum8file crc 'foo.bin' +if result = -1 then + messagebox 'file open error' 'checksum8file = ' +else + sprintf '0x%08X' crc + messagebox inputstr 'checksum8file = ' +endif +</pre> + +</body> +</html> Copied: trunk/doc/ja/html/macro/command/crc16.html (from rev 5175, trunk/doc/ja/html/macro/command/crc32.html) =================================================================== --- trunk/doc/ja/html/macro/command/crc16.html (rev 0) +++ trunk/doc/ja/html/macro/command/crc16.html 2013-03-26 16:25:36 UTC (rev 5177) @@ -0,0 +1,80 @@ +<!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>crc16, crc16file</title> + <meta http-equiv="Content-Style-Type" content="text/css"> + <link rel="stylesheet" href="../../style.css" type="text/css"> +</head> + +<body> + + +<h1>crc16, crc16file</h1> + +<p> +CRC-16-IBM\x82\xF0\x8Cv\x8EZ\x82\xB7\x82\xE9\x81B +</p> + +<pre class="macro-syntax"> +crc16 <intvar> <string> +crc16file <intvar> <filename> +</pre> + +<h2>\x89\xF0\x90\xE0</h2> + +<p> +\x88\xF8\x90\x94\x82̕\xB6\x8E\x9A\x97\xE6\x82уt\x83@\x83C\x83\x8B\x82\xA9\x82\xE7CRC(Cyclic Redundancy Checking)\x82\xF0\x8Cv\x8EZ\x82\xB7\x82\xE9\x81B\x91\xBD\x8D\x80\x8E\xAE\x81i\x89E\x89\xF1\x82\xE8\x81j\x82͈ȉ\xBA\x82̂Ƃ\xA8\x82\xE8\x81B +<br><br> + +0xA001 (x<sup>16</sup>+x<sup>15</sup>+x<sup>2</sup>+x<sup>0</sup>) +<br><br> + +\x8Cv\x8EZ\x8C\x8B\x89ʂ\xCD intvar \x95ϐ\x94\x82ɐ\x94\x92l\x82Ƃ\xB5\x82Ċi\x94[\x82\xB3\x82\xEA\x82\xE9\x81B<br> +crc16file \x82Ńt\x83@\x83C\x83\x8B\x82\xAA\x8AJ\x82\xAF\x82Ȃ\xA9\x82\xC1\x82\xBD\x8Fꍇ\x82́Aresult \x95ϐ\x94\x82\xC9 -1 \x82\xAA\x8Ai\x94[\x82\xB3\x82\xEA\x82\xE9\x81B +</p> + +CRC\x83A\x83\x8B\x83S\x83\x8A\x83Y\x83\x80\x82̎\xC0\x91\x95\x81iC\x8C\xBE\x8C\xEA\x81j\x82\xF0\x88ȉ\xBA\x82Ɏ\xA6\x82\xB7\x81B +<pre> +<code> +static unsigned int crc16(int n, unsigned char c[]) +{ +#define CRC16POLY2 0x8408U /* \x8D\xB6\x89E\x8Bt\x93] */ + + int i, j; + unsigned long r; + + r = 0xFFFFU; + for (i = 0; i < n; i++) { + r ^= c[i]; + for (j = 0; j < CHAR_BIT; j++) + if (r & 1) r = (r >> 1) ^ CRC16POLY2; + else r >>= 1; + } + return r ^ 0xFFFFU; +} +</code></pre> + + +<h2>\x97\xE1</h2> + +<pre class="macro-example"> +str = 'this is a test string to be CRC16ed' +crc16 crc str + +; Display CRC16 result asHEX +sprintf '0x%08X' crc +messagebox inputstr 'CRC16 = ' + +crc16file crc 'foo.bin' +if result = -1 then + messagebox 'file open error' 'CRC16 = ' +else + sprintf '0x%08X' crc + messagebox inputstr 'CRC16 = ' +endif +</pre> + +</body> +</html> Modified: trunk/doc/ja/html/macro/command/index.html =================================================================== --- trunk/doc/ja/html/macro/command/index.html 2013-03-26 15:18:45 UTC (rev 5176) +++ trunk/doc/ja/html/macro/command/index.html 2013-03-26 16:25:36 UTC (rev 5177) @@ -184,8 +184,16 @@ <h2>\x82\xBB\x82̑\xBC\x82̃R\x83}\x83\x93\x83h</h2> <ul> <li><a href="beep.html">beep</a> + <li><a href="checksum8.html">checksum8</a> (\x83o\x81[\x83W\x83\x87\x83\x934.78\x88ȍ~) + <li><a href="checksum8.html">checksum8file</a> (\x83o\x81[\x83W\x83\x87\x83\x934.78\x88ȍ~) + <li><a href="checksum16.html">checksum16</a> (\x83o\x81[\x83W\x83\x87\x83\x934.78\x88ȍ~) + <li><a href="checksum16.html">checksum16file</a> (\x83o\x81[\x83W\x83\x87\x83\x934.78\x88ȍ~) + <li><a href="checksum32.html">checksum32</a> (\x83o\x81[\x83W\x83\x87\x83\x934.78\x88ȍ~) + <li><a href="checksum32.html">checksum32file</a> (\x83o\x81[\x83W\x83\x87\x83\x934.78\x88ȍ~) <li><a href="closesbox.html">closesbox</a> <li><a href="clipb2var.html">clipb2var</a> (\x83o\x81[\x83W\x83\x87\x83\x934.46\x88ȍ~) + <li><a href="crc16.html">crc16</a> (\x83o\x81[\x83W\x83\x87\x83\x934.78\x88ȍ~) + <li><a href="crc16.html">crc16file</a> (\x83o\x81[\x83W\x83\x87\x83\x934.78\x88ȍ~) <li><a href="crc32.html">crc32</a> (\x83o\x81[\x83W\x83\x87\x83\x934.60\x88ȍ~) <li><a href="crc32.html">crc32file</a> (\x83o\x81[\x83W\x83\x87\x83\x934.60\x88ȍ~) <li><a href="exec.html">exec</a> Modified: trunk/doc/ja/teraterm.hhc =================================================================== --- trunk/doc/ja/teraterm.hhc 2013-03-26 15:18:45 UTC (rev 5176) +++ trunk/doc/ja/teraterm.hhc 2013-03-26 16:25:36 UTC (rev 5177) @@ -1358,6 +1358,30 @@ <param name="ImageNumber" value="11"> </OBJECT> <LI> <OBJECT type="text/sitemap"> + <param name="Name" value="checksum8"> + <param name="Local" value="html\macro\command\checksum8.html"> + </OBJECT> + <LI> <OBJECT type="text/sitemap"> + <param name="Name" value="checksum8file"> + <param name="Local" value="html\macro\command\checksum8.html"> + </OBJECT> + <LI> <OBJECT type="text/sitemap"> + <param name="Name" value="checksum16"> + <param name="Local" value="html\macro\command\checksum16.html"> + </OBJECT> + <LI> <OBJECT type="text/sitemap"> + <param name="Name" value="checksum16file"> + <param name="Local" value="html\macro\command\checksum16.html"> + </OBJECT> + <LI> <OBJECT type="text/sitemap"> + <param name="Name" value="checksum32"> + <param name="Local" value="html\macro\command\checksum32.html"> + </OBJECT> + <LI> <OBJECT type="text/sitemap"> + <param name="Name" value="checksum32file"> + <param name="Local" value="html\macro\command\checksum32.html"> + </OBJECT> + <LI> <OBJECT type="text/sitemap"> <param name="Name" value="closesbox"> <param name="Local" value="html\macro\command\closesbox.html"> <param name="ImageNumber" value="11"> @@ -1368,6 +1392,14 @@ <param name="ImageNumber" value="11"> </OBJECT> <LI> <OBJECT type="text/sitemap"> + <param name="Name" value="crc16"> + <param name="Local" value="html\macro\command\crc16.html"> + </OBJECT> + <LI> <OBJECT type="text/sitemap"> + <param name="Name" value="crc16file"> + <param name="Local" value="html\macro\command\crc16.html"> + </OBJECT> + <LI> <OBJECT type="text/sitemap"> <param name="Name" value="crc32"> <param name="Local" value="html\macro\command\crc32.html"> <param name="ImageNumber" value="11"> Modified: trunk/doc/ja/teraterm.hhp =================================================================== --- trunk/doc/ja/teraterm.hhp 2013-03-26 15:18:45 UTC (rev 5176) +++ trunk/doc/ja/teraterm.hhp 2013-03-26 16:25:36 UTC (rev 5177) @@ -169,6 +169,12 @@ HlpMacroCommandCall=html\macro\command\call.html HlpMacroCommandCallmenu=html\macro\command\callmenu.html HlpMacroCommandChangedir=html\macro\command\changedir.html +HlpMacroCommandChecksum8=html\macro\command\checksum8.html +HlpMacroCommandChecksum8File=html\macro\command\checksum8.html +HlpMacroCommandChecksum16=html\macro\command\checksum16.html +HlpMacroCommandChecksum16File=html\macro\command\checksum16.html +HlpMacroCommandChecksum32=html\macro\command\checksum32.html +HlpMacroCommandChecksum32File=html\macro\command\checksum32.html HlpMacroCommandClearscreen=html\macro\command\clearscreen.html HlpMacroCommandClipb2var=html\macro\command\clipb2var.html HlpMacroCommandClosesbox=html\macro\command\closesbox.html @@ -176,6 +182,8 @@ HlpMacroCommandCode2str=html\macro\command\code2str.html HlpMacroCommandConnect=html\macro\command\connect.html HlpMacroCommandContinue=html\macro\command\continue.html +HlpMacroCommandCrc16=html\macro\command\crc16.html +HlpMacroCommandCrc16File=html\macro\command\crc16.html HlpMacroCommandCrc32=html\macro\command\crc32.html HlpMacroCommandCrc32File=html\macro\command\crc32.html HlpMacroCommandCygConnect=html\macro\command\cygconnect.html