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
6b955b51
Commit
6b955b51
authored
Dec 29, 2008
by
Rob Shearman
Committed by
Alexandre Julliard
Dec 29, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Generate header files from the parse tree instead of using hooks in the parser.
parent
bf5a9cb6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
51 additions
and
110 deletions
+51
-110
header.c
tools/widl/header.c
+0
-0
header.h
tools/widl/header.h
+0
-11
parser.h
tools/widl/parser.h
+1
-0
parser.y
tools/widl/parser.y
+35
-61
typetree.c
tools/widl/typetree.c
+4
-3
typetree.h
tools/widl/typetree.h
+1
-1
widl.c
tools/widl/widl.c
+3
-30
widl.h
tools/widl/widl.h
+5
-3
widltypes.h
tools/widl/widltypes.h
+2
-1
No files found.
tools/widl/header.c
View file @
6b955b51
This diff is collapsed.
Click to expand it.
tools/widl/header.h
View file @
6b955b51
...
...
@@ -47,17 +47,6 @@ extern int need_proxy_file(const statement_list_t *stmts);
extern
const
var_t
*
is_callas
(
const
attr_list_t
*
list
);
extern
void
write_args
(
FILE
*
h
,
const
var_list_t
*
arg
,
const
char
*
name
,
int
obj
,
int
do_indent
);
extern
void
write_array
(
FILE
*
h
,
array_dims_t
*
v
,
int
field
);
extern
void
write_import
(
const
char
*
fname
);
extern
void
write_forward
(
type_t
*
iface
);
extern
void
write_interface
(
type_t
*
iface
);
extern
void
write_coclass
(
type_t
*
cocl
);
extern
void
write_coclass_forward
(
type_t
*
cocl
);
extern
void
write_typedef
(
type_t
*
type
);
extern
void
write_declaration
(
const
var_t
*
v
,
int
is_in_interface
);
extern
void
write_library
(
const
typelib_t
*
typelib
);
extern
void
write_user_types
(
void
);
extern
void
write_context_handle_rundowns
(
void
);
extern
void
write_generic_handle_routines
(
void
);
extern
const
var_t
*
get_explicit_handle_var
(
const
func_t
*
func
);
extern
const
type_t
*
get_explicit_generic_handle_type
(
const
var_t
*
var
);
extern
const
var_t
*
get_explicit_generic_handle_var
(
const
func_t
*
func
);
...
...
tools/widl/parser.h
View file @
6b955b51
...
...
@@ -46,5 +46,6 @@ void pop_import(void);
int
is_type
(
const
char
*
name
);
void
check_functions
(
const
type_t
*
iface
);
func_list_t
*
gen_function_list
(
const
statement_list_t
*
stmts
);
#endif
tools/widl/parser.y
View file @
6b955b51
This diff is collapsed.
Click to expand it.
tools/widl/typetree.c
View file @
6b955b51
...
...
@@ -64,13 +64,14 @@ static int compute_method_indexes(type_t *iface)
return
idx
;
}
void
type_interface_define
(
type_t
*
iface
,
type_t
*
inherit
,
func_list_t
*
func
s
)
void
type_interface_define
(
type_t
*
iface
,
type_t
*
inherit
,
statement_list_t
*
stmt
s
)
{
iface
->
ref
=
inherit
;
iface
->
details
.
iface
=
xmalloc
(
sizeof
(
*
iface
->
details
.
iface
));
iface
->
funcs
=
funcs
;
iface
->
funcs
=
gen_function_list
(
stmts
)
;
iface
->
details
.
iface
->
disp_props
=
NULL
;
iface
->
details
.
iface
->
disp_methods
=
NULL
;
iface
->
stmts
=
stmts
;
iface
->
defined
=
TRUE
;
check_functions
(
iface
);
compute_method_indexes
(
iface
);
...
...
@@ -84,7 +85,7 @@ void type_dispinterface_define(type_t *iface, var_list_t *props, func_list_t *me
iface
->
funcs
=
NULL
;
iface
->
details
.
iface
->
disp_props
=
props
;
iface
->
details
.
iface
->
disp_methods
=
methods
;
iface
->
funcs
=
methods
;
iface
->
stmts
=
NULL
;
iface
->
defined
=
TRUE
;
check_functions
(
iface
);
compute_method_indexes
(
iface
);
...
...
tools/widl/typetree.h
View file @
6b955b51
...
...
@@ -26,7 +26,7 @@
type_t
*
type_new_function
(
var_list_t
*
args
);
type_t
*
type_new_pointer
(
type_t
*
ref
,
attr_list_t
*
attrs
);
void
type_interface_define
(
type_t
*
iface
,
type_t
*
inherit
,
func_list_t
*
func
s
);
void
type_interface_define
(
type_t
*
iface
,
type_t
*
inherit
,
statement_list_t
*
stmt
s
);
void
type_dispinterface_define
(
type_t
*
iface
,
var_list_t
*
props
,
func_list_t
*
methods
);
void
type_dispinterface_define_from_iface
(
type_t
*
dispiface
,
type_t
*
iface
);
...
...
tools/widl/widl.c
View file @
6b955b51
...
...
@@ -213,14 +213,14 @@ static void set_everything(int x)
do_dlldata
=
x
;
}
static
void
start_cplusplus_guard
(
FILE
*
fp
)
void
start_cplusplus_guard
(
FILE
*
fp
)
{
fprintf
(
fp
,
"#ifdef __cplusplus
\n
"
);
fprintf
(
fp
,
"extern
\"
C
\"
{
\n
"
);
fprintf
(
fp
,
"#endif
\n\n
"
);
}
static
void
end_cplusplus_guard
(
FILE
*
fp
)
void
end_cplusplus_guard
(
FILE
*
fp
)
{
fprintf
(
fp
,
"#ifdef __cplusplus
\n
"
);
fprintf
(
fp
,
"}
\n
"
);
...
...
@@ -626,38 +626,11 @@ int main(int argc,char *argv[])
}
}
if
(
do_header
)
{
header_token
=
make_token
(
header_name
);
if
(
!
(
header
=
fopen
(
header_name
,
"w"
)))
{
fprintf
(
stderr
,
"Could not open %s for output
\n
"
,
header_name
);
return
1
;
}
fprintf
(
header
,
"/*** Autogenerated by WIDL %s from %s - Do not edit ***/
\n
"
,
PACKAGE_VERSION
,
input_name
);
fprintf
(
header
,
"#include <rpc.h>
\n
"
);
fprintf
(
header
,
"#include <rpcndr.h>
\n\n
"
);
fprintf
(
header
,
"#ifndef __WIDL_%s
\n
"
,
header_token
);
fprintf
(
header
,
"#define __WIDL_%s
\n
"
,
header_token
);
start_cplusplus_guard
(
header
);
}
header_token
=
make_token
(
header_name
);
init_types
();
ret
=
parser_parse
();
if
(
do_header
)
{
fprintf
(
header
,
"/* Begin additional prototypes for all interfaces */
\n
"
);
fprintf
(
header
,
"
\n
"
);
write_user_types
();
write_generic_handle_routines
();
write_context_handle_rundowns
();
fprintf
(
header
,
"
\n
"
);
fprintf
(
header
,
"/* End additional prototypes */
\n
"
);
fprintf
(
header
,
"
\n
"
);
end_cplusplus_guard
(
header
);
fprintf
(
header
,
"#endif /* __WIDL_%s */
\n
"
,
header_token
);
fclose
(
header
);
}
fclose
(
parser_in
);
if
(
ret
)
{
...
...
tools/widl/widl.h
View file @
6b955b51
...
...
@@ -50,6 +50,7 @@ extern int do_win64;
extern
char
*
input_name
;
extern
char
*
header_name
;
extern
char
*
header_token
;
extern
char
*
local_stubs_name
;
extern
char
*
typelib_name
;
extern
char
*
dlldata_name
;
...
...
@@ -67,9 +68,7 @@ extern time_t now;
extern
int
line_number
;
extern
int
char_number
;
extern
FILE
*
header
;
extern
FILE
*
idfile
;
extern
void
write_header
(
const
statement_list_t
*
stmts
);
extern
void
write_id_data
(
const
statement_list_t
*
stmts
);
extern
void
write_proxies
(
const
statement_list_t
*
stmts
);
extern
void
write_client
(
const
statement_list_t
*
stmts
);
...
...
@@ -77,4 +76,7 @@ extern void write_server(const statement_list_t *stmts);
extern
void
write_local_stubs
(
const
statement_list_t
*
stmts
);
extern
void
write_dlldata
(
const
statement_list_t
*
stmts
);
extern
void
start_cplusplus_guard
(
FILE
*
fp
);
extern
void
end_cplusplus_guard
(
FILE
*
fp
);
#endif
tools/widl/widltypes.h
View file @
6b955b51
...
...
@@ -295,6 +295,7 @@ struct _type_t {
struct
iface_details
*
iface
;
}
details
;
func_list_t
*
funcs
;
/* interfaces and modules */
statement_list_t
*
stmts
;
/* interfaces and modules */
ifref_list_t
*
ifaces
;
/* coclasses */
unsigned
long
dim
;
/* array dimension */
expr_t
*
size_is
,
*
length_is
;
...
...
@@ -339,7 +340,7 @@ struct _declarator_t {
struct
_func_t
{
var_t
*
def
;
var_list_t
*
args
;
int
i
gnore
,
i
dx
;
int
idx
;
/* parser-internal */
struct
list
entry
;
...
...
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