aboutsummaryrefslogtreecommitdiff
path: root/build-aux/templates/mm-errors-quarks.c.template
diff options
context:
space:
mode:
authorAleksander Morgado <aleksandermj@chromium.org>2023-04-27 11:23:22 +0000
committerAleksander Morgado <aleksander@aleksander.es>2023-04-27 12:23:04 +0000
commitefcfce02a95fe43adb40c1e01e82e0719a217983 (patch)
tree6db930fd8f86ae4075a5eed620a9561f2b0666b5 /build-aux/templates/mm-errors-quarks.c.template
parent549e2f511874cc5d8b6ff4b8d0cca6aafe461a35 (diff)
build-aux,mkenums: import custom mkenums tool from libqmi/libmbim
We're going to use certain new features included in the custom tool.
Diffstat (limited to 'build-aux/templates/mm-errors-quarks.c.template')
-rw-r--r--build-aux/templates/mm-errors-quarks.c.template42
1 files changed, 42 insertions, 0 deletions
diff --git a/build-aux/templates/mm-errors-quarks.c.template b/build-aux/templates/mm-errors-quarks.c.template
new file mode 100644
index 00000000..4386a601
--- /dev/null
+++ b/build-aux/templates/mm-errors-quarks.c.template
@@ -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 ***/