| 1 |
/* |
| 2 |
SPDX-License-Identifier: GPL-2.0-or-later AND LGPL-2.0-or-later AND MIT |
| 3 |
SPDX-FileCopyrightText: 2008-2013, 2015 Colin Walters <[email protected]> |
| 4 |
SPDX-FileCopyrightText: 2008 Johan Bilien |
| 5 |
SPDX-FileCopyrightText: 2008-2010 Johan Dahlin |
| 6 |
SPDX-FileCopyrightText: 2008 Lucas Almeida Rocha |
| 7 |
SPDX-FileCopyrightText: 2008, 2010 Owen W. Taylor |
| 8 |
SPDX-FileCopyrightText: 2009 Andreas Rottmann <[email protected]> |
| 9 |
SPDX-FileCopyrightText: 2009 Havoc Pennington |
| 10 |
SPDX-FileCopyrightText: 2009-2010 litl, LLC |
| 11 |
SPDX-FileCopyrightText: 2009 Mark Lee |
| 12 |
SPDX-FileCopyrightText: 2009, 2011 Maxim Ermilov |
| 13 |
SPDX-FileCopyrightText: 2009 Simon van der Linden |
| 14 |
SPDX-FileCopyrightText: 2009-2010 Sugar Labs |
| 15 |
SPDX-FileCopyrightText: 2010-2012, 2015 Collabora, Ltd. |
| 16 |
SPDX-FileCopyrightText: 2010 Jonathan Matthew |
| 17 |
SPDX-FileCopyrightText: 2010 Zach Goldberg |
| 18 |
SPDX-FileCopyrightText: 2011-2012, 2014 Giovanni Campagna |
| 19 |
SPDX-FileCopyrightText: 2011-2012 Martin Pitt |
| 20 |
SPDX-FileCopyrightText: 2011 Pavel Holejsovsky |
| 21 |
SPDX-FileCopyrightText: 2011, 2024 Red Hat, Inc. |
| 22 |
SPDX-FileCopyrightText: 2011-2012 Torsten Schönfeld |
| 23 |
SPDX-FileCopyrightText: 2011 Xavier Claessens |
| 24 |
SPDX-FileCopyrightText: 2012 Alban Browaeys |
| 25 |
SPDX-FileCopyrightText: 2012 Bastian Winkler |
| 26 |
SPDX-FileCopyrightText: 2012 Canonical Ltd. |
| 27 |
SPDX-FileCopyrightText: 2012 Coeus Group |
| 28 |
SPDX-FileCopyrightText: 2012 Dieter Verfaillie |
| 29 |
SPDX-FileCopyrightText: 2012-2013 Jasper St. Pierre |
| 30 |
SPDX-FileCopyrightText: 2012 Jon Nordby |
| 31 |
SPDX-FileCopyrightText: 2012 Krzesimir Nowak |
| 32 |
SPDX-FileCopyrightText: 2012 Paolo Borelli |
| 33 |
SPDX-FileCopyrightText: 2012, 2014 Simon Feltman |
| 34 |
SPDX-FileCopyrightText: 2013, 2019, 2021-2022 Emmanuele Bassi |
| 35 |
SPDX-FileCopyrightText: 2013 Florian Müllner |
| 36 |
SPDX-FileCopyrightText: 2013 Stef Walter |
| 37 |
SPDX-FileCopyrightText: 2014-2015 RIFT.io, Inc. |
| 38 |
SPDX-FileCopyrightText: 2015 Ben Iofel |
| 39 |
SPDX-FileCopyrightText: 2015 Christoph Reiter |
| 40 |
SPDX-FileCopyrightText: 2015 Debarshi Ray |
| 41 |
SPDX-FileCopyrightText: 2016 Intel |
| 42 |
SPDX-FileCopyrightText: 2016 Lionel Landwerlin |
| 43 |
SPDX-FileCopyrightText: 2017 Endless Mobile, Inc. |
| 44 |
SPDX-FileCopyrightText: 2016-2019, 2024 Philip Chimento <[email protected]> |
| 45 |
SPDX-FileCopyrightText: 2017 Rico Tzschichholz |
| 46 |
SPDX-FileCopyrightText: 2018-2019 Tomasz Miąsko |
| 47 |
SPDX-FileCopyrightText: 2020 Centricular |
| 48 |
SPDX-FileCopyrightText: 2021, 2023 Marco Trevisan |
| 49 |
SPDX-FileCopyrightText: 2022 Lubomir Rintel |
| 50 |
SPDX-FileCopyrightText: 2023-2024 Simon McVittie |
| 51 |
SPDX-FileCopyrightText: 2023 Evan Welsh |
| 52 |
*/ |
| 53 |
|
| 54 |
#pragma once |
| 55 |
|
| 56 |
#include <stdarg.h> |
| 57 |
#include <sys/types.h> |
| 58 |
|
| 59 |
#include <gio/gio.h> |
| 60 |
#include <glib-object.h> |
| 61 |
#include <glib.h> |
| 62 |
|
| 63 |
#ifndef GI_TEST_DISABLE_CAIRO |
| 64 |
#include <cairo.h> |
| 65 |
#endif /* GI_TEST_DISABLE_CAIRO */ |
| 66 |
|
| 67 |
#include "gitestmacros.h" |
| 68 |
|
| 69 |
GI_TEST_EXTERN |
| 70 |
void regress_set_abort_on_error (gboolean abort_on_error); |
| 71 |
|
| 72 |
/* return annotations */ |
| 73 |
GI_TEST_EXTERN |
| 74 |
char *regress_test_return_allow_none (void); |
| 75 |
|
| 76 |
GI_TEST_EXTERN |
| 77 |
char *regress_test_return_nullable (void); |
| 78 |
|
| 79 |
/* basic types */ |
| 80 |
GI_TEST_EXTERN |
| 81 |
gboolean regress_test_boolean (gboolean in); |
| 82 |
|
| 83 |
GI_TEST_EXTERN |
| 84 |
gboolean regress_test_boolean_true (gboolean in); |
| 85 |
|
| 86 |
GI_TEST_EXTERN |
| 87 |
gboolean regress_test_boolean_false (gboolean in); |
| 88 |
|
| 89 |
GI_TEST_EXTERN |
| 90 |
gint8 regress_test_int8 (gint8 in); |
| 91 |
|
| 92 |
GI_TEST_EXTERN |
| 93 |
guint8 regress_test_uint8 (guint8 in); |
| 94 |
|
| 95 |
GI_TEST_EXTERN |
| 96 |
gint16 regress_test_int16 (gint16 in); |
| 97 |
|
| 98 |
GI_TEST_EXTERN |
| 99 |
guint16 regress_test_uint16 (guint16 in); |
| 100 |
|
| 101 |
GI_TEST_EXTERN |
| 102 |
gint32 regress_test_int32 (gint32 in); |
| 103 |
|
| 104 |
GI_TEST_EXTERN |
| 105 |
guint32 regress_test_uint32 (guint32 in); |
| 106 |
|
| 107 |
GI_TEST_EXTERN |
| 108 |
gint64 regress_test_int64 (gint64 in); |
| 109 |
|
| 110 |
GI_TEST_EXTERN |
| 111 |
guint64 regress_test_uint64 (guint64 in); |
| 112 |
|
| 113 |
GI_TEST_EXTERN |
| 114 |
gshort regress_test_short (gshort in); |
| 115 |
|
| 116 |
GI_TEST_EXTERN |
| 117 |
gushort regress_test_ushort (gushort in); |
| 118 |
|
| 119 |
GI_TEST_EXTERN |
| 120 |
gint regress_test_int (gint in); |
| 121 |
|
| 122 |
GI_TEST_EXTERN |
| 123 |
guint regress_test_uint (guint in); |
| 124 |
|
| 125 |
GI_TEST_EXTERN |
| 126 |
glong regress_test_long (glong in); |
| 127 |
|
| 128 |
GI_TEST_EXTERN |
| 129 |
gulong regress_test_ulong (gulong in); |
| 130 |
|
| 131 |
GI_TEST_EXTERN |
| 132 |
gssize regress_test_ssize (gssize in); |
| 133 |
|
| 134 |
GI_TEST_EXTERN |
| 135 |
gsize regress_test_size (gsize in); |
| 136 |
|
| 137 |
GI_TEST_EXTERN |
| 138 |
gfloat regress_test_float (gfloat in); |
| 139 |
|
| 140 |
GI_TEST_EXTERN |
| 141 |
gdouble regress_test_double (gdouble in); |
| 142 |
|
| 143 |
GI_TEST_EXTERN |
| 144 |
gunichar regress_test_unichar (gunichar in); |
| 145 |
|
| 146 |
GI_TEST_EXTERN |
| 147 |
time_t regress_test_timet (time_t in); |
| 148 |
|
| 149 |
GI_TEST_EXTERN |
| 150 |
off_t regress_test_offt (off_t in); |
| 151 |
|
| 152 |
GI_TEST_EXTERN |
| 153 |
GType regress_test_gtype (GType in); |
| 154 |
|
| 155 |
/* utf8 */ |
| 156 |
GI_TEST_EXTERN |
| 157 |
const char *regress_test_utf8_const_return (void); |
| 158 |
|
| 159 |
GI_TEST_EXTERN |
| 160 |
char *regress_test_utf8_nonconst_return (void); |
| 161 |
|
| 162 |
GI_TEST_EXTERN |
| 163 |
void regress_test_utf8_const_in (const char *in); |
| 164 |
|
| 165 |
GI_TEST_EXTERN |
| 166 |
void regress_test_utf8_out (char **out); |
| 167 |
|
| 168 |
GI_TEST_EXTERN |
| 169 |
void regress_test_utf8_inout (char **inout); |
| 170 |
|
| 171 |
GI_TEST_EXTERN |
| 172 |
GSList *regress_test_filename_return (void); |
| 173 |
|
| 174 |
GI_TEST_EXTERN |
| 175 |
void regress_test_utf8_null_in (char *in); |
| 176 |
|
| 177 |
GI_TEST_EXTERN |
| 178 |
void regress_test_utf8_null_out (char **char_out); |
| 179 |
|
| 180 |
/* in arguments after out arguments */ |
| 181 |
GI_TEST_EXTERN |
| 182 |
void regress_test_int_out_utf8 (int *length, const char *in); |
| 183 |
|
| 184 |
/* multiple output arguments */ |
| 185 |
|
| 186 |
GI_TEST_EXTERN |
| 187 |
void regress_test_multi_double_args (gdouble in, gdouble *one, gdouble *two); |
| 188 |
|
| 189 |
GI_TEST_EXTERN |
| 190 |
void regress_test_utf8_out_out (char **out0, char **out1); |
| 191 |
|
| 192 |
GI_TEST_EXTERN |
| 193 |
char *regress_test_utf8_out_nonconst_return (char **out); |
| 194 |
|
| 195 |
/* non-basic-types */ |
| 196 |
/* array */ |
| 197 |
GI_TEST_EXTERN |
| 198 |
gboolean regress_test_strv_in (char **arr); |
| 199 |
|
| 200 |
GI_TEST_EXTERN |
| 201 |
int regress_test_array_int_in (int n_ints, int *ints); |
| 202 |
|
| 203 |
GI_TEST_EXTERN |
| 204 |
void regress_test_array_int_out (int *n_ints, int **ints); |
| 205 |
|
| 206 |
GI_TEST_EXTERN |
| 207 |
void regress_test_array_int_inout (int *n_ints, int **ints); |
| 208 |
|
| 209 |
GI_TEST_EXTERN |
| 210 |
int regress_test_array_gint8_in (int n_ints, gint8 *ints); |
| 211 |
|
| 212 |
GI_TEST_EXTERN |
| 213 |
int regress_test_array_gint16_in (int n_ints, gint16 *ints); |
| 214 |
|
| 215 |
GI_TEST_EXTERN |
| 216 |
gint32 regress_test_array_gint32_in (int n_ints, gint32 *ints); |
| 217 |
|
| 218 |
GI_TEST_EXTERN |
| 219 |
gint64 regress_test_array_gint64_in (int n_ints, gint64 *ints); |
| 220 |
|
| 221 |
GI_TEST_EXTERN |
| 222 |
char *regress_test_array_gtype_in (int n_types, GType *types); |
| 223 |
|
| 224 |
GI_TEST_EXTERN |
| 225 |
const char **regress_test_strv_out_container (void); |
| 226 |
|
| 227 |
GI_TEST_EXTERN |
| 228 |
char **regress_test_strv_out (void); |
| 229 |
|
| 230 |
GI_TEST_EXTERN |
| 231 |
const char *const *regress_test_strv_out_c (void); |
| 232 |
|
| 233 |
GI_TEST_EXTERN |
| 234 |
void regress_test_strv_outarg (const char ***retp); |
| 235 |
|
| 236 |
GI_TEST_EXTERN |
| 237 |
int regress_test_array_fixed_size_int_in (int *ints); |
| 238 |
|
| 239 |
GI_TEST_EXTERN |
| 240 |
void regress_test_array_fixed_size_int_out (int **ints); |
| 241 |
|
| 242 |
GI_TEST_EXTERN |
| 243 |
int *regress_test_array_fixed_size_int_return (void); |
| 244 |
|
| 245 |
/* transfer tests */ |
| 246 |
GI_TEST_EXTERN |
| 247 |
int *regress_test_array_int_full_out (int *len); |
| 248 |
|
| 249 |
GI_TEST_EXTERN |
| 250 |
int *regress_test_array_int_none_out (int *len); |
| 251 |
|
| 252 |
GI_TEST_EXTERN |
| 253 |
void regress_test_array_int_null_in (int *arr, int len); |
| 254 |
|
| 255 |
GI_TEST_EXTERN |
| 256 |
void regress_test_array_int_null_out (int **arr, int *len); |
| 257 |
|
| 258 |
/* interface */ |
| 259 |
/* GList */ |
| 260 |
GI_TEST_EXTERN |
| 261 |
const GList *regress_test_glist_nothing_return (void); |
| 262 |
|
| 263 |
GI_TEST_EXTERN |
| 264 |
GList *regress_test_glist_nothing_return2 (void); |
| 265 |
|
| 266 |
GI_TEST_EXTERN |
| 267 |
GList *regress_test_glist_container_return (void); |
| 268 |
|
| 269 |
GI_TEST_EXTERN |
| 270 |
GList *regress_test_glist_everything_return (void); |
| 271 |
|
| 272 |
GI_TEST_EXTERN |
| 273 |
void regress_test_glist_gtype_container_in (GList *in); |
| 274 |
|
| 275 |
GI_TEST_EXTERN |
| 276 |
void regress_test_glist_nothing_in (const GList *in); |
| 277 |
|
| 278 |
GI_TEST_EXTERN |
| 279 |
void regress_test_glist_nothing_in2 (GList *in); |
| 280 |
|
| 281 |
GI_TEST_EXTERN |
| 282 |
void regress_test_glist_null_in (GList *in); |
| 283 |
|
| 284 |
GI_TEST_EXTERN |
| 285 |
void regress_test_glist_null_out (GList **out_list); |
| 286 |
|
| 287 |
/* GSList */ |
| 288 |
GI_TEST_EXTERN |
| 289 |
const GSList *regress_test_gslist_nothing_return (void); |
| 290 |
|
| 291 |
GI_TEST_EXTERN |
| 292 |
GSList *regress_test_gslist_nothing_return2 (void); |
| 293 |
|
| 294 |
GI_TEST_EXTERN |
| 295 |
GSList *regress_test_gslist_container_return (void); |
| 296 |
|
| 297 |
GI_TEST_EXTERN |
| 298 |
GSList *regress_test_gslist_everything_return (void); |
| 299 |
|
| 300 |
GI_TEST_EXTERN |
| 301 |
void regress_test_gslist_nothing_in (const GSList *in); |
| 302 |
|
| 303 |
GI_TEST_EXTERN |
| 304 |
void regress_test_gslist_nothing_in2 (GSList *in); |
| 305 |
|
| 306 |
GI_TEST_EXTERN |
| 307 |
void regress_test_gslist_null_in (GSList *in); |
| 308 |
|
| 309 |
GI_TEST_EXTERN |
| 310 |
void regress_test_gslist_null_out (GSList **out_list); |
| 311 |
|
| 312 |
/* GHashTable */ |
| 313 |
GI_TEST_EXTERN |
| 314 |
const GHashTable *regress_test_ghash_null_return (void); |
| 315 |
|
| 316 |
GI_TEST_EXTERN |
| 317 |
const GHashTable *regress_test_ghash_nothing_return (void); |
| 318 |
|
| 319 |
GI_TEST_EXTERN |
| 320 |
GHashTable *regress_test_ghash_nothing_return2 (void); |
| 321 |
|
| 322 |
GI_TEST_EXTERN |
| 323 |
GHashTable *regress_test_ghash_gvalue_return (void); |
| 324 |
|
| 325 |
GI_TEST_EXTERN |
| 326 |
void regress_test_ghash_gvalue_in (GHashTable *hash); |
| 327 |
|
| 328 |
GI_TEST_EXTERN |
| 329 |
GHashTable *regress_test_ghash_container_return (void); |
| 330 |
|
| 331 |
GI_TEST_EXTERN |
| 332 |
GHashTable *regress_test_ghash_everything_return (void); |
| 333 |
|
| 334 |
GI_TEST_EXTERN |
| 335 |
void regress_test_ghash_null_in (const GHashTable *in); |
| 336 |
|
| 337 |
GI_TEST_EXTERN |
| 338 |
void regress_test_ghash_null_out (const GHashTable **out); |
| 339 |
|
| 340 |
GI_TEST_EXTERN |
| 341 |
void regress_test_ghash_nothing_in (const GHashTable *in); |
| 342 |
|
| 343 |
GI_TEST_EXTERN |
| 344 |
void regress_test_ghash_nothing_in2 (GHashTable *in); |
| 345 |
|
| 346 |
GI_TEST_EXTERN |
| 347 |
GHashTable *regress_test_ghash_nested_everything_return (void); |
| 348 |
|
| 349 |
GI_TEST_EXTERN |
| 350 |
GHashTable *regress_test_ghash_nested_everything_return2 (void); |
| 351 |
|
| 352 |
/* GPtrArray */ |
| 353 |
GI_TEST_EXTERN |
| 354 |
GPtrArray *regress_test_garray_container_return (void); |
| 355 |
|
| 356 |
GI_TEST_EXTERN |
| 357 |
GPtrArray *regress_test_garray_full_return (void); |
| 358 |
|
| 359 |
/* error? */ |
| 360 |
|
| 361 |
/* closure */ |
| 362 |
GI_TEST_EXTERN |
| 363 |
int regress_test_closure (GClosure *closure); |
| 364 |
|
| 365 |
GI_TEST_EXTERN |
| 366 |
int regress_test_closure_one_arg (GClosure *closure, int arg); |
| 367 |
|
| 368 |
GI_TEST_EXTERN |
| 369 |
GVariant *regress_test_closure_variant (GClosure *closure, GVariant *arg); |
| 370 |
|
| 371 |
/* value */ |
| 372 |
GI_TEST_EXTERN |
| 373 |
int regress_test_int_value_arg (const GValue *v); |
| 374 |
|
| 375 |
GI_TEST_EXTERN |
| 376 |
const GValue *regress_test_value_return (int i); |
| 377 |
|
| 378 |
/* foreign structs */ |
| 379 |
#ifndef GI_TEST_DISABLE_CAIRO |
| 380 |
GI_TEST_EXTERN |
| 381 |
cairo_t *regress_test_cairo_context_full_return (void); |
| 382 |
|
| 383 |
GI_TEST_EXTERN |
| 384 |
void regress_test_cairo_context_none_in (cairo_t *context); |
| 385 |
|
| 386 |
GI_TEST_EXTERN |
| 387 |
cairo_surface_t *regress_test_cairo_surface_none_return (void); |
| 388 |
|
| 389 |
GI_TEST_EXTERN |
| 390 |
cairo_surface_t *regress_test_cairo_surface_full_return (void); |
| 391 |
|
| 392 |
GI_TEST_EXTERN |
| 393 |
void regress_test_cairo_surface_none_in (cairo_surface_t *surface); |
| 394 |
|
| 395 |
GI_TEST_EXTERN |
| 396 |
void regress_test_cairo_surface_full_out (cairo_surface_t **surface); |
| 397 |
#endif /* GI_TEST_DISABLE_CAIRO */ |
| 398 |
|
| 399 |
/* versioning (deprecated, since, stability) */ |
| 400 |
GI_TEST_EXTERN |
| 401 |
void regress_test_versioning (void); |
| 402 |
|
| 403 |
GI_TEST_EXTERN |
| 404 |
GVariant *regress_test_gvariant_i (void); |
| 405 |
|
| 406 |
GI_TEST_EXTERN |
| 407 |
GVariant *regress_test_gvariant_s (void); |
| 408 |
|
| 409 |
GI_TEST_EXTERN |
| 410 |
GVariant *regress_test_gvariant_asv (void); |
| 411 |
|
| 412 |
GI_TEST_EXTERN |
| 413 |
GVariant *regress_test_gvariant_v (void); |
| 414 |
|
| 415 |
GI_TEST_EXTERN |
| 416 |
GVariant *regress_test_gvariant_as (void); |
| 417 |
|
| 418 |
/* enums / flags */ |
| 419 |
|
| 420 |
#define NUM_REGRESS_FOO |
| 421 |
|
| 422 |
/** |
| 423 |
* RegressTestEnum: |
| 424 |
* @REGRESS_TEST_VALUE1: value 1 |
| 425 |
* @REGRESS_TEST_VALUE2: value 2 |
| 426 |
* |
| 427 |
* By purpose, not all members have documentation |
| 428 |
*/ |
| 429 |
typedef enum |
| 430 |
{ |
| 431 |
REGRESS_TEST_VALUE1, |
| 432 |
REGRESS_TEST_VALUE2, |
| 433 |
REGRESS_TEST_VALUE3 = -1, |
| 434 |
REGRESS_TEST_VALUE4 = '0', |
| 435 |
REGRESS_TEST_VALUE5 |
| 436 |
} RegressTestEnum; |
| 437 |
|
| 438 |
typedef enum |
| 439 |
{ |
| 440 |
REGRESS_TEST_UNSIGNED_VALUE1 = 1, |
| 441 |
REGRESS_TEST_UNSIGNED_VALUE2 = 0x80000000 |
| 442 |
} RegressTestEnumUnsigned; |
| 443 |
|
| 444 |
typedef enum |
| 445 |
{ |
| 446 |
REGRESS_TEST_FLAG1 = 1 << 0, |
| 447 |
REGRESS_TEST_FLAG2 = 1 << 1, |
| 448 |
REGRESS_TEST_FLAG3 = 1 << 2, |
| 449 |
} RegressTestFlags; |
| 450 |
|
| 451 |
typedef enum |
| 452 |
{ |
| 453 |
REGRESS_TEST_DISCONTINUOUS_FLAG1 = 1 << 9, |
| 454 |
REGRESS_TEST_DISCONTINUOUS_FLAG2 = 1 << 29 |
| 455 |
} RegressTestDiscontinuousFlags; |
| 456 |
|
| 457 |
GI_TEST_EXTERN |
| 458 |
GType regress_test_discontinuous_flags_get_type (void) G_GNUC_CONST; |
| 459 |
#define REGRESS_TEST_TYPE_DISCONTINUOUS_FLAGS (regress_test_discontinuous_flags_get_type ()) |
| 460 |
|
| 461 |
GI_TEST_EXTERN |
| 462 |
RegressTestDiscontinuousFlags |
| 463 |
regress_test_discontinuous_1_with_private_values (void); |
| 464 |
|
| 465 |
GI_TEST_EXTERN |
| 466 |
RegressTestDiscontinuousFlags |
| 467 |
regress_test_discontinuous_2_with_private_values (void); |
| 468 |
|
| 469 |
GI_TEST_EXTERN |
| 470 |
GType regress_test_enum_get_type (void) G_GNUC_CONST; |
| 471 |
#define REGRESS_TEST_TYPE_ENUM (regress_test_enum_get_type ()) |
| 472 |
|
| 473 |
GI_TEST_EXTERN |
| 474 |
GType regress_test_enum_unsigned_get_type (void) G_GNUC_CONST; |
| 475 |
#define REGRESS_TEST_TYPE_ENUM_UNSIGNED (regress_test_enum_unsigned_get_type ()) |
| 476 |
|
| 477 |
GI_TEST_EXTERN |
| 478 |
GType regress_test_flags_get_type (void) G_GNUC_CONST; |
| 479 |
#define REGRESS_TEST_TYPE_FLAGS (regress_test_flags_get_type ()) |
| 480 |
|
| 481 |
typedef enum |
| 482 |
{ |
| 483 |
REGRESS_TEST_REFERENCE_ZERO = 2 + 2, |
| 484 |
REGRESS_TEST_REFERENCE_ONE = 1 + 1, |
| 485 |
REGRESS_TEST_REFERENCE_TWO = 6 * 9, |
| 486 |
REGRESS_TEST_REFERENCE_THREE = REGRESS_TEST_REFERENCE_ONE + REGRESS_TEST_REFERENCE_ONE, |
| 487 |
REGRESS_TEST_REFERENCE_FOUR = REGRESS_TEST_REFERENCE_TWO * REGRESS_TEST_REFERENCE_THREE, |
| 488 |
REGRESS_TEST_REFERENCE_FIVE = ~REGRESS_TEST_REFERENCE_FOUR, |
| 489 |
} RegressTestReferenceEnum; |
| 490 |
|
| 491 |
/* this is not registered with GType */ |
| 492 |
typedef enum |
| 493 |
{ |
| 494 |
REGRESS_TEST_EVALUE1, |
| 495 |
REGRESS_TEST_EVALUE2 = 42, |
| 496 |
REGRESS_TEST_EVALUE3 = '0' |
| 497 |
} RegressTestEnumNoGEnum; |
| 498 |
|
| 499 |
/** |
| 500 |
* REGRESS_TEST_EVALUE_DEPRECATED: |
| 501 |
* |
| 502 |
* Scanner used to replace %REGRESS_TEST_EVALUE1 with %REGRESS_TEST_EVALUE_DEPRECATED. |
| 503 |
*/ |
| 504 |
#define REGRESS_TEST_EVALUE_DEPRECATED REGRESS_TEST_EVALUE1 |
| 505 |
|
| 506 |
GI_TEST_EXTERN |
| 507 |
const gchar *regress_test_enum_param (RegressTestEnum e); |
| 508 |
|
| 509 |
GI_TEST_EXTERN |
| 510 |
const gchar *regress_test_unsigned_enum_param (RegressTestEnumUnsigned e); |
| 511 |
|
| 512 |
GI_TEST_EXTERN |
| 513 |
void regress_global_get_flags_out (RegressTestFlags *v); |
| 514 |
|
| 515 |
/* error domains */ |
| 516 |
|
| 517 |
typedef enum |
| 518 |
{ |
| 519 |
REGRESS_TEST_ERROR_CODE1 = 1, |
| 520 |
REGRESS_TEST_ERROR_CODE2 = 2, |
| 521 |
REGRESS_TEST_ERROR_CODE3 = 3 |
| 522 |
} RegressTestError; |
| 523 |
|
| 524 |
GI_TEST_EXTERN |
| 525 |
GType regress_test_error_get_type (void); |
| 526 |
|
| 527 |
GI_TEST_EXTERN |
| 528 |
GQuark regress_test_error_quark (void); |
| 529 |
|
| 530 |
/* Test weird names, with and without |
| 531 |
c_symbol_prefix given by a GType |
| 532 |
*/ |
| 533 |
typedef enum |
| 534 |
{ |
| 535 |
REGRESS_TEST_ABC_ERROR_CODE1 = 1, |
| 536 |
REGRESS_TEST_ABC_ERROR_CODE2 = 2, |
| 537 |
REGRESS_TEST_ABC_ERROR_CODE3 = 3 |
| 538 |
} RegressTestABCError; |
| 539 |
|
| 540 |
GI_TEST_EXTERN |
| 541 |
GType regress_test_abc_error_get_type (void); |
| 542 |
|
| 543 |
GI_TEST_EXTERN |
| 544 |
GQuark regress_test_abc_error_quark (void); |
| 545 |
|
| 546 |
typedef enum |
| 547 |
{ |
| 548 |
REGRESS_TEST_OTHER_ERROR_CODE1 = 1, |
| 549 |
REGRESS_TEST_OTHER_ERROR_CODE2 = 2, |
| 550 |
REGRESS_TEST_OTHER_ERROR_CODE3 = 3 |
| 551 |
} RegressTestOtherError; |
| 552 |
|
| 553 |
/* This returns a GType for RegressTestOtherError. |
| 554 |
The difference is intentional, although it |
| 555 |
is mainly meant for capitalization problems. |
| 556 |
*/ |
| 557 |
GI_TEST_EXTERN |
| 558 |
GType regress_test_unconventional_error_get_type (void); |
| 559 |
|
| 560 |
GI_TEST_EXTERN |
| 561 |
GQuark regress_test_unconventional_error_quark (void); |
| 562 |
|
| 563 |
typedef enum |
| 564 |
{ |
| 565 |
REGRESS_TEST_DEF_ERROR_CODE0 = 0, |
| 566 |
REGRESS_TEST_DEF_ERROR_CODE1 = 1, |
| 567 |
REGRESS_TEST_DEF_ERROR_CODE2 = 2 |
| 568 |
} RegressTestDEFError; |
| 569 |
|
| 570 |
GI_TEST_EXTERN |
| 571 |
GQuark regress_test_def_error_quark (void); |
| 572 |
|
| 573 |
/* the scanner used to have problem |
| 574 |
with two uppercase letter right after |
| 575 |
the identifier prefix, that's why |
| 576 |
we break the RegressTest convention */ |
| 577 |
typedef enum |
| 578 |
{ |
| 579 |
REGRESS_ATEST_ERROR_CODE0 = 0, |
| 580 |
REGRESS_ATEST_ERROR_CODE1 = 1, |
| 581 |
REGRESS_ATEST_ERROR_CODE2 = 2 |
| 582 |
} RegressATestError; |
| 583 |
|
| 584 |
GI_TEST_EXTERN |
| 585 |
GQuark regress_atest_error_quark (void); |
| 586 |
|
| 587 |
/* constants */ |
| 588 |
|
| 589 |
#define REGRESS_NEGATIVE_INT_CONSTANT -42 |
| 590 |
#define REGRESS_INT_CONSTANT 4422 |
| 591 |
#define REGRESS_DOUBLE_CONSTANT 44.22 |
| 592 |
#define REGRESS_STRING_CONSTANT "Some String" |
| 593 |
#define REGRESS_Mixed_Case_Constant 4423 |
| 594 |
#define REGRESS_BOOL_CONSTANT TRUE |
| 595 |
#define REGRESS_G_GINT64_CONSTANT (G_GINT64_CONSTANT (1000)) |
| 596 |
#define REGRESS_GUINT64_CONSTANT ((guint64) - 1) |
| 597 |
#define REGRESS_GOOD_EXPR_CONSTANT (1 + 2 * (3 + 2) << 13 - 4 >> REGRESS_ATEST_ERROR_CODE2) |
| 598 |
#define REGRESS_BAD_EXPR_CONSTANT (1 + SOMETHING_UNDEFINED) |
| 599 |
|
| 600 |
typedef guint64 RegressTestTypeGUInt64; |
| 601 |
#define REGRESS_GUINT64_CONSTANTA ((RegressTestTypeGUInt64) - 1) |
| 602 |
|
| 603 |
/* structures */ |
| 604 |
typedef struct _RegressTestStructA RegressTestStructA; |
| 605 |
typedef struct _RegressTestStructB RegressTestStructB; |
| 606 |
typedef struct _RegressTestStructC RegressTestStructC; |
| 607 |
typedef struct _RegressTestStructD RegressTestStructD; |
| 608 |
typedef struct _RegressTestStructF RegressTestStructF; |
| 609 |
|
| 610 |
struct _RegressTestStructA |
| 611 |
{ |
| 612 |
gint some_int; |
| 613 |
gint8 some_int8; |
| 614 |
gdouble some_double; |
| 615 |
RegressTestEnum some_enum; |
| 616 |
}; |
| 617 |
|
| 618 |
GI_TEST_EXTERN |
| 619 |
void regress_test_struct_a_clone (RegressTestStructA *a, |
| 620 |
RegressTestStructA *a_out); |
| 621 |
|
| 622 |
GI_TEST_EXTERN |
| 623 |
void regress_test_struct_a_parse (RegressTestStructA *a_out, const gchar *string); |
| 624 |
|
| 625 |
GI_TEST_EXTERN |
| 626 |
void regress_test_array_struct_out (RegressTestStructA **arr, int *len); |
| 627 |
|
| 628 |
struct _RegressTestStructB |
| 629 |
{ |
| 630 |
gint8 some_int8; |
| 631 |
RegressTestStructA nested_a; |
| 632 |
}; |
| 633 |
|
| 634 |
GI_TEST_EXTERN |
| 635 |
void regress_test_struct_b_clone (RegressTestStructB *b, |
| 636 |
RegressTestStructB *b_out); |
| 637 |
|
| 638 |
/* This one has a non-basic member */ |
| 639 |
struct _RegressTestStructC |
| 640 |
{ |
| 641 |
gint another_int; |
| 642 |
GObject *obj; |
| 643 |
}; |
| 644 |
|
| 645 |
/* This one has annotated fields */ |
| 646 |
/** |
| 647 |
* RegressTestStructD: |
| 648 |
* @array1: (array zero-terminated=1): |
| 649 |
* @array2: (array zero-terminated=1) (element-type RegressTestObj): |
| 650 |
* @field: (type RegressTestObj): |
| 651 |
* @list: (element-type RegressTestObj): |
| 652 |
* @garray: (element-type RegressTestObj): |
| 653 |
* @ref_count: |
| 654 |
*/ |
| 655 |
struct _RegressTestStructD |
| 656 |
{ |
| 657 |
RegressTestStructA **array1; |
| 658 |
gpointer *array2; |
| 659 |
gpointer field; |
| 660 |
GList *list; |
| 661 |
GPtrArray *garray; |
| 662 |
}; |
| 663 |
|
| 664 |
/* This one has an array of anonymous unions, inspired by GValue */ |
| 665 |
struct RegressTestStructE |
| 666 |
{ |
| 667 |
GType some_type; |
| 668 |
union |
| 669 |
{ |
| 670 |
gint v_int; |
| 671 |
guint v_uint; |
| 672 |
glong v_long; |
| 673 |
gulong v_ulong; |
| 674 |
gint64 v_int64; |
| 675 |
guint64 v_uint64; |
| 676 |
gfloat v_float; |
| 677 |
gdouble v_double; |
| 678 |
gpointer v_pointer; |
| 679 |
} some_union[2]; |
| 680 |
}; |
| 681 |
|
| 682 |
/* This one has members with const or volatile modifiers. */ |
| 683 |
struct _RegressTestStructF |
| 684 |
{ |
| 685 |
volatile gint ref_count; |
| 686 |
const gint *data1; |
| 687 |
const gint *const data2; |
| 688 |
const gint *const *const data3; |
| 689 |
const gint **const *data4; |
| 690 |
volatile gint *const data5; |
| 691 |
const gint *volatile data6; |
| 692 |
volatile unsigned const char data7; |
| 693 |
}; |
| 694 |
|
| 695 |
/* plain-old-data boxed types */ |
| 696 |
typedef struct _RegressTestSimpleBoxedA RegressTestSimpleBoxedA; |
| 697 |
typedef struct _RegressTestSimpleBoxedB RegressTestSimpleBoxedB; |
| 698 |
|
| 699 |
/** |
| 700 |
* RegressTestSimpleBoxedA: (copy-func regress_test_simple_boxed_a_copy) |
| 701 |
* @some_int: |
| 702 |
* @some_int8: |
| 703 |
* @some_double: |
| 704 |
* @some_enum: |
| 705 |
* |
| 706 |
* ... |
| 707 |
*/ |
| 708 |
struct _RegressTestSimpleBoxedA |
| 709 |
{ |
| 710 |
gint some_int; |
| 711 |
gint8 some_int8; |
| 712 |
gdouble some_double; |
| 713 |
RegressTestEnum some_enum; |
| 714 |
}; |
| 715 |
|
| 716 |
/* Intentionally uses _get_gtype */ |
| 717 |
GI_TEST_EXTERN |
| 718 |
GType regress_test_simple_boxed_a_get_gtype (void); |
| 719 |
|
| 720 |
GI_TEST_EXTERN |
| 721 |
RegressTestSimpleBoxedA *regress_test_simple_boxed_a_copy (RegressTestSimpleBoxedA *a); |
| 722 |
|
| 723 |
GI_TEST_EXTERN |
| 724 |
gboolean regress_test_simple_boxed_a_equals (RegressTestSimpleBoxedA *a, |
| 725 |
RegressTestSimpleBoxedA *other_a); |
| 726 |
|
| 727 |
GI_TEST_EXTERN |
| 728 |
const RegressTestSimpleBoxedA *regress_test_simple_boxed_a_const_return (void); |
| 729 |
|
| 730 |
struct _RegressTestSimpleBoxedB |
| 731 |
{ |
| 732 |
gint8 some_int8; |
| 733 |
RegressTestSimpleBoxedA nested_a; |
| 734 |
}; |
| 735 |
|
| 736 |
GI_TEST_EXTERN |
| 737 |
GType regress_test_simple_boxed_b_get_type (void); |
| 738 |
|
| 739 |
GI_TEST_EXTERN |
| 740 |
RegressTestSimpleBoxedB *regress_test_simple_boxed_b_copy (RegressTestSimpleBoxedB *b); |
| 741 |
|
| 742 |
/* opaque boxed */ |
| 743 |
#define REGRESS_TEST_TYPE_BOXED (regress_test_boxed_get_type ()) |
| 744 |
|
| 745 |
typedef struct _RegressTestBoxed RegressTestBoxed; |
| 746 |
typedef struct _RegressTestBoxedPrivate RegressTestBoxedPrivate; |
| 747 |
|
| 748 |
struct _RegressTestBoxed |
| 749 |
{ |
| 750 |
gint8 some_int8; |
| 751 |
RegressTestSimpleBoxedA nested_a; |
| 752 |
|
| 753 |
RegressTestBoxedPrivate *priv; |
| 754 |
}; |
| 755 |
|
| 756 |
GI_TEST_EXTERN |
| 757 |
GType regress_test_boxed_get_type (void); |
| 758 |
|
| 759 |
GI_TEST_EXTERN |
| 760 |
RegressTestBoxed *regress_test_boxed_new (void); |
| 761 |
|
| 762 |
GI_TEST_EXTERN |
| 763 |
RegressTestBoxed *regress_test_boxed_new_alternative_constructor1 (int i); |
| 764 |
|
| 765 |
GI_TEST_EXTERN |
| 766 |
RegressTestBoxed *regress_test_boxed_new_alternative_constructor2 (int i, int j); |
| 767 |
|
| 768 |
GI_TEST_EXTERN |
| 769 |
RegressTestBoxed *regress_test_boxed_new_alternative_constructor3 (char *s); |
| 770 |
|
| 771 |
GI_TEST_EXTERN |
| 772 |
RegressTestBoxed *regress_test_boxed_copy (RegressTestBoxed *boxed); |
| 773 |
|
| 774 |
GI_TEST_EXTERN |
| 775 |
gboolean regress_test_boxed_equals (RegressTestBoxed *boxed, |
| 776 |
RegressTestBoxed *other); |
| 777 |
|
| 778 |
GI_TEST_EXTERN |
| 779 |
void regress_test_boxeds_not_a_method (RegressTestBoxed *boxed); |
| 780 |
|
| 781 |
GI_TEST_EXTERN |
| 782 |
void regress_test_boxeds_not_a_static (void); |
| 783 |
|
| 784 |
typedef struct _RegressTestBoxedB RegressTestBoxedB; |
| 785 |
|
| 786 |
struct _RegressTestBoxedB |
| 787 |
{ |
| 788 |
gint8 some_int8; |
| 789 |
glong some_long; |
| 790 |
}; |
| 791 |
|
| 792 |
GI_TEST_EXTERN |
| 793 |
GType regress_test_boxed_b_get_type (void); |
| 794 |
|
| 795 |
GI_TEST_EXTERN |
| 796 |
RegressTestBoxedB *regress_test_boxed_b_new (gint8 some_int8, glong some_long); |
| 797 |
|
| 798 |
GI_TEST_EXTERN |
| 799 |
RegressTestBoxedB *regress_test_boxed_b_copy (RegressTestBoxedB *boxed); |
| 800 |
|
| 801 |
typedef struct _RegressTestBoxedC RegressTestBoxedC; |
| 802 |
|
| 803 |
struct _RegressTestBoxedC |
| 804 |
{ |
| 805 |
guint refcount; |
| 806 |
guint another_thing; |
| 807 |
gboolean name_conflict; |
| 808 |
}; |
| 809 |
|
| 810 |
GI_TEST_EXTERN |
| 811 |
GType regress_test_boxed_c_get_type (void); |
| 812 |
|
| 813 |
GI_TEST_EXTERN |
| 814 |
RegressTestBoxedC *regress_test_boxed_c_new (void); |
| 815 |
|
| 816 |
GI_TEST_EXTERN |
| 817 |
gboolean regress_test_boxed_c_name_conflict (RegressTestBoxedC *boxed); |
| 818 |
|
| 819 |
/** |
| 820 |
* RegressTestBoxedD: (copy-func regress_test_boxed_d_copy) |
| 821 |
* (free-func regress_test_boxed_d_free) |
| 822 |
* |
| 823 |
*/ |
| 824 |
typedef struct _RegressTestBoxedD RegressTestBoxedD; |
| 825 |
|
| 826 |
GI_TEST_EXTERN |
| 827 |
GType regress_test_boxed_d_get_type (void); |
| 828 |
|
| 829 |
GI_TEST_EXTERN |
| 830 |
RegressTestBoxedD *regress_test_boxed_d_new (const char *a_string, int a_int); |
| 831 |
|
| 832 |
GI_TEST_EXTERN |
| 833 |
RegressTestBoxedD *regress_test_boxed_d_copy (RegressTestBoxedD *boxed); |
| 834 |
|
| 835 |
GI_TEST_EXTERN |
| 836 |
void regress_test_boxed_d_free (RegressTestBoxedD *boxed); |
| 837 |
|
| 838 |
GI_TEST_EXTERN |
| 839 |
int regress_test_boxed_d_get_magic (RegressTestBoxedD *boxed); |
| 840 |
|
| 841 |
/* gobject */ |
| 842 |
#define REGRESS_TEST_TYPE_OBJ (regress_test_obj_get_type ()) |
| 843 |
#define REGRESS_TEST_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), REGRESS_TEST_TYPE_OBJ, RegressTestObj)) |
| 844 |
#define REGRESS_TEST_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), REGRESS_TEST_TYPE_OBJ)) |
| 845 |
#define REGRESS_TEST_OBJ_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), REGRESS_TEST_TYPE_OBJ, RegressTestObjClass)) |
| 846 |
|
| 847 |
typedef struct _RegressTestObj RegressTestObj; |
| 848 |
typedef struct _RegressTestObjClass RegressTestObjClass; |
| 849 |
|
| 850 |
/** |
| 851 |
* RegressTestObj: |
| 852 |
* @bare: (allow-none): |
| 853 |
*/ |
| 854 |
struct _RegressTestObj |
| 855 |
{ |
| 856 |
GObject parent_instance; |
| 857 |
|
| 858 |
GObject *bare; |
| 859 |
RegressTestBoxed *boxed; |
| 860 |
GHashTable *hash_table; |
| 861 |
GList *list; |
| 862 |
gint8 some_int8; |
| 863 |
float some_float; |
| 864 |
double some_double; |
| 865 |
char *string; |
| 866 |
GType gtype; |
| 867 |
gint name_conflict; |
| 868 |
GByteArray *byte_array; |
| 869 |
gunichar unichar; |
| 870 |
|
| 871 |
/* < private > */ |
| 872 |
void (*function_ptr) (void); |
| 873 |
}; |
| 874 |
|
| 875 |
typedef void (*RegressTestExternallyDefinedCallback) (RegressTestObj *obj, int someint); |
| 876 |
|
| 877 |
struct _RegressTestObjClass |
| 878 |
{ |
| 879 |
GObjectClass parent_class; |
| 880 |
|
| 881 |
int (*matrix) (RegressTestObj *obj, const char *somestr); |
| 882 |
|
| 883 |
/** |
| 884 |
* RegressTestObjClass::allow_none_vfunc: |
| 885 |
* @two: (allow-none): Another object |
| 886 |
*/ |
| 887 |
void (*allow_none_vfunc) (RegressTestObj *obj, RegressTestObj *two); |
| 888 |
|
| 889 |
/** |
| 890 |
* RegressTestObjClass::static_vfunc: |
| 891 |
*/ |
| 892 |
gboolean (*static_vfunc) (void); |
| 893 |
|
| 894 |
/** |
| 895 |
* RegressTestObjClass::static_vfunc_params: |
| 896 |
* @value: |
| 897 |
* @error: |
| 898 |
* |
| 899 |
* Return: (transfer none): |
| 900 |
*/ |
| 901 |
RegressTestObj *(*static_vfunc_params) (gint value, GError **error); |
| 902 |
|
| 903 |
/** |
| 904 |
* RegressTestObjClass::static_vfunc_out: |
| 905 |
* @two: (out): |
| 906 |
*/ |
| 907 |
void (*static_vfunc_out) (RegressTestObj **two); |
| 908 |
|
| 909 |
guint test_signal; |
| 910 |
guint test_signal_with_static_scope_arg; |
| 911 |
|
| 912 |
RegressTestExternallyDefinedCallback complex_vfunc; |
| 913 |
|
| 914 |
/* Should be replaced with simple "gpointer" and not be callback */ |
| 915 |
void (*_regress_reserved1) (void); |
| 916 |
void (*_regress_reserved2) (void); |
| 917 |
}; |
| 918 |
|
| 919 |
GI_TEST_EXTERN |
| 920 |
GType regress_test_obj_get_type (void); |
| 921 |
|
| 922 |
GI_TEST_EXTERN |
| 923 |
RegressTestObj *regress_test_obj_new (RegressTestObj *obj); |
| 924 |
|
| 925 |
GI_TEST_EXTERN |
| 926 |
RegressTestObj *regress_constructor (void); |
| 927 |
|
| 928 |
GI_TEST_EXTERN |
| 929 |
RegressTestObj *regress_test_obj_new_from_file (const char *x, GError **error); |
| 930 |
|
| 931 |
GI_TEST_EXTERN |
| 932 |
void regress_test_obj_set_bare (RegressTestObj *obj, GObject *bare); |
| 933 |
|
| 934 |
GI_TEST_EXTERN |
| 935 |
void regress_test_obj_set_string (RegressTestObj *obj, const char *str); |
| 936 |
|
| 937 |
GI_TEST_EXTERN |
| 938 |
const char *regress_test_obj_get_string (RegressTestObj *obj); |
| 939 |
|
| 940 |
GI_TEST_EXTERN |
| 941 |
void regress_test_obj_emit_sig_with_obj (RegressTestObj *obj); |
| 942 |
|
| 943 |
GI_TEST_EXTERN |
| 944 |
void regress_test_obj_emit_sig_with_obj_full (RegressTestObj *obj); |
| 945 |
|
| 946 |
#if GLIB_CHECK_VERSION(2, 68, 0) |
| 947 |
GI_TEST_EXTERN |
| 948 |
void regress_test_obj_emit_sig_with_gstrv_full (RegressTestObj *obj); |
| 949 |
#endif |
| 950 |
|
| 951 |
GI_TEST_EXTERN |
| 952 |
void regress_test_obj_emit_sig_with_foreign_struct (RegressTestObj *obj); |
| 953 |
|
| 954 |
GI_TEST_EXTERN |
| 955 |
void regress_test_obj_emit_sig_with_int64 (RegressTestObj *obj); |
| 956 |
|
| 957 |
GI_TEST_EXTERN |
| 958 |
void regress_test_obj_emit_sig_with_uint64 (RegressTestObj *obj); |
| 959 |
|
| 960 |
GI_TEST_EXTERN |
| 961 |
void regress_test_obj_emit_sig_with_array_len_prop (RegressTestObj *obj); |
| 962 |
|
| 963 |
GI_TEST_EXTERN |
| 964 |
void regress_test_obj_emit_sig_with_inout_int (RegressTestObj *obj); |
| 965 |
|
| 966 |
GI_TEST_EXTERN |
| 967 |
void regress_test_obj_emit_sig_with_error (RegressTestObj *self); |
| 968 |
|
| 969 |
GI_TEST_EXTERN |
| 970 |
void regress_test_obj_emit_sig_with_null_error (RegressTestObj *self); |
| 971 |
|
| 972 |
GI_TEST_EXTERN |
| 973 |
int regress_test_obj_instance_method (RegressTestObj *obj); |
| 974 |
|
| 975 |
GI_TEST_EXTERN |
| 976 |
void regress_test_obj_instance_method_full (RegressTestObj *obj); |
| 977 |
|
| 978 |
GI_TEST_EXTERN |
| 979 |
double regress_test_obj_static_method (int x); |
| 980 |
|
| 981 |
GI_TEST_EXTERN |
| 982 |
void regress_forced_method (RegressTestObj *obj); |
| 983 |
|
| 984 |
GI_TEST_EXTERN |
| 985 |
void regress_test_array_fixed_out_objects (RegressTestObj ***objs); |
| 986 |
|
| 987 |
#if (defined(__GNUC__) || defined(__clang__)) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L |
| 988 |
#define G_GCC_STATIC static |
| 989 |
#else |
| 990 |
#define G_GCC_STATIC |
| 991 |
#endif |
| 992 |
GI_TEST_EXTERN |
| 993 |
void regress_test_array_static_in_int (int x[G_GCC_STATIC 10]); |
| 994 |
|
| 995 |
GI_TEST_EXTERN |
| 996 |
void regress_test_obj_torture_signature_0 (RegressTestObj *obj, |
| 997 |
int x, |
| 998 |
double *y, |
| 999 |
int *z, |
| 1000 |
const char *foo, |
| 1001 |
int *q, |
| 1002 |
guint m); |
| 1003 |
|
| 1004 |
GI_TEST_EXTERN |
| 1005 |
gboolean regress_test_obj_torture_signature_1 (RegressTestObj *obj, |
| 1006 |
int x, |
| 1007 |
double *y, |
| 1008 |
int *z, |
| 1009 |
const char *foo, |
| 1010 |
int *q, |
| 1011 |
guint m, |
| 1012 |
GError **error); |
| 1013 |
|
| 1014 |
GI_TEST_EXTERN |
| 1015 |
gboolean regress_test_obj_skip_return_val (RegressTestObj *obj, |
| 1016 |
gint a, |
| 1017 |
gint *out_b, |
| 1018 |
gdouble c, |
| 1019 |
gint *inout_d, |
| 1020 |
gint *out_sum, |
| 1021 |
gint num1, |
| 1022 |
gint num2, |
| 1023 |
GError **error); |
| 1024 |
|
| 1025 |
GI_TEST_EXTERN |
| 1026 |
gboolean regress_test_obj_skip_return_val_no_out (RegressTestObj *obj, |
| 1027 |
gint a, |
| 1028 |
GError **error); |
| 1029 |
|
| 1030 |
GI_TEST_EXTERN |
| 1031 |
gboolean regress_test_obj_skip_param (RegressTestObj *obj, |
| 1032 |
gint a, |
| 1033 |
gint *out_b, |
| 1034 |
gdouble c, |
| 1035 |
gint *inout_d, |
| 1036 |
gint *out_sum, |
| 1037 |
gint num1, |
| 1038 |
gint num2, |
| 1039 |
GError **error); |
| 1040 |
|
| 1041 |
GI_TEST_EXTERN |
| 1042 |
gboolean regress_test_obj_skip_out_param (RegressTestObj *obj, |
| 1043 |
gint a, |
| 1044 |
gint *out_b, |
| 1045 |
gdouble c, |
| 1046 |
gint *inout_d, |
| 1047 |
gint *out_sum, |
| 1048 |
gint num1, |
| 1049 |
gint num2, |
| 1050 |
GError **error); |
| 1051 |
|
| 1052 |
GI_TEST_EXTERN |
| 1053 |
gboolean regress_test_obj_skip_inout_param (RegressTestObj *obj, |
| 1054 |
gint a, |
| 1055 |
gint *out_b, |
| 1056 |
gdouble c, |
| 1057 |
gint *inout_d, |
| 1058 |
gint *out_sum, |
| 1059 |
gint num1, |
| 1060 |
gint num2, |
| 1061 |
GError **error); |
| 1062 |
|
| 1063 |
/* virtual */ |
| 1064 |
GI_TEST_EXTERN |
| 1065 |
int regress_test_obj_do_matrix (RegressTestObj *obj, const char *somestr); |
| 1066 |
|
| 1067 |
GI_TEST_EXTERN |
| 1068 |
void regress_func_obj_null_in (RegressTestObj *obj); |
| 1069 |
|
| 1070 |
GI_TEST_EXTERN |
| 1071 |
void regress_test_obj_null_out (RegressTestObj **obj); |
| 1072 |
|
| 1073 |
GI_TEST_EXTERN |
| 1074 |
void regress_func_obj_nullable_in (RegressTestObj *obj); |
| 1075 |
|
| 1076 |
GI_TEST_EXTERN |
| 1077 |
void regress_test_obj_not_nullable_typed_gpointer_in (RegressTestObj *obj, |
| 1078 |
gpointer input); |
| 1079 |
|
| 1080 |
GI_TEST_EXTERN |
| 1081 |
void regress_test_obj_not_nullable_element_typed_gpointer_in (RegressTestObj *obj, |
| 1082 |
gpointer input, |
| 1083 |
guint count); |
| 1084 |
|
| 1085 |
GI_TEST_EXTERN |
| 1086 |
void regress_test_obj_name_conflict (RegressTestObj *obj); |
| 1087 |
|
| 1088 |
/* inheritance */ |
| 1089 |
#define REGRESS_TEST_TYPE_SUB_OBJ (regress_test_sub_obj_get_type ()) |
| 1090 |
#define REGRESS_TEST_SUB_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), REGRESS_TEST_TYPE_SUB_OBJ, RegressTestSubObj)) |
| 1091 |
#define REGRESS_TEST_IS_SUB_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), REGRESS_TEST_TYPE_SUB_OBJ)) |
| 1092 |
#define REGRESS_TEST_SUB_OBJ_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), REGRESS_TEST_TYPE_SUB_OBJ, RegressTestSubObjClass)) |
| 1093 |
|
| 1094 |
typedef struct _RegressTestSubObj RegressTestSubObj; |
| 1095 |
typedef struct _RegressTestSubObjClass RegressTestSubObjClass; |
| 1096 |
|
| 1097 |
struct _RegressTestSubObj |
| 1098 |
{ |
| 1099 |
RegressTestObj parent_instance; |
| 1100 |
/*< private >*/ |
| 1101 |
gint number; |
| 1102 |
gboolean boolean; |
| 1103 |
}; |
| 1104 |
|
| 1105 |
struct _RegressTestSubObjClass |
| 1106 |
{ |
| 1107 |
RegressTestObjClass parent_class; |
| 1108 |
}; |
| 1109 |
|
| 1110 |
GI_TEST_EXTERN |
| 1111 |
GType regress_test_sub_obj_get_type (void); |
| 1112 |
|
| 1113 |
GI_TEST_EXTERN |
| 1114 |
RegressTestObj *regress_test_sub_obj_new (void); |
| 1115 |
|
| 1116 |
GI_TEST_EXTERN |
| 1117 |
void regress_test_sub_obj_unset_bare (RegressTestSubObj *obj); |
| 1118 |
|
| 1119 |
GI_TEST_EXTERN |
| 1120 |
int regress_test_sub_obj_instance_method (RegressTestSubObj *obj); |
| 1121 |
|
| 1122 |
/* fundamental object */ |
| 1123 |
#define REGRESS_TEST_TYPE_FUNDAMENTAL_OBJECT (regress_test_fundamental_object_get_type ()) |
| 1124 |
#define REGRESS_TEST_IS_FUNDAMENTAL_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), REGRESS_TEST_TYPE_FUNDAMENTAL_OBJECT)) |
| 1125 |
#define REGRESS_TEST_IS_FUNDAMENTAL_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), REGRESS_TEST_TYPE_FUNDAMENTAL_OBJECT)) |
| 1126 |
#define REGRESS_TEST_FUNDAMENTAL_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), REGRESS_TEST_TYPE_FUNDAMENTAL_OBJECT, RegressTestFundamentalObjectClass)) |
| 1127 |
#define REGRESS_TEST_FUNDAMENTAL_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), REGRESS_TEST_TYPE_FUNDAMENTAL_OBJECT, RegressTestFundamentalObject)) |
| 1128 |
#define REGRESS_TEST_FUNDAMENTAL_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), REGRESS_TEST_TYPE_FUNDAMENTAL_OBJECT, RegressTestFundamentalObjectClass)) |
| 1129 |
#define REGRESS_TEST_FUNDAMENTAL_OBJECT_CAST(obj) ((RegressTestFundamentalObject *) (obj)) |
| 1130 |
|
| 1131 |
typedef struct _RegressTestFundamentalObject RegressTestFundamentalObject; |
| 1132 |
typedef struct _RegressTestFundamentalObjectClass RegressTestFundamentalObjectClass; |
| 1133 |
/** |
| 1134 |
* RegressTestFundamentalObjectCopyFunction: |
| 1135 |
* |
| 1136 |
* Returns: (transfer full): |
| 1137 |
*/ |
| 1138 |
typedef RegressTestFundamentalObject *(*RegressTestFundamentalObjectCopyFunction) (const RegressTestFundamentalObject *obj); |
| 1139 |
typedef void (*RegressTestFundamentalObjectFinalizeFunction) (RegressTestFundamentalObject *obj); |
| 1140 |
|
| 1141 |
struct _RegressTestFundamentalObject |
| 1142 |
{ |
| 1143 |
GTypeInstance instance; |
| 1144 |
gint refcount; |
| 1145 |
guint flags; |
| 1146 |
}; |
| 1147 |
|
| 1148 |
struct _RegressTestFundamentalObjectClass |
| 1149 |
{ |
| 1150 |
GTypeClass type_class; |
| 1151 |
|
| 1152 |
RegressTestFundamentalObjectCopyFunction copy; |
| 1153 |
RegressTestFundamentalObjectFinalizeFunction finalize; |
| 1154 |
}; |
| 1155 |
|
| 1156 |
GI_TEST_EXTERN |
| 1157 |
GType regress_test_fundamental_object_get_type (void); |
| 1158 |
|
| 1159 |
GI_TEST_EXTERN |
| 1160 |
RegressTestFundamentalObject *regress_test_fundamental_object_ref (RegressTestFundamentalObject *fundamental_object); |
| 1161 |
|
| 1162 |
GI_TEST_EXTERN |
| 1163 |
void regress_test_fundamental_object_unref (RegressTestFundamentalObject *fundamental_object); |
| 1164 |
|
| 1165 |
#define REGRESS_TEST_VALUE_HOLDS_FUNDAMENTAL_OBJECT(value) (G_VALUE_HOLDS (value, REGRESS_TEST_TYPE_FUNDAMENTAL_OBJECT)) |
| 1166 |
|
| 1167 |
GI_TEST_EXTERN |
| 1168 |
void regress_test_value_set_fundamental_object (GValue *value, RegressTestFundamentalObject *fundamental_object); |
| 1169 |
|
| 1170 |
GI_TEST_EXTERN |
| 1171 |
RegressTestFundamentalObject *regress_test_value_get_fundamental_object (const GValue *value); |
| 1172 |
|
| 1173 |
typedef struct _RegressTestFundamentalSubObject RegressTestFundamentalSubObject; |
| 1174 |
typedef struct _RegressTestFundamentalSubObjectClass RegressTestFundamentalSubObjectClass; |
| 1175 |
|
| 1176 |
struct _RegressTestFundamentalSubObject |
| 1177 |
{ |
| 1178 |
RegressTestFundamentalObject fundamental_object; |
| 1179 |
char *data; |
| 1180 |
}; |
| 1181 |
|
| 1182 |
struct _RegressTestFundamentalSubObjectClass |
| 1183 |
{ |
| 1184 |
RegressTestFundamentalObjectClass fundamental_object_class; |
| 1185 |
}; |
| 1186 |
|
| 1187 |
GI_TEST_EXTERN |
| 1188 |
GType regress_test_fundamental_sub_object_get_type (void); |
| 1189 |
|
| 1190 |
struct _RegressTestFundamentalObjectNoGetSetFunc |
| 1191 |
{ |
| 1192 |
/* This is not really an RegressTestFundamentalObject but we "inherit" |
| 1193 |
* the structure from it */ |
| 1194 |
/* < private > */ |
| 1195 |
RegressTestFundamentalObject fundamental_object; |
| 1196 |
|
| 1197 |
/* < public > */ |
| 1198 |
char *data; |
| 1199 |
}; |
| 1200 |
|
| 1201 |
struct _RegressTestFundamentalObjectNoGetSetFuncClass |
| 1202 |
{ |
| 1203 |
RegressTestFundamentalObjectClass fundamental_object_class; |
| 1204 |
}; |
| 1205 |
|
| 1206 |
typedef struct _RegressTestFundamentalObjectNoGetSetFunc RegressTestFundamentalObjectNoGetSetFunc; |
| 1207 |
typedef struct _RegressTestFundamentalObjectNoGetSetFuncClass RegressTestFundamentalObjectNoGetSetFuncClass; |
| 1208 |
|
| 1209 |
GI_TEST_EXTERN |
| 1210 |
GType regress_test_fundamental_object_no_get_set_func_get_type (void); |
| 1211 |
|
| 1212 |
struct _RegressTestFundamentalSubObjectNoGetSetFunc |
| 1213 |
{ |
| 1214 |
/* < private > */ |
| 1215 |
RegressTestFundamentalObjectNoGetSetFunc fundamental_object; |
| 1216 |
}; |
| 1217 |
|
| 1218 |
struct _RegressTestFundamentalSubObjectNoGetSetFuncClass |
| 1219 |
{ |
| 1220 |
RegressTestFundamentalObjectNoGetSetFuncClass fundamental_object_class; |
| 1221 |
}; |
| 1222 |
|
| 1223 |
typedef struct _RegressTestFundamentalSubObjectNoGetSetFunc RegressTestFundamentalSubObjectNoGetSetFunc; |
| 1224 |
typedef struct _RegressTestFundamentalSubObjectNoGetSetFuncClass RegressTestFundamentalSubObjectNoGetSetFuncClass; |
| 1225 |
|
| 1226 |
GI_TEST_EXTERN |
| 1227 |
GType regress_test_fundamental_sub_object_no_get_set_func_get_type (void); |
| 1228 |
|
| 1229 |
GI_TEST_EXTERN |
| 1230 |
RegressTestFundamentalSubObject * |
| 1231 |
regress_test_fundamental_sub_object_new (const char *data); |
| 1232 |
|
| 1233 |
GI_TEST_EXTERN |
| 1234 |
RegressTestFundamentalObject * |
| 1235 |
regress_test_create_fundamental_hidden_class_instance (void); |
| 1236 |
|
| 1237 |
GI_TEST_EXTERN |
| 1238 |
RegressTestFundamentalObjectNoGetSetFunc * |
| 1239 |
regress_test_fundamental_object_no_get_set_func_new (const char *data); |
| 1240 |
|
| 1241 |
GI_TEST_EXTERN |
| 1242 |
const char * |
| 1243 |
regress_test_fundamental_object_no_get_set_func_get_data (RegressTestFundamentalObjectNoGetSetFunc *fundamental); |
| 1244 |
|
| 1245 |
GI_TEST_EXTERN |
| 1246 |
RegressTestFundamentalSubObjectNoGetSetFunc * |
| 1247 |
regress_test_fundamental_sub_object_no_get_set_func_new (const char *data); |
| 1248 |
|
| 1249 |
GI_TEST_EXTERN |
| 1250 |
void |
| 1251 |
regress_test_fundamental_object_no_get_set_func_make_compatible_with_fundamental_sub_object (void); |
| 1252 |
|
| 1253 |
/* callback */ |
| 1254 |
typedef void (*RegressTestSimpleCallback) (void); |
| 1255 |
typedef void RegressTestNoPtrCallback (void); |
| 1256 |
typedef int (*RegressTestCallback) (void); |
| 1257 |
typedef int (*RegressTestCallbackUserData) (gpointer user_data); |
| 1258 |
/** |
| 1259 |
* RegressTestCallbackHashtable: |
| 1260 |
* @data: (element-type utf8 gint): a hash table; will be modified |
| 1261 |
*/ |
| 1262 |
typedef void (*RegressTestCallbackHashtable) (GHashTable *data); |
| 1263 |
typedef void (*RegressTestCallbackGError) (const GError *error); |
| 1264 |
/** |
| 1265 |
* RegressTestCallbackOwnedGError: |
| 1266 |
* @error: (transfer full): GError instance; must be freed by the callback |
| 1267 |
*/ |
| 1268 |
typedef void (*RegressTestCallbackOwnedGError) (GError *error); |
| 1269 |
/** |
| 1270 |
* RegressTestCallbackFull: |
| 1271 |
* @foo: the investment rate |
| 1272 |
* @bar: how much money |
| 1273 |
* @path: (type filename): Path to file |
| 1274 |
*/ |
| 1275 |
typedef int (*RegressTestCallbackFull) (int foo, double bar, char *path); |
| 1276 |
/** |
| 1277 |
* RegressTestCallbackReturnFull: |
| 1278 |
* Return value: (transfer full): |
| 1279 |
*/ |
| 1280 |
typedef RegressTestObj *(*RegressTestCallbackReturnFull) (void); |
| 1281 |
/** |
| 1282 |
* RegressTestCallbackArray: |
| 1283 |
* @one: (array length=one_length): |
| 1284 |
* @one_length: |
| 1285 |
* @two: (array length=two_length) (element-type utf8): |
| 1286 |
* @two_length: |
| 1287 |
*/ |
| 1288 |
typedef int (*RegressTestCallbackArray) (int *one, gsize one_length, const char **two, int two_length); |
| 1289 |
/** |
| 1290 |
* RegressTestCallbackArrayInOut: |
| 1291 |
* @ints: (inout) (array length=length): |
| 1292 |
* @length: (inout): |
| 1293 |
*/ |
| 1294 |
typedef void (*RegressTestCallbackArrayInOut) (int **ints, int *length); |
| 1295 |
|
| 1296 |
GI_TEST_EXTERN |
| 1297 |
void regress_test_simple_callback (RegressTestSimpleCallback callback); |
| 1298 |
|
| 1299 |
GI_TEST_EXTERN |
| 1300 |
void regress_test_noptr_callback (RegressTestNoPtrCallback callback); |
| 1301 |
|
| 1302 |
GI_TEST_EXTERN |
| 1303 |
int regress_test_callback (RegressTestCallback callback); |
| 1304 |
|
| 1305 |
GI_TEST_EXTERN |
| 1306 |
int regress_test_multi_callback (RegressTestCallback callback); |
| 1307 |
|
| 1308 |
GI_TEST_EXTERN |
| 1309 |
int regress_test_array_callback (RegressTestCallbackArray callback); |
| 1310 |
|
| 1311 |
GI_TEST_EXTERN |
| 1312 |
int regress_test_array_inout_callback (RegressTestCallbackArrayInOut callback); |
| 1313 |
|
| 1314 |
GI_TEST_EXTERN |
| 1315 |
int regress_test_callback_user_data (RegressTestCallbackUserData callback, |
| 1316 |
gpointer user_data); |
| 1317 |
|
| 1318 |
GI_TEST_EXTERN |
| 1319 |
void regress_test_callback_return_full (RegressTestCallbackReturnFull callback); |
| 1320 |
|
| 1321 |
GI_TEST_EXTERN |
| 1322 |
int regress_test_callback_destroy_notify (RegressTestCallbackUserData callback, |
| 1323 |
gpointer user_data, |
| 1324 |
GDestroyNotify notify); |
| 1325 |
|
| 1326 |
GI_TEST_EXTERN |
| 1327 |
int regress_test_callback_destroy_notify_no_user_data (RegressTestCallbackUserData callback, |
| 1328 |
GDestroyNotify notify); |
| 1329 |
|
| 1330 |
GI_TEST_EXTERN |
| 1331 |
int regress_test_callback_thaw_notifications (void); |
| 1332 |
|
| 1333 |
GI_TEST_EXTERN |
| 1334 |
void regress_test_callback_async (RegressTestCallbackUserData callback, gpointer user_data); |
| 1335 |
|
| 1336 |
GI_TEST_EXTERN |
| 1337 |
int regress_test_callback_thaw_async (void); |
| 1338 |
|
| 1339 |
GI_TEST_EXTERN |
| 1340 |
void regress_test_async_ready_callback (GAsyncReadyCallback callback); |
| 1341 |
|
| 1342 |
GI_TEST_EXTERN |
| 1343 |
void regress_test_function_async (int io_priority, |
| 1344 |
GCancellable *cancellable, |
| 1345 |
GAsyncReadyCallback callback, |
| 1346 |
gpointer user_data); |
| 1347 |
|
| 1348 |
GI_TEST_EXTERN |
| 1349 |
int regress_test_function_thaw_async (void); |
| 1350 |
|
| 1351 |
GI_TEST_EXTERN |
| 1352 |
gboolean regress_test_function_finish (GAsyncResult *res, GError **error); |
| 1353 |
|
| 1354 |
GI_TEST_EXTERN |
| 1355 |
gboolean regress_test_function_sync (int io_priority); |
| 1356 |
|
| 1357 |
GI_TEST_EXTERN |
| 1358 |
void regress_test_obj_instance_method_callback (RegressTestObj *obj, RegressTestCallback callback); |
| 1359 |
|
| 1360 |
GI_TEST_EXTERN |
| 1361 |
void regress_test_obj_static_method_callback (RegressTestCallback callback); |
| 1362 |
|
| 1363 |
GI_TEST_EXTERN |
| 1364 |
RegressTestObj *regress_test_obj_new_callback (RegressTestCallbackUserData callback, |
| 1365 |
gpointer user_data, |
| 1366 |
GDestroyNotify notify); |
| 1367 |
|
| 1368 |
GI_TEST_EXTERN |
| 1369 |
void regress_test_obj_new_async (const char *x G_GNUC_UNUSED, |
| 1370 |
GCancellable *cancellable G_GNUC_UNUSED, |
| 1371 |
GAsyncReadyCallback callback G_GNUC_UNUSED, |
| 1372 |
gpointer user_data G_GNUC_UNUSED); |
| 1373 |
|
| 1374 |
GI_TEST_EXTERN |
| 1375 |
int regress_test_obj_constructor_thaw_async (void); |
| 1376 |
|
| 1377 |
GI_TEST_EXTERN |
| 1378 |
RegressTestObj *regress_test_obj_new_finish (GAsyncResult *res G_GNUC_UNUSED, |
| 1379 |
GError **error G_GNUC_UNUSED); |
| 1380 |
|
| 1381 |
GI_TEST_EXTERN |
| 1382 |
void regress_test_hash_table_callback (GHashTable *data, RegressTestCallbackHashtable callback); |
| 1383 |
|
| 1384 |
GI_TEST_EXTERN |
| 1385 |
void regress_test_gerror_callback (RegressTestCallbackGError callback); |
| 1386 |
|
| 1387 |
GI_TEST_EXTERN |
| 1388 |
void regress_test_null_gerror_callback (RegressTestCallbackGError callback); |
| 1389 |
|
| 1390 |
GI_TEST_EXTERN |
| 1391 |
void regress_test_owned_gerror_callback (RegressTestCallbackOwnedGError callback); |
| 1392 |
|
| 1393 |
GI_TEST_EXTERN |
| 1394 |
void regress_test_skip_unannotated_callback (RegressTestCallback callback); |
| 1395 |
|
| 1396 |
typedef struct _RegressTestInterface RegressTestInterface; |
| 1397 |
|
| 1398 |
/* interface */ |
| 1399 |
#define REGRESS_TEST_TYPE_INTERFACE (regress_test_interface_get_type ()) |
| 1400 |
#define REGRESS_TEST_INTERFACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), REGRESS_TEST_TYPE_INTERFACE, RegressTestInterface)) |
| 1401 |
#define REGRESS_TEST_IS_INTERFACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), REGRESS_TEST_TYPE_INTERFACE)) |
| 1402 |
#define REGRESS_TEST_INTERFACE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), REGRESS_TEST_TYPE_INTERFACE, RegressTestInterfaceIface)) |
| 1403 |
|
| 1404 |
typedef struct _RegressTestInterfaceIface RegressTestInterfaceIface; |
| 1405 |
|
| 1406 |
struct _RegressTestInterfaceIface |
| 1407 |
{ |
| 1408 |
GTypeInterface base_iface; |
| 1409 |
}; |
| 1410 |
|
| 1411 |
GI_TEST_EXTERN |
| 1412 |
GType regress_test_interface_get_type (void) G_GNUC_CONST; |
| 1413 |
|
| 1414 |
GI_TEST_EXTERN |
| 1415 |
void regress_test_interface_emit_signal (RegressTestInterface *self); |
| 1416 |
|
| 1417 |
/* gobject with non-standard prefix */ |
| 1418 |
#define REGRESS_TEST_TYPE_WI_802_1X (regress_test_wi_802_1x_get_type ()) |
| 1419 |
#define REGRESS_TEST_WI_802_1X(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), REGRESS_TEST_TYPE_WI_802_1X, RegressTestWi8021x)) |
| 1420 |
#define REGRESS_TEST_IS_WI_802_1X(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), REGRESS_TEST_TYPE_WI_802_1X)) |
| 1421 |
#define REGRESS_TEST_WI_802_1X_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), REGRESS_TEST_TYPE_WI_802_1X, RegressTestWi8021xClass)) |
| 1422 |
|
| 1423 |
typedef struct |
| 1424 |
{ |
| 1425 |
GObject parent_instance; |
| 1426 |
|
| 1427 |
gboolean testbool; |
| 1428 |
} RegressTestWi8021x; |
| 1429 |
|
| 1430 |
typedef struct |
| 1431 |
{ |
| 1432 |
GObjectClass parent_class; |
| 1433 |
} RegressTestWi8021xClass; |
| 1434 |
|
| 1435 |
GI_TEST_EXTERN |
| 1436 |
GType regress_test_wi_802_1x_get_type (void); |
| 1437 |
|
| 1438 |
GI_TEST_EXTERN |
| 1439 |
RegressTestWi8021x *regress_test_wi_802_1x_new (void); |
| 1440 |
|
| 1441 |
GI_TEST_EXTERN |
| 1442 |
gboolean regress_test_wi_802_1x_get_testbool (RegressTestWi8021x *obj); |
| 1443 |
|
| 1444 |
GI_TEST_EXTERN |
| 1445 |
void regress_test_wi_802_1x_set_testbool (RegressTestWi8021x *obj, gboolean v); |
| 1446 |
|
| 1447 |
GI_TEST_EXTERN |
| 1448 |
int regress_test_wi_802_1x_static_method (int x); |
| 1449 |
|
| 1450 |
/* floating gobject */ |
| 1451 |
#define REGRESS_TEST_TYPE_FLOATING (regress_test_floating_get_type ()) |
| 1452 |
#define REGRESS_TEST_FLOATING(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), REGRESS_TEST_TYPE_FLOATING, RegressTestFloating)) |
| 1453 |
#define REGRESS_TEST_IS_FLOATING(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), REGRESS_TEST_TYPE_FLOATING)) |
| 1454 |
#define REGRESS_TEST_FLOATING_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), REGRESS_TEST_TYPE_FLOATING, RegressTestFloatingClass)) |
| 1455 |
|
| 1456 |
typedef struct |
| 1457 |
{ |
| 1458 |
GInitiallyUnowned parent_instance; |
| 1459 |
} RegressTestFloating; |
| 1460 |
|
| 1461 |
typedef struct |
| 1462 |
{ |
| 1463 |
GInitiallyUnownedClass parent_class; |
| 1464 |
} RegressTestFloatingClass; |
| 1465 |
|
| 1466 |
GI_TEST_EXTERN |
| 1467 |
GType regress_test_floating_get_type (void); |
| 1468 |
|
| 1469 |
GI_TEST_EXTERN |
| 1470 |
RegressTestFloating *regress_test_floating_new (void); |
| 1471 |
|
| 1472 |
/* Function signature torture tests */ |
| 1473 |
|
| 1474 |
GI_TEST_EXTERN |
| 1475 |
void regress_test_torture_signature_0 (int x, |
| 1476 |
double *y, |
| 1477 |
int *z, |
| 1478 |
const char *foo, |
| 1479 |
int *q, |
| 1480 |
guint m); |
| 1481 |
|
| 1482 |
GI_TEST_EXTERN |
| 1483 |
gboolean regress_test_torture_signature_1 (int x, |
| 1484 |
double *y, |
| 1485 |
int *z, |
| 1486 |
const char *foo, |
| 1487 |
int *q, |
| 1488 |
guint m, |
| 1489 |
GError **error); |
| 1490 |
|
| 1491 |
GI_TEST_EXTERN |
| 1492 |
void regress_test_torture_signature_2 (int x, |
| 1493 |
RegressTestCallbackUserData callback, |
| 1494 |
gpointer user_data, |
| 1495 |
GDestroyNotify notify, |
| 1496 |
double *y, |
| 1497 |
int *z, |
| 1498 |
const char *foo, |
| 1499 |
int *q, |
| 1500 |
guint m); |
| 1501 |
|
| 1502 |
GI_TEST_EXTERN |
| 1503 |
GValue *regress_test_date_in_gvalue (void); |
| 1504 |
|
| 1505 |
GI_TEST_EXTERN |
| 1506 |
GValue *regress_test_strv_in_gvalue (void); |
| 1507 |
|
| 1508 |
GI_TEST_EXTERN |
| 1509 |
GValue *regress_test_null_strv_in_gvalue (void); |
| 1510 |
|
| 1511 |
GI_TEST_EXTERN |
| 1512 |
GObject *_regress_this_is_a_private_symbol (void); |
| 1513 |
|
| 1514 |
GI_TEST_EXTERN |
| 1515 |
void regress_test_multiline_doc_comments (void); |
| 1516 |
|
| 1517 |
GI_TEST_EXTERN |
| 1518 |
void regress_test_nested_parameter (int a); |
| 1519 |
|
| 1520 |
/** |
| 1521 |
* RegressSkippedStructure: (skip) |
| 1522 |
* |
| 1523 |
* This should be skipped, and moreover, all function which |
| 1524 |
* use it should be. |
| 1525 |
*/ |
| 1526 |
typedef struct |
| 1527 |
{ |
| 1528 |
int x; |
| 1529 |
double v; |
| 1530 |
} RegressSkippedStructure; |
| 1531 |
|
| 1532 |
GI_TEST_EXTERN |
| 1533 |
void regress_random_function_with_skipped_structure (int x, |
| 1534 |
RegressSkippedStructure *foo, |
| 1535 |
double v); |
| 1536 |
|
| 1537 |
/** |
| 1538 |
* RegressIntset: |
| 1539 |
* |
| 1540 |
* Like telepathy-glib's TpIntset. |
| 1541 |
* |
| 1542 |
*/ |
| 1543 |
typedef struct _RegressIntset RegressIntset; |
| 1544 |
|
| 1545 |
/** |
| 1546 |
* RegressIntsetAlias: (skip) |
| 1547 |
* |
| 1548 |
* Compatibility typedef, like telepathy-glib's TpIntSet |
| 1549 |
* |
| 1550 |
*/ |
| 1551 |
typedef RegressIntset RegressIntsetAlias; |
| 1552 |
|
| 1553 |
/** |
| 1554 |
* RegressPtrArrayAlias: |
| 1555 |
* |
| 1556 |
* Typedef'd GPtrArray for some reason |
| 1557 |
*/ |
| 1558 |
typedef GPtrArray RegressPtrArrayAlias; |
| 1559 |
|
| 1560 |
GI_TEST_EXTERN |
| 1561 |
void regress_introspectable_via_alias (RegressPtrArrayAlias *data); |
| 1562 |
|
| 1563 |
/** |
| 1564 |
* RegressVaListAlias: |
| 1565 |
* |
| 1566 |
* Typedef'd va_list for additional reasons |
| 1567 |
*/ |
| 1568 |
typedef va_list RegressVaListAlias; |
| 1569 |
|
| 1570 |
GI_TEST_EXTERN |
| 1571 |
void regress_not_introspectable_via_alias (RegressVaListAlias ok); |
| 1572 |
|
| 1573 |
/** |
| 1574 |
* RegressAliasedTestBoxed: |
| 1575 |
* |
| 1576 |
* Typedef TestBoxed to test caller-allocates correctness |
| 1577 |
*/ |
| 1578 |
typedef RegressTestBoxed RegressAliasedTestBoxed; |
| 1579 |
|
| 1580 |
GI_TEST_EXTERN |
| 1581 |
void regress_aliased_caller_alloc (RegressAliasedTestBoxed *boxed); |
| 1582 |
|
| 1583 |
/* private testing */ |
| 1584 |
|
| 1585 |
typedef struct |
| 1586 |
{ |
| 1587 |
gint this_is_public_before; |
| 1588 |
/* < private > */ |
| 1589 |
gint this_is_private; |
| 1590 |
/* < public > */ |
| 1591 |
gint this_is_public_after; |
| 1592 |
} RegressTestPrivateStruct; |
| 1593 |
|
| 1594 |
typedef enum |
| 1595 |
{ |
| 1596 |
REGRESS_TEST_PUBLIC_ENUM_BEFORE = 1 << 0, |
| 1597 |
/* <private> */ |
| 1598 |
REGRESS_TEST_PRIVATE_ENUM = 1 << 1, |
| 1599 |
/* <public> */ |
| 1600 |
REGRESS_TEST_PUBLIC_ENUM_AFTER = 1 << 2, |
| 1601 |
} RegressTestPrivateEnum; |
| 1602 |
|
| 1603 |
typedef struct |
| 1604 |
{ |
| 1605 |
gint just_int; |
| 1606 |
gint array[10]; |
| 1607 |
} RegressTestStructFixedArray; |
| 1608 |
|
| 1609 |
GI_TEST_EXTERN |
| 1610 |
void regress_test_struct_fixed_array_frob (RegressTestStructFixedArray *str); |
| 1611 |
|
| 1612 |
typedef struct |
| 1613 |
{ |
| 1614 |
gchar name[32]; |
| 1615 |
} RegressLikeXklConfigItem; |
| 1616 |
|
| 1617 |
GI_TEST_EXTERN |
| 1618 |
void regress_like_xkl_config_item_set_name (RegressLikeXklConfigItem *self, |
| 1619 |
char const *name); |
| 1620 |
|
| 1621 |
#define REGRESS_UTF8_CONSTANT "const \xe2\x99\xa5 utf8" |
| 1622 |
|
| 1623 |
#ifdef __GNUC__ |
| 1624 |
#define REGRESS_TEST_GNUC_EXTENSION_STMT(foo) (G_GNUC_EXTENSION ({ int x[10]; x[5] = 42; x[5]; })) |
| 1625 |
#endif |
| 1626 |
|
| 1627 |
/* https://bugzilla.gnome.org/show_bug.cgi?id=662888 */ |
| 1628 |
#define REGRESS_LONG_STRING_CONSTANT \ |
| 1629 |
"TYPE,VALUE,ENCODING,CHARSET,LANGUAGE,DOM,INTL,POSTAL,PARCEL," \ |
| 1630 |
"HOME,WORK,PREF,VOICE,FAX,MSG,CELL,PAGER,BBS,MODEM,CAR,ISDN,VIDEO," \ |
| 1631 |
"AOL,APPLELINK,ATTMAIL,CIS,EWORLD,INTERNET,IBMMAIL,MCIMAIL," \ |
| 1632 |
"POWERSHARE,PRODIGY,TLX,X400,GIF,CGM,WMF,BMP,MET,PMB,DIB,PICT,TIFF," \ |
| 1633 |
"PDF,PS,JPEG,QTIME,MPEG,MPEG2,AVI,WAVE,AIFF,PCM,X509,PGP" |
| 1634 |
|
| 1635 |
GI_TEST_EXTERN |
| 1636 |
void regress_has_parameter_named_attrs (int foo, |
| 1637 |
gpointer attributes); |
| 1638 |
|
| 1639 |
typedef struct |
| 1640 |
{ |
| 1641 |
int dummy; |
| 1642 |
struct |
| 1643 |
{ |
| 1644 |
const char *name; |
| 1645 |
guint x; |
| 1646 |
} attributes[32]; |
| 1647 |
|
| 1648 |
double dummy2; |
| 1649 |
} RegressLikeGnomeKeyringPasswordSchema; |
| 1650 |
|
| 1651 |
/* Ensure we ignore symbols that start with _; in particular we don't |
| 1652 |
* want to issue a namespace warning. |
| 1653 |
*/ |
| 1654 |
#define _DONTSCANTHIS 1 |
| 1655 |
|
| 1656 |
/* https://bugzilla.gnome.org/show_bug.cgi?id=685022 */ |
| 1657 |
#define REGRESS_MININT64 ((gint64) G_GINT64_CONSTANT (0x8000000000000000)) |
| 1658 |
#define REGRESS_MAXUINT64 (G_GINT64_CONSTANT (0xffffffffffffffffU)) |
| 1659 |
|
| 1660 |
/* https://bugzilla.gnome.org/show_bug.cgi?id=698367 */ |
| 1661 |
#ifndef __GI_SCANNER__ |
| 1662 |
#define REGRESS_DONTSCANTHIS 1 |
| 1663 |
#else |
| 1664 |
#define REGRESS_GI_SCANNER_ELSE 3 |
| 1665 |
#endif |
| 1666 |
#ifndef BLAH |
| 1667 |
#ifdef __GI_SCANNER__ |
| 1668 |
#define REGRESS_GI_SCANNER_IFDEF 3 |
| 1669 |
#endif |
| 1670 |
#endif |
| 1671 |
|
| 1672 |
/* This struct is one pattern by which padding can be consumed, if |
| 1673 |
* you're willing to take a hard dependency on anonymous unions. */ |
| 1674 |
typedef struct |
| 1675 |
{ |
| 1676 |
int x; |
| 1677 |
|
| 1678 |
union |
| 1679 |
{ |
| 1680 |
RegressLikeGnomeKeyringPasswordSchema *a[2]; |
| 1681 |
|
| 1682 |
guint padding[4]; |
| 1683 |
}; |
| 1684 |
} RegressAnAnonymousUnion; |
| 1685 |
|
| 1686 |
typedef struct |
| 1687 |
{ |
| 1688 |
int x; |
| 1689 |
|
| 1690 |
union |
| 1691 |
{ |
| 1692 |
struct |
| 1693 |
{ |
| 1694 |
RegressLikeGnomeKeyringPasswordSchema *a; |
| 1695 |
RegressLikeXklConfigItem *b; |
| 1696 |
}; |
| 1697 |
|
| 1698 |
guint padding[4]; |
| 1699 |
}; |
| 1700 |
} RegressAnonymousUnionAndStruct; |
| 1701 |
|
| 1702 |
GI_TEST_EXTERN |
| 1703 |
GVariant *regress_get_variant (void); |
| 1704 |
|
| 1705 |
typedef struct _RegressTestReferenceCounters RegressTestReferenceCounters; |
| 1706 |
|
| 1707 |
struct _RegressTestReferenceCounters |
| 1708 |
{ |
| 1709 |
grefcount refcount; |
| 1710 |
gatomicrefcount atomicrefcount; |
| 1711 |
}; |
| 1712 |
|
| 1713 |
GI_TEST_EXTERN |
| 1714 |
void regress_test_array_struct_out_none (RegressTestStructA **arr, gsize *len); |
| 1715 |
|
| 1716 |
GI_TEST_EXTERN |
| 1717 |
void regress_test_array_struct_out_container (RegressTestStructA **arr, gsize *len); |
| 1718 |
|
| 1719 |
GI_TEST_EXTERN |
| 1720 |
void regress_test_array_struct_out_full_fixed (RegressTestStructA **arr); |
| 1721 |
|
| 1722 |
GI_TEST_EXTERN |
| 1723 |
void regress_test_array_struct_out_caller_alloc (RegressTestStructA *arr, gsize len); |
| 1724 |
|
| 1725 |
GI_TEST_EXTERN |
| 1726 |
void regress_test_array_struct_in_full (RegressTestStructA *arr, gsize len); |
| 1727 |
|
| 1728 |
GI_TEST_EXTERN |
| 1729 |
void regress_test_array_struct_in_none (RegressTestStructA *arr, gsize len); |
| 1730 |
|
| 1731 |
GI_TEST_EXTERN |
| 1732 |
void regress_test_obj_function_async (RegressTestObj *self, |
| 1733 |
int io_priority, |
| 1734 |
GCancellable *cancellable, |
| 1735 |
GAsyncReadyCallback callback, |
| 1736 |
gpointer user_data); |
| 1737 |
|
| 1738 |
GI_TEST_EXTERN |
| 1739 |
void regress_test_obj_function2 (RegressTestObj *self, |
| 1740 |
int io_priority, |
| 1741 |
GCancellable *cancellable, |
| 1742 |
RegressTestCallbackUserData test_cb, |
| 1743 |
gpointer test_data, |
| 1744 |
GDestroyNotify test_destroy, |
| 1745 |
GAsyncReadyCallback callback, |
| 1746 |
gpointer user_data); |
| 1747 |
|
| 1748 |
GI_TEST_EXTERN |
| 1749 |
gboolean regress_test_obj_function2_finish (RegressTestObj *self, |
| 1750 |
GAsyncResult *result, |
| 1751 |
gboolean *match, |
| 1752 |
GObject **some_obj, |
| 1753 |
GError **error); |
| 1754 |
|
| 1755 |
GI_TEST_EXTERN |
| 1756 |
gboolean regress_test_obj_function2_sync (RegressTestObj *self, int io_priority); |
| 1757 |
|
| 1758 |
GI_TEST_EXTERN |
| 1759 |
int regress_test_obj_function_thaw_async (RegressTestObj *self); |
| 1760 |
|
| 1761 |
GI_TEST_EXTERN |
| 1762 |
gboolean regress_test_obj_function_finish (RegressTestObj *self, GAsyncResult *res, GError **error); |
| 1763 |
|
| 1764 |
GI_TEST_EXTERN |
| 1765 |
gboolean regress_test_obj_function_sync (RegressTestObj *self, int io_priority); |
| 1766 |
|
| 1767 |
static inline gboolean regress_test_inline_function (gboolean foo); |
| 1768 |
/* |
| 1769 |
* regress_test_inline_function: |
| 1770 |
* |
| 1771 |
* An inline function that should be exposed as such |
| 1772 |
*/ |
| 1773 |
static inline gboolean |
| 1774 |
regress_test_inline_function (gboolean foo) |
| 1775 |
{ |
| 1776 |
return foo; |
| 1777 |
} |
| 1778 |
|
| 1779 |
static inline gboolean regress_test_obj_inline_method (RegressTestObj *obj, gboolean foo); |
| 1780 |
/* |
| 1781 |
* regress_test_obj_inline_method: |
| 1782 |
* |
| 1783 |
* An inline function that should be exposed as such |
| 1784 |
*/ |
| 1785 |
static inline gboolean |
| 1786 |
regress_test_obj_inline_method (RegressTestObj *obj G_GNUC_UNUSED, gboolean foo) |
| 1787 |
{ |
| 1788 |
return foo; |
| 1789 |
} |