#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "widl.h"
#include "utils.h"
#include "parser.h"
#include "typetree.h"
#include "header.h"
Go to the source code of this file.
|
type_t * | duptype (type_t *t, int dupname) |
|
type_t * | make_type (enum type_type type) |
|
static const var_t * | find_arg (const var_list_t *args, const char *name) |
|
const char * | type_get_name (const type_t *type, enum name_type name_type) |
|
static char * | append_namespace (char *ptr, struct namespace *namespace, const char *separator) |
|
char * | format_namespace (struct namespace *namespace, const char *prefix, const char *separator, const char *suffix) |
|
type_t * | type_new_function (var_list_t *args) |
|
type_t * | type_new_pointer (unsigned char pointer_default, 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) |
|
type_t * | type_new_coclass (char *name) |
|
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) |
|
type_t * | type_new_basic (enum type_basic_type basic_type) |
|
type_t * | type_new_int (enum type_basic_type basic_type, int sign) |
|
type_t * | type_new_void (void) |
|
type_t * | type_new_enum (const char *name, struct namespace *namespace, int defined, var_list_t *enums) |
|
type_t * | type_new_struct (char *name, struct namespace *namespace, int defined, var_list_t *fields) |
|
type_t * | type_new_nonencapsulated_union (const char *name, int defined, var_list_t *fields) |
|
type_t * | type_new_encapsulated_union (char *name, var_t *switch_field, var_t *union_field, var_list_t *cases) |
|
static int | is_valid_bitfield_type (const type_t *type) |
|
type_t * | type_new_bitfield (type_t *field, const expr_t *bits) |
|
static int | compute_method_indexes (type_t *iface) |
|
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_t * | type_coclass_define (type_t *coclass, ifref_list_t *ifaces) |
|
int | type_is_equal (const type_t *type1, const type_t *type2) |
|
◆ append_namespace()
Definition at line 94 of file typetree.c.
95{
102 }
103
108}
char * strcat(char *DstString, const char *SrcString)
ACPI_SIZE strlen(const char *String)
char * strcpy(char *DstString, const char *SrcString)
static const WCHAR separator[]
struct namespace * parent
static char * append_namespace(char *ptr, struct namespace *namespace, const char *separator)
static int is_global_namespace(const struct namespace *namespace)
Referenced by append_namespace(), and format_namespace().
◆ compute_method_indexes()
static int compute_method_indexes |
( |
type_t * |
iface | ) |
|
|
static |
◆ duptype()
Definition at line 33 of file typetree.c.
34{
36
38 if (dupname &&
t->name)
40
42}
char * xstrdup(const char *s)
type_t * alloc_type(void)
Referenced by type_new_alias().
◆ find_arg()
Definition at line 68 of file typetree.c.
69{
71
73 {
76 }
77
79}
int strcmp(const char *String1, const char *String2)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Referenced by type_new_function().
◆ format_namespace()
◆ is_valid_bitfield_type()
Definition at line 365 of file typetree.c.
366{
368 {
373 {
391 }
393 default:
395 }
396}
GLuint GLuint GLsizei GLenum 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)
@ TYPE_BASIC_ERROR_STATUS_T
Referenced by type_new_bitfield().
◆ make_type()
Definition at line 44 of file typetree.c.
45{
53 memset(&
t->details, 0,
sizeof(
t->details));
54 t->typestring_offset = 0;
59 t->user_types_registered =
FALSE;
66}
void init_loc_info(loc_info_t *)
Referenced by type_new_array(), type_new_basic(), type_new_bitfield(), type_new_enum(), type_new_function(), type_new_nonencapsulated_union(), type_new_pointer(), type_new_struct(), and type_new_void().
◆ type_coclass_define()
Definition at line 488 of file typetree.c.
489{
492 return coclass;
493}
struct coclass_details coclass
◆ type_dispinterface_define()
Definition at line 452 of file typetree.c.
453{
464}
static const WCHAR props[]
type_t * find_type(const char *name, struct namespace *namespace, int t)
◆ type_dispinterface_define_from_iface()
void type_dispinterface_define_from_iface |
( |
type_t * |
dispiface, |
|
|
type_t * |
iface |
|
) |
| |
◆ type_get_name()
◆ type_interface_define()
◆ type_is_equal()
Definition at line 495 of file typetree.c.
496{
499
504
505
506
508}
static enum type_type type_get_type_detect_alias(const type_t *type)
◆ type_module_define()
Definition at line 480 of file typetree.c.
481{
486}
IMAGEHLP_MODULEW64 module
◆ type_new_alias()
Definition at line 190 of file typetree.c.
191{
193
198
199 a->details =
t->details;
201
203}
GLboolean GLboolean GLboolean GLboolean a
type_t * duptype(type_t *t, int dupname)
◆ type_new_array()
Definition at line 226 of file typetree.c.
229{
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;
239 t->details.array.ptr_def_fc = ptr_default_fc;
241}
type_t * make_type(enum type_type type)
◆ type_new_basic()
◆ type_new_bitfield()
Definition at line 398 of file typetree.c.
399{
401
403 error_loc(
"bit-field has invalid type\n");
404
406 error_loc(
"negative width for bit-field\n");
407
408
409
411 t->details.bitfield.field =
field;
412 t->details.bitfield.bits =
bits;
414}
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
static int is_valid_bitfield_type(const type_t *type)
◆ type_new_coclass()
Definition at line 215 of file typetree.c.
216{
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);
223}
struct hlsl_type * get_type(struct hlsl_scope *scope, const char *name, BOOL recursive) DECLSPEC_HIDDEN
◆ type_new_encapsulated_union()
Definition at line 353 of file typetree.c.
354{
358 t->details.structure =
xmalloc(
sizeof(*
t->details.structure));
360 t->details.structure->fields =
append_var(
t->details.structure->fields, union_field );
363}
type_t * type_new_nonencapsulated_union(const char *name, int defined, var_list_t *fields)
var_list_t * append_var(var_list_t *list, var_t *var)
@ TYPE_ENCAPSULATED_UNION
var_t * make_var(char *name)
◆ type_new_enum()
Definition at line 274 of file typetree.c.
275{
279 t->namespace =
namespace;
280
283 else if (defined)
284 {
285 t->details.enumeration =
xmalloc(
sizeof(*
t->details.enumeration));
286 t->details.enumeration->enums =
enums;
288 }
289
291 {
292 if (defined)
294 else
296 }
298}
static const struct encodedInt enums[]
struct enumeration_details * enumeration
type_t * reg_type(type_t *type, const char *name, struct namespace *namespace, int t)
void add_incomplete(type_t *t)
◆ type_new_function()
Definition at line 131 of file typetree.c.
132{
136
138 {
141 {
146 }
147 }
149 {
153 {
155 error_loc(
"too many unnamed arguments\n");
156 else
157 {
159 do
160 {
162 name[0] =
i > 26 ?
'a' +
i / 26 :
'a' +
i;
163 name[1] =
i > 26 ?
'a' +
i % 26 : 0;
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;
179}
static void list_remove(struct list_entry *entry)
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
__WINE_SERVER_LIST_INLINE unsigned int list_count(const struct list *list)
static const var_t * find_arg(const var_list_t *args, const char *name)
◆ type_new_int()
Definition at line 251 of file typetree.c.
252{
254
256
257
258 if (!int_types[basic_type][
sign + 1])
259 {
262 }
263 return int_types[basic_type][
sign + 1];
264}
struct basic_details basic
type_t * type_new_basic(enum type_basic_type basic_type)
#define TYPE_BASIC_INT_MAX
Referenced by resolve_expression().
◆ type_new_module()
Definition at line 205 of file typetree.c.
206{
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);
213}
◆ type_new_nonencapsulated_union()
Definition at line 330 of file typetree.c.
331{
337 else if (defined)
338 {
339 t->details.structure =
xmalloc(
sizeof(*
t->details.structure));
340 t->details.structure->fields =
fields;
342 }
344 {
345 if (defined)
347 else
349 }
351}
struct struct_details * structure
Referenced by type_new_encapsulated_union().
◆ type_new_pointer()
Definition at line 181 of file typetree.c.
182{
185 t->details.pointer.ref =
ref;
188}
coclass PSFactoryBuffer pointer_default(unique)] interface ObjectRpcBaseTypes
Referenced by resolve_expression().
◆ type_new_struct()
Definition at line 300 of file typetree.c.
301{
304
305
307
310 t->namespace =
namespace;
311
314 else if (defined)
315 {
316 t->details.structure =
xmalloc(
sizeof(*
t->details.structure));
317 t->details.structure->fields =
fields;
319 }
321 {
322 if (defined)
324 else
326 }
328}
◆ type_new_void()
Definition at line 266 of file typetree.c.
267{
269 if (!void_type)
271 return void_type;
272}