summaryrefslogtreecommitdiff
path: root/build-aux/templates/qmi-enum-types.c.template
diff options
context:
space:
mode:
Diffstat (limited to 'build-aux/templates/qmi-enum-types.c.template')
-rw-r--r--build-aux/templates/qmi-enum-types.c.template46
1 files changed, 0 insertions, 46 deletions
diff --git a/build-aux/templates/qmi-enum-types.c.template b/build-aux/templates/qmi-enum-types.c.template
index d2670110..011793ec 100644
--- a/build-aux/templates/qmi-enum-types.c.template
+++ b/build-aux/templates/qmi-enum-types.c.template
@@ -36,7 +36,6 @@ GType
/* Enum-specific method to get the value as a string.
* We get the nick of the GEnumValue. Note that this will be
* valid even if the GEnumClass is not referenced anywhere. */
-#if defined __@ENUMNAME@_IS_ENUM__
const gchar *
@enum_name@_get_string (@EnumName@ val)
{
@@ -49,51 +48,6 @@ const gchar *
return NULL;
}
-#endif /* __@ENUMNAME@_IS_ENUM__ */
-
-/* Flags-specific method to build a string with the given mask.
- * We get a comma separated list of the nicks of the GFlagsValues.
- * Note that this will be valid even if the GFlagsClass is not referenced
- * anywhere. */
-#if defined __@ENUMNAME@_IS_FLAGS__
-gchar *
-@enum_name@_build_string_from_mask (@EnumName@ mask)
-{
- guint i;
- gboolean first = TRUE;
- GString *str = NULL;
-
- for (i = 0; @enum_name@_values[i].value_nick; i++) {
- /* We also look for exact matches */
- if ((guint)mask == @enum_name@_values[i].value) {
- if (str)
- g_string_free (str, TRUE);
- return g_strdup (@enum_name@_values[i].value_nick);
- }
-
- /* Build list with single-bit masks */
- if (mask & @enum_name@_values[i].value) {
- guint c;
- gulong number = @enum_name@_values[i].value;
-
- for (c = 0; number; c++)
- number &= number - 1;
-
- if (c == 1) {
- if (!str)
- str = g_string_new ("");
- g_string_append_printf (str, "%s%s",
- first ? "" : ", ",
- @enum_name@_values[i].value_nick);
- if (first)
- first = FALSE;
- }
- }
- }
-
- return (str ? g_string_free (str, FALSE) : NULL);
-}
-#endif /* __@ENUMNAME@_IS_FLAGS__ */
/*** END value-tail ***/