1 #ifndef __PYGI_INVOKE_STATE_STRUCT_H__
2 #define __PYGI_INVOKE_STATE_STRUCT_H__
6 #include <girepository.h>
10 typedef struct _PyGIInvokeArgState
12 /* Holds memory for the C value of arguments marshaled "to" or "from" Python. */
15 /* Holds pointers to values in arg_values or a caller allocated chunk of
16 * memory via arg_pointer.v_pointer.
18 GIArgument arg_pointer
;
20 /* Holds from_py marshaler cleanup data. */
21 gpointer arg_cleanup_data
;
23 /* Holds to_py marshaler cleanup data. */
24 gpointer to_py_arg_cleanup_data
;
28 typedef struct _PyGIInvokeState
33 /* Number of arguments the ffi wrapped C function takes. Used as the exact
34 * count for argument related arrays held in this struct.
38 /* List of arguments passed to ffi. Elements can point directly to values held in
39 * arg_values for "in/from Python" or indirectly via arg_pointers for
40 * "out/inout/to Python". In the latter case, the args[x].arg_pointer.v_pointer
41 * member points to memory for the value storage.
43 GIArgument
**ffi_args
;
45 /* Array of size n_args containing per argument state */
46 PyGIInvokeArgState
*args
;
48 /* Memory to receive the result of the C ffi function call. */
49 GIArgument return_arg
;
50 gpointer to_py_return_arg_cleanup_data
;
52 /* A GError exception which is indirectly bound into the last position of
53 * the "args" array if the callable caches "throws" member is set.
61 /* Function pointer to call with ffi. */
62 gpointer function_ptr
;