#ifndef AM_PARTITIONS_H
#define AM_PARTITIONS_H
#include "fs_core.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
PART_FS_UNKNOWN = 0,
PART_FS_EXT2 = 1,
PART_FS_EXT3 = 2,
PART_FS_EXT4 = 3,
PART_FS_NTFS = 4,
PART_FS_EXFAT = 5,
PART_FS_FAT32 = 6,
PART_FS_FAT16 = 7,
PART_FS_HFS_PLUS = 8,
PART_FS_APFS = 9,
PART_FS_LINUX_SWAP = 10,
PART_FS_ISO9660 = 11,
PART_FS_SQUASHFS = 12,
} PartitionsFsKind;
typedef enum {
PART_TABLE_NONE = 0,
PART_TABLE_GPT = 1,
PART_TABLE_MBR = 2,
} PartitionsTableKind;
typedef struct {
uint64_t start;
uint64_t length;
int32_t fs_kind;
int32_t table_kind;
uint8_t type_guid[16];
uint8_t type_byte;
uint8_t _pad[7];
const char *label;
size_t label_len;
} PartitionInfo;
typedef struct PartitionList PartitionList;
FsCoreErrorCode partitions_probe(const FsCoreDevice *device,
PartitionList **list_out);
size_t partitions_count(const PartitionList *list);
int32_t partitions_table_kind(const PartitionList *list);
FsCoreErrorCode partitions_get(const PartitionList *list,
size_t index,
PartitionInfo *out);
int32_t partitions_sniff(const PartitionList *list, size_t index);
int32_t partitions_sniff_device(const FsCoreDevice *device,
uint64_t device_size_bytes);
FsCoreDevice *partitions_open_slice(const PartitionList *list, size_t index);
void partitions_list_free(PartitionList *list);
#ifdef __cplusplus
}
#endif
#endif