-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathesc.h
269 lines (263 loc) · 8.55 KB
/
esc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
/* $Id: esc.h,v 1.80 2024/10/14 17:15:14 tom Exp $ */
#ifndef ESC_H
#define ESC_H 1
#define BEL 0007 /* ^G */
#define BS 0010 /* \b */
#define TAB 0011 /* \t */
#define LF 0012 /* \n */
#define CR 0015 /* \r */
#define SO 0016 /* 14 */
#define SI 0017 /* 15 */
#define ESC 0033
#define SS3 0217
#define DCS 0220
#define CSI 0233
#define ST 0234
#define OSC 0235
/*
* "ANSI" modes for DECRQM, DECRPM, SM and RM are a subset of the modes listed
* in ECMA-48. The ones noted as "non-DEC" are not implemented in any of
* DEC's terminals.
*/
#define GATM 1 /* guarded area transfer (disabled) */
#define KAM 2 /* keyboard action */
#define CRM 3 /* control representation (setup) */
#define IRM 4 /* insert/replace */
#define SRTM 5 /* status reporting transfer (disabled) */
#define ERM 6 /* erasure mode (non-DEC) */
#define VEM 7 /* vertical editing (disabled) */
#define BDSM 8 /* bi-directional support mode (non-DEC) */
#define DCSM 9 /* device component select mode (non-DEC) */
#define HEM 10 /* horizontal editing (disabled) */
#define PUM 11 /* positioning unit (disabled) */
#define SRM 12 /* send/receive */
#define FEAM 13 /* format effector action (disabled) */
#define FETM 14 /* format effector transfer (disabled) */
#define MATM 15 /* multiple area transfer (disabled) */
#define TTM 16 /* transfer termination (disabled) */
#define SATM 17 /* selected area transfer (disabled) */
#define TSM 18 /* tabulation stop (disabled) */
#define EBM 19 /* editing boundary (disabled) */
#define LNM 20 /* line feed/new line */
/* DEC private modes for DECRQM, DECRPM, SM and RM, based on list from
* VT520 reference manual, as well as dec_term_function_checklist.ps from
* Shuford's archive.
*/
#define DECCKM 1 /* cursor keys */
#define DECANM 2 /* ANSI */
#define DECCOLM 3 /* column */
#define DECSCLM 4 /* scrolling */
#define DECSCNM 5 /* screen */
#define DECOM 6 /* origin */
#define DECAWM 7 /* autowrap */
#define DECARM 8 /* autorepeat */
#define DECEDM 10 /* edit */
#define DECLTM 11 /* line transmit */
#define DECKANAM 12 /* Katakana shift */
#define DECSCFDM 13 /* space compression field delimiter */
#define DECTEM 14 /* transmission execution */
#define DECEKEM 16 /* edit key execution */
#define DECPFF 18 /* print form feed */
#define DECPEX 19 /* printer extent */
#define DECTCEM 25 /* text cursor enable */
#define DECRLM 34 /* left-to-right */
#define DECHEBM 35 /* Hebrew keyboard mapping (VT520) */
#define DECHEM 36 /* Hebrew encoding */
#define DECTEK 38 /* 4010/4014 emulation (VT240, VT330/VT340) */
#define DECNRCM 42 /* national replacement character set */
#define DECGEPM 43 /* graphics expanded print */
#define DECGPCM 44 /* graphics print color */
#define DECGPCS 45 /* graphics print color syntax */
#define DECGPBM 46 /* graphics print background */
#define DECGRPM 47 /* graphics rotated print */
#define DEC131TM 53 /* VT131 transmit */
#define DECNAKB 57 /* Greek/N-A Keyboard Mapping */
#define DECKKDM 59 /* Kanji/Katakana */
#define DECHCCM 60 /* horizontal cursor coupling (disabled) */
#define DECVCCM 61 /* vertical cursor coupling */
#define DECPCCM 64 /* page cursor coupling */
#define DECNKM 66 /* numeric keypad */
#define DECBKM 67 /* backarrow key */
#define DECKBUM 68 /* keyboard usage */
#define DECLRMM 69 /* left/right margin mode (VT420) */
#define DECXRLM 73 /* transmit rate linking */
#define DECSDM 80 /* Sixel display */
#define DECKPM 81 /* keyboard positioning */
#define DECNCSM 95 /* no clearing screen on column change */
#define DECRLCM 96 /* right-to-left copy */
#define DECCRTSM 97 /* CRT save */
#define DECARSM 98 /* auto resize */
#define DECMCM 99 /* modem control */
#define DECAAM 100 /* auto answerback */
#define DECCANSM 101 /* conceal answerback */
#define DECNULM 102 /* null */
#define DECHDPXM 103 /* half duplex */
#define DECESKM 104 /* enable secondary keyboard language */
#define DECOSCNM 106 /* overscan */
#define DECFWM 111 /* framed windows */
#define DECRPL 112 /* review previous lines */
#define DECHWUM 113 /* host wake-up mode (CRT and energy saver) */
#define DECATCUM 114 /* alternate text color underline */
#define DECATCBM 115 /* alternate text color blink */
#define DECBBSM 116 /* bold and blink style */
#define DECECM 117 /* erase color */
/* esc.c */
const char *csi_input(void);
const char *csi_output(void);
const char *dcs_input(void);
const char *dcs_output(void);
const char *osc_input(void);
const char *osc_output(void);
char *ss2_input(void);
char *ss2_output(void);
char *ss3_input(void);
char *ss3_output(void);
char *st_input(void);
char *st_output(void);
int cup(int pn1, int pn2);
int decdc(int pn);
int decic(int pn);
int default_1(int pn);
int default_1a(int pn);
int println(const char *s);
int printxx(const char *fmt, ...) GCC_PRINTFLIKE(1,2);
int tprintf(const char *fmt, ...) GCC_PRINTFLIKE(1,2);
int cprintf(const char *fmt, ...) GCC_PRINTFLIKE(1,2);
void brc(int pn, int c);
void brc2(int pn1, int pn2, int c);
void brc3(int pn1, int pn2, int pn3, int c);
void cbt(int pn);
void cha(int pn);
void cht(int pn);
void cnl(int pn);
void cpl(int pn);
void cub(int pn);
void cud(int pn);
void cuf(int pn);
void cuu(int pn);
void da(void);
void dch(int pn);
void decac(int flag, int fg, int bg);
void decaln(void);
void decarm(int flag);
void decatc(int flag, int fg, int bg);
void decawm(int flag);
void decbi(void);
void decbkm(int flag);
void deccara(int top, int left, int bottom, int right, int attr);
void decckm(int flag);
void deccolm(int flag);
void deccra(int Pts, int Pl, int Pbs, int Prs, int Pps, int Ptd, int Pld, int Ppd);
void decdhl(int lower);
void decdwl(void);
void decefr(int top, int left, int bottom, int right);
void decelr(int all_or_one, int pixels_or_cells);
void decera(int top, int left, int bottom, int right);
void decfi(void);
void decfra(int c, int top, int left, int bottom, int right);
void decid(void);
void deckbum(int flag);
void deckpam(void);
void deckpm(int flag);
void deckpnm(void);
void decll(const char *ps);
void decncsm(int flag);
void decnkm(int flag);
void decnrcm(int flag);
void decom(int flag);
void decpex(int flag);
void decpff(int flag);
void decrara(int top, int left, int bottom, int right, int attr);
void decrc(void);
void decreqtparm(int pn);
void decrqlp(int mode);
void decrqpsr(int mode);
void decrqss(const char *pn);
void decsace(int flag);
void decsasd(int pn);
void decsc(void);
void decsca(int pn1);
void decsclm(int flag);
void decscnm(int flag);
void decscpp(int cols);
void decsed(int pn1);
void decsel(int pn1);
void decsera(int top, int left, int bottom, int right);
void decstglt(int mode);
void decsle(int mode);
void decslpp(int rows);
void decslrm(int pn1, int pn2);
void decsnls(int pn);
void decssdt(int pn);
void decstbm(int pn1, int pn2);
void decstr(void);
void decswl(void);
void dectst(int pn);
void dl(int pn);
void do_csi(const char *fmt, ...) GCC_PRINTFLIKE(1,2);
void do_dcs(const char *fmt, ...) GCC_PRINTFLIKE(1,2);
void do_osc(const char *fmt, ...) GCC_PRINTFLIKE(1,2);
void dsr(int pn);
void ech(int pn);
void ed(int pn);
void el(int pn);
void esc(const char *s);
void extra_padding(int msecs);
void holdit(void);
void hpa(int pn);
void hpr(int pn);
void hts(void);
void hvp(int pn1, int pn2);
void ich(int pn);
void il(int pn);
void ind(void);
void inflush(void);
void inputline(char *s);
void mc_autoprint(int flag);
void mc_print_all_pages(void);
void mc_print_composed(void);
void mc_print_cursor_line(void);
void mc_print_page(void);
void mc_printer_assign(int flag);
void mc_printer_controller(int flag);
void mc_printer_start(int flag);
void nel(void);
void np(void);
void padding(int msecs);
void pp(void);
void ppa(int pn);
void ppb(int pn);
void ppr(int pn);
void put_char(FILE *fp, int c);
void put_string(FILE *fp, const char *s);
void readnl(void);
void rep(int pn);
void reset_decslrm(void);
void reset_decstbm(void);
void reset_inchar(void);
void ri(void);
void ris(void);
void rm(const char *ps);
void s8c1t(int flag);
void scs(int g, int c);
void sd(int pn);
void sgr(const char *ps);
void sl(int pn);
void sm(const char *ps);
void sr(int pn);
void srm(int flag);
void su(int pn);
void tbc(int pn);
void vpa(int pn);
void vpr(int pn);
void vt52cub1(void);
void vt52cud1(void);
void vt52cuf1(void);
void vt52cup(int l, int c);
void vt52cuu1(void);
void vt52ed(void);
void vt52el(void);
void vt52home(void);
void vt52ri(void);
void zleep(int t);
#endif /* ESC_H */