makehtml.pl 2.22 KB
Newer Older
Alexandre Julliard's avatar
Alexandre Julliard committed
1
#!/usr/bin/perl
Alexandre Julliard's avatar
Alexandre Julliard committed
2
open(APIW,"./apiw.index") or die "Can't find ./apiw.index";
Alexandre Julliard's avatar
Alexandre Julliard committed
3 4 5 6 7 8 9 10 11
while(<APIW>)
{
  ($func,$link)=split /:/;
  chop $link;
  $link=~m/(\d*)/;
  $apiw{$func}="http://www.willows.com/apiw/chapter$1/p$link.html";
}
close(APIW);

Alexandre Julliard's avatar
Alexandre Julliard committed
12
open(WINDOWS,"../include/windows.h") or die "Can't find ../include/windows.h";
Alexandre Julliard's avatar
Alexandre Julliard committed
13 14
while(<WINDOWS>) { add_func($_) if /AccessResource/../wvsprintf/; }
close(WINDOWS);
Alexandre Julliard's avatar
Alexandre Julliard committed
15
open(TOOLHELP,"../include/toolhelp.h") or die "Can't find ../include/toolhelp.h";
Alexandre Julliard's avatar
Alexandre Julliard committed
16 17
while(<TOOLHELP>) { add_func($_) if /GlobalInfo/../MemoryWrite/; }
close(TOOLHELP);
Alexandre Julliard's avatar
Alexandre Julliard committed
18
open(COMMDLG,"../include/commdlg.h") or die "Can't find ../include/commdlg.h";
Alexandre Julliard's avatar
Alexandre Julliard committed
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
while(<COMMDLG>) { add_func($_) if /ChooseColor/../ReplaceText/; }
close(COMMDLG);

print "<html><body>\n";

print "<h2>Windows API Functions</h2>\n";
print "The following API functions were found by searching windows.h,\n";
print "toolhelp.h, and commdlg.h.  Where possible, help links pointing\n";
print "to www.willows.com are included.<p>\n";
print "<table>\n";
print "<th>Help-link</th><th></th><th></th><th align=left>Function</th>\n";
foreach $func (sort(keys %funcs))
{
  $funcs{$func}=~m/(.*) +(\w*)(\(.*)/;
  print "<tr>\n<td>";
  if($apiw{$2})
  {
    print "<center><a href=\"$apiw{$2}\">APIW</a></center>";
    $impl{$2}=1;
    $impl++;
  }
  $numfuncs++;
  print "</td>\n";
  print "<td></td>\n";
  print "<td>$1</td>\n";
  print "<td>$2$3</td>\n";
  print "</tr>\n";
}
print "</table><p>\n";
print "(Approximately ",sprintf("%3.1f",$impl/(1.0*$numfuncs)*100.0),
      "% of the functions above are in the APIW standard.)<p>\n";

print "<hr>\n";
print "<h2>Unimplemented APIW functions</h2><p>\n";
print "Here's a list of the API functions in the APIW standard which were <b>not</b> found\n";
print "in windows.h, commdlg.h, or toolhelp.h:<p>\n";
foreach $func (sort (keys %apiw))
{
  if(!$impl{$func})
  {
    print "<a href=\"$apiw{$func}\">$func</a>\n";
    $unimpl++;
  }
  $numapiw++;
}
print "<p>(This comprises approximately ",sprintf("%3.1f",$unimpl/(1.0*$numapiw)*100.0),
      "% of the APIW.)\n";

print "</body></html>\n";

sub add_func
{
  $line=shift;
  chop $line; 
  $line=~s/\s+/ /g;
  ($func)=$line=~m/ (\w*)\(/;
  if($func)
  {
    while($funcs{$func}) { $func.=" "; }
    $funcs{$func}=$line;
  }
}