/*
 * 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;
} FuStructFmap;

FuStructFmap *fu_struct_fmap_ref(FuStructFmap *st) G_GNUC_NON_NULL(1);
void fu_struct_fmap_unref(FuStructFmap *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructFmap, fu_struct_fmap_unref)
FuStructFmap *fu_struct_fmap_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructFmap *fu_struct_fmap_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
gboolean fu_struct_fmap_validate_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_fmap_get_ver_major(const FuStructFmap *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_fmap_get_ver_minor(const FuStructFmap *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint64 fu_struct_fmap_get_base(const FuStructFmap *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_fmap_get_size(const FuStructFmap *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
gchar *fu_struct_fmap_get_name(const FuStructFmap *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_fmap_get_nareas(const FuStructFmap *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_fmap_set_ver_major(FuStructFmap *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_fmap_set_ver_minor(FuStructFmap *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_fmap_set_base(FuStructFmap *st, guint64 value) G_GNUC_NON_NULL(1);
void fu_struct_fmap_set_size(FuStructFmap *st, guint32 value) G_GNUC_NON_NULL(1);
gboolean fu_struct_fmap_set_name(FuStructFmap *st, const gchar *value, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_fmap_set_nareas(FuStructFmap *st, guint16 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_FMAP_OFFSET_SIGNATURE 0x0
#define FU_STRUCT_FMAP_OFFSET_VER_MAJOR 0x8
#define FU_STRUCT_FMAP_OFFSET_VER_MINOR 0x9
#define FU_STRUCT_FMAP_OFFSET_BASE 0xA
#define FU_STRUCT_FMAP_OFFSET_SIZE 0x12
#define FU_STRUCT_FMAP_OFFSET_NAME 0x16
#define FU_STRUCT_FMAP_OFFSET_NAREAS 0x36
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_FMAP_SIZE_SIGNATURE 0x8
#define FU_STRUCT_FMAP_N_ELEMENTS_SIGNATURE 8
#define FU_STRUCT_FMAP_SIZE_NAME 0x20
#define FU_STRUCT_FMAP_N_ELEMENTS_NAME 32
#define FU_STRUCT_FMAP_SIZE 0x38
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_FMAP_DEFAULT_SIGNATURE "__FMAP__"
#define FU_STRUCT_FMAP_DEFAULT_VER_MAJOR 0x1
#define FU_STRUCT_FMAP_DEFAULT_VER_MINOR 0x1
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructFmapArea;

FuStructFmapArea *fu_struct_fmap_area_ref(FuStructFmapArea *st) G_GNUC_NON_NULL(1);
void fu_struct_fmap_area_unref(FuStructFmapArea *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructFmapArea, fu_struct_fmap_area_unref)
FuStructFmapArea *fu_struct_fmap_area_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructFmapArea *fu_struct_fmap_area_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_fmap_area_get_offset(const FuStructFmapArea *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_fmap_area_get_size(const FuStructFmapArea *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
gchar *fu_struct_fmap_area_get_name(const FuStructFmapArea *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_fmap_area_get_flags(const FuStructFmapArea *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_fmap_area_set_offset(FuStructFmapArea *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_fmap_area_set_size(FuStructFmapArea *st, guint32 value) G_GNUC_NON_NULL(1);
gboolean fu_struct_fmap_area_set_name(FuStructFmapArea *st, const gchar *value, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_fmap_area_set_flags(FuStructFmapArea *st, guint16 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_FMAP_AREA_OFFSET_OFFSET 0x0
#define FU_STRUCT_FMAP_AREA_OFFSET_SIZE 0x4
#define FU_STRUCT_FMAP_AREA_OFFSET_NAME 0x8
#define FU_STRUCT_FMAP_AREA_OFFSET_FLAGS 0x28
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_FMAP_AREA_SIZE_NAME 0x20
#define FU_STRUCT_FMAP_AREA_N_ELEMENTS_NAME 32
#define FU_STRUCT_FMAP_AREA_SIZE 0x2A
#endif

#ifndef __GI_SCANNER__
#endif
