diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-03-09 17:01:13 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-03-16 14:53:23 +0100 |
commit | 961290ddd7d6acd8d9da76e100b5c8063fa70cb5 (patch) | |
tree | e2496753d454c41b620d7bf5031cc6633f3ec41a /build-aux/mm-errors-quarks-template.c | |
parent | be7f499aa6da3630e145c311c489fe478c339b78 (diff) |
build: autogenerate `mm-errors-quarks.c'
We define custom nicks for each error enum, matching the DBus error entry that
we want to have with each of them.
Diffstat (limited to 'build-aux/mm-errors-quarks-template.c')
-rw-r--r-- | build-aux/mm-errors-quarks-template.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/build-aux/mm-errors-quarks-template.c b/build-aux/mm-errors-quarks-template.c new file mode 100644 index 00000000..4386a601 --- /dev/null +++ b/build-aux/mm-errors-quarks-template.c @@ -0,0 +1,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 = 0; + + 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 ***/ |