]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_util.3x
ncurses 5.0
[ncurses.git] / man / curs_util.3x
1 .\"***************************************************************************
2 .\" Copyright (c) 1998 Free Software Foundation, Inc.                        *
3 .\"                                                                          *
4 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
5 .\" copy of this software and associated documentation files (the            *
6 .\" "Software"), to deal in the Software without restriction, including      *
7 .\" without limitation the rights to use, copy, modify, merge, publish,      *
8 .\" distribute, distribute with modifications, sublicense, and/or sell       *
9 .\" copies of the Software, and to permit persons to whom the Software is    *
10 .\" furnished to do so, subject to the following conditions:                 *
11 .\"                                                                          *
12 .\" The above copyright notice and this permission notice shall be included  *
13 .\" in all copies or substantial portions of the Software.                   *
14 .\"                                                                          *
15 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
16 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
17 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
18 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
19 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
21 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
22 .\"                                                                          *
23 .\" Except as contained in this notice, the name(s) of the above copyright   *
24 .\" holders shall not be used in advertising or otherwise to promote the     *
25 .\" sale, use or other dealings in this Software without prior written       *
26 .\" authorization.                                                           *
27 .\"***************************************************************************
28 .\"
29 .\" $Id: curs_util.3x,v 1.6 1998/03/11 21:12:53 juergen Exp $
30 .TH curs_util 3X ""
31 .SH NAME
32 \fBunctrl\fR, \fBkeyname\fR, \fBfilter\fR,
33 \fBuse_env\fR, \fBputwin\fR, \fBgetwin\fR, \fBdelay_output\fR,
34 \fBflushinp\fR - miscellaneous \fBcurses\fR utility routines
35 .SH SYNOPSIS
36 \fB#include <curses.h>\fR
37
38 \fBchar *unctrl(chtype c);\fR
39 .br
40 \fBchar *keyname(int c);\fR
41 .br
42 \fBvoid filter(void);\fR
43 .br
44 \fBvoid use_env(char bool);\fR
45 .br
46 \fBint putwin(WINDOW *win, FILE *filep);\fR
47 .br
48 \fBWINDOW *getwin(FILE *filep);\fR
49 .br
50 \fBint delay_output(int ms);\fR
51 .br
52 \fBint flushinp(void);\fR
53 .br
54 .SH DESCRIPTION
55 The \fBunctrl\fR macro expands to a character string which is a printable
56 representation of the character \fIc\fR.  Control characters are displayed in
57 the \fB^\fR\fIX\fR notation.  Printing characters are displayed as is.
58
59 The \fBkeyname\fR routine returns a character string corresponding to
60 the key \fIc\fR.
61
62 The \fBfilter\fR routine, if used, must be called before \fBinitscr\fR or
63 \fBnewterm\fR are called.  The effect is that, during those calls, \fBLINES\fR
64 is set to 1; the capabilities \fBclear\fR, \fBcup\fR, \fBcud\fR, \fBcud1\fR,
65 \fBcuu1\fR, \fBcuu\fR, \fBvpa\fR are disabled; and the \fBhome\fR string is
66 set to the value of \fBcr\fR.
67
68 The \fBuse_env\fR routine, if used, is called before \fBinitscr\fR or
69 \fBnewterm\fR are called.  When called with \fBFALSE\fR as an
70 argument, the values of \fBlines\fR and \fBcolumns\fR specified in the
71 \fIterminfo\fR database will be used, even if environment variables
72 \fBLINES\fR and \fBCOLUMNS\fR (used by default) are set, or if
73 \fBcurses\fR is running in a window (in which case default behavior
74 would be to use the window size if \fBLINES\fR and \fBCOLUMNS\fR are
75 not set).
76
77 The \fBputwin\fR routine writes all data associated with window \fIwin\fR into
78 the file to which \fIfilep\fR points.  This information can be later retrieved
79 using the \fBgetwin\fR function.
80
81 The \fBgetwin\fR routine reads window related data stored in the file by
82 \fBputwin\fR.  The routine then creates and initializes a new window using that
83 data.  It returns a pointer to the new window.
84
85 The \fBdelay_output\fR routine inserts an \fIms\fR millisecond pause
86 in output.  This routine should not be used extensively because
87 padding characters are used rather than a CPU pause.
88
89 The \fBflushinp\fR routine throws away any typeahead that has been typed by the
90 user and has not yet been read by the program.
91 .SH RETURN VALUE
92 Except for \fBflushinp\fR, routines that return an integer return \fBERR\fR
93 upon failure and \fBOK\fR (SVr4 specifies only "an integer value other than
94 \fBERR\fR") upon successful completion.
95
96 \fBflushinp\fR always returns \fBOK\fR.
97
98 Routines that return pointers return \fBNULL\fR on error.
99 .SH PORTABILITY
100 The XSI Curses standard, Issue 4 describes these functions.
101
102 The SVr4 documentation describes the action of \fBfilter\fR only in the vaguest
103 terms.  The description here is adapted from the XSI Curses standard (which
104 erroneously fails to describe the disabling of \fBcuu\fR).
105 .SH NOTES
106 Note that \fBunctrl\fR is a macro, which is defined in <\fBunctrl.h\fR>.
107 .SH SEE ALSO
108 \fBcurses\fR(3X), \fBcurs_initscr\fR(3X), \fBcurs_scr_dump\fR(3X).
109 .\"#
110 .\"# The following sets edit modes for GNU EMACS
111 .\"# Local Variables:
112 .\"# mode:nroff
113 .\"# fill-column:79
114 .\"# End: