Exemple #1
0
static void
cls_struct_72byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
{
	struct_72byte	b0, b1, b2, b3;

	b0 = *(struct_72byte*)(args[0]);
	b1 = *(struct_72byte*)(args[1]);
	b2 = *(struct_72byte*)(args[2]);
	b3 = *(struct_72byte*)(args[3]);

	*(struct_72byte*)resp = cls_struct_72byte_fn(b0, b1, b2, b3);
}
		result.d, result.e, result.f, result.g, result.h, result.i);

	return result;
}

static void
cls_struct_72byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata __UNUSED__)
{
	struct_72byte	b0, b1, b2, b3;

	b0 = *(struct_72byte*)(args[0]);
	b1 = *(struct_72byte*)(args[1]);
	b2 = *(struct_72byte*)(args[2]);
	b3 = *(struct_72byte*)(args[3]);

	*(struct_72byte*)resp = cls_struct_72byte_fn(b0, b1, b2, b3);
}

int main (void)
{
	ffi_cif cif;
        void *code;
	ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
	void* args_dbl[5];
	ffi_type* cls_struct_fields[10];
	ffi_type cls_struct_type;
	ffi_type* dbl_arg_types[5];

	cls_struct_type.size = 0;
	cls_struct_type.alignment = 0;
	cls_struct_type.type = FFI_TYPE_STRUCT;