widl: Move creation of module type into a separate function, type_new_module and give it a special FC type.

This commit is contained in:
Rob Shearman 2009-01-05 23:34:08 +00:00 committed by Alexandre Julliard
parent 8b326c4ff8
commit 64520ecdc7
5 changed files with 15 additions and 3 deletions

View File

@ -918,8 +918,8 @@ interfacedec:
| dispinterface ';' { $$ = $1; }
;
module: tMODULE aIDENTIFIER { $$ = make_type(0, NULL); $$->name = $2; $$->kind = TKIND_MODULE; }
| tMODULE aKNOWNTYPE { $$ = make_type(0, NULL); $$->name = $2; $$->kind = TKIND_MODULE; }
module: tMODULE aIDENTIFIER { $$ = type_new_module($2); }
| tMODULE aKNOWNTYPE { $$ = type_new_module($2); }
;
modulehdr: attributes module { $$ = $2;

View File

@ -209,9 +209,10 @@ unsigned short get_type_vt(type_t *t)
case RPC_FC_CVSTRUCT:
case RPC_FC_BOGUS_STRUCT:
case RPC_FC_COCLASS:
case RPC_FC_MODULE:
return VT_USERDEFINED;
case 0:
return t->kind == TKIND_PRIMITIVE ? VT_VOID : VT_USERDEFINED;
return VT_VOID;
default:
error("get_type_vt: unknown type: 0x%02x\n", t->type);
}

View File

@ -70,6 +70,15 @@ type_t *type_new_alias(type_t *t, const char *name)
return a;
}
type_t *type_new_module(char *name)
{
type_t *type = make_type(RPC_FC_MODULE, NULL);
type->name = name;
type->kind = TKIND_MODULE;
/* FIXME: register type to detect multiple definitions */
return type;
}
static int compute_method_indexes(type_t *iface)
{
int idx;

View File

@ -27,6 +27,7 @@
type_t *type_new_function(var_list_t *args);
type_t *type_new_pointer(type_t *ref, attr_list_t *attrs);
type_t *type_new_alias(type_t *t, const char *name);
type_t *type_new_module(char *name);
void type_interface_define(type_t *iface, type_t *inherit, statement_list_t *stmts);
void type_dispinterface_define(type_t *iface, var_list_t *props, func_list_t *methods);
void type_dispinterface_define_from_iface(type_t *dispiface, type_t *iface);

View File

@ -35,6 +35,7 @@ typedef GUID UUID;
#define TRUE 1
#define FALSE 0
#define RPC_FC_MODULE 0xfc
#define RPC_FC_COCLASS 0xfd
#define RPC_FC_FUNCTION 0xfe