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

#pragma once
#include <fu-input-stream.h>
/**
 * FuAtomStringIndex:
 */
typedef enum {
    /**
     * FU_ATOM_STRING_INDEX_PART_NUMBER:
     */
    FU_ATOM_STRING_INDEX_PART_NUMBER = 0x00,
    /**
     * FU_ATOM_STRING_INDEX_ASIC:
     */
    FU_ATOM_STRING_INDEX_ASIC = 0x01,
    /**
     * FU_ATOM_STRING_INDEX_PCI_TYPE:
     */
    FU_ATOM_STRING_INDEX_PCI_TYPE = 0x02,
    /**
     * FU_ATOM_STRING_INDEX_MEMORY_TYPE:
     */
    FU_ATOM_STRING_INDEX_MEMORY_TYPE = 0x03,
}  FuAtomStringIndex;
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructVbiosDate;

FuStructVbiosDate *fu_struct_vbios_date_ref(FuStructVbiosDate *st) G_GNUC_NON_NULL(1);
void fu_struct_vbios_date_unref(FuStructVbiosDate *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructVbiosDate, fu_struct_vbios_date_unref)
gchar *fu_struct_vbios_date_get_month(const FuStructVbiosDate *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
gchar *fu_struct_vbios_date_get_day(const FuStructVbiosDate *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
gchar *fu_struct_vbios_date_get_year(const FuStructVbiosDate *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
gchar *fu_struct_vbios_date_get_hours(const FuStructVbiosDate *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
gchar *fu_struct_vbios_date_get_minutes(const FuStructVbiosDate *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
gchar *fu_struct_vbios_date_get_seconds(const FuStructVbiosDate *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_VBIOS_DATE_OFFSET_MONTH 0x0
#define FU_STRUCT_VBIOS_DATE_OFFSET_DAY 0x3
#define FU_STRUCT_VBIOS_DATE_OFFSET_YEAR 0x6
#define FU_STRUCT_VBIOS_DATE_OFFSET_HOURS 0x9
#define FU_STRUCT_VBIOS_DATE_OFFSET_MINUTES 0xC
#define FU_STRUCT_VBIOS_DATE_OFFSET_SECONDS 0xF
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_VBIOS_DATE_SIZE_MONTH 0x2
#define FU_STRUCT_VBIOS_DATE_N_ELEMENTS_MONTH 2
#define FU_STRUCT_VBIOS_DATE_SIZE_DAY 0x2
#define FU_STRUCT_VBIOS_DATE_N_ELEMENTS_DAY 2
#define FU_STRUCT_VBIOS_DATE_SIZE_YEAR 0x2
#define FU_STRUCT_VBIOS_DATE_N_ELEMENTS_YEAR 2
#define FU_STRUCT_VBIOS_DATE_SIZE_HOURS 0x2
#define FU_STRUCT_VBIOS_DATE_N_ELEMENTS_HOURS 2
#define FU_STRUCT_VBIOS_DATE_SIZE_MINUTES 0x2
#define FU_STRUCT_VBIOS_DATE_N_ELEMENTS_MINUTES 2
#define FU_STRUCT_VBIOS_DATE_SIZE_SECONDS 0x2
#define FU_STRUCT_VBIOS_DATE_N_ELEMENTS_SECONDS 2
#define FU_STRUCT_VBIOS_DATE_SIZE 0x12
#endif

#ifndef __GI_SCANNER__
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructAtomImage;

FuStructAtomImage *fu_struct_atom_image_ref(FuStructAtomImage *st) G_GNUC_NON_NULL(1);
void fu_struct_atom_image_unref(FuStructAtomImage *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructAtomImage, fu_struct_atom_image_unref)
FuStructAtomImage *fu_struct_atom_image_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_atom_image_get_signature(const FuStructAtomImage *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_atom_image_get_size(const FuStructAtomImage *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_atom_image_get_pcir_loc(const FuStructAtomImage *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_atom_image_get_checksum(const FuStructAtomImage *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_atom_image_get_num_strings(const FuStructAtomImage *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_atom_image_get_rom_loc(const FuStructAtomImage *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuStructVbiosDate *fu_struct_atom_image_get_vbios_date(const FuStructAtomImage *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_atom_image_get_oem(const FuStructAtomImage *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_atom_image_get_str_loc(const FuStructAtomImage *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_ATOM_IMAGE_OFFSET_SIGNATURE 0x0
#define FU_STRUCT_ATOM_IMAGE_OFFSET_SIZE 0x2
#define FU_STRUCT_ATOM_IMAGE_OFFSET_PCIR_LOC 0x18
#define FU_STRUCT_ATOM_IMAGE_OFFSET_COMPAT_SIG 0x1E
#define FU_STRUCT_ATOM_IMAGE_OFFSET_CHECKSUM 0x21
#define FU_STRUCT_ATOM_IMAGE_OFFSET_NUM_STRINGS 0x2F
#define FU_STRUCT_ATOM_IMAGE_OFFSET_ROM_LOC 0x48
#define FU_STRUCT_ATOM_IMAGE_OFFSET_VBIOS_DATE 0x50
#define FU_STRUCT_ATOM_IMAGE_OFFSET_OEM 0x62
#define FU_STRUCT_ATOM_IMAGE_OFFSET_STR_LOC 0x6E
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_ATOM_IMAGE_SIZE_COMPAT_SIG 0x3
#define FU_STRUCT_ATOM_IMAGE_N_ELEMENTS_COMPAT_SIG 3
#define FU_STRUCT_ATOM_IMAGE_SIZE 0x72
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_ATOM_IMAGE_DEFAULT_SIGNATURE 0x55aa
#define FU_STRUCT_ATOM_IMAGE_DEFAULT_COMPAT_SIG "IBM"
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructAtomHeaderCommon;

FuStructAtomHeaderCommon *fu_struct_atom_header_common_ref(FuStructAtomHeaderCommon *st) G_GNUC_NON_NULL(1);
void fu_struct_atom_header_common_unref(FuStructAtomHeaderCommon *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructAtomHeaderCommon, fu_struct_atom_header_common_unref)
guint16 fu_struct_atom_header_common_get_size(const FuStructAtomHeaderCommon *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_atom_header_common_get_format_rev(const FuStructAtomHeaderCommon *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_atom_header_common_get_content_rev(const FuStructAtomHeaderCommon *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_ATOM_HEADER_COMMON_OFFSET_SIZE 0x0
#define FU_STRUCT_ATOM_HEADER_COMMON_OFFSET_FORMAT_REV 0x2
#define FU_STRUCT_ATOM_HEADER_COMMON_OFFSET_CONTENT_REV 0x3
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_ATOM_HEADER_COMMON_SIZE 0x4
#endif

#ifndef __GI_SCANNER__
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructAtomRom21Header;

FuStructAtomRom21Header *fu_struct_atom_rom21_header_ref(FuStructAtomRom21Header *st) G_GNUC_NON_NULL(1);
void fu_struct_atom_rom21_header_unref(FuStructAtomRom21Header *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructAtomRom21Header, fu_struct_atom_rom21_header_unref)
FuStructAtomRom21Header *fu_struct_atom_rom21_header_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
gboolean fu_struct_atom_rom21_header_validate_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuStructAtomHeaderCommon *fu_struct_atom_rom21_header_get_header(const FuStructAtomRom21Header *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_atom_rom21_header_get_bios_runtime_seg_addr(const FuStructAtomRom21Header *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_atom_rom21_header_get_protected_mode_info_offset(const FuStructAtomRom21Header *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_atom_rom21_header_get_config_filename_offset(const FuStructAtomRom21Header *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_atom_rom21_header_get_crc_block_offset(const FuStructAtomRom21Header *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_atom_rom21_header_get_bios_bootup_message_offset(const FuStructAtomRom21Header *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_atom_rom21_header_get_int10_offset(const FuStructAtomRom21Header *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_atom_rom21_header_get_pci_bus_dev_init_code(const FuStructAtomRom21Header *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_atom_rom21_header_get_io_base_addr(const FuStructAtomRom21Header *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_atom_rom21_header_get_subsystem_vendor_id(const FuStructAtomRom21Header *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_atom_rom21_header_get_subsystem_id(const FuStructAtomRom21Header *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_atom_rom21_header_get_pci_info_offset(const FuStructAtomRom21Header *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_atom_rom21_header_get_master_command_table_offset(const FuStructAtomRom21Header *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_atom_rom21_header_get_master_data_table_offset(const FuStructAtomRom21Header *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_atom_rom21_header_get_extended_function_code(const FuStructAtomRom21Header *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_atom_rom21_header_get_psp_dir_table_offset(const FuStructAtomRom21Header *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_ATOM_ROM21_HEADER_OFFSET_HEADER 0x0
#define FU_STRUCT_ATOM_ROM21_HEADER_OFFSET_SIGNATURE 0x4
#define FU_STRUCT_ATOM_ROM21_HEADER_OFFSET_BIOS_RUNTIME_SEG_ADDR 0x8
#define FU_STRUCT_ATOM_ROM21_HEADER_OFFSET_PROTECTED_MODE_INFO_OFFSET 0xA
#define FU_STRUCT_ATOM_ROM21_HEADER_OFFSET_CONFIG_FILENAME_OFFSET 0xC
#define FU_STRUCT_ATOM_ROM21_HEADER_OFFSET_CRC_BLOCK_OFFSET 0xE
#define FU_STRUCT_ATOM_ROM21_HEADER_OFFSET_BIOS_BOOTUP_MESSAGE_OFFSET 0x10
#define FU_STRUCT_ATOM_ROM21_HEADER_OFFSET_INT10_OFFSET 0x12
#define FU_STRUCT_ATOM_ROM21_HEADER_OFFSET_PCI_BUS_DEV_INIT_CODE 0x14
#define FU_STRUCT_ATOM_ROM21_HEADER_OFFSET_IO_BASE_ADDR 0x16
#define FU_STRUCT_ATOM_ROM21_HEADER_OFFSET_SUBSYSTEM_VENDOR_ID 0x18
#define FU_STRUCT_ATOM_ROM21_HEADER_OFFSET_SUBSYSTEM_ID 0x1A
#define FU_STRUCT_ATOM_ROM21_HEADER_OFFSET_PCI_INFO_OFFSET 0x1C
#define FU_STRUCT_ATOM_ROM21_HEADER_OFFSET_MASTER_COMMAND_TABLE_OFFSET 0x1E
#define FU_STRUCT_ATOM_ROM21_HEADER_OFFSET_MASTER_DATA_TABLE_OFFSET 0x20
#define FU_STRUCT_ATOM_ROM21_HEADER_OFFSET_EXTENDED_FUNCTION_CODE 0x22
#define FU_STRUCT_ATOM_ROM21_HEADER_OFFSET_PSP_DIR_TABLE_OFFSET 0x24
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_ATOM_ROM21_HEADER_SIZE_SIGNATURE 0x4
#define FU_STRUCT_ATOM_ROM21_HEADER_N_ELEMENTS_SIGNATURE 4
#define FU_STRUCT_ATOM_ROM21_HEADER_SIZE 0x28
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_ATOM_ROM21_HEADER_DEFAULT_SIGNATURE "ATOM"
#endif
