6#define SF3_FORMAT_ID_ARCHIVE 0x01
42 uint64_t entry_offset[];
50 if(archive->
count <= index)
return 0;
71 if(archive->
count <= index)
return 0;
74 const uint64_t *offsets = (
const uint64_t *)base;
75 base = (
char*)(offsets+archive->
count);
76 return (
const struct sf3_file *)(base + offsets[index]);
83 const void *start = (
const void *)archive;
84 const void *end = (
const void *)file;
85 return (end-start)+
sizeof(uint64_t)+file->
length;
SF3_INLINE const char * sf3_archive_meta_mime_type(const struct sf3_archive_meta *meta)
Returns the C string for the mime-type.
SF3_INLINE const struct sf3_archive_meta * sf3_archive_meta_entry(const struct sf3_archive *archive, uint64_t index)
SF3_EXPORT size_t sf3_archive_size(const struct sf3_archive *archive)
Computes the size of the archive file in bytes.
SF3_INLINE const char * sf3_archive_meta_path(const struct sf3_archive_meta *meta)
Returns the C string for the relative file path.
SF3_INLINE const struct sf3_file * sf3_archive_file(const struct sf3_archive *archive, uint64_t index)
uint32_t sf3_crc32_checksum
Type for a CRC32 checksum.
uint64_t metadata_size
The size of the metadata block in bytes.
uint64_t entry_offset[]
The array of offsets for each metadata entry.
A single file from an archive.
uint64_t length
The length of the data payload in bytes.
The basic header structure of every SF3 file.