tilesets
[vrlugburz] / src / fs.h
1 #ifndef FS_H_
2 #define FS_H_
3
4 #include <stdio.h>
5
6 /* buf should be at least as large as strlen(path) + 1
7  * if buf is null, or buf points to path, will do in-place replacement
8  * only UNIX-style path separators are supported
9  * returns buf
10  */
11 char *path_dir(const char *path, char *buf);
12 char *path_file(const char *path, char *buf);
13
14 /* buf should be at least strlen(dirname) + strlen(fname) + 2
15  * returns buf
16  */
17 char *combine_path(const char *dirname, const char *fname, char *buf);
18
19 /* if dirname is null or empty, this is equivalent to fopen(fname, attr) */
20 FILE *fopenat(const char *dirname, const char *fname, const char *attr);
21
22 #endif  /* FS_H_ */