/*
 * This file is auto-generated, do not modify!
 *
 * SPDX-License-Identifier: LGPL-2.1-or-later
 */

#include "config.h"

#include <glib.h>

#include "fu-crc-struct.h"

#ifdef G_LOG_DOMAIN
  #undef G_LOG_DOMAIN
#endif
#define G_LOG_DOMAIN "FuStruct"

/**
 * fu_crc_kind_to_string:
 * @val: value, e.g. %FU_CRC_KIND_B32_STANDARD
 *
 * Converts an enumerated value to a string.
 *
 * Returns: identifier string
 **/
const gchar *
fu_crc_kind_to_string(FuCrcKind val)
{
    if (val == FU_CRC_KIND_B32_STANDARD)
        return "b32-standard";
    if (val == FU_CRC_KIND_B32_BZIP2)
        return "b32-bzip2";
    if (val == FU_CRC_KIND_B32_JAMCRC)
        return "b32-jamcrc";
    if (val == FU_CRC_KIND_B32_MPEG2)
        return "b32-mpeg2";
    if (val == FU_CRC_KIND_B32_POSIX)
        return "b32-posix";
    if (val == FU_CRC_KIND_B32_SATA)
        return "b32-sata";
    if (val == FU_CRC_KIND_B32_XFER)
        return "b32-xfer";
    if (val == FU_CRC_KIND_B32C)
        return "b32c";
    if (val == FU_CRC_KIND_B32D)
        return "b32d";
    if (val == FU_CRC_KIND_B32Q)
        return "b32q";
    if (val == FU_CRC_KIND_B16_XMODEM)
        return "b16-xmodem";
    if (val == FU_CRC_KIND_B16_KERMIT)
        return "b16-kermit";
    if (val == FU_CRC_KIND_B16_USB)
        return "b16-usb";
    if (val == FU_CRC_KIND_B16_UMTS)
        return "b16-umts";
    if (val == FU_CRC_KIND_B16_TMS37157)
        return "b16-tms37157";
    if (val == FU_CRC_KIND_B16_BNR)
        return "b16-bnr";
    if (val == FU_CRC_KIND_B8_WCDMA)
        return "b8-wcdma";
    if (val == FU_CRC_KIND_B8_TECH3250)
        return "b8-tech3250";
    if (val == FU_CRC_KIND_B8_STANDARD)
        return "b8-standard";
    if (val == FU_CRC_KIND_B8_SAE_J1850)
        return "b8-sae-j1850";
    if (val == FU_CRC_KIND_B8_ROHC)
        return "b8-rohc";
    if (val == FU_CRC_KIND_B8_OPENSAFETY)
        return "b8-opensafety";
    if (val == FU_CRC_KIND_B8_NRSC5)
        return "b8-nrsc5";
    if (val == FU_CRC_KIND_B8_MIFARE_MAD)
        return "b8-mifare-mad";
    if (val == FU_CRC_KIND_B8_MAXIM_DOW)
        return "b8-maxim-dow";
    if (val == FU_CRC_KIND_B8_LTE)
        return "b8-lte";
    if (val == FU_CRC_KIND_B8_I_CODE)
        return "b8-i-code";
    if (val == FU_CRC_KIND_B8_ITU)
        return "b8-itu";
    if (val == FU_CRC_KIND_B8_HITAG)
        return "b8-hitag";
    if (val == FU_CRC_KIND_B8_GSM_B)
        return "b8-gsm-b";
    if (val == FU_CRC_KIND_B8_GSM_A)
        return "b8-gsm-a";
    if (val == FU_CRC_KIND_B8_DVB_S2)
        return "b8-dvb-s2";
    if (val == FU_CRC_KIND_B8_DARC)
        return "b8-darc";
    if (val == FU_CRC_KIND_B8_CDMA2000)
        return "b8-cdma2000";
    if (val == FU_CRC_KIND_B8_BLUETOOTH)
        return "b8-bluetooth";
    if (val == FU_CRC_KIND_B8_AUTOSAR)
        return "b8-autosar";
    return NULL;
}
/**
 * fu_crc_kind_from_string:
 * @val: (nullable): a string, e.g. `b32-standard`
 *
 * Converts a string to an enumerated value.
 *
 * Returns: enumerated value
 **/
FuCrcKind
fu_crc_kind_from_string(const gchar *val)
{
    if (g_strcmp0(val, "b32-standard") == 0)
        return FU_CRC_KIND_B32_STANDARD;
    if (g_strcmp0(val, "b32-bzip2") == 0)
        return FU_CRC_KIND_B32_BZIP2;
    if (g_strcmp0(val, "b32-jamcrc") == 0)
        return FU_CRC_KIND_B32_JAMCRC;
    if (g_strcmp0(val, "b32-mpeg2") == 0)
        return FU_CRC_KIND_B32_MPEG2;
    if (g_strcmp0(val, "b32-posix") == 0)
        return FU_CRC_KIND_B32_POSIX;
    if (g_strcmp0(val, "b32-sata") == 0)
        return FU_CRC_KIND_B32_SATA;
    if (g_strcmp0(val, "b32-xfer") == 0)
        return FU_CRC_KIND_B32_XFER;
    if (g_strcmp0(val, "b32c") == 0)
        return FU_CRC_KIND_B32C;
    if (g_strcmp0(val, "b32d") == 0)
        return FU_CRC_KIND_B32D;
    if (g_strcmp0(val, "b32q") == 0)
        return FU_CRC_KIND_B32Q;
    if (g_strcmp0(val, "b16-xmodem") == 0)
        return FU_CRC_KIND_B16_XMODEM;
    if (g_strcmp0(val, "b16-kermit") == 0)
        return FU_CRC_KIND_B16_KERMIT;
    if (g_strcmp0(val, "b16-usb") == 0)
        return FU_CRC_KIND_B16_USB;
    if (g_strcmp0(val, "b16-umts") == 0)
        return FU_CRC_KIND_B16_UMTS;
    if (g_strcmp0(val, "b16-tms37157") == 0)
        return FU_CRC_KIND_B16_TMS37157;
    if (g_strcmp0(val, "b16-bnr") == 0)
        return FU_CRC_KIND_B16_BNR;
    if (g_strcmp0(val, "b8-wcdma") == 0)
        return FU_CRC_KIND_B8_WCDMA;
    if (g_strcmp0(val, "b8-tech3250") == 0)
        return FU_CRC_KIND_B8_TECH3250;
    if (g_strcmp0(val, "b8-standard") == 0)
        return FU_CRC_KIND_B8_STANDARD;
    if (g_strcmp0(val, "b8-sae-j1850") == 0)
        return FU_CRC_KIND_B8_SAE_J1850;
    if (g_strcmp0(val, "b8-rohc") == 0)
        return FU_CRC_KIND_B8_ROHC;
    if (g_strcmp0(val, "b8-opensafety") == 0)
        return FU_CRC_KIND_B8_OPENSAFETY;
    if (g_strcmp0(val, "b8-nrsc5") == 0)
        return FU_CRC_KIND_B8_NRSC5;
    if (g_strcmp0(val, "b8-mifare-mad") == 0)
        return FU_CRC_KIND_B8_MIFARE_MAD;
    if (g_strcmp0(val, "b8-maxim-dow") == 0)
        return FU_CRC_KIND_B8_MAXIM_DOW;
    if (g_strcmp0(val, "b8-lte") == 0)
        return FU_CRC_KIND_B8_LTE;
    if (g_strcmp0(val, "b8-i-code") == 0)
        return FU_CRC_KIND_B8_I_CODE;
    if (g_strcmp0(val, "b8-itu") == 0)
        return FU_CRC_KIND_B8_ITU;
    if (g_strcmp0(val, "b8-hitag") == 0)
        return FU_CRC_KIND_B8_HITAG;
    if (g_strcmp0(val, "b8-gsm-b") == 0)
        return FU_CRC_KIND_B8_GSM_B;
    if (g_strcmp0(val, "b8-gsm-a") == 0)
        return FU_CRC_KIND_B8_GSM_A;
    if (g_strcmp0(val, "b8-dvb-s2") == 0)
        return FU_CRC_KIND_B8_DVB_S2;
    if (g_strcmp0(val, "b8-darc") == 0)
        return FU_CRC_KIND_B8_DARC;
    if (g_strcmp0(val, "b8-cdma2000") == 0)
        return FU_CRC_KIND_B8_CDMA2000;
    if (g_strcmp0(val, "b8-bluetooth") == 0)
        return FU_CRC_KIND_B8_BLUETOOTH;
    if (g_strcmp0(val, "b8-autosar") == 0)
        return FU_CRC_KIND_B8_AUTOSAR;
    return FU_CRC_KIND_UNKNOWN;
}
