42 if (dupname &&
t->name)
57 t->qualified_name =
NULL;
61 memset(&
t->details, 0,
sizeof(
t->details));
62 t->typestring_offset = 0;
67 t->user_types_registered =
FALSE;
105 return type->qualified_name ?
type->qualified_name :
type->name;
117 const char *
name =
nested ?
namespace->name : abi_prefix;
126 const char *
separator,
const char *suffix,
const char *abi_prefix)
171 switch (
type->type_type)
179 error_at( &
type->where,
"cannot compute type signature, no uuid found for type %s.\n",
type->name );
247 error_at( &
type->where,
"unimplemented type signature for basic type %d.\n",
267 error_at( &
type->where,
"unimplemented type signature for type %s of type %d.\n",
307 {
"Windows__CFoundation__CCollections__C",
"__F"},
308 {
"Windows_CFoundation_CCollections_C",
"__F"},
309 {
"Windows__CFoundation__C",
"__F"},
310 {
"Windows_CFoundation_C",
"__F"},
315 const char *tmp, *ns_prefix =
"__x_", *abi_prefix =
NULL;
336 (tmp -
buf) ==
strlen(ns_prefix) + (abi_prefix ? 5 : 0))
355 error_at( &
type->where,
"cannot compute type signature, no uuid found for type %s.\n",
type->name );
444 error_loc(
"too many unnamed arguments\n");
451 name[0] =
i > 26 ?
'a' +
i / 26 :
'a' +
i;
452 name[1] =
i > 26 ?
'a' +
i % 26 : 0;
464 t->details.function =
xmalloc(
sizeof(*
t->details.function));
465 t->details.function->args =
args;
473 t->details.pointer.ref.type =
ref;
483 a->details.alias.aliasee = *
t;
494 t->details.array.declptr = declptr;
495 t->details.array.length_is = length_is;
497 t->details.array.size_is = size_is;
499 t->details.array.dim = dim;
508 t->details.basic.type = basic_type;
509 t->details.basic.sign = 0;
520 if (!int_types[basic_type][
sign + 1])
525 return int_types[basic_type][
sign + 1];
539 error_loc(
"type %s already defined at %s:%d\n",
type->name,
type->where.input_name,
type->where.first_line );
543 type->where = *where;
558 t->namespace =
namespace;
565 t->details.enumeration =
xmalloc(
sizeof(*
t->details.enumeration));
566 t->details.enumeration->enums =
enums;
585 t->namespace =
namespace;
592 t->details.structure =
xmalloc(
sizeof(*
t->details.structure));
593 t->details.structure->fields =
fields;
612 t->namespace =
namespace;
617 if (!
t->defined && defined)
619 t->details.structure =
xmalloc(
sizeof(*
t->details.structure));
620 t->details.structure->fields =
fields;
648 t->details.structure =
xmalloc(
sizeof(*
t->details.structure));
650 t->details.structure->fields =
append_var(
t->details.structure->fields, union_field);
694 error_loc(
"bit-field has invalid type\n");
697 error_loc(
"negative width for bit-field\n");
702 t->details.bitfield.field =
field;
703 t->details.bitfield.bits =
bits;
734 error_loc(
"interface %s previously not declared an interface at %s:%d\n",
type->name,
735 type->where.input_name,
type->where.first_line );
742 if (iface == inherit)
743 error_loc(
"interface %s can't inherit from itself\n",
763 error_loc(
"dispinterface %s previously not declared a dispinterface at %s:%d\n",
764 type->name,
type->where.input_name,
type->where.first_line );
808 error_loc(
"module %s previously not declared a module at %s:%d\n",
type->name,
809 type->where.input_name,
type->where.first_line );
827 error_loc(
"coclass %s previously not declared a coclass at %s:%d\n",
type->name,
828 type->where.input_name,
type->where.first_line );
845 error_loc(
"runtimeclass %s previously not declared a runtimeclass at %s:%d\n",
type->name,
846 type->where.input_name,
type->where.first_line );
861 error_loc(
"runtimeclass %s must have a default interface or static factory\n", runtimeclass->
name);
868 if (!(
ref->type->defined))
continue;
878 error_loc(
"interface '%s' also requires interface '%s', "
879 "but runtimeclass '%s' does not implement it.\n",
891 error_loc(
"apicontract %s previously not declared a apicontract at %s:%d\n",
type->name,
892 type->where.input_name,
type->where.first_line );
906 iface->namespace = delegate->namespace;
919 error_loc(
"delegate %s previously not declared a delegate at %s:%d\n",
type->name,
920 type->where.input_name,
type->where.first_line );
957 error_loc(
"pinterface %s previously not declared a pinterface at %s:%d\n",
type->name,
958 type->where.input_name,
type->where.first_line );
996 error_loc(
"pdelegate %s previously not declared a pdelegate at %s:%d\n",
type->name,
997 type->where.input_name,
type->where.first_line );
1006 type_t *iface, *delegate;
1072 if (!var_list)
return var_list;
1074 new_var_list =
xmalloc(
sizeof(*new_var_list));
1083 return new_var_list;
1111 error_at( where,
"unimplemented parameterized type replacement for statement type %d.\n", stmt->
type );
1124 if (!stmt_list)
return stmt_list;
1126 new_stmt_list =
xmalloc(
sizeof(*new_stmt_list));
1135 return new_stmt_list;
1144 switch (
type->type_type)
1158 if (!orig || !repl)
return NULL;
1166 if (
t ==
type->details.pointer.ref.type)
return type;
1168 type->details.pointer.ref.type =
t;
1172 if (
t ==
type->details.alias.aliasee.type)
return type;
1174 type->details.alias.aliasee.type =
t;
1178 if (
t ==
t->details.array.elem.type)
return type;
1180 t->details.array.elem.type =
t;
1184 t->details.function =
xmalloc(
sizeof(*
t->details.function));
1189 t =
type->details.parameterized.type;
1196 error_at( &
type->where,
"unimplemented parameterized type replacement for type %s of type %d.\n",
1210 orig, repl, &tmpl->
where );
1227 new_type->namespace =
type->namespace;
1229 reg_type(new_type, new_type->
name, new_type->namespace, 0);
1246 static const char winrt_pinterface_namespace[] = {0x11,0xf4,0x7a,0xd5,0x7b,0x73,0x42,0xc0,0xab,0xae,0x87,0x8b,0x1e,0x16,0xad,0xee};
1249 unsigned char hash[20];
1259 sha1_update(&
ctx, winrt_pinterface_namespace,
sizeof(winrt_pinterface_namespace));
1274 hash[8] = ((
hash[8] & 0x3f) | 0x80);
1291 error_loc(
"cannot define non-parameterized type %s, declared at %s:%d\n",
type->name,
1292 type->where.input_name,
type->where.first_line );
1301 error_loc(
"pinterface/pdelegate %s previously not declared a pinterface/pdelegate at %s:%d\n",
1325 if (type1->namespace != type2->namespace)
int strcmp(const char *String1, const char *String2)
char * strstr(char *String1, char *String2)
ACPI_SIZE strlen(const char *String)
char * xstrdup(const char *s)
static void list_remove(struct list_entry *entry)
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
static void list_init(struct list_entry *head)
struct hlsl_type * get_type(struct hlsl_scope *scope, const char *name, BOOL recursive) DECLSPEC_HIDDEN
static const WCHAR version[]
static const WCHAR separator[]
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
GLuint GLuint GLsizei count
GLuint GLuint GLsizei GLenum type
GLdouble GLdouble GLdouble r
GLenum const GLfloat * params
GLenum GLuint GLenum GLsizei const GLchar * buf
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
GLboolean GLboolean GLboolean GLboolean a
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define memcpy(s1, s2, n)
#define memmove(s1, s2, n)
static const struct encodedInt enums[]
UINT WINAPI nested(MSIHANDLE hinst)
char * strmake(size_t *lenp,...)
#define offsetof(TYPE, MEMBER)
__WINE_SERVER_LIST_INLINE unsigned int list_count(const struct list *list)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
__WINE_SERVER_LIST_INLINE struct list * list_next(const struct list *list, const struct list *elem)
typeref_list_t * type_list
union _statement_t::@5358 u
struct parameterized_details parameterized
union _type_t::@5357 details
struct coclass_details coclass
const char * qualified_name
struct delegate_details delegate
struct iface_details * iface
struct runtimeclass_details runtimeclass
struct basic_details basic
IMAGEHLP_MODULEW64 module
struct namespace * parent
Character const *const prefix
static void type_parameterized_interface_specialize(type_t *tmpl, type_t *iface, typeref_list_t *orig, typeref_list_t *repl)
static void define_type(type_t *type, const struct location *where)
type_t * type_module_define(type_t *module, attr_list_t *attrs, statement_list_t *stmts, const struct location *where)
static var_list_t * replace_type_parameters_in_var_list(var_list_t *var_list, typeref_list_t *orig, typeref_list_t *repl)
static typeref_list_t * replace_type_parameters_in_type_list(typeref_list_t *list, typeref_list_t *orig, typeref_list_t *repl)
static char * format_parameterized_type_c_name(type_t *type, typeref_list_t *params, const char *prefix, const char *separator)
type_t * type_parameterized_type_specialize_partial(type_t *type, typeref_list_t *params)
type_t * type_dispinterface_define_from_iface(type_t *dispiface, attr_list_t *attrs, type_t *iface, const struct location *where)
type_t * type_runtimeclass_define(type_t *runtimeclass, attr_list_t *attrs, typeref_list_t *ifaces, const struct location *where)
int type_is_equal(const type_t *type1, const type_t *type2)
static size_t append_var_list_signature(char **buf, size_t *len, size_t pos, var_list_t *var_list)
type_t * type_apicontract_declare(char *name, struct namespace *namespace)
static statement_list_t * replace_type_parameters_in_statement_list(statement_list_t *stmt_list, typeref_list_t *orig, typeref_list_t *repl, struct location *where)
type_t * type_new_function(var_list_t *args)
type_t * type_parameterized_delegate_declare(char *name, struct namespace *namespace, typeref_list_t *params)
char * format_namespace(struct namespace *namespace, const char *prefix, const char *separator, const char *suffix, const char *abi_prefix)
type_t * type_runtimeclass_declare(char *name, struct namespace *namespace)
static const var_t * find_arg(const var_list_t *args, const char *name)
static unsigned int compute_method_indexes(type_t *iface)
type_t * type_coclass_declare(char *name)
type_t * type_new_encapsulated_union(char *name, var_t *switch_field, var_t *union_field, var_list_t *cases, const struct location *where)
static char * format_parameterized_type_signature(type_t *type, typeref_list_t *params)
static void compute_interface_signature_uuid(type_t *iface)
static void compute_delegate_iface_names(type_t *delegate, type_t *type, typeref_list_t *params)
static size_t append_namespaces(char **buf, size_t *len, size_t pos, struct namespace *namespace, const char *prefix, const char *separator, const char *suffix, const char *abi_prefix)
type_t * type_new_bitfield(type_t *field, const expr_t *bits)
type_t * type_new_nonencapsulated_union(const char *name, struct namespace *namespace, int defined, var_list_t *fields, const struct location *where)
type_t * type_parameterized_interface_define(type_t *type, attr_list_t *attrs, type_t *inherit, statement_list_t *stmts, typeref_list_t *requires, const struct location *where)
type_t * type_new_array(const char *name, const decl_spec_t *element, int declptr, unsigned int dim, expr_t *size_is, expr_t *length_is)
static char * format_parameterized_type_short_name(type_t *type, typeref_list_t *params, const char *prefix)
type_t * type_delegate_declare(char *name, struct namespace *namespace)
type_t * type_parameterized_interface_declare(char *name, struct namespace *namespace, typeref_list_t *params)
type_t * type_parameterized_delegate_define(type_t *type, attr_list_t *attrs, statement_list_t *stmts, const struct location *where)
type_t * type_module_declare(char *name)
type_t * type_interface_define(type_t *iface, attr_list_t *attrs, type_t *inherit, statement_list_t *stmts, typeref_list_t *requires, const struct location *where)
type_t * type_new_basic(enum type_basic_type basic_type)
const char * type_get_decl_name(const type_t *type, enum name_type name_type)
type_t * type_new_pointer(type_t *ref)
type_t * type_parameterized_type_specialize_define(type_t *type)
type_t * type_new_void(void)
static size_t append_pointer_stars(char **buf, size_t *len, size_t pos, type_t *type)
type_t * type_interface_declare(char *name, struct namespace *namespace)
static char const * parameterized_type_shorthands[][2]
static size_t append_type_signature(char **buf, size_t *len, size_t pos, type_t *type)
static char * format_parameterized_type_impl_name(type_t *type, typeref_list_t *params, const char *prefix)
type_t * type_delegate_define(type_t *delegate, attr_list_t *attrs, statement_list_t *stmts, const struct location *where)
static size_t append_namespace(char **buf, size_t *len, size_t pos, struct namespace *namespace, const char *separator, const char *abi_prefix)
const char * type_get_name(const type_t *type, enum name_type name_type)
type_t * type_new_struct(char *name, struct namespace *namespace, int defined, var_list_t *fields, const struct location *where)
char * format_parameterized_type_name(type_t *type, typeref_list_t *params)
type_t * type_new_int(enum type_basic_type basic_type, int sign)
type_t * duptype(type_t *t, int dupname)
type_t * type_apicontract_define(type_t *apicontract, attr_list_t *attrs, const struct location *where)
static statement_t * replace_type_parameters_in_statement(statement_t *stmt, typeref_list_t *orig, typeref_list_t *repl, struct location *where)
type_t * type_new_enum(const char *name, struct namespace *namespace, int defined, var_list_t *enums, const struct location *where)
type_t * type_dispinterface_declare(char *name)
type_t * type_parameterized_type_specialize_declare(type_t *type, typeref_list_t *params)
static int is_valid_bitfield_type(const type_t *type)
static var_t * replace_type_parameters_in_var(var_t *var, typeref_list_t *orig, typeref_list_t *repl)
static type_t * replace_type_parameters_in_type(type_t *type, typeref_list_t *orig, typeref_list_t *repl)
type_t * type_dispinterface_define(type_t *iface, attr_list_t *attrs, var_list_t *props, var_list_t *methods, const struct location *where)
type_t * type_new_alias(const decl_spec_t *t, const char *name)
static void type_parameterized_delegate_specialize(type_t *tmpl, type_t *delegate, typeref_list_t *orig, typeref_list_t *repl)
type_t * make_type(enum type_type type)
type_t * type_coclass_define(type_t *coclass, attr_list_t *attrs, typeref_list_t *ifaces, const struct location *where)
static enum type_type type_get_type(const type_t *type)
type_t * find_parameterized_type(type_t *type, typeref_list_t *params)
static type_t * type_runtimeclass_get_default_iface(const type_t *type, int check)
typeref_t * make_typeref(type_t *type)
typeref_list_t * append_typeref(typeref_list_t *list, typeref_t *ref)
static type_t * type_delegate_get_iface(const type_t *type)
static int type_basic_get_sign(const type_t *type)
static type_t * type_pointer_get_root_type(type_t *type)
static typeref_list_t * type_iface_get_requires(const type_t *type)
static enum type_basic_type type_basic_get_type(const type_t *type)
static type_t * type_pointer_get_ref_type(const type_t *type)
static type_t * type_iface_get_inherit(const type_t *type)
static statement_list_t * type_iface_get_stmts(const type_t *type)
static const WCHAR props[]
var_list_t * append_var(var_list_t *list, var_t *var)
type_t * alloc_type(void)
#define TYPE_BASIC_INT_MAX
@ TYPE_PARAMETERIZED_TYPE
@ TYPE_ENCAPSULATED_UNION
type_t * reg_type(type_t *type, const char *name, struct namespace *namespace, int t)
static enum type_type type_get_type_detect_alias(const type_t *type)
var_t * make_var(char *name)
static int is_global_namespace(const struct namespace *namespace)
@ TYPE_BASIC_ERROR_STATUS_T
type_t * find_type(const char *name, struct namespace *namespace, int t)
#define STATEMENTS_FOR_EACH_FUNC(stmt, stmts)