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;
26 typedef struct _PyGIInvokeState
31 /* Number of arguments the ffi wrapped C function takes. Used as the exact
32 * count for argument related arrays held in this struct.
36 /* List of arguments passed to ffi. Elements can point directly to values held in
37 * arg_values for "in/from Python" or indirectly via arg_pointers for
38 * "out/inout/to Python". In the latter case, the args[x].arg_pointer.v_pointer
39 * member points to memory for the value storage.
41 GIArgument **ffi_args;
43 /* Array of size n_args containing per argument state */
44 PyGIInvokeArgState *args;
46 /* Memory to receive the result of the C ffi function call. */
47 GIArgument return_arg;
49 /* A GError exception which is indirectly bound into the last position of
50 * the "args" array if the callable caches "throws" member is set.
58 /* Function pointer to call with ffi. */
59 gpointer function_ptr;