ReactOS  0.4.14-dev-608-gd495a4f
typetree.h File Reference
#include "widltypes.h"
#include <assert.h>
Include dependency graph for typetree.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  name_type { NAME_DEFAULT, NAME_C }
 

Functions

type_ttype_new_function (var_list_t *args)
 
type_ttype_new_pointer (unsigned char pointer_default, type_t *ref, attr_list_t *attrs)
 
type_ttype_new_alias (type_t *t, const char *name)
 
type_ttype_new_module (char *name)
 
type_ttype_new_array (const char *name, type_t *element, int declptr, unsigned int dim, expr_t *size_is, expr_t *length_is, unsigned char ptr_default_fc)
 
type_ttype_new_basic (enum type_basic_type basic_type)
 
type_ttype_new_int (enum type_basic_type basic_type, int sign)
 
type_ttype_new_void (void)
 
type_ttype_new_coclass (char *name)
 
type_ttype_new_enum (const char *name, struct namespace *namespace, int defined, var_list_t *enums)
 
type_ttype_new_struct (char *name, struct namespace *namespace, int defined, var_list_t *fields)
 
type_ttype_new_nonencapsulated_union (const char *name, int defined, var_list_t *fields)
 
type_ttype_new_encapsulated_union (char *name, var_t *switch_field, var_t *union_field, var_list_t *cases)
 
type_ttype_new_bitfield (type_t *field_type, const expr_t *bits)
 
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, var_list_t *methods)
 
void type_dispinterface_define_from_iface (type_t *dispiface, type_t *iface)
 
void type_module_define (type_t *module, statement_list_t *stmts)
 
type_ttype_coclass_define (type_t *coclass, ifref_list_t *ifaces)
 
int type_is_equal (const type_t *type1, const type_t *type2)
 
const chartype_get_name (const type_t *type, enum name_type name_type)
 
type_tduptype (type_t *t, int dupname)
 
static type_ttype_get_real_type (const type_t *type)
 
static enum type_type type_get_type (const type_t *type)
 
static enum type_basic_type type_basic_get_type (const type_t *type)
 
static int type_basic_get_sign (const type_t *type)
 
static var_list_ttype_struct_get_fields (const type_t *type)
 
static var_list_ttype_function_get_args (const type_t *type)
 
static var_ttype_function_get_retval (const type_t *type)
 
static type_ttype_function_get_rettype (const type_t *type)
 
static var_list_ttype_enum_get_values (const type_t *type)
 
static var_ttype_union_get_switch_value (const type_t *type)
 
static var_list_ttype_encapsulated_union_get_fields (const type_t *type)
 
static var_list_ttype_union_get_cases (const type_t *type)
 
static statement_list_ttype_iface_get_stmts (const type_t *type)
 
static type_ttype_iface_get_inherit (const type_t *type)
 
static var_list_ttype_dispiface_get_props (const type_t *type)
 
static var_list_ttype_dispiface_get_methods (const type_t *type)
 
static type_ttype_dispiface_get_inherit (const type_t *type)
 
static int type_is_defined (const type_t *type)
 
static int type_is_complete (const type_t *type)
 
static int type_array_has_conformance (const type_t *type)
 
static int type_array_has_variance (const type_t *type)
 
static unsigned int type_array_get_dim (const type_t *type)
 
static expr_ttype_array_get_conformance (const type_t *type)
 
static expr_ttype_array_get_variance (const type_t *type)
 
static type_ttype_array_get_element (const type_t *type)
 
static int type_array_is_decl_as_ptr (const type_t *type)
 
static unsigned char type_array_get_ptr_default_fc (const type_t *type)
 
static int type_is_alias (const type_t *type)
 
static type_ttype_alias_get_aliasee (const type_t *type)
 
static ifref_list_ttype_coclass_get_ifaces (const type_t *type)
 
static type_ttype_pointer_get_ref (const type_t *type)
 
static unsigned char type_pointer_get_default_fc (const type_t *type)
 
static type_ttype_bitfield_get_field (const type_t *type)
 
static const expr_ttype_bitfield_get_bits (const type_t *type)
 

Enumeration Type Documentation

◆ name_type

Enumerator
NAME_DEFAULT 
NAME_C 

Definition at line 27 of file typetree.h.

27  {
29  NAME_C
30 };

Function Documentation

◆ duptype()

type_t* duptype ( type_t t,
int  dupname 
)

Definition at line 33 of file typetree.c.

34 {
35  type_t *d = alloc_type();
36 
37  *d = *t;
38  if (dupname && t->name)
39  d->name = xstrdup(t->name);
40 
41  return d;
42 }
GLdouble GLdouble t
Definition: gl.h:2047
#define d
Definition: ke_i.h:81
char * name
Definition: compiler.c:66
type_t * alloc_type(void)
Definition: parser.tab.c:5517
char * xstrdup(const char *s)
Definition: uimain.c:768

Referenced by declare_var(), make_decl_spec(), and type_new_alias().

◆ type_alias_get_aliasee()

◆ type_array_get_conformance()

static expr_t* type_array_get_conformance ( const type_t type)
inlinestatic

Definition at line 239 of file typetree.h.

240 {
243  return type->details.array.size_is;
244 }
static type_t * type_get_real_type(const type_t *type)
Definition: typetree.h:60
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define assert(x)
Definition: debug.h:53
static enum type_type type_get_type(const type_t *type)
Definition: typetree.h:68

Referenced by assign_stub_out_args(), check_remoting_args(), clear_output_vars(), declare_var(), get_array_fc(), get_size_is_expr(), write_array_tfs(), write_parameter_conf_or_var_exprs(), and write_string_tfs().

◆ type_array_get_dim()

static unsigned int type_array_get_dim ( const type_t type)
inlinestatic

Definition at line 232 of file typetree.h.

233 {
236  return type->details.array.dim;
237 }
static type_t * type_get_real_type(const type_t *type)
Definition: typetree.h:60
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define assert(x)
Definition: debug.h:53
static enum type_type type_get_type(const type_t *type)
Definition: typetree.h:68

Referenced by check_remoting_args(), declare_var(), encode_var(), get_array_fc(), get_required_buffer_size_type(), type_memsize_and_alignment(), write_array_tfs(), write_fixed_array_pointer_descriptions(), write_string_tfs(), write_type_right(), and write_var_desc().

◆ type_array_get_element()

◆ type_array_get_ptr_default_fc()

static unsigned char type_array_get_ptr_default_fc ( const type_t type)
inlinestatic

Definition at line 267 of file typetree.h.

268 {
271  return type->details.array.ptr_def_fc;
272 }
static type_t * type_get_real_type(const type_t *type)
Definition: typetree.h:60
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define assert(x)
Definition: debug.h:53
static enum type_type type_get_type(const type_t *type)
Definition: typetree.h:68

Referenced by declare_var(), and get_pointer_fc().

◆ type_array_get_variance()

static expr_t* type_array_get_variance ( const type_t type)
inlinestatic

Definition at line 246 of file typetree.h.

247 {
250  return type->details.array.length_is;
251 }
static type_t * type_get_real_type(const type_t *type)
Definition: typetree.h:60
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define assert(x)
Definition: debug.h:53
static enum type_type type_get_type(const type_t *type)
Definition: typetree.h:68

Referenced by write_array_tfs(), and write_parameter_conf_or_var_exprs().

◆ type_array_has_conformance()

static int type_array_has_conformance ( const type_t type)
inlinestatic

Definition at line 218 of file typetree.h.

219 {
222  return (type->details.array.size_is != NULL);
223 }
static type_t * type_get_real_type(const type_t *type)
Definition: typetree.h:60
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define assert(x)
Definition: debug.h:53
smooth NULL
Definition: ftsmooth.c:416
static enum type_type type_get_type(const type_t *type)
Definition: typetree.h:68

Referenced by assign_stub_out_args(), check_remoting_args(), clear_output_vars(), get_size_is_expr(), get_struct_fc(), is_conformant_array(), write_fixed_array_pointer_descriptions(), write_parameter_conf_or_var_exprs(), and write_string_tfs().

◆ type_array_has_variance()

static int type_array_has_variance ( const type_t type)
inlinestatic

Definition at line 225 of file typetree.h.

226 {
229  return (type->details.array.length_is != NULL);
230 }
static type_t * type_get_real_type(const type_t *type)
Definition: typetree.h:60
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define assert(x)
Definition: debug.h:53
smooth NULL
Definition: ftsmooth.c:416
static enum type_type type_get_type(const type_t *type)
Definition: typetree.h:68

Referenced by get_array_fc(), get_struct_fc(), write_conformant_array_pointer_descriptions(), write_fixed_array_pointer_descriptions(), write_parameter_conf_or_var_exprs(), and write_varying_array_pointer_descriptions().

◆ type_array_is_decl_as_ptr()

◆ type_basic_get_sign()

static int type_basic_get_sign ( const type_t type)
inlinestatic

Definition at line 80 of file typetree.h.

81 {
84  return type->details.basic.sign;
85 }
static type_t * type_get_real_type(const type_t *type)
Definition: typetree.h:60
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define assert(x)
Definition: debug.h:53
static enum type_type type_get_type(const type_t *type)
Definition: typetree.h:68

Referenced by get_basic_fc(), get_type_vt(), is_signed_integer_type(), and write_type_left().

◆ type_basic_get_type()

static enum type_basic_type type_basic_get_type ( const type_t type)
inlinestatic

◆ type_bitfield_get_bits()

static const expr_t* type_bitfield_get_bits ( const type_t type)
inlinestatic

Definition at line 313 of file typetree.h.

314 {
317  return type->details.bitfield.bits;
318 }
static type_t * type_get_real_type(const type_t *type)
Definition: typetree.h:60
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define assert(x)
Definition: debug.h:53
static enum type_type type_get_type(const type_t *type)
Definition: typetree.h:68

Referenced by write_type_right().

◆ type_bitfield_get_field()

static type_t* type_bitfield_get_field ( const type_t type)
inlinestatic

Definition at line 306 of file typetree.h.

307 {
310  return type->details.bitfield.field;
311 }
static type_t * type_get_real_type(const type_t *type)
Definition: typetree.h:60
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define assert(x)
Definition: debug.h:53
static enum type_type type_get_type(const type_t *type)
Definition: typetree.h:68

Referenced by write_type_left().

◆ type_coclass_define()

type_t* type_coclass_define ( type_t coclass,
ifref_list_t ifaces 
)

Definition at line 488 of file typetree.c.

489 {
490  coclass->details.coclass.ifaces = ifaces;
491  coclass->defined = TRUE;
492  return coclass;
493 }
#define TRUE
Definition: types.h:120
struct coclass_details coclass
Definition: widltypes.h:430
unsigned int defined
Definition: widltypes.h:442
union _type_t::@4053 details

Referenced by yyparse().

◆ type_coclass_get_ifaces()

static ifref_list_t* type_coclass_get_ifaces ( const type_t type)
inlinestatic

Definition at line 285 of file typetree.h.

286 {
289  return type->details.coclass.ifaces;
290 }
static type_t * type_get_real_type(const type_t *type)
Definition: typetree.h:60
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define assert(x)
Definition: debug.h:53
static enum type_type type_get_type(const type_t *type)
Definition: typetree.h:68

Referenced by add_coclass_typeinfo().

◆ type_dispiface_get_inherit()

static type_t* type_dispiface_get_inherit ( const type_t type)
inlinestatic

Definition at line 179 of file typetree.h.

180 {
183  return type->details.iface->disp_inherit;
184 }
static type_t * type_get_real_type(const type_t *type)
Definition: typetree.h:60
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define assert(x)
Definition: debug.h:53
static enum type_type type_get_type(const type_t *type)
Definition: typetree.h:68

Referenced by add_dispinterface_typeinfo().

◆ type_dispiface_get_methods()

static var_list_t* type_dispiface_get_methods ( const type_t type)
inlinestatic

Definition at line 172 of file typetree.h.

173 {
176  return type->details.iface->disp_methods;
177 }
static type_t * type_get_real_type(const type_t *type)
Definition: typetree.h:60
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define assert(x)
Definition: debug.h:53
static enum type_type type_get_type(const type_t *type)
Definition: typetree.h:68

Referenced by add_dispinterface_typeinfo().

◆ type_dispiface_get_props()

static var_list_t* type_dispiface_get_props ( const type_t type)
inlinestatic

Definition at line 165 of file typetree.h.

166 {
169  return type->details.iface->disp_props;
170 }
static type_t * type_get_real_type(const type_t *type)
Definition: typetree.h:60
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define assert(x)
Definition: debug.h:53
static enum type_type type_get_type(const type_t *type)
Definition: typetree.h:68

Referenced by add_dispinterface_typeinfo().

◆ type_dispinterface_define()

void type_dispinterface_define ( type_t iface,
var_list_t props,
var_list_t methods 
)

Definition at line 452 of file typetree.c.

453 {
454  iface->details.iface = xmalloc(sizeof(*iface->details.iface));
455  iface->details.iface->disp_props = props;
456  iface->details.iface->disp_methods = methods;
457  iface->details.iface->stmts = NULL;
458  iface->details.iface->inherit = find_type("IDispatch", NULL, 0);
459  if (!iface->details.iface->inherit) error_loc("IDispatch is undefined\n");
460  iface->details.iface->disp_inherit = NULL;
461  iface->details.iface->async_iface = NULL;
462  iface->defined = TRUE;
463  compute_method_indexes(iface);
464 }
#define TRUE
Definition: types.h:120
void * xmalloc(int size)
Definition: uimain.c:747
void error_loc(const char *s,...)
Definition: utils.c:69
smooth NULL
Definition: ftsmooth.c:416
static int compute_method_indexes(type_t *iface)
Definition: typetree.c:416
unsigned int defined
Definition: widltypes.h:442
union _type_t::@4053 details
struct iface_details * iface
Definition: widltypes.h:427
type_t * find_type(const char *name, struct namespace *namespace, int t)
Definition: parser.tab.c:6139
static const WCHAR props[]
Definition: wbemdisp.c:288

Referenced by yyparse().

◆ type_dispinterface_define_from_iface()

void type_dispinterface_define_from_iface ( type_t dispiface,
type_t iface 
)

Definition at line 466 of file typetree.c.

467 {
468  dispiface->details.iface = xmalloc(sizeof(*dispiface->details.iface));
469  dispiface->details.iface->disp_props = NULL;
470  dispiface->details.iface->disp_methods = NULL;
471  dispiface->details.iface->stmts = NULL;
472  dispiface->details.iface->inherit = find_type("IDispatch", NULL, 0);
473  if (!dispiface->details.iface->inherit) error_loc("IDispatch is undefined\n");
474  dispiface->details.iface->disp_inherit = iface;
475  dispiface->details.iface->async_iface = NULL;
476  dispiface->defined = TRUE;
477  compute_method_indexes(dispiface);
478 }
#define TRUE
Definition: types.h:120
void * xmalloc(int size)
Definition: uimain.c:747
void error_loc(const char *s,...)
Definition: utils.c:69
smooth NULL
Definition: ftsmooth.c:416
static int compute_method_indexes(type_t *iface)
Definition: typetree.c:416
unsigned int defined
Definition: widltypes.h:442
union _type_t::@4053 details
struct iface_details * iface
Definition: widltypes.h:427
type_t * find_type(const char *name, struct namespace *namespace, int t)
Definition: parser.tab.c:6139

Referenced by yyparse().

◆ type_encapsulated_union_get_fields()

static var_list_t* type_encapsulated_union_get_fields ( const type_t type)
inlinestatic

Definition at line 127 of file typetree.h.

128 {
131  return type->details.structure->fields;
132 }
static type_t * type_get_real_type(const type_t *type)
Definition: typetree.h:60
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define assert(x)
Definition: debug.h:53
static enum type_type type_get_type(const type_t *type)
Definition: typetree.h:68

Referenced by type_buffer_alignment(), type_memsize_and_alignment(), and write_type_left().

◆ type_enum_get_values()

static var_list_t* type_enum_get_values ( const type_t type)
inlinestatic

Definition at line 113 of file typetree.h.

114 {
117  return type->details.enumeration->enums;
118 }
static type_t * type_get_real_type(const type_t *type)
Definition: typetree.h:60
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define assert(x)
Definition: debug.h:53
static enum type_type type_get_type(const type_t *type)
Definition: typetree.h:68

Referenced by add_enum_typeinfo(), check_for_additional_prototype_types(), and write_type_left().

◆ type_function_get_args()

static var_list_t* type_function_get_args ( const type_t type)
inlinestatic

Definition at line 94 of file typetree.h.

95 {
98  return type->details.function->args;
99 }
static type_t * type_get_real_type(const type_t *type)
Definition: typetree.h:60
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define assert(x)
Definition: debug.h:53
static enum type_type type_get_type(const type_t *type)
Definition: typetree.h:68

Referenced by find_identifier(), and write_type_v().

◆ type_function_get_rettype()

◆ type_function_get_retval()

static var_t* type_function_get_retval ( const type_t type)
inlinestatic

Definition at line 101 of file typetree.h.

102 {
105  return type->details.function->retval;
106 }
static type_t * type_get_real_type(const type_t *type)
Definition: typetree.h:60
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define assert(x)
Definition: debug.h:53
static enum type_type type_get_type(const type_t *type)
Definition: typetree.h:68

Referenced by declare_stub_args(), gen_proxy(), get_func_oi2_flags(), process_tfs_iface(), type_function_get_rettype(), write_func_param_struct(), write_function_stub(), write_parameters_init(), write_procformatstring_func(), and write_remoting_arguments().

◆ type_get_name()

const char* type_get_name ( const type_t type,
enum name_type  name_type 
)

Definition at line 81 of file typetree.c.

82 {
83  switch(name_type) {
84  case NAME_DEFAULT:
85  return type->name;
86  case NAME_C:
87  return type->c_name;
88  }
89 
90  assert(0);
91  return NULL;
92 }
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define assert(x)
Definition: debug.h:53
name_type
Definition: typetree.h:27
smooth NULL
Definition: ftsmooth.c:416

Referenced by write_type_left().

◆ type_get_real_type()

◆ type_get_type()

static enum type_type type_get_type ( const type_t type)
inlinestatic

Definition at line 68 of file typetree.h.

69 {
71 }
static type_t * type_get_real_type(const type_t *type)
Definition: typetree.h:60
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static enum type_type type_get_type_detect_alias(const type_t *type)
Definition: widltypes.h:589

Referenced by add_type_typeinfo(), build_iface_list(), builtin_vt(), check_all_user_types(), check_field_common(), check_for_additional_prototype_types(), check_iface_attrs(), check_remoting_args(), check_remoting_fields(), check_statements(), clear_output_vars(), decl_indirect(), declare_stub_args(), declare_var(), does_any_iface(), dump_type(), encode_type(), find_array_or_string_in_struct(), find_identifier(), find_ps_factory(), for_each_iface(), for_each_serializable(), free_variable(), get_enum_fc(), get_func_handle_var(), get_type_vt(), is_aggregate_return(), is_allowed_conf_type(), is_allowed_range_type(), is_array(), is_declptr(), is_float_type(), is_integer_type(), is_interpreted_func(), is_non_complex_struct(), is_ptr(), is_signed_integer_type(), is_valid_bitfield_type(), is_valid_member_operand(), is_void(), make_statement_declaration(), print_phase_basetype(), type_array_get_conformance(), type_array_get_dim(), type_array_get_element(), type_array_get_ptr_default_fc(), type_array_get_variance(), type_array_has_conformance(), type_array_has_variance(), type_array_is_decl_as_ptr(), type_basic_get_sign(), type_basic_get_type(), type_bitfield_get_bits(), type_bitfield_get_field(), type_buffer_alignment(), type_coclass_get_ifaces(), type_dispiface_get_inherit(), type_dispiface_get_methods(), type_dispiface_get_props(), type_encapsulated_union_get_fields(), type_enum_get_values(), type_function_get_args(), type_function_get_retval(), type_iface_get_inherit(), type_iface_get_stmts(), type_memsize_and_alignment(), type_new_function(), type_pointer_get_default_fc(), type_pointer_get_ref(), type_struct_get_fields(), type_union_get_cases(), type_union_get_switch_value(), typegen_detect_type(), user_type_has_variable_size(), write_array_element_type(), write_base_type(), write_branch_type(), write_client_ifaces(), write_coclasses(), write_conf_or_var_desc(), write_default_value(), write_descriptors(), write_expr_eval_routines(), write_fixed_array_pointer_descriptions(), write_forward_decls(), write_header_stmts(), write_id_data_stmts(), write_imports(), write_interfaces(), write_local_stubs_stmts(), write_locals(), write_member_type(), write_old_procformatstring_type(), write_parameter_conf_or_var_exprs(), write_pointer_description(), write_pointer_description_offsets(), write_proc_func_header(), write_progids(), write_proxy_stmts(), write_range_tfs(), write_remoting_arg(), write_server_stmts(), write_simple_pointer(), write_string_tfs(), write_struct_members(), write_type_left(), write_type_right(), write_typelib_interfaces(), write_union_tfs(), write_user_tfs(), write_var_desc(), write_varying_array_pointer_descriptions(), and yyparse().

◆ type_iface_get_inherit()

static type_t* type_iface_get_inherit ( const type_t type)
inlinestatic

◆ type_iface_get_stmts()

◆ type_interface_define()

void type_interface_define ( type_t iface,
type_t inherit,
statement_list_t stmts 
)

Definition at line 439 of file typetree.c.

440 {
441  iface->details.iface = xmalloc(sizeof(*iface->details.iface));
442  iface->details.iface->disp_props = NULL;
443  iface->details.iface->disp_methods = NULL;
444  iface->details.iface->stmts = stmts;
445  iface->details.iface->inherit = inherit;
446  iface->details.iface->disp_inherit = NULL;
447  iface->details.iface->async_iface = NULL;
448  iface->defined = TRUE;
449  compute_method_indexes(iface);
450 }
#define TRUE
Definition: types.h:120
void * xmalloc(int size)
Definition: uimain.c:747
smooth NULL
Definition: ftsmooth.c:416
static int compute_method_indexes(type_t *iface)
Definition: typetree.c:416
unsigned int defined
Definition: widltypes.h:442
union _type_t::@4053 details
struct iface_details * iface
Definition: widltypes.h:427

Referenced by check_async_uuid(), and yyparse().

◆ type_is_alias()

◆ type_is_complete()

static int type_is_complete ( const type_t type)
inlinestatic

Definition at line 191 of file typetree.h.

192 {
194  {
195  case TYPE_FUNCTION:
196  return (type->details.function != NULL);
197  case TYPE_INTERFACE:
198  return (type->details.iface != NULL);
199  case TYPE_ENUM:
200  return (type->details.enumeration != NULL);
201  case TYPE_UNION:
203  case TYPE_STRUCT:
204  return (type->details.structure != NULL);
205  case TYPE_VOID:
206  case TYPE_BASIC:
207  case TYPE_ALIAS:
208  case TYPE_MODULE:
209  case TYPE_COCLASS:
210  case TYPE_POINTER:
211  case TYPE_ARRAY:
212  case TYPE_BITFIELD:
213  return TRUE;
214  }
215  return FALSE;
216 }
#define TRUE
Definition: types.h:120
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
smooth NULL
Definition: ftsmooth.c:416
static enum type_type type_get_type_detect_alias(const type_t *type)
Definition: widltypes.h:589

Referenced by check_for_additional_prototype_types(), and check_remoting_fields().

◆ type_is_defined()

static int type_is_defined ( const type_t type)
inlinestatic

Definition at line 186 of file typetree.h.

187 {
188  return type->defined;
189 }
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

Referenced by is_object().

◆ type_is_equal()

int type_is_equal ( const type_t type1,
const type_t type2 
)

Definition at line 495 of file typetree.c.

496 {
498  return FALSE;
499 
500  if (type1->name && type2->name)
501  return !strcmp(type1->name, type2->name);
502  else if ((!type1->name && type2->name) || (type1->name && !type2->name))
503  return FALSE;
504 
505  /* FIXME: do deep inspection of types to determine if they are equal */
506 
507  return FALSE;
508 }
static enum type_type type_get_type_detect_alias(const type_t *type)
Definition: widltypes.h:589
const char * name
Definition: widltypes.h:418
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469

Referenced by fix_incomplete_types().

◆ type_module_define()

void type_module_define ( type_t module,
statement_list_t stmts 
)

Definition at line 480 of file typetree.c.

481 {
482  if (module->details.module) error_loc("multiple definition error\n");
483  module->details.module = xmalloc(sizeof(*module->details.module));
484  module->details.module->stmts = stmts;
485  module->defined = TRUE;
486 }
#define TRUE
Definition: types.h:120
void * xmalloc(int size)
Definition: uimain.c:747
void error_loc(const char *s,...)
Definition: utils.c:69
IMAGEHLP_MODULEW64 module

Referenced by yyparse().

◆ type_new_alias()

type_t* type_new_alias ( type_t t,
const char name 
)

Definition at line 190 of file typetree.c.

191 {
192  type_t *a = duptype(t, 0);
193 
194  a->name = xstrdup(name);
195  a->attrs = NULL;
196  a->orig = t;
197  a->is_alias = TRUE;
198  /* for pointer types */
199  a->details = t->details;
200  init_loc_info(&a->loc_info);
201 
202  return a;
203 }
#define TRUE
Definition: types.h:120
type_t * duptype(type_t *t, int dupname)
Definition: typetree.c:33
GLdouble GLdouble t
Definition: gl.h:2047
#define a
Definition: ke_i.h:78
smooth NULL
Definition: ftsmooth.c:416
void init_loc_info(loc_info_t *i)
Definition: parser.tab.c:7200
Definition: name.c:38
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
char * xstrdup(const char *s)
Definition: uimain.c:768

Referenced by decl_builtin_alias(), make_safearray(), and reg_typedefs().

◆ type_new_array()

type_t* type_new_array ( const char name,
type_t element,
int  declptr,
unsigned int  dim,
expr_t size_is,
expr_t length_is,
unsigned char  ptr_default_fc 
)

Definition at line 226 of file typetree.c.

229 {
231  if (name) t->name = xstrdup(name);
232  t->details.array.declptr = declptr;
233  t->details.array.length_is = length_is;
234  if (size_is)
235  t->details.array.size_is = size_is;
236  else
237  t->details.array.dim = dim;
238  t->details.array.elem = element;
239  t->details.array.ptr_def_fc = ptr_default_fc;
240  return t;
241 }
type_t * make_type(enum type_type type)
Definition: typetree.c:44
GLdouble GLdouble t
Definition: gl.h:2047
Definition: name.c:38
char * xstrdup(const char *s)
Definition: uimain.c:768

Referenced by append_array(), declare_var(), and make_safearray().

◆ type_new_basic()

type_t* type_new_basic ( enum type_basic_type  basic_type)

Definition at line 243 of file typetree.c.

244 {
246  t->details.basic.type = basic_type;
247  t->details.basic.sign = 0;
248  return t;
249 }
type_t * make_type(enum type_type type)
Definition: typetree.c:44
GLdouble GLdouble t
Definition: gl.h:2047

Referenced by decl_builtin_basic(), init_types(), resolve_expression(), and type_new_int().

◆ type_new_bitfield()

type_t* type_new_bitfield ( type_t field_type,
const expr_t bits 
)

Definition at line 398 of file typetree.c.

399 {
400  type_t *t;
401 
403  error_loc("bit-field has invalid type\n");
404 
405  if (bits->cval < 0)
406  error_loc("negative width for bit-field\n");
407 
408  /* FIXME: validate bits->cval <= memsize(field) * 8 */
409 
411  t->details.bitfield.field = field;
412  t->details.bitfield.bits = bits;
413  return t;
414 }
static int is_valid_bitfield_type(const type_t *type)
Definition: typetree.c:365
type_t * make_type(enum type_type type)
Definition: typetree.c:44
GLdouble GLdouble t
Definition: gl.h:2047
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929
void error_loc(const char *s,...)
Definition: utils.c:69
Definition: parser.c:43

Referenced by declare_var().

◆ type_new_coclass()

type_t* type_new_coclass ( char name)

Definition at line 215 of file typetree.c.

216 {
218  if (type->type_type != TYPE_COCLASS || type->defined)
219  error_loc("%s: redefinition error; original definition was at %s:%d\n",
220  type->name, type->loc_info.input_name, type->loc_info.line_number);
221  type->name = name;
222  return type;
223 }
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
void error_loc(const char *s,...)
Definition: utils.c:69
smooth NULL
Definition: ftsmooth.c:416
Definition: name.c:38
struct hlsl_type * get_type(struct hlsl_scope *scope, const char *name, BOOL recursive) DECLSPEC_HIDDEN
Definition: utils.c:841
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by yyparse().

◆ type_new_encapsulated_union()

type_t* type_new_encapsulated_union ( char name,
var_t switch_field,
var_t union_field,
var_list_t cases 
)

Definition at line 353 of file typetree.c.

354 {
356  if (!union_field) union_field = make_var( xstrdup("tagged_union") );
357  union_field->type = type_new_nonencapsulated_union(NULL, TRUE, cases);
358  t->details.structure = xmalloc(sizeof(*t->details.structure));
359  t->details.structure->fields = append_var( NULL, switch_field );
360  t->details.structure->fields = append_var( t->details.structure->fields, union_field );
361  t->defined = TRUE;
362  return t;
363 }
#define TRUE
Definition: types.h:120
type_t * type_new_nonencapsulated_union(const char *name, int defined, var_list_t *fields)
Definition: typetree.c:330
GLdouble GLdouble t
Definition: gl.h:2047
#define tsUNION
Definition: widltypes.h:568
void * xmalloc(int size)
Definition: uimain.c:747
smooth NULL
Definition: ftsmooth.c:416
type_t * type
Definition: widltypes.h:452
var_list_t * append_var(var_list_t *list, var_t *var)
Definition: parser.tab.c:5852
Definition: name.c:38
struct hlsl_type * get_type(struct hlsl_scope *scope, const char *name, BOOL recursive) DECLSPEC_HIDDEN
Definition: utils.c:841
var_t * make_var(char *name)
Definition: parser.tab.c:5876
char * xstrdup(const char *s)
Definition: uimain.c:768

Referenced by yyparse().

◆ type_new_enum()

type_t* type_new_enum ( const char name,
struct namespace namespace,
int  defined,
var_list_t enums 
)

Definition at line 274 of file typetree.c.

275 {
276  type_t *tag_type = name ? find_type(name, namespace, tsENUM) : NULL;
278  t->name = name;
279  t->namespace = namespace;
280 
281  if (tag_type && tag_type->details.enumeration)
282  t->details.enumeration = tag_type->details.enumeration;
283  else if (defined)
284  {
285  t->details.enumeration = xmalloc(sizeof(*t->details.enumeration));
286  t->details.enumeration->enums = enums;
287  t->defined = TRUE;
288  }
289 
290  if (name)
291  {
292  if (defined)
293  reg_type(t, name, namespace, tsENUM);
294  else
295  add_incomplete(t);
296  }
297  return t;
298 }
#define TRUE
Definition: types.h:120
type_t * make_type(enum type_type type)
Definition: typetree.c:44
static const struct encodedInt enums[]
Definition: encode.c:365
GLdouble GLdouble t
Definition: gl.h:2047
void add_incomplete(type_t *t)
Definition: parser.tab.c:6026
#define tsENUM
Definition: widltypes.h:566
struct enumeration_details * enumeration
Definition: widltypes.h:425
void * xmalloc(int size)
Definition: uimain.c:747
smooth NULL
Definition: ftsmooth.c:416
union _type_t::@4053 details
type_t * find_type(const char *name, struct namespace *namespace, int t)
Definition: parser.tab.c:6139
Definition: name.c:38
type_t * reg_type(type_t *type, const char *name, struct namespace *namespace, int t)
Definition: parser.tab.c:5992
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by yyparse().

◆ type_new_function()

type_t* type_new_function ( var_list_t args)

Definition at line 131 of file typetree.c.

132 {
133  var_t *arg;
134  type_t *t;
135  unsigned int i = 0;
136 
137  if (args)
138  {
140  if (list_count(args) == 1 && !arg->name && arg->type && type_get_type(arg->type) == TYPE_VOID)
141  {
142  list_remove(&arg->entry);
143  free(arg);
144  free(args);
145  args = NULL;
146  }
147  }
149  {
150  if (arg->type && type_get_type(arg->type) == TYPE_VOID)
151  error_loc("argument '%s' has void type\n", arg->name);
152  if (!arg->name)
153  {
154  if (i > 26 * 26)
155  error_loc("too many unnamed arguments\n");
156  else
157  {
158  int unique;
159  do
160  {
161  char name[3];
162  name[0] = i > 26 ? 'a' + i / 26 : 'a' + i;
163  name[1] = i > 26 ? 'a' + i % 26 : 0;
164  name[2] = 0;
165  unique = !find_arg(args, name);
166  if (unique)
167  arg->name = xstrdup(name);
168  i++;
169  } while (!unique);
170  }
171  }
172  }
173 
175  t->details.function = xmalloc(sizeof(*t->details.function));
176  t->details.function->args = args;
177  t->details.function->idx = -1;
178  return t;
179 }
static const var_t * find_arg(const var_list_t *args, const char *name)
Definition: typetree.c:68
type_t * make_type(enum type_type type)
Definition: typetree.c:44
#define free
Definition: debug_ros.c:5
GLdouble GLdouble t
Definition: gl.h:2047
void * arg
Definition: msvc.h:10
Definition: match.c:390
__WINE_SERVER_LIST_INLINE struct list * list_head(const struct list *list)
Definition: list.h:131
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
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
Definition: glfuncs.h:248
void * xmalloc(int size)
Definition: uimain.c:747
__WINE_SERVER_LIST_INLINE unsigned int list_count(const struct list *list)
Definition: list.h:155
void error_loc(const char *s,...)
Definition: utils.c:69
smooth NULL
Definition: ftsmooth.c:416
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
static enum type_type type_get_type(const type_t *type)
Definition: typetree.h:68
uint32_t entry
Definition: isohybrid.c:63
Definition: name.c:38
_ForwardIter unique(_ForwardIter __first, _ForwardIter __last)
Definition: _algo.h:298
char * xstrdup(const char *s)
Definition: uimain.c:768
#define LIST_ENTRY(type)
Definition: queue.h:175
#define args
Definition: format.c:66

Referenced by check_async_uuid(), and yyparse().

◆ type_new_int()

type_t* type_new_int ( enum type_basic_type  basic_type,
int  sign 
)

Definition at line 251 of file typetree.c.

252 {
253  static type_t *int_types[TYPE_BASIC_INT_MAX+1][3];
254 
255  assert(basic_type <= TYPE_BASIC_INT_MAX);
256 
257  /* map sign { -1, 0, 1 } -> { 0, 1, 2 } */
258  if (!int_types[basic_type][sign + 1])
259  {
260  int_types[basic_type][sign + 1] = type_new_basic(basic_type);
261  int_types[basic_type][sign + 1]->details.basic.sign = sign;
262  }
263  return int_types[basic_type][sign + 1];
264 }
static size_t double int int int * sign
Definition: printf.c:69
#define TYPE_BASIC_INT_MAX
Definition: widltypes.h:281
#define assert(x)
Definition: debug.h:53
union _type_t::@4053 details
type_t * type_new_basic(enum type_basic_type basic_type)
Definition: typetree.c:243
struct basic_details basic
Definition: widltypes.h:431

Referenced by resolve_expression(), and yyparse().

◆ type_new_module()

type_t* type_new_module ( char name)

Definition at line 205 of file typetree.c.

206 {
208  if (type->type_type != TYPE_MODULE || type->defined)
209  error_loc("%s: redefinition error; original definition was at %s:%d\n",
210  type->name, type->loc_info.input_name, type->loc_info.line_number);
211  type->name = name;
212  return type;
213 }
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
void error_loc(const char *s,...)
Definition: utils.c:69
smooth NULL
Definition: ftsmooth.c:416
Definition: name.c:38
struct hlsl_type * get_type(struct hlsl_scope *scope, const char *name, BOOL recursive) DECLSPEC_HIDDEN
Definition: utils.c:841
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by yyparse().

◆ type_new_nonencapsulated_union()

type_t* type_new_nonencapsulated_union ( const char name,
int  defined,
var_list_t fields 
)

Definition at line 330 of file typetree.c.

331 {
332  type_t *tag_type = name ? find_type(name, NULL, tsUNION) : NULL;
334  t->name = name;
335  if (tag_type && tag_type->details.structure)
336  t->details.structure = tag_type->details.structure;
337  else if (defined)
338  {
339  t->details.structure = xmalloc(sizeof(*t->details.structure));
340  t->details.structure->fields = fields;
341  t->defined = TRUE;
342  }
343  if (name)
344  {
345  if (defined)
346  reg_type(t, name, NULL, tsUNION);
347  else
348  add_incomplete(t);
349  }
350  return t;
351 }
struct struct_details * structure
Definition: widltypes.h:424
#define TRUE
Definition: types.h:120
type_t * make_type(enum type_type type)
Definition: typetree.c:44
GLdouble GLdouble t
Definition: gl.h:2047
void add_incomplete(type_t *t)
Definition: parser.tab.c:6026
#define tsUNION
Definition: widltypes.h:568
void * xmalloc(int size)
Definition: uimain.c:747
smooth NULL
Definition: ftsmooth.c:416
union _type_t::@4053 details
type_t * find_type(const char *name, struct namespace *namespace, int t)
Definition: parser.tab.c:6139
Definition: name.c:38
type_t * reg_type(type_t *type, const char *name, struct namespace *namespace, int t)
Definition: parser.tab.c:5992
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by type_new_encapsulated_union(), and yyparse().

◆ type_new_pointer()

type_t* type_new_pointer ( unsigned char  pointer_default,
type_t ref,
attr_list_t attrs 
)

Definition at line 181 of file typetree.c.

182 {
184  t->details.pointer.def_fc = pointer_default;
185  t->details.pointer.ref = ref;
186  t->attrs = attrs;
187  return t;
188 }
type_t * make_type(enum type_type type)
Definition: typetree.c:44
GLdouble GLdouble t
Definition: gl.h:2047
GLenum GLint ref
Definition: glext.h:6028
static unsigned char pointer_default
Definition: parser.tab.c:114

Referenced by resolve_expression(), and yyparse().

◆ type_new_struct()

type_t* type_new_struct ( char name,
struct namespace namespace,
int  defined,
var_list_t fields 
)

Definition at line 300 of file typetree.c.

301 {
302  type_t *tag_type = name ? find_type(name, namespace, tsSTRUCT) : NULL;
303  type_t *t;
304 
305  /* avoid creating duplicate typelib type entries */
306  if (tag_type && do_typelib) return tag_type;
307 
309  t->name = name;
310  t->namespace = namespace;
311 
312  if (tag_type && tag_type->details.structure)
313  t->details.structure = tag_type->details.structure;
314  else if (defined)
315  {
316  t->details.structure = xmalloc(sizeof(*t->details.structure));
317  t->details.structure->fields = fields;
318  t->defined = TRUE;
319  }
320  if (name)
321  {
322  if (defined)
323  reg_type(t, name, namespace, tsSTRUCT);
324  else
325  add_incomplete(t);
326  }
327  return t;
328 }
struct struct_details * structure
Definition: widltypes.h:424
#define TRUE
Definition: types.h:120
type_t * make_type(enum type_type type)
Definition: typetree.c:44
GLdouble GLdouble t
Definition: gl.h:2047
void add_incomplete(type_t *t)
Definition: parser.tab.c:6026
void * xmalloc(int size)
Definition: uimain.c:747
#define tsSTRUCT
Definition: widltypes.h:567
smooth NULL
Definition: ftsmooth.c:416
int do_typelib
Definition: widl.c:117
union _type_t::@4053 details
type_t * find_type(const char *name, struct namespace *namespace, int t)
Definition: parser.tab.c:6139
Definition: name.c:38
type_t * reg_type(type_t *type, const char *name, struct namespace *namespace, int t)
Definition: parser.tab.c:5992
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by yyparse().

◆ type_new_void()

type_t* type_new_void ( void  )

Definition at line 266 of file typetree.c.

267 {
268  static type_t *void_type = NULL;
269  if (!void_type)
270  void_type = make_type(TYPE_VOID);
271  return void_type;
272 }
type_t * make_type(enum type_type type)
Definition: typetree.c:44
smooth NULL
Definition: ftsmooth.c:416

Referenced by yyparse().

◆ type_pointer_get_default_fc()

static unsigned char type_pointer_get_default_fc ( const type_t type)
inlinestatic

Definition at line 299 of file typetree.h.

300 {
303  return type->details.pointer.def_fc;
304 }
static type_t * type_get_real_type(const type_t *type)
Definition: typetree.h:60
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define assert(x)
Definition: debug.h:53
static enum type_type type_get_type(const type_t *type)
Definition: typetree.h:68

Referenced by get_pointer_fc().

◆ type_pointer_get_ref()

static type_t* type_pointer_get_ref ( const type_t type)
inlinestatic

◆ type_struct_get_fields()

◆ type_union_get_cases()

static var_list_t* type_union_get_cases ( const type_t type)
inlinestatic

Definition at line 134 of file typetree.h.

135 {
136  enum type_type type_type;
137 
140 
143  {
144  const var_t *uv = LIST_ENTRY(list_tail(type->details.structure->fields), const var_t, entry);
145  return uv->type->details.structure->fields;
146  }
147  else
148  return type->details.structure->fields;
149 }
static type_t * type_get_real_type(const type_t *type)
Definition: typetree.h:60
struct struct_details * structure
Definition: widltypes.h:424
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define assert(x)
Definition: debug.h:53
__WINE_SERVER_LIST_INLINE struct list * list_tail(const struct list *list)
Definition: list.h:137
type_type
Definition: widltypes.h:399
static enum type_type type_get_type(const type_t *type)
Definition: typetree.h:68
type_t * type
Definition: widltypes.h:452
union _type_t::@4053 details
uint32_t entry
Definition: isohybrid.c:63
#define LIST_ENTRY(type)
Definition: queue.h:175

Referenced by add_union_typeinfo(), check_for_additional_prototype_types(), check_remoting_fields(), find_identifier(), type_buffer_alignment(), type_has_full_pointer(), type_has_pointers(), type_memsize_and_alignment(), write_type_left(), and write_union_tfs().

◆ type_union_get_switch_value()

static var_t* type_union_get_switch_value ( const type_t type)
inlinestatic

Definition at line 120 of file typetree.h.

121 {
124  return LIST_ENTRY(list_head(type->details.structure->fields), var_t, entry);
125 }
static type_t * type_get_real_type(const type_t *type)
Definition: typetree.h:60
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define assert(x)
Definition: debug.h:53
__WINE_SERVER_LIST_INLINE struct list * list_head(const struct list *list)
Definition: list.h:131
static enum type_type type_get_type(const type_t *type)
Definition: typetree.h:68
uint32_t entry
Definition: isohybrid.c:63
#define LIST_ENTRY(type)
Definition: queue.h:175

Referenced by write_union_tfs().