curs_util, delay_output, filter, flushinp, getwin, key_name, keyname, putwin, unctrl, use_env, wunctrl - Miscellaneous utility routines for Curses
int delay_output( int ms ); void filter( void ); int flushinp( void ); WINDOW *getwin( FILE *filep ); char *key_name( wchar_t c ); char *keyname( int c ); int putwin( WINDOW *win, FILE *filep ); void use_env( char bool ); wchar_t *wunctrl( cchar_t *wc ); include <unctrl.h>
Curses Library (libcurses)
Interfaces documented on this reference page conform to industry standards as follows:
delay_output, filter, flushinp, unctrl: XPG4, XPG4-UNIX
getwin, key_name, keyname, putwin, use_env, wunctrl: XPG4-UNIX
Refer to the
reference page for more information
about industry standards and associated tags.
The unctrl macro generates a character string that is a printable representation of the character c. Control characters are displayed in the ^X notation. Printing characters are displayed as is.
The wunctrl function generates a wide-character string that is a printable representation of the wide character wc. This function also performs the following processing on the input argument: Converts control characters to the ^X notation Removes any rendition information
The keyname and key_name routines generate a character string whose value describes the key c. The c argument of keyname can be an 8-bit character or a key code. The c argument of key_name must be a wide character. The generated string has a format according to the first applicable input item in the following list: The same character ^X M-X
The meta-character notation shown in this list is used only if meta-characters are enabled.
If applications use the filter routine, they call it before calling initscr or newterm. The filter routine tells Curses that there is a one-line screen. In this case, Curses does not use any terminal capabilities that assume knowledge of the screen line on which the cursor is positioned.
If applications use the use_env routine, they call it before calling initscr or newterm. When called with FALSE as an argument, the routine tells Curses to use the values of lines and columns as specified in the terminfo database, even when: The LINES and COLUMNS environment variables are set
The putwin routine writes all data associated with window win into the file to which filep points. The application can later retrieve this data by using the getwin function.
The getwin routine reads window-related data stored in the file by putwin and then creates and initializes a new window using that data. The getwin routine returns a pointer to the new window.
On terminals that support pad characters, the delay_output routine pauses the output for at least ms millisecond pause. Otherwise, the length of the delay is unspecified. This routine should not be used extensively because padding characters are used rather than a CPU pause.
routine throws away any typeahead input
that has not yet been read by the program.
The return value of keyname and key_name may point to a static area that is overwritten by a subsequent call to either of these functions.
Applications normally process meta-characters without storing them in a window. If an application stores meta-characters in a window and tries to retrieve them as wide characters, keyname() cannot detect meta-characters, since wide characters do not support meta-characters.
The header file <curses.h> automatically includes the header file <stdio.h>.
may be a macro.
The delay_output and putwin routines return ERR upon failure and OK upon successful completion.
The flushinp routine always returns OK.
Routines that return pointers return NULL on error.
routine does not return a value.
Functions: curses(3), curs_initscr(3), curs_scr_dump(3)