- add ZBuffer write support
[wine/multimedia.git] / tools / widl / widltypes.h
blobd784a391b16c7311552cce691b44b1f717ee4411
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 "windef.h"
26 #include "winbase.h"
27 #include "guiddef.h"
28 #include "wine/rpcfc.h"
30 #ifndef UUID_DEFINED
31 #define UUID_DEFINED
32 typedef GUID UUID;
33 #endif
35 typedef struct _attr_t attr_t;
36 typedef struct _expr_t expr_t;
37 typedef struct _type_t type_t;
38 typedef struct _typeref_t typeref_t;
39 typedef struct _var_t var_t;
40 typedef struct _func_t func_t;
42 #define DECL_LINK(type) \
43 type *l_next; \
44 type *l_prev;
46 #define LINK(x,y) do { x->l_next = y; if (y) y->l_prev = x; } while (0)
48 #define INIT_LINK(x) do { x->l_next = NULL; x->l_prev = NULL; } while (0)
49 #define NEXT_LINK(x) ((x)->l_next)
50 #define PREV_LINK(x) ((x)->l_prev)
52 enum attr_type
54 ATTR_ASYNC,
55 ATTR_CALLAS,
56 ATTR_CASE,
57 ATTR_CONTEXTHANDLE,
58 ATTR_DEFAULT,
59 ATTR_IDEMPOTENT,
60 ATTR_IIDIS,
61 ATTR_IN,
62 ATTR_LENGTHIS,
63 ATTR_LOCAL,
64 ATTR_OBJECT,
65 ATTR_OLEAUTOMATION,
66 ATTR_OUT,
67 ATTR_POINTERDEFAULT,
68 ATTR_POINTERTYPE,
69 ATTR_SIZEIS,
70 ATTR_STRING,
71 ATTR_SWITCHIS,
72 ATTR_SWITCHTYPE,
73 ATTR_UUID,
74 ATTR_V1ENUM,
75 ATTR_VERSION,
76 ATTR_WIREMARSHAL,
79 enum expr_type
81 EXPR_VOID,
82 EXPR_NUM,
83 EXPR_HEXNUM,
84 EXPR_IDENTIFIER,
85 EXPR_NEG,
86 EXPR_NOT,
87 EXPR_PPTR,
88 EXPR_CAST,
89 EXPR_SIZEOF,
90 EXPR_SHL,
91 EXPR_SHR,
92 EXPR_MUL,
93 EXPR_DIV,
94 EXPR_ADD,
95 EXPR_SUB,
96 EXPR_AND,
97 EXPR_OR,
100 struct _attr_t {
101 enum attr_type type;
102 union {
103 DWORD ival;
104 void *pval;
105 } u;
106 /* parser-internal */
107 DECL_LINK(attr_t)
110 struct _expr_t {
111 enum expr_type type;
112 expr_t *ref;
113 union {
114 long lval;
115 char *sval;
116 expr_t *ext;
117 typeref_t *tref;
118 } u;
119 int is_const;
120 long cval;
121 /* parser-internal */
122 DECL_LINK(expr_t)
125 struct _type_t {
126 char *name;
127 BYTE type;
128 struct _type_t *ref;
129 char *rname;
130 attr_t *attrs;
131 func_t *funcs;
132 var_t *fields;
133 int ignore, is_const, sign;
134 int defined, written;
136 /* parser-internal */
137 DECL_LINK(type_t)
140 struct _typeref_t {
141 char *name;
142 type_t *ref;
143 int uniq;
146 struct _var_t {
147 char *name;
148 int ptr_level;
149 expr_t *array;
150 type_t *type;
151 var_t *args; /* for function pointers */
152 char *tname;
153 attr_t *attrs;
154 expr_t *eval;
155 long lval;
157 /* parser-internal */
158 DECL_LINK(var_t)
161 struct _func_t {
162 var_t *def;
163 var_t *args;
164 int ignore, idx;
166 /* parser-internal */
167 DECL_LINK(func_t)
170 #endif