]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_util.3x
0d2e0b88b743f1213890282f5528b232a9ccbb45
[ncurses.git] / man / curs_util.3x
1 .TH curs_util 3X ""
2 .SH NAME
3 \fBunctrl\fR, \fBkeyname\fR, \fBfilter\fR,
4 \fBuse_env\fR, \fBputwin\fR, \fBgetwin\fR, \fBdelay_output\fR,
5 \fBflushinp\fR - miscellaneous \fBcurses\fR utility routines
6 .SH SYNOPSIS
7 \fB#include <curses.h>\fR
8
9 \fBchar *unctrl(chtype c);\fR
10 .br
11 \fBchar *keyname(int c);\fR
12 .br
13 \fBvoid filter(void);\fR
14 .br
15 \fBvoid use_env(char bool);\fR
16 .br
17 \fBint putwin(WINDOW *win, FILE *filep);\fR
18 .br
19 \fBWINDOW *getwin(FILE *filep);\fR
20 .br
21 \fBint delay_output(int ms);\fR
22 .br
23 \fBint flushinp(void);\fR
24 .br
25 .SH DESCRIPTION
26 The \fBunctrl\fR macro expands to a character string which is a printable
27 representation of the character \fIc\fR.  Control characters are displayed in
28 the \fB^\fR\fIX\fR notation.  Printing characters are displayed as is.
29
30 The \fBkeyname\fR routine returns a character string corresponding to
31 the key \fIc\fR.
32
33 The \fBfilter\fR routine, if used, must be called before \fBinitscr\fR or
34 \fBnewterm\fR are called.  The effect is that, during those calls, \fBLINES\fR
35 is set to 1; the capabilities \fBclear\fR, \fBcup\fR, \fBcud\fR, \fBcud1\fR,
36 \fBcuu1\fR, \fBcuu\fR, \fBvpa\fR are disabled; and the \fBhome\fR string is
37 set to the value of \fBcr\fR.
38
39 The \fBuse_env\fR routine, if used, is called before \fBinitscr\fR or
40 \fBnewterm\fR are called.  When called with \fBFALSE\fR as an
41 argument, the values of \fBlines\fR and \fBcolumns\fR specified in the
42 \fIterminfo\fR database will be used, even if environment variables
43 \fBLINES\fR and \fBCOLUMNS\fR (used by default) are set, or if
44 \fBcurses\fR is running in a window (in which case default behavior
45 would be to use the window size if \fBLINES\fR and \fBCOLUMNS\fR are
46 not set).
47
48 The \fBputwin\fR routine writes all data associated with window \fIwin\fR into
49 the file to which \fIfilep\fR points.  This information can be later retrieved
50 using the \fBgetwin\fR function.
51
52 The \fBgetwin\fR routine reads window related data stored in the file by
53 \fBputwin\fR.  The routine then creates and initializes a new window using that
54 data.  It returns a pointer to the new window.
55
56 The \fBdelay_output\fR routine inserts an \fIms\fR millisecond pause
57 in output.  This routine should not be used extensively because
58 padding characters are used rather than a CPU pause.
59
60 The \fBflushinp\fR routine throws away any typeahead that has been typed by the
61 user and has not yet been read by the program.
62 .SH RETURN VALUE
63 Except for \fBflushinp\fR, routines that return an integer return \fBERR\fR
64 upon failure and \fBOK\fR (SVr4 specifies only "an integer value other than
65 \fBERR\fR") upon successful completion.
66
67 \fBflushinp\fR always returns \fBOK\fR.
68
69 Routines that return pointers return \fBNULL\fR on error.
70 .SH PORTABILITY
71 The XSI Curses standard, Issue 4 describes these functions.
72
73 The SVr4 documentation describes the action of \fBfilter\fR only in the vaguest
74 terms.  The description here is adapted from the XSI Curses standard (which
75 erroneously fails to describe the disabling of \fBcuu\fR).
76 .SH NOTES
77 Note that \fBunctrl\fR is a macro, which is defined in <\fBunctrl.h\fR>.
78 .SH SEE ALSO
79 \fBcurses\fR(3X), \fBcurs_initscr\fR(3X), \fBcurs_scr_dump\fR(3X).
80 .\"#
81 .\"# The following sets edit modes for GNU EMACS
82 .\"# Local Variables:
83 .\"# mode:nroff
84 .\"# fill-column:79
85 .\"# End: