Bug fixes for _NO_EXTENSIONS mode.
[wine/testsucceed.git] / tools / widl / widltypes.h
blobdb27fd237a2356c91fd1c5702d288f8049806edc
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef __WIDL_WIDLTYPES_H
22 #define __WIDL_WIDLTYPES_H
24 #include <stdarg.h>
25 #include "guiddef.h"
26 #include "wine/rpcfc.h"
28 #ifndef UUID_DEFINED
29 #define UUID_DEFINED
30 typedef GUID UUID;
31 #endif
33 #define TRUE 1
34 #define FALSE 0
36 typedef struct _attr_t attr_t;
37 typedef struct _expr_t expr_t;
38 typedef struct _type_t type_t;
39 typedef struct _typeref_t typeref_t;
40 typedef struct _var_t var_t;
41 typedef struct _func_t func_t;
42 typedef struct _ifref_t ifref_t;
43 typedef struct _class_t class_t;
44 typedef struct _typelib_entry_t typelib_entry_t;
45 typedef struct _typelib_t typelib_t;
47 #define DECL_LINK(type) \
48 type *l_next; \
49 type *l_prev;
51 #define LINK(x,y) do { x->l_next = y; if (y) y->l_prev = x; } while (0)
53 #define INIT_LINK(x) do { x->l_next = NULL; x->l_prev = NULL; } while (0)
54 #define NEXT_LINK(x) ((x)->l_next)
55 #define PREV_LINK(x) ((x)->l_prev)
57 enum attr_type
59 ATTR_ASYNC,
60 ATTR_AUTO_HANDLE,
61 ATTR_CALLAS,
62 ATTR_CASE,
63 ATTR_CONTEXTHANDLE,
64 ATTR_CONTROL,
65 ATTR_DEFAULT,
66 ATTR_DEFAULTVALUE_EXPR,
67 ATTR_DEFAULTVALUE_STRING,
68 ATTR_DISPINTERFACE,
69 ATTR_DLLNAME,
70 ATTR_DUAL,
71 ATTR_ENDPOINT,
72 ATTR_ENTRY_ORDINAL,
73 ATTR_ENTRY_STRING,
74 ATTR_EXPLICIT_HANDLE,
75 ATTR_HANDLE,
76 ATTR_HELPCONTEXT,
77 ATTR_HELPFILE,
78 ATTR_HELPSTRING,
79 ATTR_HELPSTRINGCONTEXT,
80 ATTR_HELPSTRINGDLL,
81 ATTR_HIDDEN,
82 ATTR_ID,
83 ATTR_IDEMPOTENT,
84 ATTR_IIDIS,
85 ATTR_IMPLICIT_HANDLE,
86 ATTR_IN,
87 ATTR_INPUTSYNC,
88 ATTR_LENGTHIS,
89 ATTR_LOCAL,
90 ATTR_NONCREATABLE,
91 ATTR_OBJECT,
92 ATTR_ODL,
93 ATTR_OLEAUTOMATION,
94 ATTR_OPTIONAL,
95 ATTR_OUT,
96 ATTR_POINTERDEFAULT,
97 ATTR_POINTERTYPE,
98 ATTR_PROPGET,
99 ATTR_PROPPUT,
100 ATTR_PROPPUTREF,
101 ATTR_PUBLIC,
102 ATTR_READONLY,
103 ATTR_RESTRICTED,
104 ATTR_RETVAL,
105 ATTR_SIZEIS,
106 ATTR_SOURCE,
107 ATTR_STRING,
108 ATTR_SWITCHIS,
109 ATTR_SWITCHTYPE,
110 ATTR_TRANSMITAS,
111 ATTR_UUID,
112 ATTR_V1ENUM,
113 ATTR_VARARG,
114 ATTR_VERSION,
115 ATTR_WIREMARSHAL
118 enum expr_type
120 EXPR_VOID,
121 EXPR_NUM,
122 EXPR_HEXNUM,
123 EXPR_IDENTIFIER,
124 EXPR_NEG,
125 EXPR_NOT,
126 EXPR_PPTR,
127 EXPR_CAST,
128 EXPR_SIZEOF,
129 EXPR_SHL,
130 EXPR_SHR,
131 EXPR_MUL,
132 EXPR_DIV,
133 EXPR_ADD,
134 EXPR_SUB,
135 EXPR_AND,
136 EXPR_OR,
137 EXPR_COND,
140 enum type_kind
142 TKIND_ENUM = 0,
143 TKIND_RECORD,
144 TKIND_MODULE,
145 TKIND_INTERFACE,
146 TKIND_DISPATCH,
147 TKIND_COCLASS,
148 TKIND_ALIAS,
149 TKIND_UNION,
150 TKIND_MAX
153 struct _attr_t {
154 enum attr_type type;
155 union {
156 unsigned long ival;
157 void *pval;
158 } u;
159 /* parser-internal */
160 DECL_LINK(attr_t)
163 struct _expr_t {
164 enum expr_type type;
165 expr_t *ref;
166 union {
167 long lval;
168 char *sval;
169 expr_t *ext;
170 typeref_t *tref;
171 } u;
172 expr_t *ext2;
173 int is_const;
174 long cval;
175 /* parser-internal */
176 DECL_LINK(expr_t)
179 struct _type_t {
180 char *name;
181 unsigned char type;
182 struct _type_t *ref;
183 char *rname;
184 attr_t *attrs;
185 func_t *funcs;
186 var_t *fields;
187 int ignore, is_const, sign;
188 int defined, written;
189 int typelib_idx;
190 /* parser-internal */
191 DECL_LINK(type_t)
194 struct _typeref_t {
195 char *name;
196 type_t *ref;
197 int uniq;
200 struct _var_t {
201 char *name;
202 int ptr_level;
203 expr_t *array;
204 type_t *type;
205 var_t *args; /* for function pointers */
206 char *tname;
207 attr_t *attrs;
208 expr_t *eval;
209 long lval;
211 /* parser-internal */
212 DECL_LINK(var_t)
215 struct _func_t {
216 var_t *def;
217 var_t *args;
218 int ignore, idx;
220 /* parser-internal */
221 DECL_LINK(func_t)
224 struct _ifref_t {
225 type_t *iface;
226 attr_t *attrs;
228 /* parser-internal */
229 DECL_LINK(ifref_t)
232 struct _class_t {
233 char *name;
234 attr_t *attrs;
235 ifref_t *ifaces;
237 /* parser-internal */
238 DECL_LINK(class_t)
241 struct _typelib_entry_t {
242 enum type_kind kind;
243 union {
244 class_t *class;
245 type_t *interface;
246 type_t *module;
247 type_t *structure;
248 type_t *enumeration;
249 var_t *tdef;
250 } u;
251 DECL_LINK(typelib_entry_t)
254 struct _typelib_t {
255 char *name;
256 char *filename;
257 attr_t *attrs;
258 typelib_entry_t *entry;
261 #endif