-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathescseq.h
More file actions
63 lines (50 loc) · 1.54 KB
/
Copy pathescseq.h
File metadata and controls
63 lines (50 loc) · 1.54 KB
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
/**
* @file
* @brief This file defines most useful ANSI escape sequences
*
* It's hard to remember tonns of constant values, so this file defines useful
* ANSI escape sequences
*/
#ifndef HLEB_ESCSEQ_H
#define HLEB_ESCSEQ_H
#ifndef __GNUC__
#error "hleb lib relies on GNU C extensions. Use gcc compiler"
#endif
#define CSI "\e["
#define RESET CSI "0m"
#define BOLD CSI "1m"
#define ITALIC CSI "3m"
#define UNDERLINED CSI "4m"
#define BLINK CSI "5m"
#define CURUP(n) CSI HLEB_STRINGIZE_V(n) "A"
#define CURDOWN(n) CSI HLEB_STRINGIZE_V(n) "B"
#define CURFWD(n) CSI HLEB_STRINGIZE_V(n) "C"
#define CURBWD(n) CSI HLEB_STRINGIZE_V(n) "D"
#define CURNXTL(n) CSI HLEB_STRINGIZE_V(n) "E"
#define CURPRVL(n) CSI HLEB_STRINGIZE_V(n) "F"
#define CURPOS(r,c) CSI HLEB_STRINGIZE_V(r) ";" HLEB_STRINGIZE_V(c) "H"
#define CLRDISP(p) CSI HLEB_STRINGIZE_V(p) "J"
#define CLRLINE(p) CSI HLEB_STRINGIZE_V(p) "K"
#define SCRLUP(n) CSI HLEB_STRINGIZE_V(n) "S"
#define SCRLDWN(n) CSI HLEB_STRINGIZE_V(n) "T"
#define REPORT CSI "6n"
#define SAVEPOS "\e7"
#define RESTPOS "\e8"
#define SETCOLOR(c) CSI HLEB_STRINGIZE_V(c) "m"
#define RBLACK 30
#define RRED 31
#define RGREEN 32
#define RYELLOW 33
#define RBLUE 34
#define RMAGNETA 35
#define RCYAN 36
#define RWHITE 37
#define BBLACK 90
#define BRED 91
#define BGREEN 92
#define BYELLOW 93
#define BBLUE 94
#define BMAGNETA 95
#define BCYAN 96
#define BWHITE 97
#endif // HLEB_ESCSEQ_H