summaryrefslogtreecommitdiff
path: root/json-glib/json-enum-types.c.in
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@openedhand.com>2008-04-24 14:49:45 +0100
committerEmmanuele Bassi <ebassi@openedhand.com>2008-04-24 14:49:45 +0100
commit356413e8840a614914b84f40b1d8476ba036ded4 (patch)
treea676d88764357557cfd3395cb3870d9417bd7cde /json-glib/json-enum-types.c.in
parent7d57ffc03783defbfeb26e21a14e3df32555c29d (diff)
downloadjson-glib-356413e8840a614914b84f40b1d8476ba036ded4.tar.gz
Add enumeration types templates for glib-mkenums
The templates for glib-mkenums keep the Makefile.am sane and editable by mere mortals.
Diffstat (limited to 'json-glib/json-enum-types.c.in')
-rw-r--r--json-glib/json-enum-types.c.in31
1 files changed, 31 insertions, 0 deletions
diff --git a/json-glib/json-enum-types.c.in b/json-glib/json-enum-types.c.in
new file mode 100644
index 0000000..3578c6e
--- /dev/null
+++ b/json-glib/json-enum-types.c.in
@@ -0,0 +1,31 @@
+/*** BEGIN file-header ***/
+#include "json-enum-types.h"
+/*** END file-header ***/
+
+/*** BEGIN file-production ***/
+/* enumerations from "@filename@" */
+#include "@filename@"
+/*** END file-production ***/
+
+/*** BEGIN value-header ***/
+GType
+@enum_name@_get_type(void) {
+ static GType etype = 0;
+ if (G_UNLIKELY (!etype))
+ {
+ const G@Type@Value values[] = {
+/*** END value-header ***/
+
+/*** BEGIN value-production ***/
+ { @VALUENAME@, "@VALUENAME@", "@valuenick@" },
+/*** END value-production ***/
+
+/*** BEGIN value-tail ***/
+ { 0, NULL, NULL }
+ };
+ etype = g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
+ }
+ return etype;
+}
+
+/*** END value-tail ***/