Added needed string.h includes.
[wine.git] / tools / makehtml.pl
blobe51cf47dd441ab52ac88c98e1b3c28b9858a70fb
1 #!/usr/bin/perl
2 open(APIW,"./apiw.index") or die "Can't find ./apiw.index";
3 while(<APIW>)
5 ($func,$link)=split /:/;
6 chop $link;
7 $link=~m/(\d*)/;
8 $apiw{$func}="http://www.willows.com/apiw/chapter$1/p$link.html";
10 close(APIW);
12 open(WINDOWS,"../include/windows.h") or die "Can't find ../include/windows.h";
13 while(<WINDOWS>) { add_func($_) if /AccessResource/../wvsprintf/; }
14 close(WINDOWS);
15 open(TOOLHELP,"../include/toolhelp.h") or die "Can't find ../include/toolhelp.h";
16 while(<TOOLHELP>) { add_func($_) if /GlobalInfo/../MemoryWrite/; }
17 close(TOOLHELP);
18 open(COMMDLG,"../include/commdlg.h") or die "Can't find ../include/commdlg.h";
19 while(<COMMDLG>) { add_func($_) if /ChooseColor/../ReplaceText/; }
20 close(COMMDLG);
22 print "<html><body>\n";
24 print "<h2>Windows API Functions</h2>\n";
25 print "The following API functions were found by searching windows.h,\n";
26 print "toolhelp.h, and commdlg.h. Where possible, help links pointing\n";
27 print "to www.willows.com are included.<p>\n";
28 print "<table>\n";
29 print "<th>Help-link</th><th></th><th></th><th align=left>Function</th>\n";
30 foreach $func (sort(keys %funcs))
32 $funcs{$func}=~m/(.*) +(\w*)(\(.*)/;
33 print "<tr>\n<td>";
34 if($apiw{$2})
36 print "<center><a href=\"$apiw{$2}\">APIW</a></center>";
37 $impl{$2}=1;
38 $impl++;
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";
47 print "</table><p>\n";
48 print "(Approximately ",sprintf("%3.1f",$impl/(1.0*$numfuncs)*100.0),
49 "% of the functions above are in the APIW standard.)<p>\n";
51 print "<hr>\n";
52 print "<h2>Unimplemented APIW functions</h2><p>\n";
53 print "Here's a list of the API functions in the APIW standard which were <b>not</b> found\n";
54 print "in windows.h, commdlg.h, or toolhelp.h:<p>\n";
55 foreach $func (sort (keys %apiw))
57 if(!$impl{$func})
59 print "<a href=\"$apiw{$func}\">$func</a>\n";
60 $unimpl++;
62 $numapiw++;
64 print "<p>(This comprises approximately ",sprintf("%3.1f",$unimpl/(1.0*$numapiw)*100.0),
65 "% of the APIW.)\n";
67 print "</body></html>\n";
69 sub add_func
71 $line=shift;
72 chop $line;
73 $line=~s/\s+/ /g;
74 ($func)=$line=~m/ (\w*)\(/;
75 if($func)
77 while($funcs{$func}) { $func.=" "; }
78 $funcs{$func}=$line;