Write uuid of library in header.

This commit is contained in:
Jacek Caban 2005-03-05 10:49:22 +00:00 committed by Alexandre Julliard
parent c3f06fb2e6
commit e6150fe206
3 changed files with 20 additions and 9 deletions

View File

@ -80,6 +80,16 @@ int is_void(type_t *t, var_t *v)
return 0;
}
void write_guid(const char *guid_prefix, const char *name, UUID *uuid)
{
if (!uuid) return;
fprintf(header, "DEFINE_GUID(%s_%s, 0x%08lx, 0x%04x, 0x%04x, 0x%02x,0x%02x, 0x%02x,"
"0x%02x,0x%02x,0x%02x,0x%02x,0x%02x);\n",
guid_prefix, name, uuid->Data1, uuid->Data2, uuid->Data3, uuid->Data4[0],
uuid->Data4[1], uuid->Data4[2], uuid->Data4[3], uuid->Data4[4], uuid->Data4[5],
uuid->Data4[6], uuid->Data4[7]);
}
static void write_pident(FILE *h, var_t *v)
{
int c;
@ -428,6 +438,13 @@ void write_externdef(var_t *v)
fprintf(header, ";\n\n");
}
void write_library(char *name, attr_t *attr) {
UUID *uuid = get_attrp(attr, ATTR_UUID);
fprintf(header, "\n");
write_guid("LIBID", name, uuid);
fprintf(header, "\n");
}
/********** INTERFACES **********/
int is_object(attr_t *a)
@ -696,14 +713,6 @@ void write_forward(type_t *iface)
}
}
void write_guid(const char *guid_prefix, const char *name, UUID *uuid)
{
if (!uuid) return;
fprintf(header, "DEFINE_GUID(%s_%s, 0x%08lx, 0x%04x, 0x%04x, 0x%02x,0x%02x, 0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x);\n",
guid_prefix, name, uuid->Data1, uuid->Data2, uuid->Data3, uuid->Data4[0], uuid->Data4[1],
uuid->Data4[2], uuid->Data4[3], uuid->Data4[4], uuid->Data4[5], uuid->Data4[6], uuid->Data4[7]);
}
void write_iface_guid(type_t *iface)
{
UUID *uuid = get_attrp(iface->attrs, ATTR_UUID);

View File

@ -40,5 +40,6 @@ extern void write_typedef(type_t *type, var_t *names);
extern void write_expr(FILE *h, expr_t *e);
extern void write_constdef(var_t *v);
extern void write_externdef(var_t *v);
extern void write_library(char *name, attr_t *attr);
#endif

View File

@ -270,7 +270,8 @@ import: import_start imp_statements aEOF {}
libraryhdr: tLIBRARY aIDENTIFIER { $$ = $2; }
;
library_start: attributes libraryhdr '{' { start_typelib($2, $1); }
library_start: attributes libraryhdr '{' { start_typelib($2, $1);
if (!parse_only && do_header) write_library($2, $1); }
;
librarydef: library_start imp_statements '}' { end_typelib(); }
;