
/* 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 "/build/modemmanager/src/build/../ModemManager/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 }
};

/* Define type-specific symbols */
#undef __MM_IS_ENUM__
#undef __MM_IS_FLAGS__
#define __MM_IS_ENUM__

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;
}

/**
 * feature_support_get_string:
 * @val: a FeatureSupport.
 *
 * Gets the nickname string for the #FeatureSupport specified at @val.
 *
 * Returns: (transfer none): a string with the nickname, or %NULL if not found. Do not free the returned value.
 */
#if defined __MM_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 /* __MM_IS_ENUM_ */

/**
 * feature_support_build_string_from_mask:
 * @mask: bitmask of FeatureSupport values.
 *
 * Builds a string containing a comma-separated list of nicknames for
 * each #FeatureSupport in @mask.
 *
 * Returns: (transfer full): a string with the list of nicknames, or %NULL if none given. The returned value should be freed with g_free().
 */
#if defined __MM_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 /* __MM_IS_FLAGS__ */
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 }
};

/* Define type-specific symbols */
#undef __MM_IS_ENUM__
#undef __MM_IS_FLAGS__
#define __MM_IS_ENUM__

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;
}

/**
 * settings_update_method_get_string:
 * @val: a SettingsUpdateMethod.
 *
 * Gets the nickname string for the #SettingsUpdateMethod specified at @val.
 *
 * Returns: (transfer none): a string with the nickname, or %NULL if not found. Do not free the returned value.
 */
#if defined __MM_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 /* __MM_IS_ENUM_ */

/**
 * settings_update_method_build_string_from_mask:
 * @mask: bitmask of SettingsUpdateMethod values.
 *
 * Builds a string containing a comma-separated list of nicknames for
 * each #SettingsUpdateMethod in @mask.
 *
 * Returns: (transfer full): a string with the list of nicknames, or %NULL if none given. The returned value should be freed with g_free().
 */
#if defined __MM_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 /* __MM_IS_FLAGS__ */
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 }
};

/* Define type-specific symbols */
#undef __MM_IS_ENUM__
#undef __MM_IS_FLAGS__
#define __MM_IS_ENUM__

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;
}

/**
 * mm_ublox_usb_profile_get_string:
 * @val: a MMUbloxUsbProfile.
 *
 * Gets the nickname string for the #MMUbloxUsbProfile specified at @val.
 *
 * Returns: (transfer none): a string with the nickname, or %NULL if not found. Do not free the returned value.
 */
#if defined __MM_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 /* __MM_IS_ENUM_ */

/**
 * mm_ublox_usb_profile_build_string_from_mask:
 * @mask: bitmask of MMUbloxUsbProfile values.
 *
 * Builds a string containing a comma-separated list of nicknames for
 * each #MMUbloxUsbProfile in @mask.
 *
 * Returns: (transfer full): a string with the list of nicknames, or %NULL if none given. The returned value should be freed with g_free().
 */
#if defined __MM_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 /* __MM_IS_FLAGS__ */
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 }
};

/* Define type-specific symbols */
#undef __MM_IS_ENUM__
#undef __MM_IS_FLAGS__
#define __MM_IS_ENUM__

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;
}

/**
 * mm_ublox_networking_mode_get_string:
 * @val: a MMUbloxNetworkingMode.
 *
 * Gets the nickname string for the #MMUbloxNetworkingMode specified at @val.
 *
 * Returns: (transfer none): a string with the nickname, or %NULL if not found. Do not free the returned value.
 */
#if defined __MM_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 /* __MM_IS_ENUM_ */

/**
 * mm_ublox_networking_mode_build_string_from_mask:
 * @mask: bitmask of MMUbloxNetworkingMode values.
 *
 * Builds a string containing a comma-separated list of nicknames for
 * each #MMUbloxNetworkingMode in @mask.
 *
 * Returns: (transfer full): a string with the list of nicknames, or %NULL if none given. The returned value should be freed with g_free().
 */
#if defined __MM_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 /* __MM_IS_FLAGS__ */
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 }
};

/* Define type-specific symbols */
#undef __MM_IS_ENUM__
#undef __MM_IS_FLAGS__
#define __MM_IS_FLAGS__

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;
}

/**
 * mm_ublox_bearer_allowed_auth_get_string:
 * @val: a MMUbloxBearerAllowedAuth.
 *
 * Gets the nickname string for the #MMUbloxBearerAllowedAuth specified at @val.
 *
 * Returns: (transfer none): a string with the nickname, or %NULL if not found. Do not free the returned value.
 */
#if defined __MM_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 /* __MM_IS_ENUM_ */

/**
 * mm_ublox_bearer_allowed_auth_build_string_from_mask:
 * @mask: bitmask of MMUbloxBearerAllowedAuth values.
 *
 * Builds a string containing a comma-separated list of nicknames for
 * each #MMUbloxBearerAllowedAuth in @mask.
 *
 * Returns: (transfer full): a string with the list of nicknames, or %NULL if none given. The returned value should be freed with g_free().
 */
#if defined __MM_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 /* __MM_IS_FLAGS__ */

/* Generated data ends here */

