mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Remove code and checks for unsupported systems.
Remove remnants of support for systems including __EMX__, MSDOS, OS2, AMIGA and MORPHOS.
This commit is contained in:
parent
4e1b364a3e
commit
9da32a1f78
@ -85,9 +85,6 @@
|
||||
|
||||
/*
|
||||
* Character that separates dir names in a path.
|
||||
* For MS-DOS, WIN32 and OS/2 we use a backslash. A slash mostly works
|
||||
* fine, but there are places where it doesn't (e.g. in a command name).
|
||||
* For Acorn we use a dot.
|
||||
*/
|
||||
#ifdef BACKSLASH_IN_FILENAME
|
||||
# define PATHSEP psepc
|
||||
|
@ -1860,7 +1860,7 @@ int hexhex2nr(char_u *p)
|
||||
// && defined(FEAT_WINDOWS)) || defined(PROTO)
|
||||
|
||||
/// Return TRUE if "str" starts with a backslash that should be removed.
|
||||
/// For MS-DOS, WIN32 and OS/2 this is only done when the character after the
|
||||
/// For WIN32 this is only done when the character after the
|
||||
/// backslash is not a normal file name character.
|
||||
/// '$' is a valid file name character, we don't remove the backslash before
|
||||
/// it. This means it is not possible to use an environment variable after a
|
||||
@ -1891,8 +1891,6 @@ int rem_backslash(char_u *str)
|
||||
}
|
||||
|
||||
/// Halve the number of backslashes in a file name argument.
|
||||
/// For MS-DOS we only do this if the character after the backslash
|
||||
/// is not a normal file character.
|
||||
///
|
||||
/// @param p
|
||||
void backslash_halve(char_u *p)
|
||||
|
@ -10269,7 +10269,7 @@ static void f_has(typval_T *argvars, typval_T *rettv)
|
||||
"mksession",
|
||||
"modify_fname",
|
||||
"mouse",
|
||||
#if defined(UNIX) || defined(VMS)
|
||||
#if defined(UNIX)
|
||||
"mouse_dec",
|
||||
# ifdef FEAT_MOUSE_JSB
|
||||
"mouse_jsbterm",
|
||||
@ -19461,9 +19461,9 @@ repeat:
|
||||
valid |= VALID_PATH;
|
||||
*usedlen += 2;
|
||||
|
||||
/* Expand "~/path" for all systems and "~user/path" for Unix and VMS */
|
||||
/* Expand "~/path" for all systems and "~user/path" for Unix */
|
||||
if ((*fnamep)[0] == '~'
|
||||
#if !defined(UNIX) && !(defined(VMS) && defined(USER_HOME))
|
||||
#if !defined(UNIX)
|
||||
&& ((*fnamep)[1] == '/'
|
||||
# ifdef BACKSLASH_IN_FILENAME
|
||||
|| (*fnamep)[1] == '\\'
|
||||
|
@ -1349,7 +1349,7 @@ make_filter_cmd (
|
||||
if (buf == NULL)
|
||||
return NULL;
|
||||
|
||||
#if (defined(UNIX) && !defined(ARCHIE)) || defined(OS2)
|
||||
#if defined(UNIX)
|
||||
/*
|
||||
* Put braces around the command (for concatenated commands) when
|
||||
* redirecting input and/or output.
|
||||
@ -1515,7 +1515,7 @@ void write_viminfo(char_u *file, int forceit)
|
||||
char_u *tempname = NULL; /* name of temp viminfo file */
|
||||
struct stat st_new; /* mch_stat() of potential new file */
|
||||
char_u *wp;
|
||||
#if defined(UNIX) || defined(VMS)
|
||||
#if defined(UNIX)
|
||||
mode_t umask_save;
|
||||
#endif
|
||||
#ifdef UNIX
|
||||
@ -1535,7 +1535,7 @@ void write_viminfo(char_u *file, int forceit)
|
||||
/* if it does exist, but we can't read it, don't try writing */
|
||||
if (mch_stat((char *)fname, &st_new) == 0)
|
||||
goto end;
|
||||
#if defined(UNIX) || defined(VMS)
|
||||
#if defined(UNIX)
|
||||
/*
|
||||
* For Unix we create the .viminfo non-accessible for others,
|
||||
* because it may contain text from non-accessible documents.
|
||||
@ -1543,7 +1543,7 @@ void write_viminfo(char_u *file, int forceit)
|
||||
umask_save = umask(077);
|
||||
#endif
|
||||
fp_out = mch_fopen((char *)fname, WRITEBIN);
|
||||
#if defined(UNIX) || defined(VMS)
|
||||
#if defined(UNIX)
|
||||
(void)umask(umask_save);
|
||||
#endif
|
||||
} else {
|
||||
|
@ -2810,19 +2810,6 @@ void free_scriptnames(void)
|
||||
|
||||
|
||||
#if defined(USE_CR) || defined(PROTO)
|
||||
|
||||
# if defined(__MSL__) && (__MSL__ >= 22)
|
||||
/*
|
||||
* Newer version of the Metrowerks library handle DOS and UNIX files
|
||||
* without help.
|
||||
* Test with earlier versions, MSL 2.2 is the library supplied with
|
||||
* Codewarrior Pro 2.
|
||||
*/
|
||||
char *fgets_cr(char *s, int n, FILE *stream)
|
||||
{
|
||||
return fgets(s, n, stream);
|
||||
}
|
||||
# else
|
||||
/*
|
||||
* Version of fgets() which also works for lines ending in a <CR> only
|
||||
* (Macintosh format).
|
||||
@ -2856,7 +2843,6 @@ char *fgets_cr(char *s, int n, FILE *stream)
|
||||
return s;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Get one full line from a sourced file.
|
||||
|
@ -173,7 +173,7 @@ static void ex_sleep(exarg_T *eap);
|
||||
static void do_exmap(exarg_T *eap, int isabbrev);
|
||||
static void ex_winsize(exarg_T *eap);
|
||||
static void ex_wincmd(exarg_T *eap);
|
||||
#if defined(FEAT_GUI) || defined(UNIX) || defined(VMS) || defined(MSWIN)
|
||||
#if defined(FEAT_GUI) || defined(UNIX) || defined(MSWIN)
|
||||
static void ex_winpos(exarg_T *eap);
|
||||
#else
|
||||
# define ex_winpos ex_ni
|
||||
@ -3754,10 +3754,10 @@ int expand_filename(exarg_T *eap, char_u **cmdlinep, char_u **errormsgp)
|
||||
|
||||
/*
|
||||
* Halve the number of backslashes (this is Vi compatible).
|
||||
* For Unix and OS/2, when wildcards are expanded, this is
|
||||
* For Unix, when wildcards are expanded, this is
|
||||
* done by ExpandOne() below.
|
||||
*/
|
||||
#if defined(UNIX) || defined(OS2)
|
||||
#if defined(UNIX)
|
||||
if (!has_wildcards)
|
||||
#endif
|
||||
backslash_halve(eap->arg);
|
||||
@ -5702,11 +5702,7 @@ static void ex_goto(exarg_T *eap)
|
||||
* list. This function takes over responsibility for freeing the list.
|
||||
*
|
||||
* XXX The list is made into the argument list. This is freed using
|
||||
* FreeWild(), which does a series of vim_free() calls, unless the two defines
|
||||
* __EMX__ and __ALWAYS_HAS_TRAILING_NUL_POINTER are set. In this case, a
|
||||
* routine _fnexplodefree() is used. This may cause problems, but as the drop
|
||||
* file functionality is (currently) not in EMX this is not presently a
|
||||
* problem.
|
||||
* FreeWild(), which does a series of vim_free() calls.
|
||||
*/
|
||||
void
|
||||
handle_drop (
|
||||
@ -5820,7 +5816,7 @@ void alist_new(void)
|
||||
}
|
||||
}
|
||||
|
||||
#if (!defined(UNIX) && !defined(__EMX__)) || defined(ARCHIE) || defined(PROTO)
|
||||
#if !defined(UNIX) || defined(PROTO)
|
||||
/*
|
||||
* Expand the file names in the global argument list.
|
||||
* If "fnum_list" is not NULL, use "fnum_list[fnum_len]" as a list of buffer
|
||||
@ -6592,7 +6588,7 @@ void ex_cd(exarg_T *eap)
|
||||
char_u *tofree;
|
||||
|
||||
new_dir = eap->arg;
|
||||
#if !defined(UNIX) && !defined(VMS)
|
||||
#if !defined(UNIX)
|
||||
/* for non-UNIX ":cd" means: print current directory */
|
||||
if (*new_dir == NUL)
|
||||
ex_pwd(NULL);
|
||||
@ -6624,7 +6620,7 @@ void ex_cd(exarg_T *eap)
|
||||
else
|
||||
prev_dir = NULL;
|
||||
|
||||
#if defined(UNIX) || defined(VMS)
|
||||
#if defined(UNIX)
|
||||
/* for UNIX ":cd" means: go to home directory */
|
||||
if (*new_dir == NUL) {
|
||||
/* use NameBuff for home directory name */
|
||||
@ -6769,7 +6765,7 @@ static void ex_wincmd(exarg_T *eap)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(FEAT_GUI) || defined(UNIX) || defined(VMS) || defined(MSWIN)
|
||||
#if defined(FEAT_GUI) || defined(UNIX) || defined(MSWIN)
|
||||
/*
|
||||
* ":winpos".
|
||||
*/
|
||||
@ -8915,7 +8911,7 @@ static char_u *get_view_file(int c)
|
||||
*s++ = '=';
|
||||
} else if (vim_ispathsep(*p)) {
|
||||
*s++ = '=';
|
||||
#if defined(BACKSLASH_IN_FILENAME) || defined(VMS)
|
||||
#if defined(BACKSLASH_IN_FILENAME)
|
||||
if (*p == ':')
|
||||
*s++ = '-';
|
||||
else
|
||||
|
45
src/fileio.c
45
src/fileio.c
@ -347,7 +347,7 @@ readfile (
|
||||
*/
|
||||
if (sfname == NULL)
|
||||
sfname = fname;
|
||||
#if defined(UNIX) || defined(__EMX__)
|
||||
#if defined(UNIX)
|
||||
fname = sfname;
|
||||
#endif
|
||||
|
||||
@ -492,7 +492,7 @@ readfile (
|
||||
msg_scroll = msg_save;
|
||||
#ifndef UNIX
|
||||
/*
|
||||
* On MSDOS and Amiga we can't open a directory, check here.
|
||||
* On non-unix systems we can't open a directory, check here.
|
||||
*/
|
||||
perm = os_getperm(fname); /* check if the file exists */
|
||||
if (os_isdir(fname)) {
|
||||
@ -2478,7 +2478,7 @@ buf_write (
|
||||
bool file_readonly = false; /* overwritten file is read-only */
|
||||
static char *err_readonly =
|
||||
"is read-only (cannot override: \"W\" in 'cpoptions')";
|
||||
#if defined(UNIX) || defined(__EMX__XX) /*XXX fix me sometime? */
|
||||
#if defined(UNIX)
|
||||
int made_writable = FALSE; /* 'w' bit has been set */
|
||||
#endif
|
||||
/* writing everything */
|
||||
@ -2773,7 +2773,7 @@ buf_write (
|
||||
/*
|
||||
* Get information about original file (if there is one).
|
||||
*/
|
||||
#if defined(UNIX) && !defined(ARCHIE)
|
||||
#if defined(UNIX)
|
||||
st_old.st_dev = 0;
|
||||
st_old.st_ino = 0;
|
||||
perm = -1;
|
||||
@ -3302,7 +3302,7 @@ nobackup:
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(UNIX) && !defined(ARCHIE)
|
||||
#if defined(UNIX)
|
||||
/* When using ":w!" and the file was read-only: make it writable */
|
||||
if (forceit && perm >= 0 && !(perm & 0200) && st_old.st_uid == getuid()
|
||||
&& vim_strchr(p_cpo, CPO_FWRITE) == NULL) {
|
||||
@ -3811,7 +3811,7 @@ restore_backup:
|
||||
lnum -= start; /* compute number of written lines */
|
||||
--no_wait_return; /* may wait for return now */
|
||||
|
||||
#if !(defined(UNIX) || defined(VMS))
|
||||
#if !defined(UNIX)
|
||||
fname = sfname; /* use shortname now, for the messages */
|
||||
#endif
|
||||
if (!filtering) {
|
||||
@ -4201,7 +4201,7 @@ static int check_mtime(buf_T *buf, struct stat *st)
|
||||
|
||||
static int time_differs(long t1, long t2)
|
||||
{
|
||||
#if defined(__linux__) || defined(MSDOS) || defined(MSWIN)
|
||||
#if defined(__linux__) || defined(MSWIN)
|
||||
/* On a FAT filesystem, esp. under Linux, there are only 5 bits to store
|
||||
* the seconds. Since the roundoff is done when flushing the inode, the
|
||||
* time may change unexpectedly by one second!!! */
|
||||
@ -4673,7 +4673,7 @@ void shorten_fnames(int force)
|
||||
|
||||
/*
|
||||
* add extension to file name - change path/fo.o.h to path/fo.o.h.ext or
|
||||
* fo_o_h.ext for MSDOS or when shortname option set.
|
||||
* fo_o_h.ext when shortname option set.
|
||||
*
|
||||
* Assumed that fname is a valid name found in the filesystem we assure that
|
||||
* the return value is a different name and ends in 'ext'.
|
||||
@ -4740,9 +4740,8 @@ buf_modname (
|
||||
|
||||
/*
|
||||
* search backwards until we hit a '/', '\' or ':' replacing all '.'
|
||||
* by '_' for MSDOS or when shortname option set and ext starts with a dot.
|
||||
* Then truncate what is after the '/', '\' or ':' to 8 characters for
|
||||
* MSDOS and 26 characters for AMIGA, a lot more for UNIX.
|
||||
* by '_' when shortname option set and ext starts with a dot.
|
||||
* Then truncate what is after the '/', '\' or ':'.
|
||||
*/
|
||||
for (ptr = retval + fnamelen; ptr > retval; mb_ptr_back(retval, ptr)) {
|
||||
if (*ext == '.'
|
||||
@ -4814,7 +4813,7 @@ buf_modname (
|
||||
else if ((int)STRLEN(e) + extlen > 4)
|
||||
s = e + 4 - extlen;
|
||||
}
|
||||
#if defined(OS2) || defined(USE_LONG_FNAME) || defined(WIN3264)
|
||||
#if defined(USE_LONG_FNAME) || defined(WIN3264)
|
||||
/*
|
||||
* If there is no file name, and the extension starts with '.', put a
|
||||
* '_' before the dot, because just ".ext" may be invalid if it's on a
|
||||
@ -5699,7 +5698,7 @@ vim_tempname (
|
||||
* doesn't exist. */
|
||||
for (off = 0; off < 10000L; ++off) {
|
||||
int r;
|
||||
# if defined(UNIX) || defined(VMS)
|
||||
# if defined(UNIX)
|
||||
mode_t umask_save;
|
||||
# endif
|
||||
|
||||
@ -5711,13 +5710,13 @@ vim_tempname (
|
||||
if (mch_stat((char *)itmp, &st) >= 0)
|
||||
continue;
|
||||
# endif
|
||||
# if defined(UNIX) || defined(VMS)
|
||||
# if defined(UNIX)
|
||||
/* Make sure the umask doesn't remove the executable bit.
|
||||
* "repl" has been reported to use "177". */
|
||||
umask_save = umask(077);
|
||||
# endif
|
||||
r = os_mkdir((char *)itmp, 0700);
|
||||
# if defined(UNIX) || defined(VMS)
|
||||
# if defined(UNIX)
|
||||
(void)umask(umask_save);
|
||||
# endif
|
||||
if (r == 0) {
|
||||
@ -5761,27 +5760,11 @@ vim_tempname (
|
||||
# else
|
||||
char_u *p;
|
||||
|
||||
# ifdef VMS_TEMPNAM
|
||||
/* mktemp() is not working on VMS. It seems to be
|
||||
* a do-nothing function. Therefore we use tempnam().
|
||||
*/
|
||||
sprintf((char *)itmp, "VIM%c", extra_char);
|
||||
p = (char_u *)tempnam("tmp:", (char *)itmp);
|
||||
if (p != NULL) {
|
||||
/* VMS will use '.LOG' if we don't explicitly specify an extension,
|
||||
* and VIM will then be unable to find the file later */
|
||||
STRCPY(itmp, p);
|
||||
STRCAT(itmp, ".txt");
|
||||
free(p);
|
||||
} else
|
||||
return NULL;
|
||||
# else
|
||||
STRCPY(itmp, TEMPNAME);
|
||||
if ((p = vim_strchr(itmp, '?')) != NULL)
|
||||
*p = extra_char;
|
||||
if (mktemp((char *)itmp) == NULL)
|
||||
return NULL;
|
||||
# endif
|
||||
# endif
|
||||
|
||||
return vim_strsave(itmp);
|
||||
|
@ -4316,8 +4316,7 @@ check_map (
|
||||
}
|
||||
|
||||
|
||||
#if defined(MSDOS) || defined(MSWIN) || defined(OS2) \
|
||||
|| defined(FEAT_CMDWIN) || defined(MACOS) || defined(PROTO)
|
||||
#if defined(MSWIN) || defined(FEAT_CMDWIN) || defined(MACOS) || defined(PROTO)
|
||||
/*
|
||||
* Add a mapping "map" for mode "mode".
|
||||
* Need to put string in allocated memory, because do_map() will modify it.
|
||||
|
@ -189,7 +189,7 @@ EXTERN int did_wait_return INIT(= FALSE); /* wait_return() was used and
|
||||
EXTERN int need_maketitle INIT(= TRUE); /* call maketitle() soon */
|
||||
|
||||
EXTERN int quit_more INIT(= FALSE); /* 'q' hit at "--more--" msg */
|
||||
#if defined(UNIX) || defined(__EMX__) || defined(VMS) || defined(MACOS_X)
|
||||
#if defined(UNIX) || defined(MACOS_X)
|
||||
EXTERN int newline_on_exit INIT(= FALSE); /* did msg in altern. screen */
|
||||
EXTERN int intr_char INIT(= 0); /* extra interrupt character */
|
||||
#endif
|
||||
@ -952,7 +952,7 @@ EXTERN int typebuf_was_filled INIT(= FALSE); /* received text from client
|
||||
or from feedkeys() */
|
||||
|
||||
|
||||
#if defined(UNIX) || defined(VMS)
|
||||
#if defined(UNIX)
|
||||
EXTERN int term_is_xterm INIT(= FALSE); /* xterm-like 'term' */
|
||||
#endif
|
||||
|
||||
|
@ -94,10 +94,6 @@
|
||||
*/
|
||||
#define vim_isbreak(c) (breakat_flags[(char_u)(c)])
|
||||
|
||||
/*
|
||||
* On VMS file names are different and require a translation.
|
||||
* On the Mac open() has only two arguments.
|
||||
*/
|
||||
# define mch_fopen(n, p) fopen((n), (p))
|
||||
# define mch_fstat(n, p) fstat((n), (p))
|
||||
# ifdef STAT_IGNORES_SLASH
|
||||
@ -117,7 +113,7 @@
|
||||
# define mch_open(n, m, p) open((n), (m), (p))
|
||||
|
||||
/* mch_open_rw(): invoke mch_open() with third argument for user R/W. */
|
||||
#if defined(UNIX) || defined(VMS) /* open in rw------- mode */
|
||||
#if defined(UNIX) /* open in rw------- mode */
|
||||
# define mch_open_rw(n, f) mch_open((n), (f), (mode_t)0600)
|
||||
#else
|
||||
# define mch_open_rw(n, f) mch_open((n), (f), 0)
|
||||
|
25
src/main.c
25
src/main.c
@ -86,7 +86,7 @@ typedef struct {
|
||||
int window_count; /* number of windows to use */
|
||||
int window_layout; /* 0, WIN_HOR, WIN_VER or WIN_TABS */
|
||||
|
||||
#if (!defined(UNIX) && !defined(__EMX__)) || defined(ARCHIE)
|
||||
#if !defined(UNIX)
|
||||
int literal; /* don't expand file names */
|
||||
#endif
|
||||
int diff_mode; /* start with 'diff' set */
|
||||
@ -99,7 +99,7 @@ typedef struct {
|
||||
#define EDIT_TAG 3 /* tag name argument given, use tagname */
|
||||
#define EDIT_QF 4 /* start in quickfix mode */
|
||||
|
||||
#if (defined(UNIX) || defined(VMS)) && !defined(NO_VIM_MAIN)
|
||||
#if defined(UNIX) && !defined(NO_VIM_MAIN)
|
||||
static int file_owned(char *fname);
|
||||
#endif
|
||||
static void mainerr(int, char_u *);
|
||||
@ -278,7 +278,6 @@ static char *(main_errors[]) =
|
||||
/*
|
||||
* mch_init() sets up the terminal (window) for use. This must be
|
||||
* done after resetting full_screen, otherwise it may move the cursor
|
||||
* (MSDOS).
|
||||
* Note that we may use mch_exit() before mch_init()!
|
||||
*/
|
||||
mch_init();
|
||||
@ -411,7 +410,7 @@ static char *(main_errors[]) =
|
||||
if (params.edit_type == EDIT_STDIN && !recoverymode)
|
||||
read_stdin();
|
||||
|
||||
#if defined(UNIX) || defined(VMS)
|
||||
#if defined(UNIX)
|
||||
/* When switching screens and something caused a message from a vimrc
|
||||
* script, need to output an extra newline on exit. */
|
||||
if ((did_emsg || msg_didout) && *T_TI != NUL)
|
||||
@ -1055,7 +1054,7 @@ static void command_line_scan(mparm_T *parmp)
|
||||
msg_didout = FALSE;
|
||||
mch_exit(0);
|
||||
} else if (STRNICMP(argv[0] + argv_idx, "literal", 7) == 0) {
|
||||
#if (!defined(UNIX) && !defined(__EMX__)) || defined(ARCHIE)
|
||||
#if !defined(UNIX)
|
||||
parmp->literal = TRUE;
|
||||
#endif
|
||||
} else if (STRNICMP(argv[0] + argv_idx, "nofork", 6) == 0) {
|
||||
@ -1443,7 +1442,7 @@ scripterror:
|
||||
#endif
|
||||
|
||||
alist_add(&global_alist, p,
|
||||
#if (!defined(UNIX) && !defined(__EMX__)) || defined(ARCHIE)
|
||||
#if !defined(UNIX)
|
||||
parmp->literal ? 2 : 0 /* add buffer nr after exp. */
|
||||
#else
|
||||
2 /* add buffer number now and use curbuf */
|
||||
@ -1534,7 +1533,7 @@ static void check_and_set_isatty(mparm_T *paramp)
|
||||
*/
|
||||
static char_u *get_fname(mparm_T *parmp)
|
||||
{
|
||||
#if (!defined(UNIX) && !defined(__EMX__)) || defined(ARCHIE)
|
||||
#if !defined(UNIX)
|
||||
/*
|
||||
* Expand wildcards in file names.
|
||||
*/
|
||||
@ -2026,7 +2025,7 @@ static void source_startup_scripts(mparm_T *parmp)
|
||||
* SYS_VIMRC_FILE.
|
||||
*/
|
||||
if (p_exrc) {
|
||||
#if defined(UNIX) || defined(VMS)
|
||||
#if defined(UNIX)
|
||||
/* If ".vimrc" file is not owned by user, set 'secure' mode. */
|
||||
if (!file_owned(VIMRC_FILE))
|
||||
#endif
|
||||
@ -2051,7 +2050,7 @@ static void source_startup_scripts(mparm_T *parmp)
|
||||
i = do_source((char_u *)VIMRC_FILE, TRUE, DOSO_VIMRC);
|
||||
|
||||
if (i == FAIL) {
|
||||
#if defined(UNIX) || defined(VMS)
|
||||
#if defined(UNIX)
|
||||
/* if ".exrc" is not owned by user set 'secure' mode */
|
||||
if (!file_owned(EXRC_FILE))
|
||||
secure = p_secure;
|
||||
@ -2121,7 +2120,7 @@ process_env (
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
#if (defined(UNIX) || defined(VMS)) && !defined(NO_VIM_MAIN)
|
||||
#if defined(UNIX) && !defined(NO_VIM_MAIN)
|
||||
/*
|
||||
* Return TRUE if we are certain the user owns the file "fname".
|
||||
* Used for ".vimrc" and ".exrc".
|
||||
@ -2130,11 +2129,7 @@ process_env (
|
||||
static int file_owned(char *fname)
|
||||
{
|
||||
struct stat s;
|
||||
# ifdef UNIX
|
||||
uid_t uid = getuid();
|
||||
# else /* VMS */
|
||||
uid_t uid = ((getgid() << 16) | getuid());
|
||||
# endif
|
||||
|
||||
return !(mch_stat(fname, &s) != 0 || s.st_uid != uid
|
||||
# ifdef HAVE_LSTAT
|
||||
@ -2212,7 +2207,7 @@ static void usage(void)
|
||||
|
||||
mch_msg(_("\n\nArguments:\n"));
|
||||
main_msg(_("--\t\t\tOnly file names after this"));
|
||||
#if (!defined(UNIX) && !defined(__EMX__)) || defined(ARCHIE)
|
||||
#if !defined(UNIX)
|
||||
main_msg(_("--literal\t\tDon't expand wildcards"));
|
||||
#endif
|
||||
main_msg(_("-v\t\t\tVi mode (like \"vi\")"));
|
||||
|
@ -3814,8 +3814,7 @@ int convert_setup_ext(vcp, from, from_unicode_is_utf8, to, to_unicode_is_utf8)
|
||||
return OK;
|
||||
}
|
||||
|
||||
#if defined(FEAT_GUI) || defined(WIN3264) \
|
||||
|| defined(MSDOS) || defined(PROTO)
|
||||
#if defined(FEAT_GUI) || defined(WIN3264) || defined(PROTO)
|
||||
/*
|
||||
* Do conversion on typed input characters in-place.
|
||||
* The input and output are not NUL terminated!
|
||||
|
@ -473,17 +473,6 @@ void mf_free(memfile_T *mfp, bhdr_T *hp)
|
||||
mf_ins_free(mfp, hp); /* put *hp in the free list */
|
||||
}
|
||||
|
||||
#if defined(__MORPHOS__) && defined(__libnix__)
|
||||
/* function is missing in MorphOS libnix version */
|
||||
extern unsigned long *__stdfiledes;
|
||||
|
||||
static unsigned long fdtofh(int filedescriptor)
|
||||
{
|
||||
return __stdfiledes[filedescriptor];
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Sync the memory file *mfp to disk.
|
||||
* Flags:
|
||||
@ -501,7 +490,7 @@ int mf_sync(memfile_T *mfp, int flags)
|
||||
{
|
||||
int status;
|
||||
bhdr_T *hp;
|
||||
#if defined(SYNC_DUP_CLOSE) && !defined(MSDOS)
|
||||
#if defined(SYNC_DUP_CLOSE)
|
||||
int fd;
|
||||
#endif
|
||||
int got_int_save = got_int;
|
||||
@ -554,15 +543,6 @@ int mf_sync(memfile_T *mfp, int flags)
|
||||
if ((flags & MFS_FLUSH) && *p_sws != NUL) {
|
||||
#if defined(UNIX)
|
||||
# ifdef HAVE_FSYNC
|
||||
/*
|
||||
* most Unixes have the very useful fsync() function, just what we need.
|
||||
* However, with OS/2 and EMX it is also available, but there are
|
||||
* reports of bad problems with it (a bug in HPFS.IFS).
|
||||
* So we disable use of it here in case someone tries to be smart
|
||||
* and changes os_os2_cfg.h... (even though there is no __EMX__ test
|
||||
* in the #if, as __EMX__ does not have sync(); we hope for a timely
|
||||
* sync from the system itself).
|
||||
*/
|
||||
if (STRCMP(p_sws, "fsync") == 0) {
|
||||
if (fsync(mfp->mf_fd))
|
||||
status = FAIL;
|
||||
|
@ -1709,8 +1709,7 @@ static char_u *make_percent_swname(char_u *dir, char_u *name)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (defined(UNIX) || defined(__EMX__) || defined(VMS)) && \
|
||||
(defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG))
|
||||
#if defined(UNIX) && (defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG))
|
||||
static int process_still_running;
|
||||
#endif
|
||||
|
||||
@ -1784,8 +1783,7 @@ static time_t swapfile_info(char_u *fname)
|
||||
if (char_to_long(b0.b0_pid) != 0L) {
|
||||
MSG_PUTS(_("\n process ID: "));
|
||||
msg_outnum(char_to_long(b0.b0_pid));
|
||||
#if defined(UNIX) || defined(__EMX__)
|
||||
/* EMX kill() not working correctly, it seems */
|
||||
#if defined(UNIX)
|
||||
if (kill((pid_t)char_to_long(b0.b0_pid), 0) == 0) {
|
||||
MSG_PUTS(_(" (still running)"));
|
||||
process_still_running = TRUE;
|
||||
@ -1812,15 +1810,12 @@ static int recov_file_names(char_u **names, char_u *path, int prepend_dot)
|
||||
int num_names;
|
||||
|
||||
#ifdef SHORT_FNAME
|
||||
/*
|
||||
* (MS-DOS) always short names
|
||||
*/
|
||||
names[0] = modname(path, (char_u *)".sw?", FALSE);
|
||||
num_names = 1;
|
||||
#else /* !SHORT_FNAME */
|
||||
/*
|
||||
* (Win32 and Win64) never short names, but do prepend a dot.
|
||||
* (Not MS-DOS or Win32 or Win64) maybe short name, maybe not: Try both.
|
||||
* (Neither Win32 nor Win64) maybe short name, maybe not: Try both.
|
||||
* Only use the short name if it is different.
|
||||
*/
|
||||
char_u *p;
|
||||
@ -3598,8 +3593,7 @@ findswapname (
|
||||
#endif
|
||||
char_u *buf_fname = buf->b_fname;
|
||||
|
||||
#if !defined(SHORT_FNAME) \
|
||||
&& ((!defined(UNIX) && !defined(OS2)) || defined(ARCHIE))
|
||||
#if !defined(SHORT_FNAME) && !defined(UNIX)
|
||||
# define CREATE_DUMMY_FILE
|
||||
FILE *dummyfd = NULL;
|
||||
|
||||
@ -3639,7 +3633,7 @@ findswapname (
|
||||
fname = NULL;
|
||||
break;
|
||||
}
|
||||
#if (defined(UNIX) || defined(OS2)) && !defined(ARCHIE) && !defined(SHORT_FNAME)
|
||||
#if defined(UNIX) && !defined(SHORT_FNAME)
|
||||
/*
|
||||
* Some systems have a MS-DOS compatible filesystem that use 8.3 character
|
||||
* file names. If this is the first try and the swap file name does not fit in
|
||||
@ -3850,8 +3844,7 @@ findswapname (
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (defined(UNIX) || defined(__EMX__) || defined(VMS)) && \
|
||||
(defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG))
|
||||
#if defined(UNIX) && (defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG))
|
||||
process_still_running = FALSE;
|
||||
#endif
|
||||
/*
|
||||
@ -3887,7 +3880,7 @@ findswapname (
|
||||
name == NULL
|
||||
? (char_u *)_("Swap file already exists!")
|
||||
: name,
|
||||
# if defined(UNIX) || defined(__EMX__) || defined(VMS)
|
||||
# if defined(UNIX)
|
||||
process_still_running
|
||||
? (char_u *)_(
|
||||
"&Open Read-Only\n&Edit anyway\n&Recover\n&Quit\n&Abort") :
|
||||
@ -3896,7 +3889,7 @@ findswapname (
|
||||
"&Open Read-Only\n&Edit anyway\n&Recover\n&Delete it\n&Quit\n&Abort"),
|
||||
1, NULL, FALSE);
|
||||
|
||||
# if defined(UNIX) || defined(__EMX__) || defined(VMS)
|
||||
# if defined(UNIX)
|
||||
if (process_still_running && choice >= 4)
|
||||
choice++; /* Skip missing "Delete it" button */
|
||||
# endif
|
||||
|
@ -916,7 +916,7 @@ void wait_return(int redraw)
|
||||
setmouse();
|
||||
msg_check();
|
||||
|
||||
#if defined(UNIX) || defined(VMS)
|
||||
#if defined(UNIX)
|
||||
/*
|
||||
* When switching screens, we need to output an extra newline on exit.
|
||||
*/
|
||||
|
39
src/misc1.c
39
src/misc1.c
@ -2801,7 +2801,7 @@ expand_env_esc (
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(MSDOS) || defined(MSWIN) || defined(OS2) || defined(UNIX)
|
||||
#if defined(MSWIN) || defined(UNIX)
|
||||
# ifdef UNIX
|
||||
if (src[1] == '{' && *tail != '}')
|
||||
# else
|
||||
@ -2818,7 +2818,7 @@ expand_env_esc (
|
||||
#endif
|
||||
*var = NUL;
|
||||
var = vim_getenv(dst, &mustfree);
|
||||
#if defined(MSDOS) || defined(MSWIN) || defined(OS2) || defined(UNIX)
|
||||
#if defined(MSWIN) || defined(UNIX)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -2829,7 +2829,7 @@ expand_env_esc (
|
||||
var = homedir;
|
||||
tail = src + 1;
|
||||
} else { /* user directory */
|
||||
#if defined(UNIX) || (defined(VMS) && defined(USER_HOME))
|
||||
#if defined(UNIX)
|
||||
/*
|
||||
* Copy ~user to dst[], so we can put a NUL after it.
|
||||
*/
|
||||
@ -2842,7 +2842,6 @@ expand_env_esc (
|
||||
&& !vim_ispathsep(*tail))
|
||||
*var++ = *tail++;
|
||||
*var = NUL;
|
||||
# ifdef UNIX
|
||||
/*
|
||||
* Use os_get_user_directory() to get the user directory.
|
||||
* If this function fails, the shell is used to
|
||||
@ -2861,41 +2860,11 @@ expand_env_esc (
|
||||
WILD_ADD_SLASH|WILD_SILENT, WILD_EXPAND_FREE);
|
||||
mustfree = TRUE;
|
||||
}
|
||||
|
||||
# else /* !UNIX, thus VMS */
|
||||
/*
|
||||
* USER_HOME is a comma-separated list of
|
||||
* directories to search for the user account in.
|
||||
*/
|
||||
{
|
||||
char_u test[MAXPATHL], paths[MAXPATHL];
|
||||
char_u *path, *next_path, *ptr;
|
||||
struct stat st;
|
||||
|
||||
STRCPY(paths, USER_HOME);
|
||||
next_path = paths;
|
||||
while (*next_path) {
|
||||
for (path = next_path; *next_path && *next_path != ',';
|
||||
next_path++) ;
|
||||
if (*next_path)
|
||||
*next_path++ = NUL;
|
||||
STRCPY(test, path);
|
||||
STRCAT(test, "/");
|
||||
STRCAT(test, dst + 1);
|
||||
if (mch_stat(test, &st) == 0) {
|
||||
var = alloc(STRLEN(test) + 1);
|
||||
STRCPY(var, test);
|
||||
mustfree = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
# endif /* UNIX */
|
||||
#else
|
||||
/* cannot expand user's home directory, so don't try */
|
||||
var = NULL;
|
||||
tail = (char_u *)""; /* for gcc */
|
||||
#endif /* UNIX || VMS */
|
||||
#endif /* UNIX */
|
||||
}
|
||||
|
||||
#ifdef BACKSLASH_IN_FILENAME
|
||||
|
@ -688,7 +688,7 @@ int csh_like_shell(void)
|
||||
/*
|
||||
* Escape "string" for use as a shell argument with system().
|
||||
* This uses single quotes, except when we know we need to use double quotes
|
||||
* (MS-DOS and MS-Windows without 'shellslash' set).
|
||||
* (MS-Windows without 'shellslash' set).
|
||||
* Escape a newline, depending on the 'shell' option.
|
||||
* When "do_special" is true also replace "!", "%", "#" and things starting
|
||||
* with "<" like "<cfile>".
|
||||
|
33
src/option.c
33
src/option.c
@ -1003,9 +1003,7 @@ static struct vimoption
|
||||
{"isprint", "isp", P_STRING|P_VI_DEF|P_RALL|P_COMMA|P_NODUP,
|
||||
(char_u *)&p_isp, PV_NONE,
|
||||
{
|
||||
#if defined(MSDOS) || defined(MSWIN) || defined(OS2) \
|
||||
|| (defined(MACOS) && !defined(MACOS_X)) \
|
||||
|| defined(VMS)
|
||||
#if defined(MSWIN)
|
||||
(char_u *)"@,~-255",
|
||||
#else
|
||||
ISP_LATIN1,
|
||||
@ -1359,11 +1357,7 @@ static struct vimoption
|
||||
{"shell", "sh", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
|
||||
(char_u *)&p_sh, PV_NONE,
|
||||
{
|
||||
# if defined(ARCHIE)
|
||||
(char_u *)"gos",
|
||||
# else
|
||||
(char_u *)"sh",
|
||||
# endif
|
||||
(char_u *)0L
|
||||
} SCRIPTID_INIT},
|
||||
{"shellcmdflag","shcf", P_STRING|P_VI_DEF|P_SECURE,
|
||||
@ -1375,12 +1369,8 @@ static struct vimoption
|
||||
{"shellpipe", "sp", P_STRING|P_VI_DEF|P_SECURE,
|
||||
(char_u *)&p_sp, PV_NONE,
|
||||
{
|
||||
#if defined(UNIX) || defined(OS2)
|
||||
# ifdef ARCHIE
|
||||
(char_u *)"2>",
|
||||
# else
|
||||
#if defined(UNIX)
|
||||
(char_u *)"| tee",
|
||||
# endif
|
||||
#else
|
||||
(char_u *)">",
|
||||
#endif
|
||||
@ -1623,7 +1613,7 @@ static struct vimoption
|
||||
(char_u *)&p_tf, PV_NONE,
|
||||
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"ttymouse", "ttym", P_STRING|P_NODEFAULT|P_NO_MKRC|P_VI_DEF,
|
||||
#if defined(FEAT_MOUSE) && (defined(UNIX) || defined(VMS))
|
||||
#if defined(FEAT_MOUSE) && defined(UNIX)
|
||||
(char_u *)&p_ttym, PV_NONE,
|
||||
#else
|
||||
(char_u *)NULL, PV_NONE,
|
||||
@ -1646,7 +1636,7 @@ static struct vimoption
|
||||
{"undolevels", "ul", P_NUM|P_VI_DEF,
|
||||
(char_u *)&p_ul, PV_UL,
|
||||
{
|
||||
#if defined(UNIX) || defined(WIN3264) || defined(OS2) || defined(VMS)
|
||||
#if defined(UNIX) || defined(WIN3264)
|
||||
(char_u *)1000L,
|
||||
#else
|
||||
(char_u *)100L,
|
||||
@ -2068,8 +2058,8 @@ void set_init_1(void)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(FEAT_POSTSCRIPT) && (defined(MSWIN) || defined(OS2) || \
|
||||
defined(VMS) || defined(EBCDIC) || defined(MAC) || defined(hpux))
|
||||
#if defined(FEAT_POSTSCRIPT) && (defined(MSWIN) || \
|
||||
defined(EBCDIC) || defined(MAC))
|
||||
/* Set print encoding on platforms that don't default to latin1 */
|
||||
set_string_default("penc",
|
||||
(char_u *)"hp-roman8"
|
||||
@ -2186,8 +2176,7 @@ void set_init_1(void)
|
||||
options[opt_idx].flags |= P_DEF_ALLOCED;
|
||||
}
|
||||
|
||||
#if defined(MSDOS) || defined(MSWIN) || defined(OS2) || defined(MACOS) \
|
||||
|| defined(VMS)
|
||||
#if defined(MSWIN) || defined(MACOS)
|
||||
if (STRCMP(p_enc, "latin1") == 0
|
||||
|| enc_utf8
|
||||
) {
|
||||
@ -2442,7 +2431,7 @@ static char_u *term_bg_default(void)
|
||||
*/
|
||||
void set_init_3(void)
|
||||
{
|
||||
#if defined(UNIX) || defined(OS2) || defined(WIN3264)
|
||||
#if defined(UNIX) || defined(WIN3264)
|
||||
/*
|
||||
* Set 'shellpipe' and 'shellredir', depending on the 'shell' option.
|
||||
* This is done after other initializations, where 'shell' might have been
|
||||
@ -3117,7 +3106,7 @@ do_set (
|
||||
|
||||
/*
|
||||
* Copy the string, skip over escaped chars.
|
||||
* For MS-DOS and WIN32 backslashes before normal
|
||||
* For WIN32 backslashes before normal
|
||||
* file name characters are not removed, and keep
|
||||
* backslash at start, for "\\machine\path", but
|
||||
* do remove it for "\\\\machine\\path".
|
||||
@ -3584,7 +3573,7 @@ static void didset_options(void)
|
||||
(void)opt_strings_flags(p_fdo, p_fdo_values, &fdo_flags, TRUE);
|
||||
(void)opt_strings_flags(p_dy, p_dy_values, &dy_flags, TRUE);
|
||||
(void)opt_strings_flags(p_ve, p_ve_values, &ve_flags, TRUE);
|
||||
#if defined(FEAT_MOUSE) && (defined(UNIX) || defined(VMS))
|
||||
#if defined(FEAT_MOUSE) && defined(UNIX)
|
||||
(void)opt_strings_flags(p_ttym, p_ttym_values, &ttym_flags, FALSE);
|
||||
#endif
|
||||
(void)spell_check_msm();
|
||||
@ -4403,7 +4392,7 @@ did_set_string_option (
|
||||
|
||||
|
||||
|
||||
#if defined(FEAT_MOUSE_TTY) && (defined(UNIX) || defined(VMS))
|
||||
#if defined(FEAT_MOUSE_TTY) && defined(UNIX)
|
||||
/* 'ttymouse' */
|
||||
else if (varp == &p_ttym) {
|
||||
/* Switch the mouse off before changing the escape sequences used for
|
||||
|
@ -560,7 +560,7 @@ EXTERN long p_ttm; /* 'ttimeoutlen' */
|
||||
EXTERN int p_tbi; /* 'ttybuiltin' */
|
||||
EXTERN int p_tf; /* 'ttyfast' */
|
||||
EXTERN long p_ttyscroll; /* 'ttyscroll' */
|
||||
#if defined(FEAT_MOUSE) && (defined(UNIX) || defined(VMS))
|
||||
#if defined(FEAT_MOUSE) && defined(UNIX)
|
||||
EXTERN char_u *p_ttym; /* 'ttymouse' */
|
||||
EXTERN unsigned ttym_flags;
|
||||
# ifdef IN_OPTION_C
|
||||
|
@ -25,10 +25,6 @@ int os_setenv(const char *name, const char *value, int overwrite)
|
||||
|
||||
char *os_getenvname_at_index(size_t index)
|
||||
{
|
||||
# if defined(AMIGA) || defined(__MRC__) || defined(__SC__)
|
||||
// No environ[] on the Amiga and on the Mac (using MPW).
|
||||
return NULL;
|
||||
# else
|
||||
# if defined(HAVE__NSGETENVIRON)
|
||||
char **environ = *_NSGetEnviron();
|
||||
# elif !defined(__WIN32__)
|
||||
@ -51,7 +47,6 @@ char *os_getenvname_at_index(size_t index)
|
||||
}
|
||||
char *name = (char *)vim_strnsave((char_u *)str, namesize);
|
||||
return name;
|
||||
# endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -10,7 +10,6 @@
|
||||
|
||||
/*
|
||||
* os_unix.c -- code for all flavors of Unix (BSD, SYSV, SVR4, POSIX, ...)
|
||||
* Also for OS/2, using the excellent EMX package!!!
|
||||
* Also for BeOS and Atari MiNT.
|
||||
*
|
||||
* A lot of this file was originally written by Juergen Weigert and later
|
||||
@ -903,10 +902,6 @@ int mch_get_shellsize()
|
||||
long columns = 0;
|
||||
char_u *p;
|
||||
|
||||
/*
|
||||
* For OS/2 use _scrsize().
|
||||
*/
|
||||
|
||||
/*
|
||||
* 1. try using an ioctl. It is the most accurate method.
|
||||
*
|
||||
@ -1027,9 +1022,6 @@ int flags; /* EW_* flags */
|
||||
bool dir;
|
||||
char_u *extra_shell_arg = NULL;
|
||||
ShellOpts shellopts = kShellOptExpand | kShellOptSilent;
|
||||
/*
|
||||
* This is the non-OS/2 implementation (really Unix).
|
||||
*/
|
||||
int j;
|
||||
char_u *tempname;
|
||||
char_u *command;
|
||||
|
@ -339,8 +339,7 @@ static int vim_backtick(char_u *p);
|
||||
static int expand_backtick(garray_T *gap, char_u *pat, int flags);
|
||||
|
||||
|
||||
#if (defined(UNIX) && !defined(VMS)) || defined(USE_UNIXFILENAME) \
|
||||
|| defined(PROTO)
|
||||
#if defined(UNIX) || defined(USE_UNIXFILENAME) || defined(PROTO)
|
||||
/*
|
||||
* Unix style wildcard expansion code.
|
||||
* It's here because it's used both for Unix and Mac.
|
||||
|
@ -2568,7 +2568,7 @@ spell_load_file (
|
||||
if (lp->sl_fname == NULL)
|
||||
goto endFAIL;
|
||||
|
||||
/* Check for .add.spl (_add.spl for VMS). */
|
||||
/* Check for .add.spl. */
|
||||
lp->sl_add = strstr((char *)path_tail(fname), SPL_FNAME_ADD) != NULL;
|
||||
} else
|
||||
lp = old_lp;
|
||||
|
59
src/term.c
59
src/term.c
@ -9,7 +9,7 @@
|
||||
*
|
||||
* term.c: functions for controlling the terminal
|
||||
*
|
||||
* primitive termcap support for Amiga, MSDOS, and Win32 included
|
||||
* primitive termcap support for Win32 included
|
||||
*
|
||||
* NOTE: padding and variable substitution is not performed,
|
||||
* when compiling without HAVE_TGETENT, we use tputs() and tgoto() dummies.
|
||||
@ -165,7 +165,7 @@ static struct builtin_term builtin_termcaps[] =
|
||||
|
||||
#ifndef NO_BUILTIN_TCAPS
|
||||
|
||||
# if defined(AMIGA) || defined(ALL_BUILTIN_TCAPS)
|
||||
# if defined(ALL_BUILTIN_TCAPS)
|
||||
/*
|
||||
* Amiga console window, default for Amiga
|
||||
*/
|
||||
@ -196,17 +196,6 @@ static struct builtin_term builtin_termcaps[] =
|
||||
{(int)KS_UE, "\033[0m"},
|
||||
{(int)KS_CZH, "\033[3m"},
|
||||
{(int)KS_CZR, "\033[0m"},
|
||||
#if defined(__MORPHOS__) || defined(__AROS__)
|
||||
{(int)KS_CCO, "8"}, /* allow 8 colors */
|
||||
# ifdef TERMINFO
|
||||
{(int)KS_CAB, "\033[4%p1%dm"}, /* set background color */
|
||||
{(int)KS_CAF, "\033[3%p1%dm"}, /* set foreground color */
|
||||
# else
|
||||
{(int)KS_CAB, "\033[4%dm"}, /* set background color */
|
||||
{(int)KS_CAF, "\033[3%dm"}, /* set foreground color */
|
||||
# endif
|
||||
{(int)KS_OP, "\033[m"}, /* reset colors */
|
||||
#endif
|
||||
{(int)KS_MS, "y"},
|
||||
{(int)KS_UT, "y"}, /* guessed */
|
||||
{(int)KS_LE, "\b"},
|
||||
@ -215,9 +204,6 @@ static struct builtin_term builtin_termcaps[] =
|
||||
# else
|
||||
{(int)KS_CM, "\033[%i%d;%dH"},
|
||||
# endif
|
||||
#if defined(__MORPHOS__)
|
||||
{(int)KS_SR, "\033M"},
|
||||
#endif
|
||||
# ifdef TERMINFO
|
||||
{(int)KS_CRI, "\033[%p1%dC"},
|
||||
# else
|
||||
@ -338,8 +324,7 @@ static struct builtin_term builtin_termcaps[] =
|
||||
{K_RIGHT, "\033[C"},
|
||||
# endif
|
||||
|
||||
# if defined(UNIX) || defined(ALL_BUILTIN_TCAPS) || \
|
||||
defined(SOME_BUILTIN_TCAPS) || defined(__EMX__)
|
||||
# if defined(UNIX) || defined(ALL_BUILTIN_TCAPS) || defined(SOME_BUILTIN_TCAPS)
|
||||
/*
|
||||
* standard ANSI terminal, default for unix
|
||||
*/
|
||||
@ -375,7 +360,7 @@ static struct builtin_term builtin_termcaps[] =
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if defined(MSDOS) || defined(ALL_BUILTIN_TCAPS) || defined(__EMX__)
|
||||
# if defined(ALL_BUILTIN_TCAPS)
|
||||
/*
|
||||
* These codes are valid when nansi.sys or equivalent has been installed.
|
||||
* Function keys on a PC are preceded with a NUL. These are converted into
|
||||
@ -457,7 +442,7 @@ static struct builtin_term builtin_termcaps[] =
|
||||
# endif
|
||||
|
||||
|
||||
# if defined(WIN3264) || defined(ALL_BUILTIN_TCAPS) || defined(__EMX__)
|
||||
# if defined(WIN3264) || defined(ALL_BUILTIN_TCAPS)
|
||||
/*
|
||||
* These codes are valid for the Win32 Console . The entries that start with
|
||||
* ESC | are translated into console calls in os_win32.c. The function keys
|
||||
@ -577,7 +562,7 @@ static struct builtin_term builtin_termcaps[] =
|
||||
{K_K9, "\316\376"},
|
||||
# endif
|
||||
|
||||
# if defined(VMS) || defined(ALL_BUILTIN_TCAPS)
|
||||
# if defined(ALL_BUILTIN_TCAPS)
|
||||
/*
|
||||
* VT320 is working as an ANSI terminal compatible DEC terminal.
|
||||
* (it covers VT1x0, VT2x0 and VT3x0 up to VT320 on VMS as well)
|
||||
@ -683,8 +668,7 @@ static struct builtin_term builtin_termcaps[] =
|
||||
{(int)KS_MS, "y"},
|
||||
# endif
|
||||
|
||||
# if defined(UNIX) || defined(ALL_BUILTIN_TCAPS) || \
|
||||
defined(SOME_BUILTIN_TCAPS) || defined(__EMX__)
|
||||
# if defined(UNIX) || defined(ALL_BUILTIN_TCAPS) || defined(SOME_BUILTIN_TCAPS)
|
||||
{(int)KS_NAME, "xterm"},
|
||||
{(int)KS_CE, IF_EB("\033[K", ESC_STR "[K")},
|
||||
{(int)KS_AL, IF_EB("\033[L", ESC_STR "[L")},
|
||||
@ -1258,9 +1242,6 @@ static char *(key_names[]) =
|
||||
/* Do this one first, it may cause a screen redraw. */
|
||||
"Co",
|
||||
"ku", "kd", "kr", "kl",
|
||||
# ifdef ARCHIE
|
||||
"su", "sd", /* Termcap code made up! */
|
||||
# endif
|
||||
"#2", "#4", "%i", "*7",
|
||||
"k1", "k2", "k3", "k4", "k5", "k6",
|
||||
"k7", "k8", "k9", "k;", "F1", "F2",
|
||||
@ -1413,13 +1394,11 @@ int set_termname(char_u *term)
|
||||
|| term_str(KS_CCO) == empty_option)
|
||||
set_color_count(tgetnum("Co"));
|
||||
|
||||
# ifndef hpux
|
||||
BC = (char *)TGETSTR("bc", &tp);
|
||||
UP = (char *)TGETSTR("up", &tp);
|
||||
p = TGETSTR("pc", &tp);
|
||||
if (p)
|
||||
PC = *p;
|
||||
# endif /* hpux */
|
||||
}
|
||||
} else /* try == 0 || try == 2 */
|
||||
#endif /* HAVE_TGETENT */
|
||||
@ -1548,11 +1527,11 @@ int set_termname(char_u *term)
|
||||
add_termcode((char_u *)"kD", (char_u *)DEL_STR, FALSE);
|
||||
}
|
||||
|
||||
#if defined(UNIX) || defined(VMS)
|
||||
#if defined(UNIX)
|
||||
term_is_xterm = vim_is_xterm(term);
|
||||
#endif
|
||||
|
||||
# if defined(UNIX) || defined(VMS)
|
||||
# if defined(UNIX)
|
||||
/*
|
||||
* For Unix, set the 'ttymouse' option to the type of mouse to be used.
|
||||
* The termcode for the mouse is added as a side effect in option.c.
|
||||
@ -1591,7 +1570,7 @@ int set_termname(char_u *term)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(UNIX) || defined(VMS)
|
||||
#if defined(UNIX)
|
||||
/*
|
||||
* 'ttyfast' is default on for xterm, iris-ansi and a few others.
|
||||
*/
|
||||
@ -1699,8 +1678,7 @@ set_mouse_termcode (
|
||||
has_mouse_termcode |= HMT_NORMAL;
|
||||
}
|
||||
|
||||
# if ((defined(UNIX) || defined(VMS) || defined(OS2)) \
|
||||
&& defined(FEAT_MOUSE_TTY)) || defined(PROTO)
|
||||
# if (defined(UNIX) && defined(FEAT_MOUSE_TTY)) || defined(PROTO)
|
||||
void
|
||||
del_mouse_termcode (
|
||||
int n /* KS_MOUSE, KS_NETTERM_MOUSE or KS_DEC_MOUSE */
|
||||
@ -1778,8 +1756,7 @@ static char_u *vim_tgetstr(char *s, char_u **pp)
|
||||
}
|
||||
#endif /* HAVE_TGETENT */
|
||||
|
||||
#if defined(HAVE_TGETENT) && (defined(UNIX) || defined(__EMX__) || \
|
||||
defined(VMS) || defined(MACOS_X))
|
||||
#if defined(HAVE_TGETENT) && (defined(UNIX) || defined(MACOS_X))
|
||||
/*
|
||||
* Get Columns and Rows from the termcap. Used after a window signal if the
|
||||
* ioctl() fails. It doesn't make sense to call tgetent each time if the "co"
|
||||
@ -1939,7 +1916,7 @@ static int term_7to8bit(char_u *p)
|
||||
}
|
||||
|
||||
|
||||
#if !defined(HAVE_TGETENT) || defined(AMIGA) || defined(PROTO)
|
||||
#if !defined(HAVE_TGETENT) || defined(PROTO)
|
||||
|
||||
char_u *tltoa(unsigned long i)
|
||||
{
|
||||
@ -2076,7 +2053,7 @@ void out_flush_check(void)
|
||||
*/
|
||||
void out_char(unsigned c)
|
||||
{
|
||||
#if defined(UNIX) || defined(VMS) || defined(AMIGA) || defined(MACOS_X_UNIX)
|
||||
#if defined(UNIX) || defined(MACOS_X_UNIX)
|
||||
if (c == '\n') /* turn LF into CR-LF (CRMOD doesn't seem to do this) */
|
||||
out_char('\r');
|
||||
#endif
|
||||
@ -2095,7 +2072,7 @@ static void out_char_nf(unsigned);
|
||||
*/
|
||||
static void out_char_nf(unsigned c)
|
||||
{
|
||||
#if defined(UNIX) || defined(VMS) || defined(AMIGA) || defined(MACOS_X_UNIX)
|
||||
#if defined(UNIX) || defined(MACOS_X_UNIX)
|
||||
if (c == '\n') /* turn LF into CR-LF (CRMOD doesn't seem to do this) */
|
||||
out_char_nf('\r');
|
||||
#endif
|
||||
@ -2243,7 +2220,7 @@ static void term_color(char_u *s, int n)
|
||||
OUT_STR(tgoto((char *)s, 0, n));
|
||||
}
|
||||
|
||||
#if (defined(FEAT_TITLE) && (defined(UNIX) || defined(OS2) || defined(VMS) || \
|
||||
#if (defined(FEAT_TITLE) && (defined(UNIX) || \
|
||||
defined(MACOS_X))) || defined(PROTO)
|
||||
/*
|
||||
* Generic function to set window title, using t_ts and t_fs.
|
||||
@ -3579,7 +3556,7 @@ int check_termcode(int max_offset, char_u *buf, int bufsize, int *buflen)
|
||||
|| defined(FEAT_MOUSE_GPM) || defined(FEAT_SYSMOUSE)
|
||||
if (key_name[0] == (int)KS_MOUSE) {
|
||||
/*
|
||||
* For xterm and MSDOS we get "<t_mouse>scr", where
|
||||
* For xterm we get "<t_mouse>scr", where
|
||||
* s == encoded button state:
|
||||
* 0x20 = left button down
|
||||
* 0x21 = middle button down
|
||||
@ -3707,7 +3684,7 @@ int check_termcode(int max_offset, char_u *buf, int bufsize, int *buflen)
|
||||
/*
|
||||
* Handle mouse events.
|
||||
* Recognize the xterm mouse wheel, but not in the GUI, the
|
||||
* Linux console with GPM and the MS-DOS or Win32 console
|
||||
* Linux console with GPM and the Win32 console
|
||||
* (multi-clicks use >= 0x60).
|
||||
*/
|
||||
if (mouse_code >= MOUSEWHEEL_LOW
|
||||
|
18
src/ui.c
18
src/ui.c
@ -61,7 +61,7 @@ void ui_write(char_u *s, int len)
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(UNIX) || defined(VMS) || defined(PROTO) || defined(WIN3264)
|
||||
#if defined(UNIX) || defined(PROTO) || defined(WIN3264)
|
||||
/*
|
||||
* When executing an external program, there may be some typed characters that
|
||||
* are not consumed by it. Give them back to ui_inchar() and they are stored
|
||||
@ -344,8 +344,7 @@ void set_input_buf(char_u *p)
|
||||
|
||||
#if defined(FEAT_GUI) \
|
||||
|| defined(FEAT_MOUSE_GPM) || defined(FEAT_SYSMOUSE) \
|
||||
|| defined(FEAT_XCLIPBOARD) || defined(VMS) \
|
||||
|| defined(PROTO)
|
||||
|| defined(FEAT_XCLIPBOARD) || defined(PROTO)
|
||||
/*
|
||||
* Add the given bytes to the input buffer
|
||||
* Special keys start with CSI. A real CSI must have been translated to
|
||||
@ -428,7 +427,7 @@ int read_from_input_buf(char_u *buf, long maxlen)
|
||||
|
||||
void fill_input_buf(int exit_on_error)
|
||||
{
|
||||
#if defined(UNIX) || defined(OS2) || defined(VMS) || defined(MACOS_X_UNIX)
|
||||
#if defined(UNIX) || defined(MACOS_X_UNIX)
|
||||
int len;
|
||||
int try;
|
||||
static char_u *rest = NULL; /* unconverted rest of previous read */
|
||||
@ -436,7 +435,7 @@ void fill_input_buf(int exit_on_error)
|
||||
int unconverted;
|
||||
#endif
|
||||
|
||||
#if defined(UNIX) || defined(OS2) || defined(VMS) || defined(MACOS_X_UNIX)
|
||||
#if defined(UNIX) || defined(MACOS_X_UNIX)
|
||||
if (vim_is_input_buf_full())
|
||||
return;
|
||||
/*
|
||||
@ -514,9 +513,9 @@ void fill_input_buf(int exit_on_error)
|
||||
++inbufcount;
|
||||
}
|
||||
}
|
||||
#endif /* UNIX or OS2 or VMS*/
|
||||
#endif /* UNIX */
|
||||
}
|
||||
#endif /* defined(UNIX) || defined(FEAT_GUI) || defined(OS2) || defined(VMS) */
|
||||
#endif /* defined(UNIX) || defined(FEAT_GUI) */
|
||||
|
||||
/*
|
||||
* Exit because of an input read error.
|
||||
@ -567,11 +566,6 @@ int check_row(int row)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Stuff for the X clipboard. Shared between VMS and Unix.
|
||||
*/
|
||||
|
||||
|
||||
#if defined(FEAT_XCLIPBOARD) || defined(FEAT_GUI_X11) \
|
||||
|| defined(FEAT_GUI_GTK) || defined(PROTO)
|
||||
/*
|
||||
|
@ -113,7 +113,7 @@ static char *(features[]) = {
|
||||
"+mouse",
|
||||
"-mouseshape",
|
||||
|
||||
#if defined(UNIX) || defined(VMS)
|
||||
#if defined(UNIX)
|
||||
"+mouse_dec",
|
||||
"-mouse_gpm",
|
||||
# ifdef FEAT_MOUSE_JSB
|
||||
@ -122,15 +122,15 @@ static char *(features[]) = {
|
||||
"-mouse_jsbterm",
|
||||
# endif // ifdef FEAT_MOUSE_JSB
|
||||
"+mouse_netterm",
|
||||
#endif // if defined(UNIX) || defined(VMS)
|
||||
#endif // if defined(UNIX)
|
||||
|
||||
|
||||
#if defined(UNIX) || defined(VMS)
|
||||
#if defined(UNIX)
|
||||
"+mouse_sgr",
|
||||
"-mouse_sysmouse",
|
||||
"+mouse_urxvt",
|
||||
"+mouse_xterm",
|
||||
#endif // if defined(UNIX) || defined(VMS)
|
||||
#endif // if defined(UNIX)
|
||||
|
||||
"+multi_byte",
|
||||
"+multi_lang",
|
||||
@ -159,9 +159,9 @@ static char *(features[]) = {
|
||||
#else // ifdef FEAT_TAG_ANYWHITE
|
||||
"-tag_any_white",
|
||||
#endif // ifdef FEAT_TAG_ANYWHITE
|
||||
#if defined(UNIX) || defined(__EMX__)
|
||||
#if defined(UNIX)
|
||||
|
||||
// only Unix (or OS/2 with EMX!) can have terminfo instead of termcap
|
||||
// only Unix can have terminfo instead of termcap
|
||||
# ifdef TERMINFO
|
||||
"+terminfo",
|
||||
# else // ifdef TERMINFO
|
||||
@ -173,7 +173,7 @@ static char *(features[]) = {
|
||||
# else // ifdef HAVE_TGETENT
|
||||
"-tgetent",
|
||||
# endif // ifdef HAVE_TGETENT
|
||||
#endif // if defined(UNIX) || defined(__EMX__)
|
||||
#endif // if defined(UNIX)
|
||||
"+termresponse",
|
||||
"+textobjects",
|
||||
"+title",
|
||||
@ -189,14 +189,14 @@ static char *(features[]) = {
|
||||
"+wildmenu",
|
||||
"+windows",
|
||||
"+writebackup",
|
||||
#if defined(UNIX) || defined(VMS)
|
||||
#if defined(UNIX)
|
||||
"-X11",
|
||||
#endif // if defined(UNIX) || defined(VMS)
|
||||
#endif // if defined(UNIX)
|
||||
"-xfontset",
|
||||
#if defined(UNIX) || defined(VMS)
|
||||
#if defined(UNIX)
|
||||
"-xsmp",
|
||||
"-xterm_clipboard",
|
||||
#endif // if defined(UNIX) || defined(VMS)
|
||||
#endif // if defined(UNIX)
|
||||
NULL
|
||||
};
|
||||
|
||||
|
23
src/vim.h
23
src/vim.h
@ -1067,7 +1067,7 @@ typedef void *vim_acl_T; /* dummy to pass an ACL to a function */
|
||||
#define fnamencmp(x, y, n) vim_fnamencmp((char_u *)(x), (char_u *)(y), \
|
||||
(size_t)(n))
|
||||
|
||||
#if defined(UNIX) || defined(FEAT_GUI) || defined(OS2) || defined(VMS)
|
||||
#if defined(UNIX) || defined(FEAT_GUI)
|
||||
# define USE_INPUT_BUF
|
||||
#endif
|
||||
|
||||
@ -1284,27 +1284,6 @@ typedef int VimClipboard; /* This is required for the prototypes. */
|
||||
|
||||
#include "globals.h" /* global variables and messages */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* If console dialog not supported, but GUI dialog is, use the GUI one.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Default filters for gui_mch_browse().
|
||||
* The filters are almost system independent. Except for the difference
|
||||
* between "*" and "*.*" for MSDOS-like systems.
|
||||
* NOTE: Motif only uses the very first pattern. Therefore
|
||||
* BROWSE_FILTER_DEFAULT should start with a "*" pattern.
|
||||
*/
|
||||
|
||||
/* stop using fastcall for Borland */
|
||||
|
||||
|
||||
/*
|
||||
* The following macros stop display/event loop nesting at the wrong time.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Return byte length of character that starts with byte "b".
|
||||
* Returns 1 for a single-byte character.
|
||||
|
Loading…
Reference in New Issue
Block a user