blob: 703a239abfdeff19543fceec8485053326dbffa2 [file] [log] [blame]
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05301'\" t
2.\"***************************************************************************
3.\" Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
4.\" *
5.\" Permission is hereby granted, free of charge, to any person obtaining a *
6.\" copy of this software and associated documentation files (the *
7.\" "Software"), to deal in the Software without restriction, including *
8.\" without limitation the rights to use, copy, modify, merge, publish, *
9.\" distribute, distribute with modifications, sublicense, and/or sell *
10.\" copies of the Software, and to permit persons to whom the Software is *
11.\" furnished to do so, subject to the following conditions: *
12.\" *
13.\" The above copyright notice and this permission notice shall be included *
14.\" in all copies or substantial portions of the Software. *
15.\" *
16.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
17.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
18.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
19.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
20.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
21.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
22.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
23.\" *
24.\" Except as contained in this notice, the name(s) of the above copyright *
25.\" holders shall not be used in advertising or otherwise to promote the *
26.\" sale, use or other dealings in this Software without prior written *
27.\" authorization. *
28.\"***************************************************************************
29.\"
30.\" $Id: ncurses.3x,v 1.92 2008/10/25 23:31:45 tom Exp $
31.hy 0
32.TH ncurses 3X ""
33.ds n 5
34.ds d @TERMINFO@
35.SH NAME
36\fBncurses\fR - CRT screen handling and optimization package
37.SH SYNOPSIS
38\fB#include <curses.h>\fR
39.br
40.SH DESCRIPTION
41The \fBncurses\fR library routines give the user a terminal-independent method
42of updating character screens with reasonable optimization.
43This implementation is ``new curses'' (ncurses) and
44is the approved replacement for
454.4BSD classic curses, which has been discontinued.
46This describes \fBncurses\fR
47version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
48.PP
49The \fBncurses\fR library emulates the \fBcurses\fR(3X) library of
50System V Release 4 UNIX,
51and XPG4 (X/Open Portability Guide) curses (also known as XSI curses).
52XSI stands for X/Open System Interfaces Extension.
53The \fBncurses\fR library is freely redistributable in source form.
54Differences from the SVr4
55curses are summarized under the \fBEXTENSIONS\fP and \fBPORTABILITY\fP sections below and
56described in detail in the respective \fBEXTENSIONS\fP, \fBPORTABILITY\fP and \fBBUGS\fP sections
57of individual man pages.
58.PP
59The \fBncurses\fR library also provides many useful extensions,
60i.e., features which cannot be implemented by a simple add-on library
61but which require access to the internals of the library.
62.PP
63A program using these routines must be linked with the \fB-lncurses\fR option,
64or (if it has been generated) with the debugging library \fB-lncurses_g\fR.
65(Your system integrator may also have installed these libraries under
66the names \fB-lcurses\fR and \fB-lcurses_g\fR.)
67The ncurses_g library generates trace logs (in a file called 'trace' in the
68current directory) that describe curses actions.
69See also the section on \fBALTERNATE CONFIGURATIONS\fP.
70.PP
71The \fBncurses\fR package supports: overall screen, window and pad
72manipulation; output to windows and pads; reading terminal input; control over
73terminal and \fBcurses\fR input and output options; environment query
74routines; color manipulation; use of soft label keys; terminfo capabilities;
75and access to low-level terminal-manipulation routines.
76.PP
77The library uses the locale which the calling program has initialized.
78That is normally done with \fBsetlocale\fP:
79.sp
80 \fBsetlocale(LC_ALL, "");\fP
81.sp
82If the locale is not initialized,
83the library assumes that characters are printable as in ISO-8859-1,
84to work with certain legacy programs.
85You should initialize the locale and not rely on specific details of
86the library when the locale has not been setup.
87.PP
88The function \fBinitscr\fR or \fBnewterm\fR
89must be called to initialize the library
90before any of the other routines that deal with windows
91and screens are used.
92The routine \fBendwin\fR must be called before exiting.
93.PP
94To get character-at-a-time input without echoing (most
95interactive, screen oriented programs want this), the following
96sequence should be used:
97.sp
98 \fBinitscr(); cbreak(); noecho();\fR
99.sp
100Most programs would additionally use the sequence:
101.sp
102 \fBnonl();\fR
103 \fBintrflush(stdscr, FALSE);\fR
104 \fBkeypad(stdscr, TRUE);\fR
105.sp
106Before a \fBcurses\fR program is run, the tab stops of the terminal
107should be set and its initialization strings, if defined, must be output.
108This can be done by executing the \fBtput init\fR command
109after the shell environment variable \fBTERM\fR has been exported.
110\fBtset(1)\fR is usually responsible for doing this.
111[See \fBterminfo\fR(\*n) for further details.]
112.PP
113The \fBncurses\fR library permits manipulation of data structures,
114called \fIwindows\fR, which can be thought of as two-dimensional
115arrays of characters representing all or part of a CRT screen.
116A default window called \fBstdscr\fR, which is the size of the terminal
117screen, is supplied.
118Others may be created with \fBnewwin\fR.
119.PP
120Note that \fBcurses\fR does not handle overlapping windows, that's done by
121the \fBpanel\fR(3X) library.
122This means that you can either use
123\fBstdscr\fR or divide the screen into tiled windows and not using
124\fBstdscr\fR at all.
125Mixing the two will result in unpredictable, and undesired, effects.
126.PP
127Windows are referred to by variables declared as \fBWINDOW *\fR.
128These data structures are manipulated with routines described here and
129elsewhere in the \fBncurses\fR manual pages.
130Among those, the most basic
131routines are \fBmove\fR and \fBaddch\fR.
132More general versions of
133these routines are included with names beginning with \fBw\fR,
134allowing the user to specify a window.
135The routines not beginning
136with \fBw\fR affect \fBstdscr\fR.
137.PP
138After using routines to manipulate a window, \fBrefresh\fR is called,
139telling \fBcurses\fR to make the user's CRT screen look like
140\fBstdscr\fR.
141The characters in a window are actually of type
142\fBchtype\fR, (character and attribute data) so that other information
143about the character may also be stored with each character.
144.PP
145Special windows called \fIpads\fR may also be manipulated.
146These are windows
147which are not constrained to the size of the screen and whose contents need not
148be completely displayed.
149See \fBcurs_pad\fR(3X) for more information.
150.PP
151In addition to drawing characters on the screen, video attributes and colors
152may be supported, causing the characters to show up in such modes as
153underlined, in reverse video, or in color on terminals that support such
154display enhancements.
155Line drawing characters may be specified to be output.
156On input, \fBcurses\fR is also able to translate arrow and function keys that
157transmit escape sequences into single values.
158The video attributes, line
159drawing characters, and input values use names, defined in \fB<curses.h>\fR,
160such as \fBA_REVERSE\fR, \fBACS_HLINE\fR, and \fBKEY_LEFT\fR.
161.PP
162If the environment variables \fBLINES\fR and \fBCOLUMNS\fR are set, or if the
163program is executing in a window environment, line and column information in
164the environment will override information read by \fIterminfo\fR.
165This would affect a program running in an AT&T 630 layer,
166for example, where the size of a
167screen is changeable (see \fBENVIRONMENT\fR).
168.PP
169If the environment variable \fBTERMINFO\fR is defined, any program using
170\fBcurses\fR checks for a local terminal definition before checking in the
171standard place.
172For example, if \fBTERM\fR is set to \fBatt4424\fR, then the
173compiled terminal definition is found in
174.sp
175 \fB\*d/a/att4424\fR.
176.sp
177(The \fBa\fR is copied from the first letter of \fBatt4424\fR to avoid
178creation of huge directories.) However, if \fBTERMINFO\fR is set to
179\fB$HOME/myterms\fR, \fBcurses\fR first checks
180.sp
181 \fB$HOME/myterms/a/att4424\fR,
182.sp
183and if that fails, it then checks
184.sp
185 \fB\*d/a/att4424\fR.
186.sp
187This is useful for developing experimental definitions or when write
188permission in \fB\*d\fR is not available.
189.PP
190The integer variables \fBLINES\fR and \fBCOLS\fR are defined in
191\fB<curses.h>\fR and will be filled in by \fBinitscr\fR with the size of the
192screen.
193The constants \fBTRUE\fR and \fBFALSE\fR have the values \fB1\fR and
194\fB0\fR, respectively.
195.PP
196The \fBcurses\fR routines also define the \fBWINDOW *\fR variable \fBcurscr\fR
197which is used for certain low-level operations like clearing and redrawing a
198screen containing garbage.
199The \fBcurscr\fR can be used in only a few routines.
200.\"
201.SS Routine and Argument Names
202Many \fBcurses\fR routines have two or more versions.
203The routines prefixed with \fBw\fR require a window argument.
204The routines prefixed with \fBp\fR require a pad argument.
205Those without a prefix generally use \fBstdscr\fR.
206.PP
207The routines prefixed with \fBmv\fR require a \fIy\fR and \fIx\fR
208coordinate to move to before performing the appropriate action.
209The \fBmv\fR routines imply a call to \fBmove\fR before the call to the
210other routine.
211The coordinate \fIy\fR always refers to the row (of
212the window), and \fIx\fR always refers to the column.
213The upper left-hand corner is always (0,0), not (1,1).
214.PP
215The routines prefixed with \fBmvw\fR take both a window argument and
216\fIx\fR and \fIy\fR coordinates.
217The window argument is always specified before the coordinates.
218.PP
219In each case, \fIwin\fR is the window affected, and \fIpad\fR is the
220pad affected; \fIwin\fR and \fIpad\fR are always pointers to type
221\fBWINDOW\fR.
222.PP
223Option setting routines require a Boolean flag \fIbf\fR with the value
224\fBTRUE\fR or \fBFALSE\fR; \fIbf\fR is always of type \fBbool\fR.
225Most of the data types used in the library routines,
226such as \fBWINDOW\fR, \fBSCREEN\fR, \fBbool\fR, and \fBchtype\fR
227are defined in \fB<curses.h>\fR.
228Types used for the terminfo routines such as
229\fBTERMINAL\fR are defined in \fB<term.h>\fR.
230.PP
231This manual page describes functions which may appear in any configuration
232of the library.
233There are two common configurations of the library:
234.RS
235.TP 5
236ncurses
237the "normal" library, which handles 8-bit characters.
238The normal (8-bit) library stores characters combined with attributes
239in \fBchtype\fP data.
240.IP
241Attributes alone (no corresponding character) may be stored in \fBchtype\fP
242or the equivalent \fBattr_t\fP data.
243In either case, the data is stored in something like an integer.
244.IP
245Each cell (row and column) in a \fBWINDOW\fP is stored as a \fBchtype\fP.
246.TP 5
247ncursesw
248the so-called "wide" library, which handles multibyte characters
249(See the section on \fBALTERNATE CONFIGURATIONS\fP).
250The "wide" library includes all of the calls from the "normal" library.
251It adds about one third more calls using data types which store
252multibyte characters:
253.RS
254.TP 5
255.B cchar_t
256corresponds to \fBchtype\fP.
257However it is a structure, because more data is stored than can fit into
258an integer.
259The characters are large enough to require a full integer value - and there
260may be more than one character per cell.
261The video attributes and color are stored in separate fields of the structure.
262.IP
263Each cell (row and column) in a \fBWINDOW\fP is stored as a \fBcchar_t\fP.
264.TP 5
265.B wchar_t
266stores a "wide" character.
267Like \fBchtype\fP, this may be an integer.
268.TP 5
269.B wint_t
270stores a \fBwchar_t\fP or \fBWEOF\fP - not the same, though both may have
271the same size.
272.RE
273.IP
274The "wide" library provides new functions which are analogous to
275functions in the "normal" library.
276There is a naming convention which relates many of the normal/wide variants:
277a "_w" is inserted into the name.
278For example, \fBwaddch\fP becomes \fBwadd_wch\fP.
279.RE
280.PP
281.\"
282.SS Routine Name Index
283The following table lists each \fBcurses\fR routine and the name of
284the manual page on which it is described.
285Routines flagged with `*'
286are ncurses-specific, not described by XPG4 or present in SVr4.
287.PP
288.TS
289center tab(/);
290l l
291l l .
292\fBcurses\fR Routine Name/Manual Page Name
293=
294COLOR_PAIR/\fBcurs_color\fR(3X)
295PAIR_NUMBER/\fBcurs_attr\fR(3X)
296_nc_free_and_exit/\fBcurs_memleaks\fR(3X)*
297_nc_freeall/\fBcurs_memleaks\fR(3X)*
298_nc_tracebits/\fBcurs_trace\fR(3X)*
299_traceattr/\fBcurs_trace\fR(3X)*
300_traceattr2/\fBcurs_trace\fR(3X)*
301_tracechar/\fBcurs_trace\fR(3X)*
302_tracechtype/\fBcurs_trace\fR(3X)*
303_tracechtype2/\fBcurs_trace\fR(3X)*
304_tracedump/\fBcurs_trace\fR(3X)*
305_tracef/\fBcurs_trace\fR(3X)*
306_tracemouse/\fBcurs_trace\fR(3X)*
307add_wch/\fBcurs_add_wch\fR(3X)
308add_wchnstr/\fBcurs_add_wchstr\fR(3X)
309add_wchstr/\fBcurs_add_wchstr\fR(3X)
310addch/\fBcurs_addch\fR(3X)
311addchnstr/\fBcurs_addchstr\fR(3X)
312addchstr/\fBcurs_addchstr\fR(3X)
313addnstr/\fBcurs_addstr\fR(3X)
314addnwstr/\fBcurs_addwstr\fR(3X)
315addstr/\fBcurs_addstr\fR(3X)
316addwstr/\fBcurs_addwstr\fR(3X)
317assume_default_colors/\fBdefault_colors\fR(3X)*
318attr_get/\fBcurs_attr\fR(3X)
319attr_off/\fBcurs_attr\fR(3X)
320attr_on/\fBcurs_attr\fR(3X)
321attr_set/\fBcurs_attr\fR(3X)
322attroff/\fBcurs_attr\fR(3X)
323attron/\fBcurs_attr\fR(3X)
324attrset/\fBcurs_attr\fR(3X)
325baudrate/\fBcurs_termattrs\fR(3X)
326beep/\fBcurs_beep\fR(3X)
327bkgd/\fBcurs_bkgd\fR(3X)
328bkgdset/\fBcurs_bkgd\fR(3X)
329bkgrnd/\fBcurs_bkgrnd\fR(3X)
330bkgrndset/\fBcurs_bkgrnd\fR(3X)
331border/\fBcurs_border\fR(3X)
332border_set/\fBcurs_border_set\fR(3X)
333box/\fBcurs_border\fR(3X)
334box_set/\fBcurs_border_set\fR(3X)
335can_change_color/\fBcurs_color\fR(3X)
336cbreak/\fBcurs_inopts\fR(3X)
337chgat/\fBcurs_attr\fR(3X)
338clear/\fBcurs_clear\fR(3X)
339clearok/\fBcurs_outopts\fR(3X)
340clrtobot/\fBcurs_clear\fR(3X)
341clrtoeol/\fBcurs_clear\fR(3X)
342color_content/\fBcurs_color\fR(3X)
343color_set/\fBcurs_attr\fR(3X)
344copywin/\fBcurs_overlay\fR(3X)
345curs_set/\fBcurs_kernel\fR(3X)
346curses_version/\fBcurs_extend\fR(3X)*
347def_prog_mode/\fBcurs_kernel\fR(3X)
348def_shell_mode/\fBcurs_kernel\fR(3X)
349define_key/\fBdefine_key\fR(3X)*
350del_curterm/\fBcurs_terminfo\fR(3X)
351delay_output/\fBcurs_util\fR(3X)
352delch/\fBcurs_delch\fR(3X)
353deleteln/\fBcurs_deleteln\fR(3X)
354delscreen/\fBcurs_initscr\fR(3X)
355delwin/\fBcurs_window\fR(3X)
356derwin/\fBcurs_window\fR(3X)
357doupdate/\fBcurs_refresh\fR(3X)
358dupwin/\fBcurs_window\fR(3X)
359echo/\fBcurs_inopts\fR(3X)
360echo_wchar/\fBcurs_add_wch\fR(3X)
361echochar/\fBcurs_addch\fR(3X)
362endwin/\fBcurs_initscr\fR(3X)
363erase/\fBcurs_clear\fR(3X)
364erasechar/\fBcurs_termattrs\fR(3X)
365erasewchar/\fBcurs_termattrs\fR(3X)
366filter/\fBcurs_util\fR(3X)
367flash/\fBcurs_beep\fR(3X)
368flushinp/\fBcurs_util\fR(3X)
369get_wch/\fBcurs_get_wch\fR(3X)
370get_wstr/\fBcurs_get_wstr\fR(3X)
371getattrs/\fBcurs_attr\fR(3X)
372getbegx/\fBcurs_legacy\fR(3X)*
373getbegy/\fBcurs_legacy\fR(3X)*
374getbegyx/\fBcurs_getyx\fR(3X)
375getbkgd/\fBcurs_bkgd\fR(3X)
376getbkgrnd/\fBcurs_bkgrnd\fR(3X)
377getcchar/\fBcurs_getcchar\fR(3X)
378getch/\fBcurs_getch\fR(3X)
379getcurx/\fBcurs_legacy\fR(3X)*
380getcury/\fBcurs_legacy\fR(3X)*
381getmaxx/\fBcurs_legacy\fR(3X)*
382getmaxy/\fBcurs_legacy\fR(3X)*
383getmaxyx/\fBcurs_getyx\fR(3X)
384getmouse/\fBcurs_mouse\fR(3X)*
385getn_wstr/\fBcurs_get_wstr\fR(3X)
386getnstr/\fBcurs_getstr\fR(3X)
387getparx/\fBcurs_legacy\fR(3X)*
388getpary/\fBcurs_legacy\fR(3X)*
389getparyx/\fBcurs_getyx\fR(3X)
390getstr/\fBcurs_getstr\fR(3X)
391getsyx/\fBcurs_kernel\fR(3X)
392getwin/\fBcurs_util\fR(3X)
393getyx/\fBcurs_getyx\fR(3X)
394halfdelay/\fBcurs_inopts\fR(3X)
395has_colors/\fBcurs_color\fR(3X)
396has_ic/\fBcurs_termattrs\fR(3X)
397has_il/\fBcurs_termattrs\fR(3X)
398has_key/\fBcurs_getch\fR(3X)*
399hline/\fBcurs_border\fR(3X)
400hline_set/\fBcurs_border_set\fR(3X)
401idcok/\fBcurs_outopts\fR(3X)
402idlok/\fBcurs_outopts\fR(3X)
403immedok/\fBcurs_outopts\fR(3X)
404in_wch/\fBcurs_in_wch\fR(3X)
405in_wchnstr/\fBcurs_in_wchstr\fR(3X)
406in_wchstr/\fBcurs_in_wchstr\fR(3X)
407inch/\fBcurs_inch\fR(3X)
408inchnstr/\fBcurs_inchstr\fR(3X)
409inchstr/\fBcurs_inchstr\fR(3X)
410init_color/\fBcurs_color\fR(3X)
411init_pair/\fBcurs_color\fR(3X)
412initscr/\fBcurs_initscr\fR(3X)
413innstr/\fBcurs_instr\fR(3X)
414innwstr/\fBcurs_inwstr\fR(3X)
415ins_nwstr/\fBcurs_ins_wstr\fR(3X)
416ins_wch/\fBcurs_ins_wch\fR(3X)
417ins_wstr/\fBcurs_ins_wstr\fR(3X)
418insch/\fBcurs_insch\fR(3X)
419insdelln/\fBcurs_deleteln\fR(3X)
420insertln/\fBcurs_deleteln\fR(3X)
421insnstr/\fBcurs_insstr\fR(3X)
422insstr/\fBcurs_insstr\fR(3X)
423instr/\fBcurs_instr\fR(3X)
424intrflush/\fBcurs_inopts\fR(3X)
425inwstr/\fBcurs_inwstr\fR(3X)
426is_cleared/\fBcurs_opaque\fR(3X)*
427is_idcok/\fBcurs_opaque\fR(3X)*
428is_idlok/\fBcurs_opaque\fR(3X)*
429is_immedok/\fBcurs_opaque\fR(3X)*
430is_keypad/\fBcurs_opaque\fR(3X)*
431is_leaveok/\fBcurs_opaque\fR(3X)*
432is_linetouched/\fBcurs_touch\fR(3X)
433is_nodelay/\fBcurs_opaque\fR(3X)*
434is_notimeout/\fBcurs_opaque\fR(3X)*
435is_scrollok/\fBcurs_opaque\fR(3X)*
436is_syncok/\fBcurs_opaque\fR(3X)*
437is_term_resized/\fBresizeterm\fR(3X)*
438is_wintouched/\fBcurs_touch\fR(3X)
439isendwin/\fBcurs_initscr\fR(3X)
440key_defined/\fBkey_defined\fR(3X)*
441key_name/\fBcurs_util\fR(3X)
442keybound/\fBkeybound\fR(3X)*
443keyname/\fBcurs_util\fR(3X)
444keyok/\fBkeyok\fR(3X)*
445keypad/\fBcurs_inopts\fR(3X)
446killchar/\fBcurs_termattrs\fR(3X)
447killwchar/\fBcurs_termattrs\fR(3X)
448leaveok/\fBcurs_outopts\fR(3X)
449longname/\fBcurs_termattrs\fR(3X)
450mcprint/\fBcurs_print\fR(3X)*
451meta/\fBcurs_inopts\fR(3X)
452mouse_trafo/\fBcurs_mouse\fR(3X)*
453mouseinterval/\fBcurs_mouse\fR(3X)*
454mousemask/\fBcurs_mouse\fR(3X)*
455move/\fBcurs_move\fR(3X)
456mvadd_wch/\fBcurs_add_wch\fR(3X)
457mvadd_wchnstr/\fBcurs_add_wchstr\fR(3X)
458mvadd_wchstr/\fBcurs_add_wchstr\fR(3X)
459mvaddch/\fBcurs_addch\fR(3X)
460mvaddchnstr/\fBcurs_addchstr\fR(3X)
461mvaddchstr/\fBcurs_addchstr\fR(3X)
462mvaddnstr/\fBcurs_addstr\fR(3X)
463mvaddnwstr/\fBcurs_addwstr\fR(3X)
464mvaddstr/\fBcurs_addstr\fR(3X)
465mvaddwstr/\fBcurs_addwstr\fR(3X)
466mvchgat/\fBcurs_attr\fR(3X)
467mvcur/\fBcurs_terminfo\fR(3X)
468mvdelch/\fBcurs_delch\fR(3X)
469mvderwin/\fBcurs_window\fR(3X)
470mvget_wch/\fBcurs_get_wch\fR(3X)
471mvget_wstr/\fBcurs_get_wstr\fR(3X)
472mvgetch/\fBcurs_getch\fR(3X)
473mvgetn_wstr/\fBcurs_get_wstr\fR(3X)
474mvgetnstr/\fBcurs_getstr\fR(3X)
475mvgetstr/\fBcurs_getstr\fR(3X)
476mvhline/\fBcurs_border\fR(3X)
477mvhline_set/\fBcurs_border_set\fR(3X)
478mvin_wch/\fBcurs_in_wch\fR(3X)
479mvin_wchnstr/\fBcurs_in_wchstr\fR(3X)
480mvin_wchstr/\fBcurs_in_wchstr\fR(3X)
481mvinch/\fBcurs_inch\fR(3X)
482mvinchnstr/\fBcurs_inchstr\fR(3X)
483mvinchstr/\fBcurs_inchstr\fR(3X)
484mvinnstr/\fBcurs_instr\fR(3X)
485mvinnwstr/\fBcurs_inwstr\fR(3X)
486mvins_nwstr/\fBcurs_ins_wstr\fR(3X)
487mvins_wch/\fBcurs_ins_wch\fR(3X)
488mvins_wstr/\fBcurs_ins_wstr\fR(3X)
489mvinsch/\fBcurs_insch\fR(3X)
490mvinsnstr/\fBcurs_insstr\fR(3X)
491mvinsstr/\fBcurs_insstr\fR(3X)
492mvinstr/\fBcurs_instr\fR(3X)
493mvinwstr/\fBcurs_inwstr\fR(3X)
494mvprintw/\fBcurs_printw\fR(3X)
495mvscanw/\fBcurs_scanw\fR(3X)
496mvvline/\fBcurs_border\fR(3X)
497mvvline_set/\fBcurs_border_set\fR(3X)
498mvwadd_wch/\fBcurs_add_wch\fR(3X)
499mvwadd_wchnstr/\fBcurs_add_wchstr\fR(3X)
500mvwadd_wchstr/\fBcurs_add_wchstr\fR(3X)
501mvwaddch/\fBcurs_addch\fR(3X)
502mvwaddchnstr/\fBcurs_addchstr\fR(3X)
503mvwaddchstr/\fBcurs_addchstr\fR(3X)
504mvwaddnstr/\fBcurs_addstr\fR(3X)
505mvwaddnwstr/\fBcurs_addwstr\fR(3X)
506mvwaddstr/\fBcurs_addstr\fR(3X)
507mvwaddwstr/\fBcurs_addwstr\fR(3X)
508mvwchgat/\fBcurs_attr\fR(3X)
509mvwdelch/\fBcurs_delch\fR(3X)
510mvwget_wch/\fBcurs_get_wch\fR(3X)
511mvwget_wstr/\fBcurs_get_wstr\fR(3X)
512mvwgetch/\fBcurs_getch\fR(3X)
513mvwgetn_wstr/\fBcurs_get_wstr\fR(3X)
514mvwgetnstr/\fBcurs_getstr\fR(3X)
515mvwgetstr/\fBcurs_getstr\fR(3X)
516mvwhline/\fBcurs_border\fR(3X)
517mvwhline_set/\fBcurs_border_set\fR(3X)
518mvwin/\fBcurs_window\fR(3X)
519mvwin_wch/\fBcurs_in_wch\fR(3X)
520mvwin_wchnstr/\fBcurs_in_wchstr\fR(3X)
521mvwin_wchstr/\fBcurs_in_wchstr\fR(3X)
522mvwinch/\fBcurs_inch\fR(3X)
523mvwinchnstr/\fBcurs_inchstr\fR(3X)
524mvwinchstr/\fBcurs_inchstr\fR(3X)
525mvwinnstr/\fBcurs_instr\fR(3X)
526mvwinnwstr/\fBcurs_inwstr\fR(3X)
527mvwins_nwstr/\fBcurs_ins_wstr\fR(3X)
528mvwins_wch/\fBcurs_ins_wch\fR(3X)
529mvwins_wstr/\fBcurs_ins_wstr\fR(3X)
530mvwinsch/\fBcurs_insch\fR(3X)
531mvwinsnstr/\fBcurs_insstr\fR(3X)
532mvwinsstr/\fBcurs_insstr\fR(3X)
533mvwinstr/\fBcurs_instr\fR(3X)
534mvwinwstr/\fBcurs_inwstr\fR(3X)
535mvwprintw/\fBcurs_printw\fR(3X)
536mvwscanw/\fBcurs_scanw\fR(3X)
537mvwvline/\fBcurs_border\fR(3X)
538mvwvline_set/\fBcurs_border_set\fR(3X)
539napms/\fBcurs_kernel\fR(3X)
540newpad/\fBcurs_pad\fR(3X)
541newterm/\fBcurs_initscr\fR(3X)
542newwin/\fBcurs_window\fR(3X)
543nl/\fBcurs_outopts\fR(3X)
544nocbreak/\fBcurs_inopts\fR(3X)
545nodelay/\fBcurs_inopts\fR(3X)
546noecho/\fBcurs_inopts\fR(3X)
547nofilter/\fBcurs_util\fR(3X)*
548nonl/\fBcurs_outopts\fR(3X)
549noqiflush/\fBcurs_inopts\fR(3X)
550noraw/\fBcurs_inopts\fR(3X)
551notimeout/\fBcurs_inopts\fR(3X)
552overlay/\fBcurs_overlay\fR(3X)
553overwrite/\fBcurs_overlay\fR(3X)
554pair_content/\fBcurs_color\fR(3X)
555pechochar/\fBcurs_pad\fR(3X)
556pnoutrefresh/\fBcurs_pad\fR(3X)
557prefresh/\fBcurs_pad\fR(3X)
558printw/\fBcurs_printw\fR(3X)
559putp/\fBcurs_terminfo\fR(3X)
560putwin/\fBcurs_util\fR(3X)
561qiflush/\fBcurs_inopts\fR(3X)
562raw/\fBcurs_inopts\fR(3X)
563redrawwin/\fBcurs_refresh\fR(3X)
564refresh/\fBcurs_refresh\fR(3X)
565reset_prog_mode/\fBcurs_kernel\fR(3X)
566reset_shell_mode/\fBcurs_kernel\fR(3X)
567resetty/\fBcurs_kernel\fR(3X)
568resizeterm/\fBresizeterm\fR(3X)*
569restartterm/\fBcurs_terminfo\fR(3X)
570ripoffline/\fBcurs_kernel\fR(3X)
571savetty/\fBcurs_kernel\fR(3X)
572scanw/\fBcurs_scanw\fR(3X)
573scr_dump/\fBcurs_scr_dump\fR(3X)
574scr_init/\fBcurs_scr_dump\fR(3X)
575scr_restore/\fBcurs_scr_dump\fR(3X)
576scr_set/\fBcurs_scr_dump\fR(3X)
577scrl/\fBcurs_scroll\fR(3X)
578scroll/\fBcurs_scroll\fR(3X)
579scrollok/\fBcurs_outopts\fR(3X)
580set_curterm/\fBcurs_terminfo\fR(3X)
581set_term/\fBcurs_initscr\fR(3X)
582setcchar/\fBcurs_getcchar\fR(3X)
583setscrreg/\fBcurs_outopts\fR(3X)
584setsyx/\fBcurs_kernel\fR(3X)
585setterm/\fBcurs_terminfo\fR(3X)
586setupterm/\fBcurs_terminfo\fR(3X)
587slk_attr/\fBcurs_slk\fR(3X)*
588slk_attr_off/\fBcurs_slk\fR(3X)
589slk_attr_on/\fBcurs_slk\fR(3X)
590slk_attr_set/\fBcurs_slk\fR(3X)
591slk_attroff/\fBcurs_slk\fR(3X)
592slk_attron/\fBcurs_slk\fR(3X)
593slk_attrset/\fBcurs_slk\fR(3X)
594slk_clear/\fBcurs_slk\fR(3X)
595slk_color/\fBcurs_slk\fR(3X)
596slk_init/\fBcurs_slk\fR(3X)
597slk_label/\fBcurs_slk\fR(3X)
598slk_noutrefresh/\fBcurs_slk\fR(3X)
599slk_refresh/\fBcurs_slk\fR(3X)
600slk_restore/\fBcurs_slk\fR(3X)
601slk_set/\fBcurs_slk\fR(3X)
602slk_touch/\fBcurs_slk\fR(3X)
603standend/\fBcurs_attr\fR(3X)
604standout/\fBcurs_attr\fR(3X)
605start_color/\fBcurs_color\fR(3X)
606subpad/\fBcurs_pad\fR(3X)
607subwin/\fBcurs_window\fR(3X)
608syncok/\fBcurs_window\fR(3X)
609term_attrs/\fBcurs_termattrs\fR(3X)
610termattrs/\fBcurs_termattrs\fR(3X)
611termname/\fBcurs_termattrs\fR(3X)
612tgetent/\fBcurs_termcap\fR(3X)
613tgetflag/\fBcurs_termcap\fR(3X)
614tgetnum/\fBcurs_termcap\fR(3X)
615tgetstr/\fBcurs_termcap\fR(3X)
616tgoto/\fBcurs_termcap\fR(3X)
617tigetflag/\fBcurs_terminfo\fR(3X)
618tigetnum/\fBcurs_terminfo\fR(3X)
619tigetstr/\fBcurs_terminfo\fR(3X)
620timeout/\fBcurs_inopts\fR(3X)
621touchline/\fBcurs_touch\fR(3X)
622touchwin/\fBcurs_touch\fR(3X)
623tparm/\fBcurs_terminfo\fR(3X)
624tputs/\fBcurs_termcap\fR(3X)
625tputs/\fBcurs_terminfo\fR(3X)
626trace/\fBcurs_trace\fR(3X)*
627typeahead/\fBcurs_inopts\fR(3X)
628unctrl/\fBcurs_util\fR(3X)
629unget_wch/\fBcurs_get_wch\fR(3X)
630ungetch/\fBcurs_getch\fR(3X)
631ungetmouse/\fBcurs_mouse\fR(3X)*
632untouchwin/\fBcurs_touch\fR(3X)
633use_default_colors/\fBdefault_colors\fR(3X)*
634use_env/\fBcurs_util\fR(3X)
635use_extended_names/\fBcurs_extend\fR(3X)*
636use_legacy_coding/\fBlegacy_coding\fR(3X)*
637vid_attr/\fBcurs_terminfo\fR(3X)
638vid_puts/\fBcurs_terminfo\fR(3X)
639vidattr/\fBcurs_terminfo\fR(3X)
640vidputs/\fBcurs_terminfo\fR(3X)
641vline/\fBcurs_border\fR(3X)
642vline_set/\fBcurs_border_set\fR(3X)
643vw_printw/\fBcurs_printw\fR(3X)
644vw_scanw/\fBcurs_scanw\fR(3X)
645vwprintw/\fBcurs_printw\fR(3X)
646vwscanw/\fBcurs_scanw\fR(3X)
647wadd_wch/\fBcurs_add_wch\fR(3X)
648wadd_wchnstr/\fBcurs_add_wchstr\fR(3X)
649wadd_wchstr/\fBcurs_add_wchstr\fR(3X)
650waddch/\fBcurs_addch\fR(3X)
651waddchnstr/\fBcurs_addchstr\fR(3X)
652waddchstr/\fBcurs_addchstr\fR(3X)
653waddnstr/\fBcurs_addstr\fR(3X)
654waddnwstr/\fBcurs_addwstr\fR(3X)
655waddstr/\fBcurs_addstr\fR(3X)
656waddwstr/\fBcurs_addwstr\fR(3X)
657wattr_get/\fBcurs_attr\fR(3X)
658wattr_off/\fBcurs_attr\fR(3X)
659wattr_on/\fBcurs_attr\fR(3X)
660wattr_set/\fBcurs_attr\fR(3X)
661wattroff/\fBcurs_attr\fR(3X)
662wattron/\fBcurs_attr\fR(3X)
663wattrset/\fBcurs_attr\fR(3X)
664wbkgd/\fBcurs_bkgd\fR(3X)
665wbkgdset/\fBcurs_bkgd\fR(3X)
666wbkgrnd/\fBcurs_bkgrnd\fR(3X)
667wbkgrndset/\fBcurs_bkgrnd\fR(3X)
668wborder/\fBcurs_border\fR(3X)
669wborder_set/\fBcurs_border_set\fR(3X)
670wchgat/\fBcurs_attr\fR(3X)
671wclear/\fBcurs_clear\fR(3X)
672wclrtobot/\fBcurs_clear\fR(3X)
673wclrtoeol/\fBcurs_clear\fR(3X)
674wcolor_set/\fBcurs_attr\fR(3X)
675wcursyncup/\fBcurs_window\fR(3X)
676wdelch/\fBcurs_delch\fR(3X)
677wdeleteln/\fBcurs_deleteln\fR(3X)
678wecho_wchar/\fBcurs_add_wch\fR(3X)
679wechochar/\fBcurs_addch\fR(3X)
680wenclose/\fBcurs_mouse\fR(3X)*
681werase/\fBcurs_clear\fR(3X)
682wget_wch/\fBcurs_get_wch\fR(3X)
683wget_wstr/\fBcurs_get_wstr\fR(3X)
684wgetbkgrnd/\fBcurs_bkgrnd\fR(3X)
685wgetch/\fBcurs_getch\fR(3X)
686wgetn_wstr/\fBcurs_get_wstr\fR(3X)
687wgetnstr/\fBcurs_getstr\fR(3X)
688wgetstr/\fBcurs_getstr\fR(3X)
689whline/\fBcurs_border\fR(3X)
690whline_set/\fBcurs_border_set\fR(3X)
691win_wch/\fBcurs_in_wch\fR(3X)
692win_wchnstr/\fBcurs_in_wchstr\fR(3X)
693win_wchstr/\fBcurs_in_wchstr\fR(3X)
694winch/\fBcurs_inch\fR(3X)
695winchnstr/\fBcurs_inchstr\fR(3X)
696winchstr/\fBcurs_inchstr\fR(3X)
697winnstr/\fBcurs_instr\fR(3X)
698winnwstr/\fBcurs_inwstr\fR(3X)
699wins_nwstr/\fBcurs_ins_wstr\fR(3X)
700wins_wch/\fBcurs_ins_wch\fR(3X)
701wins_wstr/\fBcurs_ins_wstr\fR(3X)
702winsch/\fBcurs_insch\fR(3X)
703winsdelln/\fBcurs_deleteln\fR(3X)
704winsertln/\fBcurs_deleteln\fR(3X)
705winsnstr/\fBcurs_insstr\fR(3X)
706winsstr/\fBcurs_insstr\fR(3X)
707winstr/\fBcurs_instr\fR(3X)
708winwstr/\fBcurs_inwstr\fR(3X)
709wmouse_trafo/\fBcurs_mouse\fR(3X)*
710wmove/\fBcurs_move\fR(3X)
711wnoutrefresh/\fBcurs_refresh\fR(3X)
712wprintw/\fBcurs_printw\fR(3X)
713wredrawln/\fBcurs_refresh\fR(3X)
714wrefresh/\fBcurs_refresh\fR(3X)
715wresize/\fBwresize\fR(3X)*
716wscanw/\fBcurs_scanw\fR(3X)
717wscrl/\fBcurs_scroll\fR(3X)
718wsetscrreg/\fBcurs_outopts\fR(3X)
719wstandend/\fBcurs_attr\fR(3X)
720wstandout/\fBcurs_attr\fR(3X)
721wsyncdown/\fBcurs_window\fR(3X)
722wsyncup/\fBcurs_window\fR(3X)
723wtimeout/\fBcurs_inopts\fR(3X)
724wtouchln/\fBcurs_touch\fR(3X)
725wunctrl/\fBcurs_util\fR(3X)
726wvline/\fBcurs_border\fR(3X)
727wvline_set/\fBcurs_border_set\fR(3X)
728.TE
729.SH RETURN VALUE
730Routines that return an integer return \fBERR\fR upon failure and an
731integer value other than \fBERR\fR upon successful completion, unless
732otherwise noted in the routine descriptions.
733.PP
734All macros return the value of the \fBw\fR version, except \fBsetscrreg\fR,
735\fBwsetscrreg\fR, \fBgetyx\fR, \fBgetbegyx\fR, and \fBgetmaxyx\fR.
736The return values of \fBsetscrreg\fR, \fBwsetscrreg\fR, \fBgetyx\fR, \fBgetbegyx\fR, and
737\fBgetmaxyx\fR are undefined (i.e., these should not be used as the
738right-hand side of assignment statements).
739.PP
740Routines that return pointers return \fBNULL\fR on error.
741.SH ENVIRONMENT
742The following environment symbols are useful for customizing the
743runtime behavior of the \fBncurses\fR library.
744The most important ones have been already discussed in detail.
745.TP 5
746BAUDRATE
747The debugging library checks this environment symbol when the application
748has redirected output to a file.
749The symbol's numeric value is used for the baudrate.
750If no value is found, \fBncurses\fR uses 9600.
751This allows testers to construct repeatable test-cases
752that take into account costs that depend on baudrate.
753.TP 5
754CC
755When set, change occurrences of the command_character
756(i.e., the \fBcmdch\fP capability)
757of the loaded terminfo entries to the value of this symbol.
758Very few terminfo entries provide this feature.
759.TP 5
760COLUMNS
761Specify the width of the screen in characters.
762Applications running in a windowing environment usually are able to
763obtain the width of the window in which they are executing.
764If neither the \fBCOLUMNS\fP value nor the terminal's screen size is available,
765\fBncurses\fR uses the size which may be specified in the terminfo database
766(i.e., the \fBcols\fR capability).
767.IP
768It is important that your application use a correct size for the screen.
769This is not always possible because your application may be
770running on a host which does not honor NAWS (Negotiations About Window
771Size), or because you are temporarily running as another user.
772However, setting \fBCOLUMNS\fP and/or \fBLINES\fP overrides the library's
773use of the screen size obtained from the operating system.
774.IP
775Either \fBCOLUMNS\fP or \fBLINES\fP symbols may be specified independently.
776This is mainly useful to circumvent legacy misfeatures of terminal descriptions,
777e.g., xterm which commonly specifies a 65 line screen.
778For best results, \fBlines\fR and \fBcols\fR should not be specified in
779a terminal description for terminals which are run as emulations.
780.IP
781Use the \fBuse_env\fR function to disable all use of external environment
782(including system calls) to determine the screen size.
783.TP 5
784ESCDELAY
785Specifies the total time, in milliseconds, for which ncurses will
786await a character sequence, e.g., a function key.
787The default value, 1000 milliseconds, is enough for most uses.
788However, it is made a variable to accommodate unusual applications.
789.IP
790The most common instance where you may wish to change this value
791is to work with slow hosts, e.g., running on a network.
792If the host cannot read characters rapidly enough, it will have the same
793effect as if the terminal did not send characters rapidly enough.
794The library will still see a timeout.
795.IP
796Note that xterm mouse events are built up from character sequences
797received from the xterm.
798If your application makes heavy use of multiple-clicking, you may
799wish to lengthen this default value because the timeout applies
800to the composed multi-click event as well as the individual clicks.
801.IP
802In addition to the environment variable,
803this implementation provides a global variable with the same name.
804Portable applications should not rely upon the presence of ESCDELAY
805in either form,
806but setting the environment variable rather than the global variable
807does not create problems when compiling an application.
808.TP 5
809HOME
810Tells \fBncurses\fR where your home directory is.
811That is where it may read and write auxiliary terminal descriptions:
812.IP
813$HOME/.termcap
814.br
815$HOME/.terminfo
816.TP 5
817LINES
818Like COLUMNS, specify the height of the screen in characters.
819See COLUMNS for a detailed description.
820.TP 5
821MOUSE_BUTTONS_123
822This applies only to the OS/2 EMX port.
823It specifies the order of buttons on the mouse.
824OS/2 numbers a 3-button mouse inconsistently from other
825platforms:
826.sp
8271 = left
828.br
8292 = right
830.br
8313 = middle.
832.sp
833This symbol lets you customize the mouse.
834The symbol must be three numeric digits 1-3 in any order, e.g., 123 or 321.
835If it is not specified, \fBncurses\fR uses 132.
836.TP 5
837NCURSES_ASSUMED_COLORS
838Override the compiled-in assumption that the
839terminal's default colors are white-on-black
840(see \fBdefault_colors\fR(3X)).
841You may set the foreground and background color values with this environment
842variable by proving a 2-element list: foreground,background.
843For example, to tell ncurses to not assume anything
844about the colors, set this to "-1,-1".
845To make it green-on-black, set it to "2,0".
846Any positive value from zero to the terminfo \fBmax_colors\fR value is allowed.
847.TP 5
848NCURSES_GPM_TERMS
849This applies only to ncurses configured to use the GPM interface.
850.IP
851If present,
852the environment variable is a list of one or more terminal names
853against which the TERM environment variable is matched.
854Setting it to an empty value disables the GPM interface;
855using the built-in support for xterm, etc.
856.IP
857If the environment variable is absent,
858ncurses will attempt to open GPM if TERM contains "linux".
859.TP 5
860NCURSES_NO_HARD_TABS
861\fBNcurses\fP may use tabs as part of the cursor movement optimization.
862In some cases,
863your terminal driver may not handle these properly.
864Set this environment variable to disable the feature.
865You can also adjust your \fBstty\fP settings to avoid the problem.
866.TP 5
867NCURSES_NO_MAGIC_COOKIES
868Some terminals use a magic-cookie feature which requires special handling
869to make highlighting and other video attributes display properly.
870You can suppress the highlighting entirely for these terminals by
871setting this environment variable.
872.TP 5
873NCURSES_NO_PADDING
874Most of the terminal descriptions in the terminfo database are written
875for real "hardware" terminals.
876Many people use terminal emulators
877which run in a windowing environment and use curses-based applications.
878Terminal emulators can duplicate
879all of the important aspects of a hardware terminal, but they do not
880have the same limitations.
881The chief limitation of a hardware terminal from the standpoint
882of your application is the management of dataflow, i.e., timing.
883Unless a hardware terminal is interfaced into a terminal concentrator
884(which does flow control),
885it (or your application) must manage dataflow, preventing overruns.
886The cheapest solution (no hardware cost)
887is for your program to do this by pausing after
888operations that the terminal does slowly, such as clearing the display.
889.IP
890As a result, many terminal descriptions (including the vt100)
891have delay times embedded.
892You may wish to use these descriptions,
893but not want to pay the performance penalty.
894.IP
895Set the NCURSES_NO_PADDING symbol to disable all but mandatory
896padding.
897Mandatory padding is used as a part of special control
898sequences such as \fIflash\fR.
899.TP 5
900NCURSES_NO_SETBUF
901Normally \fBncurses\fR enables buffered output during terminal initialization.
902This is done (as in SVr4 curses) for performance reasons.
903For testing purposes, both of \fBncurses\fR and certain applications,
904this feature is made optional.
905Setting the NCURSES_NO_SETBUF variable
906disables output buffering, leaving the output in the original (usually
907line buffered) mode.
908.TP 5
909NCURSES_NO_UTF8_ACS
910During initialization, the \fBncurses\fR library
911checks for special cases where VT100 line-drawing (and the corresponding
912alternate character set capabilities) described in the terminfo are known
913to be missing.
914Specifically, when running in a UTF-8 locale,
915the Linux console emulator and the GNU screen program ignore these.
916Ncurses checks the TERM environment variable for these.
917For other special cases, you should set this environment variable.
918Doing this tells ncurses to use Unicode values which correspond to
919the VT100 line-drawing glyphs.
920That works for the special cases cited,
921and is likely to work for terminal emulators.
922.IP
923When setting this variable, you should set it to a nonzero value.
924Setting it to zero (or to a nonnumber)
925disables the special check for Linux and screen.
926.TP 5
927NCURSES_TRACE
928During initialization, the \fBncurses\fR debugging library
929checks the NCURSES_TRACE symbol.
930If it is defined, to a numeric value, \fBncurses\fR calls the \fBtrace\fR
931function, using that value as the argument.
932.IP
933The argument values, which are defined in \fBcurses.h\fR, provide several
934types of information.
935When running with traces enabled, your application will write the
936file \fBtrace\fR to the current directory.
937.TP 5
938TERM
939Denotes your terminal type.
940Each terminal type is distinct, though many are similar.
941.TP 5
942TERMCAP
943If the \fBncurses\fR library has been configured with \fItermcap\fR
944support, \fBncurses\fR will check for a terminal's description in
945termcap form if it is not available in the terminfo database.
946.IP
947The TERMCAP symbol contains either a terminal description (with
948newlines stripped out),
949or a file name telling where the information denoted by the TERM symbol exists.
950In either case, setting it directs \fBncurses\fR to ignore
951the usual place for this information, e.g., /etc/termcap.
952.TP 5
953TERMINFO
954Overrides the directory in which \fBncurses\fR searches for your terminal
955description.
956This is the simplest, but not the only way to change the list of directories.
957The complete list of directories in order follows:
958.RS
959.TP 3
960-
961the last directory to which \fBncurses\fR wrote, if any, is searched first
962.TP 3
963-
964the directory specified by the TERMINFO symbol
965.TP 3
966-
967$HOME/.terminfo
968.TP 3
969-
970directories listed in the TERMINFO_DIRS symbol
971.TP 3
972-
973one or more directories whose names are configured and compiled into the
974ncurses library, e.g.,
975@TERMINFO@
976.RE
977.TP 5
978TERMINFO_DIRS
979Specifies a list of directories to search for terminal descriptions.
980The list is separated by colons (i.e., ":") on Unix, semicolons on OS/2 EMX.
981All of the terminal descriptions are in terminfo form, which makes
982a subdirectory named for the first letter of the terminal names therein.
983.TP 5
984TERMPATH
985If TERMCAP does not hold a file name then \fBncurses\fR checks
986the TERMPATH symbol.
987This is a list of filenames separated by spaces or colons (i.e., ":") on Unix, semicolons on OS/2 EMX.
988If the TERMPATH symbol is not set, \fBncurses\fR looks in the files
989/etc/termcap, /usr/share/misc/termcap and $HOME/.termcap, in that order.
990.PP
991The library may be configured to disregard the following variables when the
992current user is the superuser (root), or if the application uses setuid or
993setgid permissions:
994$TERMINFO, $TERMINFO_DIRS, $TERMPATH, as well as $HOME.
995.SH ALTERNATE CONFIGURATIONS
996Several different configurations are possible,
997depending on the configure script options used when building \fBncurses\fP.
998There are a few main options whose effects are visible to the applications
999developer using \fBncurses\fP:
1000.TP 5
1001--disable-overwrite
1002The standard include for \fBncurses\fP is as noted in \fBSYNOPSIS\fP:
1003.RS
1004.sp
1005\fB#include <curses.h>\fR
1006.RE
1007.IP
1008This option is used to avoid filename conflicts when \fBncurses\fP
1009is not the main implementation of curses of the computer.
1010If \fBncurses\fP is installed disabling overwrite, it puts its headers in
1011a subdirectory, e.g.,
1012.RS
1013.sp
1014\fB#include <ncurses/curses.h>\fR
1015.RE
1016.IP
1017It also omits a symbolic link which would allow you to use \fB-lcurses\fP
1018to build executables.
1019.TP 5
1020--enable-widec
1021The configure script renames the library and (if the \fB--disable-overwrite\fP
1022option is used) puts the header files in a different subdirectory.
1023All of the library names have a "w" appended to them,
1024i.e., instead of
1025.RS
1026.sp
1027\fB-lncurses\fR
1028.RE
1029.IP
1030you link with
1031.RS
1032.sp
1033\fB-lncursesw\fR
1034.RE
1035.IP
1036You must also define \fB_XOPEN_SOURCE_EXTENDED\fP when compiling for the
1037wide-character library to use the extended (wide-character) functions.
1038The \fBcurses.h\fP file which is installed for the wide-character
1039library is designed to be compatible with the normal library's header.
1040Only the size of the \fBWINDOW\fP structure differs, and very few
1041applications require more than a pointer to \fBWINDOW\fPs.
1042If the headers are installed allowing overwrite,
1043the wide-character library's headers should be installed last,
1044to allow applications to be built using either library
1045from the same set of headers.
1046.TP 5
1047--with-shared
1048.TP
1049--with-normal
1050.TP
1051--with-debug
1052.TP
1053--with-profile
1054The shared and normal (static) library names differ by their suffixes,
1055e.g., \fBlibncurses.so\fP and \fBlibncurses.a\fP.
1056The debug and profiling libraries add a "_g" and a "_p" to the root
1057names respectively,
1058e.g., \fBlibncurses_g.a\fP and \fBlibncurses_p.a\fP.
1059.TP 5
1060--with-trace
1061The \fBtrace\fP function normally resides in the debug library,
1062but it is sometimes useful to configure this in the shared library.
1063Configure scripts should check for the function's existence rather
1064than assuming it is always in the debug library.
1065.SH FILES
1066.TP 5
1067@DATADIR@/tabset
1068directory containing initialization files for the terminal capability database
1069@TERMINFO@
1070terminal capability database
1071.SH SEE ALSO
1072\fBterminfo\fR(\*n) and related pages whose names begin "curs_" for detailed routine
1073descriptions.
1074.SH EXTENSIONS
1075The \fBncurses\fR library can be compiled with an option (\fB-DUSE_GETCAP\fR)
1076that falls back to the old-style /etc/termcap file if the terminal setup code
1077cannot find a terminfo entry corresponding to \fBTERM\fR.
1078Use of this feature
1079is not recommended, as it essentially includes an entire termcap compiler in
1080the \fBncurses\fR startup code, at significant cost in core and startup cycles.
1081.PP
1082The \fBncurses\fR library includes facilities for capturing mouse events on
1083certain terminals (including xterm).
1084See the \fBcurs_mouse\fR(3X)
1085manual page for details.
1086.PP
1087The \fBncurses\fR library includes facilities for responding to window
1088resizing events, e.g., when running in an xterm.
1089See the \fBresizeterm\fR(3X)
1090and \fBwresize\fR(3X) manual pages for details.
1091In addition, the library may be configured with a SIGWINCH handler.
1092.PP
1093The \fBncurses\fR library extends the fixed set of function key capabilities
1094of terminals by allowing the application designer to define additional
1095key sequences at runtime.
1096See the \fBdefine_key\fR(3X)
1097\fBkey_defined\fR(3X),
1098and \fBkeyok\fR(3X) manual pages for details.
1099.PP
1100The \fBncurses\fR library can exploit the capabilities of terminals which
1101implement the ISO-6429 SGR 39 and SGR 49 controls, which allow an application
1102to reset the terminal to its original foreground and background colors.
1103From the users' perspective, the application is able to draw colored
1104text on a background whose color is set independently, providing better
1105control over color contrasts.
1106See the \fBdefault_colors\fR(3X) manual page for details.
1107.PP
1108The \fBncurses\fR library includes a function for directing application output
1109to a printer attached to the terminal device.
1110See the \fBcurs_print\fR(3X) manual page for details.
1111.SH PORTABILITY
1112The \fBncurses\fR library is intended to be BASE-level conformant with XSI
1113Curses.
1114The EXTENDED XSI Curses functionality
1115(including color support) is supported.
1116.PP
1117A small number of local differences (that is, individual differences between
1118the XSI Curses and \fBncurses\fR calls) are described in \fBPORTABILITY\fR
1119sections of the library man pages.
1120.PP
1121This implementation also contains several extensions:
1122.RS 5
1123.PP
1124The routine \fBhas_key\fR is not part of XPG4, nor is it present in SVr4.
1125See the \fBcurs_getch\fR(3X) manual page for details.
1126.PP
1127The routine \fBslk_attr\fR is not part of XPG4, nor is it present in SVr4.
1128See the \fBcurs_slk\fR(3X) manual page for details.
1129.PP
1130The routines \fBgetmouse\fR, \fBmousemask\fR, \fBungetmouse\fR,
1131\fBmouseinterval\fR, and \fBwenclose\fR relating to mouse interfacing are not
1132part of XPG4, nor are they present in SVr4.
1133See the \fBcurs_mouse\fR(3X) manual page for details.
1134.PP
1135The routine \fBmcprint\fR was not present in any previous curses implementation.
1136See the \fBcurs_print\fR(3X) manual page for details.
1137.PP
1138The routine \fBwresize\fR is not part of XPG4, nor is it present in SVr4.
1139See the \fBwresize\fR(3X) manual page for details.
1140.PP
1141The WINDOW structure's internal details can be hidden from application
1142programs.
1143See \fBcurs_opaque\fR(3X) for the discussion of \fBis_scrollok\fR, etc.
1144.RE
1145.PP
1146In historic curses versions, delays embedded in the capabilities \fBcr\fR,
1147\fBind\fR, \fBcub1\fR, \fBff\fR and \fBtab\fR activated corresponding delay
1148bits in the UNIX tty driver.
1149In this implementation, all padding is done by sending NUL bytes.
1150This method is slightly more expensive, but narrows the interface
1151to the UNIX kernel significantly and increases the package's portability
1152correspondingly.
1153.SH NOTES
1154The header file \fB<curses.h>\fR automatically includes the header files
1155\fB<stdio.h>\fR and \fB<unctrl.h>\fR.
1156.PP
1157If standard output from a \fBncurses\fR program is re-directed to something
1158which is not a tty, screen updates will be directed to standard error.
1159This was an undocumented feature of AT&T System V Release 3 curses.
1160.SH AUTHORS
1161Zeyd M. Ben-Halim, Eric S. Raymond, Thomas E. Dickey.
1162Based on pcurses by Pavel Curtis.
1163.\"#
1164.\"# The following sets edit modes for GNU EMACS
1165.\"# Local Variables:
1166.\"# mode:nroff
1167.\"# fill-column:79
1168.\"# End: