]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_util.3x
ncurses 5.3
[ncurses.git] / man / curs_util.3x
1 .\"***************************************************************************
2 .\" Copyright (c) 1998-2001,2002 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.9 2002/09/01 19:44:37 tom Exp $
30 .TH curs_util 3X ""
31 .SH NAME
32 \fBdelay_output\fR,
33 \fBfilter\fR,
34 \fBflushinp\fR,
35 \fBgetwin\fR,
36 \fBkey_name\fR,
37 \fBkeyname\fR,
38 \fBputwin\fR,
39 \fBunctrl\fR,
40 \fBuse_env\fR,
41 \fBwunctrl\fR - miscellaneous \fBcurses\fR utility routines
42 .SH SYNOPSIS
43 \fB#include <curses.h>\fR
44
45 \fBchar *unctrl(chtype c);\fR
46 .br
47 \fBchar *wunctrl(wchar_t w);\fR
48 .br
49 \fBchar *keyname(int c);\fR
50 .br
51 \fBchar *key_name(wchar_t w);\fR
52 .br
53 \fBvoid filter(void);\fR
54 .br
55 \fBvoid use_env(bool f);\fR
56 .br
57 \fBint putwin(WINDOW *win, FILE *filep);\fR
58 .br
59 \fBWINDOW *getwin(FILE *filep);\fR
60 .br
61 \fBint delay_output(int ms);\fR
62 .br
63 \fBint flushinp(void);\fR
64 .br
65 .SH DESCRIPTION
66 The \fBunctrl\fR routine returns a character string which is a printable
67 representation of the character \fIc\fR, ignoring attributes.
68 Control characters are displayed in the \fB^\fR\fIX\fR notation.
69 Printing characters are displayed as is.
70 The corresponding \fBwunctrl\fR returns a printable representation of
71 a wide-character.
72
73 The \fBkeyname\fR routine returns a character string corresponding to the key \fIc\fR.
74 Control characters are displayed in the \fB^\fR\fIX\fR notation.
75 Values above 128 are either meta characters, shown in the \fBM-\fR\fIX\fR notation,
76 or the names of function keys, or null.
77 The corresponding \fBkey_name\fR returns a character string corresponding
78 to the wide-character value \fIw\fR.
79 The two functions do not return the same set of strings;
80 the latter returns null where the former would display a meta character.
81
82 The \fBfilter\fR routine, if used, must be called before \fBinitscr\fR or
83 \fBnewterm\fR are called.  The effect is that, during those calls, \fBLINES\fR
84 is set to 1; the capabilities \fBclear\fR, \fBcup\fR, \fBcud\fR, \fBcud1\fR,
85 \fBcuu1\fR, \fBcuu\fR, \fBvpa\fR are disabled; and the \fBhome\fR string is
86 set to the value of \fBcr\fR.
87
88 The \fBuse_env\fR routine, if used, is called before \fBinitscr\fR or
89 \fBnewterm\fR are called.  When called with \fBFALSE\fR as an
90 argument, the values of \fBlines\fR and \fBcolumns\fR specified in the
91 \fIterminfo\fR database will be used, even if environment variables
92 \fBLINES\fR and \fBCOLUMNS\fR (used by default) are set, or if
93 \fBcurses\fR is running in a window (in which case default behavior
94 would be to use the window size if \fBLINES\fR and \fBCOLUMNS\fR are
95 not set).
96
97 The \fBputwin\fR routine writes all data associated with window \fIwin\fR into
98 the file to which \fIfilep\fR points.  This information can be later retrieved
99 using the \fBgetwin\fR function.
100
101 The \fBgetwin\fR routine reads window related data stored in the file by
102 \fBputwin\fR.  The routine then creates and initializes a new window using that
103 data.  It returns a pointer to the new window.
104
105 The \fBdelay_output\fR routine inserts an \fIms\fR millisecond pause
106 in output.  This routine should not be used extensively because
107 padding characters are used rather than a CPU pause.
108
109 The \fBflushinp\fR routine throws away any typeahead that has been typed by the
110 user and has not yet been read by the program.
111 .SH RETURN VALUE
112 Except for \fBflushinp\fR, routines that return an integer return \fBERR\fR
113 upon failure and \fBOK\fR (SVr4 specifies only "an integer value other than
114 \fBERR\fR") upon successful completion.
115
116 \fBflushinp\fR always returns \fBOK\fR.
117
118 Routines that return pointers return \fBNULL\fR on error.
119 .SH PORTABILITY
120 The XSI Curses standard, Issue 4 describes these functions.
121 It states that \fBunctrl\fR and \fBwunctrl\fR will return a null pointer if
122 unsuccessful, but does not define any error conditions.
123
124 The SVr4 documentation describes the action of \fBfilter\fR only in the vaguest
125 terms.  The description here is adapted from the XSI Curses standard (which
126 erroneously fails to describe the disabling of \fBcuu\fR).
127 .SH SEE ALSO
128 \fBcurses\fR(3X), \fBcurs_initscr\fR(3X), \fBcurs_scr_dump\fR(3X).
129 .\"#
130 .\"# The following sets edit modes for GNU EMACS
131 .\"# Local Variables:
132 .\"# mode:nroff
133 .\"# fill-column:79
134 .\"# End: