Mercurial > vim
annotate src/os_unix.h @ 32591:92b93fe443e9 v9.0.1627
patch 9.0.1627: no generic mechanism to test syntax plugins
Commit: https://github.com/vim/vim/commit/46acad7284cba7842b5e505fa3d07e99806d246f
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jun 11 19:04:18 2023 +0100
patch 9.0.1627: no generic mechanism to test syntax plugins
Problem: No generic mechanism to test syntax plugins.
Solution: Add a syntax plugin test mechanism, using screendumps. Add a
simple test for "c".
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 11 Jun 2023 20:15:06 +0200 |
parents | 8f0da069a311 |
children | 448aef880252 |
rev | line source |
---|---|
10042
4aead6a9b7a9
commit https://github.com/vim/vim/commit/edf3f97ae2af024708ebb4ac614227327033ca47
Christian Brabandt <cb@256bit.org>
parents:
9669
diff
changeset
|
1 /* vi:set ts=8 sts=4 sw=4 noet: |
7 | 2 * |
3 * VIM - Vi IMproved by Bram Moolenaar | |
4 * | |
5 * Do ":help uganda" in Vim to read copying and usage conditions. | |
6 * Do ":help credits" in Vim to see a list of people who contributed. | |
7 */ | |
8 | |
9 /* | |
10 * NextStep has a problem with configure, undefine a few things: | |
11 */ | |
12 #ifdef NeXT | |
13 # ifdef HAVE_UTIME | |
14 # undef HAVE_UTIME | |
15 # endif | |
16 # ifdef HAVE_SYS_UTSNAME_H | |
17 # undef HAVE_SYS_UTSNAME_H | |
18 # endif | |
19 #endif | |
20 | |
21 #include <stdio.h> | |
22 #include <ctype.h> | |
23 | |
24 #ifdef VAXC | |
25 # include <types.h> | |
26 # include <stat.h> | |
27 #else | |
28 # include <sys/types.h> | |
29 # include <sys/stat.h> | |
30 #endif | |
31 | |
32 #ifdef HAVE_STDLIB_H | |
33 # include <stdlib.h> | |
34 #endif | |
35 | |
15963
2d8fa45b341d
patch 8.1.0987: unnecessary condition in #ifdef
Bram Moolenaar <Bram@vim.org>
parents:
15205
diff
changeset
|
36 #ifdef __CYGWIN__ |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
37 # define WIN32UNIX // Compiling for Win32 using Unix files. |
7 | 38 # define BINARY_FILE_IO |
585 | 39 |
40 # define CASE_INSENSITIVE_FILENAME | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
41 # define USE_FNAME_CASE // Fix filename case differences. |
7 | 42 #endif |
43 | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
44 // On AIX 4.2 there is a conflicting prototype for ioctl() in stropts.h and |
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
45 // unistd.h. This hack should fix that (suggested by Jeff George). |
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
46 // But on AIX 4.3 it's alright (suggested by Jake Hamby). |
7 | 47 #if defined(FEAT_GUI) && defined(_AIX) && !defined(_AIX43) && !defined(_NO_PROTO) |
48 # define _NO_PROTO | |
49 #endif | |
50 | |
51 #ifdef HAVE_UNISTD_H | |
1879 | 52 # include <unistd.h> |
7 | 53 #endif |
54 | |
55 #ifdef HAVE_LIBC_H | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
56 # include <libc.h> // for NeXT |
7 | 57 #endif |
58 | |
59 #ifdef HAVE_SYS_PARAM_H | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
60 # include <sys/param.h> // defines BSD, if it's a BSD system |
7 | 61 #endif |
62 | |
63 /* | |
64 * Using getcwd() is preferred, because it checks for a buffer overflow. | |
65 * Don't use getcwd() on systems do use system("sh -c pwd"). There is an | |
66 * autoconf check for this. | |
67 * Use getcwd() anyway if getwd() isn't present. | |
68 */ | |
69 #if defined(HAVE_GETCWD) && !(defined(BAD_GETCWD) && defined(HAVE_GETWD)) | |
70 # define USE_GETCWD | |
71 #endif | |
72 | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
73 // always use unlink() to remove files |
7 | 74 #ifndef PROTO |
75 # ifdef VMS | |
23503
49d866e9b439
patch 8.2.2294: VMS: a few remaining problems
Bram Moolenaar <Bram@vim.org>
parents:
23408
diff
changeset
|
76 # define vim_mkdir(x, y) mkdir((char *)vms_fixfilename(x), y) |
49d866e9b439
patch 8.2.2294: VMS: a few remaining problems
Bram Moolenaar <Bram@vim.org>
parents:
23408
diff
changeset
|
77 # define mch_rmdir(x) delete((char *)vms_fixfilename(x)) |
49d866e9b439
patch 8.2.2294: VMS: a few remaining problems
Bram Moolenaar <Bram@vim.org>
parents:
23408
diff
changeset
|
78 # define mch_remove(x) delete((char *)vms_fixfilename(x)) |
7 | 79 # else |
80 # define vim_mkdir(x, y) mkdir((char *)(x), y) | |
81 # define mch_rmdir(x) rmdir((char *)(x)) | |
82 # define mch_remove(x) unlink((char *)(x)) | |
83 # endif | |
84 #endif | |
85 | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
86 // The number of arguments to a signal handler is configured here. |
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
87 // It used to be a long list of almost all systems. Any system that doesn't |
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
88 // have an argument??? |
7 | 89 #define SIGHASARG |
90 | |
91 #ifdef SIGHASARG | |
29898
3276298c67c5
patch 9.0.0287: Irix systems no longer exist
Bram Moolenaar <Bram@vim.org>
parents:
29241
diff
changeset
|
92 # define SIGPROTOARG (int) |
3276298c67c5
patch 9.0.0287: Irix systems no longer exist
Bram Moolenaar <Bram@vim.org>
parents:
29241
diff
changeset
|
93 # define SIGDEFARG(s) (int s UNUSED) |
3276298c67c5
patch 9.0.0287: Irix systems no longer exist
Bram Moolenaar <Bram@vim.org>
parents:
29241
diff
changeset
|
94 # define SIGDUMMYARG 0 |
7 | 95 #else |
96 # define SIGPROTOARG (void) | |
97 # define SIGDEFARG(s) () | |
98 # define SIGDUMMYARG | |
99 #endif | |
100 | |
32425
c0b3e3c7786c
patch 9.0.1544: recent glibc marks sigset() as a deprecated
Bram Moolenaar <Bram@vim.org>
parents:
29898
diff
changeset
|
101 typedef void (*sighandler_T) SIGPROTOARG; |
c0b3e3c7786c
patch 9.0.1544: recent glibc marks sigset() as a deprecated
Bram Moolenaar <Bram@vim.org>
parents:
29898
diff
changeset
|
102 |
7 | 103 #ifdef HAVE_DIRENT_H |
104 # include <dirent.h> | |
105 # ifndef NAMLEN | |
106 # define NAMLEN(dirent) strlen((dirent)->d_name) | |
107 # endif | |
108 #else | |
109 # define dirent direct | |
110 # define NAMLEN(dirent) (dirent)->d_namlen | |
111 # if HAVE_SYS_NDIR_H | |
112 # include <sys/ndir.h> | |
113 # endif | |
114 # if HAVE_SYS_DIR_H | |
115 # include <sys/dir.h> | |
116 # endif | |
117 # if HAVE_NDIR_H | |
118 # include <ndir.h> | |
119 # endif | |
120 #endif | |
121 | |
29241
1690417aeafe
patch 8.2.5139: TIME_WITH_SYS_TIME is no longer supported by autoconf
Bram Moolenaar <Bram@vim.org>
parents:
25824
diff
changeset
|
122 #include <time.h> |
7 | 123 #ifdef HAVE_SYS_TIME_H |
124 # include <sys/time.h> | |
125 #endif | |
126 | |
127 #include <signal.h> | |
128 | |
129 #if defined(DIRSIZ) && !defined(MAXNAMLEN) | |
130 # define MAXNAMLEN DIRSIZ | |
131 #endif | |
132 | |
133 #if defined(UFS_MAXNAMLEN) && !defined(MAXNAMLEN) | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
134 # define MAXNAMLEN UFS_MAXNAMLEN // for dynix/ptx |
7 | 135 #endif |
136 | |
137 #if defined(NAME_MAX) && !defined(MAXNAMLEN) | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
138 # define MAXNAMLEN NAME_MAX // for Linux before .99p3 |
7 | 139 #endif |
140 | |
141 /* | |
142 * Note: if MAXNAMLEN has the wrong value, you will get error messages | |
143 * for not being able to open the swap file. | |
144 */ | |
145 #if !defined(MAXNAMLEN) | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
146 # define MAXNAMLEN 512 // for all other Unix |
7 | 147 #endif |
148 | |
149 #define BASENAMELEN (MAXNAMLEN - 5) | |
150 | |
151 #ifdef HAVE_PWD_H | |
152 # include <pwd.h> | |
153 #endif | |
154 | |
155 #if (defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT)) \ | |
156 || (defined(HAVE_SYS_SYSINFO_H) && defined(HAVE_SYSINFO)) \ | |
157 || defined(HAVE_SYSCTL) || defined(HAVE_SYSCONF) | |
158 # define HAVE_TOTAL_MEM | |
159 #endif | |
160 | |
3927 | 161 |
162 #ifndef PROTO | |
163 | |
7 | 164 #ifdef VMS |
819 | 165 # include <unixio.h> |
166 # include <unixlib.h> | |
167 # include <signal.h> | |
168 # include <file.h> | |
169 # include <ssdef.h> | |
170 # include <descrip.h> | |
171 # include <libclidef.h> | |
172 # include <lnmdef.h> | |
173 # include <psldef.h> | |
174 # include <prvdef.h> | |
175 # include <dvidef.h> | |
176 # include <dcdef.h> | |
177 # include <stsdef.h> | |
178 # include <iodef.h> | |
179 # include <ttdef.h> | |
180 # include <tt2def.h> | |
181 # include <jpidef.h> | |
182 # include <rms.h> | |
183 # include <trmdef.h> | |
184 # include <string.h> | |
185 # include <starlet.h> | |
186 # include <socket.h> | |
187 # include <lib$routines.h> | |
5541 | 188 # include <libdef.h> |
189 # include <libdtdef.h> | |
819 | 190 |
23408
bdda90ed5f6c
patch 8.2.2247: VMS: various smaller problems
Bram Moolenaar <Bram@vim.org>
parents:
20311
diff
changeset
|
191 # if defined(FEAT_GUI_MOTIF) |
bdda90ed5f6c
patch 8.2.2247: VMS: various smaller problems
Bram Moolenaar <Bram@vim.org>
parents:
20311
diff
changeset
|
192 # define XFree XFREE |
bdda90ed5f6c
patch 8.2.2247: VMS: various smaller problems
Bram Moolenaar <Bram@vim.org>
parents:
20311
diff
changeset
|
193 # define XmRepTypeInstallTearOffModelCon XMREPTYPEINSTALLTEAROFFMODELCON |
819 | 194 # endif |
23408
bdda90ed5f6c
patch 8.2.2247: VMS: various smaller problems
Bram Moolenaar <Bram@vim.org>
parents:
20311
diff
changeset
|
195 #endif // VMS |
7 | 196 |
20311
05b4efb062a7
patch 8.2.0711: temp directory might be cleared
Bram Moolenaar <Bram@vim.org>
parents:
19526
diff
changeset
|
197 #ifdef HAVE_FLOCK |
05b4efb062a7
patch 8.2.0711: temp directory might be cleared
Bram Moolenaar <Bram@vim.org>
parents:
19526
diff
changeset
|
198 # include <sys/file.h> |
05b4efb062a7
patch 8.2.0711: temp directory might be cleared
Bram Moolenaar <Bram@vim.org>
parents:
19526
diff
changeset
|
199 #endif |
05b4efb062a7
patch 8.2.0711: temp directory might be cleared
Bram Moolenaar <Bram@vim.org>
parents:
19526
diff
changeset
|
200 |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
201 #endif // PROTO |
3927 | 202 |
203 #ifdef VMS | |
7 | 204 typedef struct dsc$descriptor DESC; |
205 #endif | |
206 | |
207 /* | |
208 * Unix system-dependent file names | |
209 */ | |
210 #ifndef SYS_VIMRC_FILE | |
211 # define SYS_VIMRC_FILE "$VIM/vimrc" | |
212 #endif | |
213 #ifndef SYS_GVIMRC_FILE | |
214 # define SYS_GVIMRC_FILE "$VIM/gvimrc" | |
215 #endif | |
216 #ifndef DFLT_HELPFILE | |
217 # define DFLT_HELPFILE "$VIMRUNTIME/doc/help.txt" | |
218 #endif | |
219 #ifndef SYS_MENU_FILE | |
220 # define SYS_MENU_FILE "$VIMRUNTIME/menu.vim" | |
221 #endif | |
222 | |
223 #ifndef USR_EXRC_FILE | |
224 # ifdef VMS | |
225 # define USR_EXRC_FILE "sys$login:.exrc" | |
226 # else | |
227 # define USR_EXRC_FILE "$HOME/.exrc" | |
228 # endif | |
229 #endif | |
230 | |
231 #if !defined(USR_EXRC_FILE2) && defined(VMS) | |
232 # define USR_EXRC_FILE2 "sys$login:_exrc" | |
233 #endif | |
234 | |
235 #ifndef USR_VIMRC_FILE | |
236 # ifdef VMS | |
237 # define USR_VIMRC_FILE "sys$login:.vimrc" | |
238 # else | |
239 # define USR_VIMRC_FILE "$HOME/.vimrc" | |
240 # endif | |
241 #endif | |
242 | |
4863
c4d4f0fc12b9
updated for version 7.3.1178
Bram Moolenaar <bram@vim.org>
parents:
3927
diff
changeset
|
243 |
6783 | 244 #if !defined(USR_VIMRC_FILE2) |
7408
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
245 # ifdef VMS |
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
246 # define USR_VIMRC_FILE2 "sys$login:vimfiles/vimrc" |
4863
c4d4f0fc12b9
updated for version 7.3.1178
Bram Moolenaar <bram@vim.org>
parents:
3927
diff
changeset
|
247 # else |
7408
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
248 # define USR_VIMRC_FILE2 "~/.vim/vimrc" |
4863
c4d4f0fc12b9
updated for version 7.3.1178
Bram Moolenaar <bram@vim.org>
parents:
3927
diff
changeset
|
249 # endif |
7 | 250 #endif |
4863
c4d4f0fc12b9
updated for version 7.3.1178
Bram Moolenaar <bram@vim.org>
parents:
3927
diff
changeset
|
251 |
c4d4f0fc12b9
updated for version 7.3.1178
Bram Moolenaar <bram@vim.org>
parents:
3927
diff
changeset
|
252 #if !defined(USR_VIMRC_FILE3) && defined(VMS) |
c4d4f0fc12b9
updated for version 7.3.1178
Bram Moolenaar <bram@vim.org>
parents:
3927
diff
changeset
|
253 # define USR_VIMRC_FILE3 "sys$login:_vimrc" |
7 | 254 #endif |
255 | |
256 #ifndef USR_GVIMRC_FILE | |
257 # ifdef VMS | |
258 # define USR_GVIMRC_FILE "sys$login:.gvimrc" | |
259 # else | |
260 # define USR_GVIMRC_FILE "$HOME/.gvimrc" | |
261 # endif | |
262 #endif | |
263 | |
4863
c4d4f0fc12b9
updated for version 7.3.1178
Bram Moolenaar <bram@vim.org>
parents:
3927
diff
changeset
|
264 #ifndef USR_GVIMRC_FILE2 |
7408
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
265 # ifdef VMS |
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
266 # define USR_GVIMRC_FILE2 "sys$login:vimfiles/gvimrc" |
4863
c4d4f0fc12b9
updated for version 7.3.1178
Bram Moolenaar <bram@vim.org>
parents:
3927
diff
changeset
|
267 # else |
7408
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
268 # define USR_GVIMRC_FILE2 "~/.vim/gvimrc" |
4863
c4d4f0fc12b9
updated for version 7.3.1178
Bram Moolenaar <bram@vim.org>
parents:
3927
diff
changeset
|
269 # endif |
c4d4f0fc12b9
updated for version 7.3.1178
Bram Moolenaar <bram@vim.org>
parents:
3927
diff
changeset
|
270 #endif |
c4d4f0fc12b9
updated for version 7.3.1178
Bram Moolenaar <bram@vim.org>
parents:
3927
diff
changeset
|
271 |
7 | 272 #ifdef VMS |
4863
c4d4f0fc12b9
updated for version 7.3.1178
Bram Moolenaar <bram@vim.org>
parents:
3927
diff
changeset
|
273 # ifndef USR_GVIMRC_FILE3 |
c4d4f0fc12b9
updated for version 7.3.1178
Bram Moolenaar <bram@vim.org>
parents:
3927
diff
changeset
|
274 # define USR_GVIMRC_FILE3 "sys$login:_gvimrc" |
7 | 275 # endif |
276 #endif | |
277 | |
9669
284b4eb307fc
commit https://github.com/vim/vim/commit/8c08b5b569e2a9e9f63dea514591ecfa2d3bb392
Christian Brabandt <cb@256bit.org>
parents:
9536
diff
changeset
|
278 #ifndef VIM_DEFAULTS_FILE |
284b4eb307fc
commit https://github.com/vim/vim/commit/8c08b5b569e2a9e9f63dea514591ecfa2d3bb392
Christian Brabandt <cb@256bit.org>
parents:
9536
diff
changeset
|
279 # define VIM_DEFAULTS_FILE "$VIMRUNTIME/defaults.vim" |
284b4eb307fc
commit https://github.com/vim/vim/commit/8c08b5b569e2a9e9f63dea514591ecfa2d3bb392
Christian Brabandt <cb@256bit.org>
parents:
9536
diff
changeset
|
280 #endif |
284b4eb307fc
commit https://github.com/vim/vim/commit/8c08b5b569e2a9e9f63dea514591ecfa2d3bb392
Christian Brabandt <cb@256bit.org>
parents:
9536
diff
changeset
|
281 |
7 | 282 #ifndef EVIM_FILE |
283 # define EVIM_FILE "$VIMRUNTIME/evim.vim" | |
284 #endif | |
285 | |
286 #ifdef FEAT_VIMINFO | |
287 # ifndef VIMINFO_FILE | |
288 # ifdef VMS | |
289 # define VIMINFO_FILE "sys$login:.viminfo" | |
290 # else | |
291 # define VIMINFO_FILE "$HOME/.viminfo" | |
292 # endif | |
293 # endif | |
294 # if !defined(VIMINFO_FILE2) && defined(VMS) | |
295 # define VIMINFO_FILE2 "sys$login:_viminfo" | |
296 # endif | |
297 #endif | |
298 | |
299 #ifndef EXRC_FILE | |
300 # define EXRC_FILE ".exrc" | |
301 #endif | |
302 | |
303 #ifndef VIMRC_FILE | |
304 # define VIMRC_FILE ".vimrc" | |
305 #endif | |
306 | |
307 #ifdef FEAT_GUI | |
308 # ifndef GVIMRC_FILE | |
309 # define GVIMRC_FILE ".gvimrc" | |
310 # endif | |
311 #endif | |
312 | |
313 #ifndef SYNTAX_FNAME | |
314 # define SYNTAX_FNAME "$VIMRUNTIME/syntax/%s.vim" | |
315 #endif | |
316 | |
317 #ifndef DFLT_BDIR | |
7408
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
318 # ifdef VMS |
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
319 # define DFLT_BDIR "./,sys$login:,tmp:" |
7 | 320 # else |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
321 # define DFLT_BDIR ".,~/tmp,~/" // default for 'backupdir' |
7 | 322 # endif |
323 #endif | |
324 | |
325 #ifndef DFLT_DIR | |
7408
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
326 # ifdef VMS |
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
327 # define DFLT_DIR "./,sys$login:,tmp:" |
7 | 328 # else |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
329 # define DFLT_DIR ".,~/tmp,/var/tmp,/tmp" // default for 'directory' |
7 | 330 # endif |
331 #endif | |
332 | |
333 #ifndef DFLT_VDIR | |
7408
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
334 # ifdef VMS |
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
335 # define DFLT_VDIR "sys$login:vimfiles/view" |
7 | 336 # else |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
337 # define DFLT_VDIR "$HOME/.vim/view" // default for 'viewdir' |
7 | 338 # endif |
339 #endif | |
340 | |
341 #define DFLT_ERRORFILE "errors.err" | |
342 | |
19526
22f0dda71638
patch 8.2.0320: no Haiku support
Bram Moolenaar <Bram@vim.org>
parents:
18753
diff
changeset
|
343 #ifndef DFLT_RUNTIMEPATH |
22f0dda71638
patch 8.2.0320: no Haiku support
Bram Moolenaar <Bram@vim.org>
parents:
18753
diff
changeset
|
344 |
22f0dda71638
patch 8.2.0320: no Haiku support
Bram Moolenaar <Bram@vim.org>
parents:
18753
diff
changeset
|
345 # ifdef VMS |
22f0dda71638
patch 8.2.0320: no Haiku support
Bram Moolenaar <Bram@vim.org>
parents:
18753
diff
changeset
|
346 # define DFLT_RUNTIMEPATH "sys$login:vimfiles,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,sys$login:vimfiles/after" |
22f0dda71638
patch 8.2.0320: no Haiku support
Bram Moolenaar <Bram@vim.org>
parents:
18753
diff
changeset
|
347 # define CLEAN_RUNTIMEPATH "$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after" |
22f0dda71638
patch 8.2.0320: no Haiku support
Bram Moolenaar <Bram@vim.org>
parents:
18753
diff
changeset
|
348 # else |
22f0dda71638
patch 8.2.0320: no Haiku support
Bram Moolenaar <Bram@vim.org>
parents:
18753
diff
changeset
|
349 # ifdef RUNTIME_GLOBAL |
22f0dda71638
patch 8.2.0320: no Haiku support
Bram Moolenaar <Bram@vim.org>
parents:
18753
diff
changeset
|
350 # ifdef RUNTIME_GLOBAL_AFTER |
22f0dda71638
patch 8.2.0320: no Haiku support
Bram Moolenaar <Bram@vim.org>
parents:
18753
diff
changeset
|
351 # define DFLT_RUNTIMEPATH "~/.vim," RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL_AFTER ",~/.vim/after" |
22f0dda71638
patch 8.2.0320: no Haiku support
Bram Moolenaar <Bram@vim.org>
parents:
18753
diff
changeset
|
352 # define CLEAN_RUNTIMEPATH RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL_AFTER |
22f0dda71638
patch 8.2.0320: no Haiku support
Bram Moolenaar <Bram@vim.org>
parents:
18753
diff
changeset
|
353 # else |
22f0dda71638
patch 8.2.0320: no Haiku support
Bram Moolenaar <Bram@vim.org>
parents:
18753
diff
changeset
|
354 # define DFLT_RUNTIMEPATH "~/.vim," RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL "/after,~/.vim/after" |
22f0dda71638
patch 8.2.0320: no Haiku support
Bram Moolenaar <Bram@vim.org>
parents:
18753
diff
changeset
|
355 # define CLEAN_RUNTIMEPATH RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL "/after" |
22f0dda71638
patch 8.2.0320: no Haiku support
Bram Moolenaar <Bram@vim.org>
parents:
18753
diff
changeset
|
356 # endif |
15205
54d2905bd5ab
patch 8.1.0612: cannot use two global runtime dirs with configure
Bram Moolenaar <Bram@vim.org>
parents:
14509
diff
changeset
|
357 # else |
19526
22f0dda71638
patch 8.2.0320: no Haiku support
Bram Moolenaar <Bram@vim.org>
parents:
18753
diff
changeset
|
358 # define DFLT_RUNTIMEPATH "~/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,~/.vim/after" |
22f0dda71638
patch 8.2.0320: no Haiku support
Bram Moolenaar <Bram@vim.org>
parents:
18753
diff
changeset
|
359 # define CLEAN_RUNTIMEPATH "$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after" |
15205
54d2905bd5ab
patch 8.1.0612: cannot use two global runtime dirs with configure
Bram Moolenaar <Bram@vim.org>
parents:
14509
diff
changeset
|
360 # endif |
7 | 361 # endif |
19526
22f0dda71638
patch 8.2.0320: no Haiku support
Bram Moolenaar <Bram@vim.org>
parents:
18753
diff
changeset
|
362 |
7 | 363 #endif |
364 | |
7408
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
365 #ifdef VMS |
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
366 # ifndef VAX |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
367 # define VMS_TEMPNAM // to fix default .LIS extension |
7408
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
368 # endif |
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
369 # define TEMPNAME "TMP:v?XXXXXX.txt" |
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
370 # define TEMPNAMELEN 28 |
7 | 371 #else |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
372 // Try several directories to put the temp files. |
7408
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
373 # define TEMPDIRNAMES "$TMPDIR", "/tmp", ".", "$HOME" |
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
374 # define TEMPNAMELEN 256 |
7 | 375 #endif |
376 | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
377 // Special wildcards that need to be handled by the shell |
7 | 378 #define SPECIAL_WILDCHAR "`'{" |
379 | |
380 /* | |
381 * Unix has plenty of memory, use large buffers | |
382 */ | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
383 #define CMDBUFFSIZE 1024 // size of the command processing buffer |
1611 | 384 |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
385 // Use the system path length if it makes sense. |
1611 | 386 #if defined(PATH_MAX) && (PATH_MAX > 1000) |
387 # define MAXPATHL PATH_MAX | |
388 #else | |
389 # define MAXPATHL 1024 | |
390 #endif | |
7 | 391 |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
392 #define CHECK_INODE // used when checking if a swap file already |
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
393 // exists for a file |
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
394 #ifdef VMS // Use less memory because of older systems |
7 | 395 # ifndef DFLT_MAXMEM |
396 # define DFLT_MAXMEM (2*1024) | |
397 # endif | |
398 # ifndef DFLT_MAXMEMTOT | |
399 # define DFLT_MAXMEMTOT (5*1024) | |
400 # endif | |
401 #else | |
402 # ifndef DFLT_MAXMEM | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
403 # define DFLT_MAXMEM (5*1024) // use up to 5 Mbyte for a buffer |
7 | 404 # endif |
405 # ifndef DFLT_MAXMEMTOT | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
406 # define DFLT_MAXMEMTOT (10*1024) // use up to 10 Mbyte for Vim |
7 | 407 # endif |
408 #endif | |
409 | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
410 // memmove() is not present on all systems, use memmove, bcopy or memcpy. |
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
411 // Some systems have (void *) arguments, some (char *). If we use (char *) it |
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
412 // works for all |
10702
24a1fbd78b76
patch 8.0.0241: fallback implementation of mch_memmove is unused
Christian Brabandt <cb@256bit.org>
parents:
10328
diff
changeset
|
413 #if defined(USEMEMMOVE) || (!defined(USEBCOPY) && !defined(USEMEMCPY)) |
7 | 414 # define mch_memmove(to, from, len) memmove((char *)(to), (char *)(from), len) |
415 #else | |
416 # ifdef USEBCOPY | |
417 # define mch_memmove(to, from, len) bcopy((char *)(from), (char *)(to), len) | |
418 # else | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
419 // ifdef USEMEMCPY |
7 | 420 # define mch_memmove(to, from, len) memcpy((char *)(to), (char *)(from), len) |
421 # endif | |
422 #endif | |
423 | |
424 #ifndef PROTO | |
425 # ifdef HAVE_RENAME | |
426 # define mch_rename(src, dst) rename(src, dst) | |
427 # else | |
7807
1a5d34492798
commit https://github.com/vim/vim/commit/d99df423c559d85c17779b3685426c489554908c
Christian Brabandt <cb@256bit.org>
parents:
7598
diff
changeset
|
428 int mch_rename(const char *src, const char *dest); |
7 | 429 # endif |
430 # ifndef VMS | |
431 # ifdef __MVS__ | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
432 // on OS390 Unix getenv() doesn't return a pointer to persistent |
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
433 // storage -> use __getenv() |
7 | 434 # define mch_getenv(x) (char_u *)__getenv((char *)(x)) |
435 # else | |
436 # define mch_getenv(x) (char_u *)getenv((char *)(x)) | |
437 # endif | |
438 # define mch_setenv(name, val, x) setenv(name, val, x) | |
439 # endif | |
440 #endif | |
441 | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
442 // Note: Some systems need both string.h and strings.h (Savage). However, |
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
443 // some systems can't handle both, only use string.h in that case. |
7 | 444 #ifdef HAVE_STRING_H |
445 # include <string.h> | |
446 #endif | |
447 #if defined(HAVE_STRINGS_H) && !defined(NO_STRINGS_WITH_STRING_H) | |
448 # include <strings.h> | |
449 #endif | |
450 | |
451 #if defined(HAVE_SETJMP_H) | |
452 # include <setjmp.h> | |
453 # ifdef HAVE_SIGSETJMP | |
454 # define JMP_BUF sigjmp_buf | |
455 # define SETJMP(x) sigsetjmp((x), 1) | |
456 # define LONGJMP siglongjmp | |
457 # else | |
458 # define JMP_BUF jmp_buf | |
459 # define SETJMP(x) setjmp(x) | |
460 # define LONGJMP longjmp | |
461 # endif | |
462 #endif | |
463 | |
5743 | 464 #ifndef HAVE_DUP |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
465 # define HAVE_DUP // have dup() |
5743 | 466 #endif |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
467 #define HAVE_ST_MODE // have stat.st_mode |
7 | 468 |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
469 // We have three kinds of ACL support. |
7 | 470 #define HAVE_ACL (HAVE_POSIX_ACL || HAVE_SOLARIS_ACL || HAVE_AIX_ACL) |