blob: c0434ea9bd905030b69780ef6ba40c81b235c0bf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
#pragma once
/* Simple asset manager supporting pak file (a ZIP file).
*
* 1. call ubox_assets_init using a directory name DIR
* If a "DIR.pak" file exists, it will be opened and any call to read will
* check on the pak file (unless the file exists in DIR, in which case it takes
* priority).
* 2. call ubox_assets_read to read assets; allocated memory MUST be freed with free.
* 3. call ubox_assets_free to discard the DIR (and pak file if exists).
*/
uint8_t ubox_assets_init(const char *dirname);
uint8_t ubox_assets_read(const char *name, uint8_t **data, size_t *data_size);
void ubox_assets_free();
|