57 lines
879 B
C
57 lines
879 B
C
#ifndef PAK_H
|
|
#define PAK_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif // __cplusplus
|
|
|
|
#include "aliases.h"
|
|
#include <stdbool.h>
|
|
|
|
typedef struct {
|
|
u64 size;
|
|
u8 data[];
|
|
} buf_t;
|
|
|
|
typedef struct {
|
|
u64 offset;
|
|
u64 length;
|
|
char name[];
|
|
} toc_entry_t;
|
|
|
|
typedef struct {
|
|
u64 count;
|
|
u64 size;
|
|
} toc_t;
|
|
|
|
typedef struct {
|
|
u64 major;
|
|
u64 minor;
|
|
u64 patch;
|
|
} pak_ver_t;
|
|
|
|
typedef struct {
|
|
u64 size;
|
|
u8 data[];
|
|
} pak_entry_t;
|
|
|
|
typedef struct {
|
|
u64 magic;
|
|
pak_ver_t version;
|
|
toc_t toc;
|
|
} pak_t;
|
|
|
|
typedef struct asset_pack asset_pack_t;
|
|
|
|
bool create_asset_pack(const char *dirpath, const char *output);
|
|
asset_pack_t *load_asset_pack(const char *filepath);
|
|
buf_t *read_file_from_pack(asset_pack_t *pack, const char *filename);
|
|
void close_pack_file(buf_t **buf);
|
|
void close_asset_pack(asset_pack_t **pack);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif // __cplusplus
|
|
|
|
#endif // !PAK_H
|