4 * Copyright 2002 Ove Kaaven
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __WIDL_WIDLTYPES_H
22 #define __WIDL_WIDLTYPES_H
26 #include "wine/rpcfc.h"
27 #include "wine/list.h"
37 #define RPC_FC_FUNCTION 0xfe
39 typedef struct _attr_t attr_t
;
40 typedef struct _expr_t expr_t
;
41 typedef struct _type_t type_t
;
42 typedef struct _typeref_t typeref_t
;
43 typedef struct _var_t var_t
;
44 typedef struct _pident_t pident_t
;
45 typedef struct _func_t func_t
;
46 typedef struct _ifref_t ifref_t
;
47 typedef struct _typelib_entry_t typelib_entry_t
;
48 typedef struct _importlib_t importlib_t
;
49 typedef struct _importinfo_t importinfo_t
;
50 typedef struct _typelib_t typelib_t
;
51 typedef struct _user_type_t user_type_t
;
52 typedef struct _user_type_t context_handle_t
;
54 typedef struct list attr_list_t
;
55 typedef struct list str_list_t
;
56 typedef struct list func_list_t
;
57 typedef struct list expr_list_t
;
58 typedef struct list var_list_t
;
59 typedef struct list pident_list_t
;
60 typedef struct list ifref_list_t
;
61 typedef struct list array_dims_t
;
62 typedef struct list user_type_list_t
;
63 typedef struct list context_handle_list_t
;
74 ATTR_CALLCONV
, /* calling convention pseudo-attribute */
80 ATTR_DEFAULTVALUE_EXPR
,
81 ATTR_DEFAULTVALUE_STRING
,
95 ATTR_HELPSTRINGCONTEXT
,
102 ATTR_IMPLICIT_HANDLE
,
128 ATTR_STRICTCONTEXTHANDLE
,
167 TKIND_PRIMITIVE
= -1,
179 struct str_list_entry_t
191 /* parser-internal */
208 /* parser-internal */
217 const attr_list_t
*attrs
;
218 func_list_t
*funcs
; /* interfaces and modules */
219 var_list_t
*fields_or_args
; /* interfaces, structures, enumerations and functions (for args) */
220 ifref_list_t
*ifaces
; /* coclasses */
221 unsigned long dim
; /* array dimension */
222 expr_t
*size_is
, *length_is
;
223 type_t
*orig
; /* dup'd types */
224 unsigned int typestring_offset
;
225 unsigned int ptrdesc
; /* used for complex structs */
227 unsigned int declarray
: 1; /* if declared as an array */
228 unsigned int ignore
: 1;
229 unsigned int is_const
: 1;
230 unsigned int defined
: 1;
231 unsigned int written
: 1;
232 unsigned int user_types_registered
: 1;
233 unsigned int tfswrite
: 1; /* if the type needs to be written to the TFS */
243 /* parser-internal */
252 /* levels of indirection for function pointers */
257 /* parser-internal */
266 /* parser-internal */
274 /* parser-internal */
278 struct _typelib_entry_t
{
283 struct _importinfo_t
{
291 importlib_t
*importlib
;
294 struct _importlib_t
{
300 importinfo_t
*importinfos
;
311 const attr_list_t
*attrs
;
313 struct list importlibs
;
316 struct _user_type_t
{
321 extern unsigned char pointer_default
;
323 extern user_type_list_t user_type_list
;
324 void check_for_additional_prototype_types(const var_list_t
*list
);
326 void init_types(void);
327 type_t
*alloc_type(void);
328 void set_all_tfswrite(int val
);
330 type_t
*duptype(type_t
*t
, int dupname
);
331 type_t
*alias(type_t
*t
, const char *name
);
333 int is_ptr(const type_t
*t
);
334 int is_array(const type_t
*t
);
335 int is_var_ptr(const var_t
*v
);
336 int cant_be_null(const var_t
*v
);
337 int is_struct(unsigned char tc
);
338 int is_union(unsigned char tc
);
340 static inline type_t
*get_func_return_type(const func_t
*func
)
342 return func
->def
->type
->ref
;