annotate include/datapath.h @ 0:a8277d8f687a
initial commit
author |
John Tsiombikas <nuclear@member.fsf.org> |
date |
Thu, 19 Feb 2015 01:33:54 +0200 |
parents |
|
children |
c1323f9f202d |
rev |
line source |
nuclear@0
|
1 #ifndef LIBSYSUTILS_DATAPATH_H_
|
nuclear@0
|
2 #define LIBSYSUTILS_DATAPATH_H_
|
nuclear@0
|
3
|
nuclear@0
|
4 enum sysu_dir_type {
|
nuclear@0
|
5 SYSU_DATA_DIR, /* read-only assets directory */
|
nuclear@0
|
6 SYSU_STORAGE_DIR, /* read-write persistent storage directory */
|
nuclear@0
|
7 SYSU_CONFIG_DIR, /* configuration directory */
|
nuclear@0
|
8 SYSU_TMP_DIR, /* temporary data directory */
|
nuclear@0
|
9 SYSU_HOME_DIR, /* user's home directory */
|
nuclear@0
|
10 SYSU_CURRENT_DIR /* current working directory */
|
nuclear@0
|
11 };
|
nuclear@0
|
12
|
nuclear@0
|
13 const char *sysu_get_directory(sysu_dir_type type);
|
nuclear@0
|
14
|
nuclear@0
|
15 /* Writes the path to outpath, and returns the size of the path in bytes.
|
nuclear@0
|
16 * Call with len <= 0 and outpath == NULL to return required storage
|
nuclear@0
|
17 * size for the path.
|
nuclear@0
|
18 */
|
nuclear@0
|
19 int sysu_datapath(const char *inpath, char *outpath, int len);
|
nuclear@0
|
20
|
nuclear@0
|
21 /* same as above, but stores the path to an internal static buffer,
|
nuclear@0
|
22 * which will be overwritten or moved at the next call (thread unsafe).
|
nuclear@0
|
23 */
|
nuclear@0
|
24 const char *sysu_datapath_static(const char *inpath);
|
nuclear@0
|
25
|
nuclear@0
|
26 /* same as above, but allocates storage for the returned path
|
nuclear@0
|
27 * which must be freed by a call to sysu_free_datapath.
|
nuclear@0
|
28 */
|
nuclear@0
|
29 char *sysu_datapath_alloc(const char *inpath);
|
nuclear@0
|
30 void sysu_free_datapath(char *p);
|
nuclear@0
|
31
|
nuclear@0
|
32 #endif /* LIBSYSUTILS_DATAPATH_H_ */
|