|
|
#include <curses.h>char *unctrl(chtype c); char *keyname(int c); void filter(void); void use_env(char bool); int putwin(WINDOW *win, FILE *filep); WINDOW *getwin(FILE *filep); int delay_output(int ms); int draino(int ms); int flushinp(void);
The unctrl(S) macro expands to a character string which is a printable representation of the character c. Control characters are displayed in the ^X notation. Printing characters are displayed as is.
The keyname(S) routine returns a character string corresponding to the key c.
The filter(S) routine, if used, is called before initscr(S) or newterm(S). It makes curses(S) think that there is a one-line screen. Therefore, curses( ) does not use any terminal capabilities that need to know what line of the screen the cursor is on.
The use_env(S) routine, if used, is called before initscr( ) or newterm( ) are called. When it is called with FALSE as an argument, the values of lines and columns specified in the terminfo database are used. This is true even if environment variables LINES and COLUMNS (used by default) are set, or if curses( ) is running in a window (where it would normally use the window size if LINES and COLUMNS are not set).
The putwin(S) routine writes all data associated with window win into the file pointed to by filep. This information can later be retrieved using getwin(S).
The getwin( ) routine reads window-related data stored in the file by putwin( ). The routine then creates and initializes a new window using that data. It returns a pointer to the new window.
The delay_output(S) routine inserts a pause of ms milliseconds in output. Do not call this often because it uses padding characters rather than a CPU pause.
The draino(S) routine waits until ms milliseconds remain to clear the output completely. Currently, the only valid value for ms is 0.
The flushinp(S) routine throws away any typeahead characters that have been typed by the user but not yet read by the program.
Routines that return pointers return NULL on error.
unctrl( ) is a macro defined in unctrl.h.