30 int n = *(
int*)args[0];
35 printf (
"%d %d %d %d %d %d %d %d %d %d\n",
n, s1.
a, s1.
b,
36 l1.
a, l1.
b, l1.
c, l1.
d, l1.
e,
46 ffi_closure *pcl = ffi_closure_alloc (
sizeof (ffi_closure), &code);
47 ffi_type* arg_types[5];
52 ffi_type *s_type_elements[3];
55 ffi_type *l_type_elements[6];
65 s_type.type = FFI_TYPE_STRUCT;
66 s_type.elements = s_type_elements;
70 s_type_elements[2] =
NULL;
74 l_type.type = FFI_TYPE_STRUCT;
75 l_type.elements = l_type_elements;
77 l_type_elements[0] = &ffi_type_uint;
78 l_type_elements[1] = &ffi_type_uint;
79 l_type_elements[2] = &ffi_type_uint;
80 l_type_elements[3] = &ffi_type_uint;
81 l_type_elements[4] = &ffi_type_uint;
82 l_type_elements[5] =
NULL;
84 arg_types[0] = &ffi_type_sint;
85 arg_types[1] = &s_type;
86 arg_types[2] = &l_type;
87 arg_types[3] = &s_type;
91 arg_types) == FFI_OK);
108 res = ((
int (*)(
int, ...))(code))(si, s1, l1,
s2);
110 printf(
"res: %d\n", (
int) res);