Fix escaping functions to also escape the leading whitespace
[midnight-commander.git] / src / tty.h
blob85d286b72adb25b63cdd5f9b0c1d360f3a19bb15
1 #ifndef MC_TTY_H
2 #define MC_TTY_H
4 /*
5 This file is the interface to the terminal controlling library---
6 ncurses, slang or the built-in slang. It provides an additional
7 layer of abstraction above the "real" libraries to keep the number
8 of ifdefs in the other files small.
9 */
11 #ifdef HAVE_SLANG
12 # include "myslang.h"
13 #endif
15 #ifdef USE_NCURSES
16 # ifdef HAVE_NCURSES_CURSES_H
17 # include <ncurses/curses.h>
18 # elif HAVE_NCURSES_H
19 # include <ncurses.h>
20 # else
21 # include <curses.h>
22 # endif
23 #ifdef WANT_TERM_H
24 # include <term.h>
25 #endif /* WANT_TERM_H */
26 #endif /* USE_NCURSES */
28 /* {{{ Input }}} */
30 extern void tty_enable_interrupt_key(void);
31 extern void tty_disable_interrupt_key(void);
32 extern gboolean tty_got_interrupt(void);
34 /* {{{ Output }}} */
37 The output functions do not check themselves for screen overflows,
38 so make sure that you never write more than what fits on the screen.
39 While SLang provides such a feature, ncurses does not.
42 extern void tty_gotoyx(int, int);
43 extern void tty_getyx(int *, int *);
45 extern void tty_setcolor(int);
47 extern void tty_print_char(int);
48 extern void tty_print_alt_char(int);
49 extern void tty_print_string(const char *);
50 extern void tty_print_one_vline(void);
51 extern void tty_print_one_hline(void);
52 extern void tty_print_vline(int top, int left, int length);
53 extern void tty_print_hline(int top, int left, int length);
54 extern void tty_printf(const char *, ...);
56 extern char *tty_tgetstr (const char *name);
58 /* legacy interface */
60 #define enable_interrupt_key() tty_enable_interrupt_key()
61 #define disable_interrupt_key() tty_disable_interrupt_key()
62 #define got_interrupt() tty_got_interrupt()
63 #define one_hline() tty_print_one_hline()
64 #define one_vline() tty_print_one_vline()
66 #ifndef HAVE_SLANG
67 # define acs()
68 # define noacs()
69 #endif
71 #define KEY_KP_ADD 4001
72 #define KEY_KP_SUBTRACT 4002
73 #define KEY_KP_MULTIPLY 4003
75 void mc_refresh (void);
77 #endif