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