annotate src/os_unix.h @ 70:088a834ca0aa

updated for version 7.0030
author vimboss
date Tue, 04 Jan 2005 21:45:14 +0000
parents 3fc0f57ecb91
children c10855f07ab0
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 * NextStep has a problem with configure, undefine a few things:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 #ifdef NeXT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 # ifdef HAVE_UTIME
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 # undef HAVE_UTIME
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 # ifdef HAVE_SYS_UTSNAME_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 # undef HAVE_SYS_UTSNAME_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 #include <stdio.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 #include <ctype.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 #ifdef VAXC
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 # include <types.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 # include <stat.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 #else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 # include <sys/types.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 # include <sys/stat.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 #ifdef HAVE_STDLIB_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 # include <stdlib.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 #ifdef __EMX__
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 # define HAVE_TOTAL_MEM
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 #if defined(__CYGWIN__) || defined(__CYGWIN32__)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 # define WIN32UNIX /* Compiling for Win32 using Unix files. */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 # define BINARY_FILE_IO
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 /* On AIX 4.2 there is a conflicting prototype for ioctl() in stropts.h and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 * unistd.h. This hack should fix that (suggested by Jeff George).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 * But on AIX 4.3 it's alright (suggested by Jake Hamby). */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 #if defined(FEAT_GUI) && defined(_AIX) && !defined(_AIX43) && !defined(_NO_PROTO)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 # define _NO_PROTO
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 #ifdef HAVE_UNISTD_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 # include <unistd.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 #ifdef HAVE_LIBC_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 # include <libc.h> /* for NeXT */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 #ifdef HAVE_SYS_PARAM_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 # include <sys/param.h> /* defines BSD, if it's a BSD system */
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 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 * Sun defines FILE on SunOS 4.x.x, Solaris has a typedef for FILE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 #if defined(sun) && !defined(FILE)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 # define SOLARIS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 * Using getcwd() is preferred, because it checks for a buffer overflow.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 * Don't use getcwd() on systems do use system("sh -c pwd"). There is an
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 * autoconf check for this.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 * Use getcwd() anyway if getwd() isn't present.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 #if defined(HAVE_GETCWD) && !(defined(BAD_GETCWD) && defined(HAVE_GETWD))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 # define USE_GETCWD
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 #ifndef __ARGS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 /* The AIX VisualAge cc compiler defines __EXTENDED__ instead of __STDC__
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 * because it includes pre-ansi features. */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 # if defined(__STDC__) || defined(__GNUC__) || defined(__EXTENDED__)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 # define __ARGS(x) x
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 # else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 # define __ARGS(x) ()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 /* always use unlink() to remove files */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 #ifndef PROTO
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 # ifdef VMS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 # define mch_remove(x) delete((char *)(x))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 # define vim_mkdir(x, y) mkdir((char *)(x), y)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 # ifdef VAX
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 # else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 # define mch_rmdir(x) rmdir((char *)(x))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 # endif
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), y)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 # define mch_rmdir(x) rmdir((char *)(x))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 # define mch_remove(x) unlink((char *)(x))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 /* The number of arguments to a signal handler is configured here. */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 /* It used to be a long list of almost all systems. Any system that doesn't
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 * have an argument??? */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 #define SIGHASARG
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 /* List 3 arg systems here. I guess __sgi, please test and correct me. jw. */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 #if defined(__sgi) && defined(HAVE_SIGCONTEXT)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 # define SIGHAS3ARGS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 #ifdef SIGHASARG
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 # ifdef SIGHAS3ARGS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 # define SIGPROTOARG (int, int, struct sigcontext *)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 # define SIGDEFARG(s) (s, sig2, scont) int s, sig2; struct sigcontext *scont;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 # define SIGDUMMYARG 0, 0, (struct sigcontext *)0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 # else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 # define SIGPROTOARG (int)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 # define SIGDEFARG(s) (s) int s;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 # define SIGDUMMYARG 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 #else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 # define SIGPROTOARG (void)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 # define SIGDEFARG(s) ()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 # define SIGDUMMYARG
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 #ifdef HAVE_DIRENT_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 # include <dirent.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 # ifndef NAMLEN
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 # define NAMLEN(dirent) strlen((dirent)->d_name)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 #else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 # define dirent direct
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 # define NAMLEN(dirent) (dirent)->d_namlen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141 # if HAVE_SYS_NDIR_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 # include <sys/ndir.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144 # if HAVE_SYS_DIR_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145 # include <sys/dir.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 # if HAVE_NDIR_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 # include <ndir.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152 #if !defined(HAVE_SYS_TIME_H) || defined(TIME_WITH_SYS_TIME)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 # include <time.h> /* on some systems time.h should not be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154 included together with sys/time.h */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 #ifdef HAVE_SYS_TIME_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 # include <sys/time.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 #include <signal.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162 #if defined(DIRSIZ) && !defined(MAXNAMLEN)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163 # define MAXNAMLEN DIRSIZ
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166 #if defined(UFS_MAXNAMLEN) && !defined(MAXNAMLEN)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 # define MAXNAMLEN UFS_MAXNAMLEN /* for dynix/ptx */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170 #if defined(NAME_MAX) && !defined(MAXNAMLEN)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171 # define MAXNAMLEN NAME_MAX /* for Linux before .99p3 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175 * Note: if MAXNAMLEN has the wrong value, you will get error messages
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176 * for not being able to open the swap file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
178 #if !defined(MAXNAMLEN)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
179 # define MAXNAMLEN 512 /* for all other Unix */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
180 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182 #define BASENAMELEN (MAXNAMLEN - 5)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
184 #ifdef HAVE_ERRNO_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
185 # include <errno.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
186 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
187
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
188 #ifdef HAVE_PWD_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
189 # include <pwd.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
191
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192 #ifdef __COHERENT__
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
193 # undef __ARGS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
194 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
195
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196 #if (defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT)) \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197 || (defined(HAVE_SYS_SYSINFO_H) && defined(HAVE_SYSINFO)) \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
198 || defined(HAVE_SYSCTL) || defined(HAVE_SYSCONF)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
199 # define HAVE_TOTAL_MEM
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
200 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
201
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
202 #ifdef VMS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
203 #include <unixio.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204 #include <unixlib.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
205 #include <signal.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206 #include <file.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
207 #include <ssdef.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
208 #include <descrip.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209 #include <libclidef.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
210 #include <lnmdef.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211 #include <psldef.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212 #include <prvdef.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213 #include <dvidef.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
214 #include <dcdef.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
215 #include <stsdef.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
216 #include <iodef.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217 #include <ttdef.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
218 #include <tt2def.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
219 #include <jpidef.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
220 #include <rms.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
221 #include <trmdef.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
222 #include <string.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
223 #include <starlet.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
224 #include <socket.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
225 #include <lib$routines.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
226
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
227 typedef struct dsc$descriptor DESC;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
228 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
229
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
230 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
231 * Unix system-dependent file names
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
232 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
233 #ifndef SYS_VIMRC_FILE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
234 # define SYS_VIMRC_FILE "$VIM/vimrc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
235 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
236 #ifndef SYS_GVIMRC_FILE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
237 # define SYS_GVIMRC_FILE "$VIM/gvimrc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
238 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
239 #ifndef DFLT_HELPFILE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
240 # define DFLT_HELPFILE "$VIMRUNTIME/doc/help.txt"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
241 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
242 #ifndef FILETYPE_FILE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
243 # define FILETYPE_FILE "filetype.vim"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
244 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
245 #ifndef FTPLUGIN_FILE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
246 # define FTPLUGIN_FILE "ftplugin.vim"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
247 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
248 #ifndef INDENT_FILE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
249 # define INDENT_FILE "indent.vim"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
250 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
251 #ifndef FTOFF_FILE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
252 # define FTOFF_FILE "ftoff.vim"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
253 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
254 #ifndef FTPLUGOF_FILE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
255 # define FTPLUGOF_FILE "ftplugof.vim"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
256 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
257 #ifndef INDOFF_FILE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
258 # define INDOFF_FILE "indoff.vim"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
259 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
260 #ifndef SYS_MENU_FILE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
261 # define SYS_MENU_FILE "$VIMRUNTIME/menu.vim"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
262 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
263
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
264 #ifndef USR_EXRC_FILE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
265 # ifdef VMS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
266 # define USR_EXRC_FILE "sys$login:.exrc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
267 # else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
268 # define USR_EXRC_FILE "$HOME/.exrc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
269 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
270 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
271
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
272 #if !defined(USR_EXRC_FILE2) && defined(OS2)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
273 # define USR_EXRC_FILE2 "$VIM/.exrc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
274 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
275 #if !defined(USR_EXRC_FILE2) && defined(VMS)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
276 # define USR_EXRC_FILE2 "sys$login:_exrc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
277 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
278
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
279 #ifndef USR_VIMRC_FILE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
280 # ifdef VMS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
281 # define USR_VIMRC_FILE "sys$login:.vimrc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
282 # else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
283 # define USR_VIMRC_FILE "$HOME/.vimrc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
284 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
285 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
286
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
287 #if !defined(USR_VIMRC_FILE2) && defined(OS2)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
288 # define USR_VIMRC_FILE2 "$VIM/.vimrc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
289 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
290 #if !defined(USR_VIMRC_FILE2) && defined(VMS)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
291 # define USR_VIMRC_FILE2 "sys$login:_vimrc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
292 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
293
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
294 #ifndef USR_GVIMRC_FILE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
295 # ifdef VMS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
296 # define USR_GVIMRC_FILE "sys$login:.gvimrc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
297 # else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
298 # define USR_GVIMRC_FILE "$HOME/.gvimrc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
299 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
300 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
301
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
302 #ifdef VMS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
303 # ifndef USR_GVIMRC_FILE2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
304 # define USR_GVIMRC_FILE2 "sys$login:_gvimrc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
305 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
306 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
307
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
308 #ifndef EVIM_FILE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
309 # define EVIM_FILE "$VIMRUNTIME/evim.vim"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
310 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
311
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
312 #ifdef FEAT_VIMINFO
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
313 # ifndef VIMINFO_FILE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
314 # ifdef VMS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
315 # define VIMINFO_FILE "sys$login:.viminfo"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
316 # else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
317 # define VIMINFO_FILE "$HOME/.viminfo"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
318 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
319 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
320 # if !defined(VIMINFO_FILE2) && defined(OS2)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
321 # define VIMINFO_FILE2 "$VIM/.viminfo"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
322 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
323 # if !defined(VIMINFO_FILE2) && defined(VMS)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
324 # define VIMINFO_FILE2 "sys$login:_viminfo"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
325 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
326 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
327
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
328 #ifndef EXRC_FILE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
329 # define EXRC_FILE ".exrc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
330 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
331
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
332 #ifndef VIMRC_FILE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
333 # define VIMRC_FILE ".vimrc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
334 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
335
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
336 #ifdef FEAT_GUI
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
337 # ifndef GVIMRC_FILE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
338 # define GVIMRC_FILE ".gvimrc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
339 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
340 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
341
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
342 #ifndef SYNTAX_FNAME
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
343 # define SYNTAX_FNAME "$VIMRUNTIME/syntax/%s.vim"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
344 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
345
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
346 #ifndef DFLT_BDIR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
347 # ifdef OS2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
348 # define DFLT_BDIR ".,c:/tmp,~/tmp,~/"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
349 # else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
350 # ifdef VMS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
351 # define DFLT_BDIR "./,sys$login:,tmp:"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
352 # else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
353 # define DFLT_BDIR ".,~/tmp,~/" /* default for 'backupdir' */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
354 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
355 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
356 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
357
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
358 #ifndef DFLT_DIR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
359 # ifdef OS2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
360 # define DFLT_DIR ".,~/tmp,c:/tmp,/tmp"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
361 # else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
362 # ifdef VMS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
363 # define DFLT_DIR "./,sys$login:,tmp:"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
364 # else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
365 # define DFLT_DIR ".,~/tmp,/var/tmp,/tmp" /* default for 'directory' */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
366 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
367 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
368 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
369
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
370 #ifndef DFLT_VDIR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
371 # ifdef OS2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
372 # define DFLT_VDIR "$VIM/vimfiles/view"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
373 # else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
374 # ifdef VMS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
375 # define DFLT_VDIR "sys$login:vimfiles/view"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
376 # else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
377 # define DFLT_VDIR "$HOME/.vim/view" /* default for 'viewdir' */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
378 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
379 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
380 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
381
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
382 #define DFLT_ERRORFILE "errors.err"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
383
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
384 #ifdef OS2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
385 # define DFLT_RUNTIMEPATH "$HOME/vimfiles,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,$HOME/vimfiles/after"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
386 #else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
387 # ifdef VMS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
388 # define DFLT_RUNTIMEPATH "sys$login:vimfiles,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,sys$login:vimfiles/after"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
389 # else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
390 # ifdef RUNTIME_GLOBAL
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
391 # define DFLT_RUNTIMEPATH "~/.vim," RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL "/after,~/.vim/after"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
392 # else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
393 # define DFLT_RUNTIMEPATH "~/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,~/.vim/after"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
394 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
395 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
396 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
397
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
398 #ifdef OS2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
399 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
400 * Try several directories to put the temp files.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
401 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
402 # define TEMPDIRNAMES "$TMP", "$TEMP", "c:\\TMP", "c:\\TEMP", ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
403 # define TEMPNAMELEN 128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
404 #else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
405 # ifdef VMS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
406 # ifndef VAX
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
407 # define VMS_TEMPNAM /* to fix default .LIS extension */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
408 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
409 # define TEMPNAME "TMP:v?XXXXXX.txt"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
410 # define TEMPNAMELEN 28
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
411 # else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
412 # define TEMPDIRNAMES "$TMPDIR", "/tmp", ".", "$HOME"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
413 # define TEMPNAMELEN 256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
414 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
415 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
416
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
417 /* Special wildcards that need to be handled by the shell */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
418 #define SPECIAL_WILDCHAR "`'{"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
419
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
420 #ifndef HAVE_OPENDIR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
421 # define NO_EXPANDPATH
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
422 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
423
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
424 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
425 * Unix has plenty of memory, use large buffers
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
426 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
427 #define CMDBUFFSIZE 1024 /* size of the command processing buffer */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
428 #define MAXPATHL 1024 /* Unix has long paths and plenty of memory */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
429
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
430 #define CHECK_INODE /* used when checking if a swap file already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
431 exists for a file */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
432 #ifdef VMS /* Use less memory because of older systems */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
433 # ifndef DFLT_MAXMEM
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
434 # define DFLT_MAXMEM (2*1024)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
435 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
436 # ifndef DFLT_MAXMEMTOT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
437 # define DFLT_MAXMEMTOT (5*1024)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
438 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
439 #else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
440 # ifndef DFLT_MAXMEM
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
441 # define DFLT_MAXMEM (5*1024) /* use up to 5 Mbyte for a buffer */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
442 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
443 # ifndef DFLT_MAXMEMTOT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
444 # define DFLT_MAXMEMTOT (10*1024) /* use up to 10 Mbyte for Vim */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
445 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
446 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
447
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
448 /* memmove is not present on all systems, use memmove, bcopy, memcpy or our
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
449 * own version */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
450 /* Some systems have (void *) arguments, some (char *). If we use (char *) it
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
451 * works for all */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
452 #ifdef USEMEMMOVE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
453 # define mch_memmove(to, from, len) memmove((char *)(to), (char *)(from), len)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
454 #else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
455 # ifdef USEBCOPY
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
456 # define mch_memmove(to, from, len) bcopy((char *)(from), (char *)(to), len)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
457 # else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
458 # ifdef USEMEMCPY
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
459 # define mch_memmove(to, from, len) memcpy((char *)(to), (char *)(from), len)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
460 # else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
461 # define VIM_MEMMOVE /* found in misc2.c */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
462 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
463 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
464 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
465
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
466 #ifndef PROTO
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
467 # ifdef HAVE_RENAME
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
468 # define mch_rename(src, dst) rename(src, dst)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
469 # else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
470 int mch_rename __ARGS((const char *src, const char *dest));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
471 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
472 # ifdef VMS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
473 # define mch_chdir(s) chdir(vms_fixfilename(s))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
474 # else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
475 # define mch_chdir(s) chdir(s)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
476 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
477 # ifndef VMS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
478 # ifdef __MVS__
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
479 /* on OS390 Unix getenv() doesn't return a pointer to persistant
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
480 * storage -> use __getenv() */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
481 # define mch_getenv(x) (char_u *)__getenv((char *)(x))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
482 # else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
483 # define mch_getenv(x) (char_u *)getenv((char *)(x))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
484 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
485 # define mch_setenv(name, val, x) setenv(name, val, x)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
486 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
487 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
488
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
489 #if !defined(S_ISDIR) && defined(S_IFDIR)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
490 # define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
491 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
492 #if !defined(S_ISREG) && defined(S_IFREG)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
493 # define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
494 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
495 #if !defined(S_ISBLK) && defined(S_IFBLK)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
496 # define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
497 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
498 #if !defined(S_ISSOCK) && defined(S_IFSOCK)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
499 # define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
500 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
501 #if !defined(S_ISFIFO) && defined(S_IFIFO)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
502 # define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
503 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
504
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
505 /* Note: Some systems need both string.h and strings.h (Savage). However,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
506 * some systems can't handle both, only use string.h in that case. */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
507 #ifdef HAVE_STRING_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
508 # include <string.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
509 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
510 #if defined(HAVE_STRINGS_H) && !defined(NO_STRINGS_WITH_STRING_H)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
511 # include <strings.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
512 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
513
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
514 #if defined(HAVE_SETJMP_H)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
515 # include <setjmp.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
516 # ifdef HAVE_SIGSETJMP
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
517 # define JMP_BUF sigjmp_buf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
518 # define SETJMP(x) sigsetjmp((x), 1)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
519 # define LONGJMP siglongjmp
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
520 # else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
521 # define JMP_BUF jmp_buf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
522 # define SETJMP(x) setjmp(x)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
523 # define LONGJMP longjmp
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
524 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
525 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
526
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
527 #define HAVE_DUP /* have dup() */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
528 #define HAVE_ST_MODE /* have stat.st_mode */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
529
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
530 /* We have three kinds of ACL support. */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
531 #define HAVE_ACL (HAVE_POSIX_ACL || HAVE_SOLARIS_ACL || HAVE_AIX_ACL)