annotate src/os_unixx.h @ 32043:6095218c9056 v9.0.1353

patch 9.0.1353: too many "else if" statements to handle option values Commit: https://github.com/vim/vim/commit/6d611de58c8e324491415da8e79c6bd3faa3e848 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Sat Feb 25 11:59:33 2023 +0000 patch 9.0.1353: too many "else if" statements to handle option values Problem: Too many "else if" statements to handle option values. Solution: Add more functions to handle option value changes. (Yegappan Lakshmanan, closes #12058)
author Bram Moolenaar <Bram@vim.org>
date Sat, 25 Feb 2023 13:00:05 +0100
parents f37028184d6a
children c0b3e3c7786c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10042
4aead6a9b7a9 commit https://github.com/vim/vim/commit/edf3f97ae2af024708ebb4ac614227327033ca47
Christian Brabandt <cb@256bit.org>
parents: 2109
diff changeset
1 /* vi:set ts=8 sts=4 sw=4 noet:
7
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 * os_unixx.h -- include files that are only used in os_unix.c
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 * Stuff for signals
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 #if defined(HAVE_SIGSET) && !defined(signal)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 # define signal sigset
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
18753
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10914
diff changeset
20 // Sun's sys/ioctl.h redefines symbols from termio world
10460
7fd589f46801 commit https://github.com/vim/vim/commit/a899e6ecc4523c7e411eaf6fbaa4197d70f6f39e
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
21 #if defined(HAVE_SYS_IOCTL_H) && !defined(SUN_SYSTEM)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 # include <sys/ioctl.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24
18753
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10914
diff changeset
25 #ifndef USE_SYSTEM // use fork/exec to start the shell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 # if defined(HAVE_SYS_WAIT_H) || defined(HAVE_UNION_WAIT)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 # include <sys/wait.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 # ifndef WEXITSTATUS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 # ifdef HAVE_UNION_WAIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 # define WEXITSTATUS(stat_val) ((stat_val).w_T.w_Retcode)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 # else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 # define WEXITSTATUS(stat_val) (((stat_val) >> 8) & 0377)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 # ifndef WIFEXITED
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 # ifdef HAVE_UNION_WAIT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 # define WIFEXITED(stat_val) ((stat_val).w_T.w_Termsig == 0)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 # else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 # define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46
18753
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10914
diff changeset
47 #endif // !USE_SYSTEM
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 #ifdef HAVE_STROPTS_H
19816
f37028184d6a patch 8.2.0464: typos and other small problems
Bram Moolenaar <Bram@vim.org>
parents: 18753
diff changeset
50 # ifdef sinix
f37028184d6a patch 8.2.0464: typos and other small problems
Bram Moolenaar <Bram@vim.org>
parents: 18753
diff changeset
51 # define buf_T __system_buf_t__
f37028184d6a patch 8.2.0464: typos and other small problems
Bram Moolenaar <Bram@vim.org>
parents: 18753
diff changeset
52 # endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 # include <stropts.h>
19816
f37028184d6a patch 8.2.0464: typos and other small problems
Bram Moolenaar <Bram@vim.org>
parents: 18753
diff changeset
54 # ifdef sinix
f37028184d6a patch 8.2.0464: typos and other small problems
Bram Moolenaar <Bram@vim.org>
parents: 18753
diff changeset
55 # undef buf_T
f37028184d6a patch 8.2.0464: typos and other small problems
Bram Moolenaar <Bram@vim.org>
parents: 18753
diff changeset
56 # endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 #ifdef HAVE_STRING_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 # include <string.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 #ifdef HAVE_SYS_STREAM_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 # include <sys/stream.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 #ifdef HAVE_SYS_UTSNAME_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 # include <sys/utsname.h>
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 #ifdef HAVE_SYS_SYSTEMINFO_H
18753
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10914
diff changeset
72 // <sys/systeminfo.h> uses SYS_NMLN but it may not be defined (CrayT3E).
11
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
73 # ifndef SYS_NMLN
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
74 # define SYS_NMLN 32
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
75 # endif
4424b47a0797 updated for version 7.0003
vimboss
parents: 7
diff changeset
76
18753
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10914
diff changeset
77 # include <sys/systeminfo.h> // for sysinfo
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 * We use termios.h if both termios.h and termio.h are available.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 * Termios is supposed to be a superset of termio.h. Don't include them both,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 * it may give problems on some systems (e.g. hpux).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 * I don't understand why we don't want termios.h for apollo.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 #if defined(HAVE_TERMIOS_H) && !defined(apollo)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 # include <termios.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 #else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 # ifdef HAVE_TERMIO_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 # include <termio.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 # else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 # ifdef HAVE_SGTTY_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 # include <sgtty.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 #ifdef HAVE_SYS_PTEM_H
18753
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10914
diff changeset
99 # include <sys/ptem.h> // must be after termios.h for Sinix
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10914
diff changeset
100 # ifndef _IO_PTEM_H // For UnixWare that should check for _IO_PT_PTEM_H
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 # define _IO_PTEM_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104
18753
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10914
diff changeset
105 // shared library access
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 #if defined(HAVE_DLFCN_H) && defined(USE_DLOPEN)
10567
82c2c450dad0 patch 8.0.0173: build fails with EBCDIC defined
Christian Brabandt <cb@256bit.org>
parents: 10460
diff changeset
107 # if defined(__MVS__) && !defined (__SUSV3)
18753
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10914
diff changeset
108 // needed to define RTLD_LAZY (Anthony Giorgio)
802
c6245a087950 updated for version 7.0b01
vimboss
parents: 11
diff changeset
109 # define __SUSV3
c6245a087950 updated for version 7.0b01
vimboss
parents: 11
diff changeset
110 # endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 # include <dlfcn.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 #else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 # if defined(HAVE_DL_H) && defined(HAVE_SHL_LOAD)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 # include <dl.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 # endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 #endif