#!/usr/bin/perl -w use strict; # 2000/07/09: Fixed an off by one error in the month of the 'last updated' date # 2005/07/04: Added missing "

" (Thanks to the html-checker in dillo) # Added "." for Libraries to include "*.drv", "*.ocx" and other # Changed Ignore-List my @ignore_list=qw(winealsa.drv winearts.drv wineaudioio.drv wined3d winedos winejack.drv winemp3.acm winenas.drv wineoss.drv wineps.drv wineps16.drv winex11.drv); sub print_library_stats($$$$) { my ($name, $api_count, $stub_count, $pseudo_stub_count)=@_; return if ($api_count == 0); #print "Match: name=$name\n"; #print " api_count=$api_count\n"; #print " stub_count=$stub_count\n"; #print " pseudo_stub_count=$pseudo_stub_count\n"; print "\n"; print " $name\n"; print " $api_count\n"; printf " %2.0f%%\n",($api_count-$stub_count-$pseudo_stub_count)*100/$api_count; printf " %d = %d + %d\n",$stub_count+$pseudo_stub_count,$stub_count,$pseudo_stub_count; print "\n"; } my %dlls; my $api_count=0; my $stub_count=0; my $pseudo_stub_count=0; my %ignored=(); foreach my $ignored_module (@ignore_list) { $ignored{$ignored_module}=1; } while (<>) { if (/^\*.c: ([a-zA-Z0-9_.]+): [0-9]+ of ([0-9]+) functions are stubs \(([0-9]+) real, ([0-9]+) pseudo\)/) { next if (defined $ignored{$1}); my @counts=($2,$3,$4); $dlls{$1}=\@counts; $api_count+=$2; $stub_count+=$3; $pseudo_stub_count+=$4; } } my ($day,$month,$year)=(localtime)[3,4,5]; $month+=1; $year+=1900; print <<__EOF__
Wine

Wine





Quick API statistics

Here are the stats I generated out of the new results provided by Patrik Stridvall's winapi_check. Before anyone jumps to the stats and starts quoting them I would like to point out that they only tell a small part of the story and thus should be taken with a big grain of salt. In particular:

Finally here's a word about how this is all computed. winapi_check analyzes the contents of Wine's spec files which list all the entry-point (APIs) present in a DLL. This gives the per library API count in the second column. The Spec file also specifies for each API whether there is a function that implements it. If not we say this entry-point is a 'regular' stub. Some APIs are implemented but all the implementation does is print a warning: 'FIXME("stub");' (and returns either a fake success code or an error which is enough to get some applications to work). winapi_check also detects these and reports them as pseudo stubs. So the second column is the percentage of APIs of a dll which have been implemented, i.e. are neither regular nor pseudo stubs. The last column indicates how many stubs there are and their repartition between regular and pseudo stubs.

You can download the script right here. Then, to take it for a ride, type:

./tools/winapi/winapi_extract --pseudo-stub-statistics --no-verbose --no-progress 2>&1 | tee winapi_stats.txt | winapi_stats >winapi_stats.html

The text file is nice if you decide to tweak the script as an afterthought or if you want to diff it against an older version to see what has changed


Last updated: $year/$month/$day
__EOF__ ; print_library_stats("Total",$api_count,$stub_count,$pseudo_stub_count); print "\n"; print " \n"; print "\n"; foreach my $dll (sort keys %dlls) { my $counts=$dlls{$dll}; #print "$dll $counts->[0] $counts->[1] $counts->[2]\n"; print_library_stats($dll,$counts->[0],$counts->[1],$counts->[2]); } print "
Library API Count % Implemented Stubs (total=regular+pseudo)
 
\n"; print "
\n"; print "

\n"; print "\n"; print "

\n";