annotate src/ascii.h @ 27782:40ae50de0d27 v8.2.4417

patch 8.2.4417: using NULL pointer Commit: https://github.com/vim/vim/commit/e89bfd212b21c227f026e467f882c62cdd6e642d Author: Bram Moolenaar <Bram@vim.org> Date: Fri Feb 18 18:34:45 2022 +0000 patch 8.2.4417: using NULL pointer Problem: Using NULL pointer. Solution: Set offset after checking for NULL pointer.
author Bram Moolenaar <Bram@vim.org>
date Fri, 18 Feb 2022 19:45:03 +0100
parents fb4c30606b4a
children
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: 6901
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 * Definitions of various common control characters.
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 #define CharOrd(x) ((x) < 'a' ? (x) - 'A' : (x) - 'a')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 #define CharOrdLow(x) ((x) - 'a')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 #define CharOrdUp(x) ((x) - 'A')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 #define ROT13(c, a) (((((c) - (a)) + 13) % 26) + (a))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 #define NUL '\000'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 #define BELL '\007'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 #define BS '\010'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 #define TAB '\011'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 #define NL '\012'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 #define NL_STR (char_u *)"\012"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 #define FF '\014'
18753
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
25 #define CAR '\015' // CR is used by Mac OS X
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 #define ESC '\033'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 #define ESC_STR (char_u *)"\033"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 #define ESC_STR_nc "\033"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 #define DEL 0x7f
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 #define DEL_STR (char_u *)"\177"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 #define POUND 0xA3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33
18753
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
34 #define Ctrl_chr(x) (TOUPPER_ASC(x) ^ 0x40) // '?' -> DEL, '@' -> ^@, etc.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 #define Meta(x) ((x) | 0x80)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 #define CTRL_F_STR "\006"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 #define CTRL_H_STR "\010"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 #define CTRL_V_STR "\026"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40
18753
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
41 #define Ctrl_AT 0 // @
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 #define Ctrl_A 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 #define Ctrl_B 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 #define Ctrl_C 3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 #define Ctrl_D 4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 #define Ctrl_E 5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 #define Ctrl_F 6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 #define Ctrl_G 7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 #define Ctrl_H 8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 #define Ctrl_I 9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 #define Ctrl_J 10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 #define Ctrl_K 11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 #define Ctrl_L 12
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 #define Ctrl_M 13
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 #define Ctrl_N 14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 #define Ctrl_O 15
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 #define Ctrl_P 16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 #define Ctrl_Q 17
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 #define Ctrl_R 18
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 #define Ctrl_S 19
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 #define Ctrl_T 20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 #define Ctrl_U 21
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 #define Ctrl_V 22
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 #define Ctrl_W 23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 #define Ctrl_X 24
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 #define Ctrl_Y 25
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 #define Ctrl_Z 26
18753
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
68 // CTRL- [ Left Square Bracket == ESC
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
69 #define Ctrl_BSL 28 // \ BackSLash
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
70 #define Ctrl_RSB 29 // ] Right Square Bracket
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
71 #define Ctrl_HAT 30 // ^
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 #define Ctrl__ 31
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73
18753
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
74 #define CSI 0x9b // Control Sequence Introducer
6901
2ce6b77a49de patch 7.4.770
Bram Moolenaar <bram@vim.org>
parents: 3227
diff changeset
75 #define CSI_STR "\233"
18753
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
76 #define DCS 0x90 // Device Control String
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
77 #define OSC 0x9d // Operating System Command
6e3dc2d630c2 patch 8.1.2366: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
78 #define STERM 0x9c // String Terminator
6901
2ce6b77a49de patch 7.4.770
Bram Moolenaar <bram@vim.org>
parents: 3227
diff changeset
79
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 * Character that separates dir names in a path.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 * For MS-DOS, WIN32 and OS/2 we use a backslash. A slash mostly works
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 * fine, but there are places where it doesn't (e.g. in a command name).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 * For Acorn we use a dot.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 #ifdef BACKSLASH_IN_FILENAME
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 # define PATHSEP psepc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 # define PATHSEPSTR pseps
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 #else
2823
8bd38abda314 updated for version 7.3.187
Bram Moolenaar <bram@vim.org>
parents: 720
diff changeset
90 # define PATHSEP '/'
8bd38abda314 updated for version 7.3.187
Bram Moolenaar <bram@vim.org>
parents: 720
diff changeset
91 # define PATHSEPSTR "/"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 #endif