Develop and Download Open Source Software

Browse Subversion Repository

Annotation of /trunk/installer/macrotemplate.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1184 - (hide annotations) (download) (as text)
Mon Apr 14 14:34:23 2008 UTC (16 years ago) by maya
Original Path: installer/branches/avendor/macrotemplate.pl
File MIME type: text/x-perl
File size: 5365 byte(s)
teraterm/installer より移動

1 maya 1184 #
2     # マクロコマンドのドキュメント類のチェックを行う
3     #
4     # [実行方法]
5     # __END__以降のマクロ列を検証する
6     # >perl macrotemplate.pl
7     #
8     # 指定したマクロを検証する
9     # >perl macrotemplate.pl scpsend
10     #
11     # [改版履歴]
12     # 1.0 (2008.02.16 Yutaka Hirata)
13     # 1.1 (2008.02.23 Yutaka Hirata)
14     #
15    
16     $macroidfile = '..\source\ttmacro\ttmparse.h';
17     $helpidfile = '..\source\common\helpid.h';
18     $encmdfile = '..\..\doc\en\html\macro\command';
19     $jpcmdfile = '..\..\doc\jp\html\macro\command';
20     $enhhcfile = '..\..\doc\en\teraterm.hhc';
21     $jphhcfile = '..\..\doc\jp\teraterm.hhc';
22     $enhhpfile = '..\..\doc\en\teraterm.hhp';
23     $jphhpfile = '..\..\doc\jp\teraterm.hhp';
24     $keyfile = '..\release\keyfile.ini';
25    
26     if ($#ARGV != -1) {
27     print "$ARGV[0]\n";
28     do_main(lc($ARGV[0]));
29    
30     } else {
31     while (<DATA>) {
32     chomp;
33     if (/(.+)=.*/) {
34     $key = lc($1);
35     print "==== $key マクロを検証中...\n";
36     do_main($key);
37     }
38     }
39     }
40     exit(0);
41    
42    
43     #; TODO
44     #; en/teraterm.hhcにリンク挿入
45     #; en/teraterm.hhpにalias追加
46     #; jp/teraterm.hhcにリンク挿入
47     #; jp/teraterm.hhpにalias追加
48    
49     sub do_main {
50     my($macro) = @_;
51     my($ret, $id, $s, $pat);
52     my($idline, $helpline);
53     # print "$macro\n";
54    
55     $s = "Rsv$macro\\b";
56     $ret = read_keyword($macroidfile, $s);
57     $idline = $ret;
58     # print "$ret\n";
59     if ($ret =~ /$macro\s+(\d+)/i) {
60     $id = $1;
61     } else {
62     print "IDファイル($macroidfile)からマクロ定義が見つかりません\n";
63     print "$idline\n";
64     return;
65     }
66     # print "$id\n";
67    
68     $s = "Command$macro\\b";
69     $ret = read_keyword($helpidfile, $s);
70     $helpline = $ret;
71     # print "$ret\n";
72     if ($ret =~ /$macro\s+(\d+)/i) {
73     $n = 92000 + $id;
74     if ($n != $1) {
75     print "$helpidfile のIDが一致していません ($n != $1)\n";
76     print "$idline\n";
77     print "$ret\n";
78     return;
79     }
80     } else {
81     print "HELPIDファイル($helpidfile)からマクロ定義が見つかりません\n";
82     print "$idline\n";
83     print "$ret\n";
84     return;
85     }
86    
87     $s = "$encmdfile\\$macro.html";
88     if (!(-e $s)) {
89     print "マクロコマンドの英語版説明文($s)がありません\n";
90     }
91    
92     $s = "$jpcmdfile\\$macro.html";
93     if (!(-e $s)) {
94     print "マクロコマンドの日本語版説明文($s)がありません\n";
95     }
96    
97     $s = "$encmdfile\\index.html";
98     $pat = "$macro.html";
99     $ret = read_keyword($s, $pat);
100     if ($ret eq '') {
101     print "$s ファイルに $pat へのリンクがありません\n";
102     }
103    
104     $s = "$jpcmdfile\\index.html";
105     $pat = "$macro.html";
106     $ret = read_keyword($s, $pat);
107     if ($ret eq '') {
108     print "$s ファイルに $pat へのリンクがありません\n";
109     }
110    
111    
112     $pat = "$macro.html";
113     $ret = read_keyword($enhhcfile, $pat);
114     if ($ret eq '') {
115     print "$enhhcfile ファイルに $pat へのリンクがありません\n";
116     }
117    
118     $pat = "$macro.html";
119     $ret = read_keyword($jphhcfile, $pat);
120     if ($ret eq '') {
121     print "$jphhcfile ファイルに $pat へのリンクがありません\n";
122     }
123    
124    
125     $pat = "$macro.html";
126     $ret = read_keyword($enhhpfile, $pat);
127     if ($ret eq '') {
128     print "$enhhpfile ファイルに $pat へのALIASリンクがありません\n";
129     }
130    
131     $pat = "$macro.html";
132     $ret = read_keyword($jphhpfile, $pat);
133     if ($ret eq '') {
134     print "$jphhpfile ファイルに $pat へのALIASリンクがありません\n";
135     }
136    
137    
138     $pat = "\\b$macro\\b";
139     $ret = read_keyword($keyfile, $pat);
140     if ($ret eq '') {
141     print "$keyfile ファイルに $pat コマンドがありません\n";
142     }
143    
144     }
145    
146     sub read_keyword {
147     my($file, $keyword) = @_;
148     my($line) = '';
149     my($found) = 0;
150    
151     open(FP, "$file") || die "Can't open $file.";
152     while (<FP>) {
153     chomp;
154     $line = $_;
155     if (/$keyword/i) {
156     $found = 1;
157     last;
158     }
159     }
160     close(FP);
161    
162     if ($found == 0) {
163     $line = '';
164     }
165     return ($line);
166     }
167    
168     # コマンド列はkeyfile.iniから抜粋
169     __END__
170     Beep=92001
171     Bplusrecv=92002
172     Bplussend=92003
173     Break=92120
174     Call=92004
175     Callmenu=92125
176     Changedir=92005
177     Clearscreen=92006
178     Clipb2var=92113
179     Closesbox=92007
180     Closett=92008
181     Code2str=92009
182     Connect=92010
183     CygConnect=92130
184     Delpassword=92011
185     Disconnect=92012
186     Do=92126
187     Enablekeyb=92015
188     End=92016
189     EndUntil=92129
190     Exec=92019
191     Execcmnd=92020
192     Exit=92021
193     Fileclose=92022
194     Fileconcat=92023
195     Filecopy=92024
196     Filecreate=92025
197     Filedelete=92026
198     Filemarkptr=92027
199     Filenamebox=92124
200     Fileopen=92028
201     Fileread=92116
202     Filereadln=92029
203     Filerename=92030
204     Filesearch=92031
205     Fileseek=92032
206     Fileseekback=92033
207     Filestrseek=92034
208     Filestrseek2=92035
209     Filewrite=92036
210     Filewriteln=92037
211     Findoperations=92039
212     Flushrecv=92041
213     Fornext=92042
214     Getdate=92043
215     Getdir=92044
216     Getenv=92045
217     Getpassword=92046
218     Gettime=92047
219     Gettitle=92048
220     Getver=92133
221     Goto=92049
222     Ifdefined=92115
223     Ifthenelseif=92050
224     Include=92051
225     Inputbox=92052
226     Int2str=92053
227     Kmtfinish=92054
228     Kmtget=92055
229     Kmtrecv=92056
230     Kmtsend=92057
231     Loadkeymap=92058
232     Logclose=92059
233     Logopen=92060
234     Logpause=92061
235     Logstart=92062
236     Logwrite=92063
237     Loop=92127
238     Makepath=92064
239     Messagebox=92065
240     Mpause=92111
241     Passwordbox=92067
242     Pause=92068
243     Quickvanrecv=92069
244     Quickvansend=92070
245     Random=92112
246     Recvln=92071
247     Restoresetup=92072
248     Return=92073
249     Rotateleft=92122
250     Rotateright=92121
251     Scprecv=92131
252     Scpsend=92132
253     Send=92074
254     Sendbreak=92075
255     Sendfile=92076
256     Sendkcode=92077
257     Sendln=92078
258     Setbaud=92134
259     Setdate=92079
260     Setdir=92080
261     Setdlgpos=92081
262     Setenv=92123
263     Setecho=92082
264     Setexitcode=92083
265     Setsync=92084
266     Settime=92085
267     Settitle=92086
268     Show=92087
269     Showtt=92088
270     Sprintf=92117
271     Statusbox=92089
272     Str2code=92090
273     Str2int=92091
274     Strcompare=92092
275     Strconcat=92093
276     Strcopy=92094
277     Strlen=92095
278     Strscan=92096
279     Testlink=92097
280     Tolower=92118
281     Toupper=92119
282     Unlink=92099
283     Until=92128
284     Var2clipb=92114
285     Wait=92100
286     Waitevent=92101
287     Waitln=92102
288     Waitrecv=92103
289     Waitregex=92110
290     While=92104
291     Xmodemrecv=92105
292     Xmodemsend=92106
293     Yesnobox=92107
294     Zmodemrecv=92108
295     Zmodemsend=92109
296    

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26