Mercurial > vim
annotate src/os_unix.h @ 26032:162ef12a3b5f v8.2.3550
patch 8.2.3550: completion() does not work properly
Commit: https://github.com/vim/vim/commit/ae38a9db7770b38889fbf06908cc69d42b463a73
Author: Shougo Matsushita <Shougo.Matsu@gmail.com>
Date: Thu Oct 21 11:39:53 2021 +0100
patch 8.2.3550: completion() does not work properly
Problem: completion() does not work properly.
Solution: Set xp_line and add WILD_HOME_REPLACE. (Shougo Matsushita,
closes #9016)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 21 Oct 2021 12:45:04 +0200 |
parents | 3f5f25f7d8a2 |
children | 1690417aeafe |
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 | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
91 // List 3 arg systems here. I guess __sgi, please test and correct me. jw. |
7 | 92 #if defined(__sgi) && defined(HAVE_SIGCONTEXT) |
93 # define SIGHAS3ARGS | |
94 #endif | |
95 | |
96 #ifdef SIGHASARG | |
97 # ifdef SIGHAS3ARGS | |
98 # define SIGPROTOARG (int, int, struct sigcontext *) | |
25824
3f5f25f7d8a2
patch 8.2.3447: a couple of declarations are not ANSI C
Bram Moolenaar <Bram@vim.org>
parents:
23503
diff
changeset
|
99 # define SIGDEFARG(s) (int s, int sig2, struct sigcontext *scont) |
7 | 100 # define SIGDUMMYARG 0, 0, (struct sigcontext *)0 |
101 # else | |
102 # define SIGPROTOARG (int) | |
25824
3f5f25f7d8a2
patch 8.2.3447: a couple of declarations are not ANSI C
Bram Moolenaar <Bram@vim.org>
parents:
23503
diff
changeset
|
103 # define SIGDEFARG(s) (int s UNUSED) |
7 | 104 # define SIGDUMMYARG 0 |
105 # endif | |
106 #else | |
107 # define SIGPROTOARG (void) | |
108 # define SIGDEFARG(s) () | |
109 # define SIGDUMMYARG | |
110 #endif | |
111 | |
112 #ifdef HAVE_DIRENT_H | |
113 # include <dirent.h> | |
114 # ifndef NAMLEN | |
115 # define NAMLEN(dirent) strlen((dirent)->d_name) | |
116 # endif | |
117 #else | |
118 # define dirent direct | |
119 # define NAMLEN(dirent) (dirent)->d_namlen | |
120 # if HAVE_SYS_NDIR_H | |
121 # include <sys/ndir.h> | |
122 # endif | |
123 # if HAVE_SYS_DIR_H | |
124 # include <sys/dir.h> | |
125 # endif | |
126 # if HAVE_NDIR_H | |
127 # include <ndir.h> | |
128 # endif | |
129 #endif | |
130 | |
18669
9007e9896303
patch 8.1.2326: cannot parse a date/time string
Bram Moolenaar <Bram@vim.org>
parents:
17978
diff
changeset
|
131 // on some systems time.h should not be included together with sys/time.h |
7 | 132 #if !defined(HAVE_SYS_TIME_H) || defined(TIME_WITH_SYS_TIME) |
18669
9007e9896303
patch 8.1.2326: cannot parse a date/time string
Bram Moolenaar <Bram@vim.org>
parents:
17978
diff
changeset
|
133 # include <time.h> |
7 | 134 #endif |
135 #ifdef HAVE_SYS_TIME_H | |
136 # include <sys/time.h> | |
137 #endif | |
138 | |
139 #include <signal.h> | |
140 | |
141 #if defined(DIRSIZ) && !defined(MAXNAMLEN) | |
142 # define MAXNAMLEN DIRSIZ | |
143 #endif | |
144 | |
145 #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
|
146 # define MAXNAMLEN UFS_MAXNAMLEN // for dynix/ptx |
7 | 147 #endif |
148 | |
149 #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
|
150 # define MAXNAMLEN NAME_MAX // for Linux before .99p3 |
7 | 151 #endif |
152 | |
153 /* | |
154 * Note: if MAXNAMLEN has the wrong value, you will get error messages | |
155 * for not being able to open the swap file. | |
156 */ | |
157 #if !defined(MAXNAMLEN) | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
158 # define MAXNAMLEN 512 // for all other Unix |
7 | 159 #endif |
160 | |
161 #define BASENAMELEN (MAXNAMLEN - 5) | |
162 | |
163 #ifdef HAVE_PWD_H | |
164 # include <pwd.h> | |
165 #endif | |
166 | |
167 #if (defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT)) \ | |
168 || (defined(HAVE_SYS_SYSINFO_H) && defined(HAVE_SYSINFO)) \ | |
169 || defined(HAVE_SYSCTL) || defined(HAVE_SYSCONF) | |
170 # define HAVE_TOTAL_MEM | |
171 #endif | |
172 | |
3927 | 173 |
174 #ifndef PROTO | |
175 | |
7 | 176 #ifdef VMS |
819 | 177 # include <unixio.h> |
178 # include <unixlib.h> | |
179 # include <signal.h> | |
180 # include <file.h> | |
181 # include <ssdef.h> | |
182 # include <descrip.h> | |
183 # include <libclidef.h> | |
184 # include <lnmdef.h> | |
185 # include <psldef.h> | |
186 # include <prvdef.h> | |
187 # include <dvidef.h> | |
188 # include <dcdef.h> | |
189 # include <stsdef.h> | |
190 # include <iodef.h> | |
191 # include <ttdef.h> | |
192 # include <tt2def.h> | |
193 # include <jpidef.h> | |
194 # include <rms.h> | |
195 # include <trmdef.h> | |
196 # include <string.h> | |
197 # include <starlet.h> | |
198 # include <socket.h> | |
199 # include <lib$routines.h> | |
5541 | 200 # include <libdef.h> |
201 # include <libdtdef.h> | |
819 | 202 |
23408
bdda90ed5f6c
patch 8.2.2247: VMS: various smaller problems
Bram Moolenaar <Bram@vim.org>
parents:
20311
diff
changeset
|
203 # if defined(FEAT_GUI_MOTIF) |
bdda90ed5f6c
patch 8.2.2247: VMS: various smaller problems
Bram Moolenaar <Bram@vim.org>
parents:
20311
diff
changeset
|
204 # define XFree XFREE |
bdda90ed5f6c
patch 8.2.2247: VMS: various smaller problems
Bram Moolenaar <Bram@vim.org>
parents:
20311
diff
changeset
|
205 # define XmRepTypeInstallTearOffModelCon XMREPTYPEINSTALLTEAROFFMODELCON |
819 | 206 # endif |
23408
bdda90ed5f6c
patch 8.2.2247: VMS: various smaller problems
Bram Moolenaar <Bram@vim.org>
parents:
20311
diff
changeset
|
207 #endif // VMS |
7 | 208 |
20311
05b4efb062a7
patch 8.2.0711: temp directory might be cleared
Bram Moolenaar <Bram@vim.org>
parents:
19526
diff
changeset
|
209 #ifdef HAVE_FLOCK |
05b4efb062a7
patch 8.2.0711: temp directory might be cleared
Bram Moolenaar <Bram@vim.org>
parents:
19526
diff
changeset
|
210 # include <sys/file.h> |
05b4efb062a7
patch 8.2.0711: temp directory might be cleared
Bram Moolenaar <Bram@vim.org>
parents:
19526
diff
changeset
|
211 #endif |
05b4efb062a7
patch 8.2.0711: temp directory might be cleared
Bram Moolenaar <Bram@vim.org>
parents:
19526
diff
changeset
|
212 |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
213 #endif // PROTO |
3927 | 214 |
215 #ifdef VMS | |
7 | 216 typedef struct dsc$descriptor DESC; |
217 #endif | |
218 | |
219 /* | |
220 * Unix system-dependent file names | |
221 */ | |
222 #ifndef SYS_VIMRC_FILE | |
223 # define SYS_VIMRC_FILE "$VIM/vimrc" | |
224 #endif | |
225 #ifndef SYS_GVIMRC_FILE | |
226 # define SYS_GVIMRC_FILE "$VIM/gvimrc" | |
227 #endif | |
228 #ifndef DFLT_HELPFILE | |
229 # define DFLT_HELPFILE "$VIMRUNTIME/doc/help.txt" | |
230 #endif | |
231 #ifndef FILETYPE_FILE | |
232 # define FILETYPE_FILE "filetype.vim" | |
233 #endif | |
234 #ifndef FTPLUGIN_FILE | |
235 # define FTPLUGIN_FILE "ftplugin.vim" | |
236 #endif | |
237 #ifndef INDENT_FILE | |
238 # define INDENT_FILE "indent.vim" | |
239 #endif | |
240 #ifndef FTOFF_FILE | |
241 # define FTOFF_FILE "ftoff.vim" | |
242 #endif | |
243 #ifndef FTPLUGOF_FILE | |
244 # define FTPLUGOF_FILE "ftplugof.vim" | |
245 #endif | |
246 #ifndef INDOFF_FILE | |
247 # define INDOFF_FILE "indoff.vim" | |
248 #endif | |
249 #ifndef SYS_MENU_FILE | |
250 # define SYS_MENU_FILE "$VIMRUNTIME/menu.vim" | |
251 #endif | |
252 | |
253 #ifndef USR_EXRC_FILE | |
254 # ifdef VMS | |
255 # define USR_EXRC_FILE "sys$login:.exrc" | |
256 # else | |
257 # define USR_EXRC_FILE "$HOME/.exrc" | |
258 # endif | |
259 #endif | |
260 | |
261 #if !defined(USR_EXRC_FILE2) && defined(VMS) | |
262 # define USR_EXRC_FILE2 "sys$login:_exrc" | |
263 #endif | |
264 | |
265 #ifndef USR_VIMRC_FILE | |
266 # ifdef VMS | |
267 # define USR_VIMRC_FILE "sys$login:.vimrc" | |
268 # else | |
269 # define USR_VIMRC_FILE "$HOME/.vimrc" | |
270 # endif | |
271 #endif | |
272 | |
4863
c4d4f0fc12b9
updated for version 7.3.1178
Bram Moolenaar <bram@vim.org>
parents:
3927
diff
changeset
|
273 |
6783 | 274 #if !defined(USR_VIMRC_FILE2) |
7408
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
275 # ifdef VMS |
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
276 # 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
|
277 # else |
7408
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
278 # define USR_VIMRC_FILE2 "~/.vim/vimrc" |
4863
c4d4f0fc12b9
updated for version 7.3.1178
Bram Moolenaar <bram@vim.org>
parents:
3927
diff
changeset
|
279 # endif |
7 | 280 #endif |
4863
c4d4f0fc12b9
updated for version 7.3.1178
Bram Moolenaar <bram@vim.org>
parents:
3927
diff
changeset
|
281 |
c4d4f0fc12b9
updated for version 7.3.1178
Bram Moolenaar <bram@vim.org>
parents:
3927
diff
changeset
|
282 #if !defined(USR_VIMRC_FILE3) && defined(VMS) |
c4d4f0fc12b9
updated for version 7.3.1178
Bram Moolenaar <bram@vim.org>
parents:
3927
diff
changeset
|
283 # define USR_VIMRC_FILE3 "sys$login:_vimrc" |
7 | 284 #endif |
285 | |
286 #ifndef USR_GVIMRC_FILE | |
287 # ifdef VMS | |
288 # define USR_GVIMRC_FILE "sys$login:.gvimrc" | |
289 # else | |
290 # define USR_GVIMRC_FILE "$HOME/.gvimrc" | |
291 # endif | |
292 #endif | |
293 | |
4863
c4d4f0fc12b9
updated for version 7.3.1178
Bram Moolenaar <bram@vim.org>
parents:
3927
diff
changeset
|
294 #ifndef USR_GVIMRC_FILE2 |
7408
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
295 # ifdef VMS |
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
296 # 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
|
297 # else |
7408
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
298 # define USR_GVIMRC_FILE2 "~/.vim/gvimrc" |
4863
c4d4f0fc12b9
updated for version 7.3.1178
Bram Moolenaar <bram@vim.org>
parents:
3927
diff
changeset
|
299 # endif |
c4d4f0fc12b9
updated for version 7.3.1178
Bram Moolenaar <bram@vim.org>
parents:
3927
diff
changeset
|
300 #endif |
c4d4f0fc12b9
updated for version 7.3.1178
Bram Moolenaar <bram@vim.org>
parents:
3927
diff
changeset
|
301 |
7 | 302 #ifdef VMS |
4863
c4d4f0fc12b9
updated for version 7.3.1178
Bram Moolenaar <bram@vim.org>
parents:
3927
diff
changeset
|
303 # ifndef USR_GVIMRC_FILE3 |
c4d4f0fc12b9
updated for version 7.3.1178
Bram Moolenaar <bram@vim.org>
parents:
3927
diff
changeset
|
304 # define USR_GVIMRC_FILE3 "sys$login:_gvimrc" |
7 | 305 # endif |
306 #endif | |
307 | |
9669
284b4eb307fc
commit https://github.com/vim/vim/commit/8c08b5b569e2a9e9f63dea514591ecfa2d3bb392
Christian Brabandt <cb@256bit.org>
parents:
9536
diff
changeset
|
308 #ifndef VIM_DEFAULTS_FILE |
284b4eb307fc
commit https://github.com/vim/vim/commit/8c08b5b569e2a9e9f63dea514591ecfa2d3bb392
Christian Brabandt <cb@256bit.org>
parents:
9536
diff
changeset
|
309 # 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
|
310 #endif |
284b4eb307fc
commit https://github.com/vim/vim/commit/8c08b5b569e2a9e9f63dea514591ecfa2d3bb392
Christian Brabandt <cb@256bit.org>
parents:
9536
diff
changeset
|
311 |
7 | 312 #ifndef EVIM_FILE |
313 # define EVIM_FILE "$VIMRUNTIME/evim.vim" | |
314 #endif | |
315 | |
316 #ifdef FEAT_VIMINFO | |
317 # ifndef VIMINFO_FILE | |
318 # ifdef VMS | |
319 # define VIMINFO_FILE "sys$login:.viminfo" | |
320 # else | |
321 # define VIMINFO_FILE "$HOME/.viminfo" | |
322 # endif | |
323 # endif | |
324 # if !defined(VIMINFO_FILE2) && defined(VMS) | |
325 # define VIMINFO_FILE2 "sys$login:_viminfo" | |
326 # endif | |
327 #endif | |
328 | |
329 #ifndef EXRC_FILE | |
330 # define EXRC_FILE ".exrc" | |
331 #endif | |
332 | |
333 #ifndef VIMRC_FILE | |
334 # define VIMRC_FILE ".vimrc" | |
335 #endif | |
336 | |
337 #ifdef FEAT_GUI | |
338 # ifndef GVIMRC_FILE | |
339 # define GVIMRC_FILE ".gvimrc" | |
340 # endif | |
341 #endif | |
342 | |
343 #ifndef SYNTAX_FNAME | |
344 # define SYNTAX_FNAME "$VIMRUNTIME/syntax/%s.vim" | |
345 #endif | |
346 | |
347 #ifndef DFLT_BDIR | |
7408
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
348 # ifdef VMS |
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
349 # define DFLT_BDIR "./,sys$login:,tmp:" |
7 | 350 # else |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
351 # define DFLT_BDIR ".,~/tmp,~/" // default for 'backupdir' |
7 | 352 # endif |
353 #endif | |
354 | |
355 #ifndef DFLT_DIR | |
7408
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
356 # ifdef VMS |
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
357 # define DFLT_DIR "./,sys$login:,tmp:" |
7 | 358 # else |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
359 # define DFLT_DIR ".,~/tmp,/var/tmp,/tmp" // default for 'directory' |
7 | 360 # endif |
361 #endif | |
362 | |
363 #ifndef DFLT_VDIR | |
7408
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
364 # ifdef VMS |
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
365 # define DFLT_VDIR "sys$login:vimfiles/view" |
7 | 366 # else |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
367 # define DFLT_VDIR "$HOME/.vim/view" // default for 'viewdir' |
7 | 368 # endif |
369 #endif | |
370 | |
371 #define DFLT_ERRORFILE "errors.err" | |
372 | |
19526
22f0dda71638
patch 8.2.0320: no Haiku support
Bram Moolenaar <Bram@vim.org>
parents:
18753
diff
changeset
|
373 #ifndef DFLT_RUNTIMEPATH |
22f0dda71638
patch 8.2.0320: no Haiku support
Bram Moolenaar <Bram@vim.org>
parents:
18753
diff
changeset
|
374 |
22f0dda71638
patch 8.2.0320: no Haiku support
Bram Moolenaar <Bram@vim.org>
parents:
18753
diff
changeset
|
375 # ifdef VMS |
22f0dda71638
patch 8.2.0320: no Haiku support
Bram Moolenaar <Bram@vim.org>
parents:
18753
diff
changeset
|
376 # 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
|
377 # 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
|
378 # else |
22f0dda71638
patch 8.2.0320: no Haiku support
Bram Moolenaar <Bram@vim.org>
parents:
18753
diff
changeset
|
379 # ifdef RUNTIME_GLOBAL |
22f0dda71638
patch 8.2.0320: no Haiku support
Bram Moolenaar <Bram@vim.org>
parents:
18753
diff
changeset
|
380 # ifdef RUNTIME_GLOBAL_AFTER |
22f0dda71638
patch 8.2.0320: no Haiku support
Bram Moolenaar <Bram@vim.org>
parents:
18753
diff
changeset
|
381 # 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
|
382 # 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
|
383 # else |
22f0dda71638
patch 8.2.0320: no Haiku support
Bram Moolenaar <Bram@vim.org>
parents:
18753
diff
changeset
|
384 # 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
|
385 # 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
|
386 # endif |
15205
54d2905bd5ab
patch 8.1.0612: cannot use two global runtime dirs with configure
Bram Moolenaar <Bram@vim.org>
parents:
14509
diff
changeset
|
387 # else |
19526
22f0dda71638
patch 8.2.0320: no Haiku support
Bram Moolenaar <Bram@vim.org>
parents:
18753
diff
changeset
|
388 # 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
|
389 # 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
|
390 # endif |
7 | 391 # endif |
19526
22f0dda71638
patch 8.2.0320: no Haiku support
Bram Moolenaar <Bram@vim.org>
parents:
18753
diff
changeset
|
392 |
7 | 393 #endif |
394 | |
7408
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
395 #ifdef VMS |
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
396 # ifndef VAX |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
397 # 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
|
398 # endif |
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
399 # define TEMPNAME "TMP:v?XXXXXX.txt" |
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
400 # define TEMPNAMELEN 28 |
7 | 401 #else |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
402 // 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
|
403 # define TEMPDIRNAMES "$TMPDIR", "/tmp", ".", "$HOME" |
1886f2863437
commit https://github.com/vim/vim/commit/e7fedb6ebe72d9a475aa65109b77d5ed4667067a
Christian Brabandt <cb@256bit.org>
parents:
6783
diff
changeset
|
404 # define TEMPNAMELEN 256 |
7 | 405 #endif |
406 | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
407 // Special wildcards that need to be handled by the shell |
7 | 408 #define SPECIAL_WILDCHAR "`'{" |
409 | |
410 /* | |
411 * Unix has plenty of memory, use large buffers | |
412 */ | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
413 #define CMDBUFFSIZE 1024 // size of the command processing buffer |
1611 | 414 |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
415 // Use the system path length if it makes sense. |
1611 | 416 #if defined(PATH_MAX) && (PATH_MAX > 1000) |
417 # define MAXPATHL PATH_MAX | |
418 #else | |
419 # define MAXPATHL 1024 | |
420 #endif | |
7 | 421 |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
422 #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
|
423 // exists for a file |
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
424 #ifdef VMS // Use less memory because of older systems |
7 | 425 # ifndef DFLT_MAXMEM |
426 # define DFLT_MAXMEM (2*1024) | |
427 # endif | |
428 # ifndef DFLT_MAXMEMTOT | |
429 # define DFLT_MAXMEMTOT (5*1024) | |
430 # endif | |
431 #else | |
432 # ifndef DFLT_MAXMEM | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
433 # define DFLT_MAXMEM (5*1024) // use up to 5 Mbyte for a buffer |
7 | 434 # endif |
435 # ifndef DFLT_MAXMEMTOT | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
436 # define DFLT_MAXMEMTOT (10*1024) // use up to 10 Mbyte for Vim |
7 | 437 # endif |
438 #endif | |
439 | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
440 // 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
|
441 // 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
|
442 // 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
|
443 #if defined(USEMEMMOVE) || (!defined(USEBCOPY) && !defined(USEMEMCPY)) |
7 | 444 # define mch_memmove(to, from, len) memmove((char *)(to), (char *)(from), len) |
445 #else | |
446 # ifdef USEBCOPY | |
447 # define mch_memmove(to, from, len) bcopy((char *)(from), (char *)(to), len) | |
448 # else | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
449 // ifdef USEMEMCPY |
7 | 450 # define mch_memmove(to, from, len) memcpy((char *)(to), (char *)(from), len) |
451 # endif | |
452 #endif | |
453 | |
454 #ifndef PROTO | |
455 # ifdef HAVE_RENAME | |
456 # define mch_rename(src, dst) rename(src, dst) | |
457 # else | |
7807
1a5d34492798
commit https://github.com/vim/vim/commit/d99df423c559d85c17779b3685426c489554908c
Christian Brabandt <cb@256bit.org>
parents:
7598
diff
changeset
|
458 int mch_rename(const char *src, const char *dest); |
7 | 459 # endif |
460 # ifndef VMS | |
461 # ifdef __MVS__ | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
462 // 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
|
463 // storage -> use __getenv() |
7 | 464 # define mch_getenv(x) (char_u *)__getenv((char *)(x)) |
465 # else | |
466 # define mch_getenv(x) (char_u *)getenv((char *)(x)) | |
467 # endif | |
468 # define mch_setenv(name, val, x) setenv(name, val, x) | |
469 # endif | |
470 #endif | |
471 | |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
472 // 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
|
473 // some systems can't handle both, only use string.h in that case. |
7 | 474 #ifdef HAVE_STRING_H |
475 # include <string.h> | |
476 #endif | |
477 #if defined(HAVE_STRINGS_H) && !defined(NO_STRINGS_WITH_STRING_H) | |
478 # include <strings.h> | |
479 #endif | |
480 | |
481 #if defined(HAVE_SETJMP_H) | |
482 # include <setjmp.h> | |
483 # ifdef HAVE_SIGSETJMP | |
484 # define JMP_BUF sigjmp_buf | |
485 # define SETJMP(x) sigsetjmp((x), 1) | |
486 # define LONGJMP siglongjmp | |
487 # else | |
488 # define JMP_BUF jmp_buf | |
489 # define SETJMP(x) setjmp(x) | |
490 # define LONGJMP longjmp | |
491 # endif | |
492 #endif | |
493 | |
5743 | 494 #ifndef HAVE_DUP |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
495 # define HAVE_DUP // have dup() |
5743 | 496 #endif |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
497 #define HAVE_ST_MODE // have stat.st_mode |
7 | 498 |
18753
6e3dc2d630c2
patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
18705
diff
changeset
|
499 // We have three kinds of ACL support. |
7 | 500 #define HAVE_ACL (HAVE_POSIX_ACL || HAVE_SOLARIS_ACL || HAVE_AIX_ACL) |