1 #ifndef __GITESTTYPES_H__
2 #define __GITESTTYPES_H__
4 #include <glib-object.h>
8 gboolean test_boolean (gboolean in);
9 gint8 test_int8 (gint8 in);
10 guint8 test_uint8 (guint8 in);
11 gint16 test_int16 (gint16 in);
12 guint16 test_uint16 (guint16 in);
13 gint32 test_int32 (gint32 in);
14 guint32 test_uint32 (guint32 in);
15 gint64 test_int64 (gint64 in);
16 guint64 test_uint64 (guint64 in);
17 gshort test_short (gshort in);
18 gushort test_ushort (gushort in);
19 gint test_int (gint in);
20 guint test_uint (guint in);
21 glong test_long (glong in);
22 gulong test_ulong (gulong in);
23 gssize test_ssize (gssize in);
24 gsize test_size (gsize in);
25 gfloat test_float (gfloat in);
26 gdouble test_double (gdouble in);
27 time_t test_timet (time_t in);
28 GType test_gtype (GType in);
31 G_CONST_RETURN char *test_utf8_const_return (void);
32 char *test_utf8_nonconst_return (void);
33 void test_utf8_nonconst_in (char *in);
34 void test_utf8_const_in (const char *in);
35 void test_utf8_out (char **out);
36 void test_utf8_inout (char **inout);
37 GSList *test_filename_return (void);
39 /* in arguments after out arguments */
40 void test_int_out_utf8 (int *length, const char *in);
42 /* multiple output arguments */
43 void test_multi_double_args (gdouble in, gdouble *one, gdouble *two);
44 void test_utf8_out_out (char **out0, char **out1);
45 char *test_utf8_out_nonconst_return (char **out);
49 gboolean test_strv_in (char **arr);
50 int test_array_int_in (int n_ints, int *ints);
51 void test_array_int_out (int *n_ints, int **ints);
52 void test_array_int_inout (int *n_ints, int **ints);
53 int test_array_gint8_in (int n_ints, gint8 *ints);
54 int test_array_gint16_in (int n_ints, gint16 *ints);
55 gint32 test_array_gint32_in (int n_ints, gint32 *ints);
56 gint64 test_array_gint64_in (int n_ints, gint64 *ints);
57 char *test_array_gtype_in (int n_types, GType *types);
58 char **test_strv_out_container (void);
59 char **test_strv_out (void);
60 const char * const * test_strv_out_c (void);
61 void test_strv_outarg (char ***retp);
62 int test_array_fixed_size_int_in (int *ints);
63 void test_array_fixed_size_int_out (int **ints);
64 int *test_array_fixed_size_int_return (void);
67 int test_array_int_in_take (int n_ints, int *ints);
68 gboolean test_strv_in_container (char **arr);
70 int *test_array_int_full_out(int *len);
71 int *test_array_int_none_out(int *len);
75 G_CONST_RETURN GList *test_glist_nothing_return (void);
76 GList *test_glist_nothing_return2 (void);
77 GList *test_glist_container_return (void);
78 GList *test_glist_everything_return (void);
79 void test_glist_nothing_in (const GList *in);
80 void test_glist_nothing_in2 (GList *in);
81 void test_glist_container_in (GList *in);
82 void test_glist_everything_in (GList *in);
83 void test_glist_free (GList *in);
86 G_CONST_RETURN GSList *test_gslist_nothing_return (void);
87 GSList *test_gslist_nothing_return2 (void);
88 GSList *test_gslist_container_return (void);
89 GSList *test_gslist_everything_return (void);
90 void test_gslist_nothing_in (const GSList *in);
91 void test_gslist_nothing_in2 (GSList *in);
92 void test_gslist_container_in (GSList *in);
93 void test_gslist_everything_in (GSList *in);
94 void test_gslist_free (GSList *in);
97 G_CONST_RETURN GHashTable *test_ghash_null_return (void);
98 G_CONST_RETURN GHashTable *test_ghash_nothing_return (void);
99 GHashTable *test_ghash_nothing_return2 (void);
100 GHashTable *test_ghash_container_return (void);
101 GHashTable *test_ghash_everything_return (void);
102 void test_ghash_null_in (const GHashTable *in);
103 void test_ghash_nothing_in (const GHashTable *in);
104 void test_ghash_nothing_in2 (GHashTable *in);
105 void test_ghash_container_in (GHashTable *in);
106 void test_ghash_everything_in (GHashTable *in);
107 void test_ghash_free (GHashTable *in);
108 GHashTable *test_ghash_nested_everything_return (void);
109 GHashTable *test_ghash_nested_everything_return2 (void);
114 int test_closure (GClosure *closure);
115 int test_closure_one_arg (GClosure *closure, int arg);
118 int test_int_value_arg(const GValue *v);
119 const GValue *test_value_return(int i);
137 GType test_enum_get_type (void) G_GNUC_CONST;
138 #define TEST_TYPE_ENUM (test_enum_get_type ())
139 GType test_flags_get_type (void) G_GNUC_CONST;
140 #define TES_TYPE_FLAGS (test_flags_get_type ())
142 const gchar * test_enum_param(TestEnum e);
145 typedef struct _TestStructA TestStructA;
146 typedef struct _TestStructB TestStructB;
156 void test_struct_a_clone (TestStructA *a,
162 TestStructA nested_a;
165 void test_struct_b_clone (TestStructB *b,
168 /* This one has a non-basic member */
175 /* plain-old-data boxed types */
176 typedef struct _TestSimpleBoxedA TestSimpleBoxedA;
177 typedef struct _TestSimpleBoxedB TestSimpleBoxedB;
179 struct _TestSimpleBoxedA
187 GType test_simple_boxed_a_get_type (void);
188 TestSimpleBoxedA * test_simple_boxed_a_copy (TestSimpleBoxedA *a);
189 gboolean test_simple_boxed_a_equals (TestSimpleBoxedA *a,
190 TestSimpleBoxedA *other_a);
191 const TestSimpleBoxedA *test_simple_boxed_a_const_return (void);
194 struct _TestSimpleBoxedB
197 TestSimpleBoxedA nested_a;
200 GType test_simple_boxed_b_get_type (void);
201 TestSimpleBoxedB *test_simple_boxed_b_copy (TestSimpleBoxedB *b);
204 #define TEST_TYPE_BOXED (test_boxed_get_type())
206 typedef struct _TestBoxed TestBoxed;
207 typedef struct _TestBoxedPrivate TestBoxedPrivate;
212 TestSimpleBoxedA nested_a;
214 TestBoxedPrivate *priv;
217 GType test_boxed_get_type (void);
218 TestBoxed *test_boxed_new (void);
219 TestBoxed *test_boxed_copy (TestBoxed *boxed);
220 gboolean test_boxed_equals (TestBoxed *boxed,
224 #define TEST_TYPE_OBJ (test_obj_get_type ())
225 #define TEST_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), TEST_TYPE_OBJ, TestObj))
226 #define TEST_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), TEST_TYPE_OBJ))
227 #define TEST_OBJ_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TEST_TYPE_OBJ, TestObjClass))
229 typedef struct _TestObj TestObj;
230 typedef struct _TestObjClass TestObjClass;
234 * @bare: (allow-none):
238 GObject parent_instance;
246 GObjectClass parent_class;
248 int (*matrix) (TestObj *obj, const char *somestr);
251 guint test_signal_with_static_scope_arg;
254 GType test_obj_get_type (void);
255 TestObj* test_obj_new_from_file (const char *x, GError **error);
256 void test_obj_set_bare (TestObj *obj, GObject *bare);
257 int test_obj_instance_method (TestObj *obj);
258 double test_obj_static_method (int x);
260 void test_obj_torture_signature_0 (TestObj *obj,
267 gboolean test_obj_torture_signature_1 (TestObj *obj,
277 int test_obj_do_matrix (TestObj *obj, const char *somestr);
280 #define TEST_TYPE_SUB_OBJ (test_sub_obj_get_type ())
281 #define TEST_SUB_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), TEST_TYPE_SUB_OBJ, TestSubObj))
282 #define TEST_IS_SUB_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), TEST_TYPE_SUB_OBJ))
283 #define TEST_SUB_OBJ_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TEST_TYPE_SUB_OBJ, TestSubObjClass))
285 typedef struct _TestSubObj TestSubObj;
286 typedef struct _TestSubObjClass TestSubObjClass;
290 TestObj parent_instance;
293 struct _TestSubObjClass
295 TestObjClass parent_class;
298 GType test_sub_obj_get_type (void);
299 TestSubObj* test_sub_obj_new (void);
300 void test_sub_obj_unset_bare (TestSubObj *obj);
301 int test_sub_obj_instance_method (TestSubObj *obj);
304 typedef int (*TestCallback) ();
305 typedef int (*TestCallbackUserData) (gpointer user_data);
307 int test_callback (TestCallback callback);
308 int test_callback_user_data (TestCallbackUserData callback,
310 int test_callback_destroy_notify (TestCallbackUserData callback,
312 GDestroyNotify notify);
313 int test_callback_thaw_notifications (void);
315 void test_callback_async (TestCallbackUserData callback, gpointer user_data);
316 int test_callback_thaw_async (void);
318 int test_callback_infinite (TestCallbackUserData callback,
322 #define TEST_TYPE_INTERFACE (test_interface_get_type ())
323 #define TEST_INTERFACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), TEST_TYPE_INTERFACE, TestInterface))
324 #define TEST_IS_INTERFACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), TEST_TYPE_INTERFACE))
325 #define TEST_INTERFACE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TEST_TYPE_INTERFACE, TestInterfaceIface))
327 typedef struct _TestInterfaceIface TestInterfaceIface;
329 struct _TestInterfaceIface {
330 GTypeInterface base_iface;
333 GType test_interface_get_type (void) G_GNUC_CONST;
335 /* gobject with non-standard prefix */
336 #define TEST_TYPE_WI_802_1X (test_wi_802_1x_get_type ())
337 #define TEST_WI_802_1X(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), TEST_TYPE_WI_802_1X, TestWi8021x))
338 #define TEST_IS_WI_802_1X(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), TEST_TYPE_WI_802_1X))
339 #define TEST_WI_802_1X_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TEST_TYPE_WI_802_1X, TestWi8021xClass))
343 GObject parent_instance;
350 GObjectClass parent_class;
353 GType test_wi_802_1x_get_type (void);
354 TestWi8021x* test_wi_802_1x_new (void);
355 gboolean test_wi_802_1x_get_testbool (TestWi8021x *obj);
356 void test_wi_802_1x_set_testbool (TestWi8021x *obj, gboolean v);
357 int test_wi_802_1x_static_method (int x);
359 /* Function signature torture tests */
360 void test_torture_signature_0 (int x,
366 gboolean test_torture_signature_1 (int x,
373 void test_torture_signature_2 (int x,
374 TestCallbackUserData callback,
376 GDestroyNotify notify,
383 #endif /* __GITESTTYPES_H__ */