
/* 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-daemon-enums-types.h"
/* enumerations from "/build/modemmanager/src/build/../ModemManager/src/mm-base-bearer.h" */
static const GEnumValue mm_bearer_status_values[] = {
    { MM_BEARER_STATUS_DISCONNECTED, "MM_BEARER_STATUS_DISCONNECTED", "disconnected" },
    { MM_BEARER_STATUS_DISCONNECTING, "MM_BEARER_STATUS_DISCONNECTING", "disconnecting" },
    { MM_BEARER_STATUS_CONNECTING, "MM_BEARER_STATUS_CONNECTING", "connecting" },
    { MM_BEARER_STATUS_CONNECTED, "MM_BEARER_STATUS_CONNECTED", "connected" },
    { 0, NULL, NULL }
};

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

GType
mm_bearer_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 ("MMBearerStatus"),
                                      mm_bearer_status_values);
        g_once_init_leave (&g_define_type_id_initialized, g_define_type_id);
    }

    return g_define_type_id_initialized;
}

/**
 * mm_bearer_status_get_string:
 * @val: a MMBearerStatus.
 *
 * Gets the nickname string for the #MMBearerStatus 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_bearer_status_get_string (MMBearerStatus val)
{
    guint i;

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

    return NULL;
}
#endif /* __MM_IS_ENUM_ */

/**
 * mm_bearer_status_build_string_from_mask:
 * @mask: bitmask of MMBearerStatus values.
 *
 * Builds a string containing a comma-separated list of nicknames for
 * each #MMBearerStatus 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_bearer_status_build_string_from_mask (MMBearerStatus mask)
{
    guint i;
    gboolean first = TRUE;
    GString *str = NULL;

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

        /* Build list with single-bit masks */
        if (mask & mm_bearer_status_values[i].value) {
            guint c;
            gulong number = mm_bearer_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_bearer_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_bearer_connection_status_values[] = {
    { MM_BEARER_CONNECTION_STATUS_UNKNOWN, "MM_BEARER_CONNECTION_STATUS_UNKNOWN", "unknown" },
    { MM_BEARER_CONNECTION_STATUS_DISCONNECTED, "MM_BEARER_CONNECTION_STATUS_DISCONNECTED", "disconnected" },
    { MM_BEARER_CONNECTION_STATUS_DISCONNECTING, "MM_BEARER_CONNECTION_STATUS_DISCONNECTING", "disconnecting" },
    { MM_BEARER_CONNECTION_STATUS_CONNECTED, "MM_BEARER_CONNECTION_STATUS_CONNECTED", "connected" },
    { MM_BEARER_CONNECTION_STATUS_CONNECTION_FAILED, "MM_BEARER_CONNECTION_STATUS_CONNECTION_FAILED", "connection-failed" },
    { 0, NULL, NULL }
};

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

GType
mm_bearer_connection_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 ("MMBearerConnectionStatus"),
                                      mm_bearer_connection_status_values);
        g_once_init_leave (&g_define_type_id_initialized, g_define_type_id);
    }

    return g_define_type_id_initialized;
}

/**
 * mm_bearer_connection_status_get_string:
 * @val: a MMBearerConnectionStatus.
 *
 * Gets the nickname string for the #MMBearerConnectionStatus 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_bearer_connection_status_get_string (MMBearerConnectionStatus val)
{
    guint i;

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

    return NULL;
}
#endif /* __MM_IS_ENUM_ */

/**
 * mm_bearer_connection_status_build_string_from_mask:
 * @mask: bitmask of MMBearerConnectionStatus values.
 *
 * Builds a string containing a comma-separated list of nicknames for
 * each #MMBearerConnectionStatus 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_bearer_connection_status_build_string_from_mask (MMBearerConnectionStatus mask)
{
    guint i;
    gboolean first = TRUE;
    GString *str = NULL;

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

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

    return (str ? g_string_free (str, FALSE) : NULL);
}
#endif /* __MM_IS_FLAGS__ */
/* enumerations from "/build/modemmanager/src/build/../ModemManager/src/mm-filter.h" */
static const GFlagsValue mm_filter_rule_values[] = {
    { MM_FILTER_RULE_NONE, "MM_FILTER_RULE_NONE", "none" },
    { MM_FILTER_RULE_EXPLICIT_WHITELIST, "MM_FILTER_RULE_EXPLICIT_WHITELIST", "explicit-whitelist" },
    { MM_FILTER_RULE_EXPLICIT_BLACKLIST, "MM_FILTER_RULE_EXPLICIT_BLACKLIST", "explicit-blacklist" },
    { MM_FILTER_RULE_PLUGIN_WHITELIST, "MM_FILTER_RULE_PLUGIN_WHITELIST", "plugin-whitelist" },
    { MM_FILTER_RULE_QRTR, "MM_FILTER_RULE_QRTR", "qrtr" },
    { MM_FILTER_RULE_VIRTUAL, "MM_FILTER_RULE_VIRTUAL", "virtual" },
    { MM_FILTER_RULE_NET, "MM_FILTER_RULE_NET", "net" },
    { MM_FILTER_RULE_USBMISC, "MM_FILTER_RULE_USBMISC", "usbmisc" },
    { MM_FILTER_RULE_RPMSG, "MM_FILTER_RULE_RPMSG", "rpmsg" },
    { MM_FILTER_RULE_WWAN, "MM_FILTER_RULE_WWAN", "wwan" },
    { MM_FILTER_RULE_TTY, "MM_FILTER_RULE_TTY", "tty" },
    { MM_FILTER_RULE_TTY_PLATFORM_DRIVER, "MM_FILTER_RULE_TTY_PLATFORM_DRIVER", "tty-platform-driver" },
    { MM_FILTER_RULE_TTY_DRIVER, "MM_FILTER_RULE_TTY_DRIVER", "tty-driver" },
    { MM_FILTER_RULE_TTY_ACM_INTERFACE, "MM_FILTER_RULE_TTY_ACM_INTERFACE", "tty-acm-interface" },
    { MM_FILTER_RULE_TTY_WITH_NET, "MM_FILTER_RULE_TTY_WITH_NET", "tty-with-net" },
    { MM_FILTER_RULE_TTY_DEFAULT_FORBIDDEN, "MM_FILTER_RULE_TTY_DEFAULT_FORBIDDEN", "tty-default-forbidden" },
    { 0, NULL, NULL }
};

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

GType
mm_filter_rule_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 ("MMFilterRule"),
                                      mm_filter_rule_values);
        g_once_init_leave (&g_define_type_id_initialized, g_define_type_id);
    }

    return g_define_type_id_initialized;
}

/**
 * mm_filter_rule_get_string:
 * @val: a MMFilterRule.
 *
 * Gets the nickname string for the #MMFilterRule 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_filter_rule_get_string (MMFilterRule val)
{
    guint i;

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

    return NULL;
}
#endif /* __MM_IS_ENUM_ */

/**
 * mm_filter_rule_build_string_from_mask:
 * @mask: bitmask of MMFilterRule values.
 *
 * Builds a string containing a comma-separated list of nicknames for
 * each #MMFilterRule 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_filter_rule_build_string_from_mask (MMFilterRule mask)
{
    guint i;
    gboolean first = TRUE;
    GString *str = NULL;

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

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

    return (str ? g_string_free (str, FALSE) : NULL);
}
#endif /* __MM_IS_FLAGS__ */
/* enumerations from "/build/modemmanager/src/build/../ModemManager/src/mm-port-probe.h" */
static const GFlagsValue mm_port_probe_flag_values[] = {
    { MM_PORT_PROBE_NONE, "MM_PORT_PROBE_NONE", "none" },
    { MM_PORT_PROBE_AT, "MM_PORT_PROBE_AT", "at" },
    { MM_PORT_PROBE_AT_VENDOR, "MM_PORT_PROBE_AT_VENDOR", "at-vendor" },
    { MM_PORT_PROBE_AT_PRODUCT, "MM_PORT_PROBE_AT_PRODUCT", "at-product" },
    { MM_PORT_PROBE_AT_ICERA, "MM_PORT_PROBE_AT_ICERA", "at-icera" },
    { MM_PORT_PROBE_AT_XMM, "MM_PORT_PROBE_AT_XMM", "at-xmm" },
    { MM_PORT_PROBE_QCDM, "MM_PORT_PROBE_QCDM", "qcdm" },
    { MM_PORT_PROBE_QMI, "MM_PORT_PROBE_QMI", "qmi" },
    { MM_PORT_PROBE_MBIM, "MM_PORT_PROBE_MBIM", "mbim" },
    { 0, NULL, NULL }
};

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

GType
mm_port_probe_flag_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 ("MMPortProbeFlag"),
                                      mm_port_probe_flag_values);
        g_once_init_leave (&g_define_type_id_initialized, g_define_type_id);
    }

    return g_define_type_id_initialized;
}

/**
 * mm_port_probe_flag_get_string:
 * @val: a MMPortProbeFlag.
 *
 * Gets the nickname string for the #MMPortProbeFlag 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_port_probe_flag_get_string (MMPortProbeFlag val)
{
    guint i;

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

    return NULL;
}
#endif /* __MM_IS_ENUM_ */

/**
 * mm_port_probe_flag_build_string_from_mask:
 * @mask: bitmask of MMPortProbeFlag values.
 *
 * Builds a string containing a comma-separated list of nicknames for
 * each #MMPortProbeFlag 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_port_probe_flag_build_string_from_mask (MMPortProbeFlag mask)
{
    guint i;
    gboolean first = TRUE;
    GString *str = NULL;

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

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

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

/* Generated data ends here */

