minicurses.h - sfeed_curses - sfeed curses UI (now part of sfeed, development is in sfeed)
(HTM) git clone git://git.codemadness.org/sfeed_curses
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
minicurses.h (986B)
---
1 #include <sys/ioctl.h>
2
3 #undef OK
4 #define OK (0)
5
6 const char *clr_eol = "\x1b[K";
7 const char *clear_screen = "\x1b[H\x1b[2J";
8 const char *cursor_address = "\x1b[%ld;%ldH";
9 const char *cursor_normal = "\x1b[?25h"; /* DECTCEM (in)Visible cursor */
10 const char *cursor_invisible = "\x1b[?25l"; /* DECTCEM (in)Visible cursor */
11 const char *eat_newline_glitch = (void *)1;
12 const char *enter_ca_mode = "\x1b[?1049h"; /* smcup */
13 const char *exit_ca_mode = "\x1b[?1049l"; /* rmcup */
14 const char *save_cursor = "\x1b""7";
15 const char *restore_cursor = "\x1b""8";
16 const char *exit_attribute_mode = "\x1b[0m";
17 const char *enter_bold_mode = "\x1b[1m";
18 const char *enter_dim_mode = "\x1b[2m";
19 const char *enter_reverse_mode = "\x1b[7m";
20
21 int
22 setupterm(char *term, int fildes, int *errret)
23 {
24 return OK;
25 }
26
27 char *
28 tparm(const char *s, long p1, long p2, ...)
29 {
30 static char buf[32];
31
32 if (s == cursor_address) {
33 snprintf(buf, sizeof(buf), s, p1 + 1, p2 + 1);
34 return buf;
35 }
36
37 return (char *)s;
38 }