annotate src/os_msdos.h @ 632:b6632d553df3 v7.0182

updated for version 7.0182
author vimboss
date Thu, 19 Jan 2006 22:16:24 +0000
parents 6b49757d378c
children 6beb2c667935
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 #else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 # define SHORT_FNAME /* always 8.3 file name */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 #define HAVE_STDLIB_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 #define HAVE_STRING_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 #define HAVE_FCNTL_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 #define HAVE_STRCSPN
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 #define HAVE_STRICMP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 #define HAVE_STRFTIME /* guessed */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 #define HAVE_STRNICMP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 #define HAVE_MEMSET
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 #define HAVE_QSORT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 #define HAVE_ST_MODE /* have stat.st_mode */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 #if defined(__DATE__) && defined(__TIME__)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 # define HAVE_DATE_TIME
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 #define BREAKCHECK_SKIP 1 /* call mch_breakcheck() each time, it's fast */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 #define HAVE_AVAIL_MEM
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 * Borland C++ 3.1 doesn't have _RTLENTRYF
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 #ifdef __BORLANDC__
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 # if __BORLANDC__ < 0x450
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 # define _RTLENTRYF
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 #define FNAME_ILLEGAL "\"*?><|" /* illegal characters in a file name */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 #include <dos.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 #include <dir.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 #include <time.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 #ifdef DJGPP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 # include <unistd.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 # define HAVE_LOCALE_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 # define setlocale(c, p) djgpp_setlocale()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 #ifndef DJGPP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 typedef long off_t;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 * Try several directories to put the temp files.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 #define TEMPDIRNAMES "$TMP", "$TEMP", "c:\\TMP", "c:\\TEMP", ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 #define TEMPNAMELEN 128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 #ifndef DFLT_MAXMEM
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 # define DFLT_MAXMEM 256 /* use up to 256Kbyte for buffer */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 #ifndef DFLT_MAXMEMTOT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 # define DFLT_MAXMEMTOT 0 /* decide in set_init */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 #ifdef DJGPP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 # define BASENAMELEN (_USE_LFN?250:8) /* length of base of file name */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 #else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 # define BASENAMELEN 8 /* length of base of file name */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 /* codes for msdos mouse event */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 #define MSDOS_MOUSE_LEFT 0x01
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 #define MSDOS_MOUSE_RIGHT 0x02
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 #define MSDOS_MOUSE_MIDDLE 0x04
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 #ifdef DJGPP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 int mch_rename(const char *OldFile, const char *NewFile);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 #else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 # define mch_rename(src, dst) rename(src, dst)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 #ifdef DJGPP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 # define vim_mkdir(x, y) mkdir((char *)(x), y)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 #else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 # define vim_mkdir(x, y) mkdir((char *)(x))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 #define mch_rmdir(x) rmdir((char *)(x))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 #define mch_setenv(name, val, x) setenv(name, val, x)