|
ReactOS 0.4.16-dev-1946-g52006dd
|
#include "config.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include <assert.h>#include <ctype.h>#include <limits.h>#include "widl.h"#include "utils.h"#include "parser.h"#include "header.h"#include "typetree.h"#include "typegen.h"#include "expr.h"
Go to the source code of this file.
Classes | |
| struct | expr_eval_routine |
| struct | visited_struct_array |
Macros | |
| #define | ROUND_SIZE(size, alignment) (((size) + ((alignment) - 1)) & ~((alignment) - 1)) |
| #define | ROUNDING(size, alignment) (((alignment) - 1) - (((size) + ((alignment) - 1)) & ((alignment) - 1))) |
| #define | WRITE_FCTYPE(file, fctype, typestring_offset) |
Enumerations | |
| enum | type_context { TYPE_CONTEXT_TOPLEVELPARAM , TYPE_CONTEXT_PARAM , TYPE_CONTEXT_CONTAINER , TYPE_CONTEXT_CONTAINER_NO_POINTERS , TYPE_CONTEXT_RETVAL } |
Variables | |
| static const type_t * | current_structure |
| static const var_t * | current_func |
| static const var_t * | current_arg |
| static const type_t * | current_iface |
| static struct list | expr_eval_routines = LIST_INIT(expr_eval_routines) |
| static const unsigned short | MustSize = 0x0001 |
| static const unsigned short | MustFree = 0x0002 |
| static const unsigned short | IsPipe = 0x0004 |
| static const unsigned short | IsIn = 0x0008 |
| static const unsigned short | IsOut = 0x0010 |
| static const unsigned short | IsReturn = 0x0020 |
| static const unsigned short | IsBasetype = 0x0040 |
| static const unsigned short | IsByValue = 0x0080 |
| static const unsigned short | IsSimpleRef = 0x0100 |
| static const unsigned short | RobustEarly = 0x0001 |
| static const unsigned short | RobustIsIIdIs = 0x0004 |
|
inlinestatic |
Definition at line 799 of file typegen.c.
Referenced by type_has_full_pointer_recurse().
| void assign_stub_out_args | ( | FILE * | file, |
| int | indent, | ||
| const var_t * | func, | ||
| const char * | local_var_prefix | ||
| ) |
Definition at line 4922 of file typegen.c.
Referenced by gen_stub(), and write_function_stub().
Definition at line 384 of file typegen.c.
Referenced by write_pointer_checks().
Definition at line 242 of file typegen.c.
Referenced by fields_memsize(), get_padding(), and write_struct_members().
Definition at line 1380 of file typegen.c.
Referenced by write_proc_func_header(), and write_proc_func_interp().
Definition at line 1053 of file typegen.c.
Referenced by declare_stub_args(), gen_proxy(), print_phase_function(), write_function_stub(), and write_var_init().
Definition at line 4856 of file typegen.c.
Referenced by gen_stub(), and write_function_stub().
Definition at line 2072 of file typegen.c.
Referenced by write_conf_or_var_desc(), and write_descriptors().
Definition at line 2081 of file typegen.c.
Referenced by get_required_buffer_size_type(), and type_memsize_and_alignment().
|
static |
Definition at line 1399 of file typegen.c.
Referenced by write_proc_func_header(), and write_proc_func_interp().
Definition at line 3332 of file typegen.c.
Referenced by find_array_or_string_in_struct(), write_pointer_description(), and write_struct_tfs().
|
static |
Definition at line 1733 of file typegen.c.
Referenced by get_size_procformatstring(), process_tfs(), and write_procformatstring().
Definition at line 659 of file typegen.c.
Referenced by get_required_buffer_size_type(), write_array_tfs(), and write_remoting_arg().
Definition at line 195 of file typegen.c.
Referenced by get_correlation_type(), get_parameter_fc(), get_required_buffer_size_type(), print_phase_basetype(), type_buffer_alignment(), type_memsize_and_alignment(), write_branch_type(), write_range_tfs(), write_simple_pointer(), write_string_tfs(), write_union_tfs(), and write_user_tfs().
Definition at line 219 of file typegen.c.
Referenced by get_parameter_fc(), write_base_type(), and write_old_procformatstring_type().
Definition at line 955 of file typegen.c.
Referenced by write_remoting_arg().
|
static |
Definition at line 482 of file typegen.c.
Referenced by write_contexthandle_tfs(), and write_proc_func_interp().
Definition at line 1827 of file typegen.c.
Referenced by write_conf_or_var_desc(), and write_descriptors().
Definition at line 291 of file typegen.c.
Referenced by get_array_fc(), get_correlation_type(), get_parameter_fc(), get_required_buffer_size_type(), get_struct_fc(), print_phase_basetype(), type_buffer_alignment(), type_memsize_and_alignment(), write_base_type(), write_branch_type(), write_old_procformatstring_type(), write_range_tfs(), write_simple_pointer(), write_union_tfs(), and write_user_tfs().
Definition at line 1226 of file typegen.c.
Referenced by write_proc_func_interp().
Referenced by write_proc_func_interp(), and write_remoting_arguments().
Definition at line 4161 of file typegen.c.
|
static |
Definition at line 401 of file typegen.c.
Referenced by get_struct_fc().
|
static |
Definition at line 1063 of file typegen.c.
Referenced by get_func_oi2_flags(), and write_new_procformatstring_type().
|
static |
Definition at line 248 of file typegen.c.
Referenced by cant_be_null(), get_array_fc(), get_parameter_fc(), get_pointer_fc_context(), get_required_buffer_size_type(), get_struct_fc(), type_has_full_pointer_recurse(), write_contexthandle_tfs(), write_remoting_arg(), and write_user_tfs().
|
static |
Definition at line 279 of file typegen.c.
Referenced by write_nonsimple_pointer(), write_simple_pointer(), write_string_tfs(), and write_type_tfs().
|
static |
Definition at line 4135 of file typegen.c.
Referenced by get_function_buffer_size(), and write_remoting_arg().
|
static |
Definition at line 4026 of file typegen.c.
Referenced by get_parameter_fc(), get_required_buffer_size(), and get_required_buffer_size_type().
|
static |
Definition at line 4350 of file typegen.c.
Referenced by write_remoting_arg().
| unsigned int get_size_procformatstring | ( | const statement_list_t * | stmts, |
| type_pred_t | pred | ||
| ) |
Definition at line 4843 of file typegen.c.
Referenced by write_formatstringsdecl().
Definition at line 4825 of file typegen.c.
Referenced by get_size_procformatstring_iface(), write_function_stubs(), and write_proxy().
|
static |
Definition at line 4832 of file typegen.c.
Referenced by get_size_procformatstring().
| unsigned int get_size_typeformatstring | ( | const statement_list_t * | stmts, |
| type_pred_t | pred | ||
| ) |
Definition at line 4850 of file typegen.c.
Referenced by write_formatstringsdecl().
|
static |
Definition at line 424 of file typegen.c.
Referenced by fill_params_array(), get_parameter_fc(), write_conf_or_var_desc(), write_old_procformatstring_type(), and write_proc_func_interp().
Definition at line 520 of file typegen.c.
Referenced by get_array_fc(), get_parameter_fc(), get_required_buffer_size_type(), get_struct_fc(), is_non_complex_struct(), user_type_has_variable_size(), write_pointer_description(), write_remoting_arg(), and write_struct_tfs().
Definition at line 300 of file typegen.c.
Referenced by get_required_buffer_size_type(), is_user_type(), and write_user_tfs().
Definition at line 929 of file typegen.c.
Referenced by write_struct_tfs(), write_union_tfs(), and write_user_tfs().
|
inlinestatic |
Definition at line 4345 of file typegen.c.
Referenced by write_parameter_conf_or_var_exprs().
|
static |
Definition at line 940 of file typegen.c.
Referenced by write_array_element_type(), and write_member_type().
Definition at line 2343 of file typegen.c.
Referenced by gen_proxy(), gen_stub(), write_function_stub(), and write_proc_func_interp().
Definition at line 1352 of file typegen.c.
Referenced by gen_proxy(), gen_stub(), need_inline_stubs(), need_proxy_and_inline_stubs(), write_conf_or_var_desc(), write_dispatchtable(), write_function_stub(), write_nonsimple_pointer(), write_procformatstring_func(), write_proxy(), write_proxy_methods(), write_simple_pointer(), write_stub_methods(), and write_thunk_methods().
Definition at line 739 of file typegen.c.
Referenced by write_no_repeat_pointer_descriptions(), and write_pointer_description_offsets().
Definition at line 319 of file typegen.c.
Referenced by decl_indirect(), typegen_detect_type(), and write_nonsimple_pointer().
Definition at line 984 of file typegen.c.
Referenced by print_file().
Definition at line 976 of file typegen.c.
Referenced by assign_stub_out_args(), declare_stub_args(), print_phase_basetype(), print_phase_function(), print_start_tfs_comment(), write_array_tfs(), write_base_type(), write_branch_type(), write_client_call_routine(), write_conf_or_var_desc(), write_conformant_array_pointer_descriptions(), write_contexthandle_tfs(), write_descriptors(), write_end(), write_endpoints(), write_expr_eval_routine_list(), write_expr_eval_routines(), write_fixed_array_pointer_descriptions(), write_formatdesc(), write_formatstringsdecl(), write_full_pointer_free(), write_full_pointer_init(), write_func_param_struct(), write_ip_tfs(), write_member_type(), write_new_procformatstring_type(), write_no_repeat_pointer_descriptions(), write_nonsimple_pointer(), write_old_procformatstring_type(), write_parameter_conf_or_var_exprs(), write_pointer_checks(), write_pointer_description_offsets(), write_proc_func_interp(), write_procformatstring(), write_procformatstring_func(), write_procformatstring_offsets(), write_range_tfs(), write_remoting_arg(), write_remoting_arguments(), write_simple_pointer(), write_string_tfs(), write_struct_members(), write_struct_tfs(), write_type_tfs(), write_typeformatstring(), write_union_tfs(), write_user_quad_list(), write_user_tfs(), write_var_init(), and write_varying_array_pointer_descriptions().
| void print_phase_basetype | ( | FILE * | file, |
| int | indent, | ||
| const char * | local_var_prefix, | ||
| enum remoting_phase | phase, | ||
| enum pass pass pass | , | ||
| const var_t * | var, | ||
| const char * | varname | ||
| ) |
Definition at line 4225 of file typegen.c.
Referenced by write_remoting_arg().
|
static |
Definition at line 4185 of file typegen.c.
Referenced by write_remoting_arg().
Definition at line 2490 of file typegen.c.
Referenced by write_array_tfs(), write_contexthandle_tfs(), write_ip_tfs(), write_pointer_tfs(), write_string_tfs(), write_struct_tfs(), write_union_tfs(), and write_user_tfs().
|
static |
Definition at line 3995 of file typegen.c.
Referenced by get_size_typeformatstring(), and write_typeformatstring().
|
static |
Definition at line 3938 of file typegen.c.
Referenced by process_tfs().
Definition at line 2524 of file typegen.c.
Referenced by asciiToUTF8(), DeviceEvtIoInCallerContext(), IMLangFontLink_Test(), match_break(), match_line(), match_mod(), OutputQueue_Receive(), process_orders(), RequestDispatchProcessDirectly(), RequestDispatchSpecialIoctls(), RequestDispatchSyncWithSequentialQueue(), RequestDispatchToSequentialQueue(), ScrWrite(), UTF16BEToUTF8(), UTF16LEToUTF8(), write_array_element_type(), write_ip_tfs(), write_pointer_description_offsets(), write_string_tfs(), write_struct_tfs(), write_union_tfs(), write_user_tfs(), and xmlSwitchInputEncodingInt().
Definition at line 105 of file typegen.c.
Referenced by print_phase_basetype(), write_array_tfs(), write_base_type(), write_branch_type(), write_conf_or_var_desc(), write_contexthandle_tfs(), write_descriptors(), write_member_type(), write_new_procformatstring_type(), write_nonsimple_pointer(), write_old_procformatstring_type(), write_proc_func_interp(), write_range_tfs(), write_simple_pointer(), write_string_tfs(), write_struct_members(), write_struct_tfs(), write_type_tfs(), write_union_tfs(), and write_user_tfs().
Definition at line 2244 of file typegen.c.
Referenced by type_buffer_alignment(), write_array_tfs(), write_struct_tfs(), and write_user_tfs().
|
static |
Definition at line 900 of file typegen.c.
Referenced by is_full_pointer_function().
|
static |
Definition at line 825 of file typegen.c.
Referenced by type_has_full_pointer(), and type_has_full_pointer_recurse().
|
static |
Definition at line 745 of file typegen.c.
Referenced by assign_stub_out_args(), type_has_pointers(), write_array_tfs(), and write_struct_tfs().
Definition at line 2238 of file typegen.c.
Referenced by assign_stub_out_args(), get_array_fc(), get_parameter_fc(), write_array_tfs(), write_conformant_array_pointer_descriptions(), write_fixed_array_pointer_descriptions(), write_func_param_struct(), write_no_repeat_pointer_descriptions(), write_pointer_description(), write_pointer_description_offsets(), write_proc_func_interp(), write_string_tfs(), write_struct_tfs(), write_user_tfs(), and write_varying_array_pointer_descriptions().
Definition at line 2124 of file typegen.c.
Referenced by add_typedef_typeinfo(), add_var_desc(), field_memsize(), fields_memsize(), get_padding(), get_stack_size(), type_memsize(), type_memsize_and_alignment(), union_memsize(), write_fixed_array_pointer_descriptions(), write_func_param_struct(), write_no_repeat_pointer_descriptions(), write_pointer_description_offsets(), write_struct_members(), write_union_tfs(), and write_varying_array_pointer_descriptions().
| enum typegen_type typegen_detect_type | ( | const type_t * | type, |
| const attr_list_t * | attrs, | ||
| unsigned int | flags | ||
| ) |
Definition at line 324 of file typegen.c.
Referenced by assign_stub_out_args(), cant_be_null(), free_variable(), get_array_fc(), get_parameter_fc(), get_required_buffer_size_type(), get_stack_size(), get_struct_fc(), is_embedded_complex(), type_has_full_pointer_recurse(), type_has_pointers(), write_nonsimple_pointer(), write_parameter_conf_or_var_exprs(), write_pointer_tfs(), write_remoting_arg(), write_struct_tfs(), and write_type_tfs().
Definition at line 2104 of file typegen.c.
Referenced by type_memsize_and_alignment(), and write_union_tfs().
Definition at line 923 of file typegen.c.
Referenced by write_array_tfs(), write_contexthandle_tfs(), write_ip_tfs(), write_pointer_tfs(), write_range_tfs(), write_string_tfs(), write_struct_tfs(), write_type_tfs(), write_union_tfs(), and write_user_tfs().
Definition at line 2529 of file typegen.c.
Referenced by write_user_tfs().
Definition at line 909 of file typegen.c.
Referenced by write_user_tfs().
|
static |
Definition at line 2652 of file typegen.c.
Referenced by write_array_tfs().
|
static |
Definition at line 3231 of file typegen.c.
Referenced by write_string_tfs(), write_struct_tfs(), and write_type_tfs().
|
static |
Definition at line 1811 of file typegen.c.
Referenced by write_member_type().
Definition at line 3532 of file typegen.c.
Referenced by write_union_tfs().
| void write_client_call_routine | ( | FILE * | file, |
| const type_t * | iface, | ||
| const var_t * | func, | ||
| const char * | prefix, | ||
| unsigned int | proc_offset | ||
| ) |
Definition at line 5218 of file typegen.c.
Referenced by gen_proxy(), and write_function_stub().
|
static |
Definition at line 1863 of file typegen.c.
Referenced by write_array_tfs(), write_descriptors(), write_ip_tfs(), write_string_tfs(), and write_union_tfs().
|
static |
Definition at line 2953 of file typegen.c.
Referenced by write_pointer_description().
|
static |
Definition at line 3772 of file typegen.c.
Referenced by write_type_tfs().
Definition at line 2693 of file typegen.c.
Referenced by write_struct_tfs().
Definition at line 2682 of file typegen.c.
Referenced by write_array_tfs(), and write_struct_members().
Definition at line 5184 of file typegen.c.
Referenced by write_clientinterfacedecl(), and write_serverinterfacedecl().
Definition at line 5277 of file typegen.c.
Referenced by write_client_routines(), write_proxy_routines(), and write_server_routines().
Definition at line 5140 of file typegen.c.
Referenced by write_client_routines(), write_proxy_routines(), and write_server_routines().
Definition at line 5100 of file typegen.c.
Referenced by write_client_routines(), write_proxy_routines(), and write_server_routines().
|
static |
Definition at line 2880 of file typegen.c.
Referenced by write_fixed_array_pointer_descriptions(), and write_pointer_description().
| void write_formatstringsdecl | ( | FILE * | f, |
| int | indent, | ||
| const statement_list_t * | stmts, | ||
| type_pred_t | pred | ||
| ) |
Definition at line 1034 of file typegen.c.
Referenced by write_client_routines(), write_proxy_routines(), and write_server_routines().
Definition at line 2363 of file typegen.c.
Referenced by gen_proxy(), gen_stub(), and write_function_stub().
Definition at line 2356 of file typegen.c.
Referenced by gen_proxy(), gen_stub(), and write_function_stub().
| void write_func_param_struct | ( | FILE * | file, |
| const type_t * | iface, | ||
| const type_t * | func, | ||
| const char * | var_decl, | ||
| int | add_retval | ||
| ) |
Definition at line 5035 of file typegen.c.
Referenced by gen_stub_thunk(), write_client_call_routine(), and write_expr_eval_routines().
|
static |
Definition at line 1752 of file typegen.c.
Referenced by write_procformatstring().
|
static |
Definition at line 3729 of file typegen.c.
Referenced by write_type_tfs().
|
static |
Definition at line 2612 of file typegen.c.
Referenced by write_array_element_type(), and write_struct_members().
|
static |
Definition at line 1254 of file typegen.c.
Referenced by write_proc_func_interp().
|
static |
Definition at line 2829 of file typegen.c.
Referenced by write_no_repeat_pointer_descriptions(), and write_pointer_description().
|
static |
Definition at line 2369 of file typegen.c.
Referenced by write_array_element_type(), write_pointer_description_offsets(), write_pointer_tfs(), and write_struct_tfs().
|
static |
Definition at line 1290 of file typegen.c.
Referenced by write_procformatstring_func().
| void write_parameter_conf_or_var_exprs | ( | FILE * | file, |
| int | indent, | ||
| const char * | local_var_prefix, | ||
| enum remoting_phase | phase, | ||
| const var_t * | var, | ||
| int | valid_variance | ||
| ) |
Definition at line 4369 of file typegen.c.
Referenced by free_variable(), and write_remoting_arg().
| void write_parameters_init | ( | FILE * | file, |
| int | indent, | ||
| const var_t * | func, | ||
| const char * | local_var_prefix | ||
| ) |
Definition at line 1008 of file typegen.c.
Referenced by gen_stub(), and write_function_stub().
Definition at line 5088 of file typegen.c.
Referenced by gen_proxy(), and write_function_stub().
|
static |
Definition at line 3072 of file typegen.c.
Referenced by write_array_tfs(), and write_struct_tfs().
|
static |
Definition at line 2730 of file typegen.c.
Referenced by write_conformant_array_pointer_descriptions(), write_fixed_array_pointer_descriptions(), write_no_repeat_pointer_descriptions(), write_pointer_description_offsets(), and write_varying_array_pointer_descriptions().
|
static |
Definition at line 2498 of file typegen.c.
Referenced by write_struct_tfs(), and write_type_tfs().
|
static |
Definition at line 1502 of file typegen.c.
Referenced by write_procformatstring_func().
| void write_procformatstring | ( | FILE * | file, |
| const statement_list_t * | stmts, | ||
| type_pred_t | pred | ||
| ) |
Definition at line 1770 of file typegen.c.
Referenced by write_client_routines(), write_proxy_routines(), and write_server_routines().
|
static |
Definition at line 1694 of file typegen.c.
Referenced by get_size_procformatstring_func(), and write_iface_procformatstring().
|
static |
Definition at line 3820 of file typegen.c.
Referenced by write_type_tfs().
|
static |
Definition at line 4441 of file typegen.c.
Referenced by write_remoting_arguments().
| void write_remoting_arguments | ( | FILE * | file, |
| int | indent, | ||
| const var_t * | func, | ||
| const char * | local_var_prefix, | ||
| enum pass pass pass | , | ||
| enum remoting_phase | phase | ||
| ) |
Definition at line 4800 of file typegen.c.
Referenced by gen_proxy(), gen_stub(), and write_function_stub().
|
static |
Definition at line 2448 of file typegen.c.
Referenced by write_array_element_type(), write_pointer_description_offsets(), and write_pointer_tfs().
|
static |
Definition at line 3118 of file typegen.c.
Referenced by write_array_element_type(), write_pointer_description_offsets(), write_struct_tfs(), and write_type_tfs().
|
static |
Definition at line 3353 of file typegen.c.
Referenced by write_struct_tfs().
|
static |
Definition at line 3399 of file typegen.c.
Referenced by write_type_tfs().
|
static |
Definition at line 3848 of file typegen.c.
Referenced by process_tfs_iface(), write_array_tfs(), write_struct_tfs(), write_type_tfs(), write_union_tfs(), and write_user_tfs().
| void write_typeformatstring | ( | FILE * | file, |
| const statement_list_t * | stmts, | ||
| type_pred_t | pred | ||
| ) |
Definition at line 4003 of file typegen.c.
Referenced by write_client_routines(), write_proxy_routines(), and write_server_routines().
|
static |
Definition at line 3563 of file typegen.c.
Referenced by write_type_tfs().
Definition at line 5162 of file typegen.c.
Referenced by write_client_routines(), write_proxy_routines(), and write_server_routines().
Definition at line 2549 of file typegen.c.
Referenced by write_type_tfs().
|
static |
Definition at line 996 of file typegen.c.
Referenced by write_parameters_init().
|
static |
Definition at line 2996 of file typegen.c.
Referenced by write_pointer_description(), and write_varying_array_pointer_descriptions().
Definition at line 47 of file typegen.c.
Referenced by get_utf8_args(), process_tfs_iface(), and write_conf_or_var_desc().
Definition at line 46 of file typegen.c.
Referenced by process_tfs_iface(), write_conf_or_var_desc(), write_nonsimple_pointer(), and write_simple_pointer().
Definition at line 48 of file typegen.c.
Referenced by get_pointer_fc(), get_pointer_fc_context(), process_tfs_iface(), write_conf_or_var_desc(), write_contexthandle_tfs(), write_nonsimple_pointer(), and write_simple_pointer().
Definition at line 45 of file typegen.c.
Referenced by write_array_tfs(), write_descriptors(), write_ip_tfs(), write_pointer_description(), write_string_tfs(), write_struct_tfs(), and write_union_tfs().
Definition at line 50 of file typegen.c.
Referenced by write_client_ifaces(), write_client_routines(), write_conf_or_var_desc(), write_expr_eval_routine_list(), write_expr_eval_routines(), write_proxy_routines(), write_server_routines(), write_server_stmts(), write_stubdesc(), and write_stubdescriptor().
Definition at line 77 of file typegen.c.
Referenced by get_parameter_fc(), and write_new_procformatstring_type().
Definition at line 78 of file typegen.c.
Referenced by get_parameter_fc(), and write_new_procformatstring_type().
Definition at line 74 of file typegen.c.
Referenced by get_func_oi2_flags(), get_parameter_fc(), and write_new_procformatstring_type().
Definition at line 75 of file typegen.c.
Referenced by get_func_oi2_flags(), get_parameter_fc(), and write_new_procformatstring_type().
Definition at line 73 of file typegen.c.
Referenced by RxCommonRead(), RxCommonWrite(), RxLowIoReadShellCompletion(), and write_new_procformatstring_type().
Definition at line 76 of file typegen.c.
Referenced by get_parameter_fc(), and write_new_procformatstring_type().
Definition at line 79 of file typegen.c.
Referenced by get_parameter_fc(), and write_new_procformatstring_type().
Definition at line 72 of file typegen.c.
Referenced by get_parameter_fc(), and write_new_procformatstring_type().
Definition at line 71 of file typegen.c.
Referenced by get_func_oi2_flags(), get_parameter_fc(), and write_new_procformatstring_type().
Definition at line 84 of file typegen.c.
Referenced by write_conf_or_var_desc().