DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

curs_util(S-osr5)


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-osr5) 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-osr5) routine returns a character string corresponding to the key c.

The filter(S-osr5) routine, if used, is called before initscr(S-osr5) or newterm(S-osr5). It makes curses(S-osr5) 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-osr5) 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-osr5) routine writes all data associated with window win into the file pointed to by filep. This information can later be retrieved using getwin(S-osr5).

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-osr5) 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-osr5) routine waits until ms milliseconds remain to clear the output completely. Currently, the only valid value for ms is 0.

The flushinp(S-osr5) 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-osr5), curs_initscr(S-osr5), curs_scr_dump(S-osr5)

Standards conformance

unctrl(S-osr5), keyname(S-osr5), filter(S-osr5), delay_output(S-osr5), draino(S-osr5), and flushinp(S-osr5) are not part of any currently supported standard; they were developed by UNIX System Laboratories, Inc. and are maintained by The SCO Group.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005