Merge remote-tracking branch 'vim/master'

This commit is contained in:
Kazuki Sakamoto
2016-02-23 07:07:58 -08:00
50 changed files with 284 additions and 4341 deletions
-7
View File
@@ -291,11 +291,9 @@ SRC_DOS = \
src/GvimExt/uninst.bat \
README_srcdos.txt \
src/INSTALLpc.txt \
src/Make_bc3.mak \
src/Make_bc5.mak \
src/Make_cyg.mak \
src/Make_cyg_ming.mak \
src/Make_djg.mak \
src/Make_ivc.mak \
src/Make_dvc.mak \
src/Make_ming.mak \
@@ -321,8 +319,6 @@ SRC_DOS = \
src/if_perl_msvc/stdbool.h \
src/iid_ole.c \
src/os_dos.h \
src/os_msdos.c \
src/os_msdos.h \
src/os_w32dll.c \
src/os_w32exe.c \
src/os_win32.c \
@@ -330,7 +326,6 @@ SRC_DOS = \
src/os_win32.h \
src/proto/gui_w32.pro \
src/proto/if_ole.pro \
src/proto/os_msdos.pro \
src/proto/os_win32.pro \
src/proto/os_mswin.pro \
src/testdir/Make_dos.mak \
@@ -345,9 +340,7 @@ SRC_DOS = \
src/vimtbar.h \
src/xpm_w32.c \
src/xpm_w32.h \
src/xxd/Make_bc3.mak \
src/xxd/Make_bc5.mak \
src/xxd/Make_djg.mak \
src/xxd/Make_ming.mak \
src/xxd/Make_mvc.mak \
nsis/gvim.nsi \
-184
View File
@@ -1,184 +0,0 @@
# Makefile for Borland C++ 3.1 or 4.0 to compile a 16 bit version of Vim.
#
# NOTE: THIS IS OLD AND PROBABLY NO LONGER WORKS.
#
# There are compilation options at the end of this file.
#
# Command line variables:
# BOR path to root of Borland C (E:\BORLANDC)
# DEBUG set to "yes" for debugging (no)
# SPAWNO path to the spawno library directory, empty if you do not have
# it; use 8.3 filenames! (C:\CC\SPAWN)
.AUTODEPEND
!ifndef BOR
BOR = E:\BORLANDC
!endif
!if ("$(DEBUG)" == "yes")
DEBUG_FLAG = -v
!else
DEBUG_FLAG =
!endif
CC = $(BOR)\bin\bcc.exe +VIM.CFG
TLINK = $(BOR)\bin\tlink.exe
!ifndef SPAWNO
SPAWNO = C:\CC\SPAWN
!endif
!if ("$(SPAWNO)" == "")
LIBPATH = $(BOR)\LIB
INCLUDEPATH = $(BOR)\INCLUDE
SPAWND =
SPAWNL =
!else
LIBPATH = $(BOR)\LIB;$(SPAWNO)
INCLUDEPATH = $(BOR)\INCLUDE;$(SPAWNO)
SPAWND = ;SPAWNO
SPAWNL = spawnl.lib
!endif
# *Implicit Rules*
#
# use -v for debugging
#
.c.obj:
$(CC) -c $(DEBUG_FLAG) {$< }
# *List Macros*
EXE_dependencies = \
blowfish.obj \
buffer.obj \
charset.obj \
crypt.obj \
crypt_zip.obj \
diff.obj \
digraph.obj \
edit.obj \
eval.obj \
ex_cmds.obj \
ex_cmds2.obj \
ex_docmd.obj \
ex_eval.obj \
ex_getln.obj \
fileio.obj \
fold.obj \
getchar.obj \
hardcopy.obj \
hashtab.obj \
json.obj \
main.obj \
mark.obj \
memfile.obj \
memline.obj \
menu.obj \
message.obj \
misc1.obj \
misc2.obj \
move.obj \
os_msdos.obj \
normal.obj \
ops.obj \
option.obj \
popupmnu.obj \
quickfix.obj \
regexp.obj \
screen.obj \
search.obj \
sha256.obj \
spell.obj \
syntax.obj \
tag.obj \
term.obj \
ui.obj \
undo.obj \
window.obj
all: vim.exe install.exe uninstal.exe xxd/xxd.exe
# *Explicit Rules*
vim.exe: vim.cfg $(EXE_dependencies) version.c
$(CC) $(DEBUG_FLAG) -c version.c
$(TLINK) /x/c/L$(LIBPATH) $(DEBUG_FLAG) @&&|
c0l.obj $(EXE_dependencies) version.obj
vim
# no map file
$(SPAWNL) cl.lib
|
install.exe: dosinst.c
$(CC) -einstall $(DEBUG_FLAG) dosinst.c
uninstal.exe: uninstal.c
$(CC) $(DEBUG_FLAG) uninstal.c
# This may fail for older make versions, building xxd will fail anyway then.
xxd/xxd.exe: xxd/xxd.c
cd xxd
$(MAKE) -f Make_bc3.mak BOR=$(BOR) DEBUG=$(DEBUG)
cd ..
# cleaning up: Delete all generated files
clean:
-del *.obj
-del vim.exe
-del vim.sym
-del install.exe
-del uninstal.exe
-del xxd\*.obj
-del xxd\xxd.exe
-del vim.cfg
-del testdir\*.out
# Individual File Dependencies (incomplete)
ex_docmd.obj: ex_docmd.c ex_cmds.h
ex_eval.obj: ex_eval.c ex_cmds.h
main.obj: main.c globals.h option.h
term.obj: term.c term.h
version.obj: version.c version.h
# Compiler Configuration File
#
# The following compile options can be changed for better machines.
# replace -1- with -2 to produce code for a 80286 or higher
# replace -1- with -3 to produce code for a 80386 or higher
# add -v for source debugging
vim.cfg: Make_bc3.mak
copy &&|
-ml
-1-
-f-
-C
-N
-O
-Z
-k-
-d
-h
-vi-
-H=VIM.SYM
-w-par
-weas
-wpre
-Iproto
-I$(INCLUDEPATH)
-L$(LIBPATH)
-DMSDOS;FEAT_TINY$(SPAWND)
| vim.cfg
test:
cd testdir
$(MAKE) -f Make_dos.mak small
cd ..
+8 -97
View File
@@ -7,6 +7,7 @@
#
# Contributed by Ben Singer.
# Updated 4/1997 by Ron Aaron
# 2016: removed support for 16 bit DOS
# 6/1997 - added support for 16 bit DOS
# Note: this has been tested, and works, for BC5. Your mileage may vary.
# Has been reported NOT to work with BC 4.52. Maybe it can be fixed?
@@ -34,8 +35,7 @@
# name value (default)
#
# BOR path to root of Borland C install (c:\bc5)
# LINK name of the linker ($(BOR)\bin\ilink if OSTYPE is DOS16,
# $(BOR)\bin\ilink32 otherwise)
# LINK name of the linker ($(BOR)\bin\ilink32)
# GUI no or yes: set to yes if you want the GUI version (yes)
# LUA define to path to Lua dir to get Lua support (not defined)
# LUA_VER define to version of Lua being used (51)
@@ -70,7 +70,6 @@
# GETTEXT no or yes: set to yes for multi-language support (yes)
# ICONV no or yes: set to yes for dynamic iconv support (yes)
# OLE no or yes: set to yes to make OLE gvim (no)
# OSTYPE DOS16 or WIN32 (WIN32)
# DEBUG no or yes: set to yes if you wish a DEBUGging build (no)
# CODEGUARD no or yes: set to yes if you want to use CODEGUARD (no)
# CPUNR 1 through 6: select -CPU argument to compile with (3)
@@ -78,12 +77,11 @@
# USEDLL no or yes: set to yes to use the Runtime library DLL (no)
# For USEDLL=yes the cc3250.dll is required to run Vim.
# VIMDLL no or yes: create vim32.dll, and stub (g)vim.exe (no)
# ALIGN 1, 2 or 4: Alignment to use (4 for Win32, 2 for DOS16)
# ALIGN 1, 2 or 4: Alignment to use (4 for Win32)
# FASTCALL no or yes: set to yes to use register-based function protocol (yes)
# OPTIMIZE SPACE, SPEED, or MAXSPEED: type of optimization (MAXSPEED)
# POSTSCRIPT no or yes: set to yes for PostScript printing
# FEATURES TINY, SMALL, NORMAL, BIG or HUGE
# (BIG for WIN32, SMALL for DOS16)
# FEATURES TINY, SMALL, NORMAL, BIG or HUGE (BIG for WIN32)
# WINVER 0x0400 or 0x0500: minimum Win32 version to support (0x0400)
# CSCOPE no or yes: include support for Cscope interface (yes)
# NETBEANS no or yes: include support for Netbeans interface; also
@@ -99,8 +97,7 @@
BOR = c:\bc5
!endif
### LINK: Name of the linker: tlink or ilink32 (this is below, depends on
# $(OSTYPE)
### LINK: Name of the linker: ilink32 (this is below)
### GUI: yes for GUI version, no for console version
!if ("$(GUI)"=="")
@@ -166,12 +163,6 @@ CHANNEL = yes
### OLE: no for normal gvim, yes for OLE-capable gvim (only works with GUI)
#OLE = yes
### OSTYPE: DOS16 for Windows 3.1 version, WIN32 for Windows 95/98/NT/2000
# version
!if ("$(OSTYPE)"=="")
OSTYPE = WIN32
!endif
### DEBUG: Uncomment to make an executable for debugging
# DEBUG = yes
!if ("$(DEBUG)"=="yes")
@@ -208,14 +199,10 @@ USEDLL = no
### VIMDLL: yes for a DLL version of VIM (NOT RECOMMENDED), no otherwise
#VIMDLL = yes
### ALIGN: alignment you desire: (1,2 or 4: s/b 4 for Win32, 2 for DOS)
### ALIGN: alignment you desire: (1,2 or 4: s/b 4 for Win32)
!if ("$(ALIGN)"=="")
!if ($(OSTYPE)==DOS16)
ALIGN = 2
!else
ALIGN = 4
!endif
!endif
### FASTCALL: yes to use FASTCALL calling convention (RECOMMENDED!), no otherwise
# Incompatible when calling external functions (like MSVC-compiled DLLs), so
@@ -239,13 +226,9 @@ FASTCALL = yes
OPTIMIZE = MAXSPEED
!endif
### FEATURES: TINY, SMALL, NORMAL, BIG or HUGE (BIG for WIN32, SMALL for DOS16)
### FEATURES: TINY, SMALL, NORMAL, BIG or HUGE (BIG for WIN32)
!if ("$(FEATURES)"=="")
! if ($(OSTYPE)==DOS16)
FEATURES = SMALL
! else
FEATURES = BIG
! endif
!endif
### POSTSCRIPT: uncomment this line if you want PostScript printing
@@ -266,24 +249,7 @@ WINVER = 0x0400
# Sanity checks for the above options:
#
!if ($(OSTYPE)==DOS16)
!if (($(CPUNR)+0)>4)
!error CPUNR Must be less than or equal to 4 for DOS16
!endif
!if (($(ALIGN)+0)>2)
!error ALIGN Must be less than or equal to 2 for DOS16
!endif
!else # not DOS16
!if (($(CPUNR)+0)<3)
!error CPUNR Must be greater or equal to 3 for WIN32
!endif
!endif
!if ($(OSTYPE)!=WIN32) && ($(OSTYPE)!=DOS16)
!error Check the OSTYPE variable again: $(OSTYPE) is not supported!
!endif
OSTYPE = WIN32
#
# Optimizations: change as desired (RECOMMENDATION: Don't change!):
@@ -305,11 +271,6 @@ OPT = $(OPT) -pr
OPT = $(OPT) -vi-
!endif
!endif
!if ($(OSTYPE)==DOS16)
!undef GUI
!undef VIMDLL
!undef USEDLL
!endif
# shouldn't have to change:
LIB = $(BOR)\lib
INCLUDE = $(BOR)\include;.;proto
@@ -483,16 +444,9 @@ TARGET = vimd.exe
# for now, anyway: VIMDLL is only for the GUI version
TARGET = vim.exe
!endif
!if ($(OSTYPE)==DOS16)
DEFINES= -DFEAT_$(FEATURES) -DMSDOS
EXETYPE=-ml
STARTUPOBJ = c0l.obj
LINK2 =
!else
EXETYPE=-WC
STARTUPOBJ = c0x32.obj
LINK2 = -ap -OS -o -P
!endif
RESFILE = vim.res
!endif
@@ -545,16 +499,6 @@ DEFINES = $(DEFINES) -DMSWINPS
##### BASE COMPILER/TOOLS RULES #####
MAKE = $(BOR)\bin\make
CFLAGS = -w-aus -w-par -w-pch -w-ngu -w-csu -I$(INCLUDE)
!if ($(OSTYPE)==DOS16)
BRC =
!if ("$(LINK)"=="")
LINK = $(BOR)\BIN\TLink
!endif
CC = $(BOR)\BIN\Bcc
LFLAGS = -Tde -c -m -L$(LIB) $(DEBUG_FLAG) $(LINK2)
LFLAGSDLL =
CFLAGS = $(CFLAGS) -H- $(HEADERS)
!else
BRC = $(BOR)\BIN\brc32
!if ("$(LINK)"=="")
LINK = $(BOR)\BIN\ILink32
@@ -563,7 +507,6 @@ CC = $(BOR)\BIN\Bcc32
LFLAGS = -OS -Tpe -c -m -L$(LIB) $(DEBUG_FLAG) $(LINK2)
LFLAGSDLL = -Tpd -c -m -L$(LIB) $(DEBUG_FLAG) $(LINK2)
CFLAGS = $(CFLAGS) -d -RT- -k- -Oi $(HEADERS) -f-
!endif
CC1 = -c
CC2 = -o
@@ -583,8 +526,6 @@ CCARG = +$(OBJDIR)\bcc.cfg
.cpp.obj:
$(CC) $(CCARG) $(CC1) $(CC2)$@ $*.cpp
!if ($(OSTYPE)==DOS16)
!else # win32:
vimmain = \
$(OBJDIR)\os_w32exe.obj
!if ("$(VIMDLL)"=="yes")
@@ -594,7 +535,6 @@ vimwinmain = \
vimwinmain = \
$(OBJDIR)\os_w32exe.obj
!endif
!endif
vimobj = \
$(OBJDIR)\blowfish.obj \
@@ -720,13 +660,8 @@ vimobj = $(vimobj) \
$(OBJDIR)\gui_w32.obj
!endif
!if ($(OSTYPE)==WIN32)
vimobj = $(vimobj) \
$(OBJDIR)\os_win32.obj $(OBJDIR)\os_mswin.obj $(OBJDIR)\winclip.obj
!elif ($(OSTYPE)==DOS16)
vimobj = $(vimobj) \
$(OBJDIR)\os_msdos.obj
!endif
# Blab what we are going to do:
MSG = Compiling $(OSTYPE) $(TARGET) $(OLETARGET), with:
!if ("$(GUI)"=="yes")
@@ -818,14 +753,10 @@ MSG = $(MSG) Align=$(ALIGNARG)
!message $(MSG)
!if ($(OSTYPE)==DOS16)
TARGETS = $(TARGET)
!else
!if ("$(VIMDLL)"=="yes")
TARGETS = $(DLLTARGET)
!endif
TARGETS = $(TARGETS) $(TARGET)
!endif
# Targets:
all: vim vimrun.exe install.exe xxd uninstal.exe GvimExt/gvimext.dll
@@ -851,18 +782,10 @@ GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
cd ..
install.exe: dosinst.c $(OBJDIR)\bcc.cfg
!if ($(OSTYPE)==WIN32)
$(CC) $(CCARG) -WC -DWIN32 -einstall dosinst.c
!else
$(CC) $(CCARG) -WC -einstall dosinst.c
!endif
uninstal.exe: uninstal.c $(OBJDIR)\bcc.cfg
!if ($(OSTYPE)==WIN32)
$(CC) $(CCARG) -WC -DWIN32 -O2 -euninstal uninstal.c
!else
$(CC) $(CCARG) -WC -O2 -euninstal uninstal.c
!endif
clean:
!if "$(OS)" == "Windows_NT"
@@ -923,10 +846,7 @@ $(DLLTARGET): $(OBJDIR) $(vimdllobj)
cg32.lib+
!endif
# $(OSTYPE)==WIN32 causes os_mswin.c compilation. FEAT_SHORTCUT in it needs OLE
!if ("$(OLE)"=="yes" || $(OSTYPE)==WIN32)
ole2w32.lib +
!endif
!if ($(OSTYPE)==WIN32)
import32.lib+
!ifdef LUA
$(LUA_LIB_FLAG)lua.lib+
@@ -955,9 +875,6 @@ $(DLLTARGET): $(OBJDIR) $(vimdllobj)
cw32.lib
!endif
vim.def
!else
cl.lib
!endif
|
!if ("$(VIMDLL)"=="yes")
@@ -974,14 +891,11 @@ $(TARGET): $(OBJDIR) $(vimobj) $(OBJDIR)\$(RESFILE)
$(vimobj)
!endif
$<,$*
!if ($(OSTYPE)==WIN32)
!if ("$(CODEGUARD)"=="yes")
cg32.lib+
!endif
# $(OSTYPE)==WIN32 causes os_mswin.c compilation. FEAT_SHORTCUT in it needs OLE
!if ("$(OLE)"=="yes" || $(OSTYPE)==WIN32)
ole2w32.lib +
!endif
import32.lib+
!ifdef LUA
$(LUA_LIB_FLAG)lua.lib+
@@ -1011,9 +925,6 @@ $(TARGET): $(OBJDIR) $(vimobj) $(OBJDIR)\$(RESFILE)
!endif
$(OBJDIR)\$(RESFILE)
!else
emu.lib + cl.lib
!endif
|
test:
-112
View File
@@ -1,112 +0,0 @@
#
# Makefile for VIM on MSDOS, using DJGPP 2.0
#
# NOTE: THIS IS OLD AND PROBABLY NO LONGER WORKS.
#
#>>>>> choose options:
### See feature.h for a list of optionals.
### Any other defines can be included here.
DEFINES =
#>>>>> name of the compiler and linker, name of lib directory
CC = gcc
#>>>>> end of choices
###########################################################################
INCL = vim.h globals.h option.h keymap.h macros.h ascii.h term.h os_msdos.h structs.h
CFLAGS = -O2 -DMSDOS -Iproto $(DEFINES) -Wall -Dinterrupt= -Dfar= -DMAXMEM=512 -D_NAIVE_DOS_REGS
OBJ = \
obj/blowfish.o \
obj/buffer.o \
obj/charset.o \
obj/crypt.o \
obj/crypt_zip.o \
obj/diff.o \
obj/digraph.o \
obj/edit.o \
obj/eval.o \
obj/ex_cmds.o \
obj/ex_cmds2.o \
obj/ex_docmd.o \
obj/ex_eval.o \
obj/ex_getln.o \
obj/fileio.o \
obj/fold.o \
obj/getchar.o \
obj/hardcopy.o \
obj/hashtab.o \
obj/main.o \
obj/mark.o \
obj/memfile.o \
obj/memline.o \
obj/menu.o \
obj/message.o \
obj/misc1.o \
obj/misc2.o \
obj/move.o \
obj/mbyte.o \
obj/normal.o \
obj/ops.o \
obj/option.o \
obj/os_msdos.o \
obj/popupmnu.o \
obj/quickfix.o \
obj/regexp.o \
obj/screen.o \
obj/search.o \
obj/sha256.o \
obj/spell.o \
obj/syntax.o \
obj/tag.o \
obj/term.o \
obj/ui.o \
obj/undo.o \
obj/window.o \
$(TERMLIB)
all: vim.exe install.exe uninstal.exe xxd/xxd.exe
# version.c is compiled each time, so that it sets the build time.
vim.exe: obj $(OBJ) version.c version.h
$(CC) $(CFLAGS) -s -o vim.exe version.c $(OBJ) -lpc
install.exe: dosinst.c
$(CC) $(CFLAGS) -s -o install.exe dosinst.c -lpc
uninstal.exe: uninstal.c
$(CC) $(CFLAGS) -s -o uninstal.exe uninstal.c -lpc
# This requires GNU make.
xxd/xxd.exe: xxd/xxd.c
$(MAKE) --directory=xxd -f Make_djg.mak
obj:
mkdir obj
tags:
command /c ctags *.c $(INCL) ex_cmds.h
clean:
-del obj\*.o
-rmdir obj
-del vim.exe
-del install.exe
-del xxd\xxd.exe
-del testdir\*.out
# This requires GNU make.
test:
$(MAKE) --directory=testdir -f Make_dos.mak
###########################################################################
obj/%.o: %.c obj $(INCL)
$(CC) -c $(CFLAGS) -o $@ $<
# Extra dependency (there are actually many more...)
obj/ex_docmd.o: ex_cmds.h
+3 -7
View File
@@ -908,7 +908,7 @@ SANITIZER_LIBS = $(SANITIZER_CFLAGS)
### after changing this, you need to do "make reconfig".
#CONF_TERM_LIB = --with-tlib=ncurses
### For GCC on MSDOS, the ".exe" suffix will be added.
### For GCC on MS-Windows, the ".exe" suffix will be added.
#EXEEXT = .exe
#LNKEXT = .exe
@@ -1732,7 +1732,7 @@ PRO_AUTO = \
# Resources used for the Mac are in one directory.
RSRC_DIR = os_mac_rsrc
PRO_MANUAL = os_amiga.pro os_msdos.pro os_win32.pro \
PRO_MANUAL = os_amiga.pro os_win32.pro \
os_mswin.pro winclip.pro os_beos.pro os_vms.pro $(PERL_PRO)
# Default target is making the executable and tools
@@ -1853,7 +1853,7 @@ update-po:
# Generate function prototypes. This is not needed to compile vim, but if
# you want to use it, cproto is out there on the net somewhere -- Webb
#
# When generating os_amiga.pro, os_msdos.pro and os_win32.pro there will be a
# When generating os_amiga.pro and os_win32.pro there will be a
# few include files that can not be found, that's OK.
proto: $(PRO_AUTO) $(PRO_MANUAL)
@@ -1881,10 +1881,6 @@ os_amiga.pro: os_amiga.c
$(CPROTO) -DAMIGA -UHAVE_CONFIG_H -DBPTR=char* $< > proto/$@
echo "/* vim: set ft=c : */" >> proto/$@
os_msdos.pro: os_msdos.c
$(CPROTO) -DMSDOS -UHAVE_CONFIG_H $< > proto/$@
echo "/* vim: set ft=c : */" >> proto/$@
os_win32.pro: os_win32.c
$(CPROTO) -DWIN32 -UHAVE_CONFIG_H $< > proto/$@
echo "/* vim: set ft=c : */" >> proto/$@
+1 -1
View File
@@ -34,7 +34,7 @@ typedef union {
char_u uc[8];
} block8;
#if defined(WIN3264) || defined(DOS32)
#if defined(WIN3264)
/* MS-Windows is always little endian */
#else
# ifdef HAVE_CONFIG_H
+1 -5
View File
@@ -545,9 +545,7 @@ buf_clear_file(buf_T *buf)
{
buf->b_ml.ml_line_count = 1;
unchanged(buf, TRUE);
#ifndef SHORT_FNAME
buf->b_shortname = FALSE;
#endif
buf->b_p_eol = TRUE;
buf->b_start_eol = TRUE;
#ifdef FEAT_MBYTE
@@ -2915,9 +2913,7 @@ setfname(
}
#endif
#ifndef SHORT_FNAME
buf->b_shortname = FALSE;
#endif
buf_name_changed(buf);
return OK;
@@ -4490,7 +4486,7 @@ fix_fname(char_u *fname)
# ifdef BACKSLASH_IN_FILENAME
|| strstr((char *)fname, "\\\\") != NULL
# endif
# if defined(MSWIN) || defined(DJGPP)
# if defined(MSWIN)
|| vim_strchr(fname, '~') != NULL
# endif
)
+42 -6
View File
@@ -504,7 +504,11 @@ static char *e_cannot_connect = N_("E902: Cannot connect to port");
* Returns NULL for failure.
*/
channel_T *
channel_open(char *hostname, int port_in, int waittime, void (*close_cb)(void))
channel_open(
char *hostname,
int port_in,
int waittime,
void (*nb_close_cb)(void))
{
int sd = -1;
struct sockaddr_in server;
@@ -730,7 +734,7 @@ channel_open(char *hostname, int port_in, int waittime, void (*close_cb)(void))
}
channel->CH_SOCK_FD = (sock_T)sd;
channel->ch_close_cb = close_cb;
channel->ch_nb_close_cb = nb_close_cb;
#ifdef FEAT_GUI
channel_gui_register(channel);
@@ -809,6 +813,15 @@ channel_set_options(channel_T *channel, jobopt_T *opt)
else
*cbp = NULL;
}
if (opt->jo_set & JO_CLOSE_CALLBACK)
{
cbp = &channel->ch_close_cb;
vim_free(*cbp);
if (opt->jo_close_cb != NULL && *opt->jo_close_cb != NUL)
*cbp = vim_strsave(opt->jo_close_cb);
else
*cbp = NULL;
}
}
/*
@@ -1274,7 +1287,7 @@ may_invoke_callback(channel_T *channel, int part)
ch_mode_T ch_mode = channel->ch_part[part].ch_mode;
char_u *callback = NULL;
if (channel->ch_close_cb != NULL)
if (channel->ch_nb_close_cb != NULL)
/* this channel is handled elsewhere (netbeans) */
return FALSE;
@@ -1496,7 +1509,28 @@ channel_close(channel_T *channel)
}
#endif
channel->ch_close_cb = NULL;
if (channel->ch_close_cb != NULL)
{
typval_T argv[1];
typval_T rettv;
int dummy;
/* invoke the close callback; increment the refcount to avoid it
* being freed halfway */
argv[0].v_type = VAR_CHANNEL;
argv[0].vval.v_channel = channel;
++channel->ch_refcount;
call_func(channel->ch_close_cb, (int)STRLEN(channel->ch_close_cb),
&rettv, 1, argv, 0L, 0L, &dummy, TRUE, NULL);
clear_tv(&rettv);
--channel->ch_refcount;
/* the callback is only called once */
vim_free(channel->ch_close_cb);
channel->ch_close_cb = NULL;
}
channel->ch_nb_close_cb = NULL;
channel_clear(channel);
}
@@ -1558,6 +1592,8 @@ channel_clear(channel_T *channel)
#endif
vim_free(channel->ch_callback);
channel->ch_callback = NULL;
vim_free(channel->ch_close_cb);
channel->ch_close_cb = NULL;
}
#if defined(EXITFREE) || defined(PROTO)
@@ -1751,8 +1787,8 @@ channel_read(channel_T *channel, int part, char *func)
* keep stdin and stderr open? Probably not, assume the other side
* has died. */
channel_close(channel);
if (channel->ch_close_cb != NULL)
(*channel->ch_close_cb)();
if (channel->ch_nb_close_cb != NULL)
(*channel->ch_nb_close_cb)();
if (len < 0)
{
+4 -4
View File
@@ -29,7 +29,7 @@ static int diff_flags = DIFF_FILLER;
static int diff_a_works = MAYBE; /* TRUE when "diff -a" works, FALSE when it
doesn't work, MAYBE when not checked yet */
#if defined(MSWIN) || defined(MSDOS)
#if defined(MSWIN)
static int diff_bin_works = MAYBE; /* TRUE when "diff --binary" works, FALSE
when it doesn't work, MAYBE when not
checked yet */
@@ -733,7 +733,7 @@ ex_diffupdate(
break;
#endif
#if defined(MSWIN) || defined(MSDOS)
#if defined(MSWIN)
/* If the "-a" argument works, also check if "--binary" works. */
if (ok && diff_a_works == MAYBE && diff_bin_works == MAYBE)
{
@@ -764,7 +764,7 @@ ex_diffupdate(
EMSG(_("E810: Cannot read or write temp files"));
EMSG(_("E97: Cannot create diffs"));
diff_a_works = MAYBE;
#if defined(MSWIN) || defined(MSDOS)
#if defined(MSWIN)
diff_bin_works = MAYBE;
#endif
goto theend;
@@ -845,7 +845,7 @@ diff_file(
* non-zero when differences have been found. */
vim_snprintf((char *)cmd, len, "diff %s%s%s%s%s %s",
diff_a_works == FALSE ? "" : "-a ",
#if defined(MSWIN) || defined(MSDOS)
#if defined(MSWIN)
diff_bin_works == TRUE ? "--binary " : "",
#else
"",
+15 -83
View File
@@ -39,74 +39,7 @@ static garray_T user_digraphs = {0, 0, (int)sizeof(digr_T), 10, NULL};
* compilers cannot handle them (Amiga SAS/C is the most picky one).
*/
static digr_T digraphdefault[] =
#if defined(MSDOS)
/*
* MSDOS digraphs.
*/
{{'C', ',', 128}, /* ~@ XX */
{'u', '"', 129}, /* */
{'e', '\'', 130}, /* */
{'a', '^', 131}, /* ƒ */
{'a', '"', 132}, /* „ */
{'a', '`', 133}, /* … */
{'a', '@', 134}, /* † */
{'c', ',', 135}, /* ~G XX */
{'e', '^', 136}, /* ~H XX */
{'e', '"', 137}, /* ‰ */
{'e', '`', 138}, /* Š */
{'i', '"', 139}, /* */
{'i', '^', 140}, /* Œ */
{'i', '`', 141}, /* */
{'A', '"', 142}, /* ~N XX */
{'A', '@', 143}, /* */
{'E', '\'', 144}, /* */
{'a', 'e', 145}, /* */
{'A', 'E', 146}, /* */
{'o', '^', 147}, /* “ */
{'o', '"', 148}, /* ” */
{'o', '`', 149}, /* • */
{'u', '^', 150}, /* */
{'u', '`', 151}, /* — */
{'y', '"', 152}, /* ˜ */
{'O', '"', 153}, /* ™ */
{'U', '"', 154}, /* š */
{'c', '|', 155}, /* */
{'$', '$', 156}, /* œ */
{'Y', '-', 157}, /* ~] XX */
{'P', 't', 158}, /* ž */
{'f', 'f', 159}, /* Ÿ */
{'a', '\'', 160}, /*   */
{'i', '\'', 161}, /* ¡ */
{'o', '\'', 162}, /* ¢ */
{'u', '\'', 163}, /* x XX */
{'n', '~', 164}, /* ¤ */
{'N', '~', 165}, /* ¥ */
{'a', 'a', 166}, /* ¦ */
{'o', 'o', 167}, /* § */
{'~', '?', 168}, /* ¨ */
{'-', 'a', 169}, /* © */
{'a', '-', 170}, /* ª */
{'1', '2', 171}, /* « */
{'1', '4', 172}, /* ¬ */
{'~', '!', 173}, /* ­ */
{'<', '<', 174}, /* ® */
{'>', '>', 175}, /* ¯ */
{'s', 's', 225}, /* á */
{'j', 'u', 230}, /* æ */
{'o', '/', 237}, /* í */
{'+', '-', 241}, /* ñ */
{'>', '=', 242}, /* ò */
{'<', '=', 243}, /* ó */
{':', '-', 246}, /* ö */
{'~', '~', 247}, /* ÷ */
{'~', 'o', 248}, /* ø */
{'2', '2', 253}, /* ý */
{NUL, NUL, NUL}
};
#else /* !MSDOS */
# ifdef __MINT__
#ifdef __MINT__
/*
* ATARI digraphs
@@ -171,8 +104,8 @@ static digr_T digraphdefault[] =
{NUL, NUL, NUL}
};
# else /* !__MINT__ */
# ifdef HPUX_DIGRAPHS
#else /* !__MINT__ */
# ifdef HPUX_DIGRAPHS
/*
* different HPUX digraphs
@@ -275,9 +208,9 @@ static digr_T digraphdefault[] =
{NUL, NUL, NUL}
};
# else /* !HPUX_DIGRAPHS */
# else /* !HPUX_DIGRAPHS */
# ifdef EBCDIC
# ifdef EBCDIC
/*
* EBCDIC - ISO digraphs
@@ -387,8 +320,8 @@ static digr_T digraphdefault[] =
{NUL, NUL, NUL}
};
# else
# if defined(MACOS) && !defined(FEAT_MBYTE)
# else
# if defined(MACOS) && !defined(FEAT_MBYTE)
/*
* Macintosh digraphs
@@ -516,9 +449,9 @@ static digr_T digraphdefault[] =
{NUL, NUL, NUL}
};
# else /* !MACOS */
# else /* !MACOS */
# ifdef OLD_DIGRAPHS
# ifdef OLD_DIGRAPHS
/*
* digraphs compatible with Vim 5.x
@@ -625,7 +558,7 @@ static digr_T digraphdefault[] =
{'y', '"', 255}, /* x XX */
{NUL, NUL, NUL}
};
# else /* OLD_DIGRAPHS */
# else /* OLD_DIGRAPHS */
/*
* digraphs for Unicode from RFC1345
@@ -2001,13 +1934,12 @@ static digr_T digraphdefault[] =
{NUL, NUL, NUL}
};
# endif /* OLD_DIGRAPHS */
# endif /* OLD_DIGRAPHS */
# endif /* Macintosh */
# endif /* EBCDIC */
# endif /* !HPUX_DIGRAPHS */
# endif /* !__MINT__ */
#endif /* !MSDOS */
# endif /* Macintosh */
# endif /* EBCDIC */
# endif /* !HPUX_DIGRAPHS */
#endif /* !__MINT__ */
/*
* handle digraphs after typing a character
+4 -16
View File
@@ -46,14 +46,14 @@
char *searchpath(char *name);
#endif
#if defined(DJGPP) || defined(UNIX_LINT)
#if defined(UNIX_LINT)
# include <unistd.h>
# include <errno.h>
#endif
#include "version.h"
#if defined(DJGPP) || defined(UNIX_LINT)
#if defined(UNIX_LINT)
# define vim_mkdir(x, y) mkdir((char *)(x), y)
#else
# if defined(WIN3264) && !defined(__BORLANDC__)
@@ -63,9 +63,7 @@ char *searchpath(char *name);
# endif
#endif
#ifndef DJGPP
# define sleep(n) Sleep((n) * 1000)
#endif
#define sleep(n) Sleep((n) * 1000)
/* ---------------------------------------- */
@@ -423,9 +421,7 @@ run_command(char *cmd)
char *p;
/* On WinNT, 'start' is a shell built-in for cmd.exe rather than an
* executable (start.exe) like in Win9x. DJGPP, being a DOS program,
* is given the COMSPEC command.com by WinNT, so we have to find
* cmd.exe manually and use it. */
* executable (start.exe) like in Win9x. */
cmd_path = searchpath_save("cmd.exe");
if (cmd_path != NULL)
{
@@ -640,14 +636,6 @@ char *sysdrive; /* system drive or "c:\" */
static void
do_inits(char **argv)
{
#ifdef DJGPP
/*
* Use Long File Names by default, if $LFN not set.
*/
if (getenv("LFN") == NULL)
putenv("LFN=y");
#endif
/* Find out the full path of our executable. */
if (my_fullpath(installdir, argv[0], BUFSIZE) == NULL)
{
+13 -8
View File
@@ -10067,6 +10067,18 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported)
return FAIL;
}
}
else if (STRCMP(hi->hi_key, "close-cb") == 0)
{
if (!(supported & JO_CLOSE_CALLBACK))
break;
opt->jo_set |= JO_CLOSE_CALLBACK;
opt->jo_close_cb = get_callback(item);
if (opt->jo_close_cb == NULL)
{
EMSG2(_(e_invarg2), "close-cb");
return FAIL;
}
}
else if (STRCMP(hi->hi_key, "waittime") == 0)
{
if (!(supported & JO_WAITTIME))
@@ -13498,13 +13510,6 @@ f_has(typval_T *argvars, typval_T *rettv)
#ifdef __BEOS__
"beos",
#endif
#ifdef MSDOS
# ifdef DJGPP
"dos32",
# else
"dos16",
# endif
#endif
#ifdef MACOS
"mac",
#endif
@@ -18951,7 +18956,7 @@ item_compare2(const void *s1, const void *s2)
rettv.v_type = VAR_UNKNOWN; /* clear_tv() uses this */
res = call_func(sortinfo->item_compare_func,
(int)STRLEN(sortinfo->item_compare_func),
(int)STRLEN(sortinfo->item_compare_func),
&rettv, 2, argv, 0L, 0L, &dummy, TRUE,
sortinfo->item_compare_selfdict);
clear_tv(&argv[0]);
+2 -6
View File
@@ -1925,14 +1925,10 @@ write_viminfo(char_u *file, int forceit)
#ifdef UNIX
shortname,
#else
# ifdef SHORT_FNAME
TRUE,
# else
# ifdef FEAT_GUI_W32
# ifdef FEAT_GUI_W32
gui_is_win32s(),
# else
# else
FALSE,
# endif
# endif
#endif
fname,
+1 -2
View File
@@ -4329,8 +4329,7 @@ get_locale_val(int what)
{
char_u *loc;
/* Obtain the locale value from the libraries. For DJGPP this is
* redefined and it doesn't use the arguments. */
/* Obtain the locale value from the libraries. */
loc = (char_u *)setlocale(what, NULL);
# ifdef WIN32
+1 -1
View File
@@ -3765,7 +3765,7 @@ set_one_cmd_context(
/* Check for environment variable */
if (*xp->xp_pattern == '$'
#if defined(MSDOS) || defined(MSWIN)
#if defined(MSWIN)
|| *xp->xp_pattern == '%'
#endif
)
+2 -2
View File
@@ -4932,7 +4932,7 @@ expand_shellcmd(
if (*s == ' ')
++s; /* Skip space used for absolute path name. */
#if defined(MSDOS) || defined(MSWIN)
#if defined(MSWIN)
e = vim_strchr(s, ';');
#else
e = vim_strchr(s, ':');
@@ -5231,7 +5231,7 @@ globpath(
copy_option_part(&path, buf, MAXPATHL, ",");
if (STRLEN(buf) + STRLEN(file) + 2 < MAXPATHL)
{
# if defined(MSWIN) || defined(MSDOS)
# if defined(MSWIN)
/* Using the platform's path separator (\) makes vim incorrectly
* treat it as an escape character, use '/' instead. */
if (*buf != NUL && !after_pathsep(buf, buf + STRLEN(buf)))
+5 -10
View File
@@ -65,14 +65,10 @@
# if defined(UNIX) || defined(WIN3264) || defined(MACOS)
# define FEAT_HUGE
# else
# if defined(MSWIN) || defined(DJGPP) || defined(VMS) || defined(MACOS) || defined(AMIGA)
# if defined(MSWIN) || defined(VMS) || defined(MACOS) || defined(AMIGA)
# define FEAT_BIG
# else
# ifdef MSDOS
# define FEAT_SMALL
# else
# define FEAT_NORMAL
# endif
# define FEAT_NORMAL
# endif
# endif
#endif
@@ -467,7 +463,7 @@
* and byte2line().
* Note: Required for Macintosh.
*/
#if defined(FEAT_NORMAL) && !defined(MSDOS)
#if defined(FEAT_NORMAL)
# define FEAT_TITLE
#endif
@@ -541,7 +537,6 @@
* with HAVE_TGETENT defined).
*
* (nothing) Machine specific termcap entries will be included.
* This is default for win16 to save static data.
*
* SOME_BUILTIN_TCAPS Include most useful builtin termcap entries (used only
* with NO_BUILTIN_TCAPS not defined).
@@ -1068,7 +1063,7 @@
# ifdef FEAT_BIG
# define FEAT_MOUSE_SGR
# endif
# if defined(FEAT_NORMAL) && (defined(MSDOS) || defined(WIN3264))
# if defined(FEAT_NORMAL) && defined(WIN3264)
# define DOS_MOUSE
# endif
# if defined(FEAT_NORMAL) && defined(__QNX__)
@@ -1190,7 +1185,7 @@
*/
#ifdef FEAT_NORMAL
/* MS-DOS console and Win32 console can change cursor shape */
# if defined(MSDOS) || (defined(WIN3264) && !defined(FEAT_GUI_W32))
# if defined(WIN3264) && !defined(FEAT_GUI_W32)
# define MCH_CURSOR_SHAPE
# endif
# if defined(FEAT_GUI_W32) || defined(FEAT_GUI_MOTIF) \
+15 -47
View File
@@ -445,7 +445,7 @@ readfile(
return FAIL;
}
#endif
#if defined(MSDOS) || defined(MSWIN)
#if defined(MSWIN)
/*
* MS-Windows allows opening a device, but we will probably get stuck
* trying to read it.
@@ -521,12 +521,12 @@ readfile(
/*
* for UNIX: check readonly with perm and mch_access()
* for MSDOS and Amiga: check readonly by trying to open the file for writing
* for Amiga: check readonly by trying to open the file for writing
*/
file_readonly = FALSE;
if (read_stdin)
{
#if defined(MSDOS) || defined(MSWIN)
#if defined(MSWIN)
/* Force binary I/O on stdin to avoid CR-LF -> LF conversion. */
setmode(0, O_BINARY);
#endif
@@ -561,7 +561,7 @@ readfile(
msg_scroll = msg_save;
#ifndef UNIX
/*
* On MSDOS and Amiga we can't open a directory, check here.
* On Amiga we can't open a directory, check here.
*/
isdir_f = (mch_isdir(fname));
perm = mch_getperm(fname); /* check if the file exists */
@@ -3546,7 +3546,7 @@ buf_write(
}
if (c == NODE_WRITABLE)
{
# if defined(MSDOS) || defined(MSWIN)
# if defined(MSWIN)
/* MS-Windows allows opening a device, but we will probably get stuck
* trying to write to it. */
if (!p_odev)
@@ -3791,7 +3791,7 @@ buf_write(
struct stat st_new;
char_u *dirp;
char_u *rootname;
#if defined(UNIX) && !defined(SHORT_FNAME)
#if defined(UNIX)
int did_set_shortname;
#endif
@@ -3834,7 +3834,7 @@ buf_write(
goto nobackup;
}
#if defined(UNIX) && !defined(SHORT_FNAME)
#if defined(UNIX)
did_set_shortname = FALSE;
#endif
@@ -3846,12 +3846,7 @@ buf_write(
/*
* Make backup file name.
*/
backup = buf_modname(
#ifdef SHORT_FNAME
TRUE,
#else
(buf->b_p_sn || buf->b_shortname),
#endif
backup = buf_modname((buf->b_p_sn || buf->b_shortname),
rootname, backup_ext, FALSE);
if (backup == NULL)
{
@@ -3878,7 +3873,6 @@ buf_write(
{
vim_free(backup);
backup = NULL; /* no backup file to delete */
# ifndef SHORT_FNAME
/*
* may try again with 'shortname' set
*/
@@ -3891,7 +3885,6 @@ buf_write(
/* setting shortname didn't help */
if (did_set_shortname)
buf->b_shortname = FALSE;
# endif
break;
}
#endif
@@ -4059,12 +4052,7 @@ buf_write(
backup = NULL;
else
{
backup = buf_modname(
#ifdef SHORT_FNAME
TRUE,
#else
(buf->b_p_sn || buf->b_shortname),
#endif
backup = buf_modname((buf->b_p_sn || buf->b_shortname),
rootname, backup_ext, FALSE);
vim_free(rootname);
}
@@ -4911,12 +4899,7 @@ restore_backup:
*/
if (*p_pm && dobackup)
{
char *org = (char *)buf_modname(
#ifdef SHORT_FNAME
TRUE,
#else
(buf->b_p_sn || buf->b_shortname),
#endif
char *org = (char *)buf_modname((buf->b_p_sn || buf->b_shortname),
fname, p_pm, FALSE);
if (backup != NULL)
@@ -5291,7 +5274,7 @@ 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!!! */
@@ -6034,9 +6017,9 @@ shorten_fname(char_u *full_path, char_u *dir_name)
if (fnamencmp(dir_name, full_path, len) == 0)
{
p = full_path + len;
#if defined(MSDOS) || defined(MSWIN)
#if defined(MSWIN)
/*
* MSDOS: when a file is in the root directory, dir_name will end in a
* MSWIN: when a file is in the root directory, dir_name will end in a
* slash, since C: by itself does not define a specific dir. In this
* case p may already be correct. <negri>
*/
@@ -6051,7 +6034,7 @@ shorten_fname(char_u *full_path, char_u *dir_name)
#endif
}
}
#if defined(MSDOS) || defined(MSWIN)
#if defined(MSWIN)
/*
* When using a file in the current drive, remove the drive name:
* "A:\dir\file" -> "\dir\file". This helps when moving a session file on
@@ -6168,12 +6151,7 @@ modname(
char_u *ext,
int prepend_dot) /* may prepend a '.' to file name */
{
return buf_modname(
#ifdef SHORT_FNAME
TRUE,
#else
(curbuf->b_p_sn || curbuf->b_shortname),
#endif
return buf_modname((curbuf->b_p_sn || curbuf->b_shortname),
fname, ext, prepend_dot);
}
@@ -6212,9 +6190,7 @@ buf_modname(
retval[fnamelen++] = PATHSEP;
retval[fnamelen] = NUL;
}
#ifndef SHORT_FNAME
prepend_dot = FALSE; /* nothing to prepend a dot to */
#endif
}
else
{
@@ -6240,9 +6216,7 @@ buf_modname(
#ifdef USE_LONG_FNAME
&& (!USE_LONG_FNAME || shortname)
#else
# ifndef SHORT_FNAME
&& shortname
# endif
#endif
)
if (*ptr == '.') /* replace '.' by '_' */
@@ -6255,10 +6229,8 @@ buf_modname(
}
/* the file name has at most BASENAMELEN characters. */
#ifndef SHORT_FNAME
if (STRLEN(ptr) > (unsigned)BASENAMELEN)
ptr[BASENAMELEN] = '\0';
#endif
s = ptr + STRLEN(ptr);
@@ -6268,9 +6240,7 @@ buf_modname(
#ifdef USE_LONG_FNAME
if (!USE_LONG_FNAME || shortname)
#else
# ifndef SHORT_FNAME
if (shortname)
# endif
#endif
{
/*
@@ -6325,7 +6295,6 @@ buf_modname(
*/
STRCPY(s, ext);
#ifndef SHORT_FNAME
/*
* Prepend the dot.
*/
@@ -6338,7 +6307,6 @@ buf_modname(
STRMOVE(e + 1, e);
*e = '.';
}
#endif
/*
* Check that, after appending the extension, the file name is really
+4 -26
View File
@@ -1677,15 +1677,6 @@ vgetc(void)
c = CSI;
#endif
}
#ifdef MSDOS
/*
* If K_NUL was typed, it is replaced by K_NUL, 3 in mch_inchar().
* Delete the 3 here.
*/
else if (c == K_NUL && vpeekc() == 3)
(void)vgetorpeek(TRUE);
#endif
/* a keypad or special function key was not mapped, use it like
* its ASCII equivalent */
switch (c)
@@ -5241,7 +5232,7 @@ check_map(
}
#endif
#if defined(MSDOS) || defined(MSWIN) || defined(MACOS)
#if defined(MSWIN) || defined(MACOS)
#define VIS_SEL (VISUAL+SELECTMODE) /* abbreviation */
@@ -5254,7 +5245,7 @@ static struct initmap
int mode;
} initmappings[] =
{
#if defined(MSDOS) || defined(MSWIN)
#if defined(MSWIN)
/* Use the Windows (CUA) keybindings. */
# ifdef FEAT_GUI
/* paste, copy and cut */
@@ -5274,17 +5265,6 @@ static struct initmap
/* paste, copy and cut */
# ifdef FEAT_CLIPBOARD
# ifdef DJGPP
{(char_u *)"\316\122 \"*P", NORMAL}, /* SHIFT-Insert is "*P */
{(char_u *)"\316\122 \"-d\"*P", VIS_SEL}, /* SHIFT-Insert is "-d"*P */
{(char_u *)"\316\122 \022\017*", INSERT}, /* SHIFT-Insert is ^R^O* */
{(char_u *)"\316\222 \"*y", VIS_SEL}, /* CTRL-Insert is "*y */
# if 0 /* Shift-Del produces the same code as Del */
{(char_u *)"\316\123 \"*d", VIS_SEL}, /* SHIFT-Del is "*d */
# endif
{(char_u *)"\316\223 \"*d", VIS_SEL}, /* CTRL-Del is "*d */
{(char_u *)"\030 \"-d", VIS_SEL}, /* CTRL-X is "-d */
# else
{(char_u *)"\316\324 \"*P", NORMAL}, /* SHIFT-Insert is "*P */
{(char_u *)"\316\324 \"-d\"*P", VIS_SEL}, /* SHIFT-Insert is "-d"*P */
{(char_u *)"\316\324 \022\017*", INSERT}, /* SHIFT-Insert is ^R^O* */
@@ -5292,7 +5272,6 @@ static struct initmap
{(char_u *)"\316\327 \"*d", VIS_SEL}, /* SHIFT-Del is "*d */
{(char_u *)"\316\330 \"*d", VIS_SEL}, /* CTRL-Del is "*d */
{(char_u *)"\030 \"-d", VIS_SEL}, /* CTRL-X is "-d */
# endif
# else
{(char_u *)"\316\324 P", NORMAL}, /* SHIFT-Insert is P */
{(char_u *)"\316\324 \"-dP", VIS_SEL}, /* SHIFT-Insert is "-dP */
@@ -5328,7 +5307,7 @@ static struct initmap
void
init_mappings(void)
{
#if defined(MSDOS) || defined(MSWIN) ||defined(MACOS)
#if defined(MSWIN) ||defined(MACOS)
int i;
for (i = 0; i < (int)(sizeof(initmappings) / sizeof(struct initmap)); ++i)
@@ -5336,8 +5315,7 @@ init_mappings(void)
#endif
}
#if defined(MSDOS) || defined(MSWIN) \
|| 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.
+1 -4
View File
@@ -19,7 +19,7 @@
*/
EXTERN long Rows /* nr of rows in the screen */
#ifdef DO_INIT
# if defined(MSDOS) || defined(WIN3264)
# if defined(WIN3264)
= 25L
# else
= 24L
@@ -950,9 +950,6 @@ EXTERN int ctrl_x_mode INIT(= 0); /* Which Ctrl-X mode are we in? */
#endif
EXTERN int no_abbr INIT(= TRUE); /* TRUE when no abbreviations loaded */
#ifdef MSDOS
EXTERN int beep_count INIT(= 0); /* nr of beeps since last char typed */
#endif
#ifdef USE_EXE_NAME
EXTERN char_u *exe_name; /* the name of the executable */
+3 -3
View File
@@ -1097,7 +1097,7 @@ perl_to_vim(SV *sv, typval_T *rettv)
case SVt_PVHV: /* dictionary */
{
HE * entry;
size_t key_len;
I32 key_len;
char * key;
dictitem_T * item;
SV * item2;
@@ -1121,9 +1121,9 @@ perl_to_vim(SV *sv, typval_T *rettv)
for (entry = hv_iternext((HV *)sv); entry; entry = hv_iternext((HV *)sv))
{
key_len = 0;
key = hv_iterkey(entry, (I32 *)&key_len);
key = hv_iterkey(entry, &key_len);
if (!key || !key_len || strlen(key) < key_len) {
if (!key || !key_len || strlen(key) < (size_t)key_len) {
EMSG2("Malformed key Dictionary '%s'", key && *key ? key : "(empty)");
break;
}
+1 -1
View File
@@ -226,7 +226,7 @@
#if defined(UNIX) || defined(VMS) /* open in rw------- mode */
# define mch_open_rw(n, f) mch_open((n), (f), (mode_t)0600)
#else
# if defined(MSDOS) || defined(MSWIN) /* open read/write */
# if defined(MSWIN) /* open read/write */
# define mch_open_rw(n, f) mch_open((n), (f), S_IREAD | S_IWRITE)
# else
# define mch_open_rw(n, f) mch_open((n), (f), 0)
+1 -10
View File
@@ -10,10 +10,6 @@
#define EXTERN
#include "vim.h"
#ifdef SPAWNO
# include <spawno.h> /* special MS-DOS swapping library */
#endif
#ifdef __CYGWIN__
# ifndef WIN32
# include <cygwin/version.h>
@@ -521,8 +517,7 @@ main
/*
* mch_init() sets up the terminal (window) for use. This must be
* done after resetting full_screen, otherwise it may move the cursor
* (MSDOS).
* done after resetting full_screen, otherwise it may move the cursor.
* Note that we may use mch_exit() before mch_init()!
*/
mch_init();
@@ -726,10 +721,6 @@ vim_main2(int argc UNUSED, char **argv UNUSED)
}
#endif
#ifdef SPAWNO /* special MSDOS swapping library */
init_SPAWNO("", SWAP_ANY);
#endif
#ifdef FEAT_VIMINFO
/*
* Read in registers, history etc, but not marks, from the viminfo file.
+1 -1
View File
@@ -6159,7 +6159,7 @@ convert_setup_ext(
}
#if defined(FEAT_GUI) || defined(AMIGA) || defined(WIN3264) \
|| defined(MSDOS) || defined(PROTO)
|| defined(PROTO)
/*
* Do conversion on typed input characters in-place.
* The input and output are not NUL terminated!
+3 -8
View File
@@ -541,7 +541,7 @@ 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;
@@ -635,18 +635,13 @@ mf_sync(memfile_T *mfp, int flags)
status = FAIL;
}
#endif
#ifdef MSDOS
if (_dos_commit(mfp->mf_fd))
status = FAIL;
#else
# ifdef SYNC_DUP_CLOSE
#ifdef SYNC_DUP_CLOSE
/*
* Win32 is a bit more work: Duplicate the file handle and close it.
* This should flush the file to disk.
*/
if ((fd = dup(mfp->mf_fd)) >= 0)
close(fd);
# endif
#endif
#ifdef AMIGA
# if defined(__AROS__) || defined(__amigaos4__)
@@ -1263,7 +1258,7 @@ mf_do_open(
* fname cannot be NameBuff, because it must have been allocated.
*/
mf_set_ffname(mfp);
#if defined(MSDOS) || defined(MSWIN)
#if defined(MSWIN)
/*
* A ":!cd e:xxx" may change the directory without us knowing, use the
* full pathname always. Careful: This frees fname!
+10 -39
View File
@@ -326,13 +326,6 @@ ml_open(buf_T *buf)
curwin->w_nrwidth_line_count = 0;
#endif
#if defined(MSDOS) && !defined(DJGPP)
/* for 16 bit MS-DOS create a swapfile now, because we run out of
* memory very quickly */
if (p_uc != 0)
ml_open_file(buf);
#endif
/*
* fill block0 struct and write page 0
*/
@@ -641,7 +634,7 @@ ml_setname(buf_T *buf)
memfile_T *mfp;
char_u *fname;
char_u *dirp;
#if defined(MSDOS) || defined(MSWIN)
#if defined(MSWIN)
char_u *p;
#endif
@@ -672,7 +665,7 @@ ml_setname(buf_T *buf)
if (fname == NULL) /* no file name found for this dir */
continue;
#if defined(MSDOS) || defined(MSWIN)
#if defined(MSWIN)
/*
* Set full pathname for swap file now, because a ":!cd dir" may
* change directory without us knowing it.
@@ -704,7 +697,7 @@ ml_setname(buf_T *buf)
vim_free(mfp->mf_fname);
mfp->mf_fname = fname;
vim_free(mfp->mf_ffname);
#if defined(MSDOS) || defined(MSWIN)
#if defined(MSWIN)
mfp->mf_ffname = NULL; /* mf_fname is full pathname already */
#else
mf_set_ffname(mfp);
@@ -797,7 +790,7 @@ ml_open_file(buf_T *buf)
continue;
if (mf_open_file(mfp, fname) == OK) /* consumes fname! */
{
#if defined(MSDOS) || defined(MSWIN)
#if defined(MSWIN)
/*
* set full pathname for swap file now, because a ":!cd dir" may
* change directory without us knowing it.
@@ -986,7 +979,7 @@ set_b0_fname(ZERO_BL *b0p, buf_T *buf)
b0p->b0_fname[0] = NUL;
else
{
#if defined(MSDOS) || defined(MSWIN) || defined(AMIGA)
#if defined(MSWIN) || defined(AMIGA)
/* Systems that cannot translate "~user" back into a path: copy the
* file name unmodified. Do use slashes instead of backslashes for
* portability. */
@@ -1280,7 +1273,7 @@ ml_recover(void)
{
msg_start();
msg_outtrans_attr(mfp->mf_fname, attr | MSG_HIST);
#if defined(MSDOS) || defined(MSWIN)
#if defined(MSWIN)
if (STRNCMP(b0p->b0_hname, "PC ", 3) == 0)
MSG_PUTS_ATTR(_(" cannot be used with this version of Vim.\n"),
attr | MSG_HIST);
@@ -2147,7 +2140,7 @@ swapfile_info(char_u *fname)
if (b0_magic_wrong(&b0))
{
#if defined(MSDOS) || defined(MSWIN)
#if defined(MSWIN)
if (STRNCMP(b0.b0_hname, "PC ", 3) == 0)
MSG_PUTS(_("\n [not usable with this version of Vim]"));
else
@@ -2172,13 +2165,6 @@ 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.
@@ -2262,8 +2248,6 @@ end:
curbuf->b_shortname = shortname;
# endif
#endif /* !SHORT_FNAME */
return num_names;
}
@@ -3953,11 +3937,7 @@ makeswapname(
#endif
r = buf_modname(
#ifdef SHORT_FNAME
TRUE,
#else
(buf->b_p_sn || buf->b_shortname),
#endif
fname_res,
(char_u *)
#if defined(VMS)
@@ -3965,13 +3945,8 @@ makeswapname(
#else
".swp",
#endif
#ifdef SHORT_FNAME /* always 8.3 file name */
FALSE
#else
/* Prepend a '.' to the swap file name for the current directory. */
dir_name[0] == '.' && dir_name[1] == NUL
#endif
);
dir_name[0] == '.' && dir_name[1] == NUL);
if (r == NULL) /* out of memory */
return NULL;
@@ -4152,12 +4127,10 @@ findswapname(
#ifdef AMIGA
BPTR fh;
#endif
#ifndef SHORT_FNAME
int r;
#endif
char_u *buf_fname = buf->b_fname;
#if !defined(SHORT_FNAME) && !defined(UNIX)
#if !defined(UNIX)
# define CREATE_DUMMY_FILE
FILE *dummyfd = NULL;
@@ -4217,7 +4190,7 @@ findswapname(
fname = NULL;
break;
}
#if defined(UNIX) && !defined(SHORT_FNAME)
#if defined(UNIX)
/*
* 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
@@ -4356,7 +4329,6 @@ findswapname(
*/
if (fname[n - 2] == 'w' && fname[n - 1] == 'p') /* first try */
{
#ifndef SHORT_FNAME
/*
* on MS-DOS compatible filesystems (e.g. messydos) file.doc.swp
* and file.doc are the same file. To guess if this problem is
@@ -4379,7 +4351,6 @@ findswapname(
continue; /* try again with '.' replaced with '_' */
}
}
#endif
/*
* If we get here the ".swp" file really exists.
* Give an error message, unless recovering, no file name, we are
+17 -42
View File
@@ -3682,28 +3682,9 @@ vim_beep(
&& !(gui.in_use && gui.starting)
#endif
)
{
out_str(T_VB);
}
else
{
#ifdef MSDOS
/*
* The number of beeps outputted is reduced to avoid having to
* wait for all the beeps to finish. This is only a problem on
* systems where the beeps don't overlap.
*/
if (beep_count == 0 || beep_count == 10)
{
out_char(BELL);
beep_count = 1;
}
else
++beep_count;
#else
out_char(BELL);
#endif
}
}
/* When 'verbose' is set and we are sourcing a script or executing a
@@ -3817,7 +3798,7 @@ init_homedir(void)
# endif
#endif
#if defined(MSDOS) || defined(MSWIN)
#if defined(MSWIN)
/*
* Default home dir is C:/
* Best assumption we can make in such a situation.
@@ -3953,7 +3934,7 @@ expand_env_esc(
&& at_start
#endif
)
#if defined(MSDOS) || defined(MSWIN)
#if defined(MSWIN)
|| *src == '%'
#endif
|| (*src == '~' && at_start))
@@ -3982,7 +3963,7 @@ expand_env_esc(
#endif
{
while (c-- > 0 && *tail != NUL && ((vim_isIDc(*tail))
#if defined(MSDOS) || defined(MSWIN)
#if defined(MSWIN)
|| (*src == '%' && *tail != '%')
#endif
))
@@ -3991,7 +3972,7 @@ expand_env_esc(
}
}
#if defined(MSDOS) || defined(MSWIN) || defined(UNIX)
#if defined(MSWIN) || defined(UNIX)
# ifdef UNIX
if (src[1] == '{' && *tail != '}')
# else
@@ -4009,7 +3990,7 @@ expand_env_esc(
#endif
*var = NUL;
var = vim_getenv(dst, &mustfree);
#if defined(MSDOS) || defined(MSWIN) || defined(UNIX)
#if defined(MSWIN) || defined(UNIX)
}
#endif
}
@@ -4200,7 +4181,7 @@ vim_getenv(char_u *name, int *mustfree)
char_u *pend;
int vimruntime;
#if defined(MSDOS) || defined(MSWIN)
#if defined(MSWIN)
/* use "C:/" when $HOME is not set */
if (STRCMP(name, "HOME") == 0)
return homedir;
@@ -4938,7 +4919,7 @@ get_past_head(char_u *path)
{
char_u *retval;
#if defined(MSDOS) || defined(MSWIN)
#if defined(MSWIN)
/* may skip "c:" */
if (isalpha(path[0]) && path[1] == ':')
retval = path + 2;
@@ -9740,13 +9721,13 @@ static int vim_backtick(char_u *p);
static int expand_backtick(garray_T *gap, char_u *pat, int flags);
# endif
# if defined(MSDOS) || defined(WIN3264)
# if defined(WIN3264)
/*
* File name expansion code for MS-DOS, Win16 and Win32. It's here because
* it's shared between these systems.
*/
# if defined(DJGPP) || defined(PROTO)
# define _cdecl /* DJGPP doesn't have this */
# if defined(PROTO)
# define _cdecl
# else
# ifdef __BORLANDC__
# define _cdecl _RTLENTRYF
@@ -9768,14 +9749,8 @@ namelowcpy(
char_u *d,
char_u *s)
{
# ifdef DJGPP
if (USE_LONG_FNAME) /* don't lower case on Windows 95/NT systems */
while (*s)
*d++ = *s++;
else
# endif
while (*s)
*d++ = TOLOWER_LOC(*s++);
while (*s)
*d++ = TOLOWER_LOC(*s++);
*d = NUL;
}
# endif
@@ -10084,7 +10059,7 @@ mch_expandpath(
{
return dos_expandpath(gap, path, 0, flags, FALSE);
}
# endif /* MSDOS || WIN3264 */
# endif /* WIN3264 */
#if (defined(UNIX) && !defined(VMS)) || defined(USE_UNIXFILENAME) \
|| defined(PROTO)
@@ -10450,7 +10425,7 @@ expand_path_option(char_u *curdir, garray_T *gap)
if (ga_grow(gap, 1) == FAIL)
break;
# if defined(MSWIN) || defined(MSDOS)
# if defined(MSWIN)
/* Avoid the path ending in a backslash, it fails when a comma is
* appended. */
len = (int)STRLEN(buf);
@@ -10488,7 +10463,7 @@ get_path_cutoff(char_u *fname, garray_T *gap)
int j = 0;
while ((fname[j] == path_part[i][j]
# if defined(MSWIN) || defined(MSDOS)
# if defined(MSWIN)
|| (vim_ispathsep(fname[j]) && vim_ispathsep(path_part[i][j]))
#endif
) && fname[j] != NUL && path_part[i][j] != NUL)
@@ -10609,7 +10584,7 @@ uniquefy_paths(garray_T *gap, char_u *pattern)
*/
short_name = shorten_fname(path, curdir);
if (short_name != NULL && short_name > path + 1
#if defined(MSWIN) || defined(MSDOS)
#if defined(MSWIN)
/* On windows,
* shorten_fname("c:\a\a.txt", "c:\a\b")
* returns "\a\a.txt", which is not really the short
@@ -10749,7 +10724,7 @@ has_env_var(char_u *p)
if (*p == '\\' && p[1] != NUL)
++p;
else if (vim_strchr((char_u *)
#if defined(MSDOS) || defined(MSWIN)
#if defined(MSWIN)
"$%"
#else
"$"
+6 -26
View File
@@ -805,12 +805,7 @@ alloc_does_fail(long_u size)
* Some memory is reserved for error messages and for being able to
* call mf_release_all(), which needs some memory for mf_trans_add().
*/
#if defined(MSDOS) && !defined(DJGPP)
# define SMALL_MEM
# define KEEP_ROOM 8192L
#else
# define KEEP_ROOM (2 * 8192L)
#endif
#define KEEP_ROOM (2 * 8192L)
#define KEEP_ROOM_KB (KEEP_ROOM / 1024L)
/*
@@ -892,7 +887,7 @@ lalloc(long_u size, int message)
char_u *p; /* pointer to new storage space */
static int releasing = FALSE; /* don't do mf_release_all() recursive */
int try_again;
#if defined(HAVE_AVAIL_MEM) && !defined(SMALL_MEM)
#if defined(HAVE_AVAIL_MEM)
static long_u allocated = 0; /* allocated since last avail check */
#endif
@@ -909,12 +904,6 @@ lalloc(long_u size, int message)
mem_pre_alloc_l(&size);
#endif
#if defined(MSDOS) && !defined(DJGPP)
if (size >= 0xfff0) /* in MSDOS we can't deal with >64K blocks */
p = NULL;
else
#endif
/*
* Loop when out of memory: Try to release some memfile blocks and
* if some blocks are released call malloc again.
@@ -934,14 +923,13 @@ lalloc(long_u size, int message)
/* 1. No check for available memory: Just return. */
goto theend;
#else
# ifndef SMALL_MEM
/* 2. Slow check for available memory: call mch_avail_mem() after
* allocating (KEEP_ROOM / 2) amount of memory. */
allocated += size;
if (allocated < KEEP_ROOM / 2)
goto theend;
allocated = 0;
# endif
/* 3. check for available memory: call mch_avail_mem() */
if (mch_avail_mem(TRUE) < KEEP_ROOM_KB && !releasing)
{
@@ -5459,7 +5447,7 @@ find_file_in_path_option(
if (vim_isAbsName(ff_file_to_find)
/* "..", "../path", "." and "./path": don't use the path_option */
|| rel_to_curdir
#if defined(MSWIN) || defined(MSDOS)
#if defined(MSWIN)
/* handle "\tmp" as absolute path */
|| vim_ispathsep(ff_file_to_find[0])
/* handle "c:name" as absolute path */
@@ -5513,18 +5501,10 @@ find_file_in_path_option(
buf = suffixes;
for (;;)
{
if (
#ifdef DJGPP
/* "C:" by itself will fail for mch_getperm(),
* assume it's always valid. */
(find_what != FINDFILE_FILE && NameBuff[0] != NUL
&& NameBuff[1] == ':'
&& NameBuff[2] == NUL) ||
#endif
(mch_getperm(NameBuff) >= 0
if (mch_getperm(NameBuff) >= 0
&& (find_what == FINDFILE_BOTH
|| ((find_what == FINDFILE_DIR)
== mch_isdir(NameBuff)))))
== mch_isdir(NameBuff))))
{
file_name = vim_strsave(NameBuff);
goto theend;
+1 -1
View File
@@ -1432,7 +1432,7 @@ nb_do_cmd(
if (buf_was_empty)
{
if (ff_detected == EOL_UNKNOWN)
#if defined(MSDOS) || defined(MSWIN)
#if defined(MSWIN)
ff_detected = EOL_DOS;
#else
ff_detected = EOL_UNIX;
+36 -71
View File
@@ -158,9 +158,7 @@
#ifdef FEAT_SMARTINDENT
# define PV_SI OPT_BUF(BV_SI)
#endif
#ifndef SHORT_FNAME
# define PV_SN OPT_BUF(BV_SN)
#endif
#define PV_SN OPT_BUF(BV_SN)
#ifdef FEAT_SYN_HL
# define PV_SMC OPT_BUF(BV_SMC)
# define PV_SYN OPT_BUF(BV_SYN)
@@ -358,9 +356,7 @@ static int p_ro;
#ifdef FEAT_SMARTINDENT
static int p_si;
#endif
#ifndef SHORT_FNAME
static int p_sn;
#endif
static long p_sts;
#if defined(FEAT_SEARCHPATH)
static char_u *p_sua;
@@ -470,7 +466,7 @@ struct vimoption
/* 'isprint' for latin1 is also used for MS-Windows cp1252, where 0x80 is used
* for the currency sign. */
#if defined(MSDOS) || defined(MSWIN)
#if defined(MSWIN)
# define ISP_LATIN1 (char_u *)"@,~-255"
#else
# define ISP_LATIN1 (char_u *)"@,161-255"
@@ -503,7 +499,7 @@ static struct vimoption options[] =
(char_u *)NULL, PV_NONE,
#endif
{
#if (defined(MSDOS) || defined(WIN3264)) && !defined(FEAT_GUI_W32)
#if (defined(WIN3264)) && !defined(FEAT_GUI_W32)
(char_u *)128L,
#else
(char_u *)224L,
@@ -581,7 +577,7 @@ static struct vimoption options[] =
{"background", "bg", P_STRING|P_VI_DEF|P_RCLR,
(char_u *)&p_bg, PV_NONE,
{
#if (defined(MSDOS) || defined(WIN3264)) && !defined(FEAT_GUI)
#if (defined(WIN3264)) && !defined(FEAT_GUI)
(char_u *)"dark",
#else
(char_u *)"light",
@@ -646,11 +642,7 @@ static struct vimoption options[] =
(char_u *)&p_bin, PV_BIN,
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
{"bioskey", "biosk",P_BOOL|P_VI_DEF,
#ifdef MSDOS
(char_u *)&p_biosk, PV_NONE,
#else
(char_u *)NULL, PV_NONE,
#endif
{(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT},
{"blurradius", "blur", P_NUM|P_VIM,
(char_u *)&p_blur, PV_NONE,
@@ -901,11 +893,7 @@ static struct vimoption options[] =
#endif
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
{"conskey", "consk",P_BOOL|P_VI_DEF,
#ifdef MSDOS
(char_u *)&p_consk, PV_NONE,
#else
(char_u *)NULL, PV_NONE,
#endif
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
{"copyindent", "ci", P_BOOL|P_VI_DEF|P_VIM,
(char_u *)&p_ci, PV_CI,
@@ -1345,7 +1333,7 @@ static struct vimoption options[] =
{
# ifdef FEAT_GUI
(char_u *)"n-v-c:block-Cursor/lCursor,ve:ver35-Cursor,o:hor50-Cursor,i-ci:ver25-Cursor/lCursor,r-cr:hor20-Cursor/lCursor,sm:block-Cursor-blinkwait175-blinkoff150-blinkon175",
# else /* MSDOS or Win32 console */
# else /* Win32 console */
(char_u *)"n-v-c:block,o:hor50,i-ci:hor15,r-cr:hor30,sm:block",
# endif
(char_u *)0L}
@@ -1632,7 +1620,7 @@ static struct vimoption options[] =
{"isident", "isi", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
(char_u *)&p_isi, PV_NONE,
{
#if defined(MSDOS) || defined(MSWIN)
#if defined(MSWIN)
(char_u *)"@,48-57,_,128-167,224-235",
#else
# ifdef EBCDIC
@@ -1658,7 +1646,7 @@ static struct vimoption options[] =
"251-254",
#else
(char_u *)"@,48-57,_",
# if defined(MSDOS) || defined(MSWIN)
# if defined(MSWIN)
(char_u *)"@,48-57,_,128-167,224-235"
# else
ISK_LATIN1
@@ -1668,8 +1656,7 @@ static struct vimoption options[] =
{"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(MACOS) && !defined(MACOS_X)) \
#if defined(MSWIN) || (defined(MACOS) && !defined(MACOS_X)) \
|| defined(VMS)
(char_u *)"@,~-255",
#else
@@ -1708,18 +1695,18 @@ static struct vimoption options[] =
{"keywordprg", "kp", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
(char_u *)&p_kp, PV_KP,
{
#if defined(MSDOS) || defined(MSWIN)
#if defined(MSWIN)
(char_u *)":help",
#else
#ifdef VMS
# ifdef VMS
(char_u *)"help",
#else
# ifdef USEMAN_S
(char_u *)"man -s",
# else
# ifdef USEMAN_S
(char_u *)"man -s",
# else
(char_u *)"man",
# endif
# endif
#endif
#endif
(char_u *)0L} SCRIPTID_INIT},
{"langmap", "lmap", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP|P_SECURE,
@@ -1765,7 +1752,7 @@ static struct vimoption options[] =
{"lines", NULL, P_NUM|P_NODEFAULT|P_NO_MKRC|P_VI_DEF|P_RCLR,
(char_u *)&Rows, PV_NONE,
{
#if defined(MSDOS) || defined(WIN3264)
#if defined(WIN3264)
(char_u *)25L,
#else
(char_u *)24L,
@@ -1928,7 +1915,7 @@ static struct vimoption options[] =
{"mouse", NULL, P_STRING|P_VI_DEF|P_FLAGLIST,
(char_u *)&p_mouse, PV_NONE,
{
#if defined(MSDOS) || defined(WIN3264)
#if defined(WIN3264)
(char_u *)"a",
#else
(char_u *)"",
@@ -1951,7 +1938,7 @@ static struct vimoption options[] =
{"mousemodel", "mousem", P_STRING|P_VI_DEF,
(char_u *)&p_mousem, PV_NONE,
{
#if defined(MSDOS) || defined(MSWIN)
#if defined(MSWIN)
(char_u *)"popup",
#else
# if defined(MACOS)
@@ -2010,7 +1997,7 @@ static struct vimoption options[] =
(char_u *)NULL, PV_NONE,
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
{"opendevice", "odev", P_BOOL|P_VI_DEF,
#if defined(MSDOS) || defined(MSWIN)
#if defined(MSWIN)
(char_u *)&p_odev, PV_NONE,
#else
(char_u *)NULL, PV_NONE,
@@ -2056,7 +2043,7 @@ static struct vimoption options[] =
{"path", "pa", P_STRING|P_EXPAND|P_VI_DEF|P_COMMA|P_NODUP,
(char_u *)&p_path, PV_PATH,
{
#if defined AMIGA || defined MSDOS || defined MSWIN
#if defined(AMIGA) || defined(MSWIN)
(char_u *)".,,",
#else
# if defined(__EMX__)
@@ -2342,21 +2329,17 @@ static struct vimoption options[] =
#ifdef VMS
(char_u *)"-",
#else
# if defined(MSDOS)
(char_u *)"command",
# else
# if defined(WIN3264)
# if defined(WIN3264)
(char_u *)"", /* set in set_init_1() */
# else
# else
(char_u *)"sh",
# endif
# endif
#endif /* VMS */
(char_u *)0L} SCRIPTID_INIT},
{"shellcmdflag","shcf", P_STRING|P_VI_DEF|P_SECURE,
(char_u *)&p_shcf, PV_NONE,
{
#if defined(MSDOS) || defined(MSWIN)
#if defined(MSWIN)
(char_u *)"/c",
#else
(char_u *)"-c",
@@ -2412,7 +2395,7 @@ static struct vimoption options[] =
{"shellxescape", "sxe", P_STRING|P_VI_DEF|P_SECURE,
(char_u *)&p_sxe, PV_NONE,
{
#if defined(MSDOS) || defined(WIN3264)
#if defined(WIN3264)
(char_u *)"\"&|<>()@^",
#else
(char_u *)"",
@@ -2429,11 +2412,7 @@ static struct vimoption options[] =
{(char_u *)"", (char_u *)"filnxtToO"}
SCRIPTID_INIT},
{"shortname", "sn", P_BOOL|P_VI_DEF,
#ifdef SHORT_FNAME
(char_u *)NULL, PV_NONE,
#else
(char_u *)&p_sn, PV_SN,
#endif
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
{"showbreak", "sbr", P_STRING|P_VI_DEF|P_RALL,
#ifdef FEAT_LINEBREAK
@@ -2850,7 +2829,7 @@ static struct vimoption options[] =
{"viminfo", "vi", P_STRING|P_ONECOMMA|P_NODUP|P_SECURE,
#ifdef FEAT_VIMINFO
(char_u *)&p_viminfo, PV_NONE,
#if defined(MSDOS) || defined(MSWIN)
#if defined(MSWIN)
{(char_u *)"", (char_u *)"'100,<50,s10,h,rA:,rB:"}
#else
# ifdef AMIGA
@@ -3248,7 +3227,7 @@ set_init_1(void)
* Don't use it if it is empty.
*/
if (((p = mch_getenv((char_u *)"SHELL")) != NULL && *p != NUL)
#if defined(MSDOS) || defined(MSWIN)
#if defined(MSWIN)
# ifdef __EMX__
|| ((p = mch_getenv((char_u *)"EMXSHELL")) != NULL && *p != NUL)
# endif
@@ -3424,7 +3403,7 @@ set_init_1(void)
#ifdef FEAT_POSTSCRIPT
/* 'printexpr' must be allocated to be able to evaluate it. */
set_string_default("pexpr",
# if defined(MSWIN) || defined(MSDOS)
# if defined(MSWIN)
(char_u *)"system('copy' . ' ' . v:fname_in . (&printdevice == '' ? ' LPT1:' : (' \"' . &printdevice . '\"'))) . delete(v:fname_in)"
# else
# ifdef VMS
@@ -3589,8 +3568,7 @@ set_init_1(void)
options[opt_idx].flags |= P_DEF_ALLOCED;
}
#if defined(MSDOS) || defined(MSWIN) || defined(MACOS) \
|| defined(VMS)
#if defined(MSWIN) || defined(MACOS) || defined(VMS)
if (STRCMP(p_enc, "latin1") == 0
# ifdef FEAT_MBYTE
|| enc_utf8
@@ -3869,7 +3847,7 @@ set_init_2(void)
set_number_default("window", Rows - 1);
/* For DOS console the default is always black. */
#if !((defined(MSDOS) || defined(WIN3264)) && !defined(FEAT_GUI))
#if !((defined(WIN3264)) && !defined(FEAT_GUI))
/*
* If 'background' wasn't set by the user, try guessing the value,
* depending on the terminal name. Only need to check for terminals
@@ -3912,7 +3890,7 @@ set_init_2(void)
static char_u *
term_bg_default(void)
{
#if defined(MSDOS) || defined(WIN3264)
#if defined(WIN3264)
/* DOS console nearly always black */
return (char_u *)"dark";
#else
@@ -4039,15 +4017,14 @@ set_init_3(void)
}
#endif
#if defined(MSDOS) || defined(WIN3264)
#if defined(WIN3264)
/*
* Set 'shellcmdflag', 'shellxquote', and 'shellquote' depending on the
* 'shell' option.
* This is done after other initializations, where 'shell' might have been
* set, but only if they have not been set before. Default for p_shcf is
* "/c", for p_shq is "". For "sh" like shells it is changed here to
* "-c" and "\"", but not for DJGPP, because it starts the shell without
* command.com. And for Win32 we need to set p_sxq instead.
* "-c" and "\"". And for Win32 we need to set p_sxq instead.
*/
if (strstr((char *)gettail(p_sh), "sh") != NULL)
{
@@ -4060,8 +4037,7 @@ set_init_3(void)
options[idx3].def_val[VI_DEFAULT] = p_shcf;
}
# ifndef DJGPP
# ifdef WIN3264
# ifdef WIN3264
/* Somehow Win32 requires the quotes around the redirection too */
idx3 = findoption((char_u *)"sxq");
if (idx3 >= 0 && !(options[idx3].flags & P_WAS_SET))
@@ -4069,14 +4045,13 @@ set_init_3(void)
p_sxq = (char_u *)"\"";
options[idx3].def_val[VI_DEFAULT] = p_sxq;
}
# else
# else
idx3 = findoption((char_u *)"shq");
if (idx3 >= 0 && !(options[idx3].flags & P_WAS_SET))
{
p_shq = (char_u *)"\"";
options[idx3].def_val[VI_DEFAULT] = p_shq;
}
# endif
# endif
}
else if (strstr((char *)gettail(p_sh), "cmd.exe") != NULL)
@@ -4500,8 +4475,8 @@ do_set(
}
/*
* allow '=' and ':' as MSDOS command.com allows only one
* '=' character per "set" command line. grrr. (jw)
* allow '=' and ':' for hystorical reasons (MSDOS command.com
* allows only one '=' character per "set" command line. grrr. (jw)
*/
if (nextchar == '?'
|| (prefix == 1
@@ -6642,7 +6617,7 @@ did_set_string_option(
{
out_str(T_ME);
redraw_later(CLEAR);
#if defined(MSDOS) || (defined(WIN3264) && !defined(FEAT_GUI_W32))
#if defined(WIN3264) && !defined(FEAT_GUI_W32)
/* Since t_me has been set, this probably means that the user
* wants to use this as default colors. Need to reset default
* background/foreground colors. */
@@ -8960,12 +8935,6 @@ set_num_option(
}
limit_screen_size();
#ifdef DJGPP
/* avoid a crash by checking for a too large value of 'columns' */
if (old_Columns != Columns && full_screen && term_console)
mch_check_columns();
#endif
/*
* If the screen (shell) height has been changed, assume it is the
* physical screenheight.
@@ -10558,9 +10527,7 @@ get_varp(struct vimoption *p)
#ifdef FEAT_SMARTINDENT
case PV_SI: return (char_u *)&(curbuf->b_p_si);
#endif
#ifndef SHORT_FNAME
case PV_SN: return (char_u *)&(curbuf->b_p_sn);
#endif
case PV_STS: return (char_u *)&(curbuf->b_p_sts);
#ifdef FEAT_SEARCHPATH
case PV_SUA: return (char_u *)&(curbuf->b_p_sua);
@@ -10891,9 +10858,7 @@ buf_copy_options(buf_T *buf, int flags)
#endif
buf->b_p_sts = p_sts;
buf->b_p_sts_nopaste = p_sts_nopaste;
#ifndef SHORT_FNAME
buf->b_p_sn = p_sn;
#endif
#ifdef FEAT_COMMENTS
buf->b_p_com = vim_strsave(p_com);
#endif
+2 -8
View File
@@ -18,7 +18,7 @@
#ifdef AMIGA
# define DFLT_EFM "%f>%l:%c:%t:%n:%m,%f:%l: %t%*\\D%n: %m,%f %l %t%*\\D%n: %m,%*[^\"]\"%f\"%*\\D%l: %m,%f:%l:%m,%f|%l| %m"
#else
# if defined(MSDOS) || defined(WIN3264)
# if defined(WIN3264)
# define DFLT_EFM "%f(%l) : %t%*\\D%n: %m,%*[^\"]\"%f\"%*\\D%l: %m,%f(%l) : %m,%*[^ ] %f %l: %m,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,%f|%l| %m"
# else
# if defined(__EMX__) /* put most common here (i.e. gcc format) at front */
@@ -386,10 +386,6 @@ EXTERN char_u *p_bexpr;
#ifdef FEAT_BROWSE
EXTERN char_u *p_bsdir; /* 'browsedir' */
#endif
#ifdef MSDOS
EXTERN int p_biosk; /* 'bioskey' */
EXTERN int p_consk; /* 'conskey' */
#endif
#ifdef FEAT_LINEBREAK
EXTERN char_u *p_breakat; /* 'breakat' */
#endif
@@ -686,7 +682,7 @@ EXTERN int p_more; /* 'more' */
#ifdef FEAT_MZSCHEME
EXTERN long p_mzq; /* 'mzquantum */
#endif
#if defined(MSDOS) || defined(MSWIN)
#if defined(MSWIN)
EXTERN int p_odev; /* 'opendevice' */
#endif
EXTERN char_u *p_opfunc; /* 'operatorfunc' */
@@ -1096,9 +1092,7 @@ enum
#ifdef FEAT_SMARTINDENT
, BV_SI
#endif
#ifndef SHORT_FNAME
, BV_SN
#endif
#ifdef FEAT_SYN_HL
, BV_SMC
, BV_SYN
-3086
View File
File diff suppressed because it is too large Load Diff
-109
View File
@@ -1,109 +0,0 @@
/* vi:set ts=8 sts=4 sw=4:
*
* VIM - Vi IMproved by Bram Moolenaar
*
* Do ":help uganda" in Vim to read copying and usage conditions.
* Do ":help credits" in Vim to see a list of people who contributed.
*/
/*
* MSDOS Machine-dependent things.
*/
#include "os_dos.h" /* common MS-DOS and Win32 stuff */
#define BINARY_FILE_IO
#define USE_EXE_NAME /* use argv[0] for $VIM */
#define SYNC_DUP_CLOSE /* sync() a file with dup() and close() */
#define USE_TERM_CONSOLE
#ifdef DJGPP
# include <fcntl.h> /* defines _USE_LFN */
# define USE_LONG_FNAME _USE_LFN /* decide at run time */
# define USE_FNAME_CASE
# define HAVE_PUTENV
#else
# define SHORT_FNAME /* always 8.3 file name */
#endif
#define HAVE_STDLIB_H
#define HAVE_STRING_H
#define HAVE_FCNTL_H
#define HAVE_STRCSPN
#define HAVE_STRICMP
#define HAVE_STRFTIME /* guessed */
#define HAVE_STRNICMP
#define HAVE_MEMSET
#define HAVE_QSORT
#define HAVE_ST_MODE /* have stat.st_mode */
#define HAVE_MATH_H
#if defined(__DATE__) && defined(__TIME__)
# define HAVE_DATE_TIME
#endif
#define BREAKCHECK_SKIP 1 /* call mch_breakcheck() each time, it's fast */
#define HAVE_AVAIL_MEM
/*
* Borland C++ 3.1 doesn't have _RTLENTRYF
*/
#ifdef __BORLANDC__
# if __BORLANDC__ < 0x450
# define _RTLENTRYF
# endif
#endif
#define FNAME_ILLEGAL "\"*?><|" /* illegal characters in a file name */
/* cproto fails on missing include files */
#ifndef PROTO
# include <dos.h>
# include <dir.h>
# include <time.h>
#endif
#ifdef DJGPP
# include <unistd.h>
# define HAVE_LOCALE_H
# define setlocale(c, p) djgpp_setlocale()
#endif
#ifndef DJGPP
typedef long off_t;
#endif
/*
* Try several directories to put the temp files.
*/
#define TEMPDIRNAMES "$TMP", "$TEMP", "c:\\TMP", "c:\\TEMP", ""
#define TEMPNAMELEN 128
#ifndef DFLT_MAXMEM
# define DFLT_MAXMEM 256 /* use up to 256Kbyte for buffer */
#endif
#ifndef DFLT_MAXMEMTOT
# define DFLT_MAXMEMTOT 0 /* decide in set_init */
#endif
#ifdef DJGPP
# define BASENAMELEN (_USE_LFN?250:8) /* length of base of file name */
#else
# define BASENAMELEN 8 /* length of base of file name */
#endif
/* codes for msdos mouse event */
#define MSDOS_MOUSE_LEFT 0x01
#define MSDOS_MOUSE_RIGHT 0x02
#define MSDOS_MOUSE_MIDDLE 0x04
#ifdef DJGPP
int mch_rename(const char *OldFile, const char *NewFile);
#else
# define mch_rename(src, dst) rename(src, dst)
#endif
#ifdef DJGPP
# define vim_mkdir(x, y) mkdir((char *)(x), y)
#else
# define vim_mkdir(x, y) mkdir((char *)(x))
#endif
#define mch_rmdir(x) rmdir((char *)(x))
#define mch_setenv(name, val, x) setenv(name, val, x)
-3
View File
@@ -38,9 +38,6 @@
# if defined(UNIX) || defined(__EMX__) || defined(VMS)
# include "os_unix.pro"
# endif
# if defined(MSDOS)
# include "os_msdos.pro"
# endif
# ifdef WIN3264
# include "os_win32.pro"
# include "os_mswin.pro"
+2 -2
View File
@@ -7,10 +7,10 @@ channel_T *add_channel(void);
void channel_free(channel_T *channel);
void channel_gui_register(channel_T *channel);
void channel_gui_register_all(void);
channel_T *channel_open(char *hostname, int port_in, int waittime, void (*close_cb)(void));
channel_T *channel_open(char *hostname, int port_in, int waittime, void (*nb_close_cb)(void));
void channel_set_pipes(channel_T *channel, sock_T in, sock_T out, sock_T err);
void channel_set_job(channel_T *channel, job_T *job);
void channel_set_options(channel_T *channel, jobopt_T *options);
void channel_set_options(channel_T *channel, jobopt_T *opt);
void channel_set_req_callback(channel_T *channel, int part, char_u *callback, int id);
char_u *channel_get(channel_T *channel, int part);
int channel_collapse(channel_T *channel, int part);
-48
View File
@@ -1,48 +0,0 @@
/* os_msdos.c */
void mch_set_normal_colors(void);
void mch_update_cursor(void);
long_u mch_avail_mem(int special);
void mch_delay(long msec, int ignoreinput);
void mch_write(char_u *s, int len);
int mch_inchar(char_u *buf, int maxlen, long time, int tb_change_cnt);
int mch_char_avail(void);
void mch_suspend(void);
void mch_init(void);
int mch_check_win(int argc, char **argv);
int mch_input_isatty(void);
void fname_case(char_u *name, int len);
long mch_get_pid(void);
int mch_FullName(char_u *fname, char_u *buf, int len, int force);
void slash_adjust(char_u *p);
int mch_isFullName(char_u *fname);
void mch_early_init(void);
void mch_exit(int r);
void mch_settmode(int tmode);
void mch_setmouse(int on);
int mch_screenmode(char_u *arg);
int mch_get_shellsize(void);
void mch_set_shellsize(void);
void mch_new_shellsize(void);
void mch_check_columns(void);
int mch_call_shell(char_u *cmd, int options);
void mch_breakcheck(void);
int mch_has_exp_wildcard(char_u *p);
int mch_has_wildcard(char_u *p);
int mch_chdir(char *path);
char *djgpp_setlocale(void);
int clip_mch_own_selection(VimClipboard *cbd);
void clip_mch_lose_selection(VimClipboard *cbd);
void clip_mch_request_selection(VimClipboard *cbd);
void clip_mch_set_selection(VimClipboard *cbd);
long mch_getperm(char_u *name);
int mch_setperm(char_u *name, long perm);
void mch_hide(char_u *name);
int mch_isdir(char_u *name);
int mch_can_exe(char_u *name, char_u **path, int use_path);
int mch_nodetype(char_u *name);
int mch_dirname(char_u *buf, int len);
int mch_remove(char_u *name);
char_u *mch_getenv(char_u *name);
int mch_get_user_name(char_u *s, int len);
void mch_get_host_name(char_u *s, int len);
/* vim: set ft=c : */
-6
View File
@@ -1338,12 +1338,6 @@ bt_regcomp(char_u *expr, int re_flags)
if (reg(REG_NOPAREN, &flags) == NULL)
return NULL;
/* Small enough for pointer-storage convention? */
#ifdef SMALL_MALLOC /* 16 bit storage allocation */
if (regsize >= 65536L - 256L)
EMSG_RET_NULL(_("E339: Pattern too long"));
#endif
/* Allocate space. */
r = (bt_regprog_T *)lalloc(sizeof(bt_regprog_T) + regsize, TRUE);
if (r == NULL)
+4 -6
View File
@@ -3191,15 +3191,13 @@ win_line(
}
}
#ifndef MSDOS
/* Check if the character under the cursor should not be inverted */
if (!highlight_match && lnum == curwin->w_cursor.lnum && wp == curwin
# ifdef FEAT_GUI
#ifdef FEAT_GUI
&& !gui.in_use
# endif
#endif
)
noinvcur = TRUE;
#endif
/* if inverting in this line set area_highlighting */
if (fromcol >= 0)
@@ -9407,8 +9405,8 @@ win_do_lines(
* ScreenLines[] when t_CV isn't defined. That's faster than using
* win_line().
* Don't use a scroll region when we are going to redraw the text, writing
* a character in the lower right corner of the scroll region causes a
* scroll-up in the DJGPP version.
* a character in the lower right corner of the scroll region may cause a
* scroll-up .
*/
if (scroll_region
#ifdef FEAT_VERTSPLIT
+24 -22
View File
@@ -1369,9 +1369,12 @@ struct channel_S {
* first error until the connection works
* again. */
void (*ch_close_cb)(void); /* callback for when channel is closed */
void (*ch_nb_close_cb)(void);
/* callback for Netbeans when channel is
* closed */
char_u *ch_callback; /* call when any msg is not handled */
char_u *ch_close_cb; /* call when channel is closed */
job_T *ch_job; /* Job that uses this channel; this does not
* count as a reference to avoid a circular
@@ -1380,25 +1383,27 @@ struct channel_S {
int ch_refcount; /* reference count */
};
#define JO_MODE 0x0001 /* channel mode */
#define JO_IN_MODE 0x0002 /* stdin mode */
#define JO_OUT_MODE 0x0004 /* stdout mode */
#define JO_ERR_MODE 0x0008 /* stderr mode */
#define JO_CALLBACK 0x0010 /* channel callback */
#define JO_OUT_CALLBACK 0x0020 /* stdout callback */
#define JO_ERR_CALLBACK 0x0040 /* stderr callback */
#define JO_WAITTIME 0x0080 /* only for ch_open() */
#define JO_TIMEOUT 0x0100 /* all timeouts */
#define JO_OUT_TIMEOUT 0x0200 /* stdout timeouts */
#define JO_ERR_TIMEOUT 0x0400 /* stderr timeouts */
#define JO_PART 0x0800 /* "part" */
#define JO_ID 0x1000 /* "id" */
#define JO_STOPONEXIT 0x2000 /* "stoponexit" */
#define JO_EXIT_CB 0x4000 /* "exit-cb" */
#define JO_ALL 0xffffff
#define JO_MODE 0x0001 /* channel mode */
#define JO_IN_MODE 0x0002 /* stdin mode */
#define JO_OUT_MODE 0x0004 /* stdout mode */
#define JO_ERR_MODE 0x0008 /* stderr mode */
#define JO_CALLBACK 0x0010 /* channel callback */
#define JO_OUT_CALLBACK 0x0020 /* stdout callback */
#define JO_ERR_CALLBACK 0x0040 /* stderr callback */
#define JO_CLOSE_CALLBACK 0x0080 /* close callback */
#define JO_WAITTIME 0x0100 /* only for ch_open() */
#define JO_TIMEOUT 0x0200 /* all timeouts */
#define JO_OUT_TIMEOUT 0x0400 /* stdout timeouts */
#define JO_ERR_TIMEOUT 0x0800 /* stderr timeouts */
#define JO_PART 0x1000 /* "part" */
#define JO_ID 0x2000 /* "id" */
#define JO_STOPONEXIT 0x4000 /* "stoponexit" */
#define JO_EXIT_CB 0x8000 /* "exit-cb" */
#define JO_ALL 0xffffff
#define JO_MODE_ALL (JO_MODE + JO_IN_MODE + JO_OUT_MODE + JO_ERR_MODE)
#define JO_CB_ALL (JO_CALLBACK + JO_OUT_CALLBACK + JO_ERR_CALLBACK)
#define JO_CB_ALL \
(JO_CALLBACK + JO_OUT_CALLBACK + JO_ERR_CALLBACK + JO_CLOSE_CALLBACK)
#define JO_TIMEOUT_ALL (JO_TIMEOUT + JO_OUT_TIMEOUT + JO_ERR_TIMEOUT)
/*
@@ -1415,6 +1420,7 @@ typedef struct
char_u *jo_callback; /* not allocated! */
char_u *jo_out_cb; /* not allocated! */
char_u *jo_err_cb; /* not allocated! */
char_u *jo_close_cb; /* not allocated! */
int jo_waittime;
int jo_timeout;
int jo_out_timeout;
@@ -1842,9 +1848,7 @@ struct file_buffer
#endif
int b_p_ro; /* 'readonly' */
long b_p_sw; /* 'shiftwidth' */
#ifndef SHORT_FNAME
int b_p_sn; /* 'shortname' */
#endif
#ifdef FEAT_SMARTINDENT
int b_p_si; /* 'smartindent' */
#endif
@@ -1983,9 +1987,7 @@ struct file_buffer
access b_spell without #ifdef. */
#endif
#ifndef SHORT_FNAME
int b_shortname; /* this file has an 8.3 file name */
#endif
#ifdef FEAT_MZSCHEME
void *b_mzscheme_ref; /* The MzScheme reference to this buffer */
+1 -1
View File
@@ -8056,7 +8056,7 @@ free_highlight(void)
void
restore_cterm_colors(void)
{
#if defined(MSDOS) || (defined(WIN3264) && !defined(FEAT_GUI_W32))
#if defined(WIN3264) && !defined(FEAT_GUI_W32)
/* Since t_me has been set, this probably means that the user
* wants to use this as default colors. Need to reset default
* background/foreground colors. */
+5 -110
View File
@@ -10,7 +10,7 @@
*
* term.c: functions for controlling the terminal
*
* primitive termcap support for Amiga, MSDOS, and Win32 included
* primitive termcap support for Amiga and Win32 included
*
* NOTE: padding and variable substitution is not performed,
* when compiling without HAVE_TGETENT, we use tputs() and tgoto() dummies.
@@ -428,7 +428,7 @@ static struct builtin_term builtin_termcaps[] =
# endif
# endif
# if defined(MSDOS) || defined(ALL_BUILTIN_TCAPS) || defined(__EMX__)
# if defined(ALL_BUILTIN_TCAPS) || defined(__EMX__)
/*
* 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
@@ -513,107 +513,6 @@ static struct builtin_term builtin_termcaps[] =
{K_PAGEUP, "\316I"},
# endif
# if defined(MSDOS)
/*
* These codes are valid for the pc video. The entries that start with ESC |
* are translated into conio calls in os_msdos.c. Default for MSDOS.
*/
{(int)KS_NAME, "pcterm"},
{(int)KS_CE, "\033|K"},
{(int)KS_AL, "\033|L"},
{(int)KS_DL, "\033|M"},
# ifdef TERMINFO
{(int)KS_CS, "\033|%i%p1%d;%p2%dr"},
# ifdef FEAT_VERTSPLIT
{(int)KS_CSV, "\033|%i%p1%d;%p2%dV"},
# endif
# else
{(int)KS_CS, "\033|%i%d;%dr"},
# ifdef FEAT_VERTSPLIT
{(int)KS_CSV, "\033|%i%d;%dV"},
# endif
# endif
{(int)KS_CL, "\033|J"},
{(int)KS_ME, "\033|0m"}, /* normal */
{(int)KS_MR, "\033|112m"}, /* reverse: black on lightgrey */
{(int)KS_MD, "\033|15m"}, /* bold: white text */
{(int)KS_SE, "\033|0m"}, /* standout end */
{(int)KS_SO, "\033|31m"}, /* standout: white on blue */
{(int)KS_CZH, "\033|225m"}, /* italic mode: blue text on yellow */
{(int)KS_CZR, "\033|0m"}, /* italic mode end */
{(int)KS_US, "\033|67m"}, /* underscore mode: cyan text on red */
{(int)KS_UE, "\033|0m"}, /* underscore mode end */
{(int)KS_CCO, "16"}, /* allow 16 colors */
# ifdef TERMINFO
{(int)KS_CAB, "\033|%p1%db"}, /* set background color */
{(int)KS_CAF, "\033|%p1%df"}, /* set foreground color */
# else
{(int)KS_CAB, "\033|%db"}, /* set background color */
{(int)KS_CAF, "\033|%df"}, /* set foreground color */
# endif
{(int)KS_MS, "y"},
{(int)KS_UT, "y"},
{(int)KS_LE, "\b"},
# ifdef TERMINFO
{(int)KS_CM, "\033|%i%p1%d;%p2%dH"},
# else
{(int)KS_CM, "\033|%i%d;%dH"},
# endif
#ifdef DJGPP
{(int)KS_VB, "\033|B"}, /* visual bell */
#endif
{K_UP, "\316H"},
{K_DOWN, "\316P"},
{K_LEFT, "\316K"},
{K_RIGHT, "\316M"},
{K_S_LEFT, "\316s"},
{K_S_RIGHT, "\316t"},
{K_S_TAB, "\316\017"},
{K_F1, "\316;"},
{K_F2, "\316<"},
{K_F3, "\316="},
{K_F4, "\316>"},
{K_F5, "\316?"},
{K_F6, "\316@"},
{K_F7, "\316A"},
{K_F8, "\316B"},
{K_F9, "\316C"},
{K_F10, "\316D"},
{K_F11, "\316\205"},
{K_F12, "\316\206"},
{K_S_F1, "\316T"},
{K_S_F2, "\316U"},
{K_S_F3, "\316V"},
{K_S_F4, "\316W"},
{K_S_F5, "\316X"},
{K_S_F6, "\316Y"},
{K_S_F7, "\316Z"},
{K_S_F8, "\316["},
{K_S_F9, "\316\\"},
{K_S_F10, "\316]"},
{K_S_F11, "\316\207"},
{K_S_F12, "\316\210"},
{K_INS, "\316R"},
{K_DEL, "\316S"},
{K_HOME, "\316G"},
{K_END, "\316O"},
{K_PAGEDOWN, "\316Q"},
{K_PAGEUP, "\316I"},
{K_KPLUS, "\316N"},
{K_KMINUS, "\316J"},
{K_KMULTIPLY, "\3167"},
{K_K0, "\316\332"},
{K_K1, "\316\336"},
{K_K2, "\316\342"},
{K_K3, "\316\346"},
{K_K4, "\316\352"},
{K_K5, "\316\356"},
{K_K6, "\316\362"},
{K_K7, "\316\366"},
{K_K8, "\316\372"},
{K_K9, "\316\376"},
# endif
# if defined(WIN3264) || defined(ALL_BUILTIN_TCAPS) || defined(__EMX__)
/*
* These codes are valid for the Win32 Console . The entries that start with
@@ -1369,10 +1268,6 @@ static struct builtin_term builtin_termcaps[] =
# define DEFAULT_TERM (char_u *)"win32"
#endif
#ifdef MSDOS
# define DEFAULT_TERM (char_u *)"pcterm"
#endif
#if defined(UNIX) && !defined(__MINT__)
# define DEFAULT_TERM (char_u *)"ansi"
#endif
@@ -1971,7 +1866,7 @@ set_termname(char_u *term)
/* termcap failed to report size */
/* set defaults, in case ui_get_shellsize() also fails */
width = 80;
#if defined(MSDOS) || defined(WIN3264)
#if defined(WIN3264)
height = 25; /* console is often 25 lines */
#else
height = 24; /* most terminals are 24 lines */
@@ -4482,7 +4377,7 @@ check_termcode(
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
@@ -4646,7 +4541,7 @@ check_termcode(
#endif
)
{
# if !defined(MSWIN) && !defined(MSDOS)
# if !defined(MSWIN)
/*
* Handle mouse events.
* Recognize the xterm mouse wheel, but not in the GUI, the
+4
View File
@@ -140,6 +140,10 @@ class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler):
print("sending: {}".format(cmd))
self.request.sendall(cmd.encode('utf-8'))
response = ""
elif decoded[1] == 'close me':
print("closing")
self.request.close()
response = ""
elif decoded[1] == 'wait a bit':
time.sleep(0.2)
response = "waited"
+29 -3
View File
@@ -471,9 +471,9 @@ endfunc
"""""""""
let s:job_ret = 'not yet'
let s:job_exit_ret = 'not yet'
function MyExitCb(job, status)
let s:job_ret = 'done'
let s:job_exit_ret = 'done'
endfunc
function s:test_exit_callback(port)
@@ -490,6 +490,32 @@ func Test_exit_callback()
" calling job_status() triggers the callback
call job_status(s:exit_job)
call assert_equal('done', s:job_ret)
call assert_equal('done', s:job_exit_ret)
endif
endfunc
"""""""""
let s:ch_close_ret = 'alive'
function MyCloseCb(ch)
let s:ch_close_ret = 'closed'
endfunc
function s:test_close_callback(port)
let handle = ch_open('localhost:' . a:port, s:chopt)
if ch_status(handle) == "fail"
call assert_false(1, "Can't open channel")
return
endif
call ch_setoptions(handle, {'close-cb': 'MyCloseCb'})
call assert_equal('', ch_sendexpr(handle, 'close me'))
sleep 20m
call assert_equal('closed', s:ch_close_ret)
endfunc
func Test_close_callback()
call ch_log('Test_close_callback()')
call s:run_server('s:test_close_callback')
endfunc
+2 -2
View File
@@ -641,9 +641,9 @@ u_savecommon(
u_getbot();
}
#if !defined(UNIX) && !defined(DJGPP) && !defined(WIN32) && !defined(__EMX__)
#if !defined(UNIX) && !defined(WIN32) && !defined(__EMX__)
/*
* With Amiga and MSDOS 16 bit we can't handle big undo's, because
* With Amiga we can't handle big undo's, because
* then u_alloc_line would have to allocate a block larger than 32K
*/
if (size >= 8000)
-34
View File
@@ -289,41 +289,7 @@ remove_start_menu(void)
static void
delete_uninstall_key(void)
{
#ifdef WIN3264
reg_delete_key(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Vim " VIM_VERSION_SHORT);
#else
FILE *fd;
char buf[BUFSIZE];
/*
* On DJGPP we delete registry entries by creating a .inf file and
* installing it.
*/
fd = fopen("vim.inf", "w");
if (fd != NULL)
{
fprintf(fd, "[version]\n");
fprintf(fd, "signature=\"$CHICAGO$\"\n\n");
fprintf(fd, "[DefaultInstall]\n");
fprintf(fd, "DelReg=DeleteMe\n\n");
fprintf(fd, "[DeleteMe]\n");
fprintf(fd, "HKLM,\"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Vim " VIM_VERSION_SHORT "\"\n");
fclose(fd);
/* Don't know how to detect Win NT with DJGPP. Hack: Just try the Win
* 95/98/ME method, since the DJGPP version can't use long filenames
* on Win NT anyway. */
sprintf(buf, "rundll setupx.dll,InstallHinfSection DefaultInstall 132 %s\\vim.inf", installdir);
run_command(buf);
#if 0
/* Windows NT method (untested). */
sprintf(buf, "rundll32 syssetup,SetupInfObjectInstallAction DefaultInstall 128 %s\\vim.inf", installdir);
run_command(buf);
#endif
remove("vim.inf");
}
#endif
}
int
+6 -7
View File
@@ -763,6 +763,12 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1400,
/**/
1399,
/**/
1398,
/**/
1397,
/**/
@@ -3722,13 +3728,6 @@ list_version(void)
# endif
# endif
#endif
#ifdef MSDOS
# ifdef DJGPP
MSG_PUTS(_("\n32-bit MS-DOS version"));
# else
MSG_PUTS(_("\n16-bit MS-DOS version"));
# endif
#endif
#ifdef MACOS
# ifdef MACOS_X
# ifdef MACOS_X_UNIX
+3 -23
View File
@@ -27,8 +27,7 @@
# endif
#endif
#if defined(MSDOS) || defined(WIN32) || defined(_WIN64) \
|| defined(__EMX__)
#if defined(WIN32) || defined(_WIN64) || defined(__EMX__)
# include "vimio.h"
#endif
@@ -165,21 +164,6 @@
#ifdef WIN3264
# define VIM_SIZEOF_INT 4
#endif
#ifdef MSDOS
# ifdef DJGPP
# ifndef FEAT_GUI_GTK /* avoid problems when generating prototypes */
# define VIM_SIZEOF_INT 4 /* 32 bit ints */
# endif
# define DOS32
# define FEAT_CLIPBOARD
# else
# ifndef FEAT_GUI_GTK /* avoid problems when generating prototypes */
# define VIM_SIZEOF_INT 2 /* 16 bit ints */
# endif
# define SMALL_MALLOC /* 16 bit storage allocation */
# define DOS16
# endif
#endif
#ifdef AMIGA
/* Be conservative about sizeof(int). It could be 4 too. */
@@ -304,10 +288,6 @@
# include "os_amiga.h"
#endif
#ifdef MSDOS
# include "os_msdos.h"
#endif
#ifdef WIN3264
# include "os_win32.h"
#endif
@@ -463,11 +443,11 @@ typedef unsigned long u8char_T; /* long should be 32 bits or more */
#ifdef _DCC
# include <sys/stat.h>
#endif
#if defined(MSDOS) || defined(MSWIN)
#if defined(MSWIN)
# include <sys/stat.h>
#endif
#if defined(HAVE_ERRNO_H) || defined(DJGPP) \
#if defined(HAVE_ERRNO_H) \
|| defined(WIN32) || defined(_WIN64) || defined(__EMX__)
# include <errno.h>
#endif
+1 -1
View File
@@ -6448,7 +6448,7 @@ vim_FullName(
/* something failed; use the file name (truncate when too long) */
vim_strncpy(buf, fname, len - 1);
}
#if defined(MACOS_CLASSIC) || defined(MSDOS) || defined(MSWIN)
#if defined(MACOS_CLASSIC) || defined(MSWIN)
slash_adjust(buf);
#endif
return retval;
-31
View File
@@ -1,31 +0,0 @@
# Simple makefile for Borland C++ 4.0
# 3.1 can NOT be used, it has problems with the fileno() define.
# Command line variables:
# BOR path to root of Borland C (E:\BORLANDC)
# DEBUG set to "yes" for debugging (no)
!ifndef BOR
BOR = e:\bc4
!endif
!if ("$(DEBUG)" == "yes")
DEBUG_FLAG = -v -DDEBUG
!else
DEBUG_FLAG =
!endif
CC = $(BOR)\bin\bcc
INC = -I$(BOR)\include
LIB = -L$(BOR)\lib
# The following compile options can be changed for better machines.
# replace -1- with -2 to produce code for a 80286 or higher
# replace -1- with -3 to produce code for a 80386 or higher
# add -v for source debugging
OPTIMIZE= -1- -Ox
CFLAGS = -A -mc -DMSDOS $(DEBUG_FLAG) $(OPTIMIZE) $(INC) $(LIB)
xxd.exe: xxd.c
$(CC) $(CFLAGS) xxd.c
-9
View File
@@ -1,9 +0,0 @@
# The most simplistic Makefile, for DJGPP on MS-DOS
CFLAGS = -O2 -Wall
xxd.exe: xxd.c
gcc $(CFLAGS) -s -o xxd.exe xxd.c -lpc
clean:
del xxd.exe