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

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

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

/**
 * m_mtelit_model_get_string:
 * @val: a MMTelitModel.
 *
 * Gets the nickname string for the #MMTelitModel 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 *
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 /* __MM_IS_ENUM_ */

/**
 * m_mtelit_model_build_string_from_mask:
 * @mask: bitmask of MMTelitModel values.
 *
 * Builds a string containing a comma-separated list of nicknames for
 * each #MMTelitModel 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 *
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 /* __MM_IS_FLAGS__ */
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 }
};

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

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

/**
 * m_mtelit_sw_rev_cmp_get_string:
 * @val: a MMTelitSwRevCmp.
 *
 * Gets the nickname string for the #MMTelitSwRevCmp 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 *
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 /* __MM_IS_ENUM_ */

/**
 * m_mtelit_sw_rev_cmp_build_string_from_mask:
 * @mask: bitmask of MMTelitSwRevCmp values.
 *
 * Builds a string containing a comma-separated list of nicknames for
 * each #MMTelitSwRevCmp 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 *
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 /* __MM_IS_FLAGS__ */
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 }
};

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

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

/**
 * mm_telit_qss_status_get_string:
 * @val: a MMTelitQssStatus.
 *
 * Gets the nickname string for the #MMTelitQssStatus 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_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 /* __MM_IS_ENUM_ */

/**
 * mm_telit_qss_status_build_string_from_mask:
 * @mask: bitmask of MMTelitQssStatus values.
 *
 * Builds a string containing a comma-separated list of nicknames for
 * each #MMTelitQssStatus 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_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 /* __MM_IS_FLAGS__ */
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 }
};

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

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

/**
 * mm_telit_csim_lock_state_get_string:
 * @val: a MMTelitCsimLockState.
 *
 * Gets the nickname string for the #MMTelitCsimLockState 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_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 /* __MM_IS_ENUM_ */

/**
 * mm_telit_csim_lock_state_build_string_from_mask:
 * @mask: bitmask of MMTelitCsimLockState values.
 *
 * Builds a string containing a comma-separated list of nicknames for
 * each #MMTelitCsimLockState 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_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 /* __MM_IS_FLAGS__ */

/* Generated data ends here */

