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
61583ec2
Commit
61583ec2
authored
Jan 14, 2016
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Apr 09, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Add support for recursive type references to SLTG typelib generator.
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
parent
b8921b41
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
9 deletions
+44
-9
write_sltg.c
tools/widl/write_sltg.c
+44
-9
No files found.
tools/widl/write_sltg.c
View file @
61583ec2
...
...
@@ -183,6 +183,12 @@ struct sltg_hrefinfo
#include "poppack.h"
static
void
add_structure_typeinfo
(
struct
sltg_typelib
*
typelib
,
type_t
*
type
);
static
void
add_interface_typeinfo
(
struct
sltg_typelib
*
typelib
,
type_t
*
type
);
static
void
add_enum_typeinfo
(
struct
sltg_typelib
*
typelib
,
type_t
*
type
);
static
void
add_union_typeinfo
(
struct
sltg_typelib
*
typelib
,
type_t
*
type
);
static
void
add_coclass_typeinfo
(
struct
sltg_typelib
*
typelib
,
type_t
*
type
);
static
void
init_sltg_data
(
struct
sltg_data
*
data
)
{
data
->
size
=
0
;
...
...
@@ -644,8 +650,8 @@ static int local_href(struct sltg_hrefmap *hrefmap, int typelib_href)
return
href
<<
2
;
}
static
short
write_var_desc
(
struct
sltg_
data
*
data
,
type_t
*
type
,
short
flags
,
short
base_offset
,
int
*
size_instance
,
struct
sltg_hrefmap
*
hrefmap
)
static
short
write_var_desc
(
struct
sltg_
typelib
*
typelib
,
struct
sltg_data
*
data
,
type_t
*
type
,
short
flags
,
short
base_offset
,
int
*
size_instance
,
struct
sltg_hrefmap
*
hrefmap
)
{
short
vt
,
vt_flags
,
desc_offset
;
...
...
@@ -737,10 +743,10 @@ static short write_var_desc(struct sltg_data *data, type_t *type, short flags, s
chat
(
"write_var_desc: vt VT_PTR | 0x0400
\n
"
);
vt
=
VT_PTR
|
0x0400
;
append_data
(
data
,
&
vt
,
sizeof
(
vt
));
write_var_desc
(
data
,
ref
,
0
,
base_offset
,
size_instance
,
hrefmap
);
write_var_desc
(
typelib
,
data
,
ref
,
0
,
base_offset
,
size_instance
,
hrefmap
);
}
else
write_var_desc
(
data
,
ref
,
0x0e00
,
base_offset
,
size_instance
,
hrefmap
);
write_var_desc
(
typelib
,
data
,
ref
,
0x0e00
,
base_offset
,
size_instance
,
hrefmap
);
return
desc_offset
;
}
...
...
@@ -760,6 +766,33 @@ static short write_var_desc(struct sltg_data *data, type_t *type, short flags, s
type
,
type
->
name
,
type_get_type
(
type
),
type
->
typelib_idx
);
if
(
type
->
typelib_idx
==
-
1
)
{
chat
(
"write_var_desc: trying to ref not added type
\n
"
);
switch
(
type_get_type
(
type
))
{
case
TYPE_STRUCT
:
add_structure_typeinfo
(
typelib
,
type
);
break
;
case
TYPE_INTERFACE
:
add_interface_typeinfo
(
typelib
,
type
);
break
;
case
TYPE_ENUM
:
add_enum_typeinfo
(
typelib
,
type
);
break
;
case
TYPE_UNION
:
add_union_typeinfo
(
typelib
,
type
);
break
;
case
TYPE_COCLASS
:
add_coclass_typeinfo
(
typelib
,
type
);
break
;
default:
error
(
"write_var_desc: VT_USERDEFINED - unhandled type %d
\n
"
,
type_get_type
(
type
));
}
}
if
(
type
->
typelib_idx
==
-
1
)
error
(
"write_var_desc: trying to ref not added type
\n
"
);
href
=
local_href
(
hrefmap
,
type
->
typelib_idx
);
...
...
@@ -816,6 +849,8 @@ static void add_structure_typeinfo(struct sltg_typelib *typelib, type_t *type)
int
member_offset
,
var_count
=
0
,
var_data_size
=
0
,
size_instance
=
0
;
short
*
type_desc_offset
=
NULL
;
if
(
type
->
typelib_idx
!=
-
1
)
return
;
chat
(
"add_structure_typeinfo: type %p, type->name %s
\n
"
,
type
,
type
->
name
);
type
->
typelib_idx
=
typelib
->
block_count
;
...
...
@@ -825,8 +860,6 @@ static void add_structure_typeinfo(struct sltg_typelib *typelib, type_t *type)
init_sltg_data
(
&
data
);
index_name
=
add_typeinfo_block
(
typelib
,
type
,
TKIND_RECORD
);
if
(
type_struct_get_fields
(
type
))
{
int
i
=
0
;
...
...
@@ -841,13 +874,13 @@ static void add_structure_typeinfo(struct sltg_typelib *typelib, type_t *type)
{
short
base_offset
;
chat
(
"add_structure_typeinfo: var %p
, name %s, type %p
\n
"
,
var
,
var
->
name
,
var
->
declspec
.
type
);
chat
(
"add_structure_typeinfo: var %p
(%s), type %p (%s)
\n
"
,
var
,
var
->
name
,
var
->
declspec
.
type
,
var
->
declspec
.
type
->
name
);
init_sltg_data
(
&
var_data
[
i
]);
base_offset
=
var_data_size
+
(
i
+
1
)
*
sizeof
(
struct
sltg_variable
);
type_desc_offset
[
i
]
=
write_var_desc
(
&
var_data
[
i
],
var
->
declspec
.
type
,
0
,
base_offset
,
&
size_instance
,
&
hrefmap
);
type_desc_offset
[
i
]
=
write_var_desc
(
typelib
,
&
var_data
[
i
],
var
->
declspec
.
type
,
0
,
base_offset
,
&
size_instance
,
&
hrefmap
);
dump_var_desc
(
var_data
[
i
].
data
,
var_data
[
i
].
size
);
if
(
var_data
[
i
].
size
>
sizeof
(
short
))
...
...
@@ -856,6 +889,8 @@ static void add_structure_typeinfo(struct sltg_typelib *typelib, type_t *type)
}
}
index_name
=
add_typeinfo_block
(
typelib
,
type
,
TKIND_RECORD
);
init_typeinfo
(
&
ti
,
type
,
TKIND_RECORD
,
&
hrefmap
);
append_data
(
&
data
,
&
ti
,
sizeof
(
ti
));
...
...
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