41#define ROUND_SIZE(size, alignment) (((size) + ((alignment) - 1)) & ~((alignment) - 1))
43#define ROUNDING(size, alignment) (((alignment) - 1) - (((size) + ((alignment) - 1)) & ((alignment) - 1)))
73static const unsigned short IsPipe = 0x0004;
74static const unsigned short IsIn = 0x0008;
75static const unsigned short IsOut = 0x0010;
92 const char *
name,
unsigned int *typestring_offset);
96 const char *
name,
unsigned int *typestring_offset);
100 unsigned int *typeformat_offset);
109 case FC_BYTE:
return "FC_BYTE";
110 case FC_CHAR:
return "FC_CHAR";
116 case FC_LONG:
return "FC_LONG";
125 case FC_RP:
return "FC_RP";
126 case FC_UP:
return "FC_UP";
127 case FC_OP:
return "FC_OP";
128 case FC_FP:
return "FC_FP";
155 case FC_IP:
return "FC_IP";
174 case FC_PP:
return "FC_PP";
183 case FC_END:
return "FC_END";
184 case FC_PAD:
return "FC_PAD";
190 error(
"string_of_type: unknown type 0x%02x\n",
type);
249 int toplevel_attrs,
int toplevel_param)
403 unsigned short offset = 0;
404 unsigned int salign = 1;
413 unsigned int align = 0;
426 unsigned int stack_size,
align = 0;
457 by_val = (stack_size == 1 || stack_size == 2 || stack_size == 4 || stack_size == 8);
477 if (by_value) *by_value = by_val;
478 if (stack_align) *stack_align =
align;
485 unsigned char flags = 0;
510 unsigned int flags = 0;
523 int has_conformance = 0;
524 int has_variance = 0;
557 error_loc(
"field '%s' deriving from a conformant array must be the last field in the structure\n",
604 error_loc(
"field '%s' deriving from a conformant array must be the last field in the structure\n",
612 error_loc(
"field '%s' deriving from a conformant array must be the last field in the structure\n",
621 error_loc(
"Unknown struct member %s with type (0x%02x)\n",
field->name,
fc);
645 if ( has_conformance )
650 if( has_conformance && has_pointer )
652 if( has_conformance )
801 size_t new_capacity, max_capacity;
804 if (
count <= *capacity)
808 if (
count > max_capacity)
811 new_capacity =
max(4, *capacity);
812 while (new_capacity <
count && new_capacity <= max_capacity / 2)
814 if (new_capacity <
count)
815 new_capacity = max_capacity;
817 if (!(new_elements =
realloc(*elements, new_capacity *
size)))
820 *elements = new_elements;
821 *capacity = new_capacity;
849 for (
i = 0;
i < visited_structs->
count;
i++)
862 visited_structs->
count++;
871 visited_structs->
count--;
912 unsigned short off = 0;
919 error(
"user_type_offset: couldn't find type (%s)\n",
name);
934 if (
type->typestring_offset)
937 type->typestring_offset = 1;
967#define WRITE_FCTYPE(file, fctype, typestring_offset) \
970 fprintf(file, "/* %2u */\n", typestring_offset); \
971 print_file((file), 2, "0x%02x,\t/* " #fctype " */\n", fctype); \
1001 local_var_prefix,
n, local_var_prefix,
n);
1048 print_file(
f,
indent,
"static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString;\n");
1049 print_file(
f,
indent,
"static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString;\n");
1064 unsigned int *stack_size,
unsigned int *stack_align,
1065 unsigned int *typestring_offset )
1068 unsigned char fc = 0;
1073 if (is_return) is_out =
TRUE;
1074 else if (!is_in && !is_out) is_in =
TRUE;
1078 *typestring_offset =
var->typestring_offset;
1115 *typestring_offset =
var->declspec.type->typestring_offset;
1125 else *typestring_offset += 2;
1131 *typestring_offset += 4;
1166 *typestring_offset =
ref->typestring_offset;
1174 *typestring_offset =
ref->typestring_offset;
1191 *typestring_offset =
ref->typestring_offset;
1220 server_size = (server_size + 7) / 8;
1221 if (server_size < 8) *
flags |= server_size << 13;
1231 unsigned char oi2_flags = 0x40;
1232 unsigned short flags;
1233 unsigned int stack_size, stack_align, typestring_offset;
1258 unsigned int stack_size, stack_align, typestring_offset;
1259 unsigned short flags;
1285 typestring_offset, typestring_offset );
1298 if (!is_in && !is_out) is_in =
TRUE;
1328 unsigned short offset =
var->typestring_offset;
1333 offset =
var->declspec.type->typestring_offset;
1337 else if (is_in && is_out)
1387 if (
j < 4)
continue;
1402 unsigned int reg_count = 0,
float_count = 0, double_count = 0, stack_pos = 0,
offset = 0;
1412 params[0] = 0x80 + reg_count++;
1432 if (double_count >= 8)
break;
1470 if (double_count >= 8)
break;
1472 params[
pos + 1] = 0x84 + 2 * double_count + 1;
1481 while (
size && reg_count < 4)
1504 unsigned short num_proc )
1508 unsigned char explicit_fc, implicit_fc;
1509 unsigned char handle_flags;
1514 unsigned char ext_flags = 0x01;
1516 unsigned int nb_args = 0;
1517 unsigned int stack_size = 0;
1519 unsigned int stack_align;
1520 unsigned int extra_size = 0;
1521 unsigned short param_num = 0;
1522 unsigned short handle_stack_offset = 0;
1523 unsigned short handle_param_num = 0;
1536 if (
var == handle_var)
1538 handle_stack_offset = stack_size;
1539 handle_param_num = param_num;
1542 stack_size =
ROUND_SIZE( stack_size, stack_align );
1559 print_file(
file,
indent,
"NdrFcShort(0x%x),\t/* stack size = %u */\n", stack_size, stack_size );
1564 switch (explicit_fc)
1571 handle_stack_offset, handle_stack_offset );
1580 handle_stack_offset, handle_stack_offset );
1590 handle_stack_offset, handle_stack_offset );
1616 unsigned short pos = 0, fpu_mask = 0;
1637 if (
pos >= 16)
break;
1651 extra_size += 3 +
len + !(
len % 2);
1696 unsigned short num_proc )
1744 iface = stmt->
u.
type;
1745 if (!pred(iface))
continue;
1823 *typestring_offset += 1;
1865 const expr_t *
expr,
unsigned short robust_flags)
1867 unsigned char operator_type = 0;
1869 const char *conftype_string =
"field";
1885 error(
"write_conf_or_var_desc: constant value %d is greater than "
1886 "the maximum constant size of %d\n",
expr->cval,
1889 print_file(
file, 2,
"0x%x, /* Corr desc: constant, val = %d */\n",
1899 conftype_string =
"parameter";
1910 conftype_string =
"field pointer";
1915 switch (subexpr->
type)
1918 subexpr = subexpr->
ref;
1924 subexpr = subexpr->
ref;
1931 subexpr = subexpr->
ref;
1938 subexpr = subexpr->
ref;
1945 subexpr = subexpr->
ref;
1956 unsigned char param_type;
1973 correlation_variable =
var->declspec.type;
1990 correlation_variable =
var->declspec.type;
1994 if (
offset > baseoff) robust_flags &= ~RobustEarly;
1998 if (!correlation_variable)
1999 error(
"write_conf_or_var_desc: couldn't find variable %s in %s\n", subexpr->
u.
sval,
name);
2008 error(
"write_conf_or_var_desc: non-arithmetic type used as correlation variable %s\n",
2022 unsigned int callback_offset = 0;
2042 eval =
xmalloc (
sizeof(*eval));
2050 robust_flags &= ~RobustEarly;
2053 error(
"Maximum number of callback routines reached\n");
2055 print_file(
file, 2,
"0x%x,\t/* Corr desc: %s in %s */\n", conftype, conftype_string,
name);
2057 print_file(
file, 2,
"NdrFcShort(0x%hx),\t/* %u */\n", (
unsigned short)callback_offset, callback_offset);
2074 unsigned int align = 0;
2083 unsigned int size = 0;
2084 unsigned int max_align;
2090 unsigned int falign = 0;
2106 unsigned int size, maxs = 0;
2107 unsigned int align = *pmaxa;
2113 if (
v->declspec.type)
2126 unsigned int size = 0;
2179 error(
"type_memsize: Unknown enum type\n");
2240 unsigned int align = 0;
2286 error(
"type_buffer_alignment: Unknown enum type\n");
2293 if (!
var->declspec.type)
continue;
2302 if (!
var->declspec.type)
continue;
2311 if (!
var->declspec.type)
continue;
2358 print_file(
file,
indent,
"__frame->_StubMsg.FullPtrXlatTables = NdrFullPointerXlatInit(0,%s);\n",
2359 is_server ?
"XLAT_SERVER" :
"XLAT_CLIENT");
2373 unsigned int *typeformat_offset)
2375 unsigned int start_offset = *typeformat_offset;
2376 short reloff =
offset - (*typeformat_offset + 2);
2377 int in_attr, out_attr;
2379 unsigned char flags = 0;
2385 if (!in_attr && !out_attr) in_attr = 1;
2406 if (in_attr && out_attr)
2420 if (pointer_type !=
FC_RP) {
2443 *typeformat_offset += 4;
2445 return start_offset;
2452 unsigned char pointer_fc;
2461 error(
"write_simple_pointer: can't handle type %s which is a string type\n",
type->name);
2482 print_file(
file, 2,
"0x%02x, 0x%x,\t/* %s %s[simple_pointer] */\n",
2501 unsigned int *typestring_offset)
2503 unsigned int offset = *typestring_offset;
2526 return type->typestring_offset && !
type->tfswrite;
2602 print_file(
file, 2,
"NdrFcShort(0x%hx),\t/* Function offset= %hu */\n", funoff, funoff);
2604 print_file(
file, 2,
"NdrFcShort(0x%hx),\t/* %u */\n", (
unsigned short)usize, usize);
2606 reloff = absoff - *tfsoff;
2607 print_file(
file, 2,
"NdrFcShort(0x%hx),\t/* Offset= %hd (%u) */\n", reloff, reloff, absoff);
2615 unsigned int *tfsoff)
2619 unsigned int absoff;
2629 absoff =
type->typestring_offset;
2631 reloff = absoff - (*tfsoff + 2);
2638 print_file(
file, 2,
"NdrFcShort(0x%hx),\t/* Offset= %hd (%u) */\n",
2639 reloff, reloff, absoff);
2653 int cont_is_complex,
unsigned int *tfsoff)
2664 ref->typestring_offset, tfsoff);
2684 if (*tfsoff % 2 == 0)
2701 type_t *ft =
f->declspec.type;
2721 reloff = absoff - *tfsoff;
2722 print_file(
file, 2,
"NdrFcShort(0x%hx),\t/* Offset= %hd (%u) */\n",
2723 (
unsigned short)reloff, reloff, absoff);
2732 unsigned int *offset_in_memory,
unsigned int *offset_in_buffer,
2733 unsigned int *typestring_offset)
2740 if (offset_in_memory && offset_in_buffer)
2742 unsigned int memsize;
2749 print_file(
file, 2,
"NdrFcShort(0x%hx),\t/* Memory offset = %d */\n", (
unsigned short)*offset_in_memory, *offset_in_memory);
2750 print_file(
file, 2,
"NdrFcShort(0x%hx),\t/* Buffer offset = %d */\n", (
unsigned short)*offset_in_buffer, *offset_in_buffer);
2753 *offset_in_memory += memsize;
2756 *offset_in_buffer += memsize;
2758 *typestring_offset += 4;
2768 ref->typestring_offset, typestring_offset);
2772 error(
"write_pointer_description_offsets: type format string unknown\n");
2776 unsigned int offset =
type->typestring_offset;
2792 offset_in_buffer, typestring_offset);
2800 if (offset_in_memory && offset_in_buffer)
2803 unsigned int align = 0;
2810 file,
v->attrs,
TRUE,
v->declspec.type, offset_in_memory, offset_in_buffer,
2816 if (offset_in_memory && offset_in_buffer)
2819 *offset_in_memory += memsize;
2822 *offset_in_buffer += memsize;
2831 unsigned int *offset_in_memory,
unsigned int *offset_in_buffer,
2832 unsigned int *typestring_offset)
2841 *typestring_offset += 2;
2844 offset_in_memory, offset_in_buffer, typestring_offset);
2852 if (offset_in_memory && offset_in_buffer)
2855 unsigned int align = 0;
2863 offset_in_memory, offset_in_buffer, typestring_offset);
2869 *offset_in_memory += memsize;
2872 *offset_in_buffer += memsize;
2882 unsigned int *offset_in_memory,
unsigned int *offset_in_buffer,
2883 unsigned int *typestring_offset)
2885 int pointer_count = 0;
2890 unsigned int temp = 0;
2895 if (pointer_count > 0)
2897 unsigned int increment_size;
2898 unsigned int offset_of_array_pointer_mem = 0;
2899 unsigned int offset_of_array_pointer_buf = 0;
2906 print_file(
file, 2,
"NdrFcShort(0x%hx),\t/* Increment = %d */\n", (
unsigned short)increment_size, increment_size);
2907 print_file(
file, 2,
"NdrFcShort(0x%hx),\t/* Offset to array = %d */\n", (
unsigned short)*offset_in_memory, *offset_in_memory);
2908 print_file(
file, 2,
"NdrFcShort(0x%hx),\t/* Number of pointers = %d */\n", (
unsigned short)pointer_count, pointer_count);
2909 *typestring_offset += 10;
2912 file, attrs, toplevel_attrs,
type, &offset_of_array_pointer_mem,
2913 &offset_of_array_pointer_buf, typestring_offset);
2921 if (offset_in_memory && offset_in_buffer)
2924 unsigned int align = 0;
2931 file,
v->attrs,
TRUE,
v->declspec.type, offset_in_memory, offset_in_buffer,
2937 if (offset_in_memory && offset_in_buffer)
2939 unsigned int memsize;
2941 *offset_in_memory += memsize;
2944 *offset_in_buffer += memsize;
2948 return pointer_count;
2955 unsigned int offset_in_memory,
unsigned int *typestring_offset)
2957 int pointer_count = 0;
2961 unsigned int temp = 0;
2966 if (pointer_count > 0)
2968 unsigned int increment_size;
2969 unsigned int offset_of_array_pointer_mem = offset_in_memory;
2970 unsigned int offset_of_array_pointer_buf = offset_in_memory;
2975 error(
"array size of %u bytes is too large\n", increment_size);
2979 print_file(
file, 2,
"NdrFcShort(0x%hx),\t/* Increment = %d */\n", (
unsigned short)increment_size, increment_size);
2980 print_file(
file, 2,
"NdrFcShort(0x%hx),\t/* Offset to array = %d */\n", (
unsigned short)offset_in_memory, offset_in_memory);
2981 print_file(
file, 2,
"NdrFcShort(0x%hx),\t/* Number of pointers = %d */\n", (
unsigned short)pointer_count, pointer_count);
2982 *typestring_offset += 8;
2986 &offset_of_array_pointer_mem, &offset_of_array_pointer_buf,
2991 return pointer_count;
2998 unsigned int *offset_in_memory,
unsigned int *offset_in_buffer,
2999 unsigned int *typestring_offset)
3001 int pointer_count = 0;
3005 unsigned int temp = 0;
3010 if (pointer_count > 0)
3012 unsigned int increment_size;
3017 error(
"array size of %u bytes is too large\n", increment_size);
3021 print_file(
file, 2,
"NdrFcShort(0x%hx),\t/* Increment = %d */\n", (
unsigned short)increment_size, increment_size);
3022 print_file(
file, 2,
"NdrFcShort(0x%hx),\t/* Offset to array = %d */\n", (
unsigned short)*offset_in_memory, *offset_in_memory);
3023 print_file(
file, 2,
"NdrFcShort(0x%hx),\t/* Number of pointers = %d */\n", (
unsigned short)pointer_count, pointer_count);
3024 *typestring_offset += 8;
3028 offset_in_buffer, typestring_offset);
3036 if (offset_in_memory && offset_in_buffer)
3042 *offset_in_buffer =
ROUND_SIZE(*offset_in_buffer, 4);
3044 *offset_in_buffer += 8;
3053 file,
v->attrs,
v->declspec.type, offset_in_memory, offset_in_buffer,
3059 if (offset_in_memory && offset_in_buffer)
3062 *offset_in_memory += memsize;
3065 *offset_in_buffer += memsize;
3069 return pointer_count;
3073 unsigned int *typestring_offset)
3075 unsigned int offset_in_buffer;
3076 unsigned int offset_in_memory;
3082 offset_in_memory = 0;
3083 offset_in_buffer = 0;
3086 &offset_in_memory, &offset_in_buffer, typestring_offset);
3090 offset_in_memory = 0;
3091 offset_in_buffer = 0;
3094 &offset_in_memory, &offset_in_buffer, typestring_offset);
3101 file, attrs,
type, 0, typestring_offset);
3111 offset_in_memory = 0;
3112 offset_in_buffer = 0;
3115 &offset_in_memory, &offset_in_buffer, typestring_offset);
3120 const char *
name,
unsigned int *typestring_offset)
3122 unsigned int start_offset;
3123 unsigned char rtype;
3127 start_offset = *typestring_offset;
3134 pointer_type =
FC_RP;
3138 flag ?
" [simple_pointer]" :
"");
3139 *typestring_offset += 2;
3143 *typestring_offset += 2;
3145 is_processed =
FALSE;
3156 return start_offset;
3161 error(
"write_string_tfs: Unimplemented for non-basic type %s\n",
name);
3162 return start_offset;
3168 error(
"write_string_tfs: Unimplemented for type 0x%x of name: %s\n", rtype,
name);
3169 return start_offset;
3176 if (is_processed)
return start_offset;
3180 error(
"array size for parameter %s exceeds %u bytes by %u bytes\n",
3181 name, 0xffffu, dim - 0xffffu);
3188 *typestring_offset += 2;
3190 print_file(
file, 2,
"NdrFcShort(0x%hx),\t/* %d */\n", (
unsigned short)dim, dim);
3191 *typestring_offset += 2;
3194 return start_offset;
3203 *typestring_offset += 2;
3213 return start_offset;
3217 if (is_processed)
return start_offset;
3224 *typestring_offset += 2;
3227 return start_offset;
3232 const char *
name,
unsigned int *typestring_offset)
3238 unsigned int start_offset;
3240 unsigned int baseoff
3253 start_offset = *typestring_offset;
3258 *typestring_offset += 2;
3266 *typestring_offset += 4;
3271 *typestring_offset += 2;
3287 *typestring_offset += 4;
3291 print_file(
file, 2,
"NdrFcShort(0x%hx),\t/* %u */\n", (
unsigned short)dim, dim);
3292 *typestring_offset += 2;
3295 print_file(
file, 2,
"NdrFcShort(0x%hx),\t/* %u */\n", (
unsigned short)elsize, elsize);
3296 *typestring_offset += 2;
3308 *typestring_offset += 2;
3311 *typestring_offset += 1;
3320 print_file(
file, 2,
"NdrFcShort(0x%hx),\t/* %u */\n", (
unsigned short)dim, dim);
3321 *typestring_offset += 2;
3329 return start_offset;
3335 const var_t *last_field;
3354 int is_complex,
unsigned int *corroff,
3355 unsigned int *typestring_offset)
3358 unsigned short offset = 0;
3359 unsigned int salign = 1;
3366 unsigned int align = 0;
3379 *typestring_offset += 1;
3393 *typestring_offset += 1;
3400 const char *
name,
unsigned int *tfsoff)
3403 unsigned int total_size;
3405 unsigned int start_offset;
3407 unsigned int corroff;
3420 error(
"structure size for %s exceeds %d bytes by %d bytes\n",
3438 start_offset = *tfsoff;
3443 print_file(
file, 2,
"NdrFcShort(0x%hx),\t/* %d */\n", (
unsigned short)total_size, total_size);
3448 unsigned int absoff =
array->declspec.type->typestring_offset;
3449 short reloff = absoff - *tfsoff;
3450 print_file(
file, 2,
"NdrFcShort(0x%hx),\t/* Offset= %hd (%u) */\n",
3451 reloff, reloff, absoff);
3465 unsigned int absoff =
type->ptrdesc ?
type->ptrdesc : *tfsoff;
3466 int reloff = absoff - *tfsoff;
3468 print_file(
file, 2,
"NdrFcShort(0x%hx),\t/* Offset= %d (%u) */\n",
3469 (
unsigned short)reloff, reloff, absoff);
3491 type->ptrdesc = *tfsoff;
3494 type_t *ft =
f->declspec.type;
3524 if (
type->ptrdesc == *tfsoff)
3529 return start_offset;
3547 print_file(
file, 2,
"NdrFcShort(0x80%02x),\t/* Simple arm type: %s */\n",
3550 else if (
t->typestring_offset)
3552 short reloff =
t->typestring_offset - *tfsoff;
3553 print_file(
file, 2,
"NdrFcShort(0x%hx),\t/* Offset= %d (%d) */\n",
3554 reloff, reloff,
t->typestring_offset);
3566 unsigned int start_offset;
3569 unsigned int nbranch = 0;
3571 short nodeftype = 0xffff;
3577 return type->typestring_offset;
3590 if (
f->declspec.type)
3594 start_offset = *tfsoff;
3601 unsigned int align = 0;
3621 error(
"union switch type must be an integer, char, or enum\n");
3627 error(
"union switch type must be an integer, char, or enum\n");
3632 if (
f->declspec.type)
3664 error(
"union switch type must be an integer, char, or enum\n");
3670 error(
"union switch type must be an integer, char, or enum\n");
3677 print_file(
file, 2,
"NdrFcShort(0x2),\t/* Offset= 2 (%u) */\n", *tfsoff + 2);
3683 print_file(
file, 2,
"NdrFcShort(0x%hx),\t/* %d */\n", (
unsigned short)nbranch, nbranch);
3688 type_t *ft =
f->declspec.type;
3693 if (cases ==
NULL && !deflt)
3694 error(
"union field %s with neither case nor default attribute\n",
f->name);
3726 return start_offset;
3730 unsigned int *typeformat_offset)
3733 unsigned int start_offset = *typeformat_offset;
3761 for (
i = 0;
i < 8; ++
i)
3767 *typeformat_offset += 18;
3769 return start_offset;
3776 unsigned int *typeformat_offset)
3778 unsigned int start_offset = *typeformat_offset;
3786 if (!pointer_type) pointer_type =
FC_RP;
3787 *typeformat_offset += 4;
3789 print_file(
file, 2,
"NdrFcShort(0x2),\t /* Offset= 2 (%u) */\n", *typeformat_offset);
3814 *typeformat_offset += 4;
3817 return start_offset;
3822 unsigned int *typeformat_offset)
3825 unsigned int start_offset = *typeformat_offset;
3843 *typeformat_offset += 10;
3845 return start_offset;
3851 unsigned int *typeformat_offset)
3882 unsigned int absoff =
type->typestring_offset;
3883 short reloff = absoff - (*typeformat_offset + 2);
3884 off = *typeformat_offset;
3888 print_file(
file, 2,
"NdrFcShort(0x%hx),\t/* Offset= %hd (%u) */\n",
3889 reloff, reloff, absoff);
3891 *typeformat_offset += 4;
3997 unsigned int typeformat_offset = 2;
3999 return typeformat_offset + 1;
4034 const char *uname =
NULL;
4077 error(
"get_required_buffer_size: unknown basic type 0x%02x\n",
4140 if (!in_attr && !out_attr)
4187 const var_t *
var,
unsigned int type_offset)
4189 const char *function;
4193 function =
"BufferSize";
4196 function =
"Marshall";
4199 function =
"Unmarshall";
4213 (phase ==
PHASE_UNMARSHAL) ?
"(unsigned char **)" :
"(unsigned char *)",
4227 const char *varname)
4298 error(
"print_phase_basetype: Unsupported type: %s (0x%02x, ptr_level: 0)\n",
4304 print_file(
file,
indent,
"__frame->_StubMsg.Buffer = (unsigned char *)(((ULONG_PTR)__frame->_StubMsg.Buffer + %u) & ~0x%x);\n",
4322 fprintf(
file,
") > __frame->_StubMsg.BufferEnd)\n");
4328 local_var_prefix, varname);
4361 error(
"%s: multidimensional conformant"
4362 " arrays not supported at the top level\n",
4444 int in_attr, out_attr, pointer_type;
4445 const char *type_str =
NULL;
4447 unsigned int alignment, start_offset =
type->typestring_offset;
4456 if (!in_attr && !out_attr)
4463 if (!in_attr)
return;
4466 if (!out_attr)
return;
4500 print_file(
file,
indent + 1,
"(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%d]);\n", start_offset);
4519 print_file(
file,
indent + 1,
"(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%d]);\n", start_offset);
4528 pointer_type !=
FC_RP)
4534 phase,
var, start_offset);
4545 unsigned int real_start_offset = start_offset;
4550 real_start_offset += 4;
4552 real_start_offset += 2;
4556 local_var_prefix, phase,
var,
4560 phase,
var, real_start_offset);
4566 const char *array_type =
NULL;
4579 array_type =
"FixedArray";
4583 array_type =
"VaryingArray";
4586 array_type =
"ConformantArray";
4589 array_type =
"ConformantVaryingArray";
4592 array_type =
"ComplexArray";
4596 if (pointer_type !=
FC_RP) array_type =
"Pointer";
4678 const char *union_type =
NULL;
4681 union_type =
"NonEncapsulatedUnion";
4683 union_type =
"EncapsulatedUnion";
4686 phase,
var, start_offset);
4712 type_str =
"SimpleStruct";
4722 type_str =
"SimpleStruct";
4726 type_str =
"ConformantStruct";
4729 type_str =
"ConformantVaryingStruct";
4732 type_str =
"ComplexStruct";
4741 type_str =
"Pointer";
4743 start_offset =
ref->typestring_offset;
4749 type_str =
"Pointer";
4753 type_str =
"NonEncapsulatedUnion";
4755 type_str =
"EncapsulatedUnion";
4757 start_offset =
ref->typestring_offset;
4761 phase,
var, start_offset);
4766 type_str =
"UserMarshal";
4767 start_offset =
ref->typestring_offset;
4769 else type_str =
"Pointer";
4845 unsigned int size = 1;
4858 int in_attr, out_attr;
4882 if (!out_attr && !in_attr)
4896 type_to_print = &
var->declspec;
4924 int in_attr, out_attr;
4936 if (!out_attr && !in_attr)
4946 fprintf(
file,
" = NdrContextHandleInitialize(\n");
4949 var->typestring_offset);
4957 fprintf(
file,
" = NdrAllocate(&__frame->_StubMsg, ");
4958 for (
type =
var->declspec.type;
4970 for (
type =
var->declspec.type;
4998 local_var_prefix,
i, local_var_prefix,
i);
5012 local_var_prefix,
i, local_var_prefix,
i);
5036 const char *var_decl,
int add_retval )
5042 unsigned int align = 0;
5084 if (needs_packing)
print_file(
file, 0,
"#include <poppack.h>\n" );
5102 static const char *var_name =
"pS";
5103 static const char *var_name_expr =
"pS->";
5106 unsigned short callback_offset = 0;
5113 print_file(
file, 0,
"static void __RPC_USER %s_%sExprEval_%04u(PMIDL_STUB_MESSAGE pStubMsg)\n",
5119 "*pS = (struct _PARAM_STRUCT *)pStubMsg->StackTop",
FALSE );
5144 unsigned short callback_offset = 0;
5146 fprintf(
file,
"static const EXPR_EVAL ExprEvalRoutines[] =\n");
5169 fprintf(
file,
"static const USER_MARSHAL_ROUTINE_QUADRUPLE UserMarshalRoutines[] =\n");
5176 print_file(
file, 2,
"(USER_MARSHAL_MARSHALLING_ROUTINE)%s_UserMarshal,\n", ut->
name);
5177 print_file(
file, 2,
"(USER_MARSHAL_UNMARSHALLING_ROUTINE)%s_UserUnmarshal,\n", ut->
name);
5190 print_file(
f, 0,
"static const unsigned char * const %s__RpcProtseqEndpoint[][2] =\n{\n",
prefix );
5193 print_file(
f, 1,
"{ (const unsigned char *)\"" );
5196 if (*
p ==
'"' || *
p ==
'\\')
fputc(
'\\',
f );
5200 if (
p[1] !=
'[')
goto error;
5202 fprintf(
f,
"\", (const unsigned char *)\"" );
5203 for (
p += 2; *
p && *
p !=
']';
p++)
5205 if (*
p ==
'"' || *
p ==
'\\')
fputc(
'\\',
f );
5208 if (*
p !=
']')
goto error;
5219 const char *
prefix,
unsigned int proc_offset )
5225 int len, needs_params = 0;
5233 if (has_ret)
print_file(
file, 1,
"%s",
"CLIENT_CALL_RETURN _RetVal;\n" );
5240 else if (has_ret)
print_file(
file, 1,
"%s",
"CLIENT_CALL_RETURN _RetVal;\n\n" );
5243 has_ret ?
"_RetVal = " :
"",
5246 fprintf(
file,
"\n%*s&__MIDL_ProcFormatString.Format[%u]",
len,
"", proc_offset );
5272 fprintf(
file,
")%s;\n",
target.
cpu != CPU_i386 ?
"_RetVal.Simple" :
"*(LONG_PTR *)&_RetVal" );
5279 fprintf(
file,
"#ifndef USE_COMPILER_EXCEPTIONS\n");
5281 fprintf(
file,
"#include \"wine/exception.h\"\n");
5289 fprintf(
file,
"#undef RpcAbnormalTermination\n");
5292 fprintf(
file,
"typedef int (*__filter_func)(struct __exception_frame *);\n");
5293 fprintf(
file,
"typedef void (*__finally_func)(struct __exception_frame *);\n");
5295 fprintf(
file,
"#define __DECL_EXCEPTION_FRAME \\\n");
5296 fprintf(
file,
" EXCEPTION_REGISTRATION_RECORD frame; \\\n");
5301 fprintf(
file,
" unsigned char abnormal_termination; \\\n");
5302 fprintf(
file,
" unsigned char filter_level; \\\n");
5303 fprintf(
file,
" unsigned char finally_level;\n");
5309 fprintf(
file,
"static inline void __widl_unwind_target(void)\n" );
5311 fprintf(
file,
" struct __exception_frame *exc_frame = (struct __exception_frame *)__wine_get_frame();\n" );
5312 fprintf(
file,
" if (exc_frame->finally_level > exc_frame->filter_level)\n" );
5314 fprintf(
file,
" exc_frame->abnormal_termination = 1;\n");
5315 fprintf(
file,
" exc_frame->finally( exc_frame );\n");
5316 fprintf(
file,
" __wine_pop_frame( &exc_frame->frame );\n");
5318 fprintf(
file,
" exc_frame->filter_level = 0;\n");
5319 fprintf(
file,
" __wine_longjmp( &exc_frame->jmp, 1 );\n");
5322 fprintf(
file,
"static DWORD __cdecl __widl_exception_handler( EXCEPTION_RECORD *record,\n");
5323 fprintf(
file,
" EXCEPTION_REGISTRATION_RECORD *frame,\n");
5325 fprintf(
file,
" EXCEPTION_REGISTRATION_RECORD **pdispatcher )\n");
5327 fprintf(
file,
" struct __exception_frame *exc_frame = (struct __exception_frame *)frame;\n");
5329 fprintf(
file,
" if (record->ExceptionFlags & (EXCEPTION_UNWINDING | EXCEPTION_EXIT_UNWIND | EXCEPTION_NESTED_CALL))\n");
5331 fprintf(
file,
" if (exc_frame->finally_level && (record->ExceptionFlags & (EXCEPTION_UNWINDING | EXCEPTION_EXIT_UNWIND)))\n");
5333 fprintf(
file,
" exc_frame->abnormal_termination = 1;\n");
5334 fprintf(
file,
" exc_frame->finally( exc_frame );\n");
5336 fprintf(
file,
" return ExceptionContinueSearch;\n");
5338 fprintf(
file,
" exc_frame->code = record->ExceptionCode;\n");
5339 fprintf(
file,
" if (exc_frame->filter_level && exc_frame->filter( exc_frame ) == EXCEPTION_EXECUTE_HANDLER)\n" );
5340 fprintf(
file,
" __wine_rtl_unwind( frame, record, __widl_unwind_target );\n");
5341 fprintf(
file,
" return ExceptionContinueSearch;\n");
5345 fprintf(
file,
" if (!__wine_setjmpex( &__frame->jmp, &__frame->frame )) \\\n");
5347 fprintf(
file,
" if (!__frame->finally_level) \\\n" );
5348 fprintf(
file,
" __wine_push_frame( &__frame->frame ); \\\n");
5349 fprintf(
file,
" __frame->filter_level = __frame->finally_level + 1;\n" );
5352 fprintf(
file,
" if (!__frame->finally_level) \\\n" );
5353 fprintf(
file,
" __wine_pop_frame( &__frame->frame ); \\\n");
5354 fprintf(
file,
" __frame->filter_level = 0; \\\n" );
5360 fprintf(
file,
"#define RpcExceptionCode() (__frame->code)\n");
5363 fprintf(
file,
" if (!__frame->filter_level) \\\n");
5364 fprintf(
file,
" __wine_push_frame( &__frame->frame ); \\\n");
5365 fprintf(
file,
" __frame->finally_level = __frame->filter_level + 1;\n");
5368 fprintf(
file,
" if (!__frame->filter_level) \\\n");
5369 fprintf(
file,
" __wine_pop_frame( &__frame->frame ); \\\n");
5374 fprintf(
file,
"#define RpcAbnormalTermination() (__frame->abnormal_termination)\n");
5376 fprintf(
file,
"#define RpcExceptionInit(filter_func,finally_func) \\\n");
5378 fprintf(
file,
" __frame->frame.Handler = __widl_exception_handler; \\\n");
5379 fprintf(
file,
" __frame->filter = (__filter_func)(filter_func); \\\n" );
5380 fprintf(
file,
" __frame->finally = (__finally_func)(finally_func); \\\n");
5381 fprintf(
file,
" __frame->abnormal_termination = 0; \\\n");
5382 fprintf(
file,
" __frame->filter_level = 0; \\\n");
5383 fprintf(
file,
" __frame->finally_level = 0; \\\n");
5386 fprintf(
file,
"#else /* USE_COMPILER_EXCEPTIONS */\n");
5388 fprintf(
file,
"#define RpcExceptionInit(filter_func,finally_func) \\\n");
5389 fprintf(
file,
" do { (void)(filter_func); } while(0)\n");
5391 fprintf(
file,
"#define __DECL_EXCEPTION_FRAME \\\n");
5394 fprintf(
file,
"#endif /* USE_COMPILER_EXCEPTIONS */\n");
int strcmp(const char *String1, const char *String2)
ACPI_SIZE strlen(const char *String)
_Check_return_ _Ret_maybenull_ _In_ size_t alignment
char * xstrdup(const char *s)
static void list_remove(struct list_entry *entry)
static int list_empty(struct list_entry *head)
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
static const int carray[3]
static const WCHAR indent[]
int align(int length, int align)
int compare_expr(const expr_t *a, const expr_t *b)
const type_t * expr_resolve_type(const struct expr_loc *expr_loc, const type_t *cont_type, const expr_t *expr)
void write_expr(FILE *h, const expr_t *e, int brackets, int toplevel, const char *toplevel_prefix, const type_t *cont_type, const char *local_var_prefix)
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei count
GLuint GLuint GLsizei GLenum type
GLenum const GLfloat * params
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 flag
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
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 GLint GLint j
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
_Check_return_opt_ _CRTIMP int __cdecl vfprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format, va_list _ArgList)
_Check_return_opt_ _CRTIMP int __cdecl fputc(_In_ int _Ch, _Inout_ FILE *_File)
#define memmove(s1, s2, n)
static const DWORD padding[]
static uint64_t range_max(IN const pnfs_layout *layout)
#define HANDLE_PARAM_IS_RETURN
#define FC_TOP_LEVEL_CONFORMANCE
#define FC_POINTER_CONFORMANCE
#define HANDLE_PARAM_IS_OUT
#define NDR_CONTEXT_HANDLE_CANNOT_BE_NULL
#define FC_ALLOCATE_ALL_NODES
#define NDR_CONTEXT_HANDLE_SERIALIZE
@ FC_NON_ENCAPSULATED_UNION
#define FC_NORMAL_CONFORMANCE
#define Oi_USE_NEW_INIT_ROUTINES
#define HANDLE_PARAM_IS_IN
#define FC_SIMPLE_POINTER
#define NDR_CONTEXT_HANDLE_NOSERIALIZE
#define Oi_OBJ_USE_V2_INTERPRETER
#define FC_CONSTANT_CONFORMANCE
#define FC_ALLOCED_ON_STACK
#define NDR_STRICT_CONTEXT_HANDLE
#define HANDLE_PARAM_IS_VIA_PTR
__WINE_SERVER_LIST_INLINE unsigned int list_count(const struct list *list)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
__WINE_SERVER_LIST_INLINE struct list * list_next(const struct list *list, const struct list *elem)
__WINE_SERVER_LIST_INLINE struct list * list_tail(const struct list *list)
wchar_t const *const size_t const buffer_size
enum storage_class stgclass
typeref_list_t * type_list
union _statement_t::@5358 u
unsigned int typestring_offset
Character const *const prefix
static int cant_be_null(const var_t *v)
static const unsigned short IsReturn
static unsigned int field_memsize(const type_t *type, unsigned int *offset)
static unsigned int write_range_tfs(FILE *file, const attr_list_t *attrs, type_t *type, expr_list_t *range_list, unsigned int *typeformat_offset)
@ TYPE_CONTEXT_CONTAINER_NO_POINTERS
@ TYPE_CONTEXT_TOPLEVELPARAM
static int is_conformance_needed_for_phase(enum remoting_phase phase)
static const unsigned short IsBasetype
static type_t * get_user_type(const type_t *t, const char **pname)
static const unsigned short IsSimpleRef
static unsigned int get_required_buffer_size(const var_t *var, unsigned int *alignment, enum pass pass)
static int array_reserve(void **elements, size_t *capacity, size_t count, size_t size)
static unsigned char get_contexthandle_flags(const type_t *iface, const attr_list_t *attrs, const type_t *type, int is_return)
static unsigned int write_contexthandle_tfs(FILE *file, const attr_list_t *attrs, type_t *type, enum type_context context, unsigned int *typeformat_offset)
void write_pointer_checks(FILE *file, int indent, const var_t *func)
static unsigned int write_array_tfs(FILE *file, const attr_list_t *attrs, int toplevel_attrs, type_t *type, const char *name, unsigned int *typestring_offset)
static unsigned int write_string_tfs(FILE *file, const attr_list_t *attrs, int toplevel_attrs, type_t *type, enum type_context context, const char *name, unsigned int *typestring_offset)
static int write_pointer_description_offsets(FILE *file, const attr_list_t *attrs, int toplevel_attrs, type_t *type, unsigned int *offset_in_memory, unsigned int *offset_in_buffer, unsigned int *typestring_offset)
void declare_stub_args(FILE *file, int indent, const var_t *func)
enum typegen_type typegen_detect_type(const type_t *type, const attr_list_t *attrs, unsigned int flags)
static int write_no_repeat_pointer_descriptions(FILE *file, const attr_list_t *attrs, int toplevel_attrs, type_t *type, unsigned int *offset_in_memory, unsigned int *offset_in_buffer, unsigned int *typestring_offset)
static unsigned int fields_memsize(const var_list_t *fields, unsigned int *align)
static const unsigned short IsOut
static void write_branch_type(FILE *file, const type_t *t, unsigned int *tfsoff)
static int write_base_type(FILE *file, const type_t *type, unsigned int *typestring_offset)
static const unsigned short MustSize
static void write_procformatstring_func(FILE *file, int indent, const type_t *iface, const var_t *func, unsigned int *offset, unsigned short num_proc)
static void write_remoting_arg(FILE *file, int indent, const var_t *func, const char *local_var_prefix, enum pass pass, enum remoting_phase phase, const var_t *var)
void write_procformatstring(FILE *file, const statement_list_t *stmts, type_pred_t pred)
static const char * string_of_type(unsigned char type)
static const var_t * find_array_or_string_in_struct(const type_t *type)
unsigned int get_size_typeformatstring(const statement_list_t *stmts, type_pred_t pred)
void write_parameters_init(FILE *file, int indent, const var_t *func, const char *local_var_prefix)
static void get_size_procformatstring_iface(type_t *iface, FILE *file, int indent, unsigned int *size)
static struct list expr_eval_routines
static void write_formatdesc(FILE *f, int indent, const char *str)
void write_endpoints(FILE *f, const char *prefix, const str_list_t *list)
static unsigned char get_basic_fc_signed(const type_t *type)
static const unsigned short MustFree
static unsigned char get_pointer_fc(const type_t *type, const attr_list_t *attrs, int toplevel_attrs, int toplevel_param)
static void write_proc_func_interp(FILE *file, int indent, const type_t *iface, const var_t *func, unsigned int *offset, unsigned short num_proc)
static unsigned int write_user_tfs(FILE *file, type_t *type, unsigned int *tfsoff)
static unsigned int write_simple_pointer(FILE *file, const attr_list_t *attrs, int toplevel_attrs, const type_t *type, enum type_context context)
void write_user_quad_list(FILE *file)
static const unsigned short RobustEarly
void print_phase_basetype(FILE *file, int indent, const char *local_var_prefix, enum remoting_phase phase, enum pass pass, const var_t *var, const char *varname)
static void guard_rec(type_t *type)
static void write_pointer_description(FILE *file, const attr_list_t *attrs, int toplevel_attrs, type_t *type, unsigned int *typestring_offset)
expr_t * get_size_is_expr(const type_t *t, const char *name)
static int is_user_type(const type_t *t)
static unsigned int get_function_buffer_size(const var_t *func, enum pass pass)
static unsigned char get_func_oi2_flags(const var_t *func)
static unsigned int write_type_tfs(FILE *file, const attr_list_t *attrs, int toplevel_attrs, type_t *type, const char *name, enum type_context context, unsigned int *typeformat_offset)
void write_full_pointer_init(FILE *file, int indent, const var_t *func, int is_server)
void print(FILE *file, int indent, const char *format, va_list va)
void write_func_param_struct(FILE *file, const type_t *iface, const type_t *func, const char *var_decl, int add_retval)
static unsigned int write_union_tfs(FILE *file, const attr_list_t *attrs, type_t *type, unsigned int *tfsoff)
static int write_varying_array_pointer_descriptions(FILE *file, const attr_list_t *attrs, type_t *type, unsigned int *offset_in_memory, unsigned int *offset_in_buffer, unsigned int *typestring_offset)
void write_expr_eval_routine_list(FILE *file, const char *iface)
static unsigned short user_type_offset(const char *name)
static unsigned char get_correlation_type(const type_t *correlation_var)
static unsigned int compress_params_array(unsigned char *params, unsigned int count)
static unsigned int write_old_procformatstring_type(FILE *file, int indent, const var_t *var, int is_return)
int decl_indirect(const type_t *t)
static const unsigned short RobustIsIIdIs
void write_typeformatstring(FILE *file, const statement_list_t *stmts, type_pred_t pred)
#define ROUND_SIZE(size, alignment)
static int is_embedded_complex(const type_t *type, const attr_list_t *attrs)
static const unsigned short IsByValue
void write_exceptions(FILE *file)
static int is_non_complex_struct(const type_t *type)
unsigned char get_struct_fc(const type_t *type)
void write_remoting_arguments(FILE *file, int indent, const var_t *func, const char *local_var_prefix, enum pass pass, enum remoting_phase phase)
static void write_array_element_type(FILE *file, const attr_list_t *attrs, const type_t *type, int cont_is_complex, unsigned int *tfsoff)
int is_full_pointer_function(const var_t *func)
static unsigned int write_ip_tfs(FILE *file, const attr_list_t *attrs, type_t *type, unsigned int *typeformat_offset)
unsigned int get_size_procformatstring_func(const type_t *iface, const var_t *func)
static unsigned int write_new_procformatstring_type(FILE *file, int indent, const var_t *var, int is_return, unsigned int *stack_offset)
unsigned char get_basic_fc(const type_t *type)
void write_client_call_routine(FILE *file, const type_t *iface, const var_t *func, const char *prefix, unsigned int proc_offset)
unsigned int type_memsize(const type_t *t)
static int get_padding(const var_list_t *fields)
static const unsigned short IsIn
int is_interpreted_func(const type_t *iface, const var_t *func)
static void write_end(FILE *file, unsigned int *tfsoff)
int write_expr_eval_routines(FILE *file, const char *iface)
static const char * get_context_handle_type_name(const type_t *type)
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)
static int processed(const type_t *type)
static unsigned char get_parameter_fc(const var_t *var, int is_return, unsigned short *flags, unsigned int *stack_size, unsigned int *stack_align, unsigned int *typestring_offset)
static unsigned int write_conf_or_var_desc(FILE *file, const type_t *cont_type, unsigned int baseoff, const type_t *type, const expr_t *expr, unsigned short robust_flags)
static const type_t * current_iface
static unsigned int write_struct_tfs(FILE *file, type_t *type, const attr_list_t *attrs, const char *name, unsigned int *tfsoff)
unsigned int get_size_procformatstring(const statement_list_t *stmts, type_pred_t pred)
#define ROUNDING(size, alignment)
static unsigned char get_pointer_fc_context(const type_t *type, const attr_list_t *attrs, int toplevel_attrs, enum type_context context)
void write_procformatstring_offsets(FILE *file, const type_t *iface)
static void print_file(FILE *file, int indent, const char *format,...) __attribute__((format(printf
static void write_iface_procformatstring(type_t *iface, FILE *file, int indent, unsigned int *offset)
static void write_var_init(FILE *file, int indent, const type_t *t, const char *n, const char *local_var_prefix)
static int write_fixed_array_pointer_descriptions(FILE *file, const attr_list_t *attrs, int toplevel_attrs, type_t *type, unsigned int *offset_in_memory, unsigned int *offset_in_buffer, unsigned int *typestring_offset)
static int type_has_full_pointer_recurse(const type_t *type, const attr_list_t *attrs, int toplevel_attrs, int toplevel_param, struct visited_struct_array *visited_structs)
static unsigned int write_pointer_tfs(FILE *file, const attr_list_t *attrs, int toplevel_attrs, type_t *type, unsigned int ref_offset, enum type_context context, unsigned int *typestring_offset)
static void print_start_tfs_comment(FILE *file, type_t *t, unsigned int tfsoff)
static void write_member_type(FILE *file, const type_t *cont, int cont_is_complex, const attr_list_t *attrs, const type_t *type, unsigned int *corroff, unsigned int *tfsoff)
static void for_each_iface(const statement_list_t *stmts, void(*proc)(type_t *iface, FILE *file, int indent, unsigned int *offset), type_pred_t pred, FILE *file, int indent, unsigned int *offset)
static unsigned char get_enum_fc(const type_t *type)
static unsigned int fill_params_array(const type_t *iface, const var_t *func, unsigned char *params, unsigned int count)
static unsigned int clamp_align(unsigned int align)
static void process_tfs_iface(type_t *iface, FILE *file, int indent, unsigned int *offset)
static unsigned int process_tfs(FILE *file, const statement_list_t *stmts, type_pred_t pred)
static int user_type_has_variable_size(const type_t *t)
static int write_conformant_array_pointer_descriptions(FILE *file, const attr_list_t *attrs, type_t *type, unsigned int offset_in_memory, unsigned int *typestring_offset)
static int type_has_pointers(const type_t *type, const attr_list_t *attrs)
static unsigned char get_array_fc(const type_t *type, const attr_list_t *attrs)
unsigned int type_memsize_and_alignment(const type_t *t, unsigned int *align)
void write_full_pointer_free(FILE *file, int indent, const var_t *func)
static const var_t * current_arg
static void write_descriptors(FILE *file, type_t *type, unsigned int *tfsoff)
static unsigned int write_nonsimple_pointer(FILE *file, const attr_list_t *attrs, int toplevel_attrs, const type_t *type, enum type_context context, unsigned int offset, unsigned int *typeformat_offset)
static const type_t * current_structure
void write_formatstringsdecl(FILE *f, int indent, const statement_list_t *stmts, type_pred_t pred)
static unsigned int get_required_buffer_size_type(const type_t *type, const char *name, const attr_list_t *attrs, int toplevel_attrs, int toplevel_param, unsigned int *alignment)
static void write_struct_members(FILE *file, const type_t *type, int is_complex, unsigned int *corroff, unsigned int *typestring_offset)
static void update_tfsoff(type_t *type, unsigned int offset, FILE *file)
static unsigned int get_stack_size(const var_t *var, unsigned int *stack_align, int *by_value)
static void print_phase_function(FILE *file, int indent, const char *type, const char *local_var_prefix, enum remoting_phase phase, const var_t *var, unsigned int type_offset)
static int type_has_full_pointer(const type_t *type, const attr_list_t *attrs, int toplevel_attrs, int toplevel_param)
static const unsigned short IsPipe
static unsigned int union_memsize(const var_list_t *fields, unsigned int *pmaxa)
void assign_stub_out_args(FILE *file, int indent, const var_t *func, const char *local_var_prefix)
#define WRITE_FCTYPE(file, fctype, typestring_offset)
static const var_t * current_func
static unsigned int type_buffer_alignment(const type_t *t)
static unsigned int get_rpc_flags(const attr_list_t *attrs)
int(* type_pred_t)(const type_t *)
@ TGT_CTXT_HANDLE_POINTER
static int type_array_is_decl_as_ptr(const type_t *type)
static enum type_type type_get_type(const type_t *type)
static unsigned short type_array_get_ptr_tfsoff(const type_t *type)
static const decl_spec_t * type_function_get_ret(const type_t *type)
static void type_array_set_ptr_tfsoff(type_t *type, unsigned short ptr_tfsoff)
static int type_basic_get_sign(const type_t *type)
static var_t * type_union_get_switch_value(const type_t *type)
static type_t * type_function_get_rettype(const type_t *type)
static expr_t * type_array_get_variance(const type_t *type)
static int type_array_has_conformance(const type_t *type)
static var_list_t * type_union_get_cases(const type_t *type)
static type_t * type_array_get_element_type(const type_t *type)
static type_t * type_alias_get_aliasee_type(const type_t *type)
static enum type_basic_type type_basic_get_type(const type_t *type)
static var_t * type_function_get_retval(const type_t *type)
static type_t * type_iface_get_async_iface(const type_t *type)
static const decl_spec_t * type_pointer_get_ref(const type_t *type)
static expr_t * type_array_get_conformance(const type_t *type)
static var_list_t * type_struct_get_fields(const type_t *type)
static var_list_t * type_encapsulated_union_get_fields(const type_t *type)
static type_t * type_pointer_get_ref_type(const type_t *type)
static int type_is_alias(const type_t *type)
static type_t * type_iface_get_inherit(const type_t *type)
static var_list_t * type_function_get_args(const type_t *type)
static unsigned int type_array_get_dim(const type_t *type)
static statement_list_t * type_iface_get_stmts(const type_t *type)
static int type_array_has_variance(const type_t *type)
static unsigned stack_offset(compile_ctx_t *ctx)
unsigned int pointer_size
void set_all_tfswrite(int val)
@ TYPE_PARAMETERIZED_TYPE
@ TYPE_ENCAPSULATED_UNION
void clear_all_offsets(void)
@ ATTR_STRICTCONTEXTHANDLE
static enum type_type type_get_type_detect_alias(const type_t *type)
@ TYPE_BASIC_ERROR_STATUS_T
#define STATEMENTS_FOR_EACH_FUNC(stmt, stmts)