forked from hackerb9/vt340test
-
Notifications
You must be signed in to change notification settings - Fork 0
/
acschars.c
143 lines (124 loc) · 2.9 KB
/
acschars.c
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
/* Compile with gcc acschars.c -o acschars -lncurses */
/* hackerb9 2020 */
#include <term.h> /* For keypad_local */
#include <ncurses.h>
int main(void)
{
initscr();
int startrow=2;
if (LINES<12) startrow=0;
if (LINES>=12) {
attron(A_REVERSE);
mvprintw(0,0," NCURSES EXTENDED CHARACTERS \n");
attroff(A_REVERSE);
printw("\n");
}
int col=1;
int row=startrow;
mvprintw(row++, col ," ");
addch(ACS_UARROW);
printw(" ");
printw("\n");
mvprintw(row++,col," ");
addch(ACS_ULCORNER);
addch(ACS_HLINE);
addch(ACS_TTEE);
addch(ACS_HLINE);
addch(ACS_URCORNER);
printw(" ");
printw("\n");
mvprintw(row++,col," ");
addch(ACS_VLINE);
printw(" ");
addch(ACS_VLINE);
printw(" ");
addch(ACS_VLINE);
printw("\n");
move(row++,col);
addch(ACS_LARROW);
addch(ACS_LTEE);
addch(ACS_HLINE);
addch(ACS_PLUS);
addch(ACS_HLINE);
addch(ACS_RTEE);
addch(ACS_RARROW);
printw("\n");
mvprintw(row++,col," ");
addch(ACS_VLINE);
printw(" ");
addch(ACS_VLINE);
printw(" ");
addch(ACS_VLINE);
printw("\n");
mvprintw(row++,col," ");
addch(ACS_LLCORNER);
addch(ACS_HLINE);
addch(ACS_BTEE);
addch(ACS_HLINE);
addch(ACS_LRCORNER);
printw(" ");
printw("\n");
mvprintw(row++,col," ");
printw(" ");
addch(ACS_DARROW);
printw(" ");
printw("\n");
col=14;
row=startrow;
mvprintw(row++, col, "Diamond ");
addch(ACS_DIAMOND);
mvprintw(row++, col, "Board ");
addch(ACS_BOARD);
mvprintw(row++, col, "CkBoard ");
addch(ACS_CKBOARD);
mvprintw(row++, col, "Block ");
addch(ACS_BLOCK);
mvprintw(row++, col, "Bullet ");
addch(ACS_BULLET);
mvprintw(row++, col, "Degree ");
addch(ACS_DEGREE);
mvprintw(row++, col, "Lantern ");
addch(ACS_LANTERN);
col=29;
row=startrow;
printw("\n");
mvprintw(row++,col, "Scan ");
addch(ACS_S1);
addch(ACS_S3);
addch(ACS_HLINE);
addch(ACS_S7);
addch(ACS_S9);
mvprintw(row++, col, "Pi ");
addch(ACS_PI);
mvprintw(row++, col, "PlMinus ");
addch(ACS_PLMINUS);
mvprintw(row++, col, "LEqual ");
addch(ACS_LEQUAL);
mvprintw(row++, col, "GEqual ");
addch(ACS_GEQUAL);
mvprintw(row++, col, "NEqual ");
addch(ACS_NEQUAL);
mvprintw(row++, col, "Strling ");
addch(ACS_STERLING);
printw("\n");
if (LINES>=12) {
/*Long name is last string after pipe*/
printw("\n");
char *p=ttytype;
while (*p++)
;
while (p>=ttytype && *p--!='|')
;
p+=2;
printw("Terminal type: %s\n", p);
}
move(LINES-1, 0);
refresh();
/* Exit, but don't use endwin as that has the titeInhibit misfeature
which clears the screen annoyingly. Use reset_shell_mode() instead. */
putp(keypad_local); /* disable application keys mode. */
reset_shell_mode(); /* reset the terminal but don't clear screen. */
// getch(); /* Old method was wait for key */
// endwin(); /* before clearing screen. */
return 0;
}