aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Wienecke <wienecke.t@gmail.com>2014-03-27 12:38:33 +0100
committerThiago de Arruda <tpadilha84@gmail.com>2014-03-27 19:57:55 -0300
commit5762c4e528cbd6629319bf3958d1f6554b399b20 (patch)
tree3be91959012944534451ec84584ff4be84286b7c /src
parent3f7011ab9185b4968e89086f77b054161a900beb (diff)
downloadrneovim-5762c4e528cbd6629319bf3958d1f6554b399b20.tar.gz
rneovim-5762c4e528cbd6629319bf3958d1f6554b399b20.tar.bz2
rneovim-5762c4e528cbd6629319bf3958d1f6554b399b20.zip
Rename mch_* functions to os_* in os module.
Diffstat (limited to 'src')
-rw-r--r--src/buffer.c2
-rw-r--r--src/diff.c14
-rw-r--r--src/eval.c22
-rw-r--r--src/ex_cmds.c6
-rw-r--r--src/ex_cmds2.c14
-rw-r--r--src/ex_docmd.c18
-rw-r--r--src/ex_getln.c6
-rw-r--r--src/file_search.c16
-rw-r--r--src/fileio.c46
-rw-r--r--src/globals.h2
-rw-r--r--src/hardcopy.c2
-rw-r--r--src/if_cscope.c4
-rw-r--r--src/main.c6
-rw-r--r--src/mark.c2
-rw-r--r--src/mbyte.c6
-rw-r--r--src/memline.c10
-rw-r--r--src/message.c2
-rw-r--r--src/misc1.c52
-rw-r--r--src/misc2.c12
-rw-r--r--src/option.c10
-rw-r--r--src/os/env.c6
-rw-r--r--src/os/fs.c40
-rw-r--r--src/os/input.c6
-rw-r--r--src/os/input.h6
-rw-r--r--src/os/mem.c2
-rw-r--r--src/os/os.h32
-rw-r--r--src/os/time.c6
-rw-r--r--src/os/time.h2
-rw-r--r--src/os/users.c10
-rw-r--r--src/os_unix.c28
-rw-r--r--src/quickfix.c8
-rw-r--r--src/spell.c2
-rw-r--r--src/syntax.c2
-rw-r--r--src/term.c8
-rw-r--r--src/ui.c10
-rw-r--r--src/undo.c8
-rw-r--r--src/vim.h2
-rw-r--r--src/window.c10
38 files changed, 220 insertions, 220 deletions
diff --git a/src/buffer.c b/src/buffer.c
index d0d0b033df..d3c26956b3 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -2425,7 +2425,7 @@ void buflist_altfpos(win_T *win)
/*
* Return TRUE if 'ffname' is not the same file as current file.
- * Fname must have a full path (expanded by mch_get_absolute_path()).
+ * Fname must have a full path (expanded by os_get_absolute_path()).
*/
int otherfile(char_u *ffname)
{
diff --git a/src/diff.c b/src/diff.c
index 0764715685..35b8e2e346 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -824,7 +824,7 @@ static void diff_file(char_u *tmp_orig, char_u *tmp_new, char_u *tmp_diff)
if (cmd != NULL) {
/* We don't want $DIFF_OPTIONS to get in the way. */
- if (mch_getenv("DIFF_OPTIONS")) {
+ if (os_getenv("DIFF_OPTIONS")) {
vim_setenv((char_u *)"DIFF_OPTIONS", (char_u *)"");
}
@@ -906,18 +906,18 @@ void ex_diffpatch(exarg_T *eap)
// have our own temp dir use that instead, it will be cleaned up when we
// exit (any .rej files created). Don't change directory if we can't
// return to the current.
- if ((mch_dirname(dirbuf, MAXPATHL) != OK)
- || (mch_chdir((char *)dirbuf) != 0)) {
+ if ((os_dirname(dirbuf, MAXPATHL) != OK)
+ || (os_chdir((char *)dirbuf) != 0)) {
dirbuf[0] = NUL;
} else {
# ifdef TEMPDIRNAMES
if (vim_tempdir != NULL) {
- ignored = mch_chdir((char *)vim_tempdir);
+ ignored = os_chdir((char *)vim_tempdir);
} else {
- ignored = mch_chdir("/tmp");
+ ignored = os_chdir("/tmp");
}
# else
- ignored = mch_chdir("/tmp");
+ ignored = os_chdir("/tmp");
# endif // ifdef TEMPDIRNAMES
shorten_fnames(TRUE);
}
@@ -948,7 +948,7 @@ void ex_diffpatch(exarg_T *eap)
#ifdef UNIX
if (dirbuf[0] != NUL) {
- if (mch_chdir((char *)dirbuf) != 0) {
+ if (os_chdir((char *)dirbuf) != 0) {
EMSG(_(e_prev_dir));
}
shorten_fnames(TRUE);
diff --git a/src/eval.c b/src/eval.c
index df097d5e37..1e2cbfc39d 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -8549,7 +8549,7 @@ static void f_eventhandler(typval_T *argvars, typval_T *rettv)
*/
static void f_executable(typval_T *argvars, typval_T *rettv)
{
- rettv->vval.v_number = mch_can_exe(get_tv_string(&argvars[0]));
+ rettv->vval.v_number = os_can_exe(get_tv_string(&argvars[0]));
}
/*
@@ -8565,7 +8565,7 @@ static void f_exists(typval_T *argvars, typval_T *rettv)
p = get_tv_string(&argvars[0]);
if (*p == '$') { /* environment variable */
/* first try "normal" environment variables (fast) */
- if (mch_getenv((char *)(p + 1)) != NULL)
+ if (os_getenv((char *)(p + 1)) != NULL)
n = TRUE;
else {
/* try expanding things like $VIM and ${HOME} */
@@ -8862,7 +8862,7 @@ static void f_filereadable(typval_T *argvars, typval_T *rettv)
# define O_NONBLOCK 0
#endif
p = get_tv_string(&argvars[0]);
- if (*p && !mch_isdir(p) && (fd = mch_open((char *)p,
+ if (*p && !os_isdir(p) && (fd = mch_open((char *)p,
O_RDONLY | O_NONBLOCK, 0)) >= 0) {
n = TRUE;
close(fd);
@@ -9660,7 +9660,7 @@ static void f_getcwd(typval_T *argvars, typval_T *rettv)
rettv->vval.v_string = NULL;
cwd = alloc(MAXPATHL);
if (cwd != NULL) {
- if (mch_dirname(cwd, MAXPATHL) != FAIL) {
+ if (os_dirname(cwd, MAXPATHL) != FAIL) {
rettv->vval.v_string = vim_strsave(cwd);
#ifdef BACKSLASH_IN_FILENAME
if (rettv->vval.v_string != NULL)
@@ -9719,7 +9719,7 @@ static void f_getfsize(typval_T *argvars, typval_T *rettv)
rettv->v_type = VAR_NUMBER;
if (mch_stat((char *)fname, &st) >= 0) {
- if (mch_isdir(fname))
+ if (os_isdir(fname))
rettv->vval.v_number = 0;
else {
rettv->vval.v_number = (varnumber_T)st.st_size;
@@ -9812,7 +9812,7 @@ static void f_getftype(typval_T *argvars, typval_T *rettv)
default: t = "other";
}
# else
- if (mch_isdir(fname))
+ if (os_isdir(fname))
t = "dir";
else
t = "file";
@@ -10886,7 +10886,7 @@ static void f_invert(typval_T *argvars, typval_T *rettv)
*/
static void f_isdirectory(typval_T *argvars, typval_T *rettv)
{
- rettv->vval.v_number = mch_isdir(get_tv_string(&argvars[0]));
+ rettv->vval.v_number = os_isdir(get_tv_string(&argvars[0]));
}
/*
@@ -11664,7 +11664,7 @@ static int mkdir_recurse(char_u *dir, int prot)
updir = vim_strnsave(dir, (int)(p - dir));
if (updir == NULL)
return FAIL;
- if (mch_isdir(updir))
+ if (os_isdir(updir))
r = OK;
else if (mkdir_recurse(updir, prot) == OK)
r = vim_mkdir_emsg(updir, prot);
@@ -12479,7 +12479,7 @@ static void f_resolve(typval_T *argvars, typval_T *rettv)
q[-1] = NUL;
q = gettail(p);
}
- if (q > p && !mch_is_absolute_path(buf)) {
+ if (q > p && !os_is_absolute_path(buf)) {
/* symlink is relative to directory of argument */
cpy = alloc((unsigned)(STRLEN(p) + STRLEN(buf) + 1));
if (cpy != NULL) {
@@ -19345,7 +19345,7 @@ repeat:
}
/* Append a path separator to a directory. */
- if (mch_isdir(*fnamep)) {
+ if (os_isdir(*fnamep)) {
/* Make room for one or two extra characters. */
*fnamep = vim_strnsave(*fnamep, (int)STRLEN(*fnamep) + 2);
vim_free(*bufp); /* free any allocated file name */
@@ -19379,7 +19379,7 @@ repeat:
if (p != NULL) {
if (c == '.') {
- mch_dirname(dirname, MAXPATHL);
+ os_dirname(dirname, MAXPATHL);
s = shorten_fname(p, dirname);
if (s != NULL) {
*fnamep = s;
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index d0e4c9eccd..15429e5b7d 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -1730,7 +1730,7 @@ static char_u *viminfo_filename(char_u *file)
else if ((file = find_viminfo_parameter('n')) == NULL || *file == NUL) {
#ifdef VIMINFO_FILE2
/* don't use $HOME when not defined (turned into "c:/"!). */
- if (mch_getenv((char_u *)"HOME") == NULL) {
+ if (os_getenv((char_u *)"HOME") == NULL) {
/* don't use $VIM when not available. */
expand_env((char_u *)"$VIM", NameBuff, MAXPATHL);
if (STRCMP("$VIM", NameBuff) != 0) /* $VIM was expanded */
@@ -2335,7 +2335,7 @@ check_overwrite (
if (!eap->forceit && !eap->append) {
#ifdef UNIX
/* with UNIX it is possible to open a directory */
- if (mch_isdir(ffname)) {
+ if (os_isdir(ffname)) {
EMSG2(_(e_isadir2), ffname);
return FAIL;
}
@@ -5384,7 +5384,7 @@ void ex_helptags(exarg_T *eap)
xpc.xp_context = EXPAND_DIRECTORIES;
dirname = ExpandOne(&xpc, eap->arg, NULL,
WILD_LIST_NOTFOUND|WILD_SILENT, WILD_EXPAND_FREE);
- if (dirname == NULL || !mch_isdir(dirname)) {
+ if (dirname == NULL || !os_isdir(dirname)) {
EMSG2(_("E150: Not a directory: %s"), eap->arg);
return;
}
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index b461f8392a..004e0e5061 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -2493,7 +2493,7 @@ do_source (
vim_free(p);
if (fname_exp == NULL)
return retval;
- if (mch_isdir(fname_exp)) {
+ if (os_isdir(fname_exp)) {
smsg((char_u *)_("Cannot source a directory: \"%s\""), fname);
goto theend;
}
@@ -3317,11 +3317,11 @@ char_u *get_mess_lang(void)
p = (char_u *)get_locale_val(LC_COLLATE);
# endif
# else
- p = mch_getenv((char_u *)"LC_ALL");
+ p = os_getenv((char_u *)"LC_ALL");
if (p == NULL || *p == NUL) {
- p = mch_getenv((char_u *)"LC_MESSAGES");
+ p = os_getenv((char_u *)"LC_MESSAGES");
if (p == NULL || *p == NUL)
- p = mch_getenv((char_u *)"LANG");
+ p = os_getenv((char_u *)"LANG");
}
# endif
return p;
@@ -3338,11 +3338,11 @@ static char_u *get_mess_env(void)
{
char_u *p;
- p = (char_u *)mch_getenv("LC_ALL");
+ p = (char_u *)os_getenv("LC_ALL");
if (p == NULL || *p == NUL) {
- p = (char_u *)mch_getenv("LC_MESSAGES");
+ p = (char_u *)os_getenv("LC_MESSAGES");
if (p == NULL || *p == NUL) {
- p = (char_u *)mch_getenv("LANG");
+ p = (char_u *)os_getenv("LANG");
if (p != NULL && VIM_ISDIGIT(*p))
p = NULL; /* ignore something like "1043" */
# ifdef HAVE_GET_LOCALE_VAL
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index d16458fe2d..01da8f6fff 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -6607,7 +6607,7 @@ void post_chdir(int local)
if (globaldir == NULL && prev_dir != NULL)
globaldir = vim_strsave(prev_dir);
/* Remember this local directory for the window. */
- if (mch_dirname(NameBuff, MAXPATHL) == OK)
+ if (os_dirname(NameBuff, MAXPATHL) == OK)
curwin->w_localdir = vim_strsave(NameBuff);
} else {
/* We are now in the global directory, no need to remember its
@@ -6656,7 +6656,7 @@ void ex_cd(exarg_T *eap)
/* Save current directory for next ":cd -" */
tofree = prev_dir;
- if (mch_dirname(NameBuff, MAXPATHL) == OK)
+ if (os_dirname(NameBuff, MAXPATHL) == OK)
prev_dir = vim_strsave(NameBuff);
else
prev_dir = NULL;
@@ -6687,7 +6687,7 @@ void ex_cd(exarg_T *eap)
*/
static void ex_pwd(exarg_T *eap)
{
- if (mch_dirname(NameBuff, MAXPATHL) == OK) {
+ if (os_dirname(NameBuff, MAXPATHL) == OK) {
#ifdef BACKSLASH_IN_FILENAME
slash_adjust(NameBuff);
#endif
@@ -7281,7 +7281,7 @@ static void ex_mkrc(exarg_T *eap)
#if defined(FEAT_SESSION) && defined(vim_mkdir)
/* When using 'viewdir' may have to create the directory. */
- if (using_vdir && !mch_isdir(p_vdir))
+ if (using_vdir && !os_isdir(p_vdir))
vim_mkdir_emsg(p_vdir, 0755);
#endif
@@ -7337,15 +7337,15 @@ static void ex_mkrc(exarg_T *eap)
/*
* Change to session file's dir.
*/
- if (mch_dirname(dirnow, MAXPATHL) == FAIL
- || mch_chdir((char *)dirnow) != 0)
+ if (os_dirname(dirnow, MAXPATHL) == FAIL
+ || os_chdir((char *)dirnow) != 0)
*dirnow = NUL;
if (*dirnow != NUL && (ssop_flags & SSOP_SESDIR)) {
if (vim_chdirfile(fname) == OK)
shorten_fnames(TRUE);
} else if (*dirnow != NUL
&& (ssop_flags & SSOP_CURDIR) && globaldir != NULL) {
- if (mch_chdir((char *)globaldir) == 0)
+ if (os_chdir((char *)globaldir) == 0)
shorten_fnames(TRUE);
}
@@ -7355,7 +7355,7 @@ static void ex_mkrc(exarg_T *eap)
if (*dirnow != NUL && ((ssop_flags & SSOP_SESDIR)
|| ((ssop_flags & SSOP_CURDIR) && globaldir !=
NULL))) {
- if (mch_chdir((char *)dirnow) != 0)
+ if (os_chdir((char *)dirnow) != 0)
EMSG(_(e_prev_dir));
shorten_fnames(TRUE);
}
@@ -7428,7 +7428,7 @@ open_exfile (
#ifdef UNIX
/* with Unix it is possible to open a directory */
- if (mch_isdir(fname)) {
+ if (os_isdir(fname)) {
EMSG2(_(e_isadir2), fname);
return NULL;
}
diff --git a/src/ex_getln.c b/src/ex_getln.c
index e0fc7ec28f..b979373ead 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -3256,13 +3256,13 @@ static int showmatches(expand_T *xp, int wildmenu)
exp_path = expand_env_save_opt(files_found[k], TRUE);
halved_slash = backslash_halve_save(
exp_path != NULL ? exp_path : files_found[k]);
- j = mch_isdir(halved_slash != NULL ? halved_slash
+ j = os_isdir(halved_slash != NULL ? halved_slash
: files_found[k]);
vim_free(exp_path);
vim_free(halved_slash);
} else
/* Expansion was done here, file names are literal. */
- j = mch_isdir(files_found[k]);
+ j = os_isdir(files_found[k]);
if (showtail)
p = L_SHOWFILE(k);
else {
@@ -3954,7 +3954,7 @@ expand_shellcmd (
flags |= EW_FILE | EW_EXEC;
/* For an absolute name we don't use $PATH. */
- if (mch_is_absolute_path(pat))
+ if (os_is_absolute_path(pat))
path = (char_u *)" ";
else if ((pat[0] == '.' && (vim_ispathsep(pat[1])
|| (pat[1] == '.' && vim_ispathsep(pat[2])))))
diff --git a/src/file_search.c b/src/file_search.c
index 92f2a9b509..a7c8b1bf46 100644
--- a/src/file_search.c
+++ b/src/file_search.c
@@ -343,7 +343,7 @@ vim_findfile_init (
path += 2;
} else
#endif
- if (mch_dirname(ff_expand_buffer, MAXPATHL) == FAIL)
+ if (os_dirname(ff_expand_buffer, MAXPATHL) == FAIL)
goto error_return;
search_ctx->ffsc_start_dir = vim_strsave(ff_expand_buffer);
@@ -498,7 +498,7 @@ vim_findfile_init (
STRCPY(buf, ff_expand_buffer);
STRCPY(buf + eb_len, search_ctx->ffsc_fix_path);
- if (mch_isdir(buf)) {
+ if (os_isdir(buf)) {
STRCAT(ff_expand_buffer, search_ctx->ffsc_fix_path);
add_pathsep(ff_expand_buffer);
} else {
@@ -818,7 +818,7 @@ char_u *vim_findfile(void *search_ctx_arg)
for (i = stackp->ffs_filearray_cur;
i < stackp->ffs_filearray_size; ++i) {
if (!path_with_url(stackp->ffs_filearray[i])
- && !mch_isdir(stackp->ffs_filearray[i]))
+ && !os_isdir(stackp->ffs_filearray[i]))
continue; /* not a directory */
/* prepare the filename to be checked for existence
@@ -844,7 +844,7 @@ char_u *vim_findfile(void *search_ctx_arg)
== FINDFILE_BOTH
|| ((search_ctx->ffsc_find_what
== FINDFILE_DIR)
- == mch_isdir(file_path)))))
+ == os_isdir(file_path)))))
#ifndef FF_VERBOSE
&& (ff_check_visited(
&search_ctx->ffsc_visited_list->ffvl_visited_list,
@@ -877,7 +877,7 @@ char_u *vim_findfile(void *search_ctx_arg)
if (!path_with_url(file_path))
simplify_filename(file_path);
- if (mch_dirname(ff_expand_buffer, MAXPATHL)
+ if (os_dirname(ff_expand_buffer, MAXPATHL)
== OK) {
p = shorten_fname(file_path,
ff_expand_buffer);
@@ -910,7 +910,7 @@ char_u *vim_findfile(void *search_ctx_arg)
*/
for (i = stackp->ffs_filearray_cur;
i < stackp->ffs_filearray_size; ++i) {
- if (!mch_isdir(stackp->ffs_filearray[i]))
+ if (!os_isdir(stackp->ffs_filearray[i]))
continue; /* not a directory */
ff_push(search_ctx,
@@ -934,7 +934,7 @@ char_u *vim_findfile(void *search_ctx_arg)
if (fnamecmp(stackp->ffs_filearray[i],
stackp->ffs_fix_path) == 0)
continue; /* don't repush same directory */
- if (!mch_isdir(stackp->ffs_filearray[i]))
+ if (!os_isdir(stackp->ffs_filearray[i]))
continue; /* not a directory */
ff_push(search_ctx,
ff_create_stack_element(stackp->ffs_filearray[i],
@@ -1519,7 +1519,7 @@ find_file_in_path_option (
(os_file_exists(NameBuff)
&& (find_what == FINDFILE_BOTH
|| ((find_what == FINDFILE_DIR)
- == mch_isdir(NameBuff))))) {
+ == os_isdir(NameBuff))))) {
file_name = vim_strsave(NameBuff);
goto theend;
}
diff --git a/src/fileio.c b/src/fileio.c
index 2cf4e15aeb..3f639ac59f 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -405,7 +405,7 @@ readfile (
* On Unix it is possible to read a directory, so we have to
* check for it before the mch_open().
*/
- perm = mch_getperm(fname);
+ perm = os_getperm(fname);
if (perm >= 0 && !S_ISREG(perm) /* not a regular file ... */
# ifdef S_ISFIFO
&& !S_ISFIFO(perm) /* ... or fifo */
@@ -508,8 +508,8 @@ readfile (
/*
* On MSDOS and Amiga we can't open a directory, check here.
*/
- isdir_f = (mch_isdir(fname));
- perm = mch_getperm(fname); /* check if the file exists */
+ isdir_f = (os_isdir(fname));
+ perm = os_getperm(fname); /* check if the file exists */
if (isdir_f) {
filemess(curbuf, sfname, (char_u *)_("is a directory"), 0);
curbuf->b_p_ro = TRUE; /* must use "w!" now */
@@ -613,7 +613,7 @@ readfile (
/* Set swap file protection bits after creating it. */
if (swap_mode > 0 && curbuf->b_ml.ml_mfp != NULL
&& curbuf->b_ml.ml_mfp->mf_fname != NULL)
- (void)mch_setperm(curbuf->b_ml.ml_mfp->mf_fname, (long)swap_mode);
+ (void)os_setperm(curbuf->b_ml.ml_mfp->mf_fname, (long)swap_mode);
#endif
}
@@ -2879,10 +2879,10 @@ buf_write (
newfile = TRUE;
perm = -1;
} else {
- perm = mch_getperm(fname);
+ perm = os_getperm(fname);
if (perm < 0)
newfile = TRUE;
- else if (mch_isdir(fname)) {
+ else if (os_isdir(fname)) {
errnum = (char_u *)"E502: ";
errmsg = (char_u *)_("is a directory");
goto fail;
@@ -3201,7 +3201,7 @@ buf_write (
} else {
/* set file protection same as original file, but
* strip s-bit */
- (void)mch_setperm(backup, perm & 0777);
+ (void)os_setperm(backup, perm & 0777);
#ifdef UNIX
/*
@@ -3215,7 +3215,7 @@ buf_write (
&& fchown(bfd, (uid_t)-1, st_old.st_gid) != 0
# endif
)
- mch_setperm(backup,
+ os_setperm(backup,
(perm & 0707) | ((perm & 07) << 3));
# ifdef HAVE_SELINUX
mch_copy_sec(fname, backup);
@@ -3371,7 +3371,7 @@ nobackup:
if (forceit && perm >= 0 && !(perm & 0200) && st_old.st_uid == getuid()
&& vim_strchr(p_cpo, CPO_FWRITE) == NULL) {
perm |= 0200;
- (void)mch_setperm(fname, perm);
+ (void)os_setperm(fname, perm);
made_writable = TRUE;
}
#endif
@@ -3760,7 +3760,7 @@ restore_backup:
|| st.st_gid != st_old.st_gid) {
ignored = fchown(fd, st_old.st_uid, st_old.st_gid);
if (perm >= 0) /* set permission again, may have changed */
- (void)mch_setperm(wfname, perm);
+ (void)os_setperm(wfname, perm);
}
# endif
buf_setino(buf);
@@ -3779,7 +3779,7 @@ restore_backup:
perm &= ~0200; /* reset 'w' bit for security reasons */
#endif
if (perm >= 0) /* set perm. of new file same as old file */
- (void)mch_setperm(wfname, perm);
+ (void)os_setperm(wfname, perm);
#ifdef HAVE_ACL
/* Probably need to set the ACL before changing the user (can't set the
* ACL on a file the user doesn't own). */
@@ -3996,7 +3996,7 @@ restore_backup:
close(empty_fd);
}
if (org != NULL) {
- mch_setperm((char_u *)org, mch_getperm(fname) & 0777);
+ os_setperm((char_u *)org, os_getperm(fname) & 0777);
vim_free(org);
}
}
@@ -4716,7 +4716,7 @@ char_u *shorten_fname1(char_u *full_path)
dirname = alloc(MAXPATHL);
if (dirname == NULL)
return full_path;
- if (mch_dirname(dirname, MAXPATHL) == OK) {
+ if (os_dirname(dirname, MAXPATHL) == OK) {
p = shorten_fname(full_path, dirname);
if (p == NULL || *p == NUL)
p = full_path;
@@ -4768,14 +4768,14 @@ void shorten_fnames(int force)
buf_T *buf;
char_u *p;
- mch_dirname(dirname, MAXPATHL);
+ os_dirname(dirname, MAXPATHL);
for (buf = firstbuf; buf != NULL; buf = buf->b_next) {
if (buf->b_fname != NULL
&& !bt_nofile(buf)
&& !path_with_url(buf->b_fname)
&& (force
|| buf->b_sfname == NULL
- || mch_is_absolute_path(buf->b_sfname))) {
+ || os_is_absolute_path(buf->b_sfname))) {
vim_free(buf->b_sfname);
buf->b_sfname = NULL;
p = shorten_fname(buf->b_ffname, dirname);
@@ -4810,7 +4810,7 @@ void shorten_filenames(char_u **fnames, int count)
if (fnames == NULL || count < 1)
return;
- mch_dirname(dirname, sizeof(dirname));
+ os_dirname(dirname, sizeof(dirname));
for (i = 0; i < count; ++i) {
if ((p = shorten_fname(fnames[i], dirname)) != NULL) {
/* shorten_fname() returns pointer in given "fnames[i]". If free
@@ -4875,7 +4875,7 @@ buf_modname (
retval = alloc((unsigned)(MAXPATHL + extlen + 3));
if (retval == NULL)
return NULL;
- if (mch_dirname(retval, MAXPATHL) == FAIL ||
+ if (os_dirname(retval, MAXPATHL) == FAIL ||
(fnamelen = (int)STRLEN(retval)) == 0) {
vim_free(retval);
return NULL;
@@ -5185,7 +5185,7 @@ int vim_rename(char_u *from, char_u *to)
/*
* Rename() failed, try copying the file.
*/
- perm = mch_getperm(from);
+ perm = os_getperm(from);
#ifdef HAVE_ACL
/* For systems that support ACL: get the ACL from the original file. */
acl = mch_get_acl(from);
@@ -5234,7 +5234,7 @@ int vim_rename(char_u *from, char_u *to)
to = from;
}
#ifndef UNIX /* for Unix mch_open() already set the permission */
- mch_setperm(to, perm);
+ os_setperm(to, perm);
#endif
#ifdef HAVE_ACL
mch_set_acl(to, acl);
@@ -5405,7 +5405,7 @@ buf_check_timestamp (
#ifdef HAVE_ST_MODE
|| (int)st.st_mode != buf->b_orig_mode
#else
- || mch_getperm(buf->b_ffname) != buf->b_orig_mode
+ || os_getperm(buf->b_ffname) != buf->b_orig_mode
#endif
)) {
retval = 1;
@@ -5421,7 +5421,7 @@ buf_check_timestamp (
/* Don't do anything for a directory. Might contain the file
* explorer. */
- if (mch_isdir(buf->b_fname))
+ if (os_isdir(buf->b_fname))
;
/*
@@ -5725,7 +5725,7 @@ void buf_store_time(buf_T *buf, struct stat *st, char_u *fname)
#ifdef HAVE_ST_MODE
buf->b_orig_mode = (int)st->st_mode;
#else
- buf->b_orig_mode = mch_getperm(fname);
+ buf->b_orig_mode = os_getperm(fname);
#endif
}
@@ -5836,7 +5836,7 @@ vim_tempname (
/* expand $TMP, leave room for "/v1100000/999999999" */
expand_env((char_u *)tempdirs[i], itmp, TEMPNAMELEN - 20);
- if (mch_isdir(itmp)) { /* directory exists */
+ if (os_isdir(itmp)) { /* directory exists */
add_pathsep(itmp);
# ifdef HAVE_MKDTEMP
diff --git a/src/globals.h b/src/globals.h
index 960e828532..56d2a24235 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -1137,6 +1137,6 @@ EXTERN char *ignoredp;
* os_unix.c */
EXTERN int curr_tmode INIT(= TMODE_COOK); /* contains current terminal mode */
/* volatile because it is used in signal handler deathtrap(). */
-EXTERN volatile bool in_mch_delay INIT(= false); /* sleeping in mch_delay() */
+EXTERN volatile bool in_os_delay INIT(= false); /* sleeping in os_delay() */
#endif /* NEOVIM_GLOBALS_H */
diff --git a/src/hardcopy.c b/src/hardcopy.c
index 0b5d29e998..239e1bd0ac 100644
--- a/src/hardcopy.c
+++ b/src/hardcopy.c
@@ -2534,7 +2534,7 @@ int mch_print_begin(prt_settings_T *psettings)
*/
prt_dsc_start();
prt_dsc_textline("Title", (char *)psettings->jobname);
- if (mch_get_user_name(buffer, 256) == FAIL) {
+ if (os_get_user_name(buffer, 256) == FAIL) {
STRCPY(buffer, "Unknown");
}
prt_dsc_textline("For", buffer);
diff --git a/src/if_cscope.c b/src/if_cscope.c
index 85633db927..fc7864b6e8 100644
--- a/src/if_cscope.c
+++ b/src/if_cscope.c
@@ -2073,7 +2073,7 @@ static void cs_release_csp(int i, int freefnpp)
waitpid_errno = errno;
if (pid != 0)
break; /* break unless the process is still running */
- mch_delay(50L, FALSE); /* sleep 50 ms */
+ os_delay(50L, FALSE); /* sleep 50 ms */
}
# endif
/*
@@ -2104,7 +2104,7 @@ static void cs_release_csp(int i, int freefnpp)
alive = FALSE; /* cscope process no longer exists */
break;
}
- mch_delay(50L, FALSE); /* sleep 50ms */
+ os_delay(50L, FALSE); /* sleep 50ms */
}
}
if (alive)
diff --git a/src/main.c b/src/main.c
index e5a773e1d4..9cac0918ee 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1434,8 +1434,8 @@ scripterror:
if (ga_grow(&global_alist.al_ga, 1) == FAIL
|| (p = vim_strsave((char_u *)argv[0])) == NULL)
mch_exit(2);
- if (parmp->diff_mode && mch_isdir(p) && GARGCOUNT > 0
- && !mch_isdir(alist_name(&GARGLIST[0]))) {
+ if (parmp->diff_mode && os_isdir(p) && GARGCOUNT > 0
+ && !os_isdir(alist_name(&GARGLIST[0]))) {
char_u *r;
r = concat_fnames(p, gettail(alist_name(&GARGLIST[0])), TRUE);
@@ -2115,7 +2115,7 @@ process_env (
linenr_T save_sourcing_lnum;
scid_T save_sid;
- initstr = (char_u *)mch_getenv((char *)env);
+ initstr = (char_u *)os_getenv((char *)env);
if (initstr != NULL && *initstr != NUL) {
if (is_viminit)
vimrc_found(NULL, NULL);
diff --git a/src/mark.c b/src/mark.c
index d153ab0a19..5e23e07857 100644
--- a/src/mark.c
+++ b/src/mark.c
@@ -480,7 +480,7 @@ static void fname2fnum(xfmark_T *fm)
vim_strncpy(NameBuff, fm->fname, MAXPATHL - 1);
/* Try to shorten the file name. */
- mch_dirname(IObuff, IOSIZE);
+ os_dirname(IObuff, IOSIZE);
p = shorten_fname(NameBuff, IObuff);
/* buflist_new() will call fmarks_check_names() */
diff --git a/src/mbyte.c b/src/mbyte.c
index 95b28a6dad..8ac60ede11 100644
--- a/src/mbyte.c<