regress.h 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455
  1. #ifndef __GITESTTYPES_H__
  2. #define __GITESTTYPES_H__
  3. #ifndef _GI_DISABLE_CAIRO
  4. #include <cairo-gobject.h>
  5. #endif
  6. #include <glib-object.h>
  7. #include <gio/gio.h>
  8. #include <time.h>
  9. #include <string.h>
  10. #include <stdlib.h>
  11. #include "gitestmacros.h"
  12. _GI_TEST_EXTERN
  13. void regress_set_abort_on_error (gboolean abort_on_error);
  14. /* return annotations */
  15. _GI_TEST_EXTERN
  16. char *regress_test_return_allow_none (void);
  17. _GI_TEST_EXTERN
  18. char *regress_test_return_nullable (void);
  19. /* basic types */
  20. _GI_TEST_EXTERN
  21. gboolean regress_test_boolean (gboolean in);
  22. _GI_TEST_EXTERN
  23. gboolean regress_test_boolean_true (gboolean in);
  24. _GI_TEST_EXTERN
  25. gboolean regress_test_boolean_false (gboolean in);
  26. _GI_TEST_EXTERN
  27. gint8 regress_test_int8 (gint8 in);
  28. _GI_TEST_EXTERN
  29. guint8 regress_test_uint8 (guint8 in);
  30. _GI_TEST_EXTERN
  31. gint16 regress_test_int16 (gint16 in);
  32. _GI_TEST_EXTERN
  33. guint16 regress_test_uint16 (guint16 in);
  34. _GI_TEST_EXTERN
  35. gint32 regress_test_int32 (gint32 in);
  36. _GI_TEST_EXTERN
  37. guint32 regress_test_uint32 (guint32 in);
  38. _GI_TEST_EXTERN
  39. gint64 regress_test_int64 (gint64 in);
  40. _GI_TEST_EXTERN
  41. guint64 regress_test_uint64 (guint64 in);
  42. _GI_TEST_EXTERN
  43. gshort regress_test_short (gshort in);
  44. _GI_TEST_EXTERN
  45. gushort regress_test_ushort (gushort in);
  46. _GI_TEST_EXTERN
  47. gint regress_test_int (gint in);
  48. _GI_TEST_EXTERN
  49. guint regress_test_uint (guint in);
  50. _GI_TEST_EXTERN
  51. glong regress_test_long (glong in);
  52. _GI_TEST_EXTERN
  53. gulong regress_test_ulong (gulong in);
  54. _GI_TEST_EXTERN
  55. gssize regress_test_ssize (gssize in);
  56. _GI_TEST_EXTERN
  57. gsize regress_test_size (gsize in);
  58. _GI_TEST_EXTERN
  59. gfloat regress_test_float (gfloat in);
  60. _GI_TEST_EXTERN
  61. gdouble regress_test_double (gdouble in);
  62. _GI_TEST_EXTERN
  63. gunichar regress_test_unichar (gunichar in);
  64. _GI_TEST_EXTERN
  65. time_t regress_test_timet (time_t in);
  66. _GI_TEST_EXTERN
  67. GType regress_test_gtype (GType in);
  68. /* utf8 */
  69. _GI_TEST_EXTERN
  70. const char *regress_test_utf8_const_return (void);
  71. _GI_TEST_EXTERN
  72. char *regress_test_utf8_nonconst_return (void);
  73. _GI_TEST_EXTERN
  74. void regress_test_utf8_const_in (const char *in);
  75. _GI_TEST_EXTERN
  76. void regress_test_utf8_out (char **out);
  77. _GI_TEST_EXTERN
  78. void regress_test_utf8_inout (char **inout);
  79. _GI_TEST_EXTERN
  80. GSList *regress_test_filename_return (void);
  81. _GI_TEST_EXTERN
  82. void regress_test_utf8_null_in (char *in);
  83. _GI_TEST_EXTERN
  84. void regress_test_utf8_null_out (char **char_out);
  85. /* in arguments after out arguments */
  86. _GI_TEST_EXTERN
  87. void regress_test_int_out_utf8 (int *length, const char *in);
  88. /* multiple output arguments */
  89. _GI_TEST_EXTERN
  90. void regress_test_multi_double_args (gdouble in, gdouble *one, gdouble *two);
  91. _GI_TEST_EXTERN
  92. void regress_test_utf8_out_out (char **out0, char **out1);
  93. _GI_TEST_EXTERN
  94. char *regress_test_utf8_out_nonconst_return (char **out);
  95. /* non-basic-types */
  96. /* array */
  97. _GI_TEST_EXTERN
  98. gboolean regress_test_strv_in (char **arr);
  99. _GI_TEST_EXTERN
  100. int regress_test_array_int_in (int n_ints, int *ints);
  101. _GI_TEST_EXTERN
  102. void regress_test_array_int_out (int *n_ints, int **ints);
  103. _GI_TEST_EXTERN
  104. void regress_test_array_int_inout (int *n_ints, int **ints);
  105. _GI_TEST_EXTERN
  106. int regress_test_array_gint8_in (int n_ints, gint8 *ints);
  107. _GI_TEST_EXTERN
  108. int regress_test_array_gint16_in (int n_ints, gint16 *ints);
  109. _GI_TEST_EXTERN
  110. gint32 regress_test_array_gint32_in (int n_ints, gint32 *ints);
  111. _GI_TEST_EXTERN
  112. gint64 regress_test_array_gint64_in (int n_ints, gint64 *ints);
  113. _GI_TEST_EXTERN
  114. char *regress_test_array_gtype_in (int n_types, GType *types);
  115. _GI_TEST_EXTERN
  116. char **regress_test_strv_out_container (void);
  117. _GI_TEST_EXTERN
  118. char **regress_test_strv_out (void);
  119. _GI_TEST_EXTERN
  120. const char * const * regress_test_strv_out_c (void);
  121. _GI_TEST_EXTERN
  122. void regress_test_strv_outarg (char ***retp);
  123. _GI_TEST_EXTERN
  124. int regress_test_array_fixed_size_int_in (int *ints);
  125. _GI_TEST_EXTERN
  126. void regress_test_array_fixed_size_int_out (int **ints);
  127. _GI_TEST_EXTERN
  128. int *regress_test_array_fixed_size_int_return (void);
  129. /* transfer tests */
  130. _GI_TEST_EXTERN
  131. int *regress_test_array_int_full_out(int *len);
  132. _GI_TEST_EXTERN
  133. int *regress_test_array_int_none_out(int *len);
  134. _GI_TEST_EXTERN
  135. void regress_test_array_int_null_in (int *arr, int len);
  136. _GI_TEST_EXTERN
  137. void regress_test_array_int_null_out (int **arr, int *len);
  138. /* interface */
  139. /* GList */
  140. _GI_TEST_EXTERN
  141. const GList *regress_test_glist_nothing_return (void);
  142. _GI_TEST_EXTERN
  143. GList *regress_test_glist_nothing_return2 (void);
  144. _GI_TEST_EXTERN
  145. GList *regress_test_glist_container_return (void);
  146. _GI_TEST_EXTERN
  147. GList *regress_test_glist_everything_return (void);
  148. _GI_TEST_EXTERN
  149. void regress_test_glist_gtype_container_in (GList *in);
  150. _GI_TEST_EXTERN
  151. void regress_test_glist_nothing_in (const GList *in);
  152. _GI_TEST_EXTERN
  153. void regress_test_glist_nothing_in2 (GList *in);
  154. _GI_TEST_EXTERN
  155. void regress_test_glist_null_in(GSList *in);
  156. _GI_TEST_EXTERN
  157. void regress_test_glist_null_out(GSList **out_list);
  158. /* GSList */
  159. _GI_TEST_EXTERN
  160. const GSList *regress_test_gslist_nothing_return (void);
  161. _GI_TEST_EXTERN
  162. GSList *regress_test_gslist_nothing_return2 (void);
  163. _GI_TEST_EXTERN
  164. GSList *regress_test_gslist_container_return (void);
  165. _GI_TEST_EXTERN
  166. GSList *regress_test_gslist_everything_return (void);
  167. _GI_TEST_EXTERN
  168. void regress_test_gslist_nothing_in (const GSList *in);
  169. _GI_TEST_EXTERN
  170. void regress_test_gslist_nothing_in2 (GSList *in);
  171. _GI_TEST_EXTERN
  172. void regress_test_gslist_null_in(GSList *in);
  173. _GI_TEST_EXTERN
  174. void regress_test_gslist_null_out(GSList **out_list);
  175. /* GHashTable */
  176. _GI_TEST_EXTERN
  177. const GHashTable *regress_test_ghash_null_return (void);
  178. _GI_TEST_EXTERN
  179. const GHashTable *regress_test_ghash_nothing_return (void);
  180. _GI_TEST_EXTERN
  181. GHashTable *regress_test_ghash_nothing_return2 (void);
  182. _GI_TEST_EXTERN
  183. GHashTable *regress_test_ghash_gvalue_return (void);
  184. _GI_TEST_EXTERN
  185. void regress_test_ghash_gvalue_in (GHashTable *hash);
  186. _GI_TEST_EXTERN
  187. GHashTable *regress_test_ghash_container_return (void);
  188. _GI_TEST_EXTERN
  189. GHashTable *regress_test_ghash_everything_return (void);
  190. _GI_TEST_EXTERN
  191. void regress_test_ghash_null_in (const GHashTable *in);
  192. _GI_TEST_EXTERN
  193. void regress_test_ghash_null_out (const GHashTable **out);
  194. _GI_TEST_EXTERN
  195. void regress_test_ghash_nothing_in (const GHashTable *in);
  196. _GI_TEST_EXTERN
  197. void regress_test_ghash_nothing_in2 (GHashTable *in);
  198. _GI_TEST_EXTERN
  199. GHashTable *regress_test_ghash_nested_everything_return (void);
  200. _GI_TEST_EXTERN
  201. GHashTable *regress_test_ghash_nested_everything_return2 (void);
  202. /* GPtrArray */
  203. _GI_TEST_EXTERN
  204. GPtrArray *regress_test_garray_container_return (void);
  205. _GI_TEST_EXTERN
  206. GPtrArray *regress_test_garray_full_return (void);
  207. /* error? */
  208. /* closure */
  209. _GI_TEST_EXTERN
  210. int regress_test_closure (GClosure *closure);
  211. _GI_TEST_EXTERN
  212. int regress_test_closure_one_arg (GClosure *closure, int arg);
  213. _GI_TEST_EXTERN
  214. GVariant *regress_test_closure_variant (GClosure *closure, GVariant* arg);
  215. /* value */
  216. _GI_TEST_EXTERN
  217. int regress_test_int_value_arg(const GValue *v);
  218. _GI_TEST_EXTERN
  219. const GValue *regress_test_value_return(int i);
  220. /* foreign structs */
  221. #ifndef _GI_DISABLE_CAIRO
  222. _GI_TEST_EXTERN
  223. cairo_t *regress_test_cairo_context_full_return (void);
  224. _GI_TEST_EXTERN
  225. void regress_test_cairo_context_none_in (cairo_t *context);
  226. _GI_TEST_EXTERN
  227. cairo_surface_t *regress_test_cairo_surface_none_return (void);
  228. _GI_TEST_EXTERN
  229. cairo_surface_t *regress_test_cairo_surface_full_return (void);
  230. _GI_TEST_EXTERN
  231. void regress_test_cairo_surface_none_in (cairo_surface_t *surface);
  232. _GI_TEST_EXTERN
  233. void regress_test_cairo_surface_full_out (cairo_surface_t **surface);
  234. #endif
  235. /* versioning (deprecated, since, stability) */
  236. _GI_TEST_EXTERN
  237. void regress_test_versioning (void);
  238. _GI_TEST_EXTERN
  239. GVariant *regress_test_gvariant_i (void);
  240. _GI_TEST_EXTERN
  241. GVariant *regress_test_gvariant_s (void);
  242. _GI_TEST_EXTERN
  243. GVariant *regress_test_gvariant_asv (void);
  244. _GI_TEST_EXTERN
  245. GVariant *regress_test_gvariant_v (void);
  246. _GI_TEST_EXTERN
  247. GVariant *regress_test_gvariant_as (void);
  248. /* enums / flags */
  249. #define NUM_REGRESS_FOO
  250. /**
  251. * RegressTestEnum:
  252. * @REGRESS_TEST_VALUE1: value 1
  253. * @REGRESS_TEST_VALUE2: value 2
  254. *
  255. * By purpose, not all members have documentation
  256. */
  257. typedef enum
  258. {
  259. REGRESS_TEST_VALUE1,
  260. REGRESS_TEST_VALUE2,
  261. REGRESS_TEST_VALUE3 = -1,
  262. REGRESS_TEST_VALUE4 = '0'
  263. } RegressTestEnum;
  264. typedef enum
  265. {
  266. REGRESS_TEST_UNSIGNED_VALUE1 = 1,
  267. REGRESS_TEST_UNSIGNED_VALUE2 = 0x80000000
  268. } RegressTestEnumUnsigned;
  269. typedef enum
  270. {
  271. REGRESS_TEST_FLAG1 = 1 << 0,
  272. REGRESS_TEST_FLAG2 = 1 << 1,
  273. REGRESS_TEST_FLAG3 = 1 << 2,
  274. } RegressTestFlags;
  275. _GI_TEST_EXTERN
  276. GType regress_test_enum_get_type (void) G_GNUC_CONST;
  277. #define REGRESS_TEST_TYPE_ENUM (regress_test_enum_get_type ())
  278. _GI_TEST_EXTERN
  279. GType regress_test_enum_unsigned_get_type (void) G_GNUC_CONST;
  280. #define REGRESS_TEST_TYPE_ENUM_UNSIGNED (regress_test_enum_unsigned_get_type ())
  281. _GI_TEST_EXTERN
  282. GType regress_test_flags_get_type (void) G_GNUC_CONST;
  283. #define REGRESS_TEST_TYPE_FLAGS (regress_test_flags_get_type ())
  284. typedef enum
  285. {
  286. REGRESS_TEST_REFERENCE_0 = 2 + 2,
  287. REGRESS_TEST_REFERENCE_1 = 1 + 1,
  288. REGRESS_TEST_REFERENCE_2 = 6 * 9,
  289. REGRESS_TEST_REFERENCE_3 = REGRESS_TEST_REFERENCE_1 + REGRESS_TEST_REFERENCE_1,
  290. REGRESS_TEST_REFERENCE_4 = REGRESS_TEST_REFERENCE_2 * REGRESS_TEST_REFERENCE_3,
  291. REGRESS_TEST_REFERENCE_5 = ~REGRESS_TEST_REFERENCE_4,
  292. } RegressTestReferenceEnum;
  293. /* this is not registered with GType */
  294. typedef enum
  295. {
  296. REGRESS_TEST_EVALUE1,
  297. REGRESS_TEST_EVALUE2 = 42,
  298. REGRESS_TEST_EVALUE3 = '0'
  299. } RegressTestEnumNoGEnum;
  300. _GI_TEST_EXTERN
  301. const gchar * regress_test_enum_param(RegressTestEnum e);
  302. _GI_TEST_EXTERN
  303. const gchar * regress_test_unsigned_enum_param(RegressTestEnumUnsigned e);
  304. _GI_TEST_EXTERN
  305. void regress_global_get_flags_out (RegressTestFlags *v);
  306. /* error domains */
  307. typedef enum
  308. {
  309. REGRESS_TEST_ERROR_CODE1 = 1,
  310. REGRESS_TEST_ERROR_CODE2 = 2,
  311. REGRESS_TEST_ERROR_CODE3 = 3
  312. } RegressTestError;
  313. _GI_TEST_EXTERN
  314. GType regress_test_error_get_type (void);
  315. _GI_TEST_EXTERN
  316. GQuark regress_test_error_quark (void);
  317. /* Test weird names, with and without
  318. c_symbol_prefix given by a GType
  319. */
  320. typedef enum
  321. {
  322. REGRESS_TEST_ABC_ERROR_CODE1 = 1,
  323. REGRESS_TEST_ABC_ERROR_CODE2 = 2,
  324. REGRESS_TEST_ABC_ERROR_CODE3 = 3
  325. } RegressTestABCError;
  326. _GI_TEST_EXTERN
  327. GType regress_test_abc_error_get_type (void);
  328. _GI_TEST_EXTERN
  329. GQuark regress_test_abc_error_quark (void);
  330. typedef enum
  331. {
  332. REGRESS_TEST_OTHER_ERROR_CODE1 = 1,
  333. REGRESS_TEST_OTHER_ERROR_CODE2 = 2,
  334. REGRESS_TEST_OTHER_ERROR_CODE3 = 3
  335. } RegressTestOtherError;
  336. /* This returns a GType for RegressTestOtherError.
  337. The difference is intentional, although it
  338. is mainly meant for capitalization problems.
  339. */
  340. _GI_TEST_EXTERN
  341. GType regress_test_unconventional_error_get_type (void);
  342. _GI_TEST_EXTERN
  343. GQuark regress_test_unconventional_error_quark (void);
  344. typedef enum
  345. {
  346. REGRESS_TEST_DEF_ERROR_CODE0 = 0,
  347. REGRESS_TEST_DEF_ERROR_CODE1 = 1,
  348. REGRESS_TEST_DEF_ERROR_CODE2 = 2
  349. } RegressTestDEFError;
  350. _GI_TEST_EXTERN
  351. GQuark regress_test_def_error_quark (void);
  352. /* the scanner used to have problem
  353. with two uppercase letter right after
  354. the identifier prefix, that's why
  355. we break the RegressTest convention */
  356. typedef enum
  357. {
  358. REGRESS_ATEST_ERROR_CODE0 = 0,
  359. REGRESS_ATEST_ERROR_CODE1 = 1,
  360. REGRESS_ATEST_ERROR_CODE2 = 2
  361. } RegressATestError;
  362. _GI_TEST_EXTERN
  363. GQuark regress_atest_error_quark (void);
  364. /* constants */
  365. #define REGRESS_NEGATIVE_INT_CONSTANT -42
  366. #define REGRESS_INT_CONSTANT 4422
  367. #define REGRESS_DOUBLE_CONSTANT 44.22
  368. #define REGRESS_STRING_CONSTANT "Some String"
  369. #define REGRESS_Mixed_Case_Constant 4423
  370. #define REGRESS_BOOL_CONSTANT TRUE
  371. #define REGRESS_G_GINT64_CONSTANT (G_GINT64_CONSTANT (1000))
  372. #define REGRESS_GUINT64_CONSTANT ((guint64) -1)
  373. typedef guint64 RegressTestTypeGUInt64;
  374. #define REGRESS_GUINT64_CONSTANTA ((RegressTestTypeGUInt64) -1)
  375. /* structures */
  376. typedef struct _RegressTestStructA RegressTestStructA;
  377. typedef struct _RegressTestStructB RegressTestStructB;
  378. typedef struct _RegressTestStructC RegressTestStructC;
  379. typedef struct _RegressTestStructD RegressTestStructD;
  380. typedef struct _RegressTestStructF RegressTestStructF;
  381. struct _RegressTestStructA
  382. {
  383. gint some_int;
  384. gint8 some_int8;
  385. gdouble some_double;
  386. RegressTestEnum some_enum;
  387. };
  388. _GI_TEST_EXTERN
  389. void regress_test_struct_a_clone (RegressTestStructA *a,
  390. RegressTestStructA *a_out);
  391. _GI_TEST_EXTERN
  392. void regress_test_struct_a_parse (RegressTestStructA *a_out, const gchar *string);
  393. _GI_TEST_EXTERN
  394. void regress_test_array_struct_out (RegressTestStructA **arr, int *len);
  395. struct _RegressTestStructB
  396. {
  397. gint8 some_int8;
  398. RegressTestStructA nested_a;
  399. };
  400. _GI_TEST_EXTERN
  401. void regress_test_struct_b_clone (RegressTestStructB *b,
  402. RegressTestStructB *b_out);
  403. /* This one has a non-basic member */
  404. struct _RegressTestStructC
  405. {
  406. gint another_int;
  407. GObject *obj;
  408. };
  409. /* This one has annotated fields */
  410. /**
  411. * RegressTestStructD:
  412. * @array1: (array zero-terminated=1):
  413. * @array2: (array zero-terminated=1) (element-type RegressTestObj):
  414. * @field: (type RegressTestObj):
  415. * @list: (element-type RegressTestObj):
  416. * @garray: (element-type RegressTestObj):
  417. * @ref_count:
  418. */
  419. struct _RegressTestStructD
  420. {
  421. RegressTestStructA **array1;
  422. gpointer *array2;
  423. gpointer field;
  424. GList *list;
  425. GPtrArray *garray;
  426. };
  427. /* This one has an array of anonymous unions, inspired by GValue */
  428. struct RegressTestStructE
  429. {
  430. GType some_type;
  431. union {
  432. gint v_int;
  433. guint v_uint;
  434. glong v_long;
  435. gulong v_ulong;
  436. gint64 v_int64;
  437. guint64 v_uint64;
  438. gfloat v_float;
  439. gdouble v_double;
  440. gpointer v_pointer;
  441. } some_union[2];
  442. };
  443. /* This one has members with const or volatile modifiers. */
  444. struct _RegressTestStructF
  445. {
  446. volatile gint ref_count;
  447. const gint *data1;
  448. const gint *const data2;
  449. const gint *const *const data3;
  450. const gint **const* data4;
  451. volatile gint *const data5;
  452. const gint *volatile data6;
  453. };
  454. /* plain-old-data boxed types */
  455. typedef struct _RegressTestSimpleBoxedA RegressTestSimpleBoxedA;
  456. typedef struct _RegressTestSimpleBoxedB RegressTestSimpleBoxedB;
  457. struct _RegressTestSimpleBoxedA
  458. {
  459. gint some_int;
  460. gint8 some_int8;
  461. gdouble some_double;
  462. RegressTestEnum some_enum;
  463. };
  464. /* Intentionally uses _get_gtype */
  465. _GI_TEST_EXTERN
  466. GType regress_test_simple_boxed_a_get_gtype (void);
  467. _GI_TEST_EXTERN
  468. RegressTestSimpleBoxedA *regress_test_simple_boxed_a_copy (RegressTestSimpleBoxedA *a);
  469. _GI_TEST_EXTERN
  470. gboolean regress_test_simple_boxed_a_equals (RegressTestSimpleBoxedA *a,
  471. RegressTestSimpleBoxedA *other_a);
  472. _GI_TEST_EXTERN
  473. const RegressTestSimpleBoxedA *regress_test_simple_boxed_a_const_return (void);
  474. struct _RegressTestSimpleBoxedB
  475. {
  476. gint8 some_int8;
  477. RegressTestSimpleBoxedA nested_a;
  478. };
  479. _GI_TEST_EXTERN
  480. GType regress_test_simple_boxed_b_get_type (void);
  481. _GI_TEST_EXTERN
  482. RegressTestSimpleBoxedB *regress_test_simple_boxed_b_copy (RegressTestSimpleBoxedB *b);
  483. /* opaque boxed */
  484. #define REGRESS_TEST_TYPE_BOXED (regress_test_boxed_get_type())
  485. typedef struct _RegressTestBoxed RegressTestBoxed;
  486. typedef struct _RegressTestBoxedPrivate RegressTestBoxedPrivate;
  487. struct _RegressTestBoxed
  488. {
  489. gint8 some_int8;
  490. RegressTestSimpleBoxedA nested_a;
  491. RegressTestBoxedPrivate *priv;
  492. };
  493. _GI_TEST_EXTERN
  494. GType regress_test_boxed_get_type (void);
  495. _GI_TEST_EXTERN
  496. RegressTestBoxed *regress_test_boxed_new (void);
  497. _GI_TEST_EXTERN
  498. RegressTestBoxed *regress_test_boxed_new_alternative_constructor1 (int i);
  499. _GI_TEST_EXTERN
  500. RegressTestBoxed *regress_test_boxed_new_alternative_constructor2 (int i, int j);
  501. _GI_TEST_EXTERN
  502. RegressTestBoxed *regress_test_boxed_new_alternative_constructor3 (char *s);
  503. _GI_TEST_EXTERN
  504. RegressTestBoxed *regress_test_boxed_copy (RegressTestBoxed *boxed);
  505. _GI_TEST_EXTERN
  506. gboolean regress_test_boxed_equals (RegressTestBoxed *boxed,
  507. RegressTestBoxed *other);
  508. _GI_TEST_EXTERN
  509. void regress_test_boxeds_not_a_method (RegressTestBoxed *boxed);
  510. _GI_TEST_EXTERN
  511. void regress_test_boxeds_not_a_static (void);
  512. typedef struct _RegressTestBoxedB RegressTestBoxedB;
  513. struct _RegressTestBoxedB
  514. {
  515. gint8 some_int8;
  516. glong some_long;
  517. };
  518. _GI_TEST_EXTERN
  519. GType regress_test_boxed_b_get_type (void);
  520. _GI_TEST_EXTERN
  521. RegressTestBoxedB *regress_test_boxed_b_new (gint8 some_int8, glong some_long);
  522. _GI_TEST_EXTERN
  523. RegressTestBoxedB *regress_test_boxed_b_copy (RegressTestBoxedB *boxed);
  524. typedef struct _RegressTestBoxedC RegressTestBoxedC;
  525. struct _RegressTestBoxedC
  526. {
  527. guint refcount;
  528. guint another_thing;
  529. };
  530. _GI_TEST_EXTERN
  531. GType regress_test_boxed_c_get_type (void);
  532. _GI_TEST_EXTERN
  533. RegressTestBoxedC *regress_test_boxed_c_new (void);
  534. typedef struct _RegressTestBoxedD RegressTestBoxedD;
  535. _GI_TEST_EXTERN
  536. GType regress_test_boxed_d_get_type (void);
  537. _GI_TEST_EXTERN
  538. RegressTestBoxedD *regress_test_boxed_d_new (const char *a_string, int a_int);
  539. _GI_TEST_EXTERN
  540. RegressTestBoxedD *regress_test_boxed_d_copy (RegressTestBoxedD *boxed);
  541. _GI_TEST_EXTERN
  542. void regress_test_boxed_d_free (RegressTestBoxedD *boxed);
  543. _GI_TEST_EXTERN
  544. int regress_test_boxed_d_get_magic (RegressTestBoxedD *boxed);
  545. /* gobject */
  546. #define REGRESS_TEST_TYPE_OBJ (regress_test_obj_get_type ())
  547. #define REGRESS_TEST_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), REGRESS_TEST_TYPE_OBJ, RegressTestObj))
  548. #define REGRESS_TEST_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), REGRESS_TEST_TYPE_OBJ))
  549. #define REGRESS_TEST_OBJ_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), REGRESS_TEST_TYPE_OBJ, RegressTestObjClass))
  550. typedef struct _RegressTestObj RegressTestObj;
  551. typedef struct _RegressTestObjClass RegressTestObjClass;
  552. /**
  553. * RegressTestObj:
  554. * @bare: (allow-none):
  555. */
  556. struct _RegressTestObj
  557. {
  558. GObject parent_instance;
  559. GObject *bare;
  560. RegressTestBoxed *boxed;
  561. GHashTable *hash_table;
  562. GList *list;
  563. gint8 some_int8;
  564. float some_float;
  565. double some_double;
  566. char* string;
  567. GType gtype;
  568. /* < private > */
  569. void (*function_ptr) (void);
  570. };
  571. typedef void (*RegressTestExternallyDefinedCallback) (RegressTestObj *obj, int someint);
  572. struct _RegressTestObjClass
  573. {
  574. GObjectClass parent_class;
  575. int (*matrix) (RegressTestObj *obj, const char *somestr);
  576. /**
  577. * RegressTestObjClass::allow_none_vfunc:
  578. * @two: (allow-none): Another object
  579. */
  580. void (*allow_none_vfunc) (RegressTestObj *obj, RegressTestObj *two);
  581. guint test_signal;
  582. guint test_signal_with_static_scope_arg;
  583. RegressTestExternallyDefinedCallback complex_vfunc;
  584. /* Should be replaced with simple "gpointer" and not be callback */
  585. void (*_regress_reserved1) (void);
  586. void (*_regress_reserved2) (void);
  587. };
  588. _GI_TEST_EXTERN
  589. GType regress_test_obj_get_type (void);
  590. _GI_TEST_EXTERN
  591. RegressTestObj* regress_test_obj_new (RegressTestObj *obj);
  592. _GI_TEST_EXTERN
  593. RegressTestObj* regress_constructor (void);
  594. _GI_TEST_EXTERN
  595. RegressTestObj* regress_test_obj_new_from_file (const char *x, GError **error);
  596. _GI_TEST_EXTERN
  597. void regress_test_obj_set_bare (RegressTestObj *obj, GObject *bare);
  598. _GI_TEST_EXTERN
  599. void regress_test_obj_emit_sig_with_obj (RegressTestObj *obj);
  600. _GI_TEST_EXTERN
  601. void regress_test_obj_emit_sig_with_foreign_struct (RegressTestObj *obj);
  602. _GI_TEST_EXTERN
  603. void regress_test_obj_emit_sig_with_int64 (RegressTestObj *obj);
  604. _GI_TEST_EXTERN
  605. void regress_test_obj_emit_sig_with_uint64 (RegressTestObj *obj);
  606. _GI_TEST_EXTERN
  607. void regress_test_obj_emit_sig_with_array_len_prop (RegressTestObj *obj);
  608. _GI_TEST_EXTERN
  609. int regress_test_obj_instance_method (RegressTestObj *obj);
  610. _GI_TEST_EXTERN
  611. void regress_test_obj_instance_method_full (RegressTestObj *obj);
  612. _GI_TEST_EXTERN
  613. double regress_test_obj_static_method (int x);
  614. _GI_TEST_EXTERN
  615. void regress_forced_method (RegressTestObj *obj);
  616. _GI_TEST_EXTERN
  617. void regress_test_array_fixed_out_objects (RegressTestObj ***objs);
  618. _GI_TEST_EXTERN
  619. void regress_test_obj_torture_signature_0 (RegressTestObj *obj,
  620. int x,
  621. double *y,
  622. int *z,
  623. const char *foo,
  624. int *q,
  625. guint m);
  626. _GI_TEST_EXTERN
  627. gboolean regress_test_obj_torture_signature_1 (RegressTestObj *obj,
  628. int x,
  629. double *y,
  630. int *z,
  631. const char *foo,
  632. int *q,
  633. guint m,
  634. GError **error);
  635. _GI_TEST_EXTERN
  636. gboolean regress_test_obj_skip_return_val (RegressTestObj *obj,
  637. gint a,
  638. gint *out_b,
  639. gdouble c,
  640. gint *inout_d,
  641. gint *out_sum,
  642. gint num1,
  643. gint num2,
  644. GError **error);
  645. _GI_TEST_EXTERN
  646. gboolean regress_test_obj_skip_return_val_no_out (RegressTestObj *obj,
  647. gint a,
  648. GError **error);
  649. _GI_TEST_EXTERN
  650. gboolean regress_test_obj_skip_param (RegressTestObj *obj,
  651. gint a,
  652. gint *out_b,
  653. gdouble c,
  654. gint *inout_d,
  655. gint *out_sum,
  656. gint num1,
  657. gint num2,
  658. GError **error);
  659. _GI_TEST_EXTERN
  660. gboolean regress_test_obj_skip_out_param (RegressTestObj *obj,
  661. gint a,
  662. gint *out_b,
  663. gdouble c,
  664. gint *inout_d,
  665. gint *out_sum,
  666. gint num1,
  667. gint num2,
  668. GError **error);
  669. _GI_TEST_EXTERN
  670. gboolean regress_test_obj_skip_inout_param (RegressTestObj *obj,
  671. gint a,
  672. gint *out_b,
  673. gdouble c,
  674. gint *inout_d,
  675. gint *out_sum,
  676. gint num1,
  677. gint num2,
  678. GError **error);
  679. /* virtual */
  680. _GI_TEST_EXTERN
  681. int regress_test_obj_do_matrix (RegressTestObj *obj, const char *somestr);
  682. _GI_TEST_EXTERN
  683. void regress_func_obj_null_in (RegressTestObj *obj);
  684. _GI_TEST_EXTERN
  685. void regress_test_obj_null_out (RegressTestObj **obj);
  686. void regress_func_obj_nullable_in (RegressTestObj *obj);
  687. void regress_test_obj_not_nullable_typed_gpointer_in (RegressTestObj *obj,
  688. gpointer input);
  689. void regress_test_obj_not_nullable_element_typed_gpointer_in (RegressTestObj *obj,
  690. gpointer input,
  691. guint count);
  692. /* inheritance */
  693. #define REGRESS_TEST_TYPE_SUB_OBJ (regress_test_sub_obj_get_type ())
  694. #define REGRESS_TEST_SUB_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), REGRESS_TEST_TYPE_SUB_OBJ, RegressTestSubObj))
  695. #define REGRESS_TEST_IS_SUB_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), REGRESS_TEST_TYPE_SUB_OBJ))
  696. #define REGRESS_TEST_SUB_OBJ_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), REGRESS_TEST_TYPE_SUB_OBJ, RegressTestSubObjClass))
  697. typedef struct _RegressTestSubObj RegressTestSubObj;
  698. typedef struct _RegressTestSubObjClass RegressTestSubObjClass;
  699. struct _RegressTestSubObj
  700. {
  701. RegressTestObj parent_instance;
  702. };
  703. struct _RegressTestSubObjClass
  704. {
  705. RegressTestObjClass parent_class;
  706. };
  707. _GI_TEST_EXTERN
  708. GType regress_test_sub_obj_get_type (void);
  709. _GI_TEST_EXTERN
  710. RegressTestObj* regress_test_sub_obj_new (void);
  711. _GI_TEST_EXTERN
  712. void regress_test_sub_obj_unset_bare (RegressTestSubObj *obj);
  713. _GI_TEST_EXTERN
  714. int regress_test_sub_obj_instance_method (RegressTestSubObj *obj);
  715. /* fundamental object */
  716. #define REGRESS_TEST_TYPE_FUNDAMENTAL_OBJECT (regress_test_fundamental_object_get_type())
  717. #define REGRESS_TEST_IS_FUNDAMENTAL_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), REGRESS_TEST_TYPE_FUNDAMENTAL_OBJECT))
  718. #define REGRESS_TEST_IS_FUNDAMENTAL_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), REGRESS_TEST_TYPE_FUNDAMENTAL_OBJECT))
  719. #define REGRESS_TEST_FUNDAMENTAL_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), REGRESS_TEST_TYPE_FUNDAMENTAL_OBJECT, RegressTestFundamentalObjectClass))
  720. #define REGRESS_TEST_FUNDAMENTAL_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), REGRESS_TEST_TYPE_FUNDAMENTAL_OBJECT, RegressTestFundamentalObject))
  721. #define REGRESS_TEST_FUNDAMENTAL_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), REGRESS_TEST_TYPE_FUNDAMENTAL_OBJECT, RegressTestFundamentalObjectClass))
  722. #define REGRESS_TEST_FUNDAMENTAL_OBJECT_CAST(obj) ((RegressTestFundamentalObject*)(obj))
  723. typedef struct _RegressTestFundamentalObject RegressTestFundamentalObject;
  724. typedef struct _RegressTestFundamentalObjectClass RegressTestFundamentalObjectClass;
  725. /**
  726. * RegressTestFundamentalObjectCopyFunction:
  727. *
  728. * Returns: (transfer full):
  729. */
  730. typedef RegressTestFundamentalObject * (*RegressTestFundamentalObjectCopyFunction) (const RegressTestFundamentalObject *obj);
  731. typedef void (*RegressTestFundamentalObjectFinalizeFunction) (RegressTestFundamentalObject *obj);
  732. struct _RegressTestFundamentalObject {
  733. GTypeInstance instance;
  734. gint refcount;
  735. guint flags;
  736. };
  737. struct _RegressTestFundamentalObjectClass {
  738. GTypeClass type_class;
  739. RegressTestFundamentalObjectCopyFunction copy;
  740. RegressTestFundamentalObjectFinalizeFunction finalize;
  741. };
  742. _GI_TEST_EXTERN
  743. GType regress_test_fundamental_object_get_type (void);
  744. _GI_TEST_EXTERN
  745. RegressTestFundamentalObject* regress_test_fundamental_object_ref (RegressTestFundamentalObject *fundamental_object);
  746. _GI_TEST_EXTERN
  747. void regress_test_fundamental_object_unref (RegressTestFundamentalObject *fundamental_object);
  748. #define REGRESS_TEST_VALUE_HOLDS_FUNDAMENTAL_OBJECT(value) (G_VALUE_HOLDS(value, REGRESS_TEST_TYPE_FUNDAMENTAL_OBJECT))
  749. _GI_TEST_EXTERN
  750. void regress_test_value_set_fundamental_object (GValue *value, RegressTestFundamentalObject *fundamental_object);
  751. _GI_TEST_EXTERN
  752. RegressTestFundamentalObject* regress_test_value_get_fundamental_object (const GValue *value);
  753. typedef struct _RegressTestFundamentalSubObject RegressTestFundamentalSubObject;
  754. typedef struct _RegressTestFundamentalSubObjectClass RegressTestFundamentalSubObjectClass;
  755. struct _RegressTestFundamentalSubObject
  756. {
  757. RegressTestFundamentalObject fundamental_object;
  758. char *data;
  759. };
  760. struct _RegressTestFundamentalSubObjectClass {
  761. RegressTestFundamentalObjectClass fundamental_object_class;
  762. };
  763. _GI_TEST_EXTERN
  764. GType regress_test_fundamental_sub_object_get_type(void);
  765. _GI_TEST_EXTERN
  766. RegressTestFundamentalSubObject *
  767. regress_test_fundamental_sub_object_new (const char *data);
  768. /* callback */
  769. typedef void (*RegressTestSimpleCallback) (void);
  770. typedef void RegressTestNoPtrCallback (void);
  771. typedef int (*RegressTestCallback) (void);
  772. typedef int (*RegressTestCallbackUserData) (gpointer user_data);
  773. /**
  774. * RegressTestCallbackHashtable:
  775. * @data: (element-type utf8 gint): a hash table; will be modified
  776. */
  777. typedef void (*RegressTestCallbackHashtable) (GHashTable *data);
  778. typedef void (*RegressTestCallbackGError) (const GError *error);
  779. /**
  780. * RegressTestCallbackOwnedGError:
  781. * @error: (transfer full): GError instance; must be freed by the callback
  782. */
  783. typedef void (*RegressTestCallbackOwnedGError) (GError *error);
  784. /**
  785. * RegressTestCallbackFull:
  786. * @foo: the investment rate
  787. * @bar: how much money
  788. * @path: (type filename): Path to file
  789. */
  790. typedef int (*RegressTestCallbackFull) (int foo, double bar, char *path);
  791. /**
  792. * RegressTestCallbackReturnFull:
  793. * Return value: (transfer full):
  794. */
  795. typedef RegressTestObj *(*RegressTestCallbackReturnFull) (void);
  796. /**
  797. * RegressTestCallbackArray:
  798. * @one: (array length=one_length):
  799. * @one_length:
  800. * @two: (array length=two_length) (element-type utf8):
  801. * @two_length:
  802. */
  803. typedef int (*RegressTestCallbackArray) (int *one, gsize one_length, const char** two, int two_length);
  804. /**
  805. * RegressTestCallbackArrayInOut:
  806. * @ints: (inout) (array length=length):
  807. * @length: (inout):
  808. */
  809. typedef void (* RegressTestCallbackArrayInOut) (int **ints, int *length);
  810. _GI_TEST_EXTERN
  811. void regress_test_simple_callback (RegressTestSimpleCallback callback);
  812. _GI_TEST_EXTERN
  813. void regress_test_noptr_callback (RegressTestNoPtrCallback callback);
  814. _GI_TEST_EXTERN
  815. int regress_test_callback (RegressTestCallback callback);
  816. _GI_TEST_EXTERN
  817. int regress_test_multi_callback (RegressTestCallback callback);
  818. _GI_TEST_EXTERN
  819. int regress_test_array_callback (RegressTestCallbackArray callback);
  820. _GI_TEST_EXTERN
  821. int regress_test_array_inout_callback (RegressTestCallbackArrayInOut callback);
  822. _GI_TEST_EXTERN
  823. int regress_test_callback_user_data (RegressTestCallbackUserData callback,
  824. gpointer user_data);
  825. _GI_TEST_EXTERN
  826. void regress_test_callback_return_full (RegressTestCallbackReturnFull callback);
  827. _GI_TEST_EXTERN
  828. int regress_test_callback_destroy_notify (RegressTestCallbackUserData callback,
  829. gpointer user_data,
  830. GDestroyNotify notify);
  831. _GI_TEST_EXTERN
  832. int regress_test_callback_destroy_notify_no_user_data (RegressTestCallbackUserData callback,
  833. GDestroyNotify notify);
  834. _GI_TEST_EXTERN
  835. int regress_test_callback_thaw_notifications (void);
  836. _GI_TEST_EXTERN
  837. void regress_test_callback_async (RegressTestCallbackUserData callback, gpointer user_data);
  838. _GI_TEST_EXTERN
  839. int regress_test_callback_thaw_async (void);
  840. _GI_TEST_EXTERN
  841. void regress_test_async_ready_callback (GAsyncReadyCallback callback);
  842. _GI_TEST_EXTERN
  843. void regress_test_obj_instance_method_callback (RegressTestObj *obj, RegressTestCallback callback);
  844. _GI_TEST_EXTERN
  845. void regress_test_obj_static_method_callback (RegressTestCallback callback);
  846. _GI_TEST_EXTERN
  847. RegressTestObj *regress_test_obj_new_callback (RegressTestCallbackUserData callback,
  848. gpointer user_data,
  849. GDestroyNotify notify);
  850. _GI_TEST_EXTERN
  851. void regress_test_hash_table_callback (GHashTable *data, RegressTestCallbackHashtable callback);
  852. _GI_TEST_EXTERN
  853. void regress_test_gerror_callback (RegressTestCallbackGError callback);
  854. _GI_TEST_EXTERN
  855. void regress_test_null_gerror_callback (RegressTestCallbackGError callback);
  856. _GI_TEST_EXTERN
  857. void regress_test_owned_gerror_callback (RegressTestCallbackOwnedGError callback);
  858. _GI_TEST_EXTERN
  859. void regress_test_skip_unannotated_callback (RegressTestCallback callback);
  860. typedef struct _RegressTestInterface RegressTestInterface;
  861. /* interface */
  862. #define REGRESS_TEST_TYPE_INTERFACE (regress_test_interface_get_type ())
  863. #define REGRESS_TEST_INTERFACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), REGRESS_TEST_TYPE_INTERFACE, RegressTestInterface))
  864. #define REGRESS_TEST_IS_INTERFACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), REGRESS_TEST_TYPE_INTERFACE))
  865. #define REGRESS_TEST_INTERFACE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), REGRESS_TEST_TYPE_INTERFACE, RegressTestInterfaceIface))
  866. typedef struct _RegressTestInterfaceIface RegressTestInterfaceIface;
  867. struct _RegressTestInterfaceIface {
  868. GTypeInterface base_iface;
  869. };
  870. _GI_TEST_EXTERN
  871. GType regress_test_interface_get_type (void) G_GNUC_CONST;
  872. /* gobject with non-standard prefix */
  873. #define REGRESS_TEST_TYPE_WI_802_1X (regress_test_wi_802_1x_get_type ())
  874. #define REGRESS_TEST_WI_802_1X(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), REGRESS_TEST_TYPE_WI_802_1X, RegressTestWi8021x))
  875. #define REGRESS_TEST_IS_WI_802_1X(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), REGRESS_TEST_TYPE_WI_802_1X))
  876. #define REGRESS_TEST_WI_802_1X_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), REGRESS_TEST_TYPE_WI_802_1X, RegressTestWi8021xClass))
  877. typedef struct
  878. {
  879. GObject parent_instance;
  880. gboolean testbool;
  881. } RegressTestWi8021x;
  882. typedef struct
  883. {
  884. GObjectClass parent_class;
  885. } RegressTestWi8021xClass;
  886. _GI_TEST_EXTERN
  887. GType regress_test_wi_802_1x_get_type (void);
  888. _GI_TEST_EXTERN
  889. RegressTestWi8021x* regress_test_wi_802_1x_new (void);
  890. _GI_TEST_EXTERN
  891. gboolean regress_test_wi_802_1x_get_testbool (RegressTestWi8021x *obj);
  892. _GI_TEST_EXTERN
  893. void regress_test_wi_802_1x_set_testbool (RegressTestWi8021x *obj, gboolean v);
  894. _GI_TEST_EXTERN
  895. int regress_test_wi_802_1x_static_method (int x);
  896. /* floating gobject */
  897. #define REGRESS_TEST_TYPE_FLOATING (regress_test_floating_get_type ())
  898. #define REGRESS_TEST_FLOATING(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), REGRESS_TEST_TYPE_FLOATING, RegressTestFloating))
  899. #define REGRESS_TEST_IS_FLOATING(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), REGRESS_TEST_TYPE_FLOATING))
  900. #define REGRESS_TEST_FLOATING_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), REGRESS_TEST_TYPE_FLOATING, RegressTestFloatingClass))
  901. typedef struct
  902. {
  903. GInitiallyUnowned parent_instance;
  904. } RegressTestFloating;
  905. typedef struct
  906. {
  907. GInitiallyUnownedClass parent_class;
  908. } RegressTestFloatingClass;
  909. _GI_TEST_EXTERN
  910. GType regress_test_floating_get_type (void);
  911. _GI_TEST_EXTERN
  912. RegressTestFloating* regress_test_floating_new (void);
  913. /* Function signature torture tests */
  914. _GI_TEST_EXTERN
  915. void regress_test_torture_signature_0 (int x,
  916. double *y,
  917. int *z,
  918. const char *foo,
  919. int *q,
  920. guint m);
  921. _GI_TEST_EXTERN
  922. gboolean regress_test_torture_signature_1 (int x,
  923. double *y,
  924. int *z,
  925. const char *foo,
  926. int *q,
  927. guint m,
  928. GError **error);
  929. _GI_TEST_EXTERN
  930. void regress_test_torture_signature_2 (int x,
  931. RegressTestCallbackUserData callback,
  932. gpointer user_data,
  933. GDestroyNotify notify,
  934. double *y,
  935. int *z,
  936. const char *foo,
  937. int *q,
  938. guint m);
  939. _GI_TEST_EXTERN
  940. GValue *regress_test_date_in_gvalue (void);
  941. _GI_TEST_EXTERN
  942. GValue *regress_test_strv_in_gvalue (void);
  943. _GI_TEST_EXTERN
  944. GObject * _regress_this_is_a_private_symbol (void);
  945. _GI_TEST_EXTERN
  946. void regress_test_multiline_doc_comments (void);
  947. _GI_TEST_EXTERN
  948. void regress_test_nested_parameter (int a);
  949. /**
  950. * RegressSkippedStructure: (skip)
  951. *
  952. * This should be skipped, and moreover, all function which
  953. * use it should be.
  954. */
  955. typedef struct
  956. {
  957. int x;
  958. double v;
  959. } RegressSkippedStructure;
  960. _GI_TEST_EXTERN
  961. void regress_random_function_with_skipped_structure (int x,
  962. RegressSkippedStructure *foo,
  963. double v);
  964. /**
  965. * RegressIntset:
  966. *
  967. * Like telepathy-glib's TpIntset.
  968. *
  969. */
  970. typedef struct _RegressIntset RegressIntset;
  971. /**
  972. * RegressIntsetAlias: (skip)
  973. *
  974. * Compatibility typedef, like telepathy-glib's TpIntSet
  975. *
  976. */
  977. typedef RegressIntset RegressIntsetAlias;
  978. /**
  979. * RegressPtrArrayAlias:
  980. *
  981. * Typedef'd GPtrArray for some reason
  982. */
  983. typedef GPtrArray RegressPtrArrayAlias;
  984. _GI_TEST_EXTERN
  985. void regress_introspectable_via_alias (RegressPtrArrayAlias *data);
  986. /**
  987. * RegressVaListAlias:
  988. *
  989. * Typedef'd va_list for additional reasons
  990. */
  991. typedef va_list RegressVaListAlias;
  992. _GI_TEST_EXTERN
  993. void regress_not_introspectable_via_alias (RegressVaListAlias ok);
  994. /**
  995. * RegressAliasedTestBoxed:
  996. *
  997. * Typedef TestBoxed to test caller-allocates correctness
  998. */
  999. typedef RegressTestBoxed RegressAliasedTestBoxed;
  1000. _GI_TEST_EXTERN
  1001. void regress_aliased_caller_alloc (RegressAliasedTestBoxed *boxed);
  1002. /* private testing */
  1003. typedef struct {
  1004. gint this_is_public_before;
  1005. /* < private > */
  1006. gint this_is_private;
  1007. /* < public > */
  1008. gint this_is_public_after;
  1009. } RegressTestPrivateStruct;
  1010. typedef enum {
  1011. REGRESS_TEST_PUBLIC_ENUM_BEFORE = 1 << 0,
  1012. /* <private> */
  1013. REGRESS_TEST_PRIVATE_ENUM = 1 << 1,
  1014. /* <public> */
  1015. REGRESS_TEST_PUBLIC_ENUM_AFTER = 1 << 2,
  1016. } RegressTestPrivateEnum;
  1017. typedef struct {
  1018. gint just_int;
  1019. gint array[10];
  1020. } RegressTestStructFixedArray;
  1021. _GI_TEST_EXTERN
  1022. void regress_test_struct_fixed_array_frob (RegressTestStructFixedArray *str);
  1023. typedef struct {
  1024. gchar name[32];
  1025. } RegressLikeXklConfigItem;
  1026. _GI_TEST_EXTERN
  1027. void regress_like_xkl_config_item_set_name (RegressLikeXklConfigItem *self,
  1028. const char *name);
  1029. #define REGRESS_UTF8_CONSTANT "const \xe2\x99\xa5 utf8"
  1030. #ifdef __GNUC__
  1031. #define REGRESS_TEST_GNUC_EXTENSION_STMT(foo) (G_GNUC_EXTENSION ({ int x[10]; x[5] = 42; x[5]; }))
  1032. #endif
  1033. /* https://bugzilla.gnome.org/show_bug.cgi?id=662888 */
  1034. #define REGRESS_LONG_STRING_CONSTANT \
  1035. "TYPE,VALUE,ENCODING,CHARSET,LANGUAGE,DOM,INTL,POSTAL,PARCEL," \
  1036. "HOME,WORK,PREF,VOICE,FAX,MSG,CELL,PAGER,BBS,MODEM,CAR,ISDN,VIDEO," \
  1037. "AOL,APPLELINK,ATTMAIL,CIS,EWORLD,INTERNET,IBMMAIL,MCIMAIL," \
  1038. "POWERSHARE,PRODIGY,TLX,X400,GIF,CGM,WMF,BMP,MET,PMB,DIB,PICT,TIFF," \
  1039. "PDF,PS,JPEG,QTIME,MPEG,MPEG2,AVI,WAVE,AIFF,PCM,X509,PGP"
  1040. _GI_TEST_EXTERN
  1041. void regress_has_parameter_named_attrs (int foo,
  1042. gpointer attributes);
  1043. typedef struct {
  1044. int dummy;
  1045. struct {
  1046. const char *name;
  1047. guint x;
  1048. } attributes[32];
  1049. double dummy2;
  1050. } RegressLikeGnomeKeyringPasswordSchema;
  1051. /* Ensure we ignore symbols that start with _; in particular we don't
  1052. * want to issue a namespace warning.
  1053. */
  1054. #define _DONTSCANTHIS 1
  1055. /* https://bugzilla.gnome.org/show_bug.cgi?id=685022 */
  1056. #define REGRESS_MININT64 ((gint64) G_GINT64_CONSTANT(0x8000000000000000))
  1057. #define REGRESS_MAXUINT64 (G_GINT64_CONSTANT(0xffffffffffffffffU))
  1058. /* https://bugzilla.gnome.org/show_bug.cgi?id=698367 */
  1059. #ifndef __GI_SCANNER__
  1060. #define REGRESS_DONTSCANTHIS 1
  1061. #else
  1062. #define REGRESS_GI_SCANNER_ELSE 3
  1063. #endif
  1064. #ifndef BLAH
  1065. #ifdef __GI_SCANNER__
  1066. #define REGRESS_GI_SCANNER_IFDEF 3
  1067. #endif
  1068. #endif
  1069. /* This struct is one pattern by which padding can be consumed, if
  1070. * you're willing to take a hard dependency on anonymous unions. */
  1071. typedef struct {
  1072. int x;
  1073. union {
  1074. RegressLikeGnomeKeyringPasswordSchema *a[2];
  1075. guint padding[4];
  1076. };
  1077. } RegressAnAnonymousUnion;
  1078. GVariant *
  1079. regress_get_variant (void);
  1080. #endif /* __GITESTTYPES_H__ */