Commit 346188b7 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

Initial support for typelib generation.

parent 3058548e
......@@ -10,11 +10,13 @@ PROGRAMS = widl$(EXEEXT)
MODULE = none
C_SRCS = \
hash.c \
header.c \
proxy.c \
typelib.c \
utils.c \
widl.c
widl.c \
write_msft.c
EXTRA_SRCS = parser.y parser.l
EXTRA_OBJS = y.tab.o @LEX_OUTPUT_ROOT@.o
......
/*
* Hash definitions
*
* Copyright 2005 Huw Davies
*
* 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
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef __WIDL_HASH_H
#define __WIDL_HASH_H
typedef enum tag_syskind_t {
SYS_WIN16 = 0,
SYS_WIN32,
SYS_MAC
} syskind_t;
extern unsigned long lhash_val_of_name_sys( syskind_t skind, LCID lcid, LPCSTR lpStr);
#endif
......@@ -30,6 +30,7 @@
#include <ctype.h>
#include <signal.h>
#include "windef.h"
#include "widl.h"
#include "utils.h"
#include "parser.h"
......
......@@ -31,6 +31,8 @@
#include <alloca.h>
#endif
#include "windef.h"
#include "widl.h"
#include "utils.h"
#include "parser.h"
......@@ -969,6 +971,7 @@ static type_t *make_type(unsigned char type, type_t *ref)
t->sign = 0;
t->defined = FALSE;
t->written = FALSE;
t->typelib_idx = -1;
INIT_LINK(t);
return t;
}
......
......@@ -36,60 +36,6 @@
int in_typelib = 0;
/* Copied from wtypes.h. Not included directly because that would create a
* circular dependency (after all, wtypes.h is generated by widl...) */
enum VARENUM {
VT_EMPTY = 0,
VT_NULL = 1,
VT_I2 = 2,
VT_I4 = 3,
VT_R4 = 4,
VT_R8 = 5,
VT_CY = 6,
VT_DATE = 7,
VT_BSTR = 8,
VT_DISPATCH = 9,
VT_ERROR = 10,
VT_BOOL = 11,
VT_VARIANT = 12,
VT_UNKNOWN = 13,
VT_DECIMAL = 14,
VT_I1 = 16,
VT_UI1 = 17,
VT_UI2 = 18,
VT_UI4 = 19,
VT_I8 = 20,
VT_UI8 = 21,
VT_INT = 22,
VT_UINT = 23,
VT_VOID = 24,
VT_HRESULT = 25,
VT_PTR = 26,
VT_SAFEARRAY = 27,
VT_CARRAY = 28,
VT_USERDEFINED = 29,
VT_LPSTR = 30,
VT_LPWSTR = 31,
VT_RECORD = 36,
VT_FILETIME = 64,
VT_BLOB = 65,
VT_STREAM = 66,
VT_STORAGE = 67,
VT_STREAMED_OBJECT = 68,
VT_STORED_OBJECT = 69,
VT_BLOB_OBJECT = 70,
VT_CF = 71,
VT_CLSID = 72,
VT_BSTR_BLOB = 0xfff,
VT_VECTOR = 0x1000,
VT_ARRAY = 0x2000,
VT_BYREF = 0x4000,
VT_RESERVED = 0x8000,
VT_ILLEGAL = 0xffff,
VT_ILLEGALMASKED = 0xfff,
VT_TYPEMASK = 0xfff
};
static typelib_t *typelib;
/* List of oleauto types that should be recognized by name.
......@@ -195,8 +141,11 @@ unsigned short get_type_vt(type_t *t)
}
/* FIXME: should we recurse and add a VT_BYREF? */
/* Or just return VT_PTR? */
if(t->ref) return get_type_vt(t->ref);
error("get_type_vt: unknown-deref-type: %d\n", t->ref->type);
break;
case RPC_FC_STRUCT:
return VT_USERDEFINED;
default:
error("get_type_vt: unknown-type: %d\n", t->type);
}
......@@ -231,7 +180,7 @@ void end_typelib(void)
in_typelib--;
if (!typelib) return;
/* create_msft_typelib(typelib);*/
create_msft_typelib(typelib);
return;
}
......
......@@ -29,4 +29,61 @@ extern void add_coclass(class_t *cls);
extern void add_module(type_t *module);
extern void add_struct(type_t *structure);
/* Copied from wtypes.h. Not included directly because that would create a
* circular dependency (after all, wtypes.h is generated by widl...) */
enum VARENUM {
VT_EMPTY = 0,
VT_NULL = 1,
VT_I2 = 2,
VT_I4 = 3,
VT_R4 = 4,
VT_R8 = 5,
VT_CY = 6,
VT_DATE = 7,
VT_BSTR = 8,
VT_DISPATCH = 9,
VT_ERROR = 10,
VT_BOOL = 11,
VT_VARIANT = 12,
VT_UNKNOWN = 13,
VT_DECIMAL = 14,
VT_I1 = 16,
VT_UI1 = 17,
VT_UI2 = 18,
VT_UI4 = 19,
VT_I8 = 20,
VT_UI8 = 21,
VT_INT = 22,
VT_UINT = 23,
VT_VOID = 24,
VT_HRESULT = 25,
VT_PTR = 26,
VT_SAFEARRAY = 27,
VT_CARRAY = 28,
VT_USERDEFINED = 29,
VT_LPSTR = 30,
VT_LPWSTR = 31,
VT_RECORD = 36,
VT_FILETIME = 64,
VT_BLOB = 65,
VT_STREAM = 66,
VT_STORAGE = 67,
VT_STREAMED_OBJECT = 68,
VT_STORED_OBJECT = 69,
VT_BLOB_OBJECT = 70,
VT_CF = 71,
VT_CLSID = 72,
VT_BSTR_BLOB = 0xfff,
VT_VECTOR = 0x1000,
VT_ARRAY = 0x2000,
VT_BYREF = 0x4000,
VT_RESERVED = 0x8000,
VT_ILLEGAL = 0xffff,
VT_ILLEGALMASKED = 0xfff,
VT_TYPEMASK = 0xfff
};
extern unsigned short get_type_vt(type_t *t);
extern int create_msft_typelib(typelib_t *typelib);
#endif
......@@ -33,10 +33,6 @@ typedef GUID UUID;
#define TRUE 1
#define FALSE 0
#define LOWORD(l) ((unsigned short)(l))
#define HIWORD(l) ((unsigned short)((unsigned long)(l) >> 16))
#define MAKELONG(low,high) ((unsigned long)(((unsigned short)(low)) | (((unsigned long)((unsigned short)(high))) << 16)))
typedef struct _attr_t attr_t;
typedef struct _expr_t expr_t;
typedef struct _type_t type_t;
......@@ -177,7 +173,7 @@ struct _type_t {
var_t *fields;
int ignore, is_const, sign;
int defined, written;
int typelib_idx;
/* parser-internal */
DECL_LINK(type_t)
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment