aboutsummaryrefslogtreecommitdiff
path: root/include/ubox_assets.h
blob: e6f4292cfa3166190de517fcf00a4fb555e1d044 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#ifndef _UBOX_ASSETS_H
#define _UBOX_ASSETS_H

/* 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();

#endif /* _UBOX_ASSETS_H */