aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/stdpaths.c
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2015-10-17 14:45:53 +0300
committerZyX <kp-pav@yandex.ru>2015-10-23 14:54:10 +0300
commitbe91bc1e1a110da938201eab9b43736e64a7392e (patch)
tree501e6fb5bf85155e421b9fc7d9c291ea2d9be848 /src/nvim/os/stdpaths.c
parentafb0f2f9b14f0ebcb5c53a47338a6a4359019e38 (diff)
downloadrneovim-be91bc1e1a110da938201eab9b43736e64a7392e.tar.gz
rneovim-be91bc1e1a110da938201eab9b43736e64a7392e.tar.bz2
rneovim-be91bc1e1a110da938201eab9b43736e64a7392e.zip
stdpaths: Export get_xdg function (renamed) and use it for runtimepath
Diffstat (limited to 'src/nvim/os/stdpaths.c')
-rw-r--r--src/nvim/os/stdpaths.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/nvim/os/stdpaths.c b/src/nvim/os/stdpaths.c
index b8ce400276..86daa7257a 100644
--- a/src/nvim/os/stdpaths.c
+++ b/src/nvim/os/stdpaths.c
@@ -1,18 +1,10 @@
#include <stdbool.h>
+#include "nvim/os/stdpaths_defs.h"
#include "nvim/os/os.h"
#include "nvim/path.h"
#include "nvim/memory.h"
-typedef enum {
- kXDGConfigHome,
- kXDGDataHome,
- kXDGCacheHome,
- kXDGRuntimeDir,
- kXDGConfigDirs,
- kXDGDataDirs,
-} XDGVarType;
-
static const char *xdg_env_vars[] = {
[kXDGConfigHome] = "XDG_CONFIG_HOME",
[kXDGDataHome] = "XDG_DATA_HOME",
@@ -45,7 +37,7 @@ static const char *const xdg_defaults[] = {
};
#endif
-static char *get_xdg(const XDGVarType idx)
+char *stdpaths_get_xdg_var(const XDGVarType idx)
FUNC_ATTR_WARN_UNUSED_RESULT
{
const char *const env = xdg_env_vars[idx];
@@ -65,7 +57,7 @@ static char *get_xdg(const XDGVarType idx)
static char *get_xdg_home(const XDGVarType idx)
FUNC_ATTR_WARN_UNUSED_RESULT
{
- char *dir = get_xdg(idx);
+ char *dir = stdpaths_get_xdg_var(idx);
if (dir) {
dir = concat_fnames(dir, "nvim", true);
}