Functions
stdpaths.c File Reference
#include <stdbool.h>
#include "nvim/os/stdpaths_defs.h"
#include "nvim/os/os.h"
#include "nvim/path.h"
#include "nvim/memory.h"
#include "nvim/ascii.h"

Functions

char * stdpaths_get_xdg_var (const XDGVarType idx) FUNC_ATTR_WARN_UNUSED_RESULT
 
char * get_xdg_home (const XDGVarType idx) FUNC_ATTR_WARN_UNUSED_RESULT
 
char * stdpaths_user_conf_subpath (const char *fname) FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL FUNC_ATTR_NONNULL_RET
 
char * stdpaths_user_data_subpath (const char *fname, const size_t trailing_pathseps, const bool escape_commas) FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL FUNC_ATTR_NONNULL_RET
 

Function Documentation

char* get_xdg_home ( const XDGVarType  idx)

Return Nvim-specific XDG directory subpath.

Windows: Uses "…/nvim-data" for kXDGDataHome to avoid storing configuration and data files in the same path. #4403

Parameters
[in]idxXDG directory to use.
Returns
[allocated] "{xdg_directory}/nvim"
char* stdpaths_get_xdg_var ( const XDGVarType  idx)

Return XDG variable value

Parameters
[in]idxXDG variable to use.
Returns
[allocated] variable value.
char* stdpaths_user_conf_subpath ( const char *  fname)

Return subpath of $XDG_CONFIG_HOME

Parameters
[in]fnameNew component of the path.
Returns
[allocated] $XDG_CONFIG_HOME/nvim/{fname}
char* stdpaths_user_data_subpath ( const char *  fname,
const size_t  trailing_pathseps,
const bool  escape_commas 
)

Return subpath of $XDG_DATA_HOME

Parameters
[in]fnameNew component of the path.
[in]trailing_pathsepsAmount of trailing path separators to add.
[in]escape_commasIf true, all commas will be escaped.
Returns
[allocated] $XDG_DATA_HOME/nvim/{fname}.