tests: don't test for specific device labels
[pygobject.git] / gi / pygi-invoke-state-struct.h
blobdbf4e66566d5d527552088f9c4fa1acd95eaab16
1 #ifndef __PYGI_INVOKE_STATE_STRUCT_H__
2 #define __PYGI_INVOKE_STATE_STRUCT_H__
4 #include <Python.h>
6 #include <girepository.h>
8 G_BEGIN_DECLS
10 typedef struct _PyGIInvokeArgState
12 /* Holds memory for the C value of arguments marshaled "to" or "from" Python. */
13 GIArgument arg_value;
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;
25 } PyGIInvokeArgState;
28 typedef struct _PyGIInvokeState
30 PyObject *py_in_args;
31 gssize n_py_in_args;
33 /* Number of arguments the ffi wrapped C function takes. Used as the exact
34 * count for argument related arrays held in this struct.
36 gssize n_args;
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.
55 GError *error;
57 gboolean failed;
59 gpointer user_data;
61 /* Function pointer to call with ffi. */
62 gpointer function_ptr;
64 } PyGIInvokeState;
66 G_END_DECLS
68 #endif