2002-07-16 03:20:45 +00:00
|
|
|
/*
|
|
|
|
* IDL Compiler
|
|
|
|
*
|
|
|
|
* Copyright 2002 Ove Kaaven
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 12:49:52 +00:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2002-07-16 03:20:45 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __WIDL_WIDLTYPES_H
|
|
|
|
#define __WIDL_WIDLTYPES_H
|
|
|
|
|
2003-09-05 23:08:26 +00:00
|
|
|
#include <stdarg.h>
|
2002-12-15 01:13:18 +00:00
|
|
|
#include "guiddef.h"
|
2002-07-16 03:20:45 +00:00
|
|
|
#include "wine/rpcfc.h"
|
|
|
|
|
2002-12-15 01:13:18 +00:00
|
|
|
#ifndef UUID_DEFINED
|
|
|
|
#define UUID_DEFINED
|
|
|
|
typedef GUID UUID;
|
|
|
|
#endif
|
|
|
|
|
2004-04-22 03:40:01 +00:00
|
|
|
#define TRUE 1
|
|
|
|
#define FALSE 0
|
|
|
|
|
2002-07-16 03:20:45 +00:00
|
|
|
typedef struct _attr_t attr_t;
|
2002-11-12 02:12:35 +00:00
|
|
|
typedef struct _expr_t expr_t;
|
2002-07-16 03:20:45 +00:00
|
|
|
typedef struct _type_t type_t;
|
|
|
|
typedef struct _typeref_t typeref_t;
|
|
|
|
typedef struct _var_t var_t;
|
|
|
|
typedef struct _func_t func_t;
|
2004-01-07 04:21:27 +00:00
|
|
|
typedef struct _ifref_t ifref_t;
|
|
|
|
typedef struct _class_t class_t;
|
2005-01-05 17:12:25 +00:00
|
|
|
typedef struct _typelib_entry_t typelib_entry_t;
|
2006-05-15 19:55:04 +00:00
|
|
|
typedef struct _importlib_t importlib_t;
|
|
|
|
typedef struct _importinfo_t importinfo_t;
|
2005-01-05 17:12:25 +00:00
|
|
|
typedef struct _typelib_t typelib_t;
|
2002-07-16 03:20:45 +00:00
|
|
|
|
|
|
|
#define DECL_LINK(type) \
|
|
|
|
type *l_next; \
|
2006-06-27 09:51:07 +00:00
|
|
|
type *l_prev
|
2002-07-16 03:20:45 +00:00
|
|
|
|
|
|
|
#define LINK(x,y) do { x->l_next = y; if (y) y->l_prev = x; } while (0)
|
|
|
|
|
|
|
|
#define INIT_LINK(x) do { x->l_next = NULL; x->l_prev = NULL; } while (0)
|
|
|
|
#define NEXT_LINK(x) ((x)->l_next)
|
|
|
|
#define PREV_LINK(x) ((x)->l_prev)
|
|
|
|
|
2006-06-01 14:40:10 +00:00
|
|
|
#define END_OF_LIST(list) \
|
|
|
|
do { \
|
|
|
|
if (list) { \
|
|
|
|
while (NEXT_LINK(list)) \
|
|
|
|
list = NEXT_LINK(list); \
|
|
|
|
} \
|
|
|
|
} while(0)
|
|
|
|
|
2002-08-13 03:30:58 +00:00
|
|
|
enum attr_type
|
|
|
|
{
|
2006-02-09 11:10:08 +00:00
|
|
|
ATTR_AGGREGATABLE,
|
|
|
|
ATTR_APPOBJECT,
|
2002-08-13 03:30:58 +00:00
|
|
|
ATTR_ASYNC,
|
2005-02-23 20:31:07 +00:00
|
|
|
ATTR_AUTO_HANDLE,
|
2005-12-16 11:40:17 +00:00
|
|
|
ATTR_BINDABLE,
|
2002-08-13 03:30:58 +00:00
|
|
|
ATTR_CALLAS,
|
2002-12-03 19:12:07 +00:00
|
|
|
ATTR_CASE,
|
|
|
|
ATTR_CONTEXTHANDLE,
|
2005-01-09 17:59:44 +00:00
|
|
|
ATTR_CONTROL,
|
2002-08-13 03:30:58 +00:00
|
|
|
ATTR_DEFAULT,
|
2006-02-09 11:10:08 +00:00
|
|
|
ATTR_DEFAULTCOLLELEM,
|
2005-01-10 14:22:24 +00:00
|
|
|
ATTR_DEFAULTVALUE_EXPR,
|
|
|
|
ATTR_DEFAULTVALUE_STRING,
|
2006-02-09 11:10:08 +00:00
|
|
|
ATTR_DEFAULTVTABLE,
|
2005-03-28 10:01:20 +00:00
|
|
|
ATTR_DISPINTERFACE,
|
2005-12-16 11:40:17 +00:00
|
|
|
ATTR_DISPLAYBIND,
|
2004-01-07 04:21:27 +00:00
|
|
|
ATTR_DLLNAME,
|
|
|
|
ATTR_DUAL,
|
2004-04-26 23:29:59 +00:00
|
|
|
ATTR_ENDPOINT,
|
2004-01-07 04:21:27 +00:00
|
|
|
ATTR_ENTRY_ORDINAL,
|
2005-03-28 10:01:20 +00:00
|
|
|
ATTR_ENTRY_STRING,
|
2005-02-23 20:31:07 +00:00
|
|
|
ATTR_EXPLICIT_HANDLE,
|
2004-04-19 23:08:22 +00:00
|
|
|
ATTR_HANDLE,
|
2005-01-10 16:08:36 +00:00
|
|
|
ATTR_HELPCONTEXT,
|
|
|
|
ATTR_HELPFILE,
|
2004-01-07 04:21:27 +00:00
|
|
|
ATTR_HELPSTRING,
|
2005-01-10 16:08:36 +00:00
|
|
|
ATTR_HELPSTRINGCONTEXT,
|
|
|
|
ATTR_HELPSTRINGDLL,
|
2005-01-09 17:59:44 +00:00
|
|
|
ATTR_HIDDEN,
|
2004-01-07 04:21:27 +00:00
|
|
|
ATTR_ID,
|
2002-12-03 19:12:07 +00:00
|
|
|
ATTR_IDEMPOTENT,
|
2002-08-13 03:30:58 +00:00
|
|
|
ATTR_IIDIS,
|
2006-02-09 11:10:08 +00:00
|
|
|
ATTR_IMMEDIATEBIND,
|
2005-02-23 20:31:07 +00:00
|
|
|
ATTR_IMPLICIT_HANDLE,
|
2002-08-13 03:30:58 +00:00
|
|
|
ATTR_IN,
|
2004-02-11 23:57:58 +00:00
|
|
|
ATTR_INPUTSYNC,
|
2002-12-03 19:12:07 +00:00
|
|
|
ATTR_LENGTHIS,
|
2002-08-13 03:30:58 +00:00
|
|
|
ATTR_LOCAL,
|
2006-02-09 11:10:08 +00:00
|
|
|
ATTR_NONBROWSABLE,
|
2005-02-03 13:34:28 +00:00
|
|
|
ATTR_NONCREATABLE,
|
2006-02-09 11:10:08 +00:00
|
|
|
ATTR_NONEXTENSIBLE,
|
2002-08-13 03:30:58 +00:00
|
|
|
ATTR_OBJECT,
|
2004-01-07 04:21:27 +00:00
|
|
|
ATTR_ODL,
|
2002-08-13 03:30:58 +00:00
|
|
|
ATTR_OLEAUTOMATION,
|
2005-01-03 14:26:17 +00:00
|
|
|
ATTR_OPTIONAL,
|
2002-08-13 03:30:58 +00:00
|
|
|
ATTR_OUT,
|
|
|
|
ATTR_POINTERDEFAULT,
|
|
|
|
ATTR_POINTERTYPE,
|
2004-10-05 02:14:54 +00:00
|
|
|
ATTR_PROPGET,
|
|
|
|
ATTR_PROPPUT,
|
2005-02-01 18:48:25 +00:00
|
|
|
ATTR_PROPPUTREF,
|
2004-01-07 04:21:27 +00:00
|
|
|
ATTR_PUBLIC,
|
2005-09-12 20:13:40 +00:00
|
|
|
ATTR_RANGE,
|
2004-01-07 04:21:27 +00:00
|
|
|
ATTR_READONLY,
|
2006-02-09 11:10:08 +00:00
|
|
|
ATTR_REQUESTEDIT,
|
2005-01-09 17:59:44 +00:00
|
|
|
ATTR_RESTRICTED,
|
2004-01-07 04:21:27 +00:00
|
|
|
ATTR_RETVAL,
|
2002-12-03 19:12:07 +00:00
|
|
|
ATTR_SIZEIS,
|
2004-01-07 04:21:27 +00:00
|
|
|
ATTR_SOURCE,
|
2002-08-13 03:30:58 +00:00
|
|
|
ATTR_STRING,
|
2002-12-03 19:12:07 +00:00
|
|
|
ATTR_SWITCHIS,
|
|
|
|
ATTR_SWITCHTYPE,
|
2004-04-26 23:29:59 +00:00
|
|
|
ATTR_TRANSMITAS,
|
2002-11-12 02:12:35 +00:00
|
|
|
ATTR_UUID,
|
2002-08-13 03:30:58 +00:00
|
|
|
ATTR_V1ENUM,
|
2005-01-03 14:26:17 +00:00
|
|
|
ATTR_VARARG,
|
2002-12-03 19:12:07 +00:00
|
|
|
ATTR_VERSION,
|
2005-03-28 10:01:20 +00:00
|
|
|
ATTR_WIREMARSHAL
|
2002-08-13 03:30:58 +00:00
|
|
|
};
|
|
|
|
|
2002-11-12 02:12:35 +00:00
|
|
|
enum expr_type
|
|
|
|
{
|
|
|
|
EXPR_VOID,
|
|
|
|
EXPR_NUM,
|
2002-11-30 01:49:46 +00:00
|
|
|
EXPR_HEXNUM,
|
2002-11-12 02:12:35 +00:00
|
|
|
EXPR_IDENTIFIER,
|
|
|
|
EXPR_NEG,
|
2002-12-03 19:12:07 +00:00
|
|
|
EXPR_NOT,
|
2002-11-12 02:12:35 +00:00
|
|
|
EXPR_PPTR,
|
|
|
|
EXPR_CAST,
|
2002-11-30 01:49:46 +00:00
|
|
|
EXPR_SIZEOF,
|
2002-11-12 02:12:35 +00:00
|
|
|
EXPR_SHL,
|
|
|
|
EXPR_SHR,
|
|
|
|
EXPR_MUL,
|
|
|
|
EXPR_DIV,
|
|
|
|
EXPR_ADD,
|
|
|
|
EXPR_SUB,
|
|
|
|
EXPR_AND,
|
|
|
|
EXPR_OR,
|
2004-04-19 23:08:22 +00:00
|
|
|
EXPR_COND,
|
2006-07-06 11:56:36 +00:00
|
|
|
EXPR_TRUEFALSE,
|
2002-11-12 02:12:35 +00:00
|
|
|
};
|
|
|
|
|
2005-01-05 17:12:25 +00:00
|
|
|
enum type_kind
|
|
|
|
{
|
|
|
|
TKIND_ENUM = 0,
|
|
|
|
TKIND_RECORD,
|
|
|
|
TKIND_MODULE,
|
|
|
|
TKIND_INTERFACE,
|
|
|
|
TKIND_DISPATCH,
|
|
|
|
TKIND_COCLASS,
|
|
|
|
TKIND_ALIAS,
|
|
|
|
TKIND_UNION,
|
|
|
|
TKIND_MAX
|
|
|
|
};
|
|
|
|
|
2002-07-16 03:20:45 +00:00
|
|
|
struct _attr_t {
|
2002-08-13 03:30:58 +00:00
|
|
|
enum attr_type type;
|
2002-07-16 03:20:45 +00:00
|
|
|
union {
|
2004-04-22 03:40:01 +00:00
|
|
|
unsigned long ival;
|
2002-07-16 03:20:45 +00:00
|
|
|
void *pval;
|
|
|
|
} u;
|
|
|
|
/* parser-internal */
|
2006-06-27 09:51:07 +00:00
|
|
|
DECL_LINK(attr_t);
|
2002-07-16 03:20:45 +00:00
|
|
|
};
|
|
|
|
|
2002-11-12 02:12:35 +00:00
|
|
|
struct _expr_t {
|
|
|
|
enum expr_type type;
|
2006-02-07 11:28:20 +00:00
|
|
|
const expr_t *ref;
|
2002-11-12 02:12:35 +00:00
|
|
|
union {
|
|
|
|
long lval;
|
2006-02-07 11:28:20 +00:00
|
|
|
const char *sval;
|
|
|
|
const expr_t *ext;
|
|
|
|
const typeref_t *tref;
|
2002-11-12 02:12:35 +00:00
|
|
|
} u;
|
2006-02-07 11:28:20 +00:00
|
|
|
const expr_t *ext2;
|
2002-11-30 01:49:46 +00:00
|
|
|
int is_const;
|
|
|
|
long cval;
|
2002-11-12 02:12:35 +00:00
|
|
|
/* parser-internal */
|
2006-06-27 09:51:07 +00:00
|
|
|
DECL_LINK(expr_t);
|
2002-11-12 02:12:35 +00:00
|
|
|
};
|
|
|
|
|
2002-07-16 03:20:45 +00:00
|
|
|
struct _type_t {
|
2006-06-23 21:14:28 +00:00
|
|
|
const char *name;
|
2004-04-22 03:40:01 +00:00
|
|
|
unsigned char type;
|
2002-07-16 03:20:45 +00:00
|
|
|
struct _type_t *ref;
|
2006-02-07 11:32:57 +00:00
|
|
|
const attr_t *attrs;
|
2002-07-16 03:20:45 +00:00
|
|
|
func_t *funcs;
|
|
|
|
var_t *fields;
|
2002-11-12 02:12:35 +00:00
|
|
|
int ignore, is_const, sign;
|
2005-09-12 20:13:40 +00:00
|
|
|
int defined, written, user_types_registered;
|
2005-01-06 20:45:21 +00:00
|
|
|
int typelib_idx;
|
2002-07-16 03:20:45 +00:00
|
|
|
/* parser-internal */
|
2006-06-27 09:51:07 +00:00
|
|
|
DECL_LINK(type_t);
|
2002-07-16 03:20:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _typeref_t {
|
|
|
|
char *name;
|
|
|
|
type_t *ref;
|
|
|
|
int uniq;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _var_t {
|
|
|
|
char *name;
|
|
|
|
int ptr_level;
|
2002-11-12 02:12:35 +00:00
|
|
|
expr_t *array;
|
2002-07-16 03:20:45 +00:00
|
|
|
type_t *type;
|
2003-09-03 20:16:24 +00:00
|
|
|
var_t *args; /* for function pointers */
|
2006-02-07 11:31:17 +00:00
|
|
|
const char *tname;
|
2002-07-16 03:20:45 +00:00
|
|
|
attr_t *attrs;
|
2002-11-30 01:49:46 +00:00
|
|
|
expr_t *eval;
|
2002-07-16 03:20:45 +00:00
|
|
|
|
|
|
|
/* parser-internal */
|
2006-06-27 09:51:07 +00:00
|
|
|
DECL_LINK(var_t);
|
2002-07-16 03:20:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _func_t {
|
|
|
|
var_t *def;
|
|
|
|
var_t *args;
|
|
|
|
int ignore, idx;
|
|
|
|
|
|
|
|
/* parser-internal */
|
2006-06-27 09:51:07 +00:00
|
|
|
DECL_LINK(func_t);
|
2002-07-16 03:20:45 +00:00
|
|
|
};
|
|
|
|
|
2004-01-07 04:21:27 +00:00
|
|
|
struct _ifref_t {
|
|
|
|
type_t *iface;
|
|
|
|
attr_t *attrs;
|
|
|
|
|
|
|
|
/* parser-internal */
|
2006-06-27 09:51:07 +00:00
|
|
|
DECL_LINK(ifref_t);
|
2004-01-07 04:21:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _class_t {
|
|
|
|
char *name;
|
|
|
|
attr_t *attrs;
|
|
|
|
ifref_t *ifaces;
|
|
|
|
|
|
|
|
/* parser-internal */
|
2006-06-27 09:51:07 +00:00
|
|
|
DECL_LINK(class_t);
|
2004-01-07 04:21:27 +00:00
|
|
|
};
|
|
|
|
|
2005-01-05 17:12:25 +00:00
|
|
|
struct _typelib_entry_t {
|
|
|
|
enum type_kind kind;
|
|
|
|
union {
|
|
|
|
class_t *class;
|
|
|
|
type_t *interface;
|
|
|
|
type_t *module;
|
|
|
|
type_t *structure;
|
2005-01-25 20:02:09 +00:00
|
|
|
type_t *enumeration;
|
2005-02-02 19:10:02 +00:00
|
|
|
var_t *tdef;
|
2005-01-05 17:12:25 +00:00
|
|
|
} u;
|
2006-06-27 09:51:07 +00:00
|
|
|
DECL_LINK(typelib_entry_t);
|
2005-01-05 17:12:25 +00:00
|
|
|
};
|
|
|
|
|
2006-05-15 19:55:04 +00:00
|
|
|
struct _importinfo_t {
|
|
|
|
int offset;
|
|
|
|
GUID guid;
|
|
|
|
int flags;
|
|
|
|
int id;
|
|
|
|
|
|
|
|
char *name;
|
|
|
|
|
|
|
|
importlib_t *importlib;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _importlib_t {
|
|
|
|
char *name;
|
|
|
|
|
|
|
|
int version;
|
|
|
|
GUID guid;
|
|
|
|
|
|
|
|
importinfo_t *importinfos;
|
|
|
|
int ntypeinfos;
|
|
|
|
|
|
|
|
int allocated;
|
|
|
|
|
|
|
|
DECL_LINK(importlib_t);
|
|
|
|
};
|
|
|
|
|
2005-01-05 17:12:25 +00:00
|
|
|
struct _typelib_t {
|
|
|
|
char *name;
|
|
|
|
char *filename;
|
|
|
|
attr_t *attrs;
|
|
|
|
typelib_entry_t *entry;
|
2006-05-15 19:55:04 +00:00
|
|
|
importlib_t *importlibs;
|
2005-01-05 17:12:25 +00:00
|
|
|
};
|
|
|
|
|
2002-07-16 03:20:45 +00:00
|
|
|
#endif
|