40 ffi_type **at = cif->arg_types;
42 for (
i = cif->nargs-1;
i >= 0;
i--, at++)
45 if ((*at)->type == FFI_TYPE_STRUCT)
60 ffi_type **tp = cif->arg_types;
64 for (
i = 0;
i < cif->nargs;
i++, tp++, args++)
78 #if FFI_SIZEOF_ARG >= 4
91 case FFI_TYPE_COMPLEX:
95 case FFI_TYPE_POINTER:
96 *args = (
void*) &(raw++)->ptr;
110 for (
i = 0;
i < cif->nargs;
i++, tp++, args++)
113 if ((*tp)->type == FFI_TYPE_STRUCT)
115 *args = (raw++)->
ptr;
119 if ((*tp)->type == FFI_TYPE_COMPLEX)
121 *args = (raw++)->
ptr;
126 raw +=
ALIGN ((*tp)->size, sizeof (
void*)) /
sizeof (
void*);
131 #error "pdp endian not supported"
141 ffi_type **tp = cif->arg_types;
143 for (
i = 0;
i < cif->nargs;
i++, tp++, args++)
148 (raw++)->
uint = *(UINT8*) (*args);
152 (raw++)->sint = *(SINT8*) (*args);
155 case FFI_TYPE_UINT16:
156 (raw++)->
uint = *(UINT16*) (*args);
159 case FFI_TYPE_SINT16:
160 (raw++)->sint = *(SINT16*) (*args);
163 #if FFI_SIZEOF_ARG >= 4
164 case FFI_TYPE_UINT32:
165 (raw++)->
uint = *(UINT32*) (*args);
168 case FFI_TYPE_SINT32:
169 (raw++)->sint = *(SINT32*) (*args);
174 case FFI_TYPE_STRUCT:
175 (raw++)->
ptr = *args;
179 case FFI_TYPE_COMPLEX:
180 (raw++)->
ptr = *args;
183 case FFI_TYPE_POINTER:
184 (raw++)->
ptr = **(
void***) args;
188 memcpy ((
void*) raw->data, (
void*)*args, (*tp)->size);
194 #if !FFI_NATIVE_RAW_API
204 void ffi_raw_call (ffi_cif *cif,
void (*fn)(
void),
void *rvalue, ffi_raw *raw)
206 void **avalue = (
void**)
alloca (cif->nargs * sizeof (
void*));
214 ffi_translate_args (ffi_cif *cif,
void *rvalue,
215 void **avalue,
void *user_data)
218 ffi_raw_closure *cl = (ffi_raw_closure*)user_data;
221 (*cl->fun) (cif, rvalue, raw, cl->user_data);
227 void (*fun)(ffi_cif*,
void*,ffi_raw*,
void*),
238 if (status == FFI_OK)
241 cl->user_data = user_data;
257 ffi_prep_raw_closure (ffi_raw_closure* cl,
259 void (*fun)(ffi_cif*,
void*,ffi_raw*,
void*),