aboutsummaryrefslogtreecommitdiffstats
path: root/build-aux/templates/qmi-error-quarks-template.c
blob: ffae0b8b4ff579e0f8ac9250b724ecec4de96528 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*** BEGIN file-header ***/

#include <gio/gio.h>

/*** END file-header ***/

/*** BEGIN file-production ***/
/* enumerations from "@filename@" */
/*** END file-production ***/

/*** BEGIN value-header ***/

#define ERROR_PREFIX @ENUMNAME@_DBUS_PREFIX
static const GDBusErrorEntry @enum_name@_entries[] = {
/*** END value-header ***/

/*** BEGIN value-production ***/
    { @VALUENAME@, ERROR_PREFIX ".@valuenick@" },
/*** END value-production ***/

/*** BEGIN value-tail ***/
};
#undef ERROR_PREFIX

GQuark
@enum_name@_quark (void)
{
    static volatile gsize quark_volatile = 1;

    if (!quark_volatile)
        g_dbus_error_register_error_domain ("@enum_name@_quark",
                                            &quark_volatile,
                                            @enum_name@_entries,
                                            G_N_ELEMENTS (@enum_name@_entries));

    return (GQuark) quark_volatile;
}

/*** END value-tail ***/

/*** BEGIN file-tail ***/
/*** END file-tail ***/