diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2025-05-20 16:54:08 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2025-05-20 16:54:08 +0200 |
| commit | e5c8496b2acc49c6338adf9116b5dc038fe976be (patch) | |
| tree | 214cbe7d2a3b2a54745d95a32fea03ee5ebb0752 /lib | |
| parent | bce0c3d0a21c4a0f53984d55c00d1505957353a3 (diff) | |
| download | turns-e5c8496b2acc49c6338adf9116b5dc038fe976be.tar.xz turns-e5c8496b2acc49c6338adf9116b5dc038fe976be.zip | |
lib: clean up enum code template
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/src/turns-enums.c.in | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/src/turns-enums.c.in b/lib/src/turns-enums.c.in index 635ea33..e2ed865 100644 --- a/lib/src/turns-enums.c.in +++ b/lib/src/turns-enums.c.in @@ -1,35 +1,37 @@ /*** BEGIN file-header ***/ +#include <glib.h> +#include <glib-object.h> +#include <stddef.h> /*** END file-header ***/ /*** BEGIN file-production ***/ + /* enumerations from "@basename@" */ #include "@basename@" /*** END file-production ***/ /*** BEGIN value-header ***/ -GType -@enum_name@_get_type (void) +GType @enum_name@_get_type (void) { static gsize static_g_@type@_type_id; if (g_once_init_enter (&static_g_@type@_type_id)) - { - static const G@Type@Value values[] = { + { + static const G@Type@Value values[] = { /*** END value-header ***/ /*** BEGIN value-production ***/ - { @VALUENAME@, "@VALUENAME@", "@valuenick@" }, + { @VALUENAME@, "@VALUENAME@", "@valuenick@" }, /*** END value-production ***/ /*** BEGIN value-tail ***/ - { 0, NULL, NULL } - }; + { 0, NULL, NULL } + }; - GType g_@type@_type_id = - g_@type@_register_static (g_intern_static_string ("@EnumName@"), values); + GType g_@type@_type_id = g_@type@_register_static (g_intern_static_string ("@EnumName@"), values); - g_once_init_leave (&static_g_@type@_type_id, g_@type@_type_id); - } + g_once_init_leave (&static_g_@type@_type_id, g_@type@_type_id); + } return static_g_@type@_type_id; } |
