
/* 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-helper-enums-types.h"
/* enumerations from "../ModemManager/src/mm-modem-helpers.h" */
static const GFlagsValue mm_flow_control_values[] = {
    { MM_FLOW_CONTROL_UNKNOWN, "MM_FLOW_CONTROL_UNKNOWN", "unknown" },
    { MM_FLOW_CONTROL_NONE, "MM_FLOW_CONTROL_NONE", "none" },
    { MM_FLOW_CONTROL_XON_XOFF, "MM_FLOW_CONTROL_XON_XOFF", "xon-xoff" },
    { MM_FLOW_CONTROL_RTS_CTS, "MM_FLOW_CONTROL_RTS_CTS", "rts-cts" },
    { 0, NULL, NULL }
};

GType
mm_flow_control_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 ("MMFlowControl"),
                                      mm_flow_control_values);
        g_once_init_leave (&g_define_type_id_initialized, g_define_type_id);
    }

    return g_define_type_id_initialized;
}

#if defined __MM_FLOW_CONTROL_IS_ENUM__
const gchar *
mm_flow_control_get_string (MMFlowControl val)
{
    guint i;

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

    return NULL;
}
#endif

#if defined __MM_FLOW_CONTROL_IS_FLAGS__
gchar *
mm_flow_control_build_string_from_mask (MMFlowControl mask)
{
    guint i;
    gboolean first = TRUE;
    GString *str = NULL;

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

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

    return (str ? g_string_free (str, FALSE) : NULL);
}
#endif
static const GFlagsValue mm_3gpp_cmer_mode_values[] = {
    { MM_3GPP_CMER_MODE_NONE, "MM_3GPP_CMER_MODE_NONE", "none" },
    { MM_3GPP_CMER_MODE_DISCARD_URCS, "MM_3GPP_CMER_MODE_DISCARD_URCS", "discard-urcs" },
    { MM_3GPP_CMER_MODE_DISCARD_URCS_IF_LINK_RESERVED, "MM_3GPP_CMER_MODE_DISCARD_URCS_IF_LINK_RESERVED", "discard-urcs-if-link-reserved" },
    { MM_3GPP_CMER_MODE_BUFFER_URCS_IF_LINK_RESERVED, "MM_3GPP_CMER_MODE_BUFFER_URCS_IF_LINK_RESERVED", "buffer-urcs-if-link-reserved" },
    { MM_3GPP_CMER_MODE_FORWARD_URCS, "MM_3GPP_CMER_MODE_FORWARD_URCS", "forward-urcs" },
    { 0, NULL, NULL }
};

GType
mm_3gpp_cmer_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_flags_register_static (g_intern_static_string ("MM3gppCmerMode"),
                                      mm_3gpp_cmer_mode_values);
        g_once_init_leave (&g_define_type_id_initialized, g_define_type_id);
    }

    return g_define_type_id_initialized;
}

#if defined __MM_3GPP_CMER_MODE_IS_ENUM__
const gchar *
mm_3gpp_cmer_mode_get_string (MM3gppCmerMode val)
{
    guint i;

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

    return NULL;
}
#endif

#if defined __MM_3GPP_CMER_MODE_IS_FLAGS__
gchar *
mm_3gpp_cmer_mode_build_string_from_mask (MM3gppCmerMode mask)
{
    guint i;
    gboolean first = TRUE;
    GString *str = NULL;

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

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

    return (str ? g_string_free (str, FALSE) : NULL);
}
#endif
static const GFlagsValue mm_3gpp_cmer_ind_values[] = {
    { MM_3GPP_CMER_IND_NONE, "MM_3GPP_CMER_IND_NONE", "none" },
    { MM_3GPP_CMER_IND_DISABLE, "MM_3GPP_CMER_IND_DISABLE", "disable" },
    { MM_3GPP_CMER_IND_ENABLE_NOT_CAUSED_BY_CIND, "MM_3GPP_CMER_IND_ENABLE_NOT_CAUSED_BY_CIND", "enable-not-caused-by-cind" },
    { MM_3GPP_CMER_IND_ENABLE_ALL, "MM_3GPP_CMER_IND_ENABLE_ALL", "enable-all" },
    { 0, NULL, NULL }
};

GType
mm_3gpp_cmer_ind_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 ("MM3gppCmerInd"),
                                      mm_3gpp_cmer_ind_values);
        g_once_init_leave (&g_define_type_id_initialized, g_define_type_id);
    }

    return g_define_type_id_initialized;
}

#if defined __MM_3GPP_CMER_IND_IS_ENUM__
const gchar *
mm_3gpp_cmer_ind_get_string (MM3gppCmerInd val)
{
    guint i;

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

    return NULL;
}
#endif

#if defined __MM_3GPP_CMER_IND_IS_FLAGS__
gchar *
mm_3gpp_cmer_ind_build_string_from_mask (MM3gppCmerInd mask)
{
    guint i;
    gboolean first = TRUE;
    GString *str = NULL;

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

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

    return (str ? g_string_free (str, FALSE) : NULL);
}
#endif
static const GEnumValue m_m3gpp_cgev_values[] = {
    { MM_3GPP_CGEV_UNKNOWN, "MM_3GPP_CGEV_UNKNOWN", "unknown" },
    { MM_3GPP_CGEV_NW_DETACH, "MM_3GPP_CGEV_NW_DETACH", "nw-detach" },
    { MM_3GPP_CGEV_ME_DETACH, "MM_3GPP_CGEV_ME_DETACH", "me-detach" },
    { MM_3GPP_CGEV_NW_CLASS, "MM_3GPP_CGEV_NW_CLASS", "nw-class" },
    { MM_3GPP_CGEV_ME_CLASS, "MM_3GPP_CGEV_ME_CLASS", "me-class" },
    { MM_3GPP_CGEV_NW_ACT_PRIMARY, "MM_3GPP_CGEV_NW_ACT_PRIMARY", "nw-act-primary" },
    { MM_3GPP_CGEV_ME_ACT_PRIMARY, "MM_3GPP_CGEV_ME_ACT_PRIMARY", "me-act-primary" },
    { MM_3GPP_CGEV_NW_ACT_SECONDARY, "MM_3GPP_CGEV_NW_ACT_SECONDARY", "nw-act-secondary" },
    { MM_3GPP_CGEV_ME_ACT_SECONDARY, "MM_3GPP_CGEV_ME_ACT_SECONDARY", "me-act-secondary" },
    { MM_3GPP_CGEV_NW_DEACT_PRIMARY, "MM_3GPP_CGEV_NW_DEACT_PRIMARY", "nw-deact-primary" },
    { MM_3GPP_CGEV_ME_DEACT_PRIMARY, "MM_3GPP_CGEV_ME_DEACT_PRIMARY", "me-deact-primary" },
    { MM_3GPP_CGEV_NW_DEACT_SECONDARY, "MM_3GPP_CGEV_NW_DEACT_SECONDARY", "nw-deact-secondary" },
    { MM_3GPP_CGEV_ME_DEACT_SECONDARY, "MM_3GPP_CGEV_ME_DEACT_SECONDARY", "me-deact-secondary" },
    { MM_3GPP_CGEV_NW_DEACT_PDP, "MM_3GPP_CGEV_NW_DEACT_PDP", "nw-deact-pdp" },
    { MM_3GPP_CGEV_ME_DEACT_PDP, "MM_3GPP_CGEV_ME_DEACT_PDP", "me-deact-pdp" },
    { MM_3GPP_CGEV_NW_MODIFY, "MM_3GPP_CGEV_NW_MODIFY", "nw-modify" },
    { MM_3GPP_CGEV_ME_MODIFY, "MM_3GPP_CGEV_ME_MODIFY", "me-modify" },
    { MM_3GPP_CGEV_REJECT, "MM_3GPP_CGEV_REJECT", "reject" },
    { MM_3GPP_CGEV_NW_REACT, "MM_3GPP_CGEV_NW_REACT", "nw-react" },
    { 0, NULL, NULL }
};

GType
m_m3gpp_cgev_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 ("MM3gppCgev"),
                                      m_m3gpp_cgev_values);
        g_once_init_leave (&g_define_type_id_initialized, g_define_type_id);
    }

    return g_define_type_id_initialized;
}

#if defined __M_M3GPP_CGEV_IS_ENUM__
const gchar *
m_m3gpp_cgev_get_string (MM3gppCgev val)
{
    guint i;

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

    return NULL;
}
#endif

#if defined __M_M3GPP_CGEV_IS_FLAGS__
gchar *
m_m3gpp_cgev_build_string_from_mask (MM3gppCgev mask)
{
    guint i;
    gboolean first = TRUE;
    GString *str = NULL;

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

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

    return (str ? g_string_free (str, FALSE) : NULL);
}
#endif
/* enumerations from "../ModemManager/src/mm-sms-part.h" */
static const GEnumValue mm_sms_encoding_values[] = {
    { MM_SMS_ENCODING_UNKNOWN, "MM_SMS_ENCODING_UNKNOWN", "unknown" },
    { MM_SMS_ENCODING_GSM7, "MM_SMS_ENCODING_GSM7", "gsm7" },
    { MM_SMS_ENCODING_8BIT, "MM_SMS_ENCODING_8BIT", "8bit" },
    { MM_SMS_ENCODING_UCS2, "MM_SMS_ENCODING_UCS2", "ucs2" },
    { 0, NULL, NULL }
};

GType
mm_sms_encoding_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 ("MMSmsEncoding"),
                                      mm_sms_encoding_values);
        g_once_init_leave (&g_define_type_id_initialized, g_define_type_id);
    }

    return g_define_type_id_initialized;
}

#if defined __MM_SMS_ENCODING_IS_ENUM__
const gchar *
mm_sms_encoding_get_string (MMSmsEncoding val)
{
    guint i;

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

    return NULL;
}
#endif

#if defined __MM_SMS_ENCODING_IS_FLAGS__
gchar *
mm_sms_encoding_build_string_from_mask (MMSmsEncoding mask)
{
    guint i;
    gboolean first = TRUE;
    GString *str = NULL;

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

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

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

/* Generated data ends here */

