Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
0e53bb3f
Commit
0e53bb3f
authored
Jan 26, 2005
by
Huw Davies
Committed by
Alexandre Julliard
Jan 26, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix typelib only option.
Make -t and -h options inclusive.
parent
54c67dd1
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
48 additions
and
40 deletions
+48
-40
parser.l
tools/widl/parser.l
+1
-1
parser.y
tools/widl/parser.y
+17
-17
proxy.c
tools/widl/proxy.c
+1
-1
typelib.c
tools/widl/typelib.c
+1
-1
widl.c
tools/widl/widl.c
+17
-11
widl.h
tools/widl/widl.h
+3
-3
widl.man
tools/widl/widl.man
+8
-6
No files found.
tools/widl/parser.l
View file @
0e53bb3f
...
...
@@ -391,7 +391,7 @@ int do_import(char *fname)
int ptr = import_stack_ptr;
int ret;
if (!parse_only) {
if (!parse_only
&& do_header
) {
hname = dup_basename(fname, ".idl");
p = hname + strlen(hname) - 2;
if (p <= hname || strcmp( p, ".h" )) strcat(hname, ".h");
...
...
tools/widl/parser.y
View file @
0e53bb3f
...
...
@@ -249,17 +249,17 @@ int_statements: { $$ = NULL; }
;
statement: ';' {}
| constdef ';' { if (!parse_only) { write_constdef($1); } }
| constdef ';' { if (!parse_only
&& do_header
) { write_constdef($1); } }
| cppquote {}
| enumdef ';' { if (!parse_only) { write_type(header, $1, NULL, NULL); fprintf(header, ";\n\n"); } }
| externdef ';' { if (!parse_only) { write_externdef($1); } }
| enumdef ';' { if (!parse_only
&& do_header
) { write_type(header, $1, NULL, NULL); fprintf(header, ";\n\n"); } }
| externdef ';' { if (!parse_only
&& do_header
) { write_externdef($1); } }
| import {}
| structdef ';' { if (!parse_only) { write_type(header, $1, NULL, NULL); fprintf(header, ";\n\n"); } }
| structdef ';' { if (!parse_only
&& do_header
) { write_type(header, $1, NULL, NULL); fprintf(header, ";\n\n"); } }
| typedef ';' {}
| uniondef ';' { if (!parse_only) { write_type(header, $1, NULL, NULL); fprintf(header, ";\n\n"); } }
| uniondef ';' { if (!parse_only
&& do_header
) { write_type(header, $1, NULL, NULL); fprintf(header, ";\n\n"); } }
;
cppquote: tCPPQUOTE '(' aSTRING ')' { if (!parse_only) fprintf(header, "%s\n", $3); }
cppquote: tCPPQUOTE '(' aSTRING ')' { if (!parse_only
&& do_header
) fprintf(header, "%s\n", $3); }
;
import_start: tIMPORT aSTRING ';' { assert(yychar == YYEMPTY);
if (!do_import($2)) yychar = aEOF; }
...
...
@@ -580,7 +580,7 @@ coclass: tCOCLASS aIDENTIFIER { $$ = make_class($2); }
coclasshdr: attributes coclass { $$ = $2;
$$->attrs = $1;
if (!parse_only) write_coclass($$);
if (!parse_only
&& do_header
) write_coclass($$);
}
;
...
...
@@ -609,7 +609,7 @@ dispinterfacehdr: attributes dispinterface { $$ = $2;
$$->ref = find_type("IDispatch", 0);
if (!$$->ref) yyerror("IDispatch is undefined\n");
$$->defined = TRUE;
if (!parse_only) write_forward($$);
if (!parse_only
&& do_header
) write_forward($$);
}
;
...
...
@@ -627,11 +627,11 @@ dispinterfacedef: dispinterfacehdr '{'
'}' { $$ = $1;
$$->fields = $3;
$$->funcs = $4;
if (!parse_only) write_dispinterface($$);
if (!parse_only
&& do_header
) write_dispinterface($$);
}
/* FIXME: not sure how to handle this yet
| dispinterfacehdr '{' interface '}' { $$ = $1;
if (!parse_only) write_interface($$);
if (!parse_only
&& do_header
) write_interface($$);
}
*/
;
...
...
@@ -648,7 +648,7 @@ interfacehdr: attributes interface { $$ = $2;
if ($$->defined) yyerror("multiple definition error\n");
$$->attrs = $1;
$$->defined = TRUE;
if (!parse_only) write_forward($$);
if (!parse_only
&& do_header
) write_forward($$);
}
;
...
...
@@ -656,7 +656,7 @@ interfacedef: interfacehdr inherit
'{' int_statements '}' { $$ = $1;
$$->ref = $2;
$$->funcs = $4;
if (!parse_only) write_interface($$);
if (!parse_only
&& do_header
) write_interface($$);
}
/* MIDL is able to import the definition of a base class from inside the
* definition of a derived class, I'll try to support it with this rule */
...
...
@@ -665,14 +665,14 @@ interfacedef: interfacehdr inherit
$$->ref = find_type2($3, 0);
if (!$$->ref) yyerror("base class %s not found in import\n", $3);
$$->funcs = $6;
if (!parse_only) write_interface($$);
if (!parse_only
&& do_header
) write_interface($$);
}
| dispinterfacedef { $$ = $1; }
;
interfacedec:
interface ';' { $$ = $1; if (!parse_only) write_forward($$); }
| dispinterface ';' { $$ = $1; if (!parse_only) write_forward($$); }
interface ';' { $$ = $1; if (!parse_only
&& do_header
) write_forward($$); }
| dispinterface ';' { $$ = $1; if (!parse_only
&& do_header
) write_forward($$); }
;
module: tMODULE aIDENTIFIER { $$ = make_type(0, NULL); $$->name = $2; }
...
...
@@ -686,7 +686,7 @@ modulehdr: attributes module { $$ = $2;
moduledef: modulehdr '{' int_statements '}' { $$ = $1;
$$->funcs = $3;
/* FIXME: if (!parse_only) write_module($$); */
/* FIXME: if (!parse_only
&& do_header
) write_module($$); */
}
;
...
...
@@ -736,7 +736,7 @@ typedef: tTYPEDEF m_attributes type pident_list { typeref_t *tref = uniq_tref($3
tref->name = NULL;
$$ = type_ref(tref);
$$->attrs = $2;
if (!parse_only) write_typedef($$, $4);
if (!parse_only
&& do_header
) write_typedef($$, $4);
reg_types($$, $4, 0);
}
;
...
...
tools/widl/proxy.c
View file @
0e53bb3f
...
...
@@ -952,7 +952,7 @@ void write_proxies(ifref_t *ifaces)
char
*
file_id
=
proxy_token
;
int
c
;
if
(
!
do_
everything
)
return
;
if
(
!
do_
proxies
)
return
;
if
(
!
lcur
)
return
;
END_OF_LIST
(
lcur
);
...
...
tools/widl/typelib.c
View file @
0e53bb3f
...
...
@@ -170,7 +170,7 @@ unsigned short get_var_vt(var_t *v)
void
start_typelib
(
char
*
name
,
attr_t
*
attrs
)
{
in_typelib
++
;
if
(
!
do_
everything
&&
!
typelib_only
)
return
;
if
(
!
do_
typelib
)
return
;
typelib
=
xmalloc
(
sizeof
(
*
typelib
));
typelib
->
name
=
xstrdup
(
name
);
...
...
tools/widl/widl.c
View file @
0e53bb3f
...
...
@@ -59,11 +59,11 @@ static char usage[] =
" -d n Set debug level to 'n'
\n
"
" -D id[=val] Define preprocessor identifier id=val
\n
"
" -E Preprocess only
\n
"
" -h Generate headers
only
\n
"
" -h Generate headers
\n
"
" -H file Name of header file (default is infile.h)
\n
"
" -I path Set include search dir to path (multiple -I allowed)
\n
"
" -N Do not preprocess input
\n
"
" -t Generate typelib
only
\n
"
" -t Generate typelib
\n
"
" -T file Name of typelib file (default is infile.tlb)
\n
"
" -V Print version and exit
\n
"
" -W Enable pedantic warnings
\n
"
...
...
@@ -83,10 +83,11 @@ int win32 = 1;
int
debuglevel
=
DEBUGLEVEL_NONE
;
int
pedantic
=
0
;
int
do_everything
=
1
;
static
int
do_everything
=
1
;
int
preprocess_only
=
0
;
int
header_only
=
0
;
int
typelib_only
=
0
;
int
do_header
=
0
;
int
do_typelib
=
0
;
int
do_proxies
=
0
;
int
no_preprocess
=
0
;
char
*
input_name
;
...
...
@@ -150,7 +151,7 @@ int main(int argc,char *argv[])
break
;
case
'h'
:
do_everything
=
0
;
header_only
=
1
;
do_header
=
1
;
break
;
case
'H'
:
header_name
=
strdup
(
optarg
);
...
...
@@ -163,7 +164,7 @@ int main(int argc,char *argv[])
break
;
case
't'
:
do_everything
=
0
;
typelib_only
=
1
;
do_typelib
=
1
;
break
;
case
'T'
:
typelib_name
=
strdup
(
optarg
);
...
...
@@ -180,6 +181,9 @@ int main(int argc,char *argv[])
}
}
if
(
do_everything
)
{
do_header
=
do_typelib
=
do_proxies
=
1
;
}
if
(
optind
<
argc
)
{
input_name
=
xstrdup
(
argv
[
optind
]);
}
...
...
@@ -201,17 +205,17 @@ int main(int argc,char *argv[])
(
debuglevel
&
DEBUGLEVEL_PPTRACE
)
!=
0
,
(
debuglevel
&
DEBUGLEVEL_PPMSG
)
!=
0
);
if
(
!
header_name
&&
(
do_everything
||
header_only
)
)
{
if
(
!
header_name
&&
do_header
)
{
header_name
=
dup_basename
(
input_name
,
".idl"
);
strcat
(
header_name
,
".h"
);
}
if
(
!
typelib_name
&&
(
do_everything
||
typelib_only
)
)
{
if
(
!
typelib_name
&&
do_typelib
)
{
typelib_name
=
dup_basename
(
input_name
,
".idl"
);
strcat
(
typelib_name
,
".tlb"
);
}
if
(
!
proxy_name
&&
do_
everything
)
{
if
(
!
proxy_name
&&
do_
proxies
)
{
proxy_name
=
dup_basename
(
input_name
,
".idl"
);
proxy_token
=
xstrdup
(
proxy_name
);
strcat
(
proxy_name
,
"_p.c"
);
...
...
@@ -247,7 +251,7 @@ int main(int argc,char *argv[])
}
}
if
(
do_
everything
||
header_only
)
{
if
(
do_
header
)
{
header_token
=
make_token
(
header_name
);
if
(
!
(
header
=
fopen
(
header_name
,
"w"
)))
{
...
...
@@ -262,9 +266,11 @@ int main(int argc,char *argv[])
fprintf
(
header
,
"#ifdef __cplusplus
\n
"
);
fprintf
(
header
,
"extern
\"
C
\"
{
\n
"
);
fprintf
(
header
,
"#endif
\n
"
);
}
ret
=
yyparse
();
if
(
do_header
)
{
fprintf
(
header
,
"#ifdef __cplusplus
\n
"
);
fprintf
(
header
,
"}
\n
"
);
fprintf
(
header
,
"#endif
\n
"
);
...
...
tools/widl/widl.h
View file @
0e53bb3f
...
...
@@ -38,9 +38,9 @@ extern int debuglevel;
extern
int
win32
;
extern
int
pedantic
;
extern
int
do_
everything
;
extern
int
header_only
;
extern
int
typelib_only
;
extern
int
do_
header
;
extern
int
do_typelib
;
extern
int
do_proxies
;
extern
char
*
input_name
;
extern
char
*
header_name
;
...
...
tools/widl/widl.man
View file @
0e53bb3f
...
...
@@ -14,21 +14,23 @@ No options are used.
The program prints the help info and then exits.
.PP
.B General options:
.IP \fB-t\fR
Only generate a type library.
.IP "\fB-T \fIfile\fR"
Define the name of the type library to be generated.
The default filename is infile.tlb.
.IP \fB-V\fR
Print version number and exits from the program.
.PP
.B Header options:
.IP \fB-h\fR
Only g
enerate header files.
G
enerate header files.
.IP "\fB-H \fIfile\fR"
Name of header file to generate. The default header
filename is infile.h.
.PP
.B Type library options:
.IP \fB-t\fR
Generate a type library.
.IP "\fB-T \fIfile\fR"
Define the name of the type library to be generated.
The default filename is infile.tlb.
.PP
.B Preprocessor options:
.IP "\fB-I \fIpath\fR"
Add a header search dir to path. Multiple search
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment