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

#pragma once
#include <fu-input-stream.h>
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructDfuFtr;

FuStructDfuFtr *fu_struct_dfu_ftr_ref(FuStructDfuFtr *st) G_GNUC_NON_NULL(1);
void fu_struct_dfu_ftr_unref(FuStructDfuFtr *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructDfuFtr, fu_struct_dfu_ftr_unref)
FuStructDfuFtr *fu_struct_dfu_ftr_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructDfuFtr *fu_struct_dfu_ftr_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
gboolean fu_struct_dfu_ftr_validate_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_dfu_ftr_get_release(const FuStructDfuFtr *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_dfu_ftr_get_pid(const FuStructDfuFtr *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_dfu_ftr_get_vid(const FuStructDfuFtr *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_dfu_ftr_get_ver(const FuStructDfuFtr *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_dfu_ftr_get_len(const FuStructDfuFtr *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_dfu_ftr_get_crc(const FuStructDfuFtr *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_dfu_ftr_set_release(FuStructDfuFtr *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_dfu_ftr_set_pid(FuStructDfuFtr *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_dfu_ftr_set_vid(FuStructDfuFtr *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_dfu_ftr_set_ver(FuStructDfuFtr *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_dfu_ftr_set_len(FuStructDfuFtr *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_dfu_ftr_set_crc(FuStructDfuFtr *st, guint32 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_DFU_FTR_OFFSET_RELEASE 0x0
#define FU_STRUCT_DFU_FTR_OFFSET_PID 0x2
#define FU_STRUCT_DFU_FTR_OFFSET_VID 0x4
#define FU_STRUCT_DFU_FTR_OFFSET_VER 0x6
#define FU_STRUCT_DFU_FTR_OFFSET_SIG 0x8
#define FU_STRUCT_DFU_FTR_OFFSET_LEN 0xB
#define FU_STRUCT_DFU_FTR_OFFSET_CRC 0xC
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_DFU_FTR_SIZE_SIG 0x3
#define FU_STRUCT_DFU_FTR_N_ELEMENTS_SIG 3
#define FU_STRUCT_DFU_FTR_SIZE 0x10
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_DFU_FTR_DEFAULT_SIG "UFD"
#define FU_STRUCT_DFU_FTR_DEFAULT_LEN 16
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructDfuseHdr;

FuStructDfuseHdr *fu_struct_dfuse_hdr_ref(FuStructDfuseHdr *st) G_GNUC_NON_NULL(1);
void fu_struct_dfuse_hdr_unref(FuStructDfuseHdr *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructDfuseHdr, fu_struct_dfuse_hdr_unref)
FuStructDfuseHdr *fu_struct_dfuse_hdr_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructDfuseHdr *fu_struct_dfuse_hdr_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
gboolean fu_struct_dfuse_hdr_validate_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
GBytes *fu_struct_dfuse_hdr_to_bytes(const FuStructDfuseHdr *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_dfuse_hdr_get_image_size(const FuStructDfuseHdr *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_dfuse_hdr_get_targets(const FuStructDfuseHdr *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_dfuse_hdr_set_image_size(FuStructDfuseHdr *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_dfuse_hdr_set_targets(FuStructDfuseHdr *st, guint8 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_DFUSE_HDR_OFFSET_SIG 0x0
#define FU_STRUCT_DFUSE_HDR_OFFSET_VER 0x5
#define FU_STRUCT_DFUSE_HDR_OFFSET_IMAGE_SIZE 0x6
#define FU_STRUCT_DFUSE_HDR_OFFSET_TARGETS 0xA
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_DFUSE_HDR_SIZE_SIG 0x5
#define FU_STRUCT_DFUSE_HDR_N_ELEMENTS_SIG 5
#define FU_STRUCT_DFUSE_HDR_SIZE 0xB
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_DFUSE_HDR_DEFAULT_SIG "DfuSe"
#define FU_STRUCT_DFUSE_HDR_DEFAULT_VER 0x01
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructDfuseImage;

FuStructDfuseImage *fu_struct_dfuse_image_ref(FuStructDfuseImage *st) G_GNUC_NON_NULL(1);
void fu_struct_dfuse_image_unref(FuStructDfuseImage *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructDfuseImage, fu_struct_dfuse_image_unref)
FuStructDfuseImage *fu_struct_dfuse_image_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructDfuseImage *fu_struct_dfuse_image_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
gboolean fu_struct_dfuse_image_validate(const guint8 *buf, gsize bufsz, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
GBytes *fu_struct_dfuse_image_to_bytes(const FuStructDfuseImage *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_dfuse_image_get_alt_setting(const FuStructDfuseImage *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_dfuse_image_get_target_named(const FuStructDfuseImage *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
gchar *fu_struct_dfuse_image_get_target_name(const FuStructDfuseImage *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_dfuse_image_get_target_size(const FuStructDfuseImage *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_dfuse_image_get_chunks(const FuStructDfuseImage *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_dfuse_image_set_alt_setting(FuStructDfuseImage *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_dfuse_image_set_target_named(FuStructDfuseImage *st, guint32 value) G_GNUC_NON_NULL(1);
gboolean fu_struct_dfuse_image_set_target_name(FuStructDfuseImage *st, const gchar *value, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_dfuse_image_set_target_size(FuStructDfuseImage *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_dfuse_image_set_chunks(FuStructDfuseImage *st, guint32 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_DFUSE_IMAGE_OFFSET_SIG 0x0
#define FU_STRUCT_DFUSE_IMAGE_OFFSET_ALT_SETTING 0x6
#define FU_STRUCT_DFUSE_IMAGE_OFFSET_TARGET_NAMED 0x7
#define FU_STRUCT_DFUSE_IMAGE_OFFSET_TARGET_NAME 0xB
#define FU_STRUCT_DFUSE_IMAGE_OFFSET_TARGET_SIZE 0x10A
#define FU_STRUCT_DFUSE_IMAGE_OFFSET_CHUNKS 0x10E
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_DFUSE_IMAGE_SIZE_SIG 0x6
#define FU_STRUCT_DFUSE_IMAGE_N_ELEMENTS_SIG 6
#define FU_STRUCT_DFUSE_IMAGE_SIZE_TARGET_NAME 0xFF
#define FU_STRUCT_DFUSE_IMAGE_N_ELEMENTS_TARGET_NAME 255
#define FU_STRUCT_DFUSE_IMAGE_SIZE 0x112
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_DFUSE_IMAGE_DEFAULT_SIG "Target"
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructDfuseElement;

FuStructDfuseElement *fu_struct_dfuse_element_ref(FuStructDfuseElement *st) G_GNUC_NON_NULL(1);
void fu_struct_dfuse_element_unref(FuStructDfuseElement *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructDfuseElement, fu_struct_dfuse_element_unref)
FuStructDfuseElement *fu_struct_dfuse_element_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructDfuseElement *fu_struct_dfuse_element_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
GBytes *fu_struct_dfuse_element_to_bytes(const FuStructDfuseElement *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_dfuse_element_get_address(const FuStructDfuseElement *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_dfuse_element_get_size(const FuStructDfuseElement *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_dfuse_element_set_address(FuStructDfuseElement *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_dfuse_element_set_size(FuStructDfuseElement *st, guint32 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_DFUSE_ELEMENT_OFFSET_ADDRESS 0x0
#define FU_STRUCT_DFUSE_ELEMENT_OFFSET_SIZE 0x4
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_DFUSE_ELEMENT_SIZE 0x8
#endif

#ifndef __GI_SCANNER__
#endif
