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 #define E_OUTOFMEMORY ((HRESULT)0x8007000EL)
27 #define TYPE_E_IOERROR ((HRESULT)0x80028CA2L)
29 #define max(a, b) ((a) > (b) ? a : b)
33 #include "wine/rpcfc.h"
34 #include "wine/list.h"
46 #define RPC_FC_COCLASS 0xfd
47 #define RPC_FC_FUNCTION 0xfe
49 typedef struct _loc_info_t loc_info_t
;
50 typedef struct _attr_t attr_t
;
51 typedef struct _expr_t expr_t
;
52 typedef struct _type_t type_t
;
53 typedef struct _typeref_t typeref_t
;
54 typedef struct _var_t var_t
;
55 typedef struct _declarator_t declarator_t
;
56 typedef struct _func_t func_t
;
57 typedef struct _ifref_t ifref_t
;
58 typedef struct _typelib_entry_t typelib_entry_t
;
59 typedef struct _importlib_t importlib_t
;
60 typedef struct _importinfo_t importinfo_t
;
61 typedef struct _typelib_t typelib_t
;
62 typedef struct _user_type_t user_type_t
;
63 typedef struct _user_type_t context_handle_t
;
64 typedef struct _type_list_t type_list_t
;
65 typedef struct _statement_t statement_t
;
67 typedef struct list attr_list_t
;
68 typedef struct list str_list_t
;
69 typedef struct list func_list_t
;
70 typedef struct list expr_list_t
;
71 typedef struct list var_list_t
;
72 typedef struct list declarator_list_t
;
73 typedef struct list ifref_list_t
;
74 typedef struct list array_dims_t
;
75 typedef struct list user_type_list_t
;
76 typedef struct list context_handle_list_t
;
77 typedef struct list statement_list_t
;
88 ATTR_CALLCONV
, /* calling convention pseudo-attribute */
90 ATTR_CONST
, /* const pseudo-attribute */
103 ATTR_EXPLICIT_HANDLE
,
108 ATTR_HELPSTRINGCONTEXT
,
115 ATTR_IMPLICIT_HANDLE
,
143 ATTR_STRICTCONTEXTHANDLE
,
198 TKIND_PRIMITIVE
= -1,
233 const char *input_name
;
235 const char *near_text
;
238 struct str_list_entry_t
250 /* parser-internal */
267 /* parser-internal */
277 func_list_t
*funcs
; /* interfaces and modules */
278 var_list_t
*fields_or_args
; /* interfaces, structures, enumerations and functions (for args) */
279 ifref_list_t
*ifaces
; /* coclasses */
280 unsigned long dim
; /* array dimension */
281 expr_t
*size_is
, *length_is
;
282 type_t
*orig
; /* dup'd types */
283 unsigned int typestring_offset
;
284 unsigned int ptrdesc
; /* used for complex structs */
287 unsigned int declarray
: 1; /* if declared as an array */
288 unsigned int ignore
: 1;
289 unsigned int defined
: 1;
290 unsigned int written
: 1;
291 unsigned int user_types_registered
: 1;
292 unsigned int tfswrite
: 1; /* if the type needs to be written to the TFS */
293 unsigned int checked
: 1;
302 enum storage_class stgclass
;
304 struct _loc_info_t loc_info
;
306 /* parser-internal */
310 struct _declarator_t
{
316 /* parser-internal */
325 /* parser-internal */
333 /* parser-internal */
337 struct _typelib_entry_t
{
342 struct _importinfo_t
{
350 importlib_t
*importlib
;
353 struct _importlib_t
{
359 importinfo_t
*importinfos
;
370 const attr_list_t
*attrs
;
372 struct list importlibs
;
373 statement_list_t
*stmts
;
376 struct _user_type_t
{
381 struct _type_list_t
{
383 struct _type_list_t
*next
;
386 struct _statement_t
{
388 enum statement_type type
;
396 type_list_t
*type_list
;
400 extern unsigned char pointer_default
;
402 extern user_type_list_t user_type_list
;
403 void check_for_additional_prototype_types(const var_list_t
*list
);
405 void init_types(void);
406 type_t
*alloc_type(void);
407 void set_all_tfswrite(int val
);
409 type_t
*duptype(type_t
*t
, int dupname
);
410 type_t
*alias(type_t
*t
, const char *name
);
412 int is_ptr(const type_t
*t
);
413 int is_array(const type_t
*t
);
414 int is_var_ptr(const var_t
*v
);
415 int cant_be_null(const var_t
*v
);
416 int is_struct(unsigned char tc
);
417 int is_union(unsigned char tc
);
419 var_t
*find_const(const char *name
, int f
);
420 type_t
*find_type(const char *name
, int t
);
421 type_t
*make_type(unsigned char type
, type_t
*ref
);
423 void init_loc_info(loc_info_t
*);
425 static inline type_t
*get_func_return_type(const func_t
*func
)
427 return func
->def
->type
->ref
;