cmd.exe: Handle command line as Unicode.
[wine.git] / tools / widl / widltypes.h
blob69a137932c36292eebcacc01c94288aecf3fdcea
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 typelib_idx;
212 unsigned int ignore : 1;
213 unsigned int is_const : 1;
214 unsigned int defined : 1;
215 unsigned int written : 1;
216 unsigned int user_types_registered : 1;
217 unsigned int tfswrite : 1; /* if the type needs to be written to the TFS */
218 int sign : 2;
221 struct _var_t {
222 char *name;
223 array_dims_t *array;
224 type_t *type;
225 var_list_t *args; /* for function pointers */
226 attr_list_t *attrs;
227 expr_t *eval;
228 size_t corrdesc; /* offset to correlation descriptor (e.g., for unions) */
230 /* parser-internal */
231 struct list entry;
234 struct _pident_t {
235 var_t *var;
236 int ptr_level;
238 /* parser-internal */
239 struct list entry;
242 struct _func_t {
243 var_t *def;
244 var_list_t *args;
245 int ignore, idx;
247 /* parser-internal */
248 struct list entry;
251 struct _ifref_t {
252 type_t *iface;
253 attr_list_t *attrs;
255 /* parser-internal */
256 struct list entry;
259 struct _typelib_entry_t {
260 type_t *type;
261 struct list entry;
264 struct _importinfo_t {
265 int offset;
266 GUID guid;
267 int flags;
268 int id;
270 char *name;
272 importlib_t *importlib;
275 struct _importlib_t {
276 char *name;
278 int version;
279 GUID guid;
281 importinfo_t *importinfos;
282 int ntypeinfos;
284 int allocated;
286 struct list entry;
289 struct _typelib_t {
290 char *name;
291 char *filename;
292 attr_list_t *attrs;
293 struct list entries;
294 struct list importlibs;
297 void init_types(void);
299 type_t *duptype(type_t *t, int dupname);
300 type_t *alias(type_t *t, const char *name);
302 int is_ptr(const type_t *t);
303 int is_var_ptr(const var_t *v);
304 int cant_be_null(const var_t *v);
306 #endif