DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

curs_util(S)


curs_util: unctrl, keyname, filter, use_env, putwin, getwin, delay_output, draino, flushinp -- miscellaneous curses utility routines

Syntax

cc ... -lcurses

#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);

Description

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.

Return values

flushinp( ) always returns OK. All other routines that return an integer return ERR on failure and an integer value other than ERR on successful completion.

Routines that return pointers return NULL on error.

Warning

The header file curses.h automatically includes the header files stdio.h and unctrl.h.

unctrl( ) is a macro defined in unctrl.h.

Files


/usr/lib/libcurses.a
the library

See also

curses(S), curs_initscr(S), curs_scr_dump(S)

Standards conformance

unctrl(S), keyname(S), filter(S), delay_output(S), draino(S), and flushinp(S) are not part of any currently supported standard; they were developed by UNIX System Laboratories, Inc. and are maintained by The SCO Group.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003