xref: /freebsd/contrib/less/cmd.h (revision c77c488926555ca344ae3a417544cf7a720e1de1)
1a5f0fb15SPaul Saab /*
2*c77c4889SXin LI  * Copyright (C) 1984-2024  Mark Nudelman
3a5f0fb15SPaul Saab  *
4a5f0fb15SPaul Saab  * You may distribute under the terms of either the GNU General Public
5a5f0fb15SPaul Saab  * License or the Less License, as specified in the README file.
6a5f0fb15SPaul Saab  *
796e55cc7SXin LI  * For more information, see the README file.
8a5f0fb15SPaul Saab  */
9a5f0fb15SPaul Saab 
10a5f0fb15SPaul Saab 
11e2449719SXin LI #define MAX_USERCMD            1000
12a5f0fb15SPaul Saab #define MAX_CMDLEN             16
13a5f0fb15SPaul Saab 
14a5f0fb15SPaul Saab #define A_B_LINE               2
15a5f0fb15SPaul Saab #define A_B_SCREEN             3
16a5f0fb15SPaul Saab #define A_B_SCROLL             4
17a5f0fb15SPaul Saab #define A_B_SEARCH             5
18a5f0fb15SPaul Saab #define A_DIGIT                6
19a5f0fb15SPaul Saab #define A_DISP_OPTION          7
20a5f0fb15SPaul Saab #define A_DEBUG                8
21a5f0fb15SPaul Saab #define A_EXAMINE              9
22a5f0fb15SPaul Saab #define A_FIRSTCMD             10
23a5f0fb15SPaul Saab #define A_FREPAINT             11
24a5f0fb15SPaul Saab #define A_F_LINE               12
25a5f0fb15SPaul Saab #define A_F_SCREEN             13
26a5f0fb15SPaul Saab #define A_F_SCROLL             14
27a5f0fb15SPaul Saab #define A_F_SEARCH             15
28a5f0fb15SPaul Saab #define A_GOEND                16
29a5f0fb15SPaul Saab #define A_GOLINE               17
30a5f0fb15SPaul Saab #define A_GOMARK               18
31a5f0fb15SPaul Saab #define A_HELP                 19
32a5f0fb15SPaul Saab #define A_NEXT_FILE            20
33a5f0fb15SPaul Saab #define A_PERCENT              21
34a5f0fb15SPaul Saab #define A_PREV_FILE            23
35a5f0fb15SPaul Saab #define A_QUIT                 24
36a5f0fb15SPaul Saab #define A_REPAINT              25
37a5f0fb15SPaul Saab #define A_SETMARK              26
38a5f0fb15SPaul Saab #define A_SHELL                27
39a5f0fb15SPaul Saab #define A_STAT                 28
40a5f0fb15SPaul Saab #define A_FF_LINE              29
41a5f0fb15SPaul Saab #define A_BF_LINE              30
42a5f0fb15SPaul Saab #define A_VERSION              31
43a5f0fb15SPaul Saab #define A_VISUAL               32
44a5f0fb15SPaul Saab #define A_F_WINDOW             33
45a5f0fb15SPaul Saab #define A_B_WINDOW             34
46a5f0fb15SPaul Saab #define A_F_BRACKET            35
47a5f0fb15SPaul Saab #define A_B_BRACKET            36
48a5f0fb15SPaul Saab #define A_PIPE                 37
49a5f0fb15SPaul Saab #define A_INDEX_FILE           38
50a5f0fb15SPaul Saab #define A_UNDO_SEARCH          39
51a5f0fb15SPaul Saab #define A_FF_SCREEN            40
52a5f0fb15SPaul Saab #define A_LSHIFT               41
53a5f0fb15SPaul Saab #define A_RSHIFT               42
54a5f0fb15SPaul Saab #define A_AGAIN_SEARCH         43
55a5f0fb15SPaul Saab #define A_T_AGAIN_SEARCH       44
56a5f0fb15SPaul Saab #define A_REVERSE_SEARCH       45
57a5f0fb15SPaul Saab #define A_T_REVERSE_SEARCH     46
58a5f0fb15SPaul Saab #define A_OPT_TOGGLE           47
59a5f0fb15SPaul Saab #define A_OPT_SET              48
60a5f0fb15SPaul Saab #define A_OPT_UNSET            49
61a5f0fb15SPaul Saab #define A_F_FOREVER            50
62a5f0fb15SPaul Saab #define A_GOPOS                51
63a5f0fb15SPaul Saab #define A_REMOVE_FILE          52
64c9346414SPaul Saab #define A_NEXT_TAG             53
65c9346414SPaul Saab #define A_PREV_TAG             54
667374caaaSXin LI #define A_FILTER               55
6796e55cc7SXin LI #define A_F_UNTIL_HILITE       56
68a15691bfSXin LI #define A_GOEND_BUF            57
69f6b74a7dSXin LI #define A_LLSHIFT              58
70f6b74a7dSXin LI #define A_RRSHIFT              59
71b2ea2440SXin LI #define A_CLRMARK              62
72b2ea2440SXin LI #define A_SETMARKBOT           63
73b7780dbeSXin LI #define A_X11MOUSE_IN          64
74b7780dbeSXin LI #define A_F_MOUSE              66
75b7780dbeSXin LI #define A_B_MOUSE              67
76b7780dbeSXin LI /* Note "X116" refers to extended (1006) X11 mouse reporting. */
77b7780dbeSXin LI #define A_X116MOUSE_IN         68
78d713e089SXin LI #define A_PSHELL               69
792235c7feSXin LI #define A_CLR_SEARCH           70
80*c77c4889SXin LI #define A_OSC8_F_SEARCH        71
81*c77c4889SXin LI #define A_OSC8_B_SEARCH        72
82*c77c4889SXin LI #define A_OSC8_OPEN            73
83*c77c4889SXin LI #define A_OSC8_JUMP            74
84a5f0fb15SPaul Saab 
852235c7feSXin LI /* These values must not conflict with any A_* or EC_* value. */
86a5f0fb15SPaul Saab #define A_INVALID              100
87a5f0fb15SPaul Saab #define A_NOACTION             101
88a5f0fb15SPaul Saab #define A_UINVALID             102
89a5f0fb15SPaul Saab #define A_END_LIST             103
90a5f0fb15SPaul Saab #define A_SPECIAL_KEY          104
912235c7feSXin LI #define A_PREFIX               105
92a5f0fb15SPaul Saab #define A_SKIP                 127
93a5f0fb15SPaul Saab 
94a5f0fb15SPaul Saab #define A_EXTRA                0200
95a5f0fb15SPaul Saab 
96a5f0fb15SPaul Saab 
9796e55cc7SXin LI /* Line editing characters */
98a5f0fb15SPaul Saab 
99a5f0fb15SPaul Saab #define EC_BACKSPACE           1
100a5f0fb15SPaul Saab #define EC_LINEKILL            2
101a5f0fb15SPaul Saab #define EC_RIGHT               3
102a5f0fb15SPaul Saab #define EC_LEFT                4
103a5f0fb15SPaul Saab #define EC_W_LEFT              5
104a5f0fb15SPaul Saab #define EC_W_RIGHT             6
105a5f0fb15SPaul Saab #define EC_INSERT              7
106a5f0fb15SPaul Saab #define EC_DELETE              8
107a5f0fb15SPaul Saab #define EC_HOME                9
108a5f0fb15SPaul Saab #define EC_END                 10
109a5f0fb15SPaul Saab #define EC_W_BACKSPACE         11
110a5f0fb15SPaul Saab #define EC_W_DELETE            12
111a5f0fb15SPaul Saab #define EC_UP                  13
112a5f0fb15SPaul Saab #define EC_DOWN                14
113a5f0fb15SPaul Saab #define EC_EXPAND              15
114a5f0fb15SPaul Saab #define EC_F_COMPLETE          17
115a5f0fb15SPaul Saab #define EC_B_COMPLETE          18
116a5f0fb15SPaul Saab #define EC_LITERAL             19
11733096f16SXin LI #define EC_ABORT               20
1182235c7feSXin LI #define EC_X11MOUSE            21
1192235c7feSXin LI #define EC_X116MOUSE           22
120a5f0fb15SPaul Saab 
121a5f0fb15SPaul Saab #define EC_UINVALID            102
122a5f0fb15SPaul Saab 
123a5f0fb15SPaul Saab /* Flags for editchar() */
1242235c7feSXin LI #define ECF_PEEK                01
1252235c7feSXin LI #define ECF_NOHISTORY           02
1262235c7feSXin LI #define ECF_NOCOMPLETE          04
1272235c7feSXin LI #define ECF_NORIGHTLEFT         010
128a5f0fb15SPaul Saab 
129a5f0fb15SPaul Saab /* Environment variable stuff */
130a5f0fb15SPaul Saab #define EV_OK                  01
131a5f0fb15SPaul Saab 
132a5f0fb15SPaul Saab /* Special keys (keys which output different strings on different terminals) */
133a5f0fb15SPaul Saab #define SK_SPECIAL_KEY         CONTROL('K')
134a5f0fb15SPaul Saab #define SK_RIGHT_ARROW         1
135a5f0fb15SPaul Saab #define SK_LEFT_ARROW          2
136a5f0fb15SPaul Saab #define SK_UP_ARROW            3
137a5f0fb15SPaul Saab #define SK_DOWN_ARROW          4
138a5f0fb15SPaul Saab #define SK_PAGE_UP             5
139a5f0fb15SPaul Saab #define SK_PAGE_DOWN           6
140a5f0fb15SPaul Saab #define SK_HOME                7
141a5f0fb15SPaul Saab #define SK_END                 8
142a5f0fb15SPaul Saab #define SK_DELETE              9
143a5f0fb15SPaul Saab #define SK_INSERT              10
144a5f0fb15SPaul Saab #define SK_CTL_LEFT_ARROW      11
145a5f0fb15SPaul Saab #define SK_CTL_RIGHT_ARROW     12
146a5f0fb15SPaul Saab #define SK_CTL_DELETE          13
147a5f0fb15SPaul Saab #define SK_F1                  14
148a5f0fb15SPaul Saab #define SK_BACKTAB             15
149a5f0fb15SPaul Saab #define SK_CTL_BACKSPACE       16
15095270f73SXin LI #define SK_BACKSPACE           17
151a5f0fb15SPaul Saab #define SK_CONTROL_K           40
152