stdpaths: Rename export functions so that they have common prefix

This commit is contained in:
ZyX 2015-10-17 14:40:27 +03:00
parent 120ec8c2ea
commit afb0f2f9b1
3 changed files with 9 additions and 8 deletions

View File

@ -1840,7 +1840,7 @@ static void source_startup_scripts(mparm_T *parmp)
* - second user exrc file ($VIM/.exrc for Dos)
* The first that exists is used, the rest is ignored.
*/
char_u *user_vimrc = (char_u *)get_from_user_conf("init.vim");
char_u *user_vimrc = (char_u *)stdpaths_user_conf_subpath("init.vim");
if (process_env("VIMINIT", true) != OK) {
if (do_source(user_vimrc, true, DOSO_VIMRC) == FAIL
&& process_env("EXINIT", FALSE) == FAIL

View File

@ -579,11 +579,12 @@ void set_init_1(void)
"system('lpr' . (&printdevice == '' ? '' : ' -P' . &printdevice) . ' ' . v:fname_in) . delete(v:fname_in) + v:shell_error"
);
set_string_default("viewdir", (char_u *)get_from_user_data("view"));
set_string_default("backupdir", (char_u *)get_from_user_data("backup"));
set_string_default("directory", (char_u *)get_from_user_data("swap"));
set_string_default("undodir", (char_u *)get_from_user_data("undo"));
// Set default for &runtimepath. All necessary expansions are performed in
set_string_default("viewdir", (char_u *)stdpaths_user_data_subpath("view"));
set_string_default("backupdir",
(char_u *)stdpaths_user_data_subpath("backup"));
set_string_default("directory", (char_u *)stdpaths_user_data_subpath("swap"));
set_string_default("undodir", (char_u *)stdpaths_user_data_subpath("undo"));
// Set default for &runtimepath. All necessary expansions are performed in
// this function.
set_runtimepath_default();

View File

@ -82,13 +82,13 @@ static void create_dir(const char *dir, int mode, const char *suffix)
}
}
char *get_from_user_conf(const char *fname)
char *stdpaths_user_conf_subpath(const char *fname)
FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL
{
return concat_fnames(get_xdg_home(kXDGConfigHome), fname, true);
}
char *get_from_user_data(const char *fname)
char *stdpaths_user_data_subpath(const char *fname)
FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL
{
char *dir = concat_fnames(get_xdg_home(kXDGDataHome), fname, true);