
#ifndef __HLNK_H__
#define __HLNK_H__

#define HLNK_FILE_LEN  32768

#define HLNK_NAME_MAX  384

#define HIPERISO_GUID { 0x77772020, 0x2e77, 0x6576, { 0x6e, 0x74, 0x6f, 0x79, 0x2e, 0x6e, 0x65, 0x74 }}

#pragma pack(1)

typedef struct hiperiso_guid
{
    uint32_t   data1;
    uint16_t   data2;
    uint16_t   data3;
    uint8_t    data4[8];
}hiperiso_guid;

typedef struct hiperiso_hlnk
{
    hiperiso_guid   guid;         // HIPERISO_GUID
    uint32_t crc32;        // crc32
    uint32_t  disk_signature;
    uint64_t part_offset; // in bytes
    char filepath[HLNK_NAME_MAX];
    uint8_t reserverd[96];
}hiperiso_hlnk;
#pragma pack()

uint32_t hiperiso_getcrc32c (uint32_t crc, const void *buf, int size);
int hiperiso_create_hlnk(uint32_t disksig, uint64_t partoffset, const char *path, hiperiso_hlnk *hlnk);
int CheckHlnkData(hiperiso_hlnk *hlnk);
int IsSupportedImgSuffix(char *suffix);

#endif

