diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2011-11-22 11:03:03 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-03-15 14:14:18 +0100 |
commit | 23367c718643e621a08922aaa5be0542fe9c47b7 (patch) | |
tree | 81481c3bed8fe2da6ef6674d4b580ed3c8c00a9c /build-aux | |
parent | 0e9ed6e5fed70c873c597b91a9b844df44f9ffc0 (diff) |
libmm-common: include Errors type information
The code to handle the Errors type information is automatically built with
`glib-mkenums' and the new templates kept under `build-aux'.
Diffstat (limited to 'build-aux')
-rw-r--r-- | build-aux/Makefile.am | 4 | ||||
-rw-r--r-- | build-aux/mm-errors-types.c.template | 43 | ||||
-rw-r--r-- | build-aux/mm-errors-types.h.template | 27 |
3 files changed, 73 insertions, 1 deletions
diff --git a/build-aux/Makefile.am b/build-aux/Makefile.am index 652e9325..9fc2b976 100644 --- a/build-aux/Makefile.am +++ b/build-aux/Makefile.am @@ -3,4 +3,6 @@ EXTRA_DIST = \ header-generator.xsl \ header-generator-new.xsl \ mm-enums-types.h.template \ - mm-enums-types.c.template + mm-enums-types.c.template \ + mm-enums-errors.h.template \ + mm-enums-errors.c.template diff --git a/build-aux/mm-errors-types.c.template b/build-aux/mm-errors-types.c.template new file mode 100644 index 00000000..4505b7d9 --- /dev/null +++ b/build-aux/mm-errors-types.c.template @@ -0,0 +1,43 @@ +/*** BEGIN file-header ***/ +#include "ModemManager-errors.h" +#include "mm-errors-types.h" + +/*** END file-header ***/ + +/*** BEGIN file-production ***/ +/* enumerations from "@filename@" */ +/*** END file-production ***/ + +/*** BEGIN value-header ***/ + +/* @enum_name@_quark() implemented in mm-errors-quarks.c */ + +GType +@enum_name@_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const G@Type@Value values[] = { +/*** END value-header ***/ + +/*** BEGIN value-production ***/ + { @VALUENAME@, "@VALUENAME@", "@valuenick@" }, +/*** END value-production ***/ + +/*** BEGIN value-tail ***/ + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_@type@_register_static (g_intern_static_string ("@EnumName@"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} + +/*** END value-tail ***/ + +/*** BEGIN file-tail ***/ +/*** END file-tail ***/ diff --git a/build-aux/mm-errors-types.h.template b/build-aux/mm-errors-types.h.template new file mode 100644 index 00000000..1a9baf42 --- /dev/null +++ b/build-aux/mm-errors-types.h.template @@ -0,0 +1,27 @@ +/*** BEGIN file-header ***/ + +#ifndef __MM_ERRORS_TYPES_H__ +#define __MM_ERRORS_TYPES_H__ + +#include <glib-object.h> + +G_BEGIN_DECLS +/*** END file-header ***/ + +/*** BEGIN file-production ***/ + +/* enumerations from "@filename@" */ +/*** END file-production ***/ + +/*** BEGIN value-header ***/ +GQuark @enum_name@_quark (void); /* implemented in mm-errors-quarks.c */ +GType @enum_name@_get_type (void) G_GNUC_CONST; +#define @ENUMNAME@ (@enum_name@_quark ()) +#define @ENUMPREFIX@TYPE_@ENUMSHORT@ (@enum_name@_get_type ()) +/*** END value-header ***/ + +/*** BEGIN file-tail ***/ +G_END_DECLS + +#endif /* __MM_ERRORS_TYPES_H__ */ +/*** END file-tail ***/
\ No newline at end of file |