Commit aeb023f3 authored by Patrik Stridvall's avatar Patrik Stridvall Committed by Alexandre Julliard

- Continued on the new C parser.

- More reorganizations and fixes. - API files update.
parent 615c0e0c
package c_function;
use strict;
sub new {
my $proto = shift;
my $class = ref($proto) || $proto;
my $self = {};
bless ($self, $class);
return $self;
}
sub file {
my $self = shift;
my $file = \${$self->{FILE}};
local $_ = shift;
if(defined($_)) { $$file = $_; }
return $$file;
}
sub begin_line {
my $self = shift;
my $begin_line = \${$self->{BEGIN_LINE}};
local $_ = shift;
if(defined($_)) { $$begin_line = $_; }
return $$begin_line;
}
sub begin_column {
my $self = shift;
my $begin_column = \${$self->{BEGIN_COLUMN}};
local $_ = shift;
if(defined($_)) { $$begin_column = $_; }
return $$begin_column;
}
sub end_line {
my $self = shift;
my $end_line = \${$self->{END_LINE}};
local $_ = shift;
if(defined($_)) { $$end_line = $_; }
return $$end_line;
}
sub end_column {
my $self = shift;
my $end_column = \${$self->{END_COLUMN}};
local $_ = shift;
if(defined($_)) { $$end_column = $_; }
return $$end_column;
}
sub linkage {
my $self = shift;
my $linkage = \${$self->{LINKAGE}};
local $_ = shift;
if(defined($_)) { $$linkage = $_; }
return $$linkage;
}
sub return_type {
my $self = shift;
my $return_type = \${$self->{RETURN_TYPE}};
local $_ = shift;
if(defined($_)) { $$return_type = $_; }
return $$return_type;
}
sub calling_convention {
my $self = shift;
my $calling_convention = \${$self->{CALLING_CONVENTION}};
local $_ = shift;
if(defined($_)) { $$calling_convention = $_; }
return $$calling_convention;
}
sub name {
my $self = shift;
my $name = \${$self->{NAME}};
local $_ = shift;
if(defined($_)) { $$name = $_; }
return $$name;
}
sub argument_types {
my $self = shift;
my $argument_types = \${$self->{ARGUMENT_TYPES}};
local $_ = shift;
if(defined($_)) { $$argument_types = $_; }
return $$argument_types;
}
sub argument_names {
my $self = shift;
my $argument_names = \${$self->{ARGUMENT_NAMES}};
local $_ = shift;
if(defined($_)) { $$argument_names = $_; }
return $$argument_names;
}
sub statements_line {
my $self = shift;
my $statements_line = \${$self->{STATEMENTS_LINE}};
local $_ = shift;
if(defined($_)) { $$statements_line = $_; }
return $$statements_line;
}
sub statements_column {
my $self = shift;
my $statements_column = \${$self->{STATEMENTS_COLUMN}};
local $_ = shift;
if(defined($_)) { $$statements_column = $_; }
return $$statements_column;
}
sub statements {
my $self = shift;
my $statements = \${$self->{STATEMENTS}};
local $_ = shift;
if(defined($_)) { $$statements = $_; }
return $$statements;
}
1;
......@@ -51,9 +51,9 @@ sub error {
}
if(defined($tool)) {
$output->write("make_filter: $context: can't parse output: '$current'\n");
$output->write("$directory: $context: can't parse output: '$current'\n");
} else {
$output->write("make_filter: $context: can't parse output: '$current'\n");
$output->write("$directory: $context: can't parse output: '$current'\n");
}
exit 1;
}
......@@ -133,8 +133,12 @@ sub line {
# Nothing
} elsif($tool eq "gcc" && /^(?:In file included |\s*)from (.+?):(\d+)[,:]$/) {
# Nothing
} elsif($tool =~ /^gcc|ld$/ && s/^(.+?\.o(?:\(.*?\))?):\s*//) {
ld_output($1, $_)
} elsif($tool =~ /^gcc|ld$/ && s/^(.+?\.s?o)(?:\(.*?\))?:\s*//) {
$tool = "ld";
ld_output($1, $_);
} elsif($tool =~ /^gcc|ld$/ && s/^collect2:\s*//) {
$tool = "ld";
ld_output("collect2", $_);
} elsif($tool eq "gcc" && s/^(.+?\.[chly]):\s*//) {
gcc_output($1, $_);
} elsif($tool eq "winebuild" && s/^(.+?\.spec):\s*//) {
......@@ -427,13 +431,13 @@ sub gcc_output {
# Nothing
} elsif(/^((?:signed |unsigned )?(?:int|long)) format, (different type|\S+) arg \(arg (\d+)\)$/) {
my $type = $2;
if($type =~ /^
HACCEL|HANDLE|HBITMAP|HBRUSH|HCALL|HCURSOR|HDC|HDRVR|HDESK|
HGDIOBJ|HKL|HGLOBAL|HINSTANCE|HKEY|
if($type =~ /^(?:
HACCEL|HACMDRIVER|HANDLE|HBITMAP|HBRUSH|HCALL|HCURSOR|HDC|HDRVR|HDESK|HDRAWDIB
HGDIOBJ|HKL|HGLOBAL|HIMC|HINSTANCE|HKEY|HLOCAL|
HMENU|HMIDISTRM|HMIDIIN|HMIDIOUT|HMIXER|HMIXEROBJ|HMMIO|HMODULE|
HLINE|HPHONE|HPHONEAPP|
HRASCONN|HRGN|HRSRC|HWAVEIN|HWAVEOUT|HWINSTA|HWND|WSAEVENT|
handle_t|pointer$/x)
HLINE|HPEN|HPHONE|HPHONEAPP|
HRASCONN|HRGN|HRSRC|HWAVEIN|HWAVEOUT|HWINSTA|HWND|
SC_HANDLE|WSAEVENT|handle_t|pointer)$/x)
{
$supress = 1;
} else {
......@@ -580,8 +584,14 @@ sub ld_output {
$file = shift;
local $_ = shift;
if(/^the use of \`(.+?)\' is dangerous, better use \`(.+?)\'$/) {
# nothing
if(0) {
# Nothing
} elsif(/^In function \`(.*?)\':$/) {
$function = $1;
} elsif(0 && /^the use of \`(.+?)\' is dangerous, better use \`(.+?)\'$/) {
# Nothing
} else {
$message = "$_";
}
}
......
......@@ -162,8 +162,13 @@ sub prefix {
my $prefix = \${$self->{PREFIX}};
my $prefix_callback = \${$self->{PREFIX_CALLBACK}};
$$prefix = shift;
$$prefix_callback = undef;
my $new_prefix = shift;
if(defined($new_prefix)) {
$$prefix = $new_prefix;
$$prefix_callback = undef;
} else {
return $$prefix;
}
}
sub prefix_callback {
......
......@@ -16,6 +16,12 @@ use config qw(
use output qw($output);
use winapi_extract_options qw($options);
if($options->progress) {
$output->enable_progress;
} else {
$output->disable_progress;
}
use function;
use type;
use winapi_function;
......@@ -144,9 +150,7 @@ foreach my $file (@c_files) {
my %functions;
$progress_current++;
if($options->progress) {
$output->progress("$file: file $progress_current of $progress_max");
}
$output->progress("$file (file $progress_current of $progress_max)");
my $create_function = sub {
if($options->stub_statistics) {
......@@ -159,19 +163,20 @@ foreach my $file (@c_files) {
my $found_function = sub {
my $function = shift;
my $internal_name = $function->internal_name;
$functions{$internal_name} = $function;
$output->progress("$file (file $progress_current of $progress_max): $internal_name");
$output->prefix_callback(sub { return $function->prefix; });
my $documentation_line = $function->documentation_line;
my $documentation = $function->documentation;
my $function_line = $function->function_line;
my $linkage = $function->linkage;
my $return_type = $function->return_type;
my $calling_convention = $function->calling_convention;
my $internal_name = $function->internal_name;
my $statements = $function->statements;
$functions{$internal_name} = $function;
$output->prefix_callback(sub { return $function->prefix; });
if($options->spec_files) {
documentation_specifications($function);
}
......
......@@ -19,9 +19,14 @@ use config qw(
use output qw($output);
use winapi_fixup_options qw($options);
if($options->progress) {
$output->enable_progress;
} else {
$output->disable_progress;
}
use c_parser;
use type;
use winapi_function;
use winapi_parser;
use winapi_fixup_documentation qw(&fixup_documentation);
use winapi_fixup_editor;
......@@ -39,50 +44,109 @@ foreach my $file (@c_files) {
my $editor = new winapi_fixup_editor($file);
$progress_current++;
if($options->progress) {
$output->progress("$file (file $progress_current of $progress_max)");
$output->progress("$file (file $progress_current of $progress_max)");
$output->prefix("$file:");
{
open(IN, "< $file");
local $/ = undef;
$_ = <IN>;
close(IN);
}
my $parser = new c_parser($file);
my $found_preprocessor = sub {
my $begin_line = shift;
my $begin_column = shift;
my $preprocessor = shift;
my $create_function = sub {
return 'winapi_function'->new;
# $output->write("$begin_line.$begin_column: preprocessor: $preprocessor\n");
return 1;
};
my $found_function = sub {
my $function = shift;
$parser->set_found_preprocessor_callback($found_preprocessor);
my $internal_name = $function->internal_name;
if($options->progress) {
$output->progress("$file (file $progress_current of $progress_max): $internal_name");
}
my $found_comment = sub {
my $begin_line = shift;
my $begin_column = shift;
my $comment = shift;
$output->prefix_callback(sub { return $function->prefix; });
# $output->write("$begin_line.$begin_column: comment: $comment\n");
return 1;
};
$parser->set_found_comment_callback($found_comment);
my $found_declaration = sub {
my $begin_line = shift;
my $begin_column = shift;
my $end_line = shift;
my $end_column = shift;
my $declaration = shift;
# $output->write("$begin_line.$begin_column-$end_line.$end_column: declaration: \\\n$declaration\n");
return 1;
};
$parser->set_found_declaration_callback($found_declaration);
my $function;
my $found_function = sub {
$function = shift;
my $name = $function->name;
my $begin_line = $function->begin_line;
my $begin_column = $function->begin_column;
$output->progress("$file (file $progress_current of $progress_max): $name");
$output->prefix("$file:$begin_line: function $name: ");
# $output->prefix_callback(sub { return $function->prefix; });
if($options->documentation) {
fixup_documentation($function, $editor);
# fixup_documentation($function, $editor);
}
if($options->statements) {
fixup_statements($function, $editor);
}
my $statements = $function->statements;
if(!defined($statements)) {
$function = undef;
$output->prefix("$file: ");
}
$output->prefix("");
};
my $create_type = sub {
return 'type'->new;
return 0;
};
$parser->set_found_function_callback($found_function);
my $found_type = sub {
my $found_variable = sub {
my $begin_line = shift;
my $begin_column = shift;
my $linkage = shift;
my $type = shift;
};
my $name = shift;
my $found_preprocessor = sub {
my $directive = shift;
my $argument = shift;
# $output->write("$begin_line.$begin_column: $linkage $type $name\n");
return 1;
};
&winapi_parser::parse_c_file($file, $create_function, $found_function, $create_type, $found_type, $found_preprocessor);
$parser->set_found_variable_callback($found_variable);
my $line = 1;
my $column = 0;
if(!$parser->parse_c_file(\$_, \$line, \$column)) {
$output->write("can't parse file\n");
}
$output->prefix("");
$editor->flush;
}
......@@ -94,7 +94,7 @@ sub flush {
my $line = $. - $lookahead_count;
foreach my $action (@{$$triggers{$line}}) {
if($. < $action->{end_line}) {
if($. < $action->{end_line}) {
$lookahead = 1;
next LINE;
}
......
......@@ -29,7 +29,7 @@ my %options_long = (
"documentation-ordinal" => { default => 1, parent => "documentation", description => "documentation ordinal fixup" },
"documentation-wrong" => { default => 1, parent => "documentation", description => "documentation wrong fixup" },
"statements" => { default => 1, parent => "local", description => "statements fixup" },
"statements-windowsx" => { default => 1, parent => "local", description => "statements windowsx fixup" },
"statements-windowsx" => { default => 0, parent => "local", description => "statements windowsx fixup" },
"stub" => { default => 0, parent => "local", description => "stub fixup" },
"global" => { default => 1, description => "global fixup" },
......
......@@ -9,10 +9,19 @@ require Exporter;
@EXPORT = qw();
@EXPORT_OK = qw(&fixup_statements);
use config qw($wine_dir);
use options qw($options);
use output qw($output);
use c_parser;
use winapi_module_user qw(
&get_message_result_kind
&get_message_wparam_kind
&get_message_lparam_kind
);
########################################################################
# fixup_function_call
sub fixup_function_call {
my $name = shift;
......@@ -21,37 +30,58 @@ sub fixup_function_call {
return "$name(" . join(", ", @arguments) . ")";
}
########################################################################
# _parse_makelong
sub _parse_makelong {
my $value = shift;
local $_ = shift;
my $low;
my $high;
if($value =~ /^
(?:\(\w+\)\s*)?
MAKE(?:LONG|LPARAM|LRESULT|WPARAM)\s*
\(\s*(.*?)\s*,\s*(.*?)\s*\)$/sx)
my $name;
my @arguments;
my @argument_lines;
my @argument_columns;
my $parser = new c_parser;
my $line = 1;
my $column = 0;
if($parser->parse_c_function_call(\$_, \$line, \$column, \$name, \@arguments, \@argument_lines, \@argument_columns) &&
$name =~ /^MAKE(?:LONG|LPARAM|LRESULT|WPARAM)$/)
{
$low = $1;
$high = $2;
} elsif($value =~ /^(?:\(\w+\)\s*)?0L?$/) {
$low = $arguments[0];
$high = $arguments[1];
} elsif(/^(?:\(\w+\)\s*)?0L?$/) {
$low = "0";
$high = "0";
} else {
$low = "($value) & 0xffff";
$high = "($value) << 16";
$low = "($_) & 0xffff";
$high = "($_) << 16";
}
$low =~ s/^\s*(.*?)\s*$/$1/;
$high =~ s/^\s*(.*?)\s*$/$1/;
return ($low, $high);
}
sub fixup_function_call_2_forward_wm_call {
########################################################################
# fixup_function_call_2_windowsx
sub fixup_user_message_2_windowsx {
my $name = shift;
(my $hwnd, my $msg, my $wparam, my $lparam) = @{(shift)};
if($msg =~ /^(?:WM_BEGINDRAG|WM_ENTERMENULOOP|WM_EXITMENULOOP|WM_HELP|
WM_ISACTIVEICON|WM_LBTRACKPOINT|WM_NEXTMENU)$/x)
if($msg !~ /^WM_/) {
return undef;
} elsif($msg =~ /^(?:WM_BEGINDRAG|WM_ENTERMENULOOP|WM_EXITMENULOOP|WM_HELP|
WM_ISACTIVEICON|WM_LBTRACKPOINT|WM_NEXTMENU)$/x)
{
return undef;
} elsif($msg =~ /^WM_(?:GET|SET)TEXT$/) {
return undef;
}
my $suffix;
......@@ -62,8 +92,8 @@ sub fixup_function_call_2_forward_wm_call {
$suffix = "";
}
$wparam =~ s/^\(WPARAM\)//;
$lparam =~ s/^\(LPARAM\)//;
$wparam =~ s/^\(WPARAM\)\s*//;
$lparam =~ s/^\(LPARAM\)\s*//;
my @arguments;
if(0) {
......@@ -131,67 +161,161 @@ sub fixup_function_call_2_forward_wm_call {
return "FORWARD_" . $msg . "(" . join(", ", @arguments) . ", $name)";
}
########################################################################
# _fixup_user_message
sub _get_messages {
local $_ = shift;
if(/^WM_\w+$/) {
return ($_)
} elsif(/^(.*?)\s*\?\s*(WM_\w+)\s*:\s*(WM_\w+)$/) {
return ($2, $3);
} elsif(/^\w+$/) {
return ();
} else {
$output->write("_fixup_user_message: '$_'\n");
exit 1;
}
}
########################################################################
# _fixup_user_message
sub _fixup_user_message {
my $name = shift;
(my $hwnd, my $msg, my $wparam, my $lparam) = @{(shift)};
my $modified = 0;
my $wkind;
my $lkind;
foreach my $msg (_get_messages($msg)) {
my $new_wkind = &get_message_wparam_kind($msg);
if(defined($wkind) && $new_wkind ne $wkind) {
$output->write("messsages used together do not have the same type\n");
} else {
$wkind = $new_wkind;
}
my $new_lkind = &get_message_lparam_kind($msg);
if(defined($lkind) && $new_lkind ne $lkind) {
$output->write("messsages used together do not have the same type\n");
} else {
$lkind = $new_lkind;
}
}
my @entries = (
[ \$wparam, $wkind, "W", "w" ],
[ \$lparam, $lkind, "L", "l" ]
);
foreach my $entry (@entries) {
(my $refparam, my $kind, my $upper, my $lower) = @$entry;
if(!defined($kind)) {
if($msg =~ /^WM_/) {
$output->write("messsage $msg not defined\n");
}
} elsif($kind eq "ptr") {
if($$refparam =~ /^(\(${upper}PARAM\))?\s*($lower[pP]aram)$/) {
if(defined($1)) {
$$refparam = $2;
$modified = 1;
}
} elsif($$refparam =~ /^(\(${upper}PARAM\))?\s*0$/) {
$$refparam = "(${upper}PARAM) NULL";
$modified = 1;
} elsif($$refparam !~ /^\(${upper}PARAM\)\s*/) {
$$refparam = "(${upper}PARAM) $$refparam";
$modified = 1;
}
} elsif($kind eq "long") {
if($$refparam =~ s/^\(${upper}PARAM\)\s*//) {
$modified = 1;
}
}
}
if($modified) {
my @arguments = ($hwnd, $msg, $wparam, $lparam);
return "$name(" . join(", ", @arguments) . ")";
} else {
return undef;
}
}
########################################################################
# fixup_statements
sub fixup_statements {
my $function = shift;
my $editor = shift;
my $file = $function->file;
my $linkage = $function->linkage;
my $internal_name = $function->internal_name;
my $name = $function->name;
my $statements_line = $function->statements_line;
my $statements_column = $function->statements_column;
my $statements = $function->statements;
if(($linkage eq "extern" && !defined($statements)) ||
($linkage eq "" && !defined($statements)))
{
if(!defined($statements)) {
return;
}
if($options->statements_windowsx && defined($statements)) {
my $found_function_call = sub {
my $begin_line = shift;
my $begin_column = shift;
my $end_line = shift;
my $end_column = shift;
my $name = shift;
my $arguments = shift;
foreach my $argument (@$arguments) {
$argument =~ s/^\s*(.*?)\s*$/$1/;
}
if($options->statements_windowsx &&
$name =~ /^(?:DefWindowProc|SendMessage)[AW]$/ &&
$$arguments[1] =~ /^WM_\w+$/)
{
fixup_replace(\&fixup_function_call_2_forward_wm_call, $editor,
$begin_line, $begin_column, $end_line, $end_column,
$name, $arguments);
} elsif(0) {
$output->write("$begin_line.$begin_column-$end_line.$end_column: " .
"$name(" . join(", ", @$arguments) . ")\n");
}
};
if(0 && $statements_line > 490) {
$output->write("$statements_line: \\\n");
my $line = $statements_line;
my $column = 1;
if(!&c_parser::parse_c_statements(\$statements, \$line, \$column, $found_function_call)) {
$output->write("error: can't parse statements\n");
foreach my $statement (split(/\n/, $statements)) {
$output->write("$line: $statement\n");
$line++;
}
}
}
sub fixup_replace {
my $function = shift;
my $editor = shift;
my $begin_line = shift;
my $begin_column = shift;
my $end_line = shift;
my $end_column = shift;
my $parser = new c_parser($file);
my $found_function_call = sub {
my $begin_line = shift;
my $begin_column = shift;
my $end_line = shift;
my $end_column = shift;
my $name = shift;
my $arguments = shift;
foreach my $argument (@$arguments) {
$argument =~ s/^\s*(.*?)\s*$/$1/;
}
my $replace = &$function(@_);
my $fixup_function_call;
if($name =~ /^(?:DefWindowProc|SendMessage)[AW]$/)
{
if($options->statements_windowsx) {
$fixup_function_call = \&fixup_user_message_2_windowsx;
} else {
$fixup_function_call = \&_fixup_user_message;
}
}
if(defined($fixup_function_call)) {
my $replace = &$fixup_function_call($name, $arguments);
if(defined($replace)) {
$editor->replace($begin_line, $begin_column, $end_line, $end_column, $replace);
if(defined($replace)) {
$editor->replace($begin_line, $begin_column, $end_line, $end_column, $replace);
}
} elsif(0 || $options->debug) {
$output->write("$begin_line.$begin_column-$end_line.$end_column: " .
"$name(" . join(", ", @$arguments) . ")\n");
}
return 0;
};
$parser->set_found_function_call_callback($found_function_call);
my $line = $statements_line;
my $column = 0;
if(!$parser->parse_c_statements(\$statements, \$line, \$column)) {
$output->write("error: can't parse statements\n");
}
}
......
......@@ -70,9 +70,7 @@ sub new {
my $module_file = "$winapi_check_dir/modules.dat";
if($options->progress) {
$output->progress("modules.dat");
}
$output->progress("modules.dat");
my %spec_file_found;
my $allowed_dir;
......
......@@ -36,9 +36,7 @@ sub new {
$configure_in_file =~ s/^\.\///;
$config_h_in_file =~ s/^\.\///;
if($options->progress) {
$output->progress("$api_file");
}
$output->progress("$api_file");
open(IN, "< $api_file");
local $/ = "\n";
......@@ -51,9 +49,7 @@ sub new {
}
close(IN);
if($options->progress) {
$output->progress("$configure_in_file");
}
$output->progress("$configure_in_file");
my $again = 0;
open(IN, "< $configure_in_file");
......@@ -102,9 +98,7 @@ sub new {
}
close(IN);
if($options->progress) {
$output->progress("$config_h_in_file");
}
$output->progress("$config_h_in_file");
open(IN, "< $config_h_in_file");
local $/ = "\n";
......
......@@ -136,8 +136,6 @@ PLARGE_INTEGER
PLONG
PTIMERAPCROUTINE
PULARGE_INTEGER
PVOID
PVOID *
SECURITY_ATTRIBUTES *
SYSLEVEL *
SYSLEVEL **
......
......@@ -66,10 +66,12 @@ LPFONTDESC
LPOCPFIPARAMS
LPPICTDESC
LPSTREAM
LPSYSTEMTIME
LPUNKNOWN
LPUNKNOWN *
LPVOID
LPVOID *
NUMPARSE *
OLECHAR *
OLECHAR **
REFCLSID
......@@ -78,6 +80,7 @@ REFIID
SAFEARRAY *
SAFEARRAY **
SAFEARRAYBOUND *
UDATE *
UINT *
ULONG *
USHORT *
......
......@@ -6,6 +6,7 @@ DWORD
HANDLE
HBITMAP
HDROP
HGLOBAL
HMENU
HICON
HINSTANCE
......
......@@ -43,7 +43,7 @@ POINT *
RECT *
WINDOWPOS *
struct tagCURSORICONINFO *
struct tagWND *
void *
%str
......
......@@ -53,7 +53,6 @@ POINT *
RECT *
TEXTMETRICW *
WINDOWPOS *
WND *
void *
%str
......
......@@ -105,9 +105,7 @@ sub parse_api_file {
my $extension = 0;
my $forbidden = 0;
if($options->progress) {
$output->lazy_progress("$file");
}
$output->lazy_progress("$file");
open(IN, "< $wine_dir/$file") || die "$wine_dir/$file: $!\n";
$/ = "\n";
......@@ -217,9 +215,7 @@ sub parse_spec_file {
my $module;
my $module_file;
if($options->progress) {
$output->lazy_progress("$file");
}
$output->lazy_progress("$file");
open(IN, "< $file") || die "$file: $!\n";
$/ = "\n";
......
......@@ -26,6 +26,13 @@ use config qw(
);
use output qw($output);
use winapi_check_options qw($options);
if($options->progress) {
$output->enable_progress;
} else {
$output->disable_progress;
}
use modules qw($modules);
use nativeapi qw($nativeapi);
use winapi qw($win16api $win32api @winapis);
......@@ -50,9 +57,7 @@ my %include2info;
foreach my $file (@files) {
$progress_current++;
if($options->progress) {
$output->lazy_progress("$file: file $progress_current of $progress_max");
}
$output->lazy_progress("$file: file $progress_current of $progress_max");
my $file_dir = $file;
if(!($file_dir =~ s%(.*?)/[^/]+$%$1%)) {
......@@ -128,9 +133,7 @@ if($options->headers) {
my %functions;
$progress_current++;
if($options->progress) {
$output->progress("$file: file $progress_current of $progress_max");
}
$output->progress("$file: file $progress_current of $progress_max");
my $create_function = sub {
return 'winapi_function'->new;
......@@ -139,11 +142,13 @@ if($options->headers) {
my $found_function = sub {
my $function = shift;
my $internal_name = $function->internal_name;
$output->progress("$file (file $progress_current of $progress_max): $internal_name");
$output->prefix_callback(sub { return $function->prefix; });
my $function_line = $function->function_line;
my $linkage = $function->linkage;
my $internal_name = $function->internal_name;
my $external_name = $function->external_name;
my $statements = $function->statements;
......@@ -200,9 +205,7 @@ foreach my $file (@c_files) {
my $file_module32 = $modules->allowed_modules_in_file("$current_dir/$file");
$progress_current++;
if($options->progress) {
$output->progress("$file: file $progress_current of $progress_max");
}
$output->progress("$file (file $progress_current of $progress_max)");
my $file_dir = $file;
if(!($file_dir =~ s/(.*?)\/[^\/]*$/$1/)) {
......@@ -216,11 +219,12 @@ foreach my $file (@c_files) {
my $found_function = sub {
my $function = shift;
$output->prefix_callback(sub { return $function->prefix; });
my $internal_name = $function->internal_name;
$functions{$internal_name} = $function;
$output->progress("$file (file $progress_current of $progress_max): $internal_name");
$output->prefix_callback(sub { return $function->prefix; });
my $declared_function = $declared_functions{$internal_name};
my $documentation_line = $function->documentation_line;
......
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