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) {
local $_;
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 $module = lc($2);
my $ordinal = $3;
......
......@@ -195,7 +195,6 @@ dlls/odbc32
% dlls/ole32/compobj.spec
dlls/ole32
files
% dlls/ole32/ole2.spec
......@@ -210,7 +209,6 @@ dlls/ole32
% dlls/ole32/ole2nls.spec
dlls/ole32
ole
% dlls/ole32/ole2prox.spec
......
......@@ -76,14 +76,12 @@ sub new {
# 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/) {
......
......@@ -19,7 +19,6 @@ HTASK16 *
IMalloc16 *
LPCLSID
LPDWORD
LPFILETIME
LPMALLOC16 *
LPMESSAGEFILTER
LPMESSAGEFILTER *
......
......@@ -694,6 +694,15 @@ sub function_external_calling_convention {
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}};
......
......@@ -46,7 +46,7 @@ sub parse_c_file {
}
}
$statements = "";
$statements = undef;
};
my $function_end = sub {
&$function_found_callback($line_number,$debug_channels,$documentation,$linkage,$return_type,
......@@ -55,6 +55,7 @@ sub parse_c_file {
$function = "";
};
my %regs_entrypoints;
my @comment_lines = ();
my @comments = ();
my $level = 0;
my $extern_c = 0;
......@@ -72,11 +73,11 @@ sub parse_c_file {
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 @@ sub parse_c_file {
}
# 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 @@ sub parse_c_file {
next;
}
my $documentation_line;
my $documentation;
my @argument_documentations = ();
{
......@@ -137,7 +144,11 @@ sub parse_c_file {
}
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 @@ sub parse_c_file {
}
}
if(!defined($statements)) {
$statements = "";
}
if($line !~ /^\s*$/) {
$statements .= "$line\n";
}
......@@ -223,10 +238,14 @@ sub parse_c_file {
((__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++;
}
......
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