Release 20040914.
[wine/gsoc-2012-control.git] / tools / widl / widltypes.h
blob799d05ba0b6c7be03374cc0c9be5e36a2c66eec5
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_PUBLIC,
87 ATTR_READONLY,
88 ATTR_RETVAL,
89 ATTR_SIZEIS,
90 ATTR_SOURCE,
91 ATTR_STRING,
92 ATTR_SWITCHIS,
93 ATTR_SWITCHTYPE,
94 ATTR_TRANSMITAS,
95 ATTR_UUID,
96 ATTR_V1ENUM,
97 ATTR_VERSION,
98 ATTR_WIREMARSHAL,
101 enum expr_type
103 EXPR_VOID,
104 EXPR_NUM,
105 EXPR_HEXNUM,
106 EXPR_IDENTIFIER,
107 EXPR_NEG,
108 EXPR_NOT,
109 EXPR_PPTR,
110 EXPR_CAST,
111 EXPR_SIZEOF,
112 EXPR_SHL,
113 EXPR_SHR,
114 EXPR_MUL,
115 EXPR_DIV,
116 EXPR_ADD,
117 EXPR_SUB,
118 EXPR_AND,
119 EXPR_OR,
120 EXPR_COND,
123 struct _attr_t {
124 enum attr_type type;
125 union {
126 unsigned long ival;
127 void *pval;
128 } u;
129 /* parser-internal */
130 DECL_LINK(attr_t)
133 struct _expr_t {
134 enum expr_type type;
135 expr_t *ref;
136 union {
137 long lval;
138 char *sval;
139 expr_t *ext;
140 typeref_t *tref;
141 } u;
142 expr_t *ext2;
143 int is_const;
144 long cval;
145 /* parser-internal */
146 DECL_LINK(expr_t)
149 struct _type_t {
150 char *name;
151 unsigned char type;
152 struct _type_t *ref;
153 char *rname;
154 attr_t *attrs;
155 func_t *funcs;
156 var_t *fields;
157 int ignore, is_const, sign;
158 int defined, written;
160 /* parser-internal */
161 DECL_LINK(type_t)
164 struct _typeref_t {
165 char *name;
166 type_t *ref;
167 int uniq;
170 struct _var_t {
171 char *name;
172 int ptr_level;
173 expr_t *array;
174 type_t *type;
175 var_t *args; /* for function pointers */
176 char *tname;
177 attr_t *attrs;
178 expr_t *eval;
179 long lval;
181 /* parser-internal */
182 DECL_LINK(var_t)
185 struct _func_t {
186 var_t *def;
187 var_t *args;
188 int ignore, idx;
190 /* parser-internal */
191 DECL_LINK(func_t)
194 struct _ifref_t {
195 type_t *iface;
196 attr_t *attrs;
198 /* parser-internal */
199 DECL_LINK(ifref_t)
202 struct _class_t {
203 char *name;
204 attr_t *attrs;
205 ifref_t *ifaces;
207 /* parser-internal */
208 DECL_LINK(class_t)
211 #endif