Debian Codegraph @

subprojects/gobject-introspection-tests/warnlib.c

raw
1 /*
2 SPDX-License-Identifier: GPL-2.0-or-later AND LGPL-2.0-or-later AND MIT
3 SPDX-FileCopyrightText: 2012 Colin Walters <[email protected]>
4 SPDX-FileCopyrightText: 2013 Dieter Verfaillie
5 */
6
7 #include "warnlib.h"
8
9 GQuark
10 warnlib_unpaired_error_quark (void)
11 {
12 return g_quark_from_static_string ("warnlib-unpaired-error");
13 }
14
15 gboolean
16 warnlib_throw_unpaired (GError **error)
17 {
18 g_set_error_literal (error, warnlib_unpaired_error_quark (), 0,
19 "Unpaired error");
20 return FALSE;
21 }
22
23 typedef WarnLibWhateverIface WarnLibWhateverInterface;
24 G_DEFINE_INTERFACE (WarnLibWhatever, warnlib_whatever, G_TYPE_OBJECT)
25
26 static void
27 warnlib_whatever_default_init (WarnLibWhateverIface *iface G_GNUC_UNUSED)
28 {
29 }
30
31 void
32 warnlib_whatever_do_moo (WarnLibWhatever *self, int x, gpointer y)
33 {
34 WARNLIB_WHATEVER_GET_IFACE (self)->do_moo (self, x, y);
35 }
36
37 /**
38 * warnlib_whatever_do_boo:
39 * @self: a WarnLibWhatever
40 * @x: x parameter
41 * @y: y parameter
42 *
43 * Does boo.
44 */
45 void
46 warnlib_whatever_do_boo (WarnLibWhatever *self, int x, gpointer y)
47 {
48 WARNLIB_WHATEVER_GET_IFACE (self)->do_boo (self, x, y);
49 }