Common Pack library functions. More...
#include "pack/defines.h"
#include <stdbool.h>
Data Structures | |
struct | PackHeader |
Pack file header structure. More... | |
struct | PackItemHeader |
Pack item header structure. More... | |
Macros | |
#define | PACK_HEADER_MAGIC (('P' << 24) | ('A' << 16) | ('C' << 8) | 'K') |
Pack file header magic number. | |
Typedefs | |
typedef uint8_t | PackResult |
Pack result code type. | |
Functions | |
void | getPackLibraryVersion (uint8_t *major, uint8_t *minor, uint8_t *patch) |
Returns Pack library hardcoded version. (MT-Safe) | |
PackResult | readPackHeader (const char *filePath, PackHeader *header) |
Reads Pack header from the file. (MT-Safe) | |
Common Pack library functions.
struct PackHeader |
Pack file header structure.
Each Pack file begins with a header that contains information about the library and system used for packing the files. It also contains the total number of files inside the archive.
struct PackItemHeader |
Pack item header structure.
Contains information about the packed file inside the archive. This includes the size of its path, the size of compressed data, whether data are compressed, and the location of the data within the archive file.
void getPackLibraryVersion | ( | uint8_t * | major, |
uint8_t * | minor, | ||
uint8_t * | patch ) |
Returns Pack library hardcoded version. (MT-Safe)
Useful in cases when we load a dynamic Pack library (.dll) or use it from another programming language. (ex. C#, Java)
[out] | major | pointer to the uint32_t major version |
[out] | minor | pointer to the uint32_t minor version |
[out] | patch | pointer to the uint32_t patch version |
PackResult readPackHeader | ( | const char * | filePath, |
PackHeader * | header ) |
Reads Pack header from the file. (MT-Safe)
We can retrieve information about the package without creating an instance and loading the paths of all packed files.
[in] | filePath | target file path string |
[out] | header | pointer to the PackHeader structure |
SUCCESS_PACK_RESULT | on success |
FAILED_TO_OPEN_FILE_PACK_RESULT | if file doesn't exist |
BAD_FILE_TYPE_PACK_RESULT | if file header has bad magic number |