Several bug fixes and additions.

diff --git a/tools/winapi_check/modules.dat b/tools/winapi_check/modules.dat
index 7c273ee..9dfce9f 100644
--- a/tools/winapi_check/modules.dat
+++ b/tools/winapi_check/modules.dat
@@ -195,7 +195,6 @@
 % dlls/ole32/compobj.spec
 
 dlls/ole32
-files
 
 % dlls/ole32/ole2.spec
 
@@ -210,7 +209,6 @@
 % dlls/ole32/ole2nls.spec
 
 dlls/ole32
-ole
 
 % dlls/ole32/ole2prox.spec
 
diff --git a/tools/winapi_check/nativeapi.pm b/tools/winapi_check/nativeapi.pm
index 023523a..5c5c338 100644
--- a/tools/winapi_check/nativeapi.pm
+++ b/tools/winapi_check/nativeapi.pm
@@ -76,14 +76,12 @@
 	# skip comments
 	if(/^dnl/) { next; }
 
-	if(/^AC_CHECK_HEADERS\(\s*(.*?)\)\s*$/) {
-	    my @arguments = split(/,/,$1);
-	    foreach my $name (split(/\s+/, $arguments[0])) {		
+	if(/^AC_CHECK_HEADERS\(\s*([^,\)]*)(?:,|\))?/) {
+	    foreach my $name (split(/\s+/, $1)) {
 		$$conditional_headers{$name}++;
 	    }
-	} elsif(/^AC_CHECK_FUNCS\(\s*(.*?)\)\s*$/) {
-	    my @arguments = split(/,/,$1);
-	    foreach my $name (split(/\s+/, $arguments[0])) {		
+	} elsif(/^AC_CHECK_FUNCS\(\s*([^,\)]*)(?:,|\))?/) {
+	    foreach my $name (split(/\s+/, $1)) {
 		$$conditional_functions{$name}++;
 	    }
 	} elsif(/^AC_FUNC_ALLOCA/) {
diff --git a/tools/winapi_check/win16/compobj.api b/tools/winapi_check/win16/compobj.api
index 842ff1d..63e5a08 100644
--- a/tools/winapi_check/win16/compobj.api
+++ b/tools/winapi_check/win16/compobj.api
@@ -19,7 +19,6 @@
 IMalloc16 *
 LPCLSID
 LPDWORD
-LPFILETIME
 LPMALLOC16 *
 LPMESSAGEFILTER
 LPMESSAGEFILTER *
diff --git a/tools/winapi_check/winapi.pm b/tools/winapi_check/winapi.pm
index 968a721..f94fdda 100644
--- a/tools/winapi_check/winapi.pm
+++ b/tools/winapi_check/winapi.pm
@@ -694,6 +694,15 @@
     return $$function_external_calling_convention{$name};
 }
 
+sub function_internal_name {
+    my $self = shift;
+    my $function_internal_name = \%{$self->{FUNCTION_INTERNAL_NAME}};
+
+    my $name = shift;
+
+    return $$function_internal_name{$name};
+}
+
 sub function_external_name {
     my $self = shift;
     my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}};
diff --git a/tools/winapi_check/winapi_parser.pm b/tools/winapi_check/winapi_parser.pm
index e848ad3..b484407 100644
--- a/tools/winapi_check/winapi_parser.pm
+++ b/tools/winapi_check/winapi_parser.pm
@@ -46,7 +46,7 @@
 	    }
 	}
 
-	$statements = "";
+	$statements = undef;
     };
     my $function_end = sub {
 	&$function_found_callback($line_number,$debug_channels,$documentation,$linkage,$return_type,
@@ -55,6 +55,7 @@
 	$function = "";
     };
     my %regs_entrypoints;
+    my @comment_lines = ();
     my @comments = ();
     my $level = 0;
     my $extern_c = 0;
@@ -72,11 +73,11 @@
 	    if($lookahead) {
 		$lookahead = 0;
 		$_ .= "\n" . $line;
+		$lookahead_count++;
 	    } else {
 		$_ = $line;
 		$lookahead_count = 0;
 	    }
-	    $lookahead_count++;
 	    print " $level($lookahead_count): $line\n" if $options->debug >= 2;
 	    print "*** $_\n" if $options->debug >= 3;
 	} else {
@@ -91,7 +92,12 @@
 	}
       
 	# remove C comments
-	if(s/^(.*?)(\/\*.*?\*\/)(.*)$/$1 $3/s) { push @comments, $2; $again = 1; next }
+	if(s/^(.*?)(\/\*.*?\*\/)(.*)$/$1 $3/s) { 
+	    push @comment_lines, $.; 
+	    push @comments, $2; 
+	    $again = 1; 
+	    next;
+	}
 	if(/^(.*?)\/\*/s) {
 	    $lookahead = 1;
 	    next;
@@ -126,6 +132,7 @@
 	    next; 
 	}
 
+	my $documentation_line;
 	my $documentation;
 	my @argument_documentations = ();
 	{
@@ -137,7 +144,11 @@
 	    }
 
 	    if(defined($comments[$n]) && $n >= 0) {
+		my @lines = split(/\n/, $comments[$n]);
+
+		$documentation_line = $comment_lines[$n] - scalar(@lines) + 1;
 		$documentation = $comments[$n];
+
 		for(my $m=$n+1; $m <= $#comments; $m++) {
 		    if($comments[$m] =~ /^\/\*\*+\/$/ ||
 		       $comments[$m] =~ /^\/\*\s*(?:\!)?defined/) # FIXME: Kludge
@@ -211,6 +222,10 @@
 		}
 	    }
 
+	    if(!defined($statements)) {
+		$statements = "";
+	    }
+
 	    if($line !~ /^\s*$/) {
 		$statements .= "$line\n";
 	    }
@@ -223,10 +238,14 @@
             ((__cdecl|__stdcall|CDECL|VFWAPIV|VFWAPI|WINAPIV|WINAPI|CALLBACK)\s+)?
 	    (\w+(\(\w+\))?)\s*\(([^\)]*)\)\s*(\{|\;)/sx)
         {
-	    $line_number = $. - $lookahead_count;
+	    my @lines = split(/\n/, $&);
+	    my $function_line = $. - scalar(@lines) + 1;
+
+	    # FIXME: Should be separate for documentation and function
+	    $line_number = $documentation_line;
 
 	    $_ = $'; $again = 1;
-	    
+
 	    if($11 eq "{")  {
 		$level++;
 	    }