2002-07-16 05:20:45 +02: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 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2002-07-16 05:20:45 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __WIDL_WIDLTYPES_H
|
|
|
|
#define __WIDL_WIDLTYPES_H
|
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
2008-12-29 13:05:27 +01:00
|
|
|
#include <assert.h>
|
2002-12-15 02:13:18 +01:00
|
|
|
#include "guiddef.h"
|
2018-06-13 04:19:11 +02:00
|
|
|
#include "ndrtypes.h"
|
2007-01-22 14:10:30 +01:00
|
|
|
#include "wine/list.h"
|
2002-07-16 05:20:45 +02:00
|
|
|
|
2002-12-15 02:13:18 +01:00
|
|
|
#ifndef UUID_DEFINED
|
|
|
|
#define UUID_DEFINED
|
|
|
|
typedef GUID UUID;
|
|
|
|
#endif
|
|
|
|
|
2004-04-22 05:40:01 +02:00
|
|
|
#define TRUE 1
|
|
|
|
#define FALSE 0
|
|
|
|
|
2008-04-14 12:00:20 +02:00
|
|
|
typedef struct _loc_info_t loc_info_t;
|
2002-07-16 05:20:45 +02:00
|
|
|
typedef struct _attr_t attr_t;
|
2002-11-12 03:12:35 +01:00
|
|
|
typedef struct _expr_t expr_t;
|
2002-07-16 05:20:45 +02:00
|
|
|
typedef struct _type_t type_t;
|
|
|
|
typedef struct _var_t var_t;
|
2008-04-25 11:58:24 +02:00
|
|
|
typedef struct _declarator_t declarator_t;
|
2004-01-07 05:21:27 +01:00
|
|
|
typedef struct _ifref_t ifref_t;
|
2005-01-05 18:12:25 +01:00
|
|
|
typedef struct _typelib_entry_t typelib_entry_t;
|
2006-05-15 21:55:04 +02:00
|
|
|
typedef struct _importlib_t importlib_t;
|
|
|
|
typedef struct _importinfo_t importinfo_t;
|
2005-01-05 18:12:25 +01:00
|
|
|
typedef struct _typelib_t typelib_t;
|
2007-06-14 01:13:04 +02:00
|
|
|
typedef struct _user_type_t user_type_t;
|
2007-09-28 02:38:13 +02:00
|
|
|
typedef struct _user_type_t context_handle_t;
|
2011-05-27 12:07:29 +02:00
|
|
|
typedef struct _user_type_t generic_handle_t;
|
2008-04-24 20:06:42 +02:00
|
|
|
typedef struct _type_list_t type_list_t;
|
2008-04-24 20:06:28 +02:00
|
|
|
typedef struct _statement_t statement_t;
|
2016-03-29 22:06:44 +02:00
|
|
|
typedef struct _warning_t warning_t;
|
2002-07-16 05:20:45 +02:00
|
|
|
|
2007-01-22 14:21:56 +01:00
|
|
|
typedef struct list attr_list_t;
|
2007-02-07 17:54:33 +01:00
|
|
|
typedef struct list str_list_t;
|
2007-01-22 14:31:40 +01:00
|
|
|
typedef struct list expr_list_t;
|
2007-01-22 14:26:12 +01:00
|
|
|
typedef struct list var_list_t;
|
2008-04-25 11:58:24 +02:00
|
|
|
typedef struct list declarator_list_t;
|
2007-01-22 14:21:56 +01:00
|
|
|
typedef struct list ifref_list_t;
|
2007-06-14 01:13:04 +02:00
|
|
|
typedef struct list user_type_list_t;
|
2007-09-28 02:38:13 +02:00
|
|
|
typedef struct list context_handle_list_t;
|
2011-05-27 12:07:29 +02:00
|
|
|
typedef struct list generic_handle_list_t;
|
2008-04-24 20:06:28 +02:00
|
|
|
typedef struct list statement_list_t;
|
2016-03-29 22:06:44 +02:00
|
|
|
typedef struct list warning_list_t;
|
2006-06-01 16:40:10 +02:00
|
|
|
|
2002-08-13 05:30:58 +02:00
|
|
|
enum attr_type
|
|
|
|
{
|
2006-02-09 12:10:08 +01:00
|
|
|
ATTR_AGGREGATABLE,
|
2009-10-26 13:15:23 +01:00
|
|
|
ATTR_ANNOTATION,
|
2006-02-09 12:10:08 +01:00
|
|
|
ATTR_APPOBJECT,
|
2002-08-13 05:30:58 +02:00
|
|
|
ATTR_ASYNC,
|
2013-08-08 16:48:34 +02:00
|
|
|
ATTR_ASYNCUUID,
|
2005-02-23 21:31:07 +01:00
|
|
|
ATTR_AUTO_HANDLE,
|
2005-12-16 12:40:17 +01:00
|
|
|
ATTR_BINDABLE,
|
2008-04-14 11:59:55 +02:00
|
|
|
ATTR_BROADCAST,
|
2002-08-13 05:30:58 +02:00
|
|
|
ATTR_CALLAS,
|
2008-04-02 13:56:13 +02:00
|
|
|
ATTR_CALLCONV, /* calling convention pseudo-attribute */
|
2002-12-03 20:12:07 +01:00
|
|
|
ATTR_CASE,
|
2010-10-21 14:13:38 +02:00
|
|
|
ATTR_CODE,
|
|
|
|
ATTR_COMMSTATUS,
|
2008-04-29 21:39:53 +02:00
|
|
|
ATTR_CONST, /* const pseudo-attribute */
|
2002-12-03 20:12:07 +01:00
|
|
|
ATTR_CONTEXTHANDLE,
|
2005-01-09 18:59:44 +01:00
|
|
|
ATTR_CONTROL,
|
2010-10-21 14:13:38 +02:00
|
|
|
ATTR_DECODE,
|
2002-08-13 05:30:58 +02:00
|
|
|
ATTR_DEFAULT,
|
2010-10-21 14:13:38 +02:00
|
|
|
ATTR_DEFAULTBIND,
|
2006-02-09 12:10:08 +01:00
|
|
|
ATTR_DEFAULTCOLLELEM,
|
2008-04-25 11:59:21 +02:00
|
|
|
ATTR_DEFAULTVALUE,
|
2006-02-09 12:10:08 +01:00
|
|
|
ATTR_DEFAULTVTABLE,
|
2010-10-21 14:13:38 +02:00
|
|
|
ATTR_DISABLECONSISTENCYCHECK,
|
2005-03-28 12:01:20 +02:00
|
|
|
ATTR_DISPINTERFACE,
|
2005-12-16 12:40:17 +01:00
|
|
|
ATTR_DISPLAYBIND,
|
2004-01-07 05:21:27 +01:00
|
|
|
ATTR_DLLNAME,
|
|
|
|
ATTR_DUAL,
|
2010-10-21 14:13:38 +02:00
|
|
|
ATTR_ENABLEALLOCATE,
|
|
|
|
ATTR_ENCODE,
|
2004-04-27 01:29:59 +02:00
|
|
|
ATTR_ENDPOINT,
|
2008-04-25 11:59:21 +02:00
|
|
|
ATTR_ENTRY,
|
2005-02-23 21:31:07 +01:00
|
|
|
ATTR_EXPLICIT_HANDLE,
|
2010-10-21 14:13:38 +02:00
|
|
|
ATTR_FAULTSTATUS,
|
|
|
|
ATTR_FORCEALLOCATE,
|
2004-04-20 01:08:22 +02:00
|
|
|
ATTR_HANDLE,
|
2005-01-10 17:08:36 +01:00
|
|
|
ATTR_HELPCONTEXT,
|
|
|
|
ATTR_HELPFILE,
|
2004-01-07 05:21:27 +01:00
|
|
|
ATTR_HELPSTRING,
|
2005-01-10 17:08:36 +01:00
|
|
|
ATTR_HELPSTRINGCONTEXT,
|
|
|
|
ATTR_HELPSTRINGDLL,
|
2005-01-09 18:59:44 +01:00
|
|
|
ATTR_HIDDEN,
|
2004-01-07 05:21:27 +01:00
|
|
|
ATTR_ID,
|
2002-12-03 20:12:07 +01:00
|
|
|
ATTR_IDEMPOTENT,
|
2010-10-21 14:13:38 +02:00
|
|
|
ATTR_IGNORE,
|
2002-08-13 05:30:58 +02:00
|
|
|
ATTR_IIDIS,
|
2006-02-09 12:10:08 +01:00
|
|
|
ATTR_IMMEDIATEBIND,
|
2005-02-23 21:31:07 +01:00
|
|
|
ATTR_IMPLICIT_HANDLE,
|
2002-08-13 05:30:58 +02:00
|
|
|
ATTR_IN,
|
2008-04-29 21:40:30 +02:00
|
|
|
ATTR_INLINE,
|
2004-02-12 00:57:58 +01:00
|
|
|
ATTR_INPUTSYNC,
|
2002-12-03 20:12:07 +01:00
|
|
|
ATTR_LENGTHIS,
|
2008-04-24 20:03:07 +02:00
|
|
|
ATTR_LIBLCID,
|
2010-10-21 14:13:38 +02:00
|
|
|
ATTR_LICENSED,
|
2002-08-13 05:30:58 +02:00
|
|
|
ATTR_LOCAL,
|
2010-10-21 14:13:38 +02:00
|
|
|
ATTR_MAYBE,
|
|
|
|
ATTR_MESSAGE,
|
|
|
|
ATTR_NOCODE,
|
2006-02-09 12:10:08 +01:00
|
|
|
ATTR_NONBROWSABLE,
|
2005-02-03 14:34:28 +01:00
|
|
|
ATTR_NONCREATABLE,
|
2006-02-09 12:10:08 +01:00
|
|
|
ATTR_NONEXTENSIBLE,
|
2010-10-21 14:13:38 +02:00
|
|
|
ATTR_NOTIFY,
|
|
|
|
ATTR_NOTIFYFLAG,
|
2002-08-13 05:30:58 +02:00
|
|
|
ATTR_OBJECT,
|
2004-01-07 05:21:27 +01:00
|
|
|
ATTR_ODL,
|
2002-08-13 05:30:58 +02:00
|
|
|
ATTR_OLEAUTOMATION,
|
2010-10-21 14:13:38 +02:00
|
|
|
ATTR_OPTIMIZE,
|
2005-01-03 15:26:17 +01:00
|
|
|
ATTR_OPTIONAL,
|
2002-08-13 05:30:58 +02:00
|
|
|
ATTR_OUT,
|
2009-06-05 16:48:24 +02:00
|
|
|
ATTR_PARAMLCID,
|
2010-10-21 14:13:38 +02:00
|
|
|
ATTR_PARTIALIGNORE,
|
2002-08-13 05:30:58 +02:00
|
|
|
ATTR_POINTERDEFAULT,
|
|
|
|
ATTR_POINTERTYPE,
|
2010-11-30 12:05:57 +01:00
|
|
|
ATTR_PROGID,
|
2004-10-05 04:14:54 +02:00
|
|
|
ATTR_PROPGET,
|
|
|
|
ATTR_PROPPUT,
|
2005-02-01 19:48:25 +01:00
|
|
|
ATTR_PROPPUTREF,
|
2010-10-21 14:13:38 +02:00
|
|
|
ATTR_PROXY,
|
2004-01-07 05:21:27 +01:00
|
|
|
ATTR_PUBLIC,
|
2005-09-12 22:13:40 +02:00
|
|
|
ATTR_RANGE,
|
2004-01-07 05:21:27 +01:00
|
|
|
ATTR_READONLY,
|
2010-10-21 14:13:38 +02:00
|
|
|
ATTR_REPRESENTAS,
|
2006-02-09 12:10:08 +01:00
|
|
|
ATTR_REQUESTEDIT,
|
2005-01-09 18:59:44 +01:00
|
|
|
ATTR_RESTRICTED,
|
2004-01-07 05:21:27 +01:00
|
|
|
ATTR_RETVAL,
|
2002-12-03 20:12:07 +01:00
|
|
|
ATTR_SIZEIS,
|
2004-01-07 05:21:27 +01:00
|
|
|
ATTR_SOURCE,
|
2008-01-06 22:25:50 +01:00
|
|
|
ATTR_STRICTCONTEXTHANDLE,
|
2002-08-13 05:30:58 +02:00
|
|
|
ATTR_STRING,
|
2002-12-03 20:12:07 +01:00
|
|
|
ATTR_SWITCHIS,
|
|
|
|
ATTR_SWITCHTYPE,
|
2010-11-30 12:05:57 +01:00
|
|
|
ATTR_THREADING,
|
2004-04-27 01:29:59 +02:00
|
|
|
ATTR_TRANSMITAS,
|
2010-10-21 14:13:38 +02:00
|
|
|
ATTR_UIDEFAULT,
|
|
|
|
ATTR_USERMARSHAL,
|
|
|
|
ATTR_USESGETLASTERROR,
|
2002-11-12 03:12:35 +01:00
|
|
|
ATTR_UUID,
|
2002-08-13 05:30:58 +02:00
|
|
|
ATTR_V1ENUM,
|
2005-01-03 15:26:17 +01:00
|
|
|
ATTR_VARARG,
|
2002-12-03 20:12:07 +01:00
|
|
|
ATTR_VERSION,
|
2010-11-30 12:05:57 +01:00
|
|
|
ATTR_VIPROGID,
|
2005-03-28 12:01:20 +02:00
|
|
|
ATTR_WIREMARSHAL
|
2002-08-13 05:30:58 +02:00
|
|
|
};
|
|
|
|
|
2002-11-12 03:12:35 +01:00
|
|
|
enum expr_type
|
|
|
|
{
|
|
|
|
EXPR_VOID,
|
|
|
|
EXPR_NUM,
|
2002-11-30 02:49:46 +01:00
|
|
|
EXPR_HEXNUM,
|
2007-07-17 13:09:03 +02:00
|
|
|
EXPR_DOUBLE,
|
2002-11-12 03:12:35 +01:00
|
|
|
EXPR_IDENTIFIER,
|
|
|
|
EXPR_NEG,
|
2002-12-03 20:12:07 +01:00
|
|
|
EXPR_NOT,
|
2002-11-12 03:12:35 +01:00
|
|
|
EXPR_PPTR,
|
|
|
|
EXPR_CAST,
|
2002-11-30 02:49:46 +01:00
|
|
|
EXPR_SIZEOF,
|
2002-11-12 03:12:35 +01:00
|
|
|
EXPR_SHL,
|
|
|
|
EXPR_SHR,
|
|
|
|
EXPR_MUL,
|
|
|
|
EXPR_DIV,
|
|
|
|
EXPR_ADD,
|
|
|
|
EXPR_SUB,
|
|
|
|
EXPR_AND,
|
|
|
|
EXPR_OR,
|
2004-04-20 01:08:22 +02:00
|
|
|
EXPR_COND,
|
2006-07-06 13:56:36 +02:00
|
|
|
EXPR_TRUEFALSE,
|
2007-12-10 14:30:42 +01:00
|
|
|
EXPR_ADDRESSOF,
|
2008-04-20 23:15:43 +02:00
|
|
|
EXPR_MEMBER,
|
2008-04-20 23:16:00 +02:00
|
|
|
EXPR_ARRAY,
|
2008-04-20 23:16:10 +02:00
|
|
|
EXPR_MOD,
|
2008-04-22 12:35:48 +02:00
|
|
|
EXPR_LOGOR,
|
|
|
|
EXPR_LOGAND,
|
|
|
|
EXPR_XOR,
|
|
|
|
EXPR_EQUALITY,
|
|
|
|
EXPR_INEQUALITY,
|
|
|
|
EXPR_GTR,
|
|
|
|
EXPR_LESS,
|
|
|
|
EXPR_GTREQL,
|
|
|
|
EXPR_LESSEQL,
|
|
|
|
EXPR_LOGNOT,
|
|
|
|
EXPR_POS,
|
2008-04-25 11:59:21 +02:00
|
|
|
EXPR_STRLIT,
|
|
|
|
EXPR_WSTRLIT,
|
2010-01-18 23:15:46 +01:00
|
|
|
EXPR_CHARCONST,
|
2002-11-12 03:12:35 +01:00
|
|
|
};
|
|
|
|
|
2005-01-05 18:12:25 +01:00
|
|
|
enum type_kind
|
|
|
|
{
|
2006-07-28 22:45:33 +02:00
|
|
|
TKIND_PRIMITIVE = -1,
|
|
|
|
TKIND_ENUM,
|
2005-01-05 18:12:25 +01:00
|
|
|
TKIND_RECORD,
|
|
|
|
TKIND_MODULE,
|
|
|
|
TKIND_INTERFACE,
|
|
|
|
TKIND_DISPATCH,
|
|
|
|
TKIND_COCLASS,
|
|
|
|
TKIND_ALIAS,
|
|
|
|
TKIND_UNION,
|
|
|
|
TKIND_MAX
|
|
|
|
};
|
2007-01-22 14:20:36 +01:00
|
|
|
|
2008-04-30 16:23:13 +02:00
|
|
|
enum storage_class
|
|
|
|
{
|
|
|
|
STG_NONE,
|
|
|
|
STG_STATIC,
|
|
|
|
STG_EXTERN,
|
|
|
|
STG_REGISTER,
|
|
|
|
};
|
|
|
|
|
2008-04-24 20:06:28 +02:00
|
|
|
enum statement_type
|
|
|
|
{
|
|
|
|
STMT_LIBRARY,
|
2008-04-30 16:23:23 +02:00
|
|
|
STMT_DECLARATION,
|
2008-04-24 20:06:28 +02:00
|
|
|
STMT_TYPE,
|
|
|
|
STMT_TYPEREF,
|
|
|
|
STMT_MODULE,
|
|
|
|
STMT_TYPEDEF,
|
|
|
|
STMT_IMPORT,
|
|
|
|
STMT_IMPORTLIB,
|
2013-11-04 14:13:06 +01:00
|
|
|
STMT_PRAGMA,
|
2008-04-24 20:06:28 +02:00
|
|
|
STMT_CPPQUOTE
|
|
|
|
};
|
|
|
|
|
2010-11-30 12:05:57 +01:00
|
|
|
enum threading_type
|
|
|
|
{
|
|
|
|
THREADING_APARTMENT = 1,
|
|
|
|
THREADING_NEUTRAL,
|
|
|
|
THREADING_SINGLE,
|
|
|
|
THREADING_FREE,
|
|
|
|
THREADING_BOTH
|
|
|
|
};
|
|
|
|
|
2009-03-05 09:21:51 +01:00
|
|
|
enum type_basic_type
|
|
|
|
{
|
|
|
|
TYPE_BASIC_INT8 = 1,
|
|
|
|
TYPE_BASIC_INT16,
|
|
|
|
TYPE_BASIC_INT32,
|
|
|
|
TYPE_BASIC_INT64,
|
|
|
|
TYPE_BASIC_INT,
|
2009-11-07 15:54:56 +01:00
|
|
|
TYPE_BASIC_INT3264,
|
2018-11-01 15:02:28 +01:00
|
|
|
TYPE_BASIC_LONG,
|
2009-03-05 09:21:51 +01:00
|
|
|
TYPE_BASIC_CHAR,
|
|
|
|
TYPE_BASIC_HYPER,
|
|
|
|
TYPE_BASIC_BYTE,
|
|
|
|
TYPE_BASIC_WCHAR,
|
|
|
|
TYPE_BASIC_FLOAT,
|
|
|
|
TYPE_BASIC_DOUBLE,
|
|
|
|
TYPE_BASIC_ERROR_STATUS_T,
|
|
|
|
TYPE_BASIC_HANDLE,
|
|
|
|
};
|
|
|
|
|
|
|
|
#define TYPE_BASIC_MAX TYPE_BASIC_HANDLE
|
|
|
|
#define TYPE_BASIC_INT_MIN TYPE_BASIC_INT8
|
|
|
|
#define TYPE_BASIC_INT_MAX TYPE_BASIC_HYPER
|
|
|
|
|
2008-04-14 12:00:20 +02:00
|
|
|
struct _loc_info_t
|
|
|
|
{
|
|
|
|
const char *input_name;
|
|
|
|
int line_number;
|
|
|
|
const char *near_text;
|
|
|
|
};
|
|
|
|
|
2007-02-07 17:54:33 +01:00
|
|
|
struct str_list_entry_t
|
|
|
|
{
|
|
|
|
char *str;
|
|
|
|
struct list entry;
|
|
|
|
};
|
|
|
|
|
2002-07-16 05:20:45 +02:00
|
|
|
struct _attr_t {
|
2002-08-13 05:30:58 +02:00
|
|
|
enum attr_type type;
|
2002-07-16 05:20:45 +02:00
|
|
|
union {
|
2010-03-26 11:42:28 +01:00
|
|
|
unsigned int ival;
|
2002-07-16 05:20:45 +02:00
|
|
|
void *pval;
|
|
|
|
} u;
|
|
|
|
/* parser-internal */
|
2007-01-22 14:20:36 +01:00
|
|
|
struct list entry;
|
2002-07-16 05:20:45 +02:00
|
|
|
};
|
|
|
|
|
2002-11-12 03:12:35 +01:00
|
|
|
struct _expr_t {
|
|
|
|
enum expr_type type;
|
2006-02-07 12:28:20 +01:00
|
|
|
const expr_t *ref;
|
2002-11-12 03:12:35 +01:00
|
|
|
union {
|
2010-03-26 11:42:28 +01:00
|
|
|
int lval;
|
2007-07-17 13:09:03 +02:00
|
|
|
double dval;
|
2006-02-07 12:28:20 +01:00
|
|
|
const char *sval;
|
|
|
|
const expr_t *ext;
|
2007-05-01 03:31:27 +02:00
|
|
|
type_t *tref;
|
2002-11-12 03:12:35 +01:00
|
|
|
} u;
|
2006-02-07 12:28:20 +01:00
|
|
|
const expr_t *ext2;
|
2002-11-30 02:49:46 +01:00
|
|
|
int is_const;
|
2010-03-26 11:42:28 +01:00
|
|
|
int cval;
|
2002-11-12 03:12:35 +01:00
|
|
|
/* parser-internal */
|
2007-01-22 14:31:40 +01:00
|
|
|
struct list entry;
|
2002-11-12 03:12:35 +01:00
|
|
|
};
|
|
|
|
|
2008-12-29 13:05:35 +01:00
|
|
|
struct struct_details
|
|
|
|
{
|
|
|
|
var_list_t *fields;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct enumeration_details
|
|
|
|
{
|
|
|
|
var_list_t *enums;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct func_details
|
|
|
|
{
|
|
|
|
var_list_t *args;
|
2011-09-17 13:38:15 +02:00
|
|
|
struct _var_t *retval;
|
2009-01-06 00:33:27 +01:00
|
|
|
int idx;
|
2008-12-29 13:05:35 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
struct iface_details
|
|
|
|
{
|
2009-01-06 00:33:27 +01:00
|
|
|
statement_list_t *stmts;
|
2010-03-23 14:33:36 +01:00
|
|
|
var_list_t *disp_methods;
|
2008-12-29 13:05:35 +01:00
|
|
|
var_list_t *disp_props;
|
2009-03-05 09:22:32 +01:00
|
|
|
struct _type_t *inherit;
|
2018-05-29 09:49:35 +02:00
|
|
|
struct _type_t *disp_inherit;
|
2018-11-07 16:13:47 +01:00
|
|
|
struct _type_t *async_iface;
|
2008-12-29 13:05:35 +01:00
|
|
|
};
|
|
|
|
|
2009-01-06 00:33:27 +01:00
|
|
|
struct module_details
|
|
|
|
{
|
|
|
|
statement_list_t *stmts;
|
|
|
|
};
|
|
|
|
|
2009-01-06 00:33:36 +01:00
|
|
|
struct array_details
|
|
|
|
{
|
2009-03-05 09:21:35 +01:00
|
|
|
expr_t *size_is;
|
|
|
|
expr_t *length_is;
|
2009-03-05 09:22:32 +01:00
|
|
|
struct _type_t *elem;
|
|
|
|
unsigned int dim;
|
2009-03-08 00:23:44 +01:00
|
|
|
unsigned char ptr_def_fc;
|
|
|
|
unsigned char declptr; /* if declared as a pointer */
|
2011-06-01 21:27:56 +02:00
|
|
|
unsigned short ptr_tfsoff; /* offset of pointer definition for declptr */
|
2009-01-06 00:33:36 +01:00
|
|
|
};
|
|
|
|
|
2009-01-06 00:34:44 +01:00
|
|
|
struct coclass_details
|
|
|
|
{
|
|
|
|
ifref_list_t *ifaces;
|
|
|
|
};
|
|
|
|
|
2009-03-05 09:21:51 +01:00
|
|
|
struct basic_details
|
|
|
|
{
|
|
|
|
enum type_basic_type type;
|
|
|
|
int sign;
|
|
|
|
};
|
|
|
|
|
2009-03-05 09:22:19 +01:00
|
|
|
struct pointer_details
|
|
|
|
{
|
2009-03-05 09:22:32 +01:00
|
|
|
struct _type_t *ref;
|
2009-03-08 00:23:44 +01:00
|
|
|
unsigned char def_fc;
|
2009-03-05 09:22:19 +01:00
|
|
|
};
|
|
|
|
|
2009-11-07 15:55:09 +01:00
|
|
|
struct bitfield_details
|
|
|
|
{
|
|
|
|
struct _type_t *field;
|
|
|
|
const expr_t *bits;
|
|
|
|
};
|
|
|
|
|
2015-07-31 13:37:40 +02:00
|
|
|
#define HASHMAX 64
|
|
|
|
|
|
|
|
struct namespace {
|
|
|
|
const char *name;
|
|
|
|
struct namespace *parent;
|
|
|
|
struct list entry;
|
|
|
|
struct list children;
|
|
|
|
struct rtype *type_hash[HASHMAX];
|
|
|
|
};
|
|
|
|
|
2009-01-19 01:02:35 +01:00
|
|
|
enum type_type
|
|
|
|
{
|
|
|
|
TYPE_VOID,
|
|
|
|
TYPE_BASIC, /* ints, floats and handles */
|
|
|
|
TYPE_ENUM,
|
|
|
|
TYPE_STRUCT,
|
|
|
|
TYPE_ENCAPSULATED_UNION,
|
|
|
|
TYPE_UNION,
|
|
|
|
TYPE_ALIAS,
|
|
|
|
TYPE_MODULE,
|
|
|
|
TYPE_COCLASS,
|
|
|
|
TYPE_FUNCTION,
|
|
|
|
TYPE_INTERFACE,
|
|
|
|
TYPE_POINTER,
|
|
|
|
TYPE_ARRAY,
|
2009-11-07 15:55:09 +01:00
|
|
|
TYPE_BITFIELD,
|
2009-01-19 01:02:35 +01:00
|
|
|
};
|
|
|
|
|
2002-07-16 05:20:45 +02:00
|
|
|
struct _type_t {
|
2006-06-23 23:14:28 +02:00
|
|
|
const char *name;
|
2015-07-31 13:37:50 +02:00
|
|
|
struct namespace *namespace;
|
2009-03-05 09:22:19 +01:00
|
|
|
enum type_type type_type;
|
2008-04-29 21:40:30 +02:00
|
|
|
attr_list_t *attrs;
|
2008-12-29 13:05:35 +01:00
|
|
|
union
|
|
|
|
{
|
|
|
|
struct struct_details *structure;
|
|
|
|
struct enumeration_details *enumeration;
|
|
|
|
struct func_details *function;
|
|
|
|
struct iface_details *iface;
|
2009-01-06 00:33:27 +01:00
|
|
|
struct module_details *module;
|
2009-01-06 00:33:36 +01:00
|
|
|
struct array_details array;
|
2009-01-06 00:34:44 +01:00
|
|
|
struct coclass_details coclass;
|
2009-03-05 09:21:51 +01:00
|
|
|
struct basic_details basic;
|
2009-03-05 09:22:19 +01:00
|
|
|
struct pointer_details pointer;
|
2009-11-07 15:55:09 +01:00
|
|
|
struct bitfield_details bitfield;
|
2008-12-29 13:05:35 +01:00
|
|
|
} details;
|
2015-07-31 13:37:50 +02:00
|
|
|
const char *c_name;
|
2006-08-25 03:01:18 +02:00
|
|
|
type_t *orig; /* dup'd types */
|
2007-05-10 05:50:49 +02:00
|
|
|
unsigned int typestring_offset;
|
2007-09-19 00:28:49 +02:00
|
|
|
unsigned int ptrdesc; /* used for complex structs */
|
2005-01-06 21:45:21 +01:00
|
|
|
int typelib_idx;
|
2008-07-01 22:08:51 +02:00
|
|
|
loc_info_t loc_info;
|
2007-05-25 02:49:21 +02:00
|
|
|
unsigned int ignore : 1;
|
|
|
|
unsigned int defined : 1;
|
|
|
|
unsigned int written : 1;
|
|
|
|
unsigned int user_types_registered : 1;
|
2007-05-25 02:50:02 +02:00
|
|
|
unsigned int tfswrite : 1; /* if the type needs to be written to the TFS */
|
2008-04-20 23:15:16 +02:00
|
|
|
unsigned int checked : 1;
|
2009-01-06 00:34:23 +01:00
|
|
|
unsigned int is_alias : 1; /* is the type an alias? */
|
2002-07-16 05:20:45 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _var_t {
|
|
|
|
char *name;
|
|
|
|
type_t *type;
|
2007-01-22 14:20:36 +01:00
|
|
|
attr_list_t *attrs;
|
2002-11-30 02:49:46 +01:00
|
|
|
expr_t *eval;
|
2008-04-30 16:23:13 +02:00
|
|
|
enum storage_class stgclass;
|
2010-10-22 20:22:57 +02:00
|
|
|
unsigned int procstring_offset;
|
2011-09-19 12:23:01 +02:00
|
|
|
unsigned int typestring_offset;
|
2002-07-16 05:20:45 +02:00
|
|
|
|
2008-04-14 12:00:20 +02:00
|
|
|
struct _loc_info_t loc_info;
|
|
|
|
|
2002-07-16 05:20:45 +02:00
|
|
|
/* parser-internal */
|
2007-01-22 14:26:12 +01:00
|
|
|
struct list entry;
|
2002-07-16 05:20:45 +02:00
|
|
|
};
|
|
|
|
|
2008-04-25 11:58:24 +02:00
|
|
|
struct _declarator_t {
|
2007-05-10 05:50:49 +02:00
|
|
|
var_t *var;
|
2008-04-24 20:03:50 +02:00
|
|
|
type_t *type;
|
|
|
|
type_t *func_type;
|
2009-11-07 15:55:09 +01:00
|
|
|
expr_t *bits;
|
2007-05-10 05:50:49 +02:00
|
|
|
|
|
|
|
/* parser-internal */
|
|
|
|
struct list entry;
|
|
|
|
};
|
|
|
|
|
2004-01-07 05:21:27 +01:00
|
|
|
struct _ifref_t {
|
|
|
|
type_t *iface;
|
2007-01-22 14:20:36 +01:00
|
|
|
attr_list_t *attrs;
|
2004-01-07 05:21:27 +01:00
|
|
|
|
|
|
|
/* parser-internal */
|
2007-01-22 14:21:56 +01:00
|
|
|
struct list entry;
|
2004-01-07 05:21:27 +01:00
|
|
|
};
|
|
|
|
|
2005-01-05 18:12:25 +01:00
|
|
|
struct _typelib_entry_t {
|
2006-08-29 23:26:43 +02:00
|
|
|
type_t *type;
|
2007-01-22 14:10:30 +01:00
|
|
|
struct list entry;
|
2005-01-05 18:12:25 +01:00
|
|
|
};
|
|
|
|
|
2006-05-15 21:55:04 +02: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;
|
|
|
|
|
2007-01-22 14:10:30 +01:00
|
|
|
struct list entry;
|
2006-05-15 21:55:04 +02:00
|
|
|
};
|
|
|
|
|
2005-01-05 18:12:25 +01:00
|
|
|
struct _typelib_t {
|
|
|
|
char *name;
|
2008-04-14 11:59:35 +02:00
|
|
|
const attr_list_t *attrs;
|
2007-01-22 14:10:30 +01:00
|
|
|
struct list importlibs;
|
2008-04-24 20:06:28 +02:00
|
|
|
statement_list_t *stmts;
|
2005-01-05 18:12:25 +01:00
|
|
|
};
|
|
|
|
|
2007-06-14 01:13:04 +02:00
|
|
|
struct _user_type_t {
|
|
|
|
struct list entry;
|
|
|
|
const char *name;
|
|
|
|
};
|
|
|
|
|
2008-04-24 20:06:42 +02:00
|
|
|
struct _type_list_t {
|
|
|
|
type_t *type;
|
|
|
|
struct _type_list_t *next;
|
|
|
|
};
|
|
|
|
|
2008-04-24 20:06:28 +02:00
|
|
|
struct _statement_t {
|
|
|
|
struct list entry;
|
|
|
|
enum statement_type type;
|
|
|
|
union
|
|
|
|
{
|
|
|
|
ifref_t iface;
|
|
|
|
type_t *type;
|
|
|
|
const char *str;
|
|
|
|
var_t *var;
|
|
|
|
typelib_t *lib;
|
2008-04-24 20:06:42 +02:00
|
|
|
type_list_t *type_list;
|
2008-04-24 20:06:28 +02:00
|
|
|
} u;
|
|
|
|
};
|
|
|
|
|
2016-03-29 22:06:44 +02:00
|
|
|
struct _warning_t {
|
|
|
|
int num;
|
|
|
|
struct list entry;
|
|
|
|
};
|
|
|
|
|
2009-05-21 11:10:22 +02:00
|
|
|
typedef enum {
|
|
|
|
SYS_WIN16,
|
|
|
|
SYS_WIN32,
|
|
|
|
SYS_MAC,
|
|
|
|
SYS_WIN64
|
|
|
|
} syskind_t;
|
|
|
|
|
2007-06-14 01:13:04 +02:00
|
|
|
extern user_type_list_t user_type_list;
|
2011-06-13 20:31:42 +02:00
|
|
|
extern context_handle_list_t context_handle_list;
|
2011-05-27 12:07:29 +02:00
|
|
|
extern generic_handle_list_t generic_handle_list;
|
2008-03-27 15:03:17 +01:00
|
|
|
void check_for_additional_prototype_types(const var_list_t *list);
|
2007-06-14 01:13:04 +02:00
|
|
|
|
2006-08-25 03:01:18 +02:00
|
|
|
void init_types(void);
|
2007-10-09 01:47:28 +02:00
|
|
|
type_t *alloc_type(void);
|
|
|
|
void set_all_tfswrite(int val);
|
2008-12-26 17:22:25 +01:00
|
|
|
void clear_all_offsets(void);
|
2006-08-25 03:01:18 +02:00
|
|
|
|
2009-03-05 09:23:00 +01:00
|
|
|
#define tsENUM 1
|
|
|
|
#define tsSTRUCT 2
|
|
|
|
#define tsUNION 3
|
|
|
|
|
2008-04-22 12:36:38 +02:00
|
|
|
var_t *find_const(const char *name, int f);
|
2015-07-31 13:37:40 +02:00
|
|
|
type_t *find_type(const char *name, struct namespace *namespace, int t);
|
2009-03-05 09:22:32 +01:00
|
|
|
type_t *make_type(enum type_type type);
|
2015-07-31 13:37:40 +02:00
|
|
|
type_t *get_type(enum type_type type, char *name, struct namespace *namespace, int t);
|
|
|
|
type_t *reg_type(type_t *type, const char *name, struct namespace *namespace, int t);
|
2009-03-05 09:23:00 +01:00
|
|
|
void add_incomplete(type_t *t);
|
|
|
|
|
|
|
|
var_t *make_var(char *name);
|
|
|
|
var_list_t *append_var(var_list_t *list, var_t *var);
|
2008-04-22 12:36:38 +02:00
|
|
|
|
2008-07-01 22:08:51 +02:00
|
|
|
void init_loc_info(loc_info_t *);
|
|
|
|
|
2015-07-31 13:37:50 +02:00
|
|
|
char *format_namespace(struct namespace *namespace, const char *prefix, const char *separator, const char *suffix);
|
|
|
|
|
2009-01-06 00:33:27 +01:00
|
|
|
static inline var_list_t *type_get_function_args(const type_t *func_type)
|
2008-04-02 13:55:34 +02:00
|
|
|
{
|
2009-01-06 00:33:27 +01:00
|
|
|
return func_type->details.function->args;
|
|
|
|
}
|
|
|
|
|
2009-01-19 01:02:35 +01:00
|
|
|
static inline enum type_type type_get_type_detect_alias(const type_t *type)
|
|
|
|
{
|
|
|
|
if (type->is_alias)
|
|
|
|
return TYPE_ALIAS;
|
2009-03-05 09:22:19 +01:00
|
|
|
return type->type_type;
|
2009-01-19 01:02:35 +01:00
|
|
|
}
|
|
|
|
|
2009-01-06 00:33:27 +01:00
|
|
|
#define STATEMENTS_FOR_EACH_FUNC(stmt, stmts) \
|
|
|
|
if (stmts) LIST_FOR_EACH_ENTRY( stmt, stmts, statement_t, entry ) \
|
|
|
|
if (stmt->type == STMT_DECLARATION && stmt->u.var->stgclass == STG_NONE && \
|
2009-01-19 01:02:35 +01:00
|
|
|
type_get_type_detect_alias(stmt->u.var->type) == TYPE_FUNCTION)
|
2009-01-06 00:33:27 +01:00
|
|
|
|
|
|
|
static inline int statements_has_func(const statement_list_t *stmts)
|
|
|
|
{
|
|
|
|
const statement_t *stmt;
|
|
|
|
int has_func = 0;
|
|
|
|
STATEMENTS_FOR_EACH_FUNC(stmt, stmts)
|
|
|
|
{
|
|
|
|
has_func = 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return has_func;
|
2008-04-02 13:55:34 +02:00
|
|
|
}
|
|
|
|
|
2015-07-31 13:37:50 +02:00
|
|
|
static inline int is_global_namespace(const struct namespace *namespace)
|
|
|
|
{
|
|
|
|
return !namespace->name;
|
|
|
|
}
|
|
|
|
|
2002-07-16 05:20:45 +02:00
|
|
|
#endif
|