blob: e51cf47dd441ab52ac88c98e1b3c28b9858a70fb [file] [log] [blame]
Alexandre Julliard7e56f681996-01-31 19:02:28 +00001#!/usr/bin/perl
Alexandre Julliard0c126c71996-02-18 18:44:41 +00002open(APIW,"./apiw.index") or die "Can't find ./apiw.index";
Alexandre Julliard7e56f681996-01-31 19:02:28 +00003while(<APIW>)
4{
5 ($func,$link)=split /:/;
6 chop $link;
7 $link=~m/(\d*)/;
8 $apiw{$func}="http://www.willows.com/apiw/chapter$1/p$link.html";
9}
10close(APIW);
11
Alexandre Julliard0c126c71996-02-18 18:44:41 +000012open(WINDOWS,"../include/windows.h") or die "Can't find ../include/windows.h";
Alexandre Julliard7e56f681996-01-31 19:02:28 +000013while(<WINDOWS>) { add_func($_) if /AccessResource/../wvsprintf/; }
14close(WINDOWS);
Alexandre Julliard0c126c71996-02-18 18:44:41 +000015open(TOOLHELP,"../include/toolhelp.h") or die "Can't find ../include/toolhelp.h";
Alexandre Julliard7e56f681996-01-31 19:02:28 +000016while(<TOOLHELP>) { add_func($_) if /GlobalInfo/../MemoryWrite/; }
17close(TOOLHELP);
Alexandre Julliard0c126c71996-02-18 18:44:41 +000018open(COMMDLG,"../include/commdlg.h") or die "Can't find ../include/commdlg.h";
Alexandre Julliard7e56f681996-01-31 19:02:28 +000019while(<COMMDLG>) { add_func($_) if /ChooseColor/../ReplaceText/; }
20close(COMMDLG);
21
22print "<html><body>\n";
23
24print "<h2>Windows API Functions</h2>\n";
25print "The following API functions were found by searching windows.h,\n";
26print "toolhelp.h, and commdlg.h. Where possible, help links pointing\n";
27print "to www.willows.com are included.<p>\n";
28print "<table>\n";
29print "<th>Help-link</th><th></th><th></th><th align=left>Function</th>\n";
30foreach $func (sort(keys %funcs))
31{
32 $funcs{$func}=~m/(.*) +(\w*)(\(.*)/;
33 print "<tr>\n<td>";
34 if($apiw{$2})
35 {
36 print "<center><a href=\"$apiw{$2}\">APIW</a></center>";
37 $impl{$2}=1;
38 $impl++;
39 }
40 $numfuncs++;
41 print "</td>\n";
42 print "<td></td>\n";
43 print "<td>$1</td>\n";
44 print "<td>$2$3</td>\n";
45 print "</tr>\n";
46}
47print "</table><p>\n";
48print "(Approximately ",sprintf("%3.1f",$impl/(1.0*$numfuncs)*100.0),
49 "% of the functions above are in the APIW standard.)<p>\n";
50
51print "<hr>\n";
52print "<h2>Unimplemented APIW functions</h2><p>\n";
53print "Here's a list of the API functions in the APIW standard which were <b>not</b> found\n";
54print "in windows.h, commdlg.h, or toolhelp.h:<p>\n";
55foreach $func (sort (keys %apiw))
56{
57 if(!$impl{$func})
58 {
59 print "<a href=\"$apiw{$func}\">$func</a>\n";
60 $unimpl++;
61 }
62 $numapiw++;
63}
64print "<p>(This comprises approximately ",sprintf("%3.1f",$unimpl/(1.0*$numapiw)*100.0),
65 "% of the APIW.)\n";
66
67print "</body></html>\n";
68
69sub add_func
70{
71 $line=shift;
72 chop $line;
73 $line=~s/\s+/ /g;
74 ($func)=$line=~m/ (\w*)\(/;
75 if($func)
76 {
77 while($funcs{$func}) { $func.=" "; }
78 $funcs{$func}=$line;
79 }
80}