/* auto-generated, do not modify */
#pragma once
#include <fwupd-common.h>
typedef enum {
    FU_CAB_COMPRESSION_NONE = 0x0000,
    FU_CAB_COMPRESSION_MSZIP = 0x0001,
    FU_CAB_COMPRESSION_QUANTUM = 0x0002,
    FU_CAB_COMPRESSION_LZX = 0x0003,
} FuCabCompression;
const gchar *fu_cab_compression_to_string(FuCabCompression val);
typedef enum {
    FU_CAB_FILE_ATTRIBUTE_NONE = 0x00,
    FU_CAB_FILE_ATTRIBUTE_READONLY = 0x01,
    FU_CAB_FILE_ATTRIBUTE_HIDDEN = 0x02,
    FU_CAB_FILE_ATTRIBUTE_SYSTEM = 0x04,
    FU_CAB_FILE_ATTRIBUTE_ARCH = 0x20,
    FU_CAB_FILE_ATTRIBUTE_EXEC = 0x40,
    FU_CAB_FILE_ATTRIBUTE_NAME_UTF8 = 0x80,
} FuCabFileAttribute;

GByteArray *fu_struct_cab_data_new(void);
GByteArray *fu_struct_cab_data_parse_bytes(GBytes *blob, gsize offset, GError **error);
guint32 fu_struct_cab_data_get_checksum(const GByteArray *st);
guint16 fu_struct_cab_data_get_comp(const GByteArray *st);
guint16 fu_struct_cab_data_get_uncomp(const GByteArray *st);
void fu_struct_cab_data_set_checksum(GByteArray *st, guint32 value);
void fu_struct_cab_data_set_comp(GByteArray *st, guint16 value);
void fu_struct_cab_data_set_uncomp(GByteArray *st, guint16 value);
#define FU_STRUCT_CAB_DATA_OFFSET_CHECKSUM 0x0
#define FU_STRUCT_CAB_DATA_OFFSET_COMP 0x4
#define FU_STRUCT_CAB_DATA_OFFSET_UNCOMP 0x6
#define FU_STRUCT_CAB_DATA_SIZE 0x8

GByteArray *fu_struct_cab_file_new(void);
GByteArray *fu_struct_cab_file_parse_bytes(GBytes *blob, gsize offset, GError **error);
guint32 fu_struct_cab_file_get_usize(const GByteArray *st);
guint32 fu_struct_cab_file_get_uoffset(const GByteArray *st);
guint16 fu_struct_cab_file_get_index(const GByteArray *st);
guint16 fu_struct_cab_file_get_date(const GByteArray *st);
guint16 fu_struct_cab_file_get_time(const GByteArray *st);
FuCabFileAttribute fu_struct_cab_file_get_fattr(const GByteArray *st);
void fu_struct_cab_file_set_usize(GByteArray *st, guint32 value);
void fu_struct_cab_file_set_uoffset(GByteArray *st, guint32 value);
void fu_struct_cab_file_set_index(GByteArray *st, guint16 value);
void fu_struct_cab_file_set_date(GByteArray *st, guint16 value);
void fu_struct_cab_file_set_time(GByteArray *st, guint16 value);
void fu_struct_cab_file_set_fattr(GByteArray *st, FuCabFileAttribute value);
#define FU_STRUCT_CAB_FILE_OFFSET_USIZE 0x0
#define FU_STRUCT_CAB_FILE_OFFSET_UOFFSET 0x4
#define FU_STRUCT_CAB_FILE_OFFSET_INDEX 0x8
#define FU_STRUCT_CAB_FILE_OFFSET_DATE 0xA
#define FU_STRUCT_CAB_FILE_OFFSET_TIME 0xC
#define FU_STRUCT_CAB_FILE_OFFSET_FATTR 0xE
#define FU_STRUCT_CAB_FILE_SIZE 0x10

GByteArray *fu_struct_cab_folder_new(void);
GByteArray *fu_struct_cab_folder_parse_bytes(GBytes *blob, gsize offset, GError **error);
guint32 fu_struct_cab_folder_get_offset(const GByteArray *st);
guint16 fu_struct_cab_folder_get_ndatab(const GByteArray *st);
FuCabCompression fu_struct_cab_folder_get_compression(const GByteArray *st);
void fu_struct_cab_folder_set_offset(GByteArray *st, guint32 value);
void fu_struct_cab_folder_set_ndatab(GByteArray *st, guint16 value);
void fu_struct_cab_folder_set_compression(GByteArray *st, FuCabCompression value);
#define FU_STRUCT_CAB_FOLDER_OFFSET_OFFSET 0x0
#define FU_STRUCT_CAB_FOLDER_OFFSET_NDATAB 0x4
#define FU_STRUCT_CAB_FOLDER_OFFSET_COMPRESSION 0x6
#define FU_STRUCT_CAB_FOLDER_SIZE 0x8

GByteArray *fu_struct_cab_header_new(void);
GByteArray *fu_struct_cab_header_parse_bytes(GBytes *blob, gsize offset, GError **error);
gboolean fu_struct_cab_header_validate_bytes(GBytes *blob, gsize offset, GError **error);
guint32 fu_struct_cab_header_get_size(const GByteArray *st);
guint32 fu_struct_cab_header_get_off_cffile(const GByteArray *st);
guint16 fu_struct_cab_header_get_nr_folders(const GByteArray *st);
guint16 fu_struct_cab_header_get_nr_files(const GByteArray *st);
guint16 fu_struct_cab_header_get_flags(const GByteArray *st);
guint16 fu_struct_cab_header_get_set_id(const GByteArray *st);
guint16 fu_struct_cab_header_get_idx_cabinet(const GByteArray *st);
void fu_struct_cab_header_set_size(GByteArray *st, guint32 value);
void fu_struct_cab_header_set_off_cffile(GByteArray *st, guint32 value);
void fu_struct_cab_header_set_nr_folders(GByteArray *st, guint16 value);
void fu_struct_cab_header_set_nr_files(GByteArray *st, guint16 value);
void fu_struct_cab_header_set_flags(GByteArray *st, guint16 value);
void fu_struct_cab_header_set_set_id(GByteArray *st, guint16 value);
void fu_struct_cab_header_set_idx_cabinet(GByteArray *st, guint16 value);
#define FU_STRUCT_CAB_HEADER_OFFSET_SIGNATURE 0x0
#define FU_STRUCT_CAB_HEADER_OFFSET_SIZE 0x8
#define FU_STRUCT_CAB_HEADER_OFFSET_OFF_CFFILE 0x10
#define FU_STRUCT_CAB_HEADER_OFFSET_VERSION_MINOR 0x18
#define FU_STRUCT_CAB_HEADER_OFFSET_VERSION_MAJOR 0x19
#define FU_STRUCT_CAB_HEADER_OFFSET_NR_FOLDERS 0x1A
#define FU_STRUCT_CAB_HEADER_OFFSET_NR_FILES 0x1C
#define FU_STRUCT_CAB_HEADER_OFFSET_FLAGS 0x1E
#define FU_STRUCT_CAB_HEADER_OFFSET_SET_ID 0x20
#define FU_STRUCT_CAB_HEADER_OFFSET_IDX_CABINET 0x22
#define FU_STRUCT_CAB_HEADER_SIZE_SIGNATURE 0x4
#define FU_STRUCT_CAB_HEADER_SIZE 0x24
#define FU_STRUCT_CAB_HEADER_DEFAULT_SIGNATURE "MSCF"
#define FU_STRUCT_CAB_HEADER_DEFAULT_VERSION_MINOR 3
#define FU_STRUCT_CAB_HEADER_DEFAULT_VERSION_MAJOR 1
#define FU_STRUCT_CAB_HEADER_DEFAULT_NR_FOLDERS 1

GByteArray *fu_struct_cab_header_reserve_new(void);
GByteArray *fu_struct_cab_header_reserve_parse_bytes(GBytes *blob, gsize offset, GError **error);
guint16 fu_struct_cab_header_reserve_get_rsvd_hdr(const GByteArray *st);
guint8 fu_struct_cab_header_reserve_get_rsvd_folder(const GByteArray *st);
guint8 fu_struct_cab_header_reserve_get_rsvd_block(const GByteArray *st);
void fu_struct_cab_header_reserve_set_rsvd_hdr(GByteArray *st, guint16 value);
void fu_struct_cab_header_reserve_set_rsvd_folder(GByteArray *st, guint8 value);
void fu_struct_cab_header_reserve_set_rsvd_block(GByteArray *st, guint8 value);
#define FU_STRUCT_CAB_HEADER_RESERVE_OFFSET_RSVD_HDR 0x0
#define FU_STRUCT_CAB_HEADER_RESERVE_OFFSET_RSVD_FOLDER 0x2
#define FU_STRUCT_CAB_HEADER_RESERVE_OFFSET_RSVD_BLOCK 0x3
#define FU_STRUCT_CAB_HEADER_RESERVE_SIZE 0x4
