
/* 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-telit-enums-types.h"
/* enumerations from "../ModemManager/src/plugins/telit/mm-modem-helpers-telit.h" */
static const GEnumValue m_mtelit_model_values[] = {
    { MM_TELIT_MODEL_DEFAULT, "MM_TELIT_MODEL_DEFAULT", "default" },
    { MM_TELIT_MODEL_FN980, "MM_TELIT_MODEL_FN980", "fn980" },
    { MM_TELIT_MODEL_LE910C1, "MM_TELIT_MODEL_LE910C1", "le910c1" },
    { MM_TELIT_MODEL_LM940, "MM_TELIT_MODEL_LM940", "lm940" },
    { MM_TELIT_MODEL_LM960, "MM_TELIT_MODEL_LM960", "lm960" },
    { MM_TELIT_MODEL_LN920, "MM_TELIT_MODEL_LN920", "ln920" },
    { MM_TELIT_MODEL_FN990, "MM_TELIT_MODEL_FN990", "fn990" },
    { 0, NULL, NULL }
};

GType
m_mtelit_model_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 ("MMTelitModel"),
                                      m_mtelit_model_values);
        g_once_init_leave (&g_define_type_id_initialized, g_define_type_id);
    }

    return g_define_type_id_initialized;
}

#if defined __M_MTELIT_MODEL_IS_ENUM__
const gchar *
m_mtelit_model_get_string (MMTelitModel val)
{
    guint i;

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

    return NULL;
}
#endif

#if defined __M_MTELIT_MODEL_IS_FLAGS__
gchar *
m_mtelit_model_build_string_from_mask (MMTelitModel mask)
{
    guint i;
    gboolean first = TRUE;
    GString *str = NULL;

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

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

    return (str ? g_string_free (str, FALSE) : NULL);
}
#endif
static const GEnumValue m_mtelit_sw_rev_cmp_values[] = {
    { MM_TELIT_SW_REV_CMP_INVALID, "MM_TELIT_SW_REV_CMP_INVALID", "invalid" },
    { MM_TELIT_SW_REV_CMP_UNSUPPORTED, "MM_TELIT_SW_REV_CMP_UNSUPPORTED", "unsupported" },
    { MM_TELIT_SW_REV_CMP_OLDER, "MM_TELIT_SW_REV_CMP_OLDER", "older" },
    { MM_TELIT_SW_REV_CMP_EQUAL, "MM_TELIT_SW_REV_CMP_EQUAL", "equal" },
    { MM_TELIT_SW_REV_CMP_NEWER, "MM_TELIT_SW_REV_CMP_NEWER", "newer" },
    { 0, NULL, NULL }
};

GType
m_mtelit_sw_rev_cmp_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 ("MMTelitSwRevCmp"),
                                      m_mtelit_sw_rev_cmp_values);
        g_once_init_leave (&g_define_type_id_initialized, g_define_type_id);
    }

    return g_define_type_id_initialized;
}

#if defined __M_MTELIT_SW_REV_CMP_IS_ENUM__
const gchar *
m_mtelit_sw_rev_cmp_get_string (MMTelitSwRevCmp val)
{
    guint i;

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

    return NULL;
}
#endif

#if defined __M_MTELIT_SW_REV_CMP_IS_FLAGS__
gchar *
m_mtelit_sw_rev_cmp_build_string_from_mask (MMTelitSwRevCmp mask)
{
    guint i;
    gboolean first = TRUE;
    GString *str = NULL;

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

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

    return (str ? g_string_free (str, FALSE) : NULL);
}
#endif
static const GEnumValue mm_telit_qss_status_values[] = {
    { QSS_STATUS_UNKNOWN, "QSS_STATUS_UNKNOWN", "unknown" },
    { QSS_STATUS_SIM_REMOVED, "QSS_STATUS_SIM_REMOVED", "sim-removed" },
    { QSS_STATUS_SIM_INSERTED, "QSS_STATUS_SIM_INSERTED", "sim-inserted" },
    { QSS_STATUS_SIM_INSERTED_AND_UNLOCKED, "QSS_STATUS_SIM_INSERTED_AND_UNLOCKED", "sim-inserted-and-unlocked" },
    { QSS_STATUS_SIM_INSERTED_AND_READY, "QSS_STATUS_SIM_INSERTED_AND_READY", "sim-inserted-and-ready" },
    { 0, NULL, NULL }
};

GType
mm_telit_qss_status_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 ("MMTelitQssStatus"),
                                      mm_telit_qss_status_values);
        g_once_init_leave (&g_define_type_id_initialized, g_define_type_id);
    }

    return g_define_type_id_initialized;
}

#if defined __MM_TELIT_QSS_STATUS_IS_ENUM__
const gchar *
mm_telit_qss_status_get_string (MMTelitQssStatus val)
{
    guint i;

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

    return NULL;
}
#endif

#if defined __MM_TELIT_QSS_STATUS_IS_FLAGS__
gchar *
mm_telit_qss_status_build_string_from_mask (MMTelitQssStatus mask)
{
    guint i;
    gboolean first = TRUE;
    GString *str = NULL;

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

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

    return (str ? g_string_free (str, FALSE) : NULL);
}
#endif
static const GEnumValue mm_telit_csim_lock_state_values[] = {
    { CSIM_LOCK_STATE_UNKNOWN, "CSIM_LOCK_STATE_UNKNOWN", "unknown" },
    { CSIM_LOCK_STATE_UNLOCKED, "CSIM_LOCK_STATE_UNLOCKED", "unlocked" },
    { CSIM_LOCK_STATE_LOCK_REQUESTED, "CSIM_LOCK_STATE_LOCK_REQUESTED", "lock-requested" },
    { CSIM_LOCK_STATE_LOCKED, "CSIM_LOCK_STATE_LOCKED", "locked" },
    { 0, NULL, NULL }
};

GType
mm_telit_csim_lock_state_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 ("MMTelitCsimLockState"),
                                      mm_telit_csim_lock_state_values);
        g_once_init_leave (&g_define_type_id_initialized, g_define_type_id);
    }

    return g_define_type_id_initialized;
}

#if defined __MM_TELIT_CSIM_LOCK_STATE_IS_ENUM__
const gchar *
mm_telit_csim_lock_state_get_string (MMTelitCsimLockState val)
{
    guint i;

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

    return NULL;
}
#endif

#if defined __MM_TELIT_CSIM_LOCK_STATE_IS_FLAGS__
gchar *
mm_telit_csim_lock_state_build_string_from_mask (MMTelitCsimLockState mask)
{
    guint i;
    gboolean first = TRUE;
    GString *str = NULL;

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

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

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

/* Generated data ends here */

