xref: /freebsd/contrib/less/cmd.h (revision 2be1a816b9ff69588e55be0a84cbe2a31efc0f2f)
1 /*
2  * Copyright (C) 1984-2007  Mark Nudelman
3  *
4  * You may distribute under the terms of either the GNU General Public
5  * License or the Less License, as specified in the README file.
6  *
7  * For more information about less, or for information on how to
8  * contact the author, see the README file.
9  */
10 
11 
12 #define	MAX_USERCMD		500
13 #define	MAX_CMDLEN		16
14 
15 #define	A_B_LINE		2
16 #define	A_B_SCREEN		3
17 #define	A_B_SCROLL		4
18 #define	A_B_SEARCH		5
19 #define	A_DIGIT			6
20 #define	A_DISP_OPTION		7
21 #define	A_DEBUG			8
22 #define	A_EXAMINE		9
23 #define	A_FIRSTCMD		10
24 #define	A_FREPAINT		11
25 #define	A_F_LINE		12
26 #define	A_F_SCREEN		13
27 #define	A_F_SCROLL		14
28 #define	A_F_SEARCH		15
29 #define	A_GOEND			16
30 #define	A_GOLINE		17
31 #define	A_GOMARK		18
32 #define	A_HELP			19
33 #define	A_NEXT_FILE		20
34 #define	A_PERCENT		21
35 #define	A_PREFIX		22
36 #define	A_PREV_FILE		23
37 #define	A_QUIT			24
38 #define	A_REPAINT		25
39 #define	A_SETMARK		26
40 #define	A_SHELL			27
41 #define	A_STAT			28
42 #define	A_FF_LINE		29
43 #define	A_BF_LINE		30
44 #define	A_VERSION		31
45 #define	A_VISUAL		32
46 #define	A_F_WINDOW		33
47 #define	A_B_WINDOW		34
48 #define	A_F_BRACKET		35
49 #define	A_B_BRACKET		36
50 #define	A_PIPE			37
51 #define	A_INDEX_FILE		38
52 #define	A_UNDO_SEARCH		39
53 #define	A_FF_SCREEN		40
54 #define	A_LSHIFT		41
55 #define	A_RSHIFT		42
56 #define	A_AGAIN_SEARCH		43
57 #define	A_T_AGAIN_SEARCH	44
58 #define	A_REVERSE_SEARCH	45
59 #define	A_T_REVERSE_SEARCH	46
60 #define	A_OPT_TOGGLE		47
61 #define	A_OPT_SET		48
62 #define	A_OPT_UNSET		49
63 #define	A_F_FOREVER		50
64 #define	A_GOPOS			51
65 #define	A_REMOVE_FILE		52
66 #define	A_NEXT_TAG		53
67 #define	A_PREV_TAG		54
68 
69 #define	A_INVALID		100
70 #define	A_NOACTION		101
71 #define	A_UINVALID		102
72 #define	A_END_LIST		103
73 #define	A_SPECIAL_KEY		104
74 
75 #define A_SKIP			127
76 
77 #define	A_EXTRA			0200
78 
79 
80 /* Line editting characters */
81 
82 #define	EC_BACKSPACE	1
83 #define	EC_LINEKILL	2
84 #define	EC_RIGHT	3
85 #define	EC_LEFT		4
86 #define	EC_W_LEFT	5
87 #define	EC_W_RIGHT	6
88 #define	EC_INSERT 	7
89 #define	EC_DELETE	8
90 #define	EC_HOME		9
91 #define	EC_END		10
92 #define	EC_W_BACKSPACE	11
93 #define	EC_W_DELETE	12
94 #define	EC_UP		13
95 #define	EC_DOWN		14
96 #define	EC_EXPAND	15
97 #define	EC_F_COMPLETE	17
98 #define	EC_B_COMPLETE	18
99 #define	EC_LITERAL	19
100 
101 #define	EC_NOACTION	101
102 #define	EC_UINVALID	102
103 
104 /* Flags for editchar() */
105 #define	EC_PEEK		01
106 #define	EC_NOHISTORY	02
107 #define	EC_NOCOMPLETE	04
108 #define	EC_NORIGHTLEFT	010
109 
110 /* Environment variable stuff */
111 #define	EV_OK		01
112 
113 /* Special keys (keys which output different strings on different terminals) */
114 #define SK_SPECIAL_KEY		CONTROL('K')
115 #define SK_RIGHT_ARROW		1
116 #define SK_LEFT_ARROW		2
117 #define SK_UP_ARROW		3
118 #define SK_DOWN_ARROW		4
119 #define SK_PAGE_UP		5
120 #define SK_PAGE_DOWN		6
121 #define SK_HOME			7
122 #define SK_END			8
123 #define SK_DELETE		9
124 #define SK_INSERT		10
125 #define SK_CTL_LEFT_ARROW	11
126 #define SK_CTL_RIGHT_ARROW	12
127 #define SK_CTL_DELETE		13
128 #define SK_F1			14
129 #define SK_BACKTAB		15
130 #define SK_CTL_BACKSPACE	16
131 #define SK_CONTROL_K		40
132