diff options
author | David Härdeman <david@hardeman.nu> | 2020-07-09 20:36:15 +0200 |
---|---|---|
committer | David Härdeman <david@hardeman.nu> | 2020-07-09 20:36:15 +0200 |
commit | dd6321c0acf7b0570811200a205cc4104bee49c7 (patch) | |
tree | 52da75427a0c1d237806fbebba23025afd79d28d /minecctl/misc.h | |
parent | 4ae60696aed938347cc1cf2a5d8f5a2b86292132 (diff) |
Implement a basic init command in minecctl to create an initial example config
Diffstat (limited to 'minecctl/misc.h')
-rw-r--r-- | minecctl/misc.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/minecctl/misc.h b/minecctl/misc.h index 3182ef8..d1c6816 100644 --- a/minecctl/misc.h +++ b/minecctl/misc.h @@ -2,6 +2,20 @@ #ifndef foomischfoo #define foomischfoo +int open_subdir(int dfd, const char *subdir, bool nofail); + +int open_xdg_dir(const char *envname, const char *altpath, bool nofail); + +static inline int open_xdg_shared_dir() +{ + return open_xdg_dir("XDG_DATA_HOME", ".local/share", false); +} + +static inline int open_xdg_cfg_dir(bool nofail) +{ + return open_xdg_dir("XDG_CONFIG_HOME", ".config", nofail); +} + void set_use_colors(); char **strv_copy(char *const *strv); |