widl: Replace erroneously removed current_func assignment.
[wine/winequartzdrv.git] / tools / widl / widltypes.h
blob18a976a87526fdfa67094ce7f14eab1018d8ba8b
1 /*
2 * IDL Compiler
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
24 #include <stdarg.h>
25 #include "guiddef.h"
26 #include "wine/rpcfc.h"
27 #include "wine/list.h"
29 #ifndef UUID_DEFINED
30 #define UUID_DEFINED
31 typedef GUID UUID;
32 #endif
34 #define TRUE 1
35 #define FALSE 0
37 typedef struct _attr_t attr_t;
38 typedef struct _expr_t expr_t;
39 typedef struct _type_t type_t;
40 typedef struct _typeref_t typeref_t;
41 typedef struct _var_t var_t;
42 typedef struct _pident_t pident_t;
43 typedef struct _func_t func_t;
44 typedef struct _ifref_t ifref_t;
45 typedef struct _typelib_entry_t typelib_entry_t;
46 typedef struct _importlib_t importlib_t;
47 typedef struct _importinfo_t importinfo_t;
48 typedef struct _typelib_t typelib_t;
50 typedef struct list attr_list_t;
51 typedef struct list str_list_t;
52 typedef struct list func_list_t;
53 typedef struct list expr_list_t;
54 typedef struct list var_list_t;
55 typedef struct list pident_list_t;
56 typedef struct list ifref_list_t;
57 typedef struct list array_dims_t;
59 enum attr_type
61 ATTR_AGGREGATABLE,
62 ATTR_APPOBJECT,
63 ATTR_ASYNC,
64 ATTR_AUTO_HANDLE,
65 ATTR_BINDABLE,
66 ATTR_CALLAS,
67 ATTR_CASE,
68 ATTR_CONTEXTHANDLE,
69 ATTR_CONTROL,
70 ATTR_DEFAULT,
71 ATTR_DEFAULTCOLLELEM,
72 ATTR_DEFAULTVALUE_EXPR,
73 ATTR_DEFAULTVALUE_STRING,
74 ATTR_DEFAULTVTABLE,
75 ATTR_DISPINTERFACE,
76 ATTR_DISPLAYBIND,
77 ATTR_DLLNAME,
78 ATTR_DUAL,
79 ATTR_ENDPOINT,
80 ATTR_ENTRY_ORDINAL,
81 ATTR_ENTRY_STRING,
82 ATTR_EXPLICIT_HANDLE,
83 ATTR_HANDLE,
84 ATTR_HELPCONTEXT,
85 ATTR_HELPFILE,
86 ATTR_HELPSTRING,
87 ATTR_HELPSTRINGCONTEXT,
88 ATTR_HELPSTRINGDLL,
89 ATTR_HIDDEN,
90 ATTR_ID,
91 ATTR_IDEMPOTENT,
92 ATTR_IIDIS,
93 ATTR_IMMEDIATEBIND,
94 ATTR_IMPLICIT_HANDLE,
95 ATTR_IN,
96 ATTR_INPUTSYNC,
97 ATTR_LENGTHIS,
98 ATTR_LOCAL,
99 ATTR_NONBROWSABLE,
100 ATTR_NONCREATABLE,
101 ATTR_NONEXTENSIBLE,
102 ATTR_OBJECT,
103 ATTR_ODL,
104 ATTR_OLEAUTOMATION,
105 ATTR_OPTIONAL,
106 ATTR_OUT,
107 ATTR_POINTERDEFAULT,
108 ATTR_POINTERTYPE,
109 ATTR_PROPGET,
110 ATTR_PROPPUT,
111 ATTR_PROPPUTREF,
112 ATTR_PUBLIC,
113 ATTR_RANGE,
114 ATTR_READONLY,
115 ATTR_REQUESTEDIT,
116 ATTR_RESTRICTED,
117 ATTR_RETVAL,
118 ATTR_SIZEIS,
119 ATTR_SOURCE,
120 ATTR_STRING,
121 ATTR_SWITCHIS,
122 ATTR_SWITCHTYPE,
123 ATTR_TRANSMITAS,
124 ATTR_UUID,
125 ATTR_V1ENUM,
126 ATTR_VARARG,
127 ATTR_VERSION,
128 ATTR_WIREMARSHAL
131 enum expr_type
133 EXPR_VOID,
134 EXPR_NUM,
135 EXPR_HEXNUM,
136 EXPR_IDENTIFIER,
137 EXPR_NEG,
138 EXPR_NOT,
139 EXPR_PPTR,
140 EXPR_CAST,
141 EXPR_SIZEOF,
142 EXPR_SHL,
143 EXPR_SHR,
144 EXPR_MUL,
145 EXPR_DIV,
146 EXPR_ADD,
147 EXPR_SUB,
148 EXPR_AND,
149 EXPR_OR,
150 EXPR_COND,
151 EXPR_TRUEFALSE,
154 enum type_kind
156 TKIND_PRIMITIVE = -1,
157 TKIND_ENUM,
158 TKIND_RECORD,
159 TKIND_MODULE,
160 TKIND_INTERFACE,
161 TKIND_DISPATCH,
162 TKIND_COCLASS,
163 TKIND_ALIAS,
164 TKIND_UNION,
165 TKIND_MAX
168 struct str_list_entry_t
170 char *str;
171 struct list entry;
174 struct _attr_t {
175 enum attr_type type;
176 union {
177 unsigned long ival;
178 void *pval;
179 } u;
180 /* parser-internal */
181 struct list entry;
184 struct _expr_t {
185 enum expr_type type;
186 const expr_t *ref;
187 union {
188 long lval;
189 const char *sval;
190 const expr_t *ext;
191 type_t *tref;
192 } u;
193 const expr_t *ext2;
194 int is_const;
195 long cval;
196 /* parser-internal */
197 struct list entry;
200 struct _type_t {
201 const char *name;
202 enum type_kind kind;
203 unsigned char type;
204 struct _type_t *ref;
205 const attr_list_t *attrs;
206 func_list_t *funcs; /* interfaces and modules */
207 var_list_t *fields; /* interfaces, structures and enumerations */
208 ifref_list_t *ifaces; /* coclasses */
209 type_t *orig; /* dup'd types */
210 unsigned int typestring_offset;
211 int ignore, is_const, sign;
212 int defined, written, user_types_registered;
213 int typelib_idx;
216 struct _var_t {
217 char *name;
218 array_dims_t *array;
219 type_t *type;
220 var_list_t *args; /* for function pointers */
221 attr_list_t *attrs;
222 expr_t *eval;
224 /* parser-internal */
225 struct list entry;
228 struct _pident_t {
229 var_t *var;
230 int ptr_level;
232 /* parser-internal */
233 struct list entry;
236 struct _func_t {
237 var_t *def;
238 var_list_t *args;
239 int ignore, idx;
241 /* parser-internal */
242 struct list entry;
245 struct _ifref_t {
246 type_t *iface;
247 attr_list_t *attrs;
249 /* parser-internal */
250 struct list entry;
253 struct _typelib_entry_t {
254 type_t *type;
255 struct list entry;
258 struct _importinfo_t {
259 int offset;
260 GUID guid;
261 int flags;
262 int id;
264 char *name;
266 importlib_t *importlib;
269 struct _importlib_t {
270 char *name;
272 int version;
273 GUID guid;
275 importinfo_t *importinfos;
276 int ntypeinfos;
278 int allocated;
280 struct list entry;
283 struct _typelib_t {
284 char *name;
285 char *filename;
286 attr_list_t *attrs;
287 struct list entries;
288 struct list importlibs;
291 void init_types(void);
293 type_t *duptype(type_t *t, int dupname);
294 type_t *alias(type_t *t, const char *name);
296 int is_ptr(const type_t *t);
297 int is_var_ptr(const var_t *v);
298 int cant_be_null(const var_t *v);
300 #endif