Correct cases where arguments of ok() calls depend on the order in
[wine/gsoc_dplay.git] / tools / widl / widltypes.h
blob433931bdbcbeaf07cd378bed1fe0213e6d89eb81
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 #define LOWORD(l) ((unsigned short)(l))
37 #define HIWORD(l) ((unsigned short)((unsigned long)(l) >> 16))
38 #define MAKELONG(low,high) ((unsigned long)(((unsigned short)(low)) | (((unsigned long)((unsigned short)(high))) << 16)))
40 typedef struct _attr_t attr_t;
41 typedef struct _expr_t expr_t;
42 typedef struct _type_t type_t;
43 typedef struct _typeref_t typeref_t;
44 typedef struct _var_t var_t;
45 typedef struct _func_t func_t;
46 typedef struct _ifref_t ifref_t;
47 typedef struct _class_t class_t;
49 #define DECL_LINK(type) \
50 type *l_next; \
51 type *l_prev;
53 #define LINK(x,y) do { x->l_next = y; if (y) y->l_prev = x; } while (0)
55 #define INIT_LINK(x) do { x->l_next = NULL; x->l_prev = NULL; } while (0)
56 #define NEXT_LINK(x) ((x)->l_next)
57 #define PREV_LINK(x) ((x)->l_prev)
59 enum attr_type
61 ATTR_ASYNC,
62 ATTR_CALLAS,
63 ATTR_CASE,
64 ATTR_CONTEXTHANDLE,
65 ATTR_DEFAULT,
66 ATTR_DLLNAME,
67 ATTR_DUAL,
68 ATTR_ENDPOINT,
69 ATTR_ENTRY_STRING,
70 ATTR_ENTRY_ORDINAL,
71 ATTR_HANDLE,
72 ATTR_HELPSTRING,
73 ATTR_ID,
74 ATTR_IDEMPOTENT,
75 ATTR_IIDIS,
76 ATTR_IN,
77 ATTR_INPUTSYNC,
78 ATTR_LENGTHIS,
79 ATTR_LOCAL,
80 ATTR_OBJECT,
81 ATTR_ODL,
82 ATTR_OLEAUTOMATION,
83 ATTR_OUT,
84 ATTR_POINTERDEFAULT,
85 ATTR_POINTERTYPE,
86 ATTR_PROPGET,
87 ATTR_PROPPUT,
88 ATTR_PUBLIC,
89 ATTR_READONLY,
90 ATTR_RETVAL,
91 ATTR_SIZEIS,
92 ATTR_SOURCE,
93 ATTR_STRING,
94 ATTR_SWITCHIS,
95 ATTR_SWITCHTYPE,
96 ATTR_TRANSMITAS,
97 ATTR_UUID,
98 ATTR_V1ENUM,
99 ATTR_VERSION,
100 ATTR_WIREMARSHAL,
101 ATTR_DISPINTERFACE
104 enum expr_type
106 EXPR_VOID,
107 EXPR_NUM,
108 EXPR_HEXNUM,
109 EXPR_IDENTIFIER,
110 EXPR_NEG,
111 EXPR_NOT,
112 EXPR_PPTR,
113 EXPR_CAST,
114 EXPR_SIZEOF,
115 EXPR_SHL,
116 EXPR_SHR,
117 EXPR_MUL,
118 EXPR_DIV,
119 EXPR_ADD,
120 EXPR_SUB,
121 EXPR_AND,
122 EXPR_OR,
123 EXPR_COND,
126 struct _attr_t {
127 enum attr_type type;
128 union {
129 unsigned long ival;
130 void *pval;
131 } u;
132 /* parser-internal */
133 DECL_LINK(attr_t)
136 struct _expr_t {
137 enum expr_type type;
138 expr_t *ref;
139 union {
140 long lval;
141 char *sval;
142 expr_t *ext;
143 typeref_t *tref;
144 } u;
145 expr_t *ext2;
146 int is_const;
147 long cval;
148 /* parser-internal */
149 DECL_LINK(expr_t)
152 struct _type_t {
153 char *name;
154 unsigned char type;
155 struct _type_t *ref;
156 char *rname;
157 attr_t *attrs;
158 func_t *funcs;
159 var_t *fields;
160 int ignore, is_const, sign;
161 int defined, written;
163 /* parser-internal */
164 DECL_LINK(type_t)
167 struct _typeref_t {
168 char *name;
169 type_t *ref;
170 int uniq;
173 struct _var_t {
174 char *name;
175 int ptr_level;
176 expr_t *array;
177 type_t *type;
178 var_t *args; /* for function pointers */
179 char *tname;
180 attr_t *attrs;
181 expr_t *eval;
182 long lval;
184 /* parser-internal */
185 DECL_LINK(var_t)
188 struct _func_t {
189 var_t *def;
190 var_t *args;
191 int ignore, idx;
193 /* parser-internal */
194 DECL_LINK(func_t)
197 struct _ifref_t {
198 type_t *iface;
199 attr_t *attrs;
201 /* parser-internal */
202 DECL_LINK(ifref_t)
205 struct _class_t {
206 char *name;
207 attr_t *attrs;
208 ifref_t *ifaces;
210 /* parser-internal */
211 DECL_LINK(class_t)
214 #endif