Commit 0e397feb authored by Patrik Stridvall's avatar Patrik Stridvall Committed by Alexandre Julliard

Several bug fixes and additions.

parent 56a19923
...@@ -118,7 +118,7 @@ foreach my $file (@files) { ...@@ -118,7 +118,7 @@ foreach my $file (@files) {
local $_; local $_;
foreach (split(/\n/, $documentation)) { foreach (split(/\n/, $documentation)) {
if(/^ \*\s*(\w+)\s*[\(\[]\s*(\w+)\.\s*(\@|\d+)\s*[\)\]]/m) { if(/^\s*\*\s*(\w+|\@)\s*[\(\[]\s*(\w+)\s*\.\s*(\@|\d+)\s*[\)\]]/) {
my $external_name = $1; my $external_name = $1;
my $module = lc($2); my $module = lc($2);
my $ordinal = $3; my $ordinal = $3;
......
...@@ -195,7 +195,6 @@ dlls/odbc32 ...@@ -195,7 +195,6 @@ dlls/odbc32
% dlls/ole32/compobj.spec % dlls/ole32/compobj.spec
dlls/ole32 dlls/ole32
files
% dlls/ole32/ole2.spec % dlls/ole32/ole2.spec
...@@ -210,7 +209,6 @@ dlls/ole32 ...@@ -210,7 +209,6 @@ dlls/ole32
% dlls/ole32/ole2nls.spec % dlls/ole32/ole2nls.spec
dlls/ole32 dlls/ole32
ole
% dlls/ole32/ole2prox.spec % dlls/ole32/ole2prox.spec
......
...@@ -76,14 +76,12 @@ sub new { ...@@ -76,14 +76,12 @@ sub new {
# skip comments # skip comments
if(/^dnl/) { next; } if(/^dnl/) { next; }
if(/^AC_CHECK_HEADERS\(\s*(.*?)\)\s*$/) { if(/^AC_CHECK_HEADERS\(\s*([^,\)]*)(?:,|\))?/) {
my @arguments = split(/,/,$1); foreach my $name (split(/\s+/, $1)) {
foreach my $name (split(/\s+/, $arguments[0])) {
$$conditional_headers{$name}++; $$conditional_headers{$name}++;
} }
} elsif(/^AC_CHECK_FUNCS\(\s*(.*?)\)\s*$/) { } elsif(/^AC_CHECK_FUNCS\(\s*([^,\)]*)(?:,|\))?/) {
my @arguments = split(/,/,$1); foreach my $name (split(/\s+/, $1)) {
foreach my $name (split(/\s+/, $arguments[0])) {
$$conditional_functions{$name}++; $$conditional_functions{$name}++;
} }
} elsif(/^AC_FUNC_ALLOCA/) { } elsif(/^AC_FUNC_ALLOCA/) {
......
...@@ -19,7 +19,6 @@ HTASK16 * ...@@ -19,7 +19,6 @@ HTASK16 *
IMalloc16 * IMalloc16 *
LPCLSID LPCLSID
LPDWORD LPDWORD
LPFILETIME
LPMALLOC16 * LPMALLOC16 *
LPMESSAGEFILTER LPMESSAGEFILTER
LPMESSAGEFILTER * LPMESSAGEFILTER *
......
...@@ -694,6 +694,15 @@ sub function_external_calling_convention { ...@@ -694,6 +694,15 @@ sub function_external_calling_convention {
return $$function_external_calling_convention{$name}; 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 { sub function_external_name {
my $self = shift; my $self = shift;
my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}}; my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}};
......
...@@ -46,7 +46,7 @@ sub parse_c_file { ...@@ -46,7 +46,7 @@ sub parse_c_file {
} }
} }
$statements = ""; $statements = undef;
}; };
my $function_end = sub { my $function_end = sub {
&$function_found_callback($line_number,$debug_channels,$documentation,$linkage,$return_type, &$function_found_callback($line_number,$debug_channels,$documentation,$linkage,$return_type,
...@@ -55,6 +55,7 @@ sub parse_c_file { ...@@ -55,6 +55,7 @@ sub parse_c_file {
$function = ""; $function = "";
}; };
my %regs_entrypoints; my %regs_entrypoints;
my @comment_lines = ();
my @comments = (); my @comments = ();
my $level = 0; my $level = 0;
my $extern_c = 0; my $extern_c = 0;
...@@ -72,11 +73,11 @@ sub parse_c_file { ...@@ -72,11 +73,11 @@ sub parse_c_file {
if($lookahead) { if($lookahead) {
$lookahead = 0; $lookahead = 0;
$_ .= "\n" . $line; $_ .= "\n" . $line;
$lookahead_count++;
} else { } else {
$_ = $line; $_ = $line;
$lookahead_count = 0; $lookahead_count = 0;
} }
$lookahead_count++;
print " $level($lookahead_count): $line\n" if $options->debug >= 2; print " $level($lookahead_count): $line\n" if $options->debug >= 2;
print "*** $_\n" if $options->debug >= 3; print "*** $_\n" if $options->debug >= 3;
} else { } else {
...@@ -91,7 +92,12 @@ sub parse_c_file { ...@@ -91,7 +92,12 @@ sub parse_c_file {
} }
# remove C comments # 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) { if(/^(.*?)\/\*/s) {
$lookahead = 1; $lookahead = 1;
next; next;
...@@ -126,6 +132,7 @@ sub parse_c_file { ...@@ -126,6 +132,7 @@ sub parse_c_file {
next; next;
} }
my $documentation_line;
my $documentation; my $documentation;
my @argument_documentations = (); my @argument_documentations = ();
{ {
...@@ -137,7 +144,11 @@ sub parse_c_file { ...@@ -137,7 +144,11 @@ sub parse_c_file {
} }
if(defined($comments[$n]) && $n >= 0) { if(defined($comments[$n]) && $n >= 0) {
my @lines = split(/\n/, $comments[$n]);
$documentation_line = $comment_lines[$n] - scalar(@lines) + 1;
$documentation = $comments[$n]; $documentation = $comments[$n];
for(my $m=$n+1; $m <= $#comments; $m++) { for(my $m=$n+1; $m <= $#comments; $m++) {
if($comments[$m] =~ /^\/\*\*+\/$/ || if($comments[$m] =~ /^\/\*\*+\/$/ ||
$comments[$m] =~ /^\/\*\s*(?:\!)?defined/) # FIXME: Kludge $comments[$m] =~ /^\/\*\s*(?:\!)?defined/) # FIXME: Kludge
...@@ -211,6 +222,10 @@ sub parse_c_file { ...@@ -211,6 +222,10 @@ sub parse_c_file {
} }
} }
if(!defined($statements)) {
$statements = "";
}
if($line !~ /^\s*$/) { if($line !~ /^\s*$/) {
$statements .= "$line\n"; $statements .= "$line\n";
} }
...@@ -223,10 +238,14 @@ sub parse_c_file { ...@@ -223,10 +238,14 @@ sub parse_c_file {
((__cdecl|__stdcall|CDECL|VFWAPIV|VFWAPI|WINAPIV|WINAPI|CALLBACK)\s+)? ((__cdecl|__stdcall|CDECL|VFWAPIV|VFWAPI|WINAPIV|WINAPI|CALLBACK)\s+)?
(\w+(\(\w+\))?)\s*\(([^\)]*)\)\s*(\{|\;)/sx) (\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; $_ = $'; $again = 1;
if($11 eq "{") { if($11 eq "{") {
$level++; $level++;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment