diff options
author | Colin Walters <walters@verbum.org> | 2009-12-07 11:54:18 -0500 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2009-12-16 18:17:12 -0500 |
commit | 8df06489020fd43499f16e8b5cb2ec14e1f3fe29 (patch) | |
tree | 6d792ed556e4a0df89a955e3c28d9f30f67ea0aa /girepository/girffi.h | |
parent | dc93d485fab8965dd65fed00a968c41bf17262cb (diff) | |
download | gobject-introspection-8df06489020fd43499f16e8b5cb2ec14e1f3fe29.tar.gz |
[girffi] Clean up API, add g_function_info_prep_invoker
Rather than having bindings use g_function_info_invoke, which is basically
a toy/demo API, export a convenience utility function which takes the introspection
information and sets up things we need to pass to libffi.
Then invocation can be done directly to libffi by a binding.
As part of this work, remove some (unused by gjs) public functions from the
girffi API, and instead export a function to map to libffi which can work
semi-correctly.
https://bugzilla.gnome.org/show_bug.cgi?id=604074
Diffstat (limited to 'girepository/girffi.h')
-rw-r--r-- | girepository/girffi.h | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/girepository/girffi.h b/girepository/girffi.h index e931cfbf..7961177e 100644 --- a/girepository/girffi.h +++ b/girepository/girffi.h @@ -31,11 +31,24 @@ typedef void (*GIFFIClosureCallback) (ffi_cif *, void **, void *); -ffi_type * g_ir_ffi_get_ffi_type (GITypeTag tag); -GArgument * g_ir_ffi_convert_arguments (GICallableInfo *callable_info, - void **args); -ffi_type ** g_callable_info_get_ffi_arg_types (GICallableInfo *callable_info); -ffi_type * g_callable_info_get_ffi_return_type (GICallableInfo *callable_info); +typedef struct _GIFunctionInvoker GIFunctionInvoker; + +struct _GIFunctionInvoker { + ffi_cif cif; + gpointer native_address; + + gpointer padding[3]; +}; + +ffi_type * g_type_info_get_ffi_type (GITypeInfo *info); + +gboolean g_function_info_prep_invoker (GIFunctionInfo *info, + GIFunctionInvoker *invoker, + GError **error); + +void g_function_invoker_destroy (GIFunctionInvoker *invoker); + + ffi_closure * g_callable_info_prepare_closure (GICallableInfo *callable_info, ffi_cif *cif, GIFFIClosureCallback callback, |