Added missing \n in trace.
[wine.git] / tools / widl / widltypes.h
blobc4843f348218cf30129f9cf78ca390770f5d943b
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;
41 typedef struct _ifref_t ifref_t;
42 typedef struct _class_t class_t;
44 #define DECL_LINK(type) \
45 type *l_next; \
46 type *l_prev;
48 #define LINK(x,y) do { x->l_next = y; if (y) y->l_prev = x; } while (0)
50 #define INIT_LINK(x) do { x->l_next = NULL; x->l_prev = NULL; } while (0)
51 #define NEXT_LINK(x) ((x)->l_next)
52 #define PREV_LINK(x) ((x)->l_prev)
54 enum attr_type
56 ATTR_ASYNC,
57 ATTR_CALLAS,
58 ATTR_CASE,
59 ATTR_CONTEXTHANDLE,
60 ATTR_DEFAULT,
61 ATTR_DLLNAME,
62 ATTR_DUAL,
63 ATTR_ENTRY_STRING,
64 ATTR_ENTRY_ORDINAL,
65 ATTR_HELPSTRING,
66 ATTR_ID,
67 ATTR_IDEMPOTENT,
68 ATTR_IIDIS,
69 ATTR_IN,
70 ATTR_INPUTSYNC,
71 ATTR_LENGTHIS,
72 ATTR_LOCAL,
73 ATTR_OBJECT,
74 ATTR_ODL,
75 ATTR_OLEAUTOMATION,
76 ATTR_OUT,
77 ATTR_POINTERDEFAULT,
78 ATTR_POINTERTYPE,
79 ATTR_PUBLIC,
80 ATTR_READONLY,
81 ATTR_RETVAL,
82 ATTR_SIZEIS,
83 ATTR_SOURCE,
84 ATTR_STRING,
85 ATTR_SWITCHIS,
86 ATTR_SWITCHTYPE,
87 ATTR_UUID,
88 ATTR_V1ENUM,
89 ATTR_VERSION,
90 ATTR_WIREMARSHAL,
93 enum expr_type
95 EXPR_VOID,
96 EXPR_NUM,
97 EXPR_HEXNUM,
98 EXPR_IDENTIFIER,
99 EXPR_NEG,
100 EXPR_NOT,
101 EXPR_PPTR,
102 EXPR_CAST,
103 EXPR_SIZEOF,
104 EXPR_SHL,
105 EXPR_SHR,
106 EXPR_MUL,
107 EXPR_DIV,
108 EXPR_ADD,
109 EXPR_SUB,
110 EXPR_AND,
111 EXPR_OR,
114 struct _attr_t {
115 enum attr_type type;
116 union {
117 DWORD ival;
118 void *pval;
119 } u;
120 /* parser-internal */
121 DECL_LINK(attr_t)
124 struct _expr_t {
125 enum expr_type type;
126 expr_t *ref;
127 union {
128 long lval;
129 char *sval;
130 expr_t *ext;
131 typeref_t *tref;
132 } u;
133 int is_const;
134 long cval;
135 /* parser-internal */
136 DECL_LINK(expr_t)
139 struct _type_t {
140 char *name;
141 BYTE type;
142 struct _type_t *ref;
143 char *rname;
144 attr_t *attrs;
145 func_t *funcs;
146 var_t *fields;
147 int ignore, is_const, sign;
148 int defined, written;
150 /* parser-internal */
151 DECL_LINK(type_t)
154 struct _typeref_t {
155 char *name;
156 type_t *ref;
157 int uniq;
160 struct _var_t {
161 char *name;
162 int ptr_level;
163 expr_t *array;
164 type_t *type;
165 var_t *args; /* for function pointers */
166 char *tname;
167 attr_t *attrs;
168 expr_t *eval;
169 long lval;
171 /* parser-internal */
172 DECL_LINK(var_t)
175 struct _func_t {
176 var_t *def;
177 var_t *args;
178 int ignore, idx;
180 /* parser-internal */
181 DECL_LINK(func_t)
184 struct _ifref_t {
185 type_t *iface;
186 attr_t *attrs;
188 /* parser-internal */
189 DECL_LINK(ifref_t)
192 struct _class_t {
193 char *name;
194 attr_t *attrs;
195 ifref_t *ifaces;
197 /* parser-internal */
198 DECL_LINK(class_t)
201 #endif