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

#pragma once
#include <fu-input-stream.h>
/**
 * FuCabCompression:
 */
typedef enum {
    /**
     * FU_CAB_COMPRESSION_NONE:
     */
    FU_CAB_COMPRESSION_NONE = 0x0000,
    /**
     * FU_CAB_COMPRESSION_MSZIP:
     */
    FU_CAB_COMPRESSION_MSZIP = 0x0001,
    /**
     * FU_CAB_COMPRESSION_QUANTUM:
     */
    FU_CAB_COMPRESSION_QUANTUM = 0x0002,
    /**
     * FU_CAB_COMPRESSION_LZX:
     */
    FU_CAB_COMPRESSION_LZX = 0x0003,
}  FuCabCompression;
const gchar *fu_cab_compression_to_string(FuCabCompression val) G_GNUC_CONST;
/**
 * FuCabFileAttribute:
 */
typedef enum {
    /**
     * FU_CAB_FILE_ATTRIBUTE_NONE:
     */
    FU_CAB_FILE_ATTRIBUTE_NONE = 0x00,
    /**
     * FU_CAB_FILE_ATTRIBUTE_READONLY:
     */
    FU_CAB_FILE_ATTRIBUTE_READONLY = 0x01,
    /**
     * FU_CAB_FILE_ATTRIBUTE_HIDDEN:
     */
    FU_CAB_FILE_ATTRIBUTE_HIDDEN = 0x02,
    /**
     * FU_CAB_FILE_ATTRIBUTE_SYSTEM:
     */
    FU_CAB_FILE_ATTRIBUTE_SYSTEM = 0x04,
    /**
     * FU_CAB_FILE_ATTRIBUTE_ARCH:
     */
    FU_CAB_FILE_ATTRIBUTE_ARCH = 0x20,
    /**
     * FU_CAB_FILE_ATTRIBUTE_EXEC:
     */
    FU_CAB_FILE_ATTRIBUTE_EXEC = 0x40,
    /**
     * FU_CAB_FILE_ATTRIBUTE_NAME_UTF8:
     */
    FU_CAB_FILE_ATTRIBUTE_NAME_UTF8 = 0x80,
}  FuCabFileAttribute;
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructCabData;

FuStructCabData *fu_struct_cab_data_ref(FuStructCabData *st) G_GNUC_NON_NULL(1);
void fu_struct_cab_data_unref(FuStructCabData *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructCabData, fu_struct_cab_data_unref)
FuStructCabData *fu_struct_cab_data_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructCabData *fu_struct_cab_data_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_cab_data_get_checksum(const FuStructCabData *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_cab_data_get_comp(const FuStructCabData *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_cab_data_get_uncomp(const FuStructCabData *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_cab_data_set_checksum(FuStructCabData *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_cab_data_set_comp(FuStructCabData *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_cab_data_set_uncomp(FuStructCabData *st, guint16 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_CAB_DATA_OFFSET_CHECKSUM 0x0
#define FU_STRUCT_CAB_DATA_OFFSET_COMP 0x4
#define FU_STRUCT_CAB_DATA_OFFSET_UNCOMP 0x6
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_CAB_DATA_SIZE 0x8
#endif

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

FuStructCabFile *fu_struct_cab_file_ref(FuStructCabFile *st) G_GNUC_NON_NULL(1);
void fu_struct_cab_file_unref(FuStructCabFile *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructCabFile, fu_struct_cab_file_unref)
FuStructCabFile *fu_struct_cab_file_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructCabFile *fu_struct_cab_file_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_cab_file_get_usize(const FuStructCabFile *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_cab_file_get_uoffset(const FuStructCabFile *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_cab_file_get_index(const FuStructCabFile *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_cab_file_get_date(const FuStructCabFile *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_cab_file_get_time(const FuStructCabFile *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuCabFileAttribute fu_struct_cab_file_get_fattr(const FuStructCabFile *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_cab_file_set_usize(FuStructCabFile *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_cab_file_set_uoffset(FuStructCabFile *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_cab_file_set_index(FuStructCabFile *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_cab_file_set_date(FuStructCabFile *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_cab_file_set_time(FuStructCabFile *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_cab_file_set_fattr(FuStructCabFile *st, FuCabFileAttribute value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#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
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_CAB_FILE_SIZE 0x10
#endif

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

FuStructCabFolder *fu_struct_cab_folder_ref(FuStructCabFolder *st) G_GNUC_NON_NULL(1);
void fu_struct_cab_folder_unref(FuStructCabFolder *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructCabFolder, fu_struct_cab_folder_unref)
FuStructCabFolder *fu_struct_cab_folder_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructCabFolder *fu_struct_cab_folder_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_cab_folder_get_offset(const FuStructCabFolder *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_cab_folder_get_ndatab(const FuStructCabFolder *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuCabCompression fu_struct_cab_folder_get_compression(const FuStructCabFolder *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_cab_folder_set_offset(FuStructCabFolder *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_cab_folder_set_ndatab(FuStructCabFolder *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_cab_folder_set_compression(FuStructCabFolder *st, FuCabCompression value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_CAB_FOLDER_OFFSET_OFFSET 0x0
#define FU_STRUCT_CAB_FOLDER_OFFSET_NDATAB 0x4
#define FU_STRUCT_CAB_FOLDER_OFFSET_COMPRESSION 0x6
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_CAB_FOLDER_SIZE 0x8
#endif

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

FuStructCabHeader *fu_struct_cab_header_ref(FuStructCabHeader *st) G_GNUC_NON_NULL(1);
void fu_struct_cab_header_unref(FuStructCabHeader *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructCabHeader, fu_struct_cab_header_unref)
FuStructCabHeader *fu_struct_cab_header_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructCabHeader *fu_struct_cab_header_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
gboolean fu_struct_cab_header_validate_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_cab_header_get_size(const FuStructCabHeader *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_cab_header_get_off_cffile(const FuStructCabHeader *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_cab_header_get_nr_folders(const FuStructCabHeader *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_cab_header_get_nr_files(const FuStructCabHeader *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_cab_header_get_flags(const FuStructCabHeader *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_cab_header_get_set_id(const FuStructCabHeader *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_cab_header_get_idx_cabinet(const FuStructCabHeader *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_cab_header_set_size(FuStructCabHeader *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_cab_header_set_off_cffile(FuStructCabHeader *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_cab_header_set_nr_folders(FuStructCabHeader *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_cab_header_set_nr_files(FuStructCabHeader *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_cab_header_set_flags(FuStructCabHeader *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_cab_header_set_set_id(FuStructCabHeader *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_cab_header_set_idx_cabinet(FuStructCabHeader *st, guint16 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#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
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_CAB_HEADER_SIZE_SIGNATURE 0x4
#define FU_STRUCT_CAB_HEADER_N_ELEMENTS_SIGNATURE 4
#define FU_STRUCT_CAB_HEADER_SIZE 0x24
#endif

#ifndef __GI_SCANNER__
#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
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructCabHeaderReserve;

FuStructCabHeaderReserve *fu_struct_cab_header_reserve_ref(FuStructCabHeaderReserve *st) G_GNUC_NON_NULL(1);
void fu_struct_cab_header_reserve_unref(FuStructCabHeaderReserve *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructCabHeaderReserve, fu_struct_cab_header_reserve_unref)
FuStructCabHeaderReserve *fu_struct_cab_header_reserve_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructCabHeaderReserve *fu_struct_cab_header_reserve_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_cab_header_reserve_get_rsvd_hdr(const FuStructCabHeaderReserve *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_cab_header_reserve_get_rsvd_folder(const FuStructCabHeaderReserve *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_cab_header_reserve_get_rsvd_block(const FuStructCabHeaderReserve *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_cab_header_reserve_set_rsvd_hdr(FuStructCabHeaderReserve *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_cab_header_reserve_set_rsvd_folder(FuStructCabHeaderReserve *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_cab_header_reserve_set_rsvd_block(FuStructCabHeaderReserve *st, guint8 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#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
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_CAB_HEADER_RESERVE_SIZE 0x4
#endif

#ifndef __GI_SCANNER__
#endif
