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

#pragma once
#include <fu-input-stream.h>
/**
 * FuUswidHeaderFlags:
 */
typedef enum {
    /**
     * FU_USWID_HEADER_FLAG_NONE:
     */
    FU_USWID_HEADER_FLAG_NONE = 0x0,
    /**
     * FU_USWID_HEADER_FLAG_COMPRESSED:
     */
    FU_USWID_HEADER_FLAG_COMPRESSED = 0x1,
}  FuUswidHeaderFlags;
/**
 * FuUswidPayloadCompression:
 */
typedef enum {
    /**
     * FU_USWID_PAYLOAD_COMPRESSION_NONE:
     */
    FU_USWID_PAYLOAD_COMPRESSION_NONE = 0x00,
    /**
     * FU_USWID_PAYLOAD_COMPRESSION_ZLIB:
     */
    FU_USWID_PAYLOAD_COMPRESSION_ZLIB = 0x01,
    /**
     * FU_USWID_PAYLOAD_COMPRESSION_LZMA:
     */
    FU_USWID_PAYLOAD_COMPRESSION_LZMA = 0x02,
}  FuUswidPayloadCompression;
const gchar *fu_uswid_payload_compression_to_string(FuUswidPayloadCompression val) G_GNUC_CONST;
FuUswidPayloadCompression fu_uswid_payload_compression_from_string(const gchar *val) G_GNUC_CONST G_GNUC_NON_NULL(1);
/**
 * FuUswidPayloadFormat:
 */
typedef enum {
    /**
     * FU_USWID_PAYLOAD_FORMAT_COSWID:
     */
    FU_USWID_PAYLOAD_FORMAT_COSWID = 0x00,
    /**
     * FU_USWID_PAYLOAD_FORMAT_CYCLONEDX:
     */
    FU_USWID_PAYLOAD_FORMAT_CYCLONEDX = 0x01,
    /**
     * FU_USWID_PAYLOAD_FORMAT_SPDX:
     */
    FU_USWID_PAYLOAD_FORMAT_SPDX = 0x02,
}  FuUswidPayloadFormat;
const gchar *fu_uswid_payload_format_to_string(FuUswidPayloadFormat val) G_GNUC_CONST;
FuUswidPayloadFormat fu_uswid_payload_format_from_string(const gchar *val) G_GNUC_CONST G_GNUC_NON_NULL(1);
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructUswid;

FuStructUswid *fu_struct_uswid_ref(FuStructUswid *st) G_GNUC_NON_NULL(1);
void fu_struct_uswid_unref(FuStructUswid *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructUswid, fu_struct_uswid_unref)
FuStructUswid *fu_struct_uswid_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructUswid *fu_struct_uswid_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
gboolean fu_struct_uswid_validate_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_uswid_get_hdrver(const FuStructUswid *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_uswid_get_hdrsz(const FuStructUswid *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_uswid_get_payloadsz(const FuStructUswid *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuUswidHeaderFlags fu_struct_uswid_get_flags(const FuStructUswid *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuUswidPayloadCompression fu_struct_uswid_get_compression(const FuStructUswid *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuUswidPayloadFormat fu_struct_uswid_get_format(const FuStructUswid *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_uswid_set_hdrver(FuStructUswid *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_uswid_set_hdrsz(FuStructUswid *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_uswid_set_payloadsz(FuStructUswid *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_uswid_set_flags(FuStructUswid *st, FuUswidHeaderFlags value) G_GNUC_NON_NULL(1);
void fu_struct_uswid_set_compression(FuStructUswid *st, FuUswidPayloadCompression value) G_GNUC_NON_NULL(1);
void fu_struct_uswid_set_format(FuStructUswid *st, FuUswidPayloadFormat value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_USWID_OFFSET_MAGIC 0x0
#define FU_STRUCT_USWID_OFFSET_HDRVER 0x10
#define FU_STRUCT_USWID_OFFSET_HDRSZ 0x11
#define FU_STRUCT_USWID_OFFSET_PAYLOADSZ 0x13
#define FU_STRUCT_USWID_OFFSET_FLAGS 0x17
#define FU_STRUCT_USWID_OFFSET_COMPRESSION 0x18
#define FU_STRUCT_USWID_OFFSET_FORMAT 0x19
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_USWID_SIZE 0x1A
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_USWID_DEFAULT_MAGIC "\x53\x42\x4f\x4d\xd6\xba\x2e\xac\xa3\xe6\x7a\x52\xaa\xee\x3b\xaf"
#define FU_STRUCT_USWID_DEFAULT_HDRVER 0x04
#define FU_STRUCT_USWID_DEFAULT_HDRSZ 26
#define FU_STRUCT_USWID_DEFAULT_COMPRESSION FU_USWID_PAYLOAD_COMPRESSION_NONE
#define FU_STRUCT_USWID_DEFAULT_FORMAT FU_USWID_PAYLOAD_FORMAT_COSWID
#endif
