
/* This file is generated by glib-mkenums, do not modify it. This code is licensed under the same license as the containing project. Note that it links to GLib, so must comply with the LGPL linking clauses. */

#include "mm-ublox-enums-types.h"
/* enumerations from "../ModemManager/src/plugins/ublox/mm-modem-helpers-ublox.h" */
static const GEnumValue feature_support_values[] = {
    { FEATURE_SUPPORT_UNKNOWN, "FEATURE_SUPPORT_UNKNOWN", "support-unknown" },
    { FEATURE_SUPPORTED, "FEATURE_SUPPORTED", "supported" },
    { FEATURE_UNSUPPORTED, "FEATURE_UNSUPPORTED", "unsupported" },
    { 0, NULL, NULL }
};

GType
feature_support_get_type (void)
{
    static gsize g_define_type_id_initialized = 0;

    if (g_once_init_enter (&g_define_type_id_initialized)) {
        GType g_define_type_id =
            g_enum_register_static (g_intern_static_string ("FeatureSupport"),
                                      feature_support_values);
        g_once_init_leave (&g_define_type_id_initialized, g_define_type_id);
    }

    return g_define_type_id_initialized;
}

#if defined __FEATURE_SUPPORT_IS_ENUM__
const gchar *
feature_support_get_string (FeatureSupport val)
{
    guint i;

    for (i = 0; feature_support_values[i].value_nick; i++) {
        if ((gint)val == feature_support_values[i].value)
            return feature_support_values[i].value_nick;
    }

    return NULL;
}
#endif

#if defined __FEATURE_SUPPORT_IS_FLAGS__
gchar *
feature_support_build_string_from_mask (FeatureSupport mask)
{
    guint i;
    gboolean first = TRUE;
    GString *str = NULL;

    for (i = 0; feature_support_values[i].value_nick; i++) {
        /* We also look for exact matches */
        if (mask == feature_support_values[i].value) {
            if (str)
                g_string_free (str, TRUE);
            return g_strdup (feature_support_values[i].value_nick);
        }

        /* Build list with single-bit masks */
        if (mask & feature_support_values[i].value) {
            guint c;
            gulong number = feature_support_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 ? "" : ", ",
                                        feature_support_values[i].value_nick);
                if (first)
                    first = FALSE;
            }
        }
    }

    return (str ? g_string_free (str, FALSE) : NULL);
}
#endif
static const GEnumValue settings_update_method_values[] = {
    { SETTINGS_UPDATE_METHOD_UNKNOWN, "SETTINGS_UPDATE_METHOD_UNKNOWN", "unknown" },
    { SETTINGS_UPDATE_METHOD_CFUN, "SETTINGS_UPDATE_METHOD_CFUN", "cfun" },
    { SETTINGS_UPDATE_METHOD_COPS, "SETTINGS_UPDATE_METHOD_COPS", "cops" },
    { 0, NULL, NULL }
};

GType
settings_update_method_get_type (void)
{
    static gsize g_define_type_id_initialized = 0;

    if (g_once_init_enter (&g_define_type_id_initialized)) {
        GType g_define_type_id =
            g_enum_register_static (g_intern_static_string ("SettingsUpdateMethod"),
                                      settings_update_method_values);
        g_once_init_leave (&g_define_type_id_initialized, g_define_type_id);
    }

    return g_define_type_id_initialized;
}

#if defined __SETTINGS_UPDATE_METHOD_IS_ENUM__
const gchar *
settings_update_method_get_string (SettingsUpdateMethod val)
{
    guint i;

    for (i = 0; settings_update_method_values[i].value_nick; i++) {
        if ((gint)val == settings_update_method_values[i].value)
            return settings_update_method_values[i].value_nick;
    }

    return NULL;
}
#endif

#if defined __SETTINGS_UPDATE_METHOD_IS_FLAGS__
gchar *
settings_update_method_build_string_from_mask (SettingsUpdateMethod mask)
{
    guint i;
    gboolean first = TRUE;
    GString *str = NULL;

    for (i = 0; settings_update_method_values[i].value_nick; i++) {
        /* We also look for exact matches */
        if (mask == settings_update_method_values[i].value) {
            if (str)
                g_string_free (str, TRUE);
            return g_strdup (settings_update_method_values[i].value_nick);
        }

        /* Build list with single-bit masks */
        if (mask & settings_update_method_values[i].value) {
            guint c;
            gulong number = settings_update_method_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 ? "" : ", ",
                                        settings_update_method_values[i].value_nick);
                if (first)
                    first = FALSE;
            }
        }
    }

    return (str ? g_string_free (str, FALSE) : NULL);
}
#endif
static const GEnumValue mm_ublox_usb_profile_values[] = {
    { MM_UBLOX_USB_PROFILE_UNKNOWN, "MM_UBLOX_USB_PROFILE_UNKNOWN", "unknown" },
    { MM_UBLOX_USB_PROFILE_RNDIS, "MM_UBLOX_USB_PROFILE_RNDIS", "rndis" },
    { MM_UBLOX_USB_PROFILE_ECM, "MM_UBLOX_USB_PROFILE_ECM", "ecm" },
    { MM_UBLOX_USB_PROFILE_BACK_COMPATIBLE, "MM_UBLOX_USB_PROFILE_BACK_COMPATIBLE", "back-compatible" },
    { 0, NULL, NULL }
};

GType
mm_ublox_usb_profile_get_type (void)
{
    static gsize g_define_type_id_initialized = 0;

    if (g_once_init_enter (&g_define_type_id_initialized)) {
        GType g_define_type_id =
            g_enum_register_static (g_intern_static_string ("MMUbloxUsbProfile"),
                                      mm_ublox_usb_profile_values);
        g_once_init_leave (&g_define_type_id_initialized, g_define_type_id);
    }

    return g_define_type_id_initialized;
}

#if defined __MM_UBLOX_USB_PROFILE_IS_ENUM__
const gchar *
mm_ublox_usb_profile_get_string (MMUbloxUsbProfile val)
{
    guint i;

    for (i = 0; mm_ublox_usb_profile_values[i].value_nick; i++) {
        if ((gint)val == mm_ublox_usb_profile_values[i].value)
            return mm_ublox_usb_profile_values[i].value_nick;
    }

    return NULL;
}
#endif

#if defined __MM_UBLOX_USB_PROFILE_IS_FLAGS__
gchar *
mm_ublox_usb_profile_build_string_from_mask (MMUbloxUsbProfile mask)
{
    guint i;
    gboolean first = TRUE;
    GString *str = NULL;

    for (i = 0; mm_ublox_usb_profile_values[i].value_nick; i++) {
        /* We also look for exact matches */
        if (mask == mm_ublox_usb_profile_values[i].value) {
            if (str)
                g_string_free (str, TRUE);
            return g_strdup (mm_ublox_usb_profile_values[i].value_nick);
        }

        /* Build list with single-bit masks */
        if (mask & mm_ublox_usb_profile_values[i].value) {
            guint c;
            gulong number = mm_ublox_usb_profile_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 ? "" : ", ",
                                        mm_ublox_usb_profile_values[i].value_nick);
                if (first)
                    first = FALSE;
            }
        }
    }

    return (str ? g_string_free (str, FALSE) : NULL);
}
#endif
static const GEnumValue mm_ublox_networking_mode_values[] = {
    { MM_UBLOX_NETWORKING_MODE_UNKNOWN, "MM_UBLOX_NETWORKING_MODE_UNKNOWN", "unknown" },
    { MM_UBLOX_NETWORKING_MODE_ROUTER, "MM_UBLOX_NETWORKING_MODE_ROUTER", "router" },
    { MM_UBLOX_NETWORKING_MODE_BRIDGE, "MM_UBLOX_NETWORKING_MODE_BRIDGE", "bridge" },
    { 0, NULL, NULL }
};

GType
mm_ublox_networking_mode_get_type (void)
{
    static gsize g_define_type_id_initialized = 0;

    if (g_once_init_enter (&g_define_type_id_initialized)) {
        GType g_define_type_id =
            g_enum_register_static (g_intern_static_string ("MMUbloxNetworkingMode"),
                                      mm_ublox_networking_mode_values);
        g_once_init_leave (&g_define_type_id_initialized, g_define_type_id);
    }

    return g_define_type_id_initialized;
}

#if defined __MM_UBLOX_NETWORKING_MODE_IS_ENUM__
const gchar *
mm_ublox_networking_mode_get_string (MMUbloxNetworkingMode val)
{
    guint i;

    for (i = 0; mm_ublox_networking_mode_values[i].value_nick; i++) {
        if ((gint)val == mm_ublox_networking_mode_values[i].value)
            return mm_ublox_networking_mode_values[i].value_nick;
    }

    return NULL;
}
#endif

#if defined __MM_UBLOX_NETWORKING_MODE_IS_FLAGS__
gchar *
mm_ublox_networking_mode_build_string_from_mask (MMUbloxNetworkingMode mask)
{
    guint i;
    gboolean first = TRUE;
    GString *str = NULL;

    for (i = 0; mm_ublox_networking_mode_values[i].value_nick; i++) {
        /* We also look for exact matches */
        if (mask == mm_ublox_networking_mode_values[i].value) {
            if (str)
                g_string_free (str, TRUE);
            return g_strdup (mm_ublox_networking_mode_values[i].value_nick);
        }

        /* Build list with single-bit masks */
        if (mask & mm_ublox_networking_mode_values[i].value) {
            guint c;
            gulong number = mm_ublox_networking_mode_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 ? "" : ", ",
                                        mm_ublox_networking_mode_values[i].value_nick);
                if (first)
                    first = FALSE;
            }
        }
    }

    return (str ? g_string_free (str, FALSE) : NULL);
}
#endif
static const GFlagsValue mm_ublox_bearer_allowed_auth_values[] = {
    { MM_UBLOX_BEARER_ALLOWED_AUTH_UNKNOWN, "MM_UBLOX_BEARER_ALLOWED_AUTH_UNKNOWN", "unknown" },
    { MM_UBLOX_BEARER_ALLOWED_AUTH_NONE, "MM_UBLOX_BEARER_ALLOWED_AUTH_NONE", "none" },
    { MM_UBLOX_BEARER_ALLOWED_AUTH_PAP, "MM_UBLOX_BEARER_ALLOWED_AUTH_PAP", "pap" },
    { MM_UBLOX_BEARER_ALLOWED_AUTH_CHAP, "MM_UBLOX_BEARER_ALLOWED_AUTH_CHAP", "chap" },
    { MM_UBLOX_BEARER_ALLOWED_AUTH_AUTO, "MM_UBLOX_BEARER_ALLOWED_AUTH_AUTO", "auto" },
    { 0, NULL, NULL }
};

GType
mm_ublox_bearer_allowed_auth_get_type (void)
{
    static gsize g_define_type_id_initialized = 0;

    if (g_once_init_enter (&g_define_type_id_initialized)) {
        GType g_define_type_id =
            g_flags_register_static (g_intern_static_string ("MMUbloxBearerAllowedAuth"),
                                      mm_ublox_bearer_allowed_auth_values);
        g_once_init_leave (&g_define_type_id_initialized, g_define_type_id);
    }

    return g_define_type_id_initialized;
}

#if defined __MM_UBLOX_BEARER_ALLOWED_AUTH_IS_ENUM__
const gchar *
mm_ublox_bearer_allowed_auth_get_string (MMUbloxBearerAllowedAuth val)
{
    guint i;

    for (i = 0; mm_ublox_bearer_allowed_auth_values[i].value_nick; i++) {
        if ((gint)val == mm_ublox_bearer_allowed_auth_values[i].value)
            return mm_ublox_bearer_allowed_auth_values[i].value_nick;
    }

    return NULL;
}
#endif

#if defined __MM_UBLOX_BEARER_ALLOWED_AUTH_IS_FLAGS__
gchar *
mm_ublox_bearer_allowed_auth_build_string_from_mask (MMUbloxBearerAllowedAuth mask)
{
    guint i;
    gboolean first = TRUE;
    GString *str = NULL;

    for (i = 0; mm_ublox_bearer_allowed_auth_values[i].value_nick; i++) {
        /* We also look for exact matches */
        if (mask == mm_ublox_bearer_allowed_auth_values[i].value) {
            if (str)
                g_string_free (str, TRUE);
            return g_strdup (mm_ublox_bearer_allowed_auth_values[i].value_nick);
        }

        /* Build list with single-bit masks */
        if (mask & mm_ublox_bearer_allowed_auth_values[i].value) {
            guint c;
            gulong number = mm_ublox_bearer_allowed_auth_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 ? "" : ", ",
                                        mm_ublox_bearer_allowed_auth_values[i].value_nick);
                if (first)
                    first = FALSE;
            }
        }
    }

    return (str ? g_string_free (str, FALSE) : NULL);
}
#endif

/* Generated data ends here */

