ReactOS 0.4.16-dev-1946-g52006dd
header.h
Go to the documentation of this file.
1/*
2 * IDL Compiler
3 *
4 * Copyright 2002 Ove Kaaven
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#ifndef __WIDL_HEADER_H
22#define __WIDL_HEADER_H
23
24#include "typetree.h"
25
26extern const char* get_name(const var_t *v);
27extern void write_type_left(FILE *h, const decl_spec_t *ds, enum name_type name_type, bool define, int write_callconv);
28extern void write_type_right(FILE *h, type_t *t, int is_field);
29extern void write_type_decl(FILE *f, const decl_spec_t *t, const char *name);
30extern void write_type_decl_left(FILE *f, const decl_spec_t *ds);
31extern unsigned int get_context_handle_offset( const type_t *type );
32extern unsigned int get_generic_handle_offset( const type_t *type );
33extern int needs_space_after(type_t *t);
34extern int is_object(const type_t *iface);
35extern int is_local(const attr_list_t *list);
36extern int count_methods(const type_t *iface);
37extern const statement_t * get_callas_source(const type_t *iface, const var_t *def);
38extern int need_stub(const type_t *iface);
39extern int need_proxy(const type_t *iface);
40extern int need_inline_stubs(const type_t *iface);
41extern int need_stub_files(const statement_list_t *stmts);
42extern int need_proxy_file(const statement_list_t *stmts);
43extern int need_proxy_delegation(const statement_list_t *stmts);
44extern int need_inline_stubs_file(const statement_list_t *stmts);
45extern const var_t *is_callas(const attr_list_t *list);
46extern void write_args(FILE *h, const var_list_t *arg, const char *name, int obj, int do_indent, enum name_type name_type);
48extern const var_t *get_func_handle_var( const type_t *iface, const var_t *func,
49 unsigned char *explicit_fc, unsigned char *implicit_fc );
50extern int has_out_arg_or_return(const var_t *func);
51extern int is_const_decl(const var_t *var);
52
53extern void write_serialize_functions(FILE *file, const type_t *type, const type_t *iface);
54
55static inline int is_ptr(const type_t *t)
56{
57 return type_get_type(t) == TYPE_POINTER;
58}
59
60static inline int is_array(const type_t *t)
61{
62 return type_get_type(t) == TYPE_ARRAY;
63}
64
65static inline int is_func(const type_t *t)
66{
67 return type_get_type(t) == TYPE_FUNCTION;
68}
69
70static inline int is_void(const type_t *t)
71{
72 return type_get_type(t) == TYPE_VOID;
73}
74
75static inline int is_declptr(const type_t *t)
76{
78}
79
80static inline int is_conformant_array(const type_t *t)
81{
83}
84
85static inline int last_ptr(const type_t *type)
86{
88}
89
90static inline int last_array(const type_t *type)
91{
93}
94
95static inline int is_string_type(const attr_list_t *attrs, const type_t *type)
96{
98 && (last_ptr(type) || last_array(type)));
99}
100
101static inline int is_context_handle(const type_t *type)
102{
103 const type_t *t;
104 for (t = type;
105 is_ptr(t) || type_is_alias(t);
107 if (is_attr(t->attrs, ATTR_CONTEXTHANDLE))
108 return 1;
109 return 0;
110}
111
112#endif
Definition: list.h:37
const GLdouble * v
Definition: gl.h:2040
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLdouble GLdouble t
Definition: gl.h:2047
GLenum func
Definition: glext.h:6028
GLfloat f
Definition: glext.h:7540
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define ds
Definition: i386-dis.c:443
const char * var
Definition: shader.c:5666
int is_aliaschain_attr(const type_t *type, enum attr_type attr_type)
Definition: attribute.c:67
int is_attr(const attr_list_t *list, enum attr_type attr_type)
Definition: attribute.c:45
void write_type_left(FILE *h, const decl_spec_t *ds, enum name_type name_type, bool define, int write_callconv)
Definition: header.c:282
int need_stub_files(const statement_list_t *stmts)
Definition: proxy.c:845
int has_out_arg_or_return(const var_t *func)
Definition: header.c:952
int is_local(const attr_list_t *list)
Definition: header.c:982
static int last_ptr(const type_t *type)
Definition: header.h:85
static int is_declptr(const type_t *t)
Definition: header.h:75
void write_type_right(FILE *h, type_t *t, int is_field)
Definition: header.c:476
unsigned int get_generic_handle_offset(const type_t *type)
Definition: header.c:645
const var_t * get_func_handle_var(const type_t *iface, const var_t *func, unsigned char *explicit_fc, unsigned char *implicit_fc)
Definition: header.c:911
static int last_array(const type_t *type)
Definition: header.h:90
static int is_func(const type_t *t)
Definition: header.h:65
void write_type_decl_left(FILE *f, const decl_spec_t *ds)
Definition: header.c:593
const statement_t * get_callas_source(const type_t *iface, const var_t *def)
Definition: proxy.c:475
int need_proxy(const type_t *iface)
Definition: proxy.c:791
static int is_context_handle(const type_t *type)
Definition: header.h:101
static int is_void(const type_t *t)
Definition: header.h:70
static int is_conformant_array(const type_t *t)
Definition: header.h:80
unsigned int get_context_handle_offset(const type_t *type)
Definition: header.c:625
int need_inline_stubs(const type_t *iface)
Definition: proxy.c:814
int need_proxy_delegation(const statement_list_t *stmts)
Definition: proxy.c:809
void write_type_decl(FILE *f, const decl_spec_t *t, const char *name)
Definition: header.c:588
int need_inline_stubs_file(const statement_list_t *stmts)
Definition: proxy.c:850
void write_args(FILE *h, const var_list_t *arg, const char *name, int obj, int do_indent, enum name_type name_type)
Definition: header.c:1103
void write_serialize_functions(FILE *file, const type_t *type, const type_t *iface)
Definition: client.c:336
int need_proxy_file(const statement_list_t *stmts)
Definition: proxy.c:804
const char * get_name(const var_t *v)
Definition: header.c:143
int is_const_decl(const var_t *var)
Definition: header.c:845
int count_methods(const type_t *iface)
Definition: proxy.c:460
static int is_string_type(const attr_list_t *attrs, const type_t *type)
Definition: header.h:95
const type_t * get_explicit_generic_handle_type(const var_t *var)
Definition: header.c:899
int is_object(const type_t *iface)
Definition: header.c:972
int needs_space_after(type_t *t)
Definition: header.c:252
static int is_ptr(const type_t *t)
Definition: header.h:55
static int is_array(const type_t *t)
Definition: header.h:60
int need_stub(const type_t *iface)
Definition: proxy.c:799
const var_t * is_callas(const attr_list_t *list)
Definition: header.c:987
Definition: fci.c:127
Definition: name.c:39
static int type_array_is_decl_as_ptr(const type_t *type)
Definition: typetree.h:350
static enum type_type type_get_type(const type_t *type)
Definition: typetree.h:113
static int type_array_has_conformance(const type_t *type)
Definition: typetree.h:289
static type_t * type_array_get_element_type(const type_t *type)
Definition: typetree.h:345
name_type
Definition: typetree.h:30
static type_t * type_alias_get_aliasee_type(const type_t *type)
Definition: typetree.h:373
static type_t * type_pointer_get_ref_type(const type_t *type)
Definition: typetree.h:424
static int type_is_alias(const type_t *type)
Definition: typetree.h:357
@ TYPE_POINTER
Definition: widltypes.h:489
@ TYPE_VOID
Definition: widltypes.h:478
@ TYPE_ARRAY
Definition: widltypes.h:490
@ TYPE_FUNCTION
Definition: widltypes.h:487
@ ATTR_CONTEXTHANDLE
Definition: widltypes.h:89
@ ATTR_STRING
Definition: widltypes.h:174