- Minor API files update.

- Minor bug fixes.
- Minor documentation check improvements.
This commit is contained in:
Patrik Stridvall 2001-01-20 02:16:31 +00:00 committed by Alexandre Julliard
parent 74f2b4b2ae
commit 9086d42d73
15 changed files with 252 additions and 119 deletions

View File

@ -26,8 +26,6 @@ dlls/commdlg
% dlls/crtdll/crtdll.spec % dlls/crtdll/crtdll.spec
dlls/crtdll
% dlls/dciman32/dciman32.spec % dlls/dciman32/dciman32.spec
dlls/dciman32 dlls/dciman32
@ -85,8 +83,6 @@ dlls/imagehlp
% dlls/imm32/imm.spec % dlls/imm32/imm.spec
dlls/imm32
% dlls/imm32/imm32.spec % dlls/imm32/imm32.spec
dlls/imm32 dlls/imm32
@ -118,6 +114,10 @@ ole
scheduler scheduler
win32 win32
% dlls/msvcrt/msvcrt.spec
dlls/msvcrt
% dlls/kernel/stress.spec % dlls/kernel/stress.spec
dlls/kernel dlls/kernel
@ -292,6 +292,10 @@ dlls/shell32
dlls/shell32 dlls/shell32
% dlls/shdocvw/shdocvw.spec
dlls/shdocvw
% dlls/shfolder/shfolder.spec % dlls/shfolder/shfolder.spec
% dlls/shlwapi/shlwapi.spec % dlls/shlwapi/shlwapi.spec
@ -376,6 +380,10 @@ dlls/winaspi
dlls/winaspi dlls/winaspi
% dlls/winedos/winedos.spec
dlls/winedos
% dlls/wineps/wineps.spec % dlls/wineps/wineps.spec
% dlls/wineps/wineps16.spec % dlls/wineps/wineps16.spec
@ -436,12 +444,8 @@ dlls/winmm
% dlls/winnls/winnls.spec % dlls/winnls/winnls.spec
dlls/winnls
% dlls/winnls/winnls32.spec % dlls/winnls/winnls32.spec
dlls/winnls
% dlls/winsock/winsock.spec % dlls/winsock/winsock.spec
dlls/winsock dlls/winsock

View File

@ -1,5 +1,6 @@
%long %long
BOOL
DWORD DWORD
LPARAM LPARAM
LRESULT LRESULT
@ -39,3 +40,4 @@ HACMSTREAM16
HINSTANCE16 HINSTANCE16
MMRESULT16 MMRESULT16
UINT16 UINT16
WORD

View File

@ -1,92 +0,0 @@
%double
double
%long
BOOL
CHAR
DWORD
HANDLE
INT
USHORT
LONG
ULONG
UINT
WCHAR
UCHAR
clock_t
size_t
time_t
%long # --forbidden
int
unsigned int
unsigned long
%longlong
LONGLONG
ULONGLONG
%ptr
CHAR *
CRTDLL_FILE *
LPCVOID
LPDWORD
LPDWORD *
LPINT
LPUINT
LPSTR *
LPSTR **
LPCSTR *
LPVOID
PCONTEXT
PEXCEPTION_FRAME
PEXCEPTION_FRAME *
PEXCEPTION_RECORD
VOID *
WCHAR *
_INITTERMFUN *
char *
jmp_buf
find_t *
struct _stat *
struct _timeb *
time_t *
struct _heapinfo *
struct _utimbuf *
struct _exception *
CRTDLL_fpos_t *
diskfree_t *
unsigned char *
va_list
void *
%str
LPSTR
LPCSTR
%void
void
VOID
%wstr
LPCWSTR
LPWSTR
%unknown
new_handler_type
sig_handler_type
comp_func
struct complex
atexit_function
div_t
ldiv_t

View File

@ -0,0 +1,96 @@
%double
double
%long
DWORD
HANDLE
INT
LONG
MSVCRT_complex
ULONG
WCHAR
clock_t
int
long
unsigned int
unsigned long
size_t
time_t
%longlong
LONGLONG
ULONGLONG
%ptr
CHAR *
DWORD *
LPCVOID
LPDWORD *
LPINT
LPTHREAD_START_ROUTINE
LPVOID
MSVCRT__INITTERMFUN *
MSVCRT_EXCEPTION_FRAME *
MSVCRT_FILE *
MSVCRT_HEAPINFO *
MSVCRT_atexit_func
MSVCRT_atexit_func **
MSVCRT_comp_func
MSVCRT_diskfree_t *
MSVCRT_finddata_t *
MSVCRT_fpos_t *
MSVCRT_matherr_func
MSVCRT_new_handler_func
MSVCRT_sig_handler_func
MSVCRT_timeb *
MSVCRT_wfinddata_t *
PCONTEXT
PEXCEPTION_FRAME
PEXCEPTION_FRAME *
PEXCEPTION_POINTERS
PEXCEPTION_RECORD
WCHAR *
WCHAR **
WCHAR ***
WORD **
__non_rtti_object *
bad_cast *
bad_typeid *
char *
char **
char ***
exception *
int *
jmp_buf
struct _stat *
struct _utimbuf *
time_t *
type_info *
unsigned char *
unsigned int *
va_list
void *
%str
LPSTR
LPCSTR
%unknown
div_t
ldiv_t
%void
void
VOID
%wstr
LPCWSTR
LPWSTR

View File

@ -9,6 +9,7 @@ double
BOOL BOOL
BYTE BYTE
CHAR CHAR
DISPID
DWORD DWORD
FLOAT FLOAT
HCURSOR HCURSOR
@ -44,6 +45,9 @@ CHAR *
COLORREF * COLORREF *
CY * CY *
DATE * DATE *
DISPID *
DISPPARAMS *
EXCEPINFO *
FLOAT * FLOAT *
ICreateTypeLib ** ICreateTypeLib **
INTERFACEDATA * INTERFACEDATA *
@ -66,18 +70,21 @@ LPUNKNOWN *
LPVOID LPVOID
LPVOID * LPVOID *
OLECHAR * OLECHAR *
OLECHAR **
REFCLSID REFCLSID
REFGUID REFGUID
REFIID REFIID
SAFEARRAY * SAFEARRAY *
SAFEARRAY ** SAFEARRAY **
SAFEARRAYBOUND * SAFEARRAYBOUND *
UINT *
ULONG * ULONG *
USHORT * USHORT *
VARIANT * VARIANT *
VARIANTARG * VARIANTARG *
VARIANT_BOOL * VARIANT_BOOL *
VARTYPE * VARTYPE *
VOID *
double * double *
short * short *
void * void *

View File

@ -8,9 +8,10 @@ HRASCONN
LPBOOL LPBOOL
LPDWORD LPDWORD
LPRASCONNA LPRASCONNA
LPRASDIALPARAMS LPRASDIALPARAMSA
LPRASENTRYNAME LPRASENTRYNAMEA
%str %str
LPSTR LPCSTR

View File

@ -5,6 +5,7 @@ DWORD
HDEVINFO HDEVINFO
HINF HINF
HKEY HKEY
HSPFILEQ
HWND HWND
UINT UINT

View File

@ -0,0 +1,15 @@
%long
BOOL
HRESULT
%ptr
DLLVERSIONINFO *
LPVOID *
REFCLSID
REFIID
%wstr
LPCWSTR

View File

@ -48,8 +48,10 @@ int
%long --extension %long --extension
BOOL16
INT16 INT16
HANDLE16 HANDLE16
HDRVR16
HMODULE16 HMODULE16
HINSTANCE16 HINSTANCE16
HTASK16 HTASK16

View File

@ -0,0 +1,22 @@
%long
BOOL
BYTE
HANDLE
UINT
WORD
int
%ptr
CONTEXT86 *
LPDOSTASK
LPVOID
%str
LPCSTR
%void
void

View File

@ -21,6 +21,7 @@ long
FARPROC FARPROC
INT * INT *
LPDWORD LPDWORD
LPINT
LPVOID LPVOID
LPWSADATA LPWSADATA
ULONG * ULONG *

View File

@ -328,7 +328,7 @@ sub parse_spec_file {
} }
} }
} }
} elsif(/^(\d+|@)\s+stub\s+(\S+)$/) { } elsif(/^(\d+|@)\s+stub(?:\s+(?:-noimport|-norelay|-i386|-ret64))?\s+(\S+)$/) {
my $external_name = $2; my $external_name = $2;
$ordinal = $1; $ordinal = $1;

View File

@ -244,6 +244,8 @@ if($options->headers) {
} }
my %comment_width; my %comment_width;
my %comment_indent;
my %comment_spacing;
my %module_pseudo_stub_count16; my %module_pseudo_stub_count16;
my %module_pseudo_stub_count32; my %module_pseudo_stub_count32;
@ -493,8 +495,24 @@ foreach my $file ($options->c_files) {
$external_name = $internal_name; $external_name = $internal_name;
} }
if($documentation !~ /\b(\Q$external_name\E|$internal_name|$name1|$name2)\b/) { if($options->documentation_pedantic) {
$output->write("documentation: wrong or missing name \\\n$documentation\n"); my $n = 0;
if((++$n && defined($module16) && defined($external_name16) &&
$external_name16 ne "@" && $documentation !~ /\b\Q$external_name16\E\b/) ||
(++$n && defined($module16) && defined($external_name16) &&
$external_name16 eq "@" && $documentation !~ /\@/) ||
(++$n && defined($module32) && defined($external_name32) &&
$external_name32 ne "@" && $documentation !~ /\b\Q$external_name32\E\b/) ||
(++$n && defined($module32) && defined($external_name32) &&
$external_name32 eq "@" && $documentation !~ /\@/))
{
my $external_name = ($external_name16, $external_name32)[($n-1)/2];
$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) {
@ -523,7 +541,7 @@ foreach my $file ($options->c_files) {
foreach my $uc_module32 (@uc_modules32) { foreach my $uc_module32 (@uc_modules32) {
if($documentation !~ /\b$uc_module32\.\Q$ordinal32\E/) { if($documentation !~ /\b$uc_module32\.\Q$ordinal32\E/) {
$output->write("documentation: wrong or missing ordinal " . $output->write("documentation: wrong or missing ordinal " .
"expected (\U$module32\E.$ordinal32)\\\n$documentation\n"); "expected (\U$module32\E.$ordinal32) \\\n$documentation\n");
} }
} }
} }
@ -531,13 +549,35 @@ foreach my $file ($options->c_files) {
} }
if($options->documentation_pedantic) { if($options->documentation_pedantic) {
if($documentation !~ /^ \*\t\t\w+(?: \(\w+\.(?:\@|\d+)\))+/m) { if($documentation !~ /^ \*\t\t(?:\@|\w+)(?: \(\w+\.(?:\@|\d+)\))+/m) {
$output->write("documentation: pedantic check failed \\\n$documentation\n"); $output->write("documentation: pedantic check failed \\\n$documentation\n");
} }
} }
if($options->documentation_width) { if($options->documentation_comment_indent) {
if($documentation =~ /(\/\**)/) { if($documentation =~ /^ \*(\s*)\w+(\s*)([\(\[])\s*\w+\.\s*(?:\@|\d+)\s*([\)\]])/m) {
my $indent = $1;
my $spacing = $2;
my $left = $3;
my $right = $4;
$indent =~ s/\t/ /g;
$indent = length($indent);
$spacing =~ s/\t/ /g;
$spacing = length($spacing);
$comment_indent{$indent}++;
if($indent >= 20) {
$output->write("documentation: comment indent is $indent\n");
}
$comment_spacing{$spacing}++;
}
}
if($options->documentation_comment_width) {
if($documentation =~ /(^\/\*\*+)/) {
my $width = length($1); my $width = length($1);
$comment_width{$width}++; $comment_width{$width}++;
@ -689,7 +729,14 @@ foreach my $file ($options->c_files) {
$output->hide_progress; $output->hide_progress;
if($options->global) { if($options->global) {
if($options->documentation_width) { if($options->documentation_comment_indent) {
foreach my $indent (sort(keys(%comment_indent))) {
my $count = $comment_indent{$indent};
$output->write("*.c: $count functions have comment that is indented $indent\n");
}
}
if($options->documentation_comment_width) {
foreach my $width (sort(keys(%comment_width))) { foreach my $width (sort(keys(%comment_width))) {
my $count = $comment_width{$width}; my $count = $comment_width{$width};
$output->write("*.c: $count functions have comments of width $width\n"); $output->write("*.c: $count functions have comments of width $width\n");

View File

@ -69,15 +69,40 @@ my %options = (
}, },
"cross-call-unicode-ascii" => { "cross-call-unicode-ascii" => {
default => 0, parent => "cross-call", description => "check for cross calls between Unicode and ASCII" default => 0, parent => "cross-call", description => "check for cross calls between Unicode and ASCII"
}, },
"debug-messages" => { default => 0, parent => "statements", description => "check for debug messages inconsistances" }, "debug-messages" => { default => 0, parent => "statements", description => "check for debug messages inconsistances" },
"documentation" => { default => 1, parent => "local", description => "check for documentation inconsistances\n" },
"documentation-pedantic" => { default => 0, parent => "documentation", description => "be pendantic when checking for documentation inconsistances\n" },
"documentation-width" => { default => 0, parent => "documentation", description => "check for documentation width inconsistances\n" },
"documentation-arguments" => { default => 1, parent => "documentation", description => "check for arguments documentation inconsistances\n" },
"documentation-ordinal" => { default => 0, parent => "documentation", description => "check for ordinal documentation inconsistances\n" },
"prototype" => { default => 0, parent => ["local", "headers"], description => "prototype checking" },
"documentation" => {
default => 1,
parent => "local",
description => "check for documentation inconsistances"
},
"documentation-pedantic" => {
default => 0,
parent => "documentation",
description => "be pendantic when checking for documentation inconsistances"
},
"documentation-arguments" => {
default => 1,
parent => "documentation",
description => "check for arguments documentation inconsistances\n"
},
"documentation-comment-indent" => {
default => 0,
parent => "documentation", description => "check for documentation comment indent inconsistances"
},
"documentation-comment-width" => {
default => 0,
parent => "documentation", description => "check for documentation comment width inconsistances"
},
"documentation-ordinal" => {
default => 0,
parent => "documentation",
description => "check for documentation ordinal inconsistances\n"
},
"prototype" => {default => 0, parent => ["local", "headers"], description => "prototype checking" },
"global" => { default => 1, description => "global checking" }, "global" => { default => 1, description => "global checking" },
"declared" => { default => 1, parent => "global", description => "declared checking" }, "declared" => { default => 1, parent => "global", description => "declared checking" },
"implemented" => { default => 0, parent => "local", description => "implemented checking" }, "implemented" => { default => 0, parent => "local", description => "implemented checking" },

View File

@ -135,7 +135,9 @@ sub parse_c_file {
if(defined($comments[$n]) && $n >= 0) { if(defined($comments[$n]) && $n >= 0) {
$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
{
@argument_documentations = (); @argument_documentations = ();
next; next;
} }