Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
ba5a9681
Commit
ba5a9681
authored
Sep 03, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added partial support for function pointers.
parent
3e1c5afd
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
21 deletions
+62
-21
header.c
tools/widl/header.c
+48
-19
header.h
tools/widl/header.h
+1
-1
parser.y
tools/widl/parser.y
+11
-0
proxy.c
tools/widl/proxy.c
+1
-1
widltypes.h
tools/widl/widltypes.h
+1
-0
No files found.
tools/widl/header.c
View file @
ba5a9681
...
...
@@ -446,8 +446,19 @@ static void write_icom_method_def(type_t *iface)
fprintf
(
header
,
")(%s"
,
arg
?
"THIS_ "
:
"THIS"
);
while
(
arg
)
{
write_type
(
header
,
arg
->
type
,
arg
,
arg
->
tname
);
fprintf
(
header
,
" "
);
write_name
(
header
,
arg
);
if
(
arg
->
args
)
{
fprintf
(
header
,
" (STDMETHODCALLTYPE *"
);
write_name
(
header
,
arg
);
fprintf
(
header
,
")("
);
write_args
(
header
,
arg
->
args
,
NULL
,
0
,
FALSE
);
fprintf
(
header
,
")"
);
}
else
{
fprintf
(
header
,
" "
);
write_name
(
header
,
arg
);
}
write_array
(
header
,
arg
->
array
,
0
);
arg
=
PREV_LINK
(
arg
);
if
(
arg
)
fprintf
(
header
,
", "
);
...
...
@@ -503,35 +514,53 @@ static int write_method_macro(type_t *iface, char *name)
return
idx
;
}
void
write_args
(
FILE
*
h
,
var_t
*
arg
,
char
*
name
,
int
method
)
void
write_args
(
FILE
*
h
,
var_t
*
arg
,
char
*
name
,
int
method
,
int
do_indent
)
{
int
count
=
0
;
if
(
arg
)
{
while
(
NEXT_LINK
(
arg
))
arg
=
NEXT_LINK
(
arg
);
}
if
(
h
==
header
)
{
indentation
++
;
indent
(
0
);
}
else
fprintf
(
h
,
" "
);
if
(
do_indent
)
{
if
(
h
==
header
)
{
indentation
++
;
indent
(
0
);
}
else
fprintf
(
h
,
" "
);
}
if
(
method
==
1
)
{
fprintf
(
h
,
"%s* This"
,
name
);
count
++
;
}
while
(
arg
)
{
if
(
count
)
{
fprintf
(
h
,
",
\n
"
);
if
(
h
==
header
)
indent
(
0
);
else
fprintf
(
h
,
" "
);
if
(
do_indent
)
{
fprintf
(
h
,
",
\n
"
);
if
(
h
==
header
)
indent
(
0
);
else
fprintf
(
h
,
" "
);
}
else
fprintf
(
h
,
","
);
}
write_type
(
h
,
arg
->
type
,
arg
,
arg
->
tname
);
fprintf
(
h
,
" "
);
write_name
(
h
,
arg
);
if
(
arg
->
args
)
{
fprintf
(
h
,
" (STDMETHODCALLTYPE *"
);
write_name
(
h
,
arg
);
fprintf
(
h
,
")("
);
write_args
(
h
,
arg
->
args
,
NULL
,
0
,
FALSE
);
fprintf
(
h
,
")"
);
}
else
{
fprintf
(
h
,
" "
);
write_name
(
h
,
arg
);
}
write_array
(
h
,
arg
->
array
,
0
);
arg
=
PREV_LINK
(
arg
);
count
++
;
}
if
(
h
==
header
)
indentation
--
;
if
(
do_indent
&&
h
==
header
)
indentation
--
;
}
static
void
write_cpp_method_def
(
type_t
*
iface
)
...
...
@@ -549,7 +578,7 @@ static void write_cpp_method_def(type_t *iface)
fprintf
(
header
,
" STDMETHODCALLTYPE "
);
write_name
(
header
,
def
);
fprintf
(
header
,
"(
\n
"
);
write_args
(
header
,
cur
->
args
,
iface
->
name
,
2
);
write_args
(
header
,
cur
->
args
,
iface
->
name
,
2
,
TRUE
);
fprintf
(
header
,
") = 0;
\n
"
);
fprintf
(
header
,
"
\n
"
);
}
...
...
@@ -575,7 +604,7 @@ static void do_write_c_method_def(type_t *iface, char *name)
fprintf
(
header
,
" (STDMETHODCALLTYPE *"
);
write_name
(
header
,
def
);
fprintf
(
header
,
")(
\n
"
);
write_args
(
header
,
cur
->
args
,
name
,
1
);
write_args
(
header
,
cur
->
args
,
name
,
1
,
TRUE
);
fprintf
(
header
,
");
\n
"
);
fprintf
(
header
,
"
\n
"
);
}
...
...
@@ -603,7 +632,7 @@ static void write_method_proto(type_t *iface)
fprintf
(
header
,
" CALLBACK %s_"
,
iface
->
name
);
write_name
(
header
,
def
);
fprintf
(
header
,
"_Proxy(
\n
"
);
write_args
(
header
,
cur
->
args
,
iface
->
name
,
1
);
write_args
(
header
,
cur
->
args
,
iface
->
name
,
1
,
TRUE
);
fprintf
(
header
,
");
\n
"
);
/* stub prototype */
fprintf
(
header
,
"void __RPC_STUB %s_"
,
iface
->
name
);
...
...
@@ -625,14 +654,14 @@ static void write_method_proto(type_t *iface)
fprintf
(
header
,
" CALLBACK %s_"
,
iface
->
name
);
write_name
(
header
,
mdef
);
fprintf
(
header
,
"_Proxy(
\n
"
);
write_args
(
header
,
m
->
args
,
iface
->
name
,
1
);
write_args
(
header
,
m
->
args
,
iface
->
name
,
1
,
TRUE
);
fprintf
(
header
,
");
\n
"
);
/* stub prototype - use remotable prototype */
write_type
(
header
,
def
->
type
,
def
,
def
->
tname
);
fprintf
(
header
,
" __RPC_STUB %s_"
,
iface
->
name
);
write_name
(
header
,
mdef
);
fprintf
(
header
,
"_Stub(
\n
"
);
write_args
(
header
,
cur
->
args
,
iface
->
name
,
1
);
write_args
(
header
,
cur
->
args
,
iface
->
name
,
1
,
TRUE
);
fprintf
(
header
,
");
\n
"
);
}
else
{
...
...
@@ -655,7 +684,7 @@ static void write_function_proto(type_t *iface)
fprintf
(
header
,
" "
);
write_name
(
header
,
def
);
fprintf
(
header
,
"(
\n
"
);
write_args
(
header
,
cur
->
args
,
iface
->
name
,
0
);
write_args
(
header
,
cur
->
args
,
iface
->
name
,
0
,
TRUE
);
fprintf
(
header
,
");
\n
"
);
cur
=
PREV_LINK
(
cur
);
...
...
tools/widl/header.h
View file @
ba5a9681
...
...
@@ -28,7 +28,7 @@ extern void write_type(FILE *h, type_t *t, var_t *v, char *n);
extern
int
is_object
(
attr_t
*
a
);
extern
int
is_local
(
attr_t
*
a
);
extern
var_t
*
is_callas
(
attr_t
*
a
);
extern
void
write_args
(
FILE
*
h
,
var_t
*
arg
,
char
*
name
,
int
obj
);
extern
void
write_args
(
FILE
*
h
,
var_t
*
arg
,
char
*
name
,
int
obj
,
int
do_indent
);
extern
void
write_forward
(
type_t
*
iface
);
extern
void
write_interface
(
type_t
*
iface
);
extern
void
write_typedef
(
type_t
*
type
,
var_t
*
names
);
...
...
tools/widl/parser.y
View file @
ba5a9681
...
...
@@ -243,6 +243,17 @@ arg: attributes type pident array { $$ = $3;
| type pident array { $$ = $2;
set_type($$, $1, $3);
}
| attributes type pident '(' m_args ')' { $$ = $3;
$$->ptr_level--;
set_type($$, $2, NULL);
$$->attrs = $1;
$$->args = $5;
}
| type pident '(' m_args ')' { $$ = $2;
$$->ptr_level--;
set_type($$, $1, NULL);
$$->args = $4;
}
;
array: { $$ = NULL; }
...
...
tools/widl/proxy.c
View file @
ba5a9681
...
...
@@ -69,7 +69,7 @@ static void gen_proxy(type_t *iface, func_t *cur, int idx)
fprintf
(
proxy
,
" CALLBACK %s_"
,
iface
->
name
);
write_name
(
proxy
,
def
);
fprintf
(
proxy
,
"_Proxy(
\n
"
);
write_args
(
proxy
,
cur
->
args
,
iface
->
name
,
1
);
write_args
(
proxy
,
cur
->
args
,
iface
->
name
,
1
,
TRUE
);
fprintf
(
proxy
,
")
\n
"
);
fprintf
(
proxy
,
"{
\n
"
);
/* local variables */
...
...
tools/widl/widltypes.h
View file @
ba5a9681
...
...
@@ -146,6 +146,7 @@ struct _var_t {
int
ptr_level
;
expr_t
*
array
;
type_t
*
type
;
var_t
*
args
;
/* for function pointers */
char
*
tname
;
attr_t
*
attrs
;
expr_t
*
eval
;
...
...
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