annotate src/os_msdos.h @ 5627:f29febf858be v7.4.160

updated for version 7.4.160 Problem: Win32: Crash when executing external command. Solution: Only close the handle when it was created. (Yasuhiro Matsumoto)
author Bram Moolenaar <bram@vim.org>
date Fri, 24 Jan 2014 19:55:37 +0100
parents e6d8b44065bc
children cfed0e9f0ca2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 /* vi:set ts=8 sts=4 sw=4:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 * VIM - Vi IMproved by Bram Moolenaar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 * Do ":help uganda" in Vim to read copying and usage conditions.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 * Do ":help credits" in Vim to see a list of people who contributed.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 * MSDOS Machine-dependent things.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 #include "os_dos.h" /* common MS-DOS and Win32 stuff */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 #define BINARY_FILE_IO
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 #define USE_EXE_NAME /* use argv[0] for $VIM */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 #define SYNC_DUP_CLOSE /* sync() a file with dup() and close() */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 #define USE_TERM_CONSOLE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 #ifdef DJGPP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 # include <fcntl.h> /* defines _USE_LFN */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 # define USE_LONG_FNAME _USE_LFN /* decide at run time */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 # define USE_FNAME_CASE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 # define HAVE_PUTENV
799
6beb2c667935 updated for version 7.0b
vimboss
parents: 378
diff changeset
24 # define HAVE_STDARG_H
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 #else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 # define SHORT_FNAME /* always 8.3 file name */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 #define HAVE_STDLIB_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 #define HAVE_STRING_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 #define HAVE_FCNTL_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 #define HAVE_STRCSPN
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 #define HAVE_STRICMP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 #define HAVE_STRFTIME /* guessed */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 #define HAVE_STRNICMP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 #define HAVE_MEMSET
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 #define HAVE_QSORT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 #define HAVE_ST_MODE /* have stat.st_mode */
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 799
diff changeset
38 #define HAVE_MATH_H
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 #if defined(__DATE__) && defined(__TIME__)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 # define HAVE_DATE_TIME
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 #define BREAKCHECK_SKIP 1 /* call mch_breakcheck() each time, it's fast */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 #define HAVE_AVAIL_MEM
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 * Borland C++ 3.1 doesn't have _RTLENTRYF
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 #ifdef __BORLANDC__
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 # if __BORLANDC__ < 0x450
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 # define _RTLENTRYF
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 #define FNAME_ILLEGAL "\"*?><|" /* illegal characters in a file name */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55
3927
e6d8b44065bc updated for version 7.3.719
Bram Moolenaar <bram@vim.org>
parents: 1621
diff changeset
56 /* cproto fails on missing include files */
e6d8b44065bc updated for version 7.3.719
Bram Moolenaar <bram@vim.org>
parents: 1621
diff changeset
57 #ifndef PROTO
e6d8b44065bc updated for version 7.3.719
Bram Moolenaar <bram@vim.org>
parents: 1621
diff changeset
58 # include <dos.h>
e6d8b44065bc updated for version 7.3.719
Bram Moolenaar <bram@vim.org>
parents: 1621
diff changeset
59 # include <dir.h>
e6d8b44065bc updated for version 7.3.719
Bram Moolenaar <bram@vim.org>
parents: 1621
diff changeset
60 # include <time.h>
e6d8b44065bc updated for version 7.3.719
Bram Moolenaar <bram@vim.org>
parents: 1621
diff changeset
61 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 #ifdef DJGPP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 # include <unistd.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 # define HAVE_LOCALE_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 # define setlocale(c, p) djgpp_setlocale()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 #ifndef DJGPP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 typedef long off_t;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 * Try several directories to put the temp files.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 #define TEMPDIRNAMES "$TMP", "$TEMP", "c:\\TMP", "c:\\TEMP", ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 #define TEMPNAMELEN 128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 #ifndef DFLT_MAXMEM
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 # define DFLT_MAXMEM 256 /* use up to 256Kbyte for buffer */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 #ifndef DFLT_MAXMEMTOT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 # define DFLT_MAXMEMTOT 0 /* decide in set_init */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 #ifdef DJGPP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 # define BASENAMELEN (_USE_LFN?250:8) /* length of base of file name */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 #else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 # define BASENAMELEN 8 /* length of base of file name */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 /* codes for msdos mouse event */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 #define MSDOS_MOUSE_LEFT 0x01
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 #define MSDOS_MOUSE_RIGHT 0x02
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 #define MSDOS_MOUSE_MIDDLE 0x04
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 #ifdef DJGPP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 int mch_rename(const char *OldFile, const char *NewFile);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 #else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 # define mch_rename(src, dst) rename(src, dst)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 #ifdef DJGPP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 # define vim_mkdir(x, y) mkdir((char *)(x), y)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 #else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 # define vim_mkdir(x, y) mkdir((char *)(x))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 #define mch_rmdir(x) rmdir((char *)(x))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 #define mch_setenv(name, val, x) setenv(name, val, x)