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
86fead3c
Commit
86fead3c
authored
Jan 05, 2005
by
Huw Davies
Committed by
Alexandre Julliard
Jan 05, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Store interfaces, structs, coclasses and modules that are to be
written into a typelib in a list.
parent
5e4ac6bc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
97 additions
and
29 deletions
+97
-29
parser.y
tools/widl/parser.y
+3
-1
typelib.c
tools/widl/typelib.c
+60
-28
typelib.h
tools/widl/typelib.h
+1
-0
widltypes.h
tools/widl/widltypes.h
+33
-0
No files found.
tools/widl/parser.y
View file @
86fead3c
...
...
@@ -713,7 +713,9 @@ structdef: tSTRUCT t_ident '{' fields '}' { $$ = get_typev(RPC_FC_STRUCT, $2, ts
$$->type = get_struct_type( $4 );
$$->fields = $4;
$$->defined = TRUE;
}
if(in_typelib)
add_struct($$);
}
;
type: tVOID { $$ = make_tref(NULL, make_type(0, NULL)); }
...
...
tools/widl/typelib.c
View file @
86fead3c
...
...
@@ -35,7 +35,6 @@
#include "typelib.h"
int
in_typelib
=
0
;
static
FILE
*
typelib
;
/* Copied from wtypes.h. Not included directly because that would create a
* circular dependency (after all, wtypes.h is generated by widl...) */
...
...
@@ -91,6 +90,7 @@ enum VARENUM {
VT_ILLEGALMASKED
=
0xfff
,
VT_TYPEMASK
=
0xfff
};
static
typelib_t
*
typelib
;
/* List of oleauto types that should be recognized by name.
* (most of) these seem to be intrinsic types in mktyplib. */
...
...
@@ -217,52 +217,84 @@ 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
(
!
(
typelib
=
fopen
(
typelib_name
,
"wb"
)))
error
(
"Could not open %s for output
\n
"
,
typelib_name
);
in_typelib
++
;
if
(
!
do_everything
&&
!
typelib_only
)
return
;
typelib
=
xmalloc
(
sizeof
(
*
typelib
));
typelib
->
name
=
xstrdup
(
name
);
typelib
->
filename
=
xstrdup
(
typelib_name
);
typelib
->
attrs
=
attrs
;
}
void
end_typelib
(
void
)
{
if
(
typelib
)
fclose
(
typelib
);
in_typelib
--
;
in_typelib
--
;
if
(
!
typelib
)
return
;
/* create_msft_typelib(typelib);*/
return
;
}
void
add_interface
(
type_t
*
iface
)
{
if
(
!
typelib
)
return
;
typelib_entry_t
*
entry
;
if
(
!
typelib
)
return
;
/* FIXME: add interface and dependent types to typelib */
printf
(
"add interface: %s
\n
"
,
iface
->
name
);
chat
(
"add interface: %s
\n
"
,
iface
->
name
);
entry
=
xmalloc
(
sizeof
(
*
entry
));
entry
->
kind
=
TKIND_INTERFACE
;
entry
->
u
.
interface
=
iface
;
LINK
(
entry
,
typelib
->
entry
);
typelib
->
entry
=
entry
;
}
void
add_coclass
(
class_t
*
cls
)
{
ifref_t
*
lcur
=
cls
->
ifaces
;
ifref_t
*
cur
;
if
(
lcur
)
{
while
(
NEXT_LINK
(
lcur
))
lcur
=
NEXT_LINK
(
lcur
);
}
ifref_t
*
lcur
=
cls
->
ifaces
;
ifref_t
*
cur
;
typelib_entry_t
*
entry
;
if
(
!
typelib
)
return
;
if
(
lcur
)
{
while
(
NEXT_LINK
(
lcur
))
lcur
=
NEXT_LINK
(
lcur
);
}
/* install interfaces the coclass depends on */
cur
=
lcur
;
while
(
cur
)
{
add_interface
(
cur
->
iface
);
cur
=
PREV_LINK
(
cur
);
}
if
(
!
typelib
)
return
;
/* FIXME: add coclass to typelib */
printf
(
"add coclass: %s
\n
"
,
cls
->
name
);
/* install interfaces the coclass depends on */
cur
=
lcur
;
while
(
cur
)
{
add_interface
(
cur
->
iface
);
cur
=
PREV_LINK
(
cur
);
}
entry
=
xmalloc
(
sizeof
(
*
entry
));
entry
->
kind
=
TKIND_COCLASS
;
entry
->
u
.
class
=
cls
;
LINK
(
entry
,
typelib
->
entry
);
typelib
->
entry
=
entry
;
}
void
add_module
(
type_t
*
module
)
{
if
(
!
typelib
)
return
;
typelib_entry_t
*
entry
;
if
(
!
typelib
)
return
;
chat
(
"add module: %s
\n
"
,
module
->
name
);
entry
=
xmalloc
(
sizeof
(
*
entry
));
entry
->
kind
=
TKIND_MODULE
;
entry
->
u
.
module
=
module
;
LINK
(
entry
,
typelib
->
entry
);
typelib
->
entry
=
entry
;
}
void
add_struct
(
type_t
*
structure
)
{
typelib_entry_t
*
entry
;
if
(
!
typelib
)
return
;
/* FIXME: add module to typelib */
printf
(
"add module: %s
\n
"
,
module
->
name
);
chat
(
"add struct: %s
\n
"
,
structure
->
name
);
entry
=
xmalloc
(
sizeof
(
*
entry
));
entry
->
kind
=
TKIND_RECORD
;
entry
->
u
.
structure
=
structure
;
LINK
(
entry
,
typelib
->
entry
);
typelib
->
entry
=
entry
;
}
tools/widl/typelib.h
View file @
86fead3c
...
...
@@ -27,5 +27,6 @@ extern void end_typelib(void);
extern
void
add_interface
(
type_t
*
iface
);
extern
void
add_coclass
(
class_t
*
cls
);
extern
void
add_module
(
type_t
*
module
);
extern
void
add_struct
(
type_t
*
structure
);
#endif
tools/widl/widltypes.h
View file @
86fead3c
...
...
@@ -45,6 +45,8 @@ typedef struct _var_t var_t;
typedef
struct
_func_t
func_t
;
typedef
struct
_ifref_t
ifref_t
;
typedef
struct
_class_t
class_t
;
typedef
struct
_typelib_entry_t
typelib_entry_t
;
typedef
struct
_typelib_t
typelib_t
;
#define DECL_LINK(type) \
type *l_next; \
...
...
@@ -126,6 +128,19 @@ enum expr_type
EXPR_COND
,
};
enum
type_kind
{
TKIND_ENUM
=
0
,
TKIND_RECORD
,
TKIND_MODULE
,
TKIND_INTERFACE
,
TKIND_DISPATCH
,
TKIND_COCLASS
,
TKIND_ALIAS
,
TKIND_UNION
,
TKIND_MAX
};
struct
_attr_t
{
enum
attr_type
type
;
union
{
...
...
@@ -214,4 +229,22 @@ struct _class_t {
DECL_LINK
(
class_t
)
};
struct
_typelib_entry_t
{
enum
type_kind
kind
;
union
{
class_t
*
class
;
type_t
*
interface
;
type_t
*
module
;
type_t
*
structure
;
}
u
;
DECL_LINK
(
typelib_entry_t
)
};
struct
_typelib_t
{
char
*
name
;
char
*
filename
;
attr_t
*
attrs
;
typelib_entry_t
*
entry
;
};
#endif
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