X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Ffs.h;fp=src%2Ffs.h;h=a35b5297e3272111c2028b3629c216e359e7dab4;hp=0000000000000000000000000000000000000000;hb=9235256116574927657a93944ef1b21e255e771b;hpb=c6a15e27d934e90a1f3a26438dddb395bdc9de19 diff --git a/src/fs.h b/src/fs.h new file mode 100644 index 00000000..a35b5297 --- /dev/null +++ b/src/fs.h @@ -0,0 +1,23 @@ +#ifndef TINC_FS_H +#define TINC_FS_H + +#include "system.h" + +typedef enum { + DIR_CACHE = 1 << 0, + DIR_CONFBASE = 1 << 1, + DIR_CONFDIR = 1 << 2, + DIR_HOSTS = 1 << 3, + DIR_INVITATIONS = 1 << 4, +} tinc_dir_t; + +// Create one or multiple directories inside tincd configuration directory +extern bool makedirs(tinc_dir_t dirs); + +// Open file. If it does not exist, create a new file with the specified access mode. +extern FILE *fopenmask(const char *filename, const char *mode, mode_t perms) ATTR_DEALLOCATOR(fclose); + +// Get absolute path to a possibly nonexistent file or directory +extern char *absolute_path(const char *path) ATTR_MALLOC; + +#endif // TINC_FS_H