- Slightly better handling of external/internal names.
- Minor bug fixes. - Minor API files update.
This commit is contained in:
parent
163652b3f6
commit
20ca00113b
|
@ -344,7 +344,6 @@ controls
|
||||||
dlls/kernel
|
dlls/kernel
|
||||||
dlls/user
|
dlls/user
|
||||||
memory
|
memory
|
||||||
misc
|
|
||||||
windows
|
windows
|
||||||
|
|
||||||
% dlls/user/user32.spec
|
% dlls/user/user32.spec
|
||||||
|
@ -352,7 +351,6 @@ windows
|
||||||
controls
|
controls
|
||||||
dlls/user
|
dlls/user
|
||||||
loader
|
loader
|
||||||
misc
|
|
||||||
windows
|
windows
|
||||||
|
|
||||||
% dlls/version/ver.spec
|
% dlls/version/ver.spec
|
||||||
|
|
|
@ -13,6 +13,8 @@ _lwp_exit
|
||||||
_lwp_makecontext
|
_lwp_makecontext
|
||||||
_lxstat
|
_lxstat
|
||||||
_sysconf
|
_sysconf
|
||||||
|
_tolower
|
||||||
|
_toupper
|
||||||
_xmknod
|
_xmknod
|
||||||
_xstat
|
_xstat
|
||||||
abs
|
abs
|
||||||
|
@ -242,6 +244,7 @@ tolower
|
||||||
toupper
|
toupper
|
||||||
towlower
|
towlower
|
||||||
towupper
|
towupper
|
||||||
|
tzset
|
||||||
unlink
|
unlink
|
||||||
usleep
|
usleep
|
||||||
utime
|
utime
|
||||||
|
|
|
@ -78,7 +78,7 @@ sub begin_if {
|
||||||
}
|
}
|
||||||
} elsif(/^(\w+)\s*(<|<=|==|!=|>=|>)\s*(\w+)\s*((\&\&|\|\|)\s*)?/) {
|
} elsif(/^(\w+)\s*(<|<=|==|!=|>=|>)\s*(\w+)\s*((\&\&|\|\|)\s*)?/) {
|
||||||
$_ = $';
|
$_ = $';
|
||||||
} elsif(/^(\w+)\s*$/) {
|
} elsif(/^(!)?(\w+)\s*$/) {
|
||||||
$_ = $';
|
$_ = $';
|
||||||
} elsif(/^\(|\)/) {
|
} elsif(/^\(|\)/) {
|
||||||
$_ = $';
|
$_ = $';
|
||||||
|
|
|
@ -17,6 +17,7 @@ CLSID *
|
||||||
LONG *
|
LONG *
|
||||||
LPBITMAPINFOHEADER
|
LPBITMAPINFOHEADER
|
||||||
LPCLSID
|
LPCLSID
|
||||||
|
LPLONG
|
||||||
LPVOID
|
LPVOID
|
||||||
PAVIFILE
|
PAVIFILE
|
||||||
PAVIFILE *
|
PAVIFILE *
|
||||||
|
@ -31,3 +32,7 @@ LPCSTR
|
||||||
%void
|
%void
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
||||||
|
%wstr
|
||||||
|
|
||||||
|
LPCWSTR
|
|
@ -1,7 +1,6 @@
|
||||||
%long
|
%long
|
||||||
|
|
||||||
int
|
int
|
||||||
size_t
|
|
||||||
|
|
||||||
%ptr
|
%ptr
|
||||||
|
|
||||||
|
|
|
@ -5,17 +5,16 @@ double
|
||||||
%long
|
%long
|
||||||
|
|
||||||
DWORD
|
DWORD
|
||||||
HANDLE
|
|
||||||
INT
|
INT
|
||||||
LONG
|
LONG
|
||||||
MSVCRT_clock_t
|
MSVCRT_clock_t
|
||||||
MSVCRT_complex
|
MSVCRT_complex
|
||||||
MSVCRT_size_t
|
MSVCRT_size_t
|
||||||
MSVCRT_time_t
|
MSVCRT_time_t
|
||||||
ULONG
|
|
||||||
WCHAR
|
WCHAR
|
||||||
int
|
int
|
||||||
long
|
long
|
||||||
|
size_t
|
||||||
unsigned int
|
unsigned int
|
||||||
unsigned long
|
unsigned long
|
||||||
|
|
||||||
|
@ -73,10 +72,10 @@ unsigned int *
|
||||||
va_list
|
va_list
|
||||||
void *
|
void *
|
||||||
|
|
||||||
%str
|
%ptr --extension
|
||||||
|
|
||||||
LPSTR
|
_beginthread_start_routine_t
|
||||||
LPCSTR
|
_beginthreadex_start_routine_t
|
||||||
|
|
||||||
%unknown
|
%unknown
|
||||||
|
|
||||||
|
@ -87,8 +86,3 @@ MSVCRT_ldiv_t
|
||||||
|
|
||||||
void
|
void
|
||||||
VOID
|
VOID
|
||||||
|
|
||||||
%wstr
|
|
||||||
|
|
||||||
LPCWSTR
|
|
||||||
LPWSTR
|
|
||||||
|
|
|
@ -14,7 +14,6 @@ HWND
|
||||||
INT
|
INT
|
||||||
UINT
|
UINT
|
||||||
ULONG
|
ULONG
|
||||||
WORD
|
|
||||||
|
|
||||||
%long # --forbidden
|
%long # --forbidden
|
||||||
|
|
||||||
|
@ -52,7 +51,6 @@ LPDROPTARGET
|
||||||
LPDWORD
|
LPDWORD
|
||||||
LPENUMFORMATETC *
|
LPENUMFORMATETC *
|
||||||
LPENUMOLEVERB *
|
LPENUMOLEVERB *
|
||||||
LPFILETIME
|
|
||||||
LPFORMATETC
|
LPFORMATETC
|
||||||
LPGUID
|
LPGUID
|
||||||
LPLOCKBYTES *
|
LPLOCKBYTES *
|
||||||
|
@ -77,7 +75,6 @@ LPUNKNOWN
|
||||||
LPUNKNOWN *
|
LPUNKNOWN *
|
||||||
LPVOID
|
LPVOID
|
||||||
LPVOID *
|
LPVOID *
|
||||||
LPWORD
|
|
||||||
LPSTORAGE
|
LPSTORAGE
|
||||||
LPSTREAM *
|
LPSTREAM *
|
||||||
MULTI_QI *
|
MULTI_QI *
|
||||||
|
|
|
@ -19,7 +19,6 @@ LONG
|
||||||
LRESULT
|
LRESULT
|
||||||
UINT
|
UINT
|
||||||
ULONG
|
ULONG
|
||||||
WCHAR
|
|
||||||
WORD
|
WORD
|
||||||
WPARAM
|
WPARAM
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
%long
|
|
||||||
|
|
||||||
DWORD
|
|
||||||
|
|
||||||
%long # --forbidden
|
%long # --forbidden
|
||||||
|
|
||||||
HTASK16
|
HTASK16
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
%long
|
|
||||||
|
|
||||||
BOOL
|
|
||||||
DWORD
|
|
||||||
HANDLE
|
|
||||||
WORD
|
|
||||||
WOW_HANDLE_TYPE
|
|
||||||
|
|
||||||
%ptr
|
|
||||||
|
|
||||||
LPDWORD
|
|
||||||
LPVOID
|
|
||||||
PDWORD
|
|
||||||
WORD *
|
|
|
@ -1,48 +1,26 @@
|
||||||
%long
|
%long
|
||||||
|
|
||||||
BOOL
|
|
||||||
DWORD
|
DWORD
|
||||||
HANDLE
|
|
||||||
HWND
|
|
||||||
INT
|
INT
|
||||||
LONG
|
|
||||||
UINT
|
|
||||||
SOCKET
|
SOCKET
|
||||||
u_long
|
|
||||||
u_short
|
|
||||||
|
|
||||||
%long # --forbidden
|
%long # --forbidden
|
||||||
|
|
||||||
SOCKET16
|
|
||||||
long
|
long
|
||||||
|
|
||||||
%ptr
|
%ptr
|
||||||
|
|
||||||
FARPROC
|
|
||||||
INT *
|
INT *
|
||||||
LPDWORD
|
LPDWORD
|
||||||
LPINT
|
LPINT
|
||||||
LPVOID
|
LPVOID
|
||||||
LPWSADATA
|
|
||||||
ULONG *
|
|
||||||
WIN_hostent *
|
|
||||||
WIN_protoent *
|
|
||||||
WIN_servent *
|
|
||||||
char *
|
char *
|
||||||
struct netent *
|
struct netent *
|
||||||
struct sockaddr *
|
|
||||||
struct timeval *
|
|
||||||
ws_fd_set32 *
|
|
||||||
|
|
||||||
%str
|
%str
|
||||||
|
|
||||||
LPCSTR
|
LPCSTR
|
||||||
LPSTR
|
|
||||||
|
|
||||||
%void
|
%void
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
||||||
%unknown
|
|
||||||
|
|
||||||
struct in_addr
|
|
|
@ -228,14 +228,18 @@ sub parse_spec_file {
|
||||||
|
|
||||||
my $options = \${$self->{OPTIONS}};
|
my $options = \${$self->{OPTIONS}};
|
||||||
my $output = \${$self->{OUTPUT}};
|
my $output = \${$self->{OUTPUT}};
|
||||||
my $function_arguments = \%{$self->{FUNCTION_ARGUMENTS}};
|
my $function_internal_arguments = \%{$self->{FUNCTION_INTERNAL_ARGUMENTS}};
|
||||||
my $function_ordinal = \%{$self->{FUNCTION_ORDINAL}};
|
my $function_external_arguments = \%{$self->{FUNCTION_EXTERNAL_ARGUMENTS}};
|
||||||
my $function_calling_convention = \%{$self->{FUNCTION_CALLING_CONVENTION}};
|
my $function_internal_ordinal = \%{$self->{FUNCTION_INTERNAL_ORDINAL}};
|
||||||
|
my $function_external_ordinal = \%{$self->{FUNCTION_EXTERNAL_ORDINAL}};
|
||||||
|
my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
|
||||||
|
my $function_external_calling_convention = \%{$self->{FUNCTION_EXTERNAL_CALLING_CONVENTION}};
|
||||||
my $function_internal_name = \%{$self->{FUNCTION_INTERNAL_NAME}};
|
my $function_internal_name = \%{$self->{FUNCTION_INTERNAL_NAME}};
|
||||||
my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}};
|
my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}};
|
||||||
my $function_stub = \%{$self->{FUNCTION_STUB}};
|
my $function_stub = \%{$self->{FUNCTION_STUB}};
|
||||||
my $function_forward = \%{$self->{FUNCTION_FORWARD}};
|
my $function_forward = \%{$self->{FUNCTION_FORWARD}};
|
||||||
my $function_module = \%{$self->{FUNCTION_MODULE}};
|
my $function_internal_module = \%{$self->{FUNCTION_INTERNAL_MODULE}};
|
||||||
|
my $function_external_module = \%{$self->{FUNCTION_EXTERNAL_MODULE}};
|
||||||
my $modules = \%{$self->{MODULES}};
|
my $modules = \%{$self->{MODULES}};
|
||||||
my $module_files = \%{$self->{MODULE_FILES}};
|
my $module_files = \%{$self->{MODULE_FILES}};
|
||||||
|
|
||||||
|
@ -283,18 +287,29 @@ sub parse_spec_file {
|
||||||
# FIXME: Internal name existing more than once not handled properly
|
# FIXME: Internal name existing more than once not handled properly
|
||||||
$$function_internal_name{$external_name} = $internal_name;
|
$$function_internal_name{$external_name} = $internal_name;
|
||||||
$$function_external_name{$internal_name} = $external_name;
|
$$function_external_name{$internal_name} = $external_name;
|
||||||
$$function_arguments{$internal_name} = $arguments;
|
$$function_internal_arguments{$internal_name} = $arguments;
|
||||||
$$function_ordinal{$internal_name} = $ordinal;
|
$$function_external_arguments{$external_name} = $arguments;
|
||||||
$$function_calling_convention{$internal_name} = $calling_convention;
|
$$function_internal_ordinal{$internal_name} = $ordinal;
|
||||||
if(!$$function_module{$internal_name}) {
|
$$function_external_ordinal{$external_name} = $ordinal;
|
||||||
$$function_module{$internal_name} = "$module";
|
$$function_internal_calling_convention{$internal_name} = $calling_convention;
|
||||||
} elsif($$function_module{$internal_name} !~ /$module/) {
|
$$function_external_calling_convention{$external_name} = $calling_convention;
|
||||||
|
if(!$$function_internal_module{$internal_name}) {
|
||||||
|
$$function_internal_module{$internal_name} = "$module";
|
||||||
|
} elsif($$function_internal_module{$internal_name} !~ /$module/) {
|
||||||
if(0) {
|
if(0) {
|
||||||
$$output->write("$file: $external_name: the internal function ($internal_name) " .
|
$$output->write("$file: $external_name: the internal function ($internal_name) " .
|
||||||
"already belongs to a module ($$function_module{$internal_name})\n");
|
"already belongs to a module ($$function_internal_module{$internal_name})\n");
|
||||||
}
|
}
|
||||||
$$function_module{$internal_name} .= " & $module";
|
$$function_internal_module{$internal_name} .= " & $module";
|
||||||
|
}
|
||||||
|
if(!$$function_external_module{$external_name}) {
|
||||||
|
$$function_external_module{$external_name} = "$module";
|
||||||
|
} elsif($$function_external_module{$external_name} !~ /$module/) {
|
||||||
|
if(0) {
|
||||||
|
$$output->write("$file: $internal_name: the external function ($external_name) " .
|
||||||
|
"already belongs to a module ($$function_external_module{$external_name})\n");
|
||||||
|
}
|
||||||
|
$$function_external_module{$external_name} .= " & $module";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(0 && $$options->spec_mismatch) {
|
if(0 && $$options->spec_mismatch) {
|
||||||
|
@ -346,10 +361,17 @@ sub parse_spec_file {
|
||||||
|
|
||||||
# FIXME: Internal name existing more than once not handled properly
|
# FIXME: Internal name existing more than once not handled properly
|
||||||
$$function_stub{$internal_name} = 1;
|
$$function_stub{$internal_name} = 1;
|
||||||
if(!$$function_module{$internal_name}) {
|
$$function_internal_ordinal{$internal_name} = $ordinal;
|
||||||
$$function_module{$internal_name} = "$module";
|
$$function_external_ordinal{$external_name} = $ordinal;
|
||||||
} elsif($$function_module{$internal_name} !~ /$module/) {
|
if(!$$function_internal_module{$internal_name}) {
|
||||||
$$function_module{$internal_name} .= " & $module";
|
$$function_internal_module{$internal_name} = "$module";
|
||||||
|
} elsif($$function_internal_module{$internal_name} !~ /$module/) {
|
||||||
|
$$function_internal_module{$internal_name} .= " & $module";
|
||||||
|
}
|
||||||
|
if(!$$function_external_module{$external_name}) {
|
||||||
|
$$function_external_module{$external_name} = "$module";
|
||||||
|
} elsif($$function_external_module{$external_name} !~ /$module/) {
|
||||||
|
$$function_external_module{$external_name} .= " & $module";
|
||||||
}
|
}
|
||||||
} elsif(/^(\d+|@)\s+forward(?:\s+(?:-noimport|-norelay|-i386|-ret64))?\s+(\S+)\s+(\S+)\.(\S+)$/) {
|
} elsif(/^(\d+|@)\s+forward(?:\s+(?:-noimport|-norelay|-i386|-ret64))?\s+(\S+)\s+(\S+)\.(\S+)$/) {
|
||||||
$ordinal = $1;
|
$ordinal = $1;
|
||||||
|
@ -381,11 +403,8 @@ sub parse_spec_file {
|
||||||
close(IN);
|
close(IN);
|
||||||
|
|
||||||
$$modules{$module}++;
|
$$modules{$module}++;
|
||||||
if(defined($module_file)) {
|
|
||||||
$$module_files{$module} = $module_file;
|
$$module_files{$module} = $file;
|
||||||
} else {
|
|
||||||
$$module_files{$module} = "$module.drv";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub name {
|
sub name {
|
||||||
|
@ -584,23 +603,23 @@ sub module_file {
|
||||||
return $$module_files{$module};
|
return $$module_files{$module};
|
||||||
}
|
}
|
||||||
|
|
||||||
sub all_functions {
|
sub all_internal_functions {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $function_calling_convention = \%{$self->{FUNCTION_CALLING_CONVENTION}};
|
my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
|
||||||
|
|
||||||
return sort(keys(%$function_calling_convention));
|
return sort(keys(%$function_internal_calling_convention));
|
||||||
}
|
}
|
||||||
|
|
||||||
sub all_functions_in_module {
|
sub all_internal_functions_in_module {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $function_calling_convention = \%{$self->{FUNCTION_CALLING_CONVENTION}};
|
my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
|
||||||
my $function_module = \%{$self->{FUNCTION_MODULE}};
|
my $function_internal_module = \%{$self->{FUNCTION_INTERNAL_MODULE}};
|
||||||
|
|
||||||
my $module = shift;
|
my $module = shift;
|
||||||
|
|
||||||
my @names;
|
my @names;
|
||||||
foreach my $name (keys(%$function_calling_convention)) {
|
foreach my $name (keys(%$function_internal_calling_convention)) {
|
||||||
if($$function_module{$name} eq $module) {
|
if($$function_internal_module{$name} eq $module) {
|
||||||
push @names, $name;
|
push @names, $name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -615,29 +634,47 @@ sub all_functions_stub {
|
||||||
return sort(keys(%$function_stub));
|
return sort(keys(%$function_stub));
|
||||||
}
|
}
|
||||||
|
|
||||||
sub all_functions_found {
|
sub all_internal_functions_found {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $function_found = \%{$self->{FUNCTION_FOUND}};
|
my $function_found = \%{$self->{FUNCTION_FOUND}};
|
||||||
|
|
||||||
return sort(keys(%$function_found));
|
return sort(keys(%$function_found));
|
||||||
}
|
}
|
||||||
|
|
||||||
sub function_ordinal {
|
sub function_internal_ordinal {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $function_ordinal = \%{$self->{FUNCTION_ORDINAL}};
|
my $function_internal_ordinal = \%{$self->{FUNCTION_INTERNAL_ORDINAL}};
|
||||||
|
|
||||||
my $name = shift;
|
my $name = shift;
|
||||||
|
|
||||||
return $$function_ordinal{$name};
|
return $$function_internal_ordinal{$name};
|
||||||
}
|
}
|
||||||
|
|
||||||
sub function_calling_convention {
|
sub function_external_ordinal {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $function_calling_convention = \%{$self->{FUNCTION_CALLING_CONVENTION}};
|
my $function_external_ordinal = \%{$self->{FUNCTION_EXTERNAL_ORDINAL}};
|
||||||
|
|
||||||
my $name = shift;
|
my $name = shift;
|
||||||
|
|
||||||
return $$function_calling_convention{$name};
|
return $$function_external_ordinal{$name};
|
||||||
|
}
|
||||||
|
|
||||||
|
sub function_internal_calling_convention {
|
||||||
|
my $self = shift;
|
||||||
|
my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
|
||||||
|
|
||||||
|
my $name = shift;
|
||||||
|
|
||||||
|
return $$function_internal_calling_convention{$name};
|
||||||
|
}
|
||||||
|
|
||||||
|
sub function_external_calling_convention {
|
||||||
|
my $self = shift;
|
||||||
|
my $function_external_calling_convention = \%{$self->{FUNCTION_EXTERNAL_CALLING_CONVENTION}};
|
||||||
|
|
||||||
|
my $name = shift;
|
||||||
|
|
||||||
|
return $$function_external_calling_convention{$name};
|
||||||
}
|
}
|
||||||
|
|
||||||
sub function_external_name {
|
sub function_external_name {
|
||||||
|
@ -651,11 +688,11 @@ sub function_external_name {
|
||||||
|
|
||||||
sub is_function {
|
sub is_function {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $function_calling_convention = \%{$self->{FUNCTION_CALLING_CONVENTION}};
|
my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
|
||||||
|
|
||||||
my $name = shift;
|
my $name = shift;
|
||||||
|
|
||||||
return $$function_calling_convention{$name};
|
return $$function_internal_calling_convention{$name};
|
||||||
}
|
}
|
||||||
|
|
||||||
sub is_shared_function {
|
sub is_shared_function {
|
||||||
|
@ -676,22 +713,40 @@ sub found_shared_function {
|
||||||
$$function_shared{$name} = 1;
|
$$function_shared{$name} = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub function_arguments {
|
sub function_internal_arguments {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $function_arguments = \%{$self->{FUNCTION_ARGUMENTS}};
|
my $function_internal_arguments = \%{$self->{FUNCTION_INTERNAL_ARGUMENTS}};
|
||||||
|
|
||||||
my $name = shift;
|
my $name = shift;
|
||||||
|
|
||||||
return $$function_arguments{$name};
|
return $$function_internal_arguments{$name};
|
||||||
}
|
}
|
||||||
|
|
||||||
sub function_module {
|
sub function_external_arguments {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $function_module = \%{$self->{FUNCTION_MODULE}};
|
my $function_external_arguments = \%{$self->{FUNCTION_EXTERNAL_ARGUMENTS}};
|
||||||
|
|
||||||
my $name = shift;
|
my $name = shift;
|
||||||
|
|
||||||
return $$function_module{$name};
|
return $$function_external_arguments{$name};
|
||||||
|
}
|
||||||
|
|
||||||
|
sub function_internal_module {
|
||||||
|
my $self = shift;
|
||||||
|
my $function_internal_module = \%{$self->{FUNCTION_INTERNAL_MODULE}};
|
||||||
|
|
||||||
|
my $name = shift;
|
||||||
|
|
||||||
|
return $$function_internal_module{$name};
|
||||||
|
}
|
||||||
|
|
||||||
|
sub function_external_module {
|
||||||
|
my $self = shift;
|
||||||
|
my $function_external_module = \%{$self->{FUNCTION_EXTERNAL_MODULE}};
|
||||||
|
|
||||||
|
my $name = shift;
|
||||||
|
|
||||||
|
return $$function_external_module{$name};
|
||||||
}
|
}
|
||||||
|
|
||||||
sub function_stub {
|
sub function_stub {
|
||||||
|
@ -703,7 +758,7 @@ sub function_stub {
|
||||||
return $$function_stub{$name};
|
return $$function_stub{$name};
|
||||||
}
|
}
|
||||||
|
|
||||||
sub found_function {
|
sub found_internal_function {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $function_found = \%{$self->{FUNCTION_FOUND}};
|
my $function_found = \%{$self->{FUNCTION_FOUND}};
|
||||||
|
|
||||||
|
@ -712,7 +767,7 @@ sub found_function {
|
||||||
$$function_found{$name}++;
|
$$function_found{$name}++;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub function_found {
|
sub internal_function_found {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $function_found = \%{$self->{FUNCTION_FOUND}};
|
my $function_found = \%{$self->{FUNCTION_FOUND}};
|
||||||
|
|
||||||
|
|
|
@ -154,16 +154,16 @@ if($options->global) {
|
||||||
|
|
||||||
my $nativeapi = 'nativeapi'->new($options, $output, "$winapi_check_dir/nativeapi.dat", "$wine_dir/configure.in", "$wine_dir/include/config.h.in");
|
my $nativeapi = 'nativeapi'->new($options, $output, "$winapi_check_dir/nativeapi.dat", "$wine_dir/configure.in", "$wine_dir/include/config.h.in");
|
||||||
|
|
||||||
for my $name ($win32api->all_functions) {
|
for my $internal_name ($win32api->all_internal_functions) {
|
||||||
my $module16 = $win16api->function_module($name);
|
my $module16 = $win16api->function_internal_module($internal_name);
|
||||||
my $module32 = $win32api->function_module($name);
|
my $module32 = $win32api->function_internal_module($internal_name);
|
||||||
|
|
||||||
if(defined($module16)) {
|
if(defined($module16)) {
|
||||||
$win16api->found_shared_function($name);
|
$win16api->found_shared_function($internal_name);
|
||||||
$win32api->found_shared_function($name);
|
$win32api->found_shared_function($internal_name);
|
||||||
|
|
||||||
if($options->shared) {
|
if($options->shared) {
|
||||||
$output->write("*.spec: $name: is shared between $module16 (Win16) and $module32 (Win32)\n");
|
$output->write("*.spec: $internal_name: is shared between $module16 (Win16) and $module32 (Win32)\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -246,7 +246,7 @@ if($options->headers) {
|
||||||
my $statements = shift;
|
my $statements = shift;
|
||||||
|
|
||||||
foreach my $winapi (@winapis) {
|
foreach my $winapi (@winapis) {
|
||||||
my $module = $winapi->function_module($internal_name);
|
my $module = $winapi->function_internal_module($internal_name);
|
||||||
if(!defined($module)) { next }
|
if(!defined($module)) { next }
|
||||||
|
|
||||||
my $external_name = $winapi->function_external_name($internal_name);
|
my $external_name = $winapi->function_external_name($internal_name);
|
||||||
|
@ -341,13 +341,13 @@ foreach my $file (@c_files) {
|
||||||
$win32api->found_type($argument) if $options->win32;
|
$win32api->found_type($argument) if $options->win32;
|
||||||
}
|
}
|
||||||
|
|
||||||
$win16api->found_function($internal_name) if $options->win16;
|
$win16api->found_internal_function($internal_name) if $options->win16;
|
||||||
$win32api->found_function($internal_name) if $options->win32;
|
$win32api->found_internal_function($internal_name) if $options->win32;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($file_type ne "application") {
|
if($file_type ne "application") {
|
||||||
my $module16 = $win16api->function_module($internal_name);
|
my $module16 = $win16api->function_internal_module($internal_name);
|
||||||
my $module32 = $win32api->function_module($internal_name);
|
my $module32 = $win32api->function_internal_module($internal_name);
|
||||||
|
|
||||||
if(defined($module16)) {
|
if(defined($module16)) {
|
||||||
$modules->found_module_in_dir($module16, $file_dir);
|
$modules->found_module_in_dir($module16, $file_dir);
|
||||||
|
@ -636,9 +636,9 @@ if($options->global) {
|
||||||
my %module_stub_count16;
|
my %module_stub_count16;
|
||||||
my %module_total_count16;
|
my %module_total_count16;
|
||||||
|
|
||||||
foreach my $name ($win16api->all_functions,$win16api->all_functions_stub) {
|
foreach my $internal_name ($win16api->all_internal_functions,$win16api->all_functions_stub) {
|
||||||
foreach my $module (split(/ \& /, $win16api->function_module($name))) {
|
foreach my $module (split(/ \& /, $win16api->function_internal_module($internal_name))) {
|
||||||
if($win16api->function_stub($name)) {
|
if($win16api->function_stub($internal_name)) {
|
||||||
$module_stub_count16{$module}++;
|
$module_stub_count16{$module}++;
|
||||||
}
|
}
|
||||||
$module_total_count16{$module}++;
|
$module_total_count16{$module}++;
|
||||||
|
@ -668,9 +668,9 @@ if($options->global) {
|
||||||
my %module_stub_count32;
|
my %module_stub_count32;
|
||||||
my %module_total_count32;
|
my %module_total_count32;
|
||||||
|
|
||||||
foreach my $name ($win32api->all_functions,$win32api->all_functions_stub) {
|
foreach my $internal_name ($win32api->all_internal_functions,$win32api->all_functions_stub) {
|
||||||
foreach my $module (split(/ \& /, $win32api->function_module($name))) {
|
foreach my $module (split(/ \& /, $win32api->function_internal_module($internal_name))) {
|
||||||
if($win32api->function_stub($name)) {
|
if($win32api->function_stub($internal_name)) {
|
||||||
$module_stub_count32{$module}++;
|
$module_stub_count32{$module}++;
|
||||||
}
|
}
|
||||||
$module_total_count32{$module}++;
|
$module_total_count32{$module}++;
|
||||||
|
|
|
@ -75,7 +75,7 @@ sub check_documentation {
|
||||||
$external_name = $internal_name;
|
$external_name = $internal_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($options->documentation_pedantic) {
|
if($options->documentation_name) {
|
||||||
my $n = 0;
|
my $n = 0;
|
||||||
if((++$n && defined($module16) && defined($external_name16) &&
|
if((++$n && defined($module16) && defined($external_name16) &&
|
||||||
$external_name16 ne "@" && $documentation !~ /\b\Q$external_name16\E\b/) ||
|
$external_name16 ne "@" && $documentation !~ /\b\Q$external_name16\E\b/) ||
|
||||||
|
@ -87,17 +87,15 @@ sub check_documentation {
|
||||||
$external_name32 eq "@" && $documentation !~ /\@/))
|
$external_name32 eq "@" && $documentation !~ /\@/))
|
||||||
{
|
{
|
||||||
my $external_name = ($external_name16, $external_name32)[($n-1)/2];
|
my $external_name = ($external_name16, $external_name32)[($n-1)/2];
|
||||||
|
if($options->documentation_pedantic || $documentation !~ /\b(?:$internal_name|$name1|$name2)\b/) {
|
||||||
$output->write("documentation: wrong or missing name ($external_name) \\\n$documentation\n");
|
$output->write("documentation: wrong or missing name ($external_name) \\\n$documentation\n");
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if($documentation !~ /\b(?:\Q$external_name\E|$internal_name|$name1|$name2)\b/) {
|
|
||||||
$output->write("documentation: wrong or missing name \\\n$documentation\n");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($options->documentation_ordinal) {
|
if($options->documentation_ordinal) {
|
||||||
if(defined($module16)) {
|
if(defined($module16)) {
|
||||||
my $ordinal16 = $win16api->function_ordinal($internal_name);
|
my $ordinal16 = $win16api->function_internal_ordinal($internal_name);
|
||||||
|
|
||||||
if(!defined($ordinal16)) {
|
if(!defined($ordinal16)) {
|
||||||
$output->write("function have no ordinal\n");
|
$output->write("function have no ordinal\n");
|
||||||
|
@ -112,7 +110,7 @@ sub check_documentation {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(defined($module32)) {
|
if(defined($module32)) {
|
||||||
my $ordinal32 = $win32api->function_ordinal($internal_name);
|
my $ordinal32 = $win32api->function_internal_ordinal($internal_name);
|
||||||
|
|
||||||
if(!defined($ordinal32)) {
|
if(!defined($ordinal32)) {
|
||||||
$output->write("function have no ordinal\n");
|
$output->write("function have no ordinal\n");
|
||||||
|
@ -129,7 +127,7 @@ sub check_documentation {
|
||||||
}
|
}
|
||||||
|
|
||||||
if($options->documentation_pedantic) {
|
if($options->documentation_pedantic) {
|
||||||
my $ordinal = $win16api->function_ordinal($internal_name);
|
my $ordinal = $win16api->function_internal_ordinal($internal_name);
|
||||||
if(defined($ordinal) && $documentation !~ /^ \*\s+(?:\@|\w+)(?:\s+[\(\[]\w+\.(?:\@|\d+)[\)\]])+/m) {
|
if(defined($ordinal) && $documentation !~ /^ \*\s+(?:\@|\w+)(?:\s+[\(\[]\w+\.(?:\@|\d+)[\)\]])+/m) {
|
||||||
$output->write("documentation: pedantic check failed \\\n$documentation\n");
|
$output->write("documentation: pedantic check failed \\\n$documentation\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,11 +20,11 @@ sub check {
|
||||||
}
|
}
|
||||||
|
|
||||||
if($options->declared) {
|
if($options->declared) {
|
||||||
foreach my $name ($winapi->all_functions) {
|
foreach my $internal_name ($winapi->all_internal_functions) {
|
||||||
if(!$winapi->function_found($name) && !$nativeapi->is_function($name)) {
|
if(!$winapi->internal_function_found($internal_name) && !$nativeapi->is_function($internal_name)) {
|
||||||
my $module = $winapi->function_module($name);
|
my $module = $winapi->function_internal_module($internal_name);
|
||||||
$output->write("*.c: $module: $name: ");
|
$output->write("*.c: $module: $internal_name: ");
|
||||||
$output->write("function declared but not implemented: " . $winapi->function_arguments($name) . "\n");
|
$output->write("function declared but not implemented: " . $winapi->function_internal_arguments($internal_name) . "\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ sub check_function {
|
||||||
my $nativeapi = shift;
|
my $nativeapi = shift;
|
||||||
my $winapi = shift;
|
my $winapi = shift;
|
||||||
|
|
||||||
my $module = $winapi->function_module($internal_name);
|
my $module = $winapi->function_internal_module($internal_name);
|
||||||
|
|
||||||
if($winapi->name eq "win16") {
|
if($winapi->name eq "win16") {
|
||||||
if($winapi->function_stub($internal_name)) {
|
if($winapi->function_stub($internal_name)) {
|
||||||
|
@ -89,8 +89,8 @@ sub check_function {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
my $declared_calling_convention = $winapi->function_calling_convention($internal_name);
|
my $declared_calling_convention = $winapi->function_internal_calling_convention($internal_name);
|
||||||
my @declared_argument_kinds = split(/\s+/, $winapi->function_arguments($internal_name));
|
my @declared_argument_kinds = split(/\s+/, $winapi->function_internal_arguments($internal_name));
|
||||||
|
|
||||||
if($declared_calling_convention =~ /^register|interrupt$/) {
|
if($declared_calling_convention =~ /^register|interrupt$/) {
|
||||||
push @declared_argument_kinds, "ptr";
|
push @declared_argument_kinds, "ptr";
|
||||||
|
@ -122,8 +122,12 @@ sub check_function {
|
||||||
$output->write("function not implemented as vararg\n");
|
$output->write("function not implemented as vararg\n");
|
||||||
}
|
}
|
||||||
} elsif($#argument_types != -1 && $argument_types[$#argument_types] eq "...") {
|
} elsif($#argument_types != -1 && $argument_types[$#argument_types] eq "...") {
|
||||||
|
if($#argument_types == 0) {
|
||||||
|
pop @argument_types;
|
||||||
|
} else {
|
||||||
$output->write("function not declared as vararg\n");
|
$output->write("function not declared as vararg\n");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if($#argument_types != -1 && $argument_types[$#argument_types] eq "CONTEXT *" &&
|
if($#argument_types != -1 && $argument_types[$#argument_types] eq "CONTEXT *" &&
|
||||||
$internal_name !~ /^(Get|Set)ThreadContext$/) # FIXME: Kludge
|
$internal_name !~ /^(Get|Set)ThreadContext$/) # FIXME: Kludge
|
||||||
|
|
|
@ -96,6 +96,11 @@ my %options = (
|
||||||
default => 0,
|
default => 0,
|
||||||
parent => "documentation", description => "check for documentation comment width inconsistances"
|
parent => "documentation", description => "check for documentation comment width inconsistances"
|
||||||
},
|
},
|
||||||
|
"documentation-name" => {
|
||||||
|
default => 1,
|
||||||
|
parent => "documentation",
|
||||||
|
description => "check for documentation name inconsistances\n"
|
||||||
|
},
|
||||||
"documentation-ordinal" => {
|
"documentation-ordinal" => {
|
||||||
default => 0,
|
default => 0,
|
||||||
parent => "documentation",
|
parent => "documentation",
|
||||||
|
|
|
@ -257,7 +257,7 @@ sub parse_c_file {
|
||||||
|
|
||||||
$arguments =~ y/\t\n/ /;
|
$arguments =~ y/\t\n/ /;
|
||||||
$arguments =~ s/^\s*(.*?)\s*$/$1/;
|
$arguments =~ s/^\s*(.*?)\s*$/$1/;
|
||||||
if($arguments eq "") { $arguments = "void" }
|
if($arguments eq "") { $arguments = "..." }
|
||||||
|
|
||||||
my @argument_types;
|
my @argument_types;
|
||||||
my @argument_names;
|
my @argument_names;
|
||||||
|
|
Loading…
Reference in New Issue