'\"macro stdmacro
.if n .pH g3x.curs_util @(#)curs_util	40.3 of 12/15/89
.\" Copyright 1989 AT&T
.\" ident	"@(#)svid_ti:ti_lib/curs_util	1.4"
.nr X
.if \nX=0 .ds x} curs_util 3X "" "\&"
.if \nX=1 .ds x} curs_util 3X ""
.if \nX=2 .ds x} curs_util 3X "" "\&"
.if \nX=3 .ds x} curs_util "" "" "\&"
.TH \*(x}
.SH NAME
\f4curs_util\f2: \f4 unctrl\f1, \f4keyname\f1, \f4filter\f1, \f4use_env\f1, \f4putwin\f1, \f4getwin\f1, \f4delay_output\f1, \f4flushinp\f1 \- miscellaneous \f4curses\fP utility routines
.SH SYNOPSIS
.nf
.ft 4
#include <curses.h>
.sp
char *unctrl(chtype c);
.sp .5
char *keyname(int c);
.sp .5
int filter(void);
.sp .5
void use_env(char bool);
.sp .5
int putwin(WINDOW *win, FILE *filep);
.sp .5
WINDOW *getwin(FILE *filep);
.sp .5
int delay_output(int ms);
.sp .5
int flushinp(void);
.ft 1
.fi
.SH DESCRIPTION
The \f4unctrl\f1 macro expands to a character string which is a printable
representation of the character \f2c\f1.
Control characters are displayed in the \f4^\f2X\f1 notation.
Printing characters are displayed as is.
.P
With the \f4keyname\f1 routine,
a character string corresponding to the key \f2c\f1 is returned.
.P
The \f4filter\f1 routine, if used, is called
before \f4initscr\f1 or \f4newterm\f1 are called.
It makes \f4curses\fP think that there is a one-line screen.
\f4curses\fP does not use any terminal capabilities that assume that they know
on what line of the screen the cursor is positioned.
.P
The \f4use_env\fP routine, if used, is called before
\f4initscr\fP or \f4newterm\fP are called.
When called with \f4FALSE\fP as an argument, the values of
\f4lines\fP and \f4columns\fP specified in the \f2terminfo\fP database
will be used, even if environment variables \f4LINES\fP and
\f4COLUMNS\fP (used by default) are set, or if \f4curses\fP is running in a
window (in which case default behavior would be to use the window size if
\f4LINES\fP and \f4COLUMNS\fP are not set).
.P
With the \f4putwin\f1 routine,
all data associated with window \f2win\f1 is written into the file
to which \f2filep\f1 points.
This information can be later retrieved using 
the \f4getwin\f1 function.
.P
The \f4getwin\f1 routine
reads window related data stored in the file by \f4putwin\f1.
The routine then creates and initializes a new window using that data.
It returns a pointer to the new window.
.PP
The \f4delay_output\f1 routine inserts an \f2ms\f1
millisecond pause in output.
This routine should not be used extensively
because padding characters are used rather than a CPU pause.
.P
The \f4flushinp\f1 routine
throws away any typeahead that has been typed by the
user and has not yet been read by the program.
.SH RETURN VALUE
Except for \f4flushinp\fP,
routines that return an integer return \f4ERR\f1 upon
failure and an integer value other than \f4ERR\f1
upon successful completion.
.P
\f4flushinp\fP always returns \f4OK\fP.
.P
Routines that return pointers return \f4NULL\f1 on error.
.SH NOTES
.P
The header file \f4<curses.h>\f1 automatically includes the header files
\f4<stdio.h>\f1 and \f4<unctrl.h>\f1.
.PP
Note that \f4unctrl\f1 is a macro,
which is defined in <\f4unctrl.h\f1>.
.SH SEE ALSO
.na
\f4curses\fP(3X),
\f4curs_initscr\fP(3X),
\f4curs_scr_dump\fP(3X).
.ad
