-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: NEWS,v 1.2829 2017/04/30 01:26:45 tom Exp $
+-- $Id: NEWS,v 1.2836 2017/05/06 18:50:43 tom Exp $
-------------------------------------------------------------------------------
This is a log of changes that ncurses has gone through since Zeyd started
Changes through 1.9.9e did not credit all contributions;
it is not possible to add this information.
+20170506
+ + modify tic/infocmp display of numeric values to use hexadecimal when
+ they are "close" to a power of two, making the result more readable.
+ + improve discussion of portability in curs_mouse.3x
+ + change line-length for generated html/manpages to 78 columns from 65.
+ + improve discussion of line-drawing characters in curs_add_wch.3x
+ (prompted by discussion with Lorinczy Zsigmond).
+ + cleanup formatting of hackguide.html and ncurses-intro.html
+ + add examples for WACS_D_PLUS and WACS_T_PLUS to test/ncurses.c
+
20170429
+ corrected a case where $with_gpm was set to "maybe" after CF_WITH_GPM,
overlooked in 20160528 fixes (report by Alexandre Bury).
-5:0:9 6.0 20170429
+5:0:9 6.0 20170506
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: dist.mk,v 1.1158 2017/04/23 14:51:25 tom Exp $
+# $Id: dist.mk,v 1.1162 2017/05/06 18:10:15 tom Exp $
# Makefile for creating ncurses distributions.
#
# This only needs to be used directly as a makefile by developers, but
# These define the major/minor/patch versions of ncurses.
NCURSES_MAJOR = 6
NCURSES_MINOR = 0
-NCURSES_PATCH = 20170429
+NCURSES_PATCH = 20170506
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
# --without-manpage-renames
# on Debian/testing. The -scrollbar and -width options are used to make lynx
# use 79 columns as it did in 2.8.5 and before.
-DUMP = lynx -dump -scrollbar=0 -width=79
+DUMP = lynx -dump -scrollbar=0 -width=79 -display_charset=US-ASCII
DUMP2 = $(DUMP) -nolist
# gcc's file is "gnathtml.pl"
doc/hackguide.doc: doc/html/hackguide.html
$(DUMP2) doc/html/hackguide.html > $@
-# This is the original command:
-# MANPROG = tbl | nroff -man
-#
-# This happens to work for groff 1.18.1 on Debian. At some point groff's
-# maintainer changed the line-length (we do not want/need that here).
-#
# The distributed html files are formatted using
# configure --without-manpage-renames
#
# If that conflicts with the --without-manpage-renames, you can install those
# in a different location using the --with-install-prefix option of the
# configure script.
-MANPROG = tbl | nroff -mandoc -rLL=65n -rLT=71n -Tascii
+MANPROG = tbl | nroff -mandoc -rLL=78n -rLT=78n -Tascii
manhtml:
@for f in doc/html/man/*.html; do \
Our conventions are simple:
1. Maintain package-internal files in plain text. The expected viewer
- for them more(1) or an editor window; there's no point in
+ for them more(1) or an editor window; there is no point in
elaborate mark-up.
2. Mark up manual pages in the man macros. These have to be viewable
through traditional man(1) programs.
When in doubt, HTMLize a master and use lynx(1) to generate plain
ASCII (as we do for the announcement document).
- The reason for choosing HTML is that it's (a) well-adapted for on-line
- browsing through viewers that are everywhere; (b) more easily readable
- as plain text than most other mark-ups, if you don't have a viewer;
- and (c) carries enough information that you can generate a
+ The reason for choosing HTML is that it is (a) well-adapted for
+ on-line browsing through viewers that are everywhere; (b) more easily
+ readable as plain text than most other mark-ups, if you do not have a
+ viewer; and (c) carries enough information that you can generate a
nice-looking printed version from it. Also, of course, it make
exporting things like the announcement document to WWW pretty trivial.
subscribe <name>@<host.domain>
The ncurses code is maintained by a small group of volunteers. While
- we try our best to fix bugs promptly, we simply don't have a lot of
+ we try our best to fix bugs promptly, we simply do not have a lot of
hours to spend on elementary hand-holding. We rely on intelligent
cooperation from our users. If you think you have found a bug in
ncurses, there are some steps you can take before contacting us that
will help get the bug fixed quickly.
In order to use our bug-fixing time efficiently, we put people who
- show us they've taken these steps at the head of our queue. This means
- that if you don't, you'll probably end up at the tail end and have to
- wait a while.
+ show us they have taken these steps at the head of our queue. This
+ means that if you do not, you will probably end up at the tail end and
+ have to wait a while.
1. Develop a recipe to reproduce the bug.
Bugs we can reproduce are likely to be fixed very quickly, often
within days. The most effective single thing you can do to get a
2. Try to reproduce the bug on a different terminal type.
In our experience, most of the behaviors people report as library
bugs are actually due to subtle problems in terminal descriptions.
- This is especially likely to be true if you're using a traditional
- asynchronous terminal or PC-based terminal emulator, rather than
- xterm or a UNIX console entry.
- It's therefore extremely helpful if you can tell us whether or not
- your problem reproduces on other terminal types. Usually you'll
- have both a console type and xterm available; please tell us
+ This is especially likely to be true if you are using a
+ traditional asynchronous terminal or PC-based terminal emulator,
+ rather than xterm or a UNIX console entry.
+ It is therefore extremely helpful if you can tell us whether or
+ not your problem reproduces on other terminal types. Usually you
+ will have both a console type and xterm available; please tell us
whether or not your bug reproduces on both.
If you have xterm available, it is also good to collect xterm
reports for different window sizes. This is especially true if you
normally use an unusual xterm window size -- a surprising number
- of the bugs we've seen are either triggered or masked by these.
+ of the bugs we have seen are either triggered or masked by these.
3. Generate and examine a trace file for the broken behavior.
Recompile your program with the debugging versions of the
libraries. Insert a trace() call with the argument set to
tell you immediately if this is happening, and save you from the
possible embarrassment of being told that the bug is in your code
and is your problem rather than ours.
- If the virtual-screen dumps look correct but the bug persists,
- it's possible to crank up the trace level to give more and more
+ If the virtual-screen dumps look correct but the bug persists, it
+ is possible to crank up the trace level to give more and more
information about the library's update actions and the control
sequences it issues to perform them. The test directory of the
distribution contains a tool for digesting these logs to make them
less tedious to wade through.
- Often you'll find terminfo problems at this stage by noticing that
- the escape sequences put out for various capabilities are wrong.
- If not, you're likely to learn enough to be able to characterize
- any bug in the screen-update logic quite exactly.
+ Often you will find terminfo problems at this stage by noticing
+ that the escape sequences put out for various capabilities are
+ wrong. If not, you are likely to learn enough to be able to
+ characterize any bug in the screen-update logic quite exactly.
4. Report details and symptoms, not just interpretations.
- If you do the preceding two steps, it is very likely that you'll
+ If you do the preceding two steps, it is very likely that you will
discover the nature of the problem yourself and be able to send us
a fix. This will create happy feelings all around and earn you
- good karma for the first time you run into a bug you really can't
+ good karma for the first time you run into a bug you really cannot
characterize and fix yourself.
- If you're still stuck, at least you'll know what to tell us.
+ If you are still stuck, at least you will know what to tell us.
Remember, we need details. If you guess about what is safe to
leave out, you are too likely to be wrong.
If your bug produces a bad update, include a trace file. Try to
make the trace at the least voluminous level that pins down the
- bug. Logs that have been through tracemunch are OK, it doesn't
- throw away any information (actually they're better than
- un-munched ones because they're easier to read).
+ bug. Logs that have been through tracemunch are OK, it does not
+ throw away any information (actually they are better than
+ un-munched ones because they are easier to read).
If your bug produces a core-dump, please include a symbolic stack
trace generated by gdb(1) or your local equivalent.
- Tell us about every terminal on which you've reproduced the bug --
- and every terminal on which you can't. Ideally, sent us terminfo
- sources for all of these (yours might differ from ours).
+ Tell us about every terminal on which you have reproduced the bug
+ -- and every terminal on which you cannot. Ideally, sent us
+ terminfo sources for all of these (yours might differ from ours).
Include your ncurses version and your OS/machine type, of course!
You can find your ncurses version in the curses.h file.
The most important of these is mvcur, a test frame for the
cursor-movement optimization code. With this program, you can see
directly what control sequences will be emitted for any given cursor
- movement or scroll/insert/delete operations. If you think you've got a
- bad capability identified, you can disable it and test again. The
+ movement or scroll/insert/delete operations. If you think you have got
+ a bad capability identified, you can disable it and test again. The
program is command-driven and has on-line help.
If you think the vertical-scroll optimization is broken, or just want
lib_mouse.c lib_mvcur.c lib_refresh.c lib_setup.c lib_vidattr.c
Most of the algorithmic complexity in the library lives in these
- files. If there is a real bug in ncurses itself, it's probably here.
- We'll tour some of these files in detail below (see The Engine Room).
+ files. If there is a real bug in ncurses itself, it is probably here.
+ We will tour some of these files in detail below (see The Engine
+ Room).
Finally, there is a group of files that is actually most of the
terminfo compiler. The reason this code lives in the ncurses library
alloc_entry.c captoinfo.c comp_captab.c comp_error.c comp_hash.c
comp_parse.c comp_scan.c parse_entry.c read_termcap.c write_entry.c
- We'll discuss these in the compiler tour.
+ We will discuss these in the compiler tour.
The Engine Room
Hackers bruised by previous encounters with variant select(2) calls
may find the code in lib_twait.c interesting. It deals with the
- problem that some BSD selects don't return a reliable time-left value.
- The function timed_wait() effectively simulates a System V select.
+ problem that some BSD selects do not return a reliable time-left
+ value. The function timed_wait() effectively simulates a System V
+ select.
Mouse Events
to imply having the prefix somewhere in the function-key capabilities
at terminal-type initialization.
- This kluge only works because kmous isn't actually used by any
+ This kluge only works because kmous is not actually used by any
historic terminal type or curses implementation we know of. Best guess
- is it's a relic of some forgotten experiment in-house at Bell Labs
- that didn't leave any traces in the publicly-distributed System V
+ is it is a relic of some forgotten experiment in-house at Bell Labs
+ that did not leave any traces in the publicly-distributed System V
terminfo files. If System V or XPG4 ever gets serious about using it
again, this kluge may have to change.
TYPE_REGEXP will recognize.
The configuration code prefers the POSIX regex facility, modeled on
- System V's, but will settle for BSD regexps if the former isn't
+ System V's, but will settle for BSD regexps if the former is not
available.
Historical note: the panels code was written primarily to assist in
The implementation therefore starts with a table-driven, dual-mode
lexical analyzer (in comp_scan.c). The lexer chooses its mode (termcap
- or terminfo) based on the first `,' or `:' it finds in each entry. The
+ or terminfo) based on the first "," or ":" it finds in each entry. The
lexer does all the work of recognizing capability names and values;
the grammar above it is trivial, just "parse entries till you run out
of file".
shareable text space).
Thus, adding a new capability is usually pretty trivial, just a matter
- of adding one line to the include/Caps file. We'll have more to say
+ of adding one line to the include/Caps file. We will have more to say
about this in the section on Source-Form Translation.
Use Capability Resolution
- The background problem that makes tic tricky isn't the capability
- translation itself, it's the resolution of use capabilities. Older
+ The background problem that makes tic tricky is not the capability
+ translation itself, it is the resolution of use capabilities. Older
versions would not handle forward use references for this reason (that
is, a using terminal always had to follow its use target in the source
file). By doing this, they got away with a simple implementation
tactic; compile everything as it blows by, then resolve uses from
compiled entries.
- This won't do for ncurses. The problem is that that the whole
+ This will not do for ncurses. The problem is that that the whole
compilation process has to be embeddable in the ncurses library so
that it can be called by the startup code to translate termcap entries
- on the fly. The embedded version can't go promiscuously writing
+ on the fly. The embedded version cannot go promiscuously writing
everything it translates out to disk -- for one thing, it will
typically be running with non-root permissions.
use resolution in-memory before writing everything out. This design
has other advantages: it makes forward and back use-references equally
easy (so we get the latter for free), and it makes checking for name
- collisions before they're written out easy to do.
+ collisions before they are written out easy to do.
And this is exactly how the embedded version works. But the
stand-alone user-accessible version of tic partly reverts to the
writes out the referenced entry if it has no use capabilities. The
compiler main loop refrains from adding the entry to the in-core list
when this hook fires. If some other entry later needs to reference an
- entry that got written immediately, that's OK; the resolution code
- will fetch it off disk when it can't find it in core.
+ entry that got written immediately, that is OK; the resolution code
+ will fetch it off disk when it cannot find it in core.
Name collisions will still be detected, just not as cleanly. The
write_entry() code complains before overwriting an entry that
The include/Caps file has a header comment describing ways you can
specify source translations for nonstandard capabilities just by
- altering the master table. It's possible to set up capability aliasing
- or tell the compiler to plain ignore a given capability without
- writing any C code at all.
+ altering the master table. It is possible to set up capability
+ aliasing or tell the compiler to plain ignore a given capability
+ without writing any C code at all.
For circumstances where you need to do algorithmic translation, there
are functions in parse_entry.c called after the parse of each entry
Look for the string FIXME in source files to tag minor bugs and
potential problems that could use fixing.
- Don't try to auto-detect OS features in the main body of the C code.
- That's the job of the configuration system.
+ Do not try to auto-detect OS features in the main body of the C code.
+ That is the job of the configuration system.
To hold down complexity, do make your code data-driven. Especially, if
you can drive logic from a table filtered out of include/Caps, do it.
If you find you need to augment the data in that file in order to
- generate the proper table, that's still preferable to ad-hoc code --
- that's why the fifth field (flags) is there.
+ generate the proper table, that is still preferable to ad-hoc code --
+ that is why the fifth field (flags) is there.
Have fun!
The following notes are intended to be a first step towards DOS and
Macintosh ports of the ncurses libraries.
- The following library modules are `pure curses'; they operate only on
+ The following library modules are "pure curses"; they operate only on
the curses internal structures, do all output through other curses
calls (not including tputs() and putp()) and do not call any other
UNIX routines such as signal(2) or the stdio library. Thus, they
Modules that would have to be modified for a port start here:
- The following modules are `pure curses' but contain assumptions
+ The following modules are "pure curses" but contain assumptions
inappropriate for a memory-mapped port.
lib_longname.c
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<!--
- $Id: hackguide.html,v 1.29 2013/05/17 23:29:18 tom Exp $
+ $Id: hackguide.html,v 1.30 2017/05/05 11:50:09 tom Exp $
****************************************************************************
- * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2012,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* authorization. *
****************************************************************************
-->
-<HTML>
-<HEAD>
-<TITLE>A Hacker's Guide to Ncurses Internals</TITLE>
-<link rev="made" href="mailto:bugs-ncurses@gnu.org">
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<!--
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
+
+<html>
+<head>
+ <meta name="generator" content=
+ "HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
+
+ <title>A Hacker's Guide to Ncurses Internals</title>
+ <link rev="made" href="mailto:bugs-ncurses@gnu.org">
+ <meta http-equiv="Content-Type" content=
+ "text/html; charset=us-ascii"><!--
This document is self-contained, *except* that there is one relative link to
the ncurses-intro.html document, expected to be in the same directory with
this one.
-->
-</HEAD>
-<BODY>
-
-<H1>A Hacker's Guide to NCURSES</H1>
-
-<H1>Contents</H1>
-<UL>
-<LI><A HREF="#abstract">Abstract</A>
-<LI><A HREF="#objective">Objective of the Package</A>
-<UL>
-<LI><A HREF="#whysvr4">Why System V Curses?</A>
-<LI><A HREF="#extensions">How to Design Extensions</A>
-</UL>
-<LI><A HREF="#portability">Portability and Configuration</A>
-<LI><A HREF="#documentation">Documentation Conventions</A>
-<LI><A HREF="#bugtrack">How to Report Bugs</A>
-<LI><A HREF="#ncurslib">A Tour of the Ncurses Library</A>
-<UL>
-<LI><A HREF="#loverview">Library Overview</A>
-<LI><A HREF="#engine">The Engine Room</A>
-<LI><A HREF="#input">Keyboard Input</A>
-<LI><A HREF="#mouse">Mouse Events</A>
-<LI><A HREF="#output">Output and Screen Updating</A>
-</UL>
-<LI><A HREF="#fmnote">The Forms and Menu Libraries</A>
-<LI><A HREF="#tic">A Tour of the Terminfo Compiler</A>
-<UL>
-<LI><A HREF="#nonuse">Translation of Non-<STRONG>use</STRONG> Capabilities</A>
-<LI><A HREF="#uses">Use Capability Resolution</A>
-<LI><A HREF="#translation">Source-Form Translation</A>
-</UL>
-<LI><A HREF="#utils">Other Utilities</A>
-<LI><A HREF="#style">Style Tips for Developers</A>
-<LI><A HREF="#port">Porting Hints</A>
-</UL>
-
-<H1><A NAME="abstract">Abstract</A></H1>
-
-This document is a hacker's tour of the <STRONG>ncurses</STRONG> library and utilities.
-It discusses design philosophy, implementation methods, and the
-conventions used for coding and documentation. It is recommended
-reading for anyone who is interested in porting, extending or improving the
-package.
-
-<H1><A NAME="objective">Objective of the Package</A></H1>
-
-The objective of the <STRONG>ncurses</STRONG> package is to provide a free software API for
-character-cell terminals and terminal emulators with the following
-characteristics:
-
-<UL>
-<LI>Source-compatible with historical curses implementations (including
- the original BSD curses and System V curses.
-<LI>Conformant with the XSI Curses standard issued as part of XPG4 by
- X/Open.
-<LI>High-quality -- stable and reliable code, wide portability, good
- packaging, superior documentation.
-<LI>Featureful -- should eliminate as much of the drudgery of C interface
- programming as possible, freeing programmers to think at a higher
- level of design.
-</UL>
-
-These objectives are in priority order. So, for example, source
-compatibility with older version must trump featurefulness -- we cannot
-add features if it means breaking the portion of the API corresponding
-to historical curses versions.
-
-<H2><A NAME="whysvr4">Why System V Curses?</A></H2>
-
-We used System V curses as a model, reverse-engineering their API, in
-order to fulfill the first two objectives. <P>
-
-System V curses implementations can support BSD curses programs with
-just a recompilation, so by capturing the System V API we also
-capture BSD's. <P>
-
-More importantly for the future, the XSI Curses standard issued by X/Open
-is explicitly and closely modeled on System V. So conformance with
-System V took us most of the way to base-level XSI conformance.
-
-<H2><A NAME="extensions">How to Design Extensions</A></H2>
-
-The third objective (standards conformance) requires that it be easy to
-condition source code using <STRONG>ncurses</STRONG> so that the absence of nonstandard
-extensions does not break the code. <P>
-
-Accordingly, we have a policy of associating with each nonstandard extension
-a feature macro, so that ncurses client code can use this macro to condition
-in or out the code that requires the <STRONG>ncurses</STRONG> extension. <P>
-
-For example, there is a macro <CODE>NCURSES_MOUSE_VERSION</CODE> which XSI Curses
-does not define, but which is defined in the <STRONG>ncurses</STRONG> library header.
-You can use this to condition the calls to the mouse API calls.
-
-<H1><A NAME="portability">Portability and Configuration</A></H1>
-
-Code written for <STRONG>ncurses</STRONG> may assume an ANSI-standard C compiler and
-POSIX-compatible OS interface. It may also assume the presence of a
-System-V-compatible <EM>select(2)</EM> call. <P>
-
-We encourage (but do not require) developers to make the code friendly
-to less-capable UNIX environments wherever possible. <P>
-
-We encourage developers to support OS-specific optimizations and methods
-not available under POSIX/ANSI, provided only that:
-
-<UL>
-<LI>All such code is properly conditioned so the build process does not
- attempt to compile it under a plain ANSI/POSIX environment.
-<LI>Adding such implementation methods does not introduce incompatibilities
- in the <STRONG>ncurses</STRONG> API between platforms.
-</UL>
-
-We use GNU <CODE>autoconf(1)</CODE> as a tool to deal with portability issues.
-The right way to leverage an OS-specific feature is to modify the autoconf
-specification files (configure.in and aclocal.m4) to set up a new feature
-macro, which you then use to condition your code.
-
-<H1><A NAME="documentation">Documentation Conventions</A></H1>
-
-There are three kinds of documentation associated with this package. Each
-has a different preferred format:
-
-<UL>
-<LI>Package-internal files (README, INSTALL, TO-DO etc.)
-<LI>Manual pages.
-<LI>Everything else (i.e., narrative documentation).
-</UL>
-
-Our conventions are simple:
-<OL>
-<LI><STRONG>Maintain package-internal files in plain text.</STRONG>
- The expected viewer for them <EM>more(1)</EM> or an editor window; there's
- no point in elaborate mark-up.
-
-<LI><STRONG>Mark up manual pages in the man macros.</STRONG> These have to be viewable
- through traditional <EM>man(1)</EM> programs.
-
-<LI><STRONG>Write everything else in HTML.</STRONG>
-</OL>
-
-When in doubt, HTMLize a master and use <EM>lynx(1)</EM> to generate
-plain ASCII (as we do for the announcement document). <P>
+</head>
+
+<body>
+ <h1>A Hacker's Guide to NCURSES</h1>
+
+ <h1>Contents</h1>
+
+ <ul>
+ <li><a href="#abstract">Abstract</a></li>
+
+ <li>
+ <a href="#objective">Objective of the Package</a>
+
+ <ul>
+ <li><a href="#whysvr4">Why System V Curses?</a></li>
+
+ <li><a href="#extensions">How to Design Extensions</a></li>
+ </ul>
+ </li>
+
+ <li><a href="#portability">Portability and
+ Configuration</a></li>
+
+ <li><a href="#documentation">Documentation Conventions</a></li>
+
+ <li><a href="#bugtrack">How to Report Bugs</a></li>
+
+ <li>
+ <a href="#ncurslib">A Tour of the Ncurses Library</a>
+
+ <ul>
+ <li><a href="#loverview">Library Overview</a></li>
+
+ <li><a href="#engine">The Engine Room</a></li>
+
+ <li><a href="#input">Keyboard Input</a></li>
+
+ <li><a href="#mouse">Mouse Events</a></li>
+
+ <li><a href="#output">Output and Screen Updating</a></li>
+ </ul>
+ </li>
+
+ <li><a href="#fmnote">The Forms and Menu Libraries</a></li>
+
+ <li>
+ <a href="#tic">A Tour of the Terminfo Compiler</a>
+
+ <ul>
+ <li><a href="#nonuse">Translation of
+ Non-<strong>use</strong> Capabilities</a></li>
+
+ <li><a href="#uses">Use Capability Resolution</a></li>
+
+ <li><a href="#translation">Source-Form Translation</a></li>
+ </ul>
+ </li>
+
+ <li><a href="#utils">Other Utilities</a></li>
+
+ <li><a href="#style">Style Tips for Developers</a></li>
+
+ <li><a href="#port">Porting Hints</a></li>
+ </ul>
+
+ <h1><a name="abstract" id="abstract">Abstract</a></h1>
+
+ <p>This document is a hacker's tour of the
+ <strong>ncurses</strong> library and utilities. It discusses
+ design philosophy, implementation methods, and the conventions
+ used for coding and documentation. It is recommended reading for
+ anyone who is interested in porting, extending or improving the
+ package.</p>
+
+ <h1><a name="objective" id="objective">Objective of the
+ Package</a></h1>
+
+ <p>The objective of the <strong>ncurses</strong> package is to
+ provide a free software API for character-cell terminals and
+ terminal emulators with the following characteristics:</p>
+
+ <ul>
+ <li>Source-compatible with historical curses implementations
+ (including the original BSD curses and System V curses.</li>
+
+ <li>Conformant with the XSI Curses standard issued as part of
+ XPG4 by X/Open.</li>
+
+ <li>High-quality — stable and reliable code, wide
+ portability, good packaging, superior documentation.</li>
+
+ <li>Featureful — should eliminate as much of the drudgery
+ of C interface programming as possible, freeing programmers to
+ think at a higher level of design.</li>
+ </ul>
+
+ <p>These objectives are in priority order. So, for example,
+ source compatibility with older version must trump featurefulness
+ — we cannot add features if it means breaking the portion
+ of the API corresponding to historical curses versions.</p>
+
+ <h2><a name="whysvr4" id="whysvr4">Why System V Curses?</a></h2>
+
+ <p>We used System V curses as a model, reverse-engineering their
+ API, in order to fulfill the first two objectives.</p>
+
+ <p>System V curses implementations can support BSD curses
+ programs with just a recompilation, so by capturing the System V
+ API we also capture BSD's.</p>
+
+ <p>More importantly for the future, the XSI Curses standard
+ issued by X/Open is explicitly and closely modeled on System V.
+ So conformance with System V took us most of the way to
+ base-level XSI conformance.</p>
+
+ <h2><a name="extensions" id="extensions">How to Design
+ Extensions</a></h2>
+
+ <p>The third objective (standards conformance) requires that it
+ be easy to condition source code using <strong>ncurses</strong>
+ so that the absence of nonstandard extensions does not break the
+ code.</p>
+
+ <p>Accordingly, we have a policy of associating with each
+ nonstandard extension a feature macro, so that ncurses client
+ code can use this macro to condition in or out the code that
+ requires the <strong>ncurses</strong> extension.</p>
+
+ <p>For example, there is a macro
+ <code>NCURSES_MOUSE_VERSION</code> which XSI Curses does not
+ define, but which is defined in the <strong>ncurses</strong>
+ library header. You can use this to condition the calls to the
+ mouse API calls.</p>
+
+ <h1><a name="portability" id="portability">Portability and
+ Configuration</a></h1>
+
+ <p>Code written for <strong>ncurses</strong> may assume an
+ ANSI-standard C compiler and POSIX-compatible OS interface. It
+ may also assume the presence of a System-V-compatible
+ <em>select(2)</em> call.</p>
+
+ <p>We encourage (but do not require) developers to make the code
+ friendly to less-capable UNIX environments wherever possible.</p>
+
+ <p>We encourage developers to support OS-specific optimizations
+ and methods not available under POSIX/ANSI, provided only
+ that:</p>
+
+ <ul>
+ <li>All such code is properly conditioned so the build process
+ does not attempt to compile it under a plain ANSI/POSIX
+ environment.</li>
+
+ <li>Adding such implementation methods does not introduce
+ incompatibilities in the <strong>ncurses</strong> API between
+ platforms.</li>
+ </ul>
+
+ <p>We use GNU <code>autoconf(1)</code> as a tool to deal with
+ portability issues. The right way to leverage an OS-specific
+ feature is to modify the autoconf specification files
+ (configure.in and aclocal.m4) to set up a new feature macro,
+ which you then use to condition your code.</p>
+
+ <h1><a name="documentation" id="documentation">Documentation
+ Conventions</a></h1>
+
+ <p>There are three kinds of documentation associated with this
+ package. Each has a different preferred format:</p>
+
+ <ul>
+ <li>Package-internal files (README, INSTALL, TO-DO etc.)</li>
+
+ <li>Manual pages.</li>
-The reason for choosing HTML is that it's (a) well-adapted for on-line
-browsing through viewers that are everywhere; (b) more easily readable
-as plain text than most other mark-ups, if you don't have a viewer; and (c)
-carries enough information that you can generate a nice-looking printed
-version from it. Also, of course, it make exporting things like the
-announcement document to WWW pretty trivial.
-
-<H1><A NAME="bugtrack">How to Report Bugs</A></H1>
-
-The <A NAME="bugreport">reporting address for bugs</A> is
-<A HREF="mailto:bug-ncurses@gnu.org">bug-ncurses@gnu.org</A>.
-This is a majordomo list; to join, write
-to <CODE>bug-ncurses-request@gnu.org</CODE> with a message containing the line:
-<PRE>
+ <li>Everything else (i.e., narrative documentation).</li>
+ </ul>
+
+ <p>Our conventions are simple:</p>
+
+ <ol>
+ <li><strong>Maintain package-internal files in plain
+ text.</strong> The expected viewer for them <em>more(1)</em> or
+ an editor window; there is no point in elaborate mark-up.</li>
+
+ <li><strong>Mark up manual pages in the man macros.</strong>
+ These have to be viewable through traditional <em>man(1)</em>
+ programs.</li>
+
+ <li><strong>Write everything else in HTML.</strong></li>
+ </ol>
+
+ <p>When in doubt, HTMLize a master and use <em>lynx(1)</em> to
+ generate plain ASCII (as we do for the announcement
+ document).</p>
+
+ <p>The reason for choosing HTML is that it is (a) well-adapted
+ for on-line browsing through viewers that are everywhere; (b)
+ more easily readable as plain text than most other mark-ups, if
+ you do not have a viewer; and (c) carries enough information that
+ you can generate a nice-looking printed version from it. Also, of
+ course, it make exporting things like the announcement document
+ to WWW pretty trivial.</p>
+
+ <h1><a name="bugtrack" id="bugtrack">How to Report Bugs</a></h1>
+
+ <p>The <a name="bugreport" id="bugreport">reporting address for
+ bugs</a> is <a href=
+ "mailto:bug-ncurses@gnu.org">bug-ncurses@gnu.org</a>. This is a
+ majordomo list; to join, write to
+ <code>bug-ncurses-request@gnu.org</code> with a message
+ containing the line:</p>
+ <pre>
subscribe <name>@<host.domain>
-</PRE>
-
-The <CODE>ncurses</CODE> code is maintained by a small group of
-volunteers. While we try our best to fix bugs promptly, we simply
-don't have a lot of hours to spend on elementary hand-holding. We rely
-on intelligent cooperation from our users. If you think you have
-found a bug in <CODE>ncurses</CODE>, there are some steps you can take
-before contacting us that will help get the bug fixed quickly. <P>
-
-In order to use our bug-fixing time efficiently, we put people who
-show us they've taken these steps at the head of our queue. This
-means that if you don't, you'll probably end up at the tail end and
-have to wait a while.
-
-<OL>
-<LI>Develop a recipe to reproduce the bug.
-<p>
-Bugs we can reproduce are likely to be fixed very quickly, often
-within days. The most effective single thing you can do to get a
-quick fix is develop a way we can duplicate the bad behavior --
-ideally, by giving us source for a small, portable test program that
-breaks the library. (Even better is a keystroke recipe using one of
-the test programs provided with the distribution.)
-
-<LI>Try to reproduce the bug on a different terminal type. <P>
-
-In our experience, most of the behaviors people report as library bugs
-are actually due to subtle problems in terminal descriptions. This is
-especially likely to be true if you're using a traditional
-asynchronous terminal or PC-based terminal emulator, rather than xterm
-or a UNIX console entry. <P>
-
-It's therefore extremely helpful if you can tell us whether or not your
-problem reproduces on other terminal types. Usually you'll have both
-a console type and xterm available; please tell us whether or not your
-bug reproduces on both. <P>
-
-If you have xterm available, it is also good to collect xterm reports for
-different window sizes. This is especially true if you normally use an
-unusual xterm window size -- a surprising number of the bugs we've seen
-are either triggered or masked by these.
-
-<LI>Generate and examine a trace file for the broken behavior. <P>
-
-Recompile your program with the debugging versions of the libraries.
-Insert a <CODE>trace()</CODE> call with the argument set to <CODE>TRACE_UPDATE</CODE>.
-(See <A HREF="ncurses-intro.html#debugging">"Writing Programs with
-NCURSES"</A> for details on trace levels.)
-Reproduce your bug, then look at the trace file to see what the library
-was actually doing. <P>
-
-Another frequent cause of apparent bugs is application coding errors
-that cause the wrong things to be put on the virtual screen. Looking
-at the virtual-screen dumps in the trace file will tell you immediately if
-this is happening, and save you from the possible embarrassment of being
-told that the bug is in your code and is your problem rather than ours. <P>
-
-If the virtual-screen dumps look correct but the bug persists, it's
-possible to crank up the trace level to give more and more information
-about the library's update actions and the control sequences it issues
-to perform them. The test directory of the distribution contains a
-tool for digesting these logs to make them less tedious to wade
-through. <P>
-
-Often you'll find terminfo problems at this stage by noticing that the
-escape sequences put out for various capabilities are wrong. If not,
-you're likely to learn enough to be able to characterize any bug in
-the screen-update logic quite exactly.
-
-<LI>Report details and symptoms, not just interpretations. <P>
-
-If you do the preceding two steps, it is very likely that you'll discover
-the nature of the problem yourself and be able to send us a fix. This
-will create happy feelings all around and earn you good karma for the first
-time you run into a bug you really can't characterize and fix yourself. <P>
-
-If you're still stuck, at least you'll know what to tell us. Remember, we
-need details. If you guess about what is safe to leave out, you are too
-likely to be wrong. <P>
-
-If your bug produces a bad update, include a trace file. Try to make
-the trace at the <EM>least</EM> voluminous level that pins down the
-bug. Logs that have been through tracemunch are OK, it doesn't throw
-away any information (actually they're better than un-munched ones because
-they're easier to read). <P>
-
-If your bug produces a core-dump, please include a symbolic stack trace
-generated by gdb(1) or your local equivalent. <P>
-
-Tell us about every terminal on which you've reproduced the bug -- and
-every terminal on which you can't. Ideally, sent us terminfo sources
-for all of these (yours might differ from ours). <P>
-
-Include your ncurses version and your OS/machine type, of course! You can
-find your ncurses version in the <CODE>curses.h</CODE> file.
-</OL>
-
-If your problem smells like a logic error or in cursor movement or
-scrolling or a bad capability, there are a couple of tiny test frames
-for the library algorithms in the progs directory that may help you
-isolate it. These are not part of the normal build, but do have their
-own make productions. <P>
-
-The most important of these is <CODE>mvcur</CODE>, a test frame for the
-cursor-movement optimization code. With this program, you can see
-directly what control sequences will be emitted for any given cursor
-movement or scroll/insert/delete operations. If you think you've got
-a bad capability identified, you can disable it and test again. The
-program is command-driven and has on-line help. <P>
-
-If you think the vertical-scroll optimization is broken, or just want to
-understand how it works better, build <CODE>hashmap</CODE> and read the
-header comments of <CODE>hardscroll.c</CODE> and <CODE>hashmap.c</CODE>; then try
-it out. You can also test the hardware-scrolling optimization separately
-with <CODE>hardscroll</CODE>. <P>
-
-<H1><A NAME="ncurslib">A Tour of the Ncurses Library</A></H1>
-
-<H2><A NAME="loverview">Library Overview</A></H2>
-
-Most of the library is superstructure -- fairly trivial convenience
-interfaces to a small set of basic functions and data structures used
-to manipulate the virtual screen (in particular, none of this code
-does any I/O except through calls to more fundamental modules
-described below). The files
-<blockquote>
-<CODE>
-lib_addch.c
-lib_bkgd.c
-lib_box.c
-lib_chgat.c
-lib_clear.c
-lib_clearok.c
-lib_clrbot.c
-lib_clreol.c
-lib_colorset.c
-lib_data.c
-lib_delch.c
-lib_delwin.c
-lib_echo.c
-lib_erase.c
-lib_gen.c
-lib_getstr.c
-lib_hline.c
-lib_immedok.c
-lib_inchstr.c
-lib_insch.c
-lib_insdel.c
-lib_insstr.c
-lib_instr.c
-lib_isendwin.c
-lib_keyname.c
-lib_leaveok.c
-lib_move.c
-lib_mvwin.c
-lib_overlay.c
-lib_pad.c
-lib_printw.c
-lib_redrawln.c
-lib_scanw.c
-lib_screen.c
-lib_scroll.c
-lib_scrollok.c
-lib_scrreg.c
-lib_set_term.c
-lib_slk.c
-lib_slkatr_set.c
-lib_slkatrof.c
-lib_slkatron.c
-lib_slkatrset.c
-lib_slkattr.c
-lib_slkclear.c
-lib_slkcolor.c
-lib_slkinit.c
-lib_slklab.c
-lib_slkrefr.c
-lib_slkset.c
-lib_slktouch.c
-lib_touch.c
-lib_unctrl.c
-lib_vline.c
-lib_wattroff.c
-lib_wattron.c
-lib_window.c
-</CODE>
-</blockquote>
-are all in this category. They are very
-unlikely to need change, barring bugs or some fundamental
-reorganization in the underlying data structures. <P>
-
-These files are used only for debugging support:
-<blockquote>
-<code>
-lib_trace.c
-lib_traceatr.c
-lib_tracebits.c
-lib_tracechr.c
-lib_tracedmp.c
-lib_tracemse.c
-trace_buf.c
-</code>
-</blockquote>
-It is rather unlikely you will ever need to change these, unless
-you want to introduce a new debug trace level for some reason.<P>
-
-There is another group of files that do direct I/O via <EM>tputs()</EM>,
-computations on the terminal capabilities, or queries to the OS
-environment, but nevertheless have only fairly low complexity. These
-include:
-<blockquote>
-<code>
-lib_acs.c
-lib_beep.c
-lib_color.c
-lib_endwin.c
-lib_initscr.c
-lib_longname.c
-lib_newterm.c
-lib_options.c
-lib_termcap.c
-lib_ti.c
-lib_tparm.c
-lib_tputs.c
-lib_vidattr.c
-read_entry.c.
-</code>
-</blockquote>
-They are likely to need revision only if
-ncurses is being ported to an environment without an underlying
-terminfo capability representation. <P>
-
-These files
-have serious hooks into
-the tty driver and signal facilities:
-<blockquote>
-<code>
-lib_kernel.c
-lib_baudrate.c
-lib_raw.c
-lib_tstp.c
-lib_twait.c
-</code>
-</blockquote>
-If you run into porting snafus
-moving the package to another UNIX, the problem is likely to be in one
-of these files.
-The file <CODE>lib_print.c</CODE> uses sleep(2) and also
-falls in this category.<P>
-
-Almost all of the real work is done in the files
-<blockquote>
-<code>
-hardscroll.c
-hashmap.c
-lib_addch.c
-lib_doupdate.c
-lib_getch.c
-lib_mouse.c
-lib_mvcur.c
-lib_refresh.c
-lib_setup.c
-lib_vidattr.c
-</code>
-</blockquote>
-Most of the algorithmic complexity in the
-library lives in these files.
-If there is a real bug in <STRONG>ncurses</STRONG> itself, it's probably here.
-We'll tour some of these files in detail
-below (see <A HREF="#engine">The Engine Room</A>). <P>
-
-Finally, there is a group of files that is actually most of the
-terminfo compiler. The reason this code lives in the <STRONG>ncurses</STRONG>
-library is to support fallback to /etc/termcap. These files include
-<blockquote>
-<code>
-alloc_entry.c
-captoinfo.c
-comp_captab.c
-comp_error.c
-comp_hash.c
-comp_parse.c
-comp_scan.c
-parse_entry.c
-read_termcap.c
-write_entry.c
-</code>
-</blockquote>
-We'll discuss these in the compiler tour.
-
-<H2><A NAME="engine">The Engine Room</A></H2>
-
-<H3><A NAME="input">Keyboard Input</A></H3>
-
-All <CODE>ncurses</CODE> input funnels through the function
-<CODE>wgetch()</CODE>, defined in <CODE>lib_getch.c</CODE>. This function is
-tricky; it has to poll for keyboard and mouse events and do a running
-match of incoming input against the set of defined special keys. <P>
-
-The central data structure in this module is a FIFO queue, used to
-match multiple-character input sequences against special-key
-capabilities; also to implement pushback via <CODE>ungetch()</CODE>. <P>
-
-The <CODE>wgetch()</CODE> code distinguishes between function key
-sequences and the same sequences typed manually by doing a timed wait
-after each input character that could lead a function key sequence.
-If the entire sequence takes less than 1 second, it is assumed to have
-been generated by a function key press. <P>
-
-Hackers bruised by previous encounters with variant <CODE>select(2)</CODE>
-calls may find the code in <CODE>lib_twait.c</CODE> interesting. It deals
-with the problem that some BSD selects don't return a reliable
-time-left value. The function <CODE>timed_wait()</CODE> effectively
-simulates a System V select.
-
-<H3><A NAME="mouse">Mouse Events</A></H3>
-
-If the mouse interface is active, <CODE>wgetch()</CODE> polls for mouse
-events each call, before it goes to the keyboard for input. It is
-up to <CODE>lib_mouse.c</CODE> how the polling is accomplished; it may vary
-for different devices. <P>
-
-Under xterm, however, mouse event notifications come in via the keyboard
-input stream. They are recognized by having the <STRONG>kmous</STRONG> capability
-as a prefix. This is kind of klugey, but trying to wire in recognition of
-a mouse key prefix without going through the function-key machinery would
-be just too painful, and this turns out to imply having the prefix somewhere
-in the function-key capabilities at terminal-type initialization. <P>
-
-This kluge only works because <STRONG>kmous</STRONG> isn't actually used by any
-historic terminal type or curses implementation we know of. Best
-guess is it's a relic of some forgotten experiment in-house at Bell
-Labs that didn't leave any traces in the publicly-distributed System V
-terminfo files. If System V or XPG4 ever gets serious about using it
-again, this kluge may have to change. <P>
-
-Here are some more details about mouse event handling: <P>
-
-The <CODE>lib_mouse()</CODE>code is logically split into a lower level that
-accepts event reports in a device-dependent format and an upper level that
-parses mouse gestures and filters events. The mediating data structure is a
-circular queue of event structures. <P>
-
-Functionally, the lower level's job is to pick up primitive events and
-put them on the circular queue. This can happen in one of two ways:
-either (a) <CODE>_nc_mouse_event()</CODE> detects a series of incoming
-mouse reports and queues them, or (b) code in <CODE>lib_getch.c</CODE> detects the
-<STRONG>kmous</STRONG> prefix in the keyboard input stream and calls _nc_mouse_inline
-to queue up a series of adjacent mouse reports. <P>
-
-In either case, <CODE>_nc_mouse_parse()</CODE> should be called after the
-series is accepted to parse the digested mouse reports (low-level
-events) into a gesture (a high-level or composite event).
-
-<H3><A NAME="output">Output and Screen Updating</A></H3>
-
-With the single exception of character echoes during a <CODE>wgetnstr()</CODE>
-call (which simulates cooked-mode line editing in an ncurses window),
-the library normally does all its output at refresh time. <P>
-
-The main job is to go from the current state of the screen (as represented
-in the <CODE>curscr</CODE> window structure) to the desired new state (as
-represented in the <CODE>newscr</CODE> window structure), while doing as
-little I/O as possible. <P>
-
-The brains of this operation are the modules <CODE>hashmap.c</CODE>,
-<CODE>hardscroll.c</CODE> and <CODE>lib_doupdate.c</CODE>; the latter two use
-<CODE>lib_mvcur.c</CODE>. Essentially, what happens looks like this: <P>
-
-The <CODE>hashmap.c</CODE> module tries to detect vertical motion
-changes between the real and virtual screens. This information
-is represented by the oldindex members in the newscr structure.
-These are modified by vertical-motion and clear operations, and both are
-re-initialized after each update. To this change-journalling
-information, the hashmap code adds deductions made using a modified Heckel
-algorithm on hash values generated from the line contents. <P>
-
-The <CODE>hardscroll.c</CODE> module computes an optimum set of scroll,
-insertion, and deletion operations to make the indices match. It calls
-<CODE>_nc_mvcur_scrolln()</CODE> in <CODE>lib_mvcur.c</CODE> to do those motions. <P>
-
-Then <CODE>lib_doupdate.c</CODE> goes to work. Its job is to do line-by-line
-transformations of <CODE>curscr</CODE> lines to <CODE>newscr</CODE> lines. Its main
-tool is the routine <CODE>mvcur()</CODE> in <CODE>lib_mvcur.c</CODE>. This routine
-does cursor-movement optimization, attempting to get from given screen
-location A to given location B in the fewest output characters possible. <P>
-
-If you want to work on screen optimizations, you should use the fact
-that (in the trace-enabled version of the library) enabling the
-<CODE>TRACE_TIMES</CODE> trace level causes a report to be emitted after
-each screen update giving the elapsed time and a count of characters
-emitted during the update. You can use this to tell when an update
-optimization improves efficiency. <P>
-
-In the trace-enabled version of the library, it is also possible to disable
-and re-enable various optimizations at runtime by tweaking the variable
-<CODE>_nc_optimize_enable</CODE>. See the file <CODE>include/curses.h.in</CODE>
-for mask values, near the end.
-
-<H1><A NAME="fmnote">The Forms and Menu Libraries</A></H1>
-
-The forms and menu libraries should work reliably in any environment you
-can port ncurses to. The only portability issue anywhere in them is what
-flavor of regular expressions the built-in form field type TYPE_REGEXP
-will recognize. <P>
-
-The configuration code prefers the POSIX regex facility, modeled on
-System V's, but will settle for BSD regexps if the former isn't available. <P>
-
-Historical note: the panels code was written primarily to assist in
-porting u386mon 2.0 (comp.sources.misc v14i001-4) to systems lacking
-panels support; u386mon 2.10 and beyond use it. This version has been
-slightly cleaned up for <CODE>ncurses</CODE>.
-
-<H1><A NAME="tic">A Tour of the Terminfo Compiler</A></H1>
-
-The <STRONG>ncurses</STRONG> implementation of <STRONG>tic</STRONG> is rather complex
-internally; it has to do a trying combination of missions. This starts
-with the fact that, in addition to its normal duty of compiling
-terminfo sources into loadable terminfo binaries, it has to be able to
-handle termcap syntax and compile that too into terminfo entries. <P>
-
-The implementation therefore starts with a table-driven, dual-mode
-lexical analyzer (in <CODE>comp_scan.c</CODE>). The lexer chooses its
-mode (termcap or terminfo) based on the first `,' or `:' it finds in
-each entry. The lexer does all the work of recognizing capability
-names and values; the grammar above it is trivial, just "parse entries
-till you run out of file".
-
-<H2><A NAME="nonuse">Translation of Non-<STRONG>use</STRONG> Capabilities</A></H2>
-
-Translation of most things besides <STRONG>use</STRONG> capabilities is pretty
-straightforward. The lexical analyzer's tokenizer hands each capability
-name to a hash function, which drives a table lookup. The table entry
-yields an index which is used to look up the token type in another table,
-and controls interpretation of the value. <P>
-
-One possibly interesting aspect of the implementation is the way the
-compiler tables are initialized. All the tables are generated by various
-awk/sed/sh scripts from a master table <CODE>include/Caps</CODE>; these
-scripts actually write C initializers which are linked to the compiler.
-Furthermore, the hash table is generated in the same way, so it doesn't
-have to be generated at compiler startup time (another benefit of this
-organization is that the hash table can be in shareable text space). <P>
-
-Thus, adding a new capability is usually pretty trivial, just a matter
-of adding one line to the <CODE>include/Caps</CODE> file. We'll have more
-to say about this in the section on <A HREF="#translation">Source-Form
-Translation</A>.
-
-<H2><A NAME="uses">Use Capability Resolution</A></H2>
-
-The background problem that makes <STRONG>tic</STRONG> tricky isn't the capability
-translation itself, it's the resolution of <STRONG>use</STRONG> capabilities. Older
-versions would not handle forward <STRONG>use</STRONG> references for this reason
-(that is, a using terminal always had to follow its use target in the
-source file). By doing this, they got away with a simple implementation
-tactic; compile everything as it blows by, then resolve uses from compiled
-entries. <P>
-
-This won't do for <STRONG>ncurses</STRONG>. The problem is that that the whole
-compilation process has to be embeddable in the <STRONG>ncurses</STRONG> library
-so that it can be called by the startup code to translate termcap
-entries on the fly. The embedded version can't go promiscuously writing
-everything it translates out to disk -- for one thing, it will typically
-be running with non-root permissions. <P>
-
-So our <STRONG>tic</STRONG> is designed to parse an entire terminfo file into a
-doubly-linked circular list of entry structures in-core, and then do
-<STRONG>use</STRONG> resolution in-memory before writing everything out. This
-design has other advantages: it makes forward and back use-references
-equally easy (so we get the latter for free), and it makes checking for
-name collisions before they're written out easy to do. <P>
-
-And this is exactly how the embedded version works. But the stand-alone
-user-accessible version of <STRONG>tic</STRONG> partly reverts to the historical
-strategy; it writes to disk (not keeping in core) any entry with no
-<STRONG>use</STRONG> references. <P>
-
-This is strictly a core-economy kluge, implemented because the
-terminfo master file is large enough that some core-poor systems swap
-like crazy when you compile it all in memory...there have been reports of
-this process taking <STRONG>three hours</STRONG>, rather than the twenty seconds
-or less typical on the author's development box. <P>
-
-So. The executable <STRONG>tic</STRONG> passes the entry-parser a hook that
-<EM>immediately</EM> writes out the referenced entry if it has no use
-capabilities. The compiler main loop refrains from adding the entry
-to the in-core list when this hook fires. If some other entry later
-needs to reference an entry that got written immediately, that's OK;
-the resolution code will fetch it off disk when it can't find it in
-core. <P>
-
-Name collisions will still be detected, just not as cleanly. The
-<CODE>write_entry()</CODE> code complains before overwriting an entry that
-postdates the time of <STRONG>tic</STRONG>'s first call to
-<CODE>write_entry()</CODE>, Thus it will complain about overwriting
-entries newly made during the <STRONG>tic</STRONG> run, but not about
-overwriting ones that predate it.
-
-<H2><A NAME="translation">Source-Form Translation</A></H2>
-
-Another use of <STRONG>tic</STRONG> is to do source translation between various termcap
-and terminfo formats. There are more variants out there than you might
-think; the ones we know about are described in the <STRONG>captoinfo(1)</STRONG>
-manual page. <P>
-
-The translation output code (<CODE>dump_entry()</CODE> in
-<CODE>ncurses/dump_entry.c</CODE>) is shared with the <STRONG>infocmp(1)</STRONG>
-utility. It takes the same internal representation used to generate
-the binary form and dumps it to standard output in a specified
-format. <P>
-
-The <CODE>include/Caps</CODE> file has a header comment describing ways you
-can specify source translations for nonstandard capabilities just by
-altering the master table. It's possible to set up capability aliasing
-or tell the compiler to plain ignore a given capability without writing
-any C code at all. <P>
-
-For circumstances where you need to do algorithmic translation, there
-are functions in <CODE>parse_entry.c</CODE> called after the parse of each
-entry that are specifically intended to encapsulate such
-translations. This, for example, is where the AIX <STRONG>box1</STRONG> capability
-get translated to an <STRONG>acsc</STRONG> string.
-
-<H1><A NAME="utils">Other Utilities</A></H1>
-
-The <STRONG>infocmp</STRONG> utility is just a wrapper around the same
-entry-dumping code used by <STRONG>tic</STRONG> for source translation. Perhaps
-the one interesting aspect of the code is the use of a predicate
-function passed in to <CODE>dump_entry()</CODE> to control which
-capabilities are dumped. This is necessary in order to handle both
-the ordinary De-compilation case and entry difference reporting. <P>
-
-The <STRONG>tput</STRONG> and <STRONG>clear</STRONG> utilities just do an entry load
-followed by a <CODE>tputs()</CODE> of a selected capability.
-
-<H1><A NAME="style">Style Tips for Developers</A></H1>
-
-See the TO-DO file in the top-level directory of the source distribution
-for additions that would be particularly useful. <P>
-
-The prefix <CODE>_nc_</CODE> should be used on library public functions that are
-not part of the curses API in order to prevent pollution of the
-application namespace.
-
-If you have to add to or modify the function prototypes in curses.h.in,
-read ncurses/MKlib_gen.sh first so you can avoid breaking XSI conformance.
-
-Please join the ncurses mailing list. See the INSTALL file in the
-top level of the distribution for details on the list. <P>
-
-Look for the string <CODE>FIXME</CODE> in source files to tag minor bugs
-and potential problems that could use fixing. <P>
-
-Don't try to auto-detect OS features in the main body of the C code.
-That's the job of the configuration system. <P>
-
-To hold down complexity, do make your code data-driven. Especially,
-if you can drive logic from a table filtered out of
-<CODE>include/Caps</CODE>, do it. If you find you need to augment the
-data in that file in order to generate the proper table, that's still
-preferable to ad-hoc code -- that's why the fifth field (flags) is
-there. <P>
-
-Have fun!
-
-<H1><A NAME="port">Porting Hints</A></H1>
-
-The following notes are intended to be a first step towards DOS and Macintosh
-ports of the ncurses libraries. <P>
-
-The following library modules are `pure curses'; they operate only on
-the curses internal structures, do all output through other curses
-calls (not including <CODE>tputs()</CODE> and <CODE>putp()</CODE>) and do not
-call any other UNIX routines such as signal(2) or the stdio library.
-Thus, they should not need to be modified for single-terminal
-ports.
-
-<blockquote>
-<code>
-lib_addch.c
-lib_addstr.c
-lib_bkgd.c
-lib_box.c
-lib_clear.c
-lib_clrbot.c
-lib_clreol.c
-lib_delch.c
-lib_delwin.c
-lib_erase.c
-lib_inchstr.c
-lib_insch.c
-lib_insdel.c
-lib_insstr.c
-lib_keyname.c
-lib_move.c
-lib_mvwin.c
-lib_newwin.c
-lib_overlay.c
-lib_pad.c
-lib_printw.c
-lib_refresh.c
-lib_scanw.c
-lib_scroll.c
-lib_scrreg.c
-lib_set_term.c
-lib_touch.c
-lib_tparm.c
-lib_tputs.c
-lib_unctrl.c
-lib_window.c
-panel.c
-</code>
-</blockquote>
-<P>
-
-This module is pure curses, but calls outstr():
-
-<blockquote>
-<code>
-lib_getstr.c
-</code>
-</blockquote>
-<P>
-
-These modules are pure curses, except that they use <CODE>tputs()</CODE>
-and <CODE>putp()</CODE>:
-
-<blockquote>
-<code>
-lib_beep.c
-lib_color.c
-lib_endwin.c
-lib_options.c
-lib_slk.c
-lib_vidattr.c
-</code>
-</blockquote>
-<P>
-
-This modules assist in POSIX emulation on non-POSIX systems:
-<DL>
-<DT> sigaction.c
-<DD> signal calls
-</DL>
-
-The following source files will not be needed for a
-single-terminal-type port.
-
-<blockquote>
-<code>
-alloc_entry.c
-captoinfo.c
-clear.c
-comp_captab.c
-comp_error.c
-comp_hash.c
-comp_main.c
-comp_parse.c
-comp_scan.c
-dump_entry.c
-infocmp.c
-parse_entry.c
-read_entry.c
-tput.c
-write_entry.c
-</code>
-</blockquote>
-<P>
-
-The following modules will use open()/read()/write()/close()/lseek() on files,
-but no other OS calls.
-
-<DL>
-<DT>lib_screen.c
-<DD>used to read/write screen dumps
-<DT>lib_trace.c
-<DD>used to write trace data to the logfile
-</DL>
-
-Modules that would have to be modified for a port start here: <P>
-
-The following modules are `pure curses' but contain assumptions inappropriate
-for a memory-mapped port.
-
-<dl>
-<dt>lib_longname.c<dd>assumes there may be multiple terminals
-<dt>lib_acs.c<dd>assumes acs_map as a double indirection
-<dt>lib_mvcur.c<dd>assumes cursor moves have variable cost
-<dt>lib_termcap.c<dd>assumes there may be multiple terminals
-<dt>lib_ti.c<dd>assumes there may be multiple terminals
-</dl>
-
-The following modules use UNIX-specific calls:
-
-<dl>
-<dt>lib_doupdate.c<dd>input checking
-<dt>lib_getch.c<dd>read()
-<dt>lib_initscr.c<dd>getenv()
-<dt>lib_newterm.c
-<dt>lib_baudrate.c
-<dt>lib_kernel.c<dd>various tty-manipulation and system calls
-<dt>lib_raw.c<dd>various tty-manipulation calls
-<dt>lib_setup.c<dd>various tty-manipulation calls
-<dt>lib_restart.c<dd>various tty-manipulation calls
-<dt>lib_tstp.c<dd>signal-manipulation calls
-<dt>lib_twait.c<dd>gettimeofday(), select().
-</dl>
-
-<HR>
-<ADDRESS>Eric S. Raymond <esr@snark.thyrsus.com></ADDRESS>
-(Note: This is <EM>not</EM> the <A HREF="#bugtrack">bug address</A>!)
-</BODY>
-</HTML>
+</pre>
+
+ <p>The <code>ncurses</code> code is maintained by a small group
+ of volunteers. While we try our best to fix bugs promptly, we
+ simply do not have a lot of hours to spend on elementary
+ hand-holding. We rely on intelligent cooperation from our users.
+ If you think you have found a bug in <code>ncurses</code>, there
+ are some steps you can take before contacting us that will help
+ get the bug fixed quickly.</p>
+
+ <p>In order to use our bug-fixing time efficiently, we put people
+ who show us they have taken these steps at the head of our queue.
+ This means that if you do not, you will probably end up at the
+ tail end and have to wait a while.</p>
+
+ <ol>
+ <li>Develop a recipe to reproduce the bug.
+
+ <p>Bugs we can reproduce are likely to be fixed very quickly,
+ often within days. The most effective single thing you can do
+ to get a quick fix is develop a way we can duplicate the bad
+ behavior — ideally, by giving us source for a small,
+ portable test program that breaks the library. (Even better
+ is a keystroke recipe using one of the test programs provided
+ with the distribution.)</p>
+ </li>
+
+ <li>Try to reproduce the bug on a different terminal type.
+
+ <p>In our experience, most of the behaviors people report as
+ library bugs are actually due to subtle problems in terminal
+ descriptions. This is especially likely to be true if you are
+ using a traditional asynchronous terminal or PC-based
+ terminal emulator, rather than xterm or a UNIX console
+ entry.</p>
+
+ <p>It is therefore extremely helpful if you can tell us
+ whether or not your problem reproduces on other terminal
+ types. Usually you will have both a console type and xterm
+ available; please tell us whether or not your bug reproduces
+ on both.</p>
+
+ <p>If you have xterm available, it is also good to collect
+ xterm reports for different window sizes. This is especially
+ true if you normally use an unusual xterm window size —
+ a surprising number of the bugs we have seen are either
+ triggered or masked by these.</p>
+ </li>
+
+ <li>Generate and examine a trace file for the broken behavior.
+
+ <p>Recompile your program with the debugging versions of the
+ libraries. Insert a <code>trace()</code> call with the
+ argument set to <code>TRACE_UPDATE</code>. (See <a href=
+ "ncurses-intro.html#debugging">"Writing Programs with
+ NCURSES"</a> for details on trace levels.) Reproduce your
+ bug, then look at the trace file to see what the library was
+ actually doing.</p>
+
+ <p>Another frequent cause of apparent bugs is application
+ coding errors that cause the wrong things to be put on the
+ virtual screen. Looking at the virtual-screen dumps in the
+ trace file will tell you immediately if this is happening,
+ and save you from the possible embarrassment of being told
+ that the bug is in your code and is your problem rather than
+ ours.</p>
+
+ <p>If the virtual-screen dumps look correct but the bug
+ persists, it is possible to crank up the trace level to give
+ more and more information about the library's update actions
+ and the control sequences it issues to perform them. The test
+ directory of the distribution contains a tool for digesting
+ these logs to make them less tedious to wade through.</p>
+
+ <p>Often you will find terminfo problems at this stage by
+ noticing that the escape sequences put out for various
+ capabilities are wrong. If not, you are likely to learn
+ enough to be able to characterize any bug in the
+ screen-update logic quite exactly.</p>
+ </li>
+
+ <li>Report details and symptoms, not just interpretations.
+
+ <p>If you do the preceding two steps, it is very likely that
+ you will discover the nature of the problem yourself and be
+ able to send us a fix. This will create happy feelings all
+ around and earn you good karma for the first time you run
+ into a bug you really cannot characterize and fix
+ yourself.</p>
+
+ <p>If you are still stuck, at least you will know what to
+ tell us. Remember, we need details. If you guess about what
+ is safe to leave out, you are too likely to be wrong.</p>
+
+ <p>If your bug produces a bad update, include a trace file.
+ Try to make the trace at the <em>least</em> voluminous level
+ that pins down the bug. Logs that have been through
+ tracemunch are OK, it does not throw away any information
+ (actually they are better than un-munched ones because they
+ are easier to read).</p>
+
+ <p>If your bug produces a core-dump, please include a
+ symbolic stack trace generated by gdb(1) or your local
+ equivalent.</p>
+
+ <p>Tell us about every terminal on which you have reproduced
+ the bug — and every terminal on which you cannot.
+ Ideally, sent us terminfo sources for all of these (yours
+ might differ from ours).</p>
+
+ <p>Include your ncurses version and your OS/machine type, of
+ course! You can find your ncurses version in the
+ <code>curses.h</code> file.</p>
+ </li>
+ </ol>
+
+ <p>If your problem smells like a logic error or in cursor
+ movement or scrolling or a bad capability, there are a couple of
+ tiny test frames for the library algorithms in the progs
+ directory that may help you isolate it. These are not part of the
+ normal build, but do have their own make productions.</p>
+
+ <p>The most important of these is <code>mvcur</code>, a test
+ frame for the cursor-movement optimization code. With this
+ program, you can see directly what control sequences will be
+ emitted for any given cursor movement or scroll/insert/delete
+ operations. If you think you have got a bad capability
+ identified, you can disable it and test again. The program is
+ command-driven and has on-line help.</p>
+
+ <p>If you think the vertical-scroll optimization is broken, or
+ just want to understand how it works better, build
+ <code>hashmap</code> and read the header comments of
+ <code>hardscroll.c</code> and <code>hashmap.c</code>; then try it
+ out. You can also test the hardware-scrolling optimization
+ separately with <code>hardscroll</code>.</p>
+
+ <h1><a name="ncurslib" id="ncurslib">A Tour of the Ncurses
+ Library</a></h1>
+
+ <h2><a name="loverview" id="loverview">Library Overview</a></h2>
+
+ <p>Most of the library is superstructure — fairly trivial
+ convenience interfaces to a small set of basic functions and data
+ structures used to manipulate the virtual screen (in particular,
+ none of this code does any I/O except through calls to more
+ fundamental modules described below). The files</p>
+
+ <blockquote>
+ <code>lib_addch.c lib_bkgd.c lib_box.c lib_chgat.c lib_clear.c
+ lib_clearok.c lib_clrbot.c lib_clreol.c lib_colorset.c
+ lib_data.c lib_delch.c lib_delwin.c lib_echo.c lib_erase.c
+ lib_gen.c lib_getstr.c lib_hline.c lib_immedok.c lib_inchstr.c
+ lib_insch.c lib_insdel.c lib_insstr.c lib_instr.c
+ lib_isendwin.c lib_keyname.c lib_leaveok.c lib_move.c
+ lib_mvwin.c lib_overlay.c lib_pad.c lib_printw.c lib_redrawln.c
+ lib_scanw.c lib_screen.c lib_scroll.c lib_scrollok.c
+ lib_scrreg.c lib_set_term.c lib_slk.c lib_slkatr_set.c
+ lib_slkatrof.c lib_slkatron.c lib_slkatrset.c lib_slkattr.c
+ lib_slkclear.c lib_slkcolor.c lib_slkinit.c lib_slklab.c
+ lib_slkrefr.c lib_slkset.c lib_slktouch.c lib_touch.c
+ lib_unctrl.c lib_vline.c lib_wattroff.c lib_wattron.c
+ lib_window.c</code>
+ </blockquote>
+
+ <p>are all in this category. They are very unlikely to need
+ change, barring bugs or some fundamental reorganization in the
+ underlying data structures.</p>
+
+ <p>These files are used only for debugging support:</p>
+
+ <blockquote>
+ <code>lib_trace.c lib_traceatr.c lib_tracebits.c lib_tracechr.c
+ lib_tracedmp.c lib_tracemse.c trace_buf.c</code>
+ </blockquote>
+
+ <p>It is rather unlikely you will ever need to change these,
+ unless you want to introduce a new debug trace level for some
+ reason.</p>
+
+ <p>There is another group of files that do direct I/O via
+ <em>tputs()</em>, computations on the terminal capabilities, or
+ queries to the OS environment, but nevertheless have only fairly
+ low complexity. These include:</p>
+
+ <blockquote>
+ <code>lib_acs.c lib_beep.c lib_color.c lib_endwin.c
+ lib_initscr.c lib_longname.c lib_newterm.c lib_options.c
+ lib_termcap.c lib_ti.c lib_tparm.c lib_tputs.c lib_vidattr.c
+ read_entry.c.</code>
+ </blockquote>
+
+ <p>They are likely to need revision only if ncurses is being
+ ported to an environment without an underlying terminfo
+ capability representation.</p>
+
+ <p>These files have serious hooks into the tty driver and signal
+ facilities:</p>
+
+ <blockquote>
+ <code>lib_kernel.c lib_baudrate.c lib_raw.c lib_tstp.c
+ lib_twait.c</code>
+ </blockquote>
+
+ <p>If you run into porting snafus moving the package to another
+ UNIX, the problem is likely to be in one of these files. The file
+ <code>lib_print.c</code> uses sleep(2) and also falls in this
+ category.</p>
+
+ <p>Almost all of the real work is done in the files</p>
+
+ <blockquote>
+ <code>hardscroll.c hashmap.c lib_addch.c lib_doupdate.c
+ lib_getch.c lib_mouse.c lib_mvcur.c lib_refresh.c lib_setup.c
+ lib_vidattr.c</code>
+ </blockquote>
+
+ <p>Most of the algorithmic complexity in the library lives in
+ these files. If there is a real bug in <strong>ncurses</strong>
+ itself, it is probably here. We will tour some of these files in
+ detail below (see <a href="#engine">The Engine Room</a>).</p>
+
+ <p>Finally, there is a group of files that is actually most of
+ the terminfo compiler. The reason this code lives in the
+ <strong>ncurses</strong> library is to support fallback to
+ /etc/termcap. These files include</p>
+
+ <blockquote>
+ <code>alloc_entry.c captoinfo.c comp_captab.c comp_error.c
+ comp_hash.c comp_parse.c comp_scan.c parse_entry.c
+ read_termcap.c write_entry.c</code>
+ </blockquote>
+
+ <p>We will discuss these in the compiler tour.</p>
+
+ <h2><a name="engine" id="engine">The Engine Room</a></h2>
+
+ <h3><a name="input" id="input">Keyboard Input</a></h3>
+
+ <p>All <code>ncurses</code> input funnels through the function
+ <code>wgetch()</code>, defined in <code>lib_getch.c</code>. This
+ function is tricky; it has to poll for keyboard and mouse events
+ and do a running match of incoming input against the set of
+ defined special keys.</p>
+
+ <p>The central data structure in this module is a FIFO queue,
+ used to match multiple-character input sequences against
+ special-key capabilities; also to implement pushback via
+ <code>ungetch()</code>.</p>
+
+ <p>The <code>wgetch()</code> code distinguishes between function
+ key sequences and the same sequences typed manually by doing a
+ timed wait after each input character that could lead a function
+ key sequence. If the entire sequence takes less than 1 second, it
+ is assumed to have been generated by a function key press.</p>
+
+ <p>Hackers bruised by previous encounters with variant
+ <code>select(2)</code> calls may find the code in
+ <code>lib_twait.c</code> interesting. It deals with the problem
+ that some BSD selects do not return a reliable time-left value.
+ The function <code>timed_wait()</code> effectively simulates a
+ System V select.</p>
+
+ <h3><a name="mouse" id="mouse">Mouse Events</a></h3>
+
+ <p>If the mouse interface is active, <code>wgetch()</code> polls
+ for mouse events each call, before it goes to the keyboard for
+ input. It is up to <code>lib_mouse.c</code> how the polling is
+ accomplished; it may vary for different devices.</p>
+
+ <p>Under xterm, however, mouse event notifications come in via
+ the keyboard input stream. They are recognized by having the
+ <strong>kmous</strong> capability as a prefix. This is kind of
+ klugey, but trying to wire in recognition of a mouse key prefix
+ without going through the function-key machinery would be just
+ too painful, and this turns out to imply having the prefix
+ somewhere in the function-key capabilities at terminal-type
+ initialization.</p>
+
+ <p>This kluge only works because <strong>kmous</strong> is not
+ actually used by any historic terminal type or curses
+ implementation we know of. Best guess is it is a relic of some
+ forgotten experiment in-house at Bell Labs that did not leave any
+ traces in the publicly-distributed System V terminfo files. If
+ System V or XPG4 ever gets serious about using it again, this
+ kluge may have to change.</p>
+
+ <p>Here are some more details about mouse event handling:</p>
+
+ <p>The <code>lib_mouse()</code>code is logically split into a
+ lower level that accepts event reports in a device-dependent
+ format and an upper level that parses mouse gestures and filters
+ events. The mediating data structure is a circular queue of event
+ structures.</p>
+
+ <p>Functionally, the lower level's job is to pick up primitive
+ events and put them on the circular queue. This can happen in one
+ of two ways: either (a) <code>_nc_mouse_event()</code> detects a
+ series of incoming mouse reports and queues them, or (b) code in
+ <code>lib_getch.c</code> detects the <strong>kmous</strong>
+ prefix in the keyboard input stream and calls _nc_mouse_inline to
+ queue up a series of adjacent mouse reports.</p>
+
+ <p>In either case, <code>_nc_mouse_parse()</code> should be
+ called after the series is accepted to parse the digested mouse
+ reports (low-level events) into a gesture (a high-level or
+ composite event).</p>
+
+ <h3><a name="output" id="output">Output and Screen
+ Updating</a></h3>
+
+ <p>With the single exception of character echoes during a
+ <code>wgetnstr()</code> call (which simulates cooked-mode line
+ editing in an ncurses window), the library normally does all its
+ output at refresh time.</p>
+
+ <p>The main job is to go from the current state of the screen (as
+ represented in the <code>curscr</code> window structure) to the
+ desired new state (as represented in the <code>newscr</code>
+ window structure), while doing as little I/O as possible.</p>
+
+ <p>The brains of this operation are the modules
+ <code>hashmap.c</code>, <code>hardscroll.c</code> and
+ <code>lib_doupdate.c</code>; the latter two use
+ <code>lib_mvcur.c</code>. Essentially, what happens looks like
+ this:</p>
+
+ <p>The <code>hashmap.c</code> module tries to detect vertical
+ motion changes between the real and virtual screens. This
+ information is represented by the oldindex members in the newscr
+ structure. These are modified by vertical-motion and clear
+ operations, and both are re-initialized after each update. To
+ this change-journalling information, the hashmap code adds
+ deductions made using a modified Heckel algorithm on hash values
+ generated from the line contents.</p>
+
+ <p>The <code>hardscroll.c</code> module computes an optimum set
+ of scroll, insertion, and deletion operations to make the indices
+ match. It calls <code>_nc_mvcur_scrolln()</code> in
+ <code>lib_mvcur.c</code> to do those motions.</p>
+
+ <p>Then <code>lib_doupdate.c</code> goes to work. Its job is to
+ do line-by-line transformations of <code>curscr</code> lines to
+ <code>newscr</code> lines. Its main tool is the routine
+ <code>mvcur()</code> in <code>lib_mvcur.c</code>. This routine
+ does cursor-movement optimization, attempting to get from given
+ screen location A to given location B in the fewest output
+ characters possible.</p>
+
+ <p>If you want to work on screen optimizations, you should use
+ the fact that (in the trace-enabled version of the library)
+ enabling the <code>TRACE_TIMES</code> trace level causes a report
+ to be emitted after each screen update giving the elapsed time
+ and a count of characters emitted during the update. You can use
+ this to tell when an update optimization improves efficiency.</p>
+
+ <p>In the trace-enabled version of the library, it is also
+ possible to disable and re-enable various optimizations at
+ runtime by tweaking the variable
+ <code>_nc_optimize_enable</code>. See the file
+ <code>include/curses.h.in</code> for mask values, near the
+ end.</p>
+
+ <h1><a name="fmnote" id="fmnote">The Forms and Menu
+ Libraries</a></h1>
+
+ <p>The forms and menu libraries should work reliably in any
+ environment you can port ncurses to. The only portability issue
+ anywhere in them is what flavor of regular expressions the
+ built-in form field type TYPE_REGEXP will recognize.</p>
+
+ <p>The configuration code prefers the POSIX regex facility,
+ modeled on System V's, but will settle for BSD regexps if the
+ former is not available.</p>
+
+ <p>Historical note: the panels code was written primarily to
+ assist in porting u386mon 2.0 (comp.sources.misc v14i001-4) to
+ systems lacking panels support; u386mon 2.10 and beyond use it.
+ This version has been slightly cleaned up for
+ <code>ncurses</code>.</p>
+
+ <h1><a name="tic" id="tic">A Tour of the Terminfo
+ Compiler</a></h1>
+
+ <p>The <strong>ncurses</strong> implementation of
+ <strong>tic</strong> is rather complex internally; it has to do a
+ trying combination of missions. This starts with the fact that,
+ in addition to its normal duty of compiling terminfo sources into
+ loadable terminfo binaries, it has to be able to handle termcap
+ syntax and compile that too into terminfo entries.</p>
+
+ <p>The implementation therefore starts with a table-driven,
+ dual-mode lexical analyzer (in <code>comp_scan.c</code>). The
+ lexer chooses its mode (termcap or terminfo) based on the first
+ “,” or “:” it finds in each entry. The
+ lexer does all the work of recognizing capability names and
+ values; the grammar above it is trivial, just "parse entries till
+ you run out of file".</p>
+
+ <h2><a name="nonuse" id="nonuse">Translation of
+ Non-<strong>use</strong> Capabilities</a></h2>
+
+ <p>Translation of most things besides <strong>use</strong>
+ capabilities is pretty straightforward. The lexical analyzer's
+ tokenizer hands each capability name to a hash function, which
+ drives a table lookup. The table entry yields an index which is
+ used to look up the token type in another table, and controls
+ interpretation of the value.</p>
+
+ <p>One possibly interesting aspect of the implementation is the
+ way the compiler tables are initialized. All the tables are
+ generated by various awk/sed/sh scripts from a master table
+ <code>include/Caps</code>; these scripts actually write C
+ initializers which are linked to the compiler. Furthermore, the
+ hash table is generated in the same way, so it doesn't have to be
+ generated at compiler startup time (another benefit of this
+ organization is that the hash table can be in shareable text
+ space).</p>
+
+ <p>Thus, adding a new capability is usually pretty trivial, just
+ a matter of adding one line to the <code>include/Caps</code>
+ file. We will have more to say about this in the section on
+ <a href="#translation">Source-Form Translation</a>.</p>
+
+ <h2><a name="uses" id="uses">Use Capability Resolution</a></h2>
+
+ <p>The background problem that makes <strong>tic</strong> tricky
+ is not the capability translation itself, it is the resolution of
+ <strong>use</strong> capabilities. Older versions would not
+ handle forward <strong>use</strong> references for this reason
+ (that is, a using terminal always had to follow its use target in
+ the source file). By doing this, they got away with a simple
+ implementation tactic; compile everything as it blows by, then
+ resolve uses from compiled entries.</p>
+
+ <p>This will not do for <strong>ncurses</strong>. The problem is
+ that that the whole compilation process has to be embeddable in
+ the <strong>ncurses</strong> library so that it can be called by
+ the startup code to translate termcap entries on the fly. The
+ embedded version cannot go promiscuously writing everything it
+ translates out to disk — for one thing, it will typically
+ be running with non-root permissions.</p>
+
+ <p>So our <strong>tic</strong> is designed to parse an entire
+ terminfo file into a doubly-linked circular list of entry
+ structures in-core, and then do <strong>use</strong> resolution
+ in-memory before writing everything out. This design has other
+ advantages: it makes forward and back use-references equally easy
+ (so we get the latter for free), and it makes checking for name
+ collisions before they are written out easy to do.</p>
+
+ <p>And this is exactly how the embedded version works. But the
+ stand-alone user-accessible version of <strong>tic</strong>
+ partly reverts to the historical strategy; it writes to disk (not
+ keeping in core) any entry with no <strong>use</strong>
+ references.</p>
+
+ <p>This is strictly a core-economy kluge, implemented because the
+ terminfo master file is large enough that some core-poor systems
+ swap like crazy when you compile it all in memory...there have
+ been reports of this process taking <strong>three hours</strong>,
+ rather than the twenty seconds or less typical on the author's
+ development box.</p>
+
+ <p>So. The executable <strong>tic</strong> passes the
+ entry-parser a hook that <em>immediately</em> writes out the
+ referenced entry if it has no use capabilities. The compiler main
+ loop refrains from adding the entry to the in-core list when this
+ hook fires. If some other entry later needs to reference an entry
+ that got written immediately, that is OK; the resolution code
+ will fetch it off disk when it cannot find it in core.</p>
+
+ <p>Name collisions will still be detected, just not as cleanly.
+ The <code>write_entry()</code> code complains before overwriting
+ an entry that postdates the time of <strong>tic</strong>'s first
+ call to <code>write_entry()</code>, Thus it will complain about
+ overwriting entries newly made during the <strong>tic</strong>
+ run, but not about overwriting ones that predate it.</p>
+
+ <h2><a name="translation" id="translation">Source-Form
+ Translation</a></h2>
+
+ <p>Another use of <strong>tic</strong> is to do source
+ translation between various termcap and terminfo formats. There
+ are more variants out there than you might think; the ones we
+ know about are described in the <strong>captoinfo(1)</strong>
+ manual page.</p>
+
+ <p>The translation output code (<code>dump_entry()</code> in
+ <code>ncurses/dump_entry.c</code>) is shared with the
+ <strong>infocmp(1)</strong> utility. It takes the same internal
+ representation used to generate the binary form and dumps it to
+ standard output in a specified format.</p>
+
+ <p>The <code>include/Caps</code> file has a header comment
+ describing ways you can specify source translations for
+ nonstandard capabilities just by altering the master table. It is
+ possible to set up capability aliasing or tell the compiler to
+ plain ignore a given capability without writing any C code at
+ all.</p>
+
+ <p>For circumstances where you need to do algorithmic
+ translation, there are functions in <code>parse_entry.c</code>
+ called after the parse of each entry that are specifically
+ intended to encapsulate such translations. This, for example, is
+ where the AIX <strong>box1</strong> capability get translated to
+ an <strong>acsc</strong> string.</p>
+
+ <h1><a name="utils" id="utils">Other Utilities</a></h1>
+
+ <p>The <strong>infocmp</strong> utility is just a wrapper around
+ the same entry-dumping code used by <strong>tic</strong> for
+ source translation. Perhaps the one interesting aspect of the
+ code is the use of a predicate function passed in to
+ <code>dump_entry()</code> to control which capabilities are
+ dumped. This is necessary in order to handle both the ordinary
+ De-compilation case and entry difference reporting.</p>
+
+ <p>The <strong>tput</strong> and <strong>clear</strong> utilities
+ just do an entry load followed by a <code>tputs()</code> of a
+ selected capability.</p>
+
+ <h1><a name="style" id="style">Style Tips for Developers</a></h1>
+
+ <p>See the TO-DO file in the top-level directory of the source
+ distribution for additions that would be particularly useful.</p>
+
+ <p>The prefix <code>_nc_</code> should be used on library public
+ functions that are not part of the curses API in order to prevent
+ pollution of the application namespace. If you have to add to or
+ modify the function prototypes in curses.h.in, read
+ ncurses/MKlib_gen.sh first so you can avoid breaking XSI
+ conformance. Please join the ncurses mailing list. See the
+ INSTALL file in the top level of the distribution for details on
+ the list.</p>
+
+ <p>Look for the string <code>FIXME</code> in source files to tag
+ minor bugs and potential problems that could use fixing.</p>
+
+ <p>Do not try to auto-detect OS features in the main body of the
+ C code. That is the job of the configuration system.</p>
+
+ <p>To hold down complexity, do make your code data-driven.
+ Especially, if you can drive logic from a table filtered out of
+ <code>include/Caps</code>, do it. If you find you need to augment
+ the data in that file in order to generate the proper table, that
+ is still preferable to ad-hoc code — that is why the fifth
+ field (flags) is there.</p>
+
+ <p>Have fun!</p>
+
+ <h1><a name="port" id="port">Porting Hints</a></h1>
+
+ <p>The following notes are intended to be a first step towards
+ DOS and Macintosh ports of the ncurses libraries.</p>
+
+ <p>The following library modules are “pure curses”;
+ they operate only on the curses internal structures, do all
+ output through other curses calls (not including
+ <code>tputs()</code> and <code>putp()</code>) and do not call any
+ other UNIX routines such as signal(2) or the stdio library. Thus,
+ they should not need to be modified for single-terminal
+ ports.</p>
+
+ <blockquote>
+ <code>lib_addch.c lib_addstr.c lib_bkgd.c lib_box.c lib_clear.c
+ lib_clrbot.c lib_clreol.c lib_delch.c lib_delwin.c lib_erase.c
+ lib_inchstr.c lib_insch.c lib_insdel.c lib_insstr.c
+ lib_keyname.c lib_move.c lib_mvwin.c lib_newwin.c lib_overlay.c
+ lib_pad.c lib_printw.c lib_refresh.c lib_scanw.c lib_scroll.c
+ lib_scrreg.c lib_set_term.c lib_touch.c lib_tparm.c lib_tputs.c
+ lib_unctrl.c lib_window.c panel.c</code>
+ </blockquote>
+
+ <p>This module is pure curses, but calls outstr():</p>
+
+ <blockquote>
+ <code>lib_getstr.c</code>
+ </blockquote>
+
+ <p>These modules are pure curses, except that they use
+ <code>tputs()</code> and <code>putp()</code>:</p>
+
+ <blockquote>
+ <code>lib_beep.c lib_color.c lib_endwin.c lib_options.c
+ lib_slk.c lib_vidattr.c</code>
+ </blockquote>
+
+ <p>This modules assist in POSIX emulation on non-POSIX
+ systems:</p>
+
+ <dl>
+ <dt>sigaction.c</dt>
+
+ <dd>signal calls</dd>
+ </dl>
+
+ <p>The following source files will not be needed for a
+ single-terminal-type port.</p>
+
+ <blockquote>
+ <code>alloc_entry.c captoinfo.c clear.c comp_captab.c
+ comp_error.c comp_hash.c comp_main.c comp_parse.c comp_scan.c
+ dump_entry.c infocmp.c parse_entry.c read_entry.c tput.c
+ write_entry.c</code>
+ </blockquote>
+
+ <p>The following modules will use
+ open()/read()/write()/close()/lseek() on files, but no other OS
+ calls.</p>
+
+ <dl>
+ <dt>lib_screen.c</dt>
+
+ <dd>used to read/write screen dumps</dd>
+
+ <dt>lib_trace.c</dt>
+
+ <dd>used to write trace data to the logfile</dd>
+ </dl>
+
+ <p>Modules that would have to be modified for a port start
+ here:</p>
+
+ <p>The following modules are “pure curses” but
+ contain assumptions inappropriate for a memory-mapped port.</p>
+
+ <dl>
+ <dt>lib_longname.c</dt>
+
+ <dd>assumes there may be multiple terminals</dd>
+
+ <dt>lib_acs.c</dt>
+
+ <dd>assumes acs_map as a double indirection</dd>
+
+ <dt>lib_mvcur.c</dt>
+
+ <dd>assumes cursor moves have variable cost</dd>
+
+ <dt>lib_termcap.c</dt>
+
+ <dd>assumes there may be multiple terminals</dd>
+
+ <dt>lib_ti.c</dt>
+
+ <dd>assumes there may be multiple terminals</dd>
+ </dl>
+
+ <p>The following modules use UNIX-specific calls:</p>
+
+ <dl>
+ <dt>lib_doupdate.c</dt>
+
+ <dd>input checking</dd>
+
+ <dt>lib_getch.c</dt>
+
+ <dd>read()</dd>
+
+ <dt>lib_initscr.c</dt>
+
+ <dd>getenv()</dd>
+
+ <dt>lib_newterm.c</dt>
+
+ <dt>lib_baudrate.c</dt>
+
+ <dt>lib_kernel.c</dt>
+
+ <dd>various tty-manipulation and system calls</dd>
+
+ <dt>lib_raw.c</dt>
+
+ <dd>various tty-manipulation calls</dd>
+
+ <dt>lib_setup.c</dt>
+
+ <dd>various tty-manipulation calls</dd>
+
+ <dt>lib_restart.c</dt>
+
+ <dd>various tty-manipulation calls</dd>
+
+ <dt>lib_tstp.c</dt>
+
+ <dd>signal-manipulation calls</dd>
+
+ <dt>lib_twait.c</dt>
+
+ <dd>gettimeofday(), select().</dd>
+ </dl>
+ <hr>
+
+ <address>
+ Eric S. Raymond <esr@snark.thyrsus.com>
+ </address>(Note: This is <em>not</em> the <a href="#bugtrack">bug
+ address</a>!)
+</body>
+</html>
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<!--
- $Id: index.html,v 1.6 2013/05/17 23:30:29 tom Exp $
+ $Id: index.html,v 1.7 2017/05/05 12:04:48 tom Exp $
****************************************************************************
- * Copyright (c) 1998-2010,2013 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2013,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* authorization. *
****************************************************************************
-->
-<HTML>
-<HEAD>
-<TITLE>Welcome to ncurses</TITLE>
-<link rev=made href="mailto:bug-ncurses@gnu.org">
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-</HEAD>
-<BODY>
-
-<H1>Welcome to ncurses</H1>
-From this index page you have access to these further documents
-<UL>
-<LI>The <a href="announce.html">Announcement</a> of the current version of ncurses.
-<LI>An <a href="ncurses-intro.html">Introduction</a> into (n)curses programming.
-<LI>A <a href="hackguide.html">hackers guide</a> to ncurses.
-<LI>A description of the <a href="Ada95.html">Ada95 binding</a>, by Jürgen Pfeifer.
-<li>A <a href="NCURSES-Programming-HOWTO.html">A short tutorial</a>, by Pradeep Padala.
-</UL><P>
-We also have HTML versions of all the ncurses <a href="man">manpages</a>.
-</BODY>
-</HTML>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
+
+<html>
+<head>
+ <meta name="generator" content=
+ "HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
+
+ <title>Welcome to ncurses</title>
+ <link rev="made" href="mailto:bug-ncurses@gnu.org">
+ <meta http-equiv="Content-Type" content=
+ "text/html; charset=us-ascii">
+</head>
+
+<body>
+ <h1>Welcome to ncurses</h1>From this index page you have access
+ to these further documents
+
+ <ul>
+ <li>The <a href="announce.html">Announcement</a> of the current
+ version of ncurses.</li>
+
+ <li>An <a href="ncurses-intro.html">Introduction</a> into
+ (n)curses programming.</li>
+
+ <li>A <a href="hackguide.html">hackers guide</a> to
+ ncurses.</li>
+
+ <li>A description of the <a href="Ada95.html">Ada95
+ binding</a>, by Jürgen Pfeifer.</li>
+
+ <li>A <a href="NCURSES-Programming-HOWTO.html">A short
+ tutorial</a>, by Pradeep Padala.</li>
+ </ul>
+
+ <p>We also have HTML versions of all the ncurses <a href=
+ "man">manpages</a>.</p>
+</body>
+</html>
<BODY>
<H1 class="no-header">ADACURSES 1 User Commands</H1>
<PRE>
-<STRONG>ADACURSES(1)</STRONG> User Commands <STRONG>ADACURSES(1)</STRONG>
+<STRONG>ADACURSES(1)</STRONG> User Commands <STRONG>ADACURSES(1)</STRONG>
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
- This is a shell script which simplifies configuring an
- application to use the AdaCurses library binding to
- ncurses.
+ This is a shell script which simplifies configuring an application to
+ use the AdaCurses library binding to ncurses.
</PRE><H2><a name="h2-OPTIONS">OPTIONS</a></H2><PRE>
<STRONG>--cflags</STRONG>
- echos the gnat (Ada compiler) flags needed to com-
- pile with AdaCurses.
-
- <STRONG>--libs</STRONG> echos the gnat libraries needed to link with
+ echos the gnat (Ada compiler) flags needed to compile with
AdaCurses.
+ <STRONG>--libs</STRONG> echos the gnat libraries needed to link with AdaCurses.
+
<STRONG>--version</STRONG>
- echos the release+patchdate version of the ncurses
- libraries used to configure and build AdaCurses.
+ echos the release+patchdate version of the ncurses libraries
+ used to configure and build AdaCurses.
- <STRONG>--help</STRONG> prints a list of the <STRONG>adacurses6-config</STRONG> script's
- options.
+ <STRONG>--help</STRONG> prints a list of the <STRONG>adacurses6-config</STRONG> script's options.
- If no options are given, <STRONG>adacurses6-config</STRONG> prints the com-
- bination of <STRONG>--cflags</STRONG> and <STRONG>--libs</STRONG> that <STRONG>gnatmake</STRONG> expects (see
- example).
+ If no options are given, <STRONG>adacurses6-config</STRONG> prints the combination of
+ <STRONG>--cflags</STRONG> and <STRONG>--libs</STRONG> that <STRONG>gnatmake</STRONG> expects (see example).
</PRE><H2><a name="h2-EXAMPLE">EXAMPLE</a></H2><PRE>
- For example, supposing that you want to compile the "Hello
- World!" program for AdaCurses. Make a file named
- "hello.adb":
+ For example, supposing that you want to compile the "Hello World!"
+ program for AdaCurses. Make a file named "hello.adb":
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
procedure Hello is
end case;
Nap_Milli_Seconds (50);
-
end loop;
End_Windows;
end Hello;
Then, using
- gnatmake `adacurses-config --cflags` hello -largs
- `adacurses-config --libs`
+ gnatmake `adacurses-config --cflags` hello -largs `adacurses-
+ config --libs`
or (simpler):
gnatmake hello `adacurses-config`
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20170429).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20170506).
- <STRONG>ADACURSES(1)</STRONG>
+ <STRONG>ADACURSES(1)</STRONG>
</PRE>
<div class="nav">
<ul>
<BODY>
<H1 class="no-header">captoinfo 1m</H1>
<PRE>
-<STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG> <STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>
+<STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG> <STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
- <STRONG>captoinfo</STRONG> - convert a <EM>termcap</EM> description into a <EM>terminfo</EM>
- description
+ <STRONG>captoinfo</STRONG> - convert a <EM>termcap</EM> description into a <EM>terminfo</EM> description
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
- <STRONG>captoinfo</STRONG> looks in each given text <EM>file</EM> for <STRONG>termcap</STRONG>
- descriptions. For each one found, an equivalent <STRONG>terminfo</STRONG>
- description is written to standard output. Termcap <STRONG>tc</STRONG>
- capabilities are translated directly to terminfo <STRONG>use</STRONG> capa-
- bilities.
+ <STRONG>captoinfo</STRONG> looks in each given text <EM>file</EM> for <STRONG>termcap</STRONG> descriptions. For
+ each one found, an equivalent <STRONG>terminfo</STRONG> description is written to stan-
+ dard output. Termcap <STRONG>tc</STRONG> capabilities are translated directly to ter-
+ minfo <STRONG>use</STRONG> capabilities.
- If no <EM>file</EM> is given, then the environment variable <STRONG>TERMCAP</STRONG>
- is used for the filename or entry. If <STRONG>TERMCAP</STRONG> is a full
- pathname to a file, only the terminal whose name is speci-
- fied in the environment variable <STRONG>TERM</STRONG> is extracted from
- that file. If the environment variable <STRONG>TERMCAP</STRONG> is not
- set, then the file <STRONG>/usr/share/terminfo</STRONG> is read.
+ If no <EM>file</EM> is given, then the environment variable <STRONG>TERMCAP</STRONG> is used for
+ the filename or entry. If <STRONG>TERMCAP</STRONG> is a full pathname to a file, only
+ the terminal whose name is specified in the environment variable <STRONG>TERM</STRONG>
+ is extracted from that file. If the environment variable <STRONG>TERMCAP</STRONG> is
+ not set, then the file <STRONG>/usr/share/terminfo</STRONG> is read.
- <STRONG>-v</STRONG> print out tracing information on standard error as
- the program runs.
+ <STRONG>-v</STRONG> print out tracing information on standard error as the program
+ runs.
- <STRONG>-V</STRONG> print out the version of the program in use on stan-
- dard error and exit.
+ <STRONG>-V</STRONG> print out the version of the program in use on standard error and
+ exit.
- <STRONG>-1</STRONG> cause the fields to print out one to a line. Other-
- wise, the fields will be printed several to a line to
- a maximum width of 60 characters.
+ <STRONG>-1</STRONG> cause the fields to print out one to a line. Otherwise, the
+ fields will be printed several to a line to a maximum width of 60
+ characters.
<STRONG>-w</STRONG> change the output to <EM>width</EM> characters.
</PRE><H2><a name="h2-FILES">FILES</a></H2><PRE>
- /usr/share/terminfo Compiled terminal description data-
- base.
+ /usr/share/terminfo Compiled terminal description database.
</PRE><H2><a name="h2-TRANSLATIONS-FROM-NONSTANDARD-CAPABILITIES">TRANSLATIONS FROM NONSTANDARD CAPABILITIES</a></H2><PRE>
- Some obsolete nonstandard capabilities will automatically
- be translated into standard (SVr4/XSI Curses) terminfo
- capabilities by <STRONG>captoinfo</STRONG>. Whenever one of these auto-
- matic translations is done, the program will issue an
- notification to stderr, inviting the user to check that it
- has not mistakenly translated a completely unknown and
- random capability and/or syntax error.
+ Some obsolete nonstandard capabilities will automatically be translated
+ into standard (SVr4/XSI Curses) terminfo capabilities by <STRONG>captoinfo</STRONG>.
+ Whenever one of these automatic translations is done, the program will
+ issue an notification to stderr, inviting the user to check that it has
+ not mistakenly translated a completely unknown and random capability
+ and/or syntax error.
Nonstd Std From Terminfo
name name capability
GE ae XENIX exit_alt_charset_mode
GS as XENIX enter_alt_charset_mode
HM kh XENIX key_home
-
LD kL XENIX key_dl
PD kN XENIX key_npage
PN po XENIX prtr_off
PS pf XENIX prtr_on
PU kP XENIX key_ppage
+
RT @8 XENIX kent
UP ku XENIX kcuu1
KA k; Tek key_f10
FC Sf Tek set_foreground
HS mh Iris enter_dim_mode
- XENIX termcap also used to have a set of extension capa-
- bilities for forms drawing, designed to take advantage of
- the IBM PC high-half graphics. They were as follows:
+ XENIX termcap also used to have a set of extension capabilities for
+ forms drawing, designed to take advantage of the IBM PC high-half
+ graphics. They were as follows:
Cap Graphic
-----------------------------
Gc intersection
GG acs magic cookie count
- If the single-line capabilities occur in an entry, they
- will automatically be composed into an <STRONG>acsc</STRONG> string. The
- double-line capabilities and <STRONG>GG</STRONG> are discarded with a warn-
- ing message.
+ If the single-line capabilities occur in an entry, they will automati-
+ cally be composed into an <STRONG>acsc</STRONG> string. The double-line capabilities
+ and <STRONG>GG</STRONG> are discarded with a warning message.
- IBM's AIX has a terminfo facility descended from SVr1 ter-
- minfo but incompatible with the SVr4 format. The follow-
- ing AIX extensions are automatically translated:
+ IBM's AIX has a terminfo facility descended from SVr1 terminfo but
+ incompatible with the SVr4 format. The following AIX extensions are
+ automatically translated:
IBM XSI
-------------
font2 s2ds
font3 s3ds
- Additionally, the AIX <EM>box1</EM> capability will be automati-
- cally translated to an <STRONG>acsc</STRONG> string.
+ Additionally, the AIX <EM>box1</EM> capability will be automatically translated
+ to an <STRONG>acsc</STRONG> string.
- Hewlett-Packard's terminfo library supports two nonstan-
- dard terminfo capabilities <STRONG>meml</STRONG> (memory lock) and <STRONG>memu</STRONG>
- (memory unlock). These will be discarded with a warning
- message.
+ Hewlett-Packard's terminfo library supports two nonstandard terminfo
+ capabilities <STRONG>meml</STRONG> (memory lock) and <STRONG>memu</STRONG> (memory unlock). These will
+ be discarded with a warning message.
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
- This utility is actually a link to <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, running in <EM>-I</EM>
- mode. You can use other <STRONG>tic</STRONG> options such as <STRONG>-f</STRONG> and <STRONG>-x</STRONG>.
+ This utility is actually a link to <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, running in <EM>-I</EM> mode. You
+ can use other <STRONG>tic</STRONG> options such as <STRONG>-f</STRONG> and <STRONG>-x</STRONG>.
- The trace option is not identical to SVr4's. Under SVr4,
- instead of following the <STRONG>-v</STRONG> with a trace level n, you
- repeat it n times.
+ The trace option is not identical to SVr4's. Under SVr4, instead of
+ following the <STRONG>-v</STRONG> with a trace level n, you repeat it n times.
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20170429).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20170506).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
- <STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>
+ <STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>
</PRE>
<div class="nav">
<ul>
<BODY>
<H1 class="no-header">clear 1</H1>
<PRE>
-<STRONG><A HREF="clear.1.html">clear(1)</A></STRONG> <STRONG><A HREF="clear.1.html">clear(1)</A></STRONG>
+<STRONG><A HREF="clear.1.html">clear(1)</A></STRONG> <STRONG><A HREF="clear.1.html">clear(1)</A></STRONG>
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
- <STRONG>clear</STRONG> clears your screen if this is possible, including
- its scrollback buffer (if the extended "E3" capability is
- defined). <STRONG>clear</STRONG> looks in the environment for the terminal
- type given by the environment variable <STRONG>TERM</STRONG>, and then in
- the <STRONG>terminfo</STRONG> database to determine how to clear the
+ <STRONG>clear</STRONG> clears your screen if this is possible, including its scrollback
+ buffer (if the extended "E3" capability is defined). <STRONG>clear</STRONG> looks in
+ the environment for the terminal type given by the environment variable
+ <STRONG>TERM</STRONG>, and then in the <STRONG>terminfo</STRONG> database to determine how to clear the
screen.
- <STRONG>clear</STRONG> writes to the standard output. You can redirect the
- standard output to a file (which prevents <STRONG>clear</STRONG> from actu-
- ally clearing the screen), and later <STRONG>cat</STRONG> the file to the
- screen, clearing it at that point.
+ <STRONG>clear</STRONG> writes to the standard output. You can redirect the standard
+ output to a file (which prevents <STRONG>clear</STRONG> from actually clearing the
+ screen), and later <STRONG>cat</STRONG> the file to the screen, clearing it at that
+ point.
- <STRONG>clear</STRONG> ignores any command-line parameters that may be
- present. The analogous "<STRONG>tput</STRONG> clear" has command-line
- parameters including <STRONG>-T</STRONG> for overriding the <STRONG>TERM</STRONG> environ-
- ment variable.
+ <STRONG>clear</STRONG> ignores any command-line parameters that may be present. The
+ analogous "<STRONG>tput</STRONG> clear" has command-line parameters including <STRONG>-T</STRONG> for
+ overriding the <STRONG>TERM</STRONG> environment variable.
</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
- A <STRONG>clear</STRONG> command appeared in 2.79BSD dated February 24,
- 1979. Later that was provided in Unix 8th edition (1985).
+ A <STRONG>clear</STRONG> command appeared in 2.79BSD dated February 24, 1979. Later
+ that was provided in Unix 8th edition (1985).
- AT&T adapted a different BSD program (<STRONG>tset</STRONG>) to make a new
- command (<STRONG>tput</STRONG>), and used this to replace the <STRONG>clear</STRONG> command
- with a shell script which calls <STRONG>tput</STRONG> <STRONG>clear</STRONG>, e.g.,
+ AT&T adapted a different BSD program (<STRONG>tset</STRONG>) to make a new command
+ (<STRONG>tput</STRONG>), and used this to replace the <STRONG>clear</STRONG> command with a shell script
+ which calls <STRONG>tput</STRONG> <STRONG>clear</STRONG>, e.g.,
/usr/bin/tput ${1:+-T$1} clear 2> /dev/null
exit
- In 1989, when Keith Bostic revised the BSD <STRONG>tput</STRONG> command to
- make it similar to the AT&T <STRONG>tput</STRONG>, he added a shell script
- for the <STRONG>clear</STRONG> command:
+ In 1989, when Keith Bostic revised the BSD <STRONG>tput</STRONG> command to make it sim-
+ ilar to the AT&T <STRONG>tput</STRONG>, he added a shell script for the <STRONG>clear</STRONG> command:
exec tput clear
- The remainder of the script in each case is a copyright
- notice.
+ The remainder of the script in each case is a copyright notice.
- The ncurses <STRONG>clear</STRONG> command began in 1995 by adapting the
- original BSD <STRONG>clear</STRONG> command (with terminfo, of course).
+ The ncurses <STRONG>clear</STRONG> command began in 1995 by adapting the original BSD
+ <STRONG>clear</STRONG> command (with terminfo, of course).
The <STRONG>E3</STRONG> extension came later:
- <STRONG>o</STRONG> In June 1999, xterm provided an extension to the stan-
- dard control sequence for clearing the screen. Rather
- than clearing just the visible part of the screen
- using
+ <STRONG>o</STRONG> In June 1999, xterm provided an extension to the standard control
+ sequence for clearing the screen. Rather than clearing just the
+ visible part of the screen using
printf '\033[2J'
printf '\033[<STRONG>3</STRONG>J'
- This is documented in <EM>XTerm</EM> <EM>Control</EM> <EM>Sequences</EM> as a
- feature originating with xterm.
+ This is documented in <EM>XTerm</EM> <EM>Control</EM> <EM>Sequences</EM> as a feature origi-
+ nating with xterm.
- <STRONG>o</STRONG> A few other terminal developers adopted the feature,
- e.g., PuTTY in 2006.
+ <STRONG>o</STRONG> A few other terminal developers adopted the feature, e.g., PuTTY in
+ 2006.
- <STRONG>o</STRONG> In April 2011, a Red Hat developer submitted a patch
- to the Linux kernel, modifying its console driver to
- do the same thing. The Linux change, part of the 3.0
- release, did not mention xterm, although it was cited
- in the Red Hat bug report (#683733) which led to the
- change.
+ <STRONG>o</STRONG> In April 2011, a Red Hat developer submitted a patch to the Linux
+ kernel, modifying its console driver to do the same thing. The
+ Linux change, part of the 3.0 release, did not mention xterm,
+ although it was cited in the Red Hat bug report (#683733) which led
+ to the change.
- <STRONG>o</STRONG> Again, a few other terminal developers adopted the
- feature. But the next relevant step was a change to
- the <STRONG>clear</STRONG> program in 2013 to incorporate this exten-
- sion.
+ <STRONG>o</STRONG> Again, a few other terminal developers adopted the feature. But
+ the next relevant step was a change to the <STRONG>clear</STRONG> program in 2013 to
+ incorporate this extension.
- <STRONG>o</STRONG> In 2013, the <STRONG>E3</STRONG> extension was overlooked in <STRONG>tput</STRONG> with
- the "clear" parameter. That was addressed in 2016 by
- reorganizing <STRONG>tput</STRONG> to share its logic with <STRONG>clear</STRONG> and
- <STRONG>tset</STRONG>.
+ <STRONG>o</STRONG> In 2013, the <STRONG>E3</STRONG> extension was overlooked in <STRONG>tput</STRONG> with the "clear"
+ parameter. That was addressed in 2016 by reorganizing <STRONG>tput</STRONG> to
+ share its logic with <STRONG>clear</STRONG> and <STRONG>tset</STRONG>.
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
- Neither IEEE Std 1003.1/The Open Group Base Specifica-
- tions Issue 7 (POSIX.1-2008) nor X/Open Curses Issue 7
- documents tset or reset.
+ Neither IEEE Std 1003.1/The Open Group Base Specifications Issue 7
+ (POSIX.1-2008) nor X/Open Curses Issue 7 documents tset or reset.
- The latter documents <STRONG>tput</STRONG>, which could be used to replace
- this utility either via a shell script or by an alias
- (such as a symbolic link) to run <STRONG>tput</STRONG> as <STRONG>clear</STRONG>.
+ The latter documents <STRONG>tput</STRONG>, which could be used to replace this utility
+ either via a shell script or by an alias (such as a symbolic link) to
+ run <STRONG>tput</STRONG> as <STRONG>clear</STRONG>.
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="tput.1.html">tput(1)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20170429).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20170506).
- <STRONG><A HREF="clear.1.html">clear(1)</A></STRONG>
+ <STRONG><A HREF="clear.1.html">clear(1)</A></STRONG>
</PRE>
<div class="nav">
<ul>
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************
- * @Id: curs_add_wch.3x,v 1.17 2017/01/07 19:25:15 tom Exp @
+ * @Id: curs_add_wch.3x,v 1.22 2017/05/06 14:01:26 tom Exp @
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML>
<BODY>
<H1 class="no-header">curs_add_wch 3x</H1>
<PRE>
-<STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG> <STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG>
+<STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG> <STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG>
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
- <STRONG>add_wch</STRONG>, <STRONG>wadd_wch</STRONG>, <STRONG>mvadd_wch</STRONG>, <STRONG>mvwadd_wch</STRONG>, <STRONG>echo_wchar</STRONG>,
- <STRONG>wecho_wchar</STRONG> - add a complex character and rendition to a
- <STRONG>curses</STRONG> window, then advance the cursor
+ <STRONG>add_wch</STRONG>, <STRONG>wadd_wch</STRONG>, <STRONG>mvadd_wch</STRONG>, <STRONG>mvwadd_wch</STRONG>, <STRONG>echo_wchar</STRONG>, <STRONG>wecho_wchar</STRONG> - add
+ a complex character and rendition to a <STRONG>curses</STRONG> window, then advance the
+ cursor
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
<STRONG>int</STRONG> <STRONG>add_wch(</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM> <STRONG>);</STRONG>
<STRONG>int</STRONG> <STRONG>wadd_wch(</STRONG> <STRONG>WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM> <STRONG>);</STRONG>
<STRONG>int</STRONG> <STRONG>mvadd_wch(</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM> <STRONG>);</STRONG>
- <STRONG>int</STRONG> <STRONG>mvwadd_wch(</STRONG> <STRONG>WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG>
- <STRONG>*</STRONG><EM>wch</EM> <STRONG>);</STRONG>
+ <STRONG>int</STRONG> <STRONG>mvwadd_wch(</STRONG> <STRONG>WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM> <STRONG>);</STRONG>
<STRONG>int</STRONG> <STRONG>echo_wchar(</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM> <STRONG>);</STRONG>
<STRONG>int</STRONG> <STRONG>wecho_wchar(</STRONG> <STRONG>WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM> <STRONG>);</STRONG>
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
</PRE><H3><a name="h3-add_wch">add_wch</a></H3><PRE>
- The <STRONG>add_wch</STRONG>, <STRONG>wadd_wch</STRONG>, <STRONG>mvadd_wch</STRONG>, and <STRONG>mvwadd_wch</STRONG> functions
- put the complex character <EM>wch</EM> into the given window at its
- current position, which is then advanced. These functions
- perform wrapping and special-character processing as fol-
- lows:
+ The <STRONG>add_wch</STRONG>, <STRONG>wadd_wch</STRONG>, <STRONG>mvadd_wch</STRONG>, and <STRONG>mvwadd_wch</STRONG> functions put the com-
+ plex character <EM>wch</EM> into the given window at its current position, which
+ is then advanced. These functions perform wrapping and special-charac-
+ ter processing as follows:
- <STRONG>o</STRONG> If <EM>wch</EM> refers to a spacing character, then any previ-
- ous character at that location is removed. A new
- character specified by <EM>wch</EM> is placed at that location
- with rendition specified by <EM>wch</EM>. The cursor then
- advances to the next spacing character on the screen.
+ <STRONG>o</STRONG> If <EM>wch</EM> refers to a spacing character, then any previous character
+ at that location is removed. A new character specified by <EM>wch</EM> is
+ placed at that location with rendition specified by <EM>wch</EM>. The cur-
+ sor then advances to the next spacing character on the screen.
- <STRONG>o</STRONG> If <EM>wch</EM> refers to a non-spacing character, all previous
- characters at that location are preserved. The non-
- spacing characters of <EM>wch</EM> are added to the spacing
- complex character, and the rendition specified by <EM>wch</EM>
- is ignored.
+ <STRONG>o</STRONG> If <EM>wch</EM> refers to a non-spacing character, all previous characters
+ at that location are preserved. The non-spacing characters of <EM>wch</EM>
+ are added to the spacing complex character, and the rendition spec-
+ ified by <EM>wch</EM> is ignored.
- <STRONG>o</STRONG> If the character part of <EM>wch</EM> is a tab, newline,
- backspace or other control character, the window is
- updated and the cursor moves as if <STRONG>addch</STRONG> were called.
+ <STRONG>o</STRONG> If the character part of <EM>wch</EM> is a tab, newline, backspace or other
+ control character, the window is updated and the cursor moves as if
+ <STRONG>addch</STRONG> were called.
</PRE><H3><a name="h3-echo_wchar">echo_wchar</a></H3><PRE>
- The <STRONG>echo_wchar</STRONG> function is functionally equivalent to a
- call to <STRONG>add_wch</STRONG> followed by a call to <STRONG><A HREF="curs_refresh.3x.html">refresh(3x)</A></STRONG>. Simi-
- larly, the <STRONG>wecho_wchar</STRONG> is functionally equivalent to a
- call to <STRONG>wadd_wch</STRONG> followed by a call to <STRONG>wrefresh</STRONG>. The
- knowledge that only a single character is being output is
- taken into consideration and, for non-control characters,
- a considerable performance gain might be seen by using the
- *<STRONG>echo</STRONG>* functions instead of their equivalents.
+ The <STRONG>echo_wchar</STRONG> function is functionally equivalent to a call to <STRONG>add_wch</STRONG>
+ followed by a call to <STRONG><A HREF="curs_refresh.3x.html">refresh(3x)</A></STRONG>. Similarly, the <STRONG>wecho_wchar</STRONG> is func-
+ tionally equivalent to a call to <STRONG>wadd_wch</STRONG> followed by a call to <STRONG>wre-</STRONG>
+ <STRONG>fresh</STRONG>. The knowledge that only a single character is being output is
+ taken into consideration and, for non-control characters, a consider-
+ able performance gain might be seen by using the *<STRONG>echo</STRONG>* functions
+ instead of their equivalents.
</PRE><H3><a name="h3-Line-Graphics">Line Graphics</a></H3><PRE>
- Like <STRONG><A HREF="curs_addch.3x.html">addch(3x)</A></STRONG>, <STRONG>addch_wch</STRONG> accepts symbols which make it
- simple to draw lines and other frequently used special
- characters. These symbols correspond to the same VT100
- line-drawing set as <STRONG><A HREF="curs_addch.3x.html">addch(3x)</A></STRONG>.
-
- <EM>Name</EM> <EM>Unicode</EM> <EM>Default</EM> <EM>Description</EM>
- ----------------------------------------------------------------
- WACS_BLOCK 0x25ae # solid square block
- WACS_BOARD 0x2592 # board of squares
- WACS_BTEE 0x2534 + bottom tee
-
- WACS_BULLET 0x00b7 o bullet
- WACS_CKBOARD 0x2592 : checker board (stipple)
- WACS_DARROW 0x2193 v arrow pointing down
- WACS_DEGREE 0x00b0 ' degree symbol
- WACS_DIAMOND 0x25c6 + diamond
- WACS_GEQUAL 0x2265 > greater-than-or-equal-to
- WACS_HLINE 0x2500 - horizontal line
- WACS_LANTERN 0x2603 # lantern symbol
- WACS_LARROW 0x2190 < arrow pointing left
- WACS_LEQUAL 0x2264 < less-than-or-equal-to
- WACS_LLCORNER 0x2514 + lower left-hand corner
- WACS_LRCORNER 0x2518 + lower right-hand corner
- WACS_LTEE 0x2524 + left tee
- WACS_NEQUAL 0x2260 ! not-equal
- WACS_PI 0x03c0 * greek pi
- WACS_PLMINUS 0x00b1 # plus/minus
- WACS_PLUS 0x253c + plus
- WACS_RARROW 0x2192 > arrow pointing right
- WACS_RTEE 0x251c + right tee
- WACS_S1 0x23ba - scan line 1
- WACS_S3 0x23bb - scan line 3
- WACS_S7 0x23bc - scan line 7
- WACS_S9 0x23bd _ scan line 9
- WACS_STERLING 0x00a3 f pound-sterling symbol
- WACS_TTEE 0x252c + top tee
- WACS_UARROW 0x2191 ^ arrow pointing up
- WACS_ULCORNER 0x250c + upper left-hand corner
- WACS_URCORNER 0x2510 + upper right-hand corner
- WACS_VLINE 0x2502 | vertical line
-
- The wide-character configuration of ncurses also defines
- symbols for thick- and double-lines:
-
- <EM>Name</EM> <EM>Unicode</EM> <EM>Default</EM> <EM>Description</EM>
- ---------------------------------------------------------------------
- WACS_T_ULCORNER 0x250f + thick upper left corner
- WACS_T_LLCORNER 0x2517 + thick lower left corner
- WACS_T_URCORNER 0x2513 + thick upper right corner
- WACS_T_LRCORNER 0x251b + thick lower right corner
- WACS_T_LTEE 0x252b + thick tee pointing right
- WACS_T_RTEE 0x2523 + thick tee pointing left
- WACS_T_BTEE 0x253b + thick tee pointing up
- WACS_T_TTEE 0x2533 + thick tee pointing down
- WACS_T_HLINE 0x2501 - thick horizontal line
- WACS_T_VLINE 0x2503 | thick vertical line
- WACS_T_PLUS 0x254b + thick large plus or crossover
- WACS_D_ULCORNER 0x2554 + double upper left corner
- WACS_D_LLCORNER 0x255a + double lower left corner
- WACS_D_URCORNER 0x2557 + double upper right corner
- WACS_D_LRCORNER 0x255d + double lower right corner
- WACS_D_RTEE 0x2563 + double tee pointing left
- WACS_D_LTEE 0x2560 + double tee pointing right
- WACS_D_BTEE 0x2569 + double tee pointing up
- WACS_D_TTEE 0x2566 + double tee pointing down
- WACS_D_HLINE 0x2550 - double horizontal line
- WACS_D_VLINE 0x2551 | double vertical line
- WACS_D_PLUS 0x256c + double large plus or crossover
+ Like <STRONG><A HREF="curs_addch.3x.html">addch(3x)</A></STRONG>, <STRONG>addch_wch</STRONG> accepts symbols which make it simple to draw
+ lines and other frequently used special characters. These symbols cor-
+ respond to the same VT100 line-drawing set as <STRONG><A HREF="curs_addch.3x.html">addch(3x)</A></STRONG>.
+
+ <STRONG>ACS</STRONG> <STRONG>Unicode</STRONG> <STRONG>ASCII</STRONG> <STRONG>acsc</STRONG> <STRONG>Glyph</STRONG>
+ <STRONG>Name</STRONG> <STRONG>Default</STRONG> <STRONG>Default</STRONG> <STRONG>char</STRONG> <STRONG>Name</STRONG>
+ ------------------------------------------------------------------------
+ WACS_BLOCK 0x25ae # 0 solid square block
+ WACS_BOARD 0x2592 # h board of squares
+ WACS_BTEE 0x2534 + v bottom tee
+ WACS_BULLET 0x00b7 o ~ bullet
+ WACS_CKBOARD 0x2592 : a checker board (stipple)
+ WACS_DARROW 0x2193 v . arrow pointing down
+ WACS_DEGREE 0x00b0 ' f degree symbol
+ WACS_DIAMOND 0x25c6 + ` diamond
+
+ WACS_GEQUAL 0x2265 > > greater-than-or-equal-to
+ WACS_HLINE 0x2500 - q horizontal line
+ WACS_LANTERN 0x2603 # i lantern symbol
+ WACS_LARROW 0x2190 < , arrow pointing left
+ WACS_LEQUAL 0x2264 < y less-than-or-equal-to
+ WACS_LLCORNER 0x2514 + m lower left-hand corner
+ WACS_LRCORNER 0x2518 + j lower right-hand corner
+ WACS_LTEE 0x2524 + t left tee
+ WACS_NEQUAL 0x2260 ! | not-equal
+ WACS_PI 0x03c0 * { greek pi
+ WACS_PLMINUS 0x00b1 # g plus/minus
+ WACS_PLUS 0x253c + n plus
+ WACS_RARROW 0x2192 > + arrow pointing right
+ WACS_RTEE 0x251c + u right tee
+ WACS_S1 0x23ba - o scan line 1
+ WACS_S3 0x23bb - p scan line 3
+ WACS_S7 0x23bc - r scan line 7
+ WACS_S9 0x23bd _ s scan line 9
+ WACS_STERLING 0x00a3 f } pound-sterling symbol
+ WACS_TTEE 0x252c + w top tee
+ WACS_UARROW 0x2191 ^ - arrow pointing up
+ WACS_ULCORNER 0x250c + l upper left-hand corner
+ WACS_URCORNER 0x2510 + k upper right-hand corner
+ WACS_VLINE 0x2502 | x vertical line
+
+ The wide-character configuration of ncurses also defines symbols for
+ double-lines:
+
+ <STRONG>ACS</STRONG> <STRONG>Unicode</STRONG> <STRONG>ASCII</STRONG> <STRONG>acsc</STRONG> <STRONG>Glyph</STRONG>
+ <STRONG>Name</STRONG> <STRONG>Default</STRONG> <STRONG>Default</STRONG> <STRONG>char</STRONG> <STRONG>Name</STRONG>
+ ------------------------------------------------------------------------
+ WACS_D_BTEE 0x2569 + H double tee pointing up
+ WACS_D_HLINE 0x2550 - R double horizontal line
+ WACS_D_LLCORNER 0x255a + D double lower left corner
+ WACS_D_LRCORNER 0x255d + A double lower right corner
+ WACS_D_LTEE 0x2560 + F double tee pointing right
+ WACS_D_PLUS 0x256c + E double large plus
+ WACS_D_RTEE 0x2563 + G double tee pointing left
+ WACS_D_TTEE 0x2566 + I double tee pointing down
+ WACS_D_ULCORNER 0x2554 + C double upper left corner
+ WACS_D_URCORNER 0x2557 + B double upper right corner
+ WACS_D_VLINE 0x2551 | Y double vertical line
+
+ and for thick lines:
+
+ <STRONG>ACS</STRONG> <STRONG>Unicode</STRONG> <STRONG>ASCII</STRONG> <STRONG>acsc</STRONG> <STRONG>Glyph</STRONG>
+ <STRONG>Name</STRONG> <STRONG>Default</STRONG> <STRONG>Default</STRONG> <STRONG>char</STRONG> <STRONG>Name</STRONG>
+ -----------------------------------------------------------------------
+ WACS_T_BTEE 0x253b + V thick tee pointing up
+ WACS_T_HLINE 0x2501 - Q thick horizontal line
+ WACS_T_LLCORNER 0x2517 + M thick lower left corner
+ WACS_T_LRCORNER 0x251b + J thick lower right corner
+ WACS_T_LTEE 0x252b + T thick tee pointing right
+ WACS_T_PLUS 0x254b + N thick large plus
+ WACS_T_RTEE 0x2523 + U thick tee pointing left
+ WACS_T_TTEE 0x2533 + W thick tee pointing down
+ WACS_T_ULCORNER 0x250f + L thick upper left corner
+ WACS_T_URCORNER 0x2513 + K thick upper right corner
+ WACS_T_VLINE 0x2503 | X thick vertical line
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
- All routines return the integer <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> on
- success.
+ All routines return the integer <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> on success.
- Functions with a "mv" prefix first perform a cursor move-
- ment using <STRONG>wmove</STRONG>, and return an error if the position is
- outside the window, or if the window pointer is null.
+ Functions with a "mv" prefix first perform a cursor movement using
+ <STRONG>wmove</STRONG>, and return an error if the position is outside the window, or if
+ the window pointer is null.
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
- Note that <STRONG>add_wch</STRONG>, <STRONG>mvadd_wch</STRONG>, <STRONG>mvwadd_wch</STRONG>, and <STRONG>echo_wchar</STRONG>
- may be macros.
+ Note that <STRONG>add_wch</STRONG>, <STRONG>mvadd_wch</STRONG>, <STRONG>mvwadd_wch</STRONG>, and <STRONG>echo_wchar</STRONG> may be macros.
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
- All of these functions are described in the XSI Curses
- standard, Issue 4. The defaults specified for line-draw-
- ing characters apply in the POSIX locale.
-
- X/Open Curses makes it clear that the WACS_ symbols should
- be defined as a pointer to <STRONG>cchar_t</STRONG> data, e.g., in the dis-
- cussion of <STRONG>border_set</STRONG>. A few implementations are problem-
- atic:
-
- <STRONG>o</STRONG> NetBSD curses defines the symbols as a <STRONG>wchar_t</STRONG> within
- a <STRONG>cchar_t</STRONG>.
-
- <STRONG>o</STRONG> HPUX curses equates some of the <EM>ACS</EM><STRONG>_</STRONG> symbols to the
- analogous <EM>WACS</EM><STRONG>_</STRONG> symbols as if the <EM>ACS</EM><STRONG>_</STRONG> symbols were
- wide characters. The misdefined symbols are the
- arrows and other symbols which are not used for line-
- drawing.
-
- X/Open Curses does not define symbols for thick- or dou-
- ble-lines. SVr4 curses implementations defined their
- line-drawing symbols in terms of intermediate symbols.
- This implementation extends those symbols, providing new
- definitions which are not in the SVr4 implementations.
+ All of these functions are described in the XSI Curses standard, Issue
+ 4. The defaults specified for line-drawing characters apply in the
+ POSIX locale.
+
+ X/Open Curses makes it clear that the WACS_ symbols should be defined
+ as a pointer to <STRONG>cchar_t</STRONG> data, e.g., in the discussion of <STRONG>border_set</STRONG>. A
+ few implementations are problematic:
+
+ <STRONG>o</STRONG> NetBSD curses defines the symbols as a <STRONG>wchar_t</STRONG> within a <STRONG>cchar_t</STRONG>.
+
+ <STRONG>o</STRONG> HPUX curses equates some of the <EM>ACS</EM><STRONG>_</STRONG> symbols to the analogous <EM>WACS</EM><STRONG>_</STRONG>
+ symbols as if the <EM>ACS</EM><STRONG>_</STRONG> symbols were wide characters. The misde-
+ fined symbols are the arrows and other symbols which are not used
+ for line-drawing.
+
+ X/Open Curses does not define symbols for thick- or double-lines. SVr4
+ curses implementations defined their line-drawing symbols in terms of
+ intermediate symbols. This implementation extends those symbols, pro-
+ viding new definitions which are not in the SVr4 implementations.
+
+ Not all Unicode-capable terminals provide support for VT100-style
+ alternate character sets (i.e., the <STRONG>acsc</STRONG> capability), with their corre-
+ sponding line-drawing characters. X/Open Curses did not address the
+ aspect of integrating Unicode with line-drawing characters. Existing
+ implementations of Unix curses (AIX, HPUX, Solaris) use only the <STRONG>acsc</STRONG>
+ character-mapping to provide this feature. As a result, those imple-
+ mentations can only use single-byte line-drawing characters. Ncurses
+ 5.3 (2002) provided a table of Unicode values to solve these problems.
+ NetBSD curses incorporated that table in 2010.
+
+ In this implementation, the Unicode values are used instead of the ter-
+ minal description's <STRONG>acsc</STRONG> mapping as discussed in <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG> for the
+ environment variable <STRONG>NCURSES_NO_UTF8_ACS</STRONG>. In contrast, for the same
+ cases, the line-drawing characters described in <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG> will use
+ only the ASCII default values.
+
+ Having Unicode available does not solve all of the problems with line-
+ drawing for curses:
+
+ <STRONG>o</STRONG> The closest Unicode equivalents to the VT100 graphics <EM>S1</EM>, <EM>S3</EM>, <EM>S7</EM>
+ and <EM>S9</EM> frequently are not displayed at the regular intervals which
+ the terminal used.
+
+ <STRONG>o</STRONG> The <EM>lantern</EM> is a special case. It originated with the AT&T 4410
+ terminal in the early 1980s. There is no accessible documentation
+ depicting the lantern symbol on the AT&T terminal.
+
+ Lacking documentation, most readers assume that a <EM>storm</EM> <EM>lantern</EM> was
+ intended. But there are several possibilities, all with problems.
+
+ Unicode 6.0 (2010) does provide two lantern symbols: U+1F383 and
+ U+1F3EE. Those were not availble in 2002, and are irrelevant since
+ they lie outside the BMP and as a result are not generally avail-
+ able in terminals. They are not storm lanterns, in any case.
+
+ Most <EM>storm</EM> <EM>lanterns</EM> have a tapering glass chimney (to guard against
+ tipping); some have a wire grid protecting the chimney.
+
+ For the tapering appearance, U+2603 was adequate. In use on a
+ terminal, no one can tell what the image represents. Unicode calls
+ it a snowman.
+
+ Others have suggested these alternatives: S U+00A7 (section mark),
+ <STRONG>O</STRONG> U+0398 (theta), <STRONG>O</STRONG> U+03A6 (phi), d U+03B4 (delta), U+2327 (x in a
+ rectangle), U+256C (forms double vertical and horizontal), and
+ U+2612 (ballot box with x).
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
- <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>, <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>, <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>,
- <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>, <STRONG>putwc(3)</STRONG>
+ <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>, <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>, <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>, <STRONG>curs_out-</STRONG>
+ <STRONG><A HREF="curs_outopts.3x.html">opts(3x)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>, <STRONG>putwc(3)</STRONG>
- <STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG>
+ <STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG>
</PRE>
<div class="nav">
<ul>
<BODY>
<H1 class="no-header">curs_add_wchstr 3x</H1>
<PRE>
-<STRONG><A HREF="curs_add_wchstr.3x.html">curs_add_wchstr(3x)</A></STRONG> <STRONG><A HREF="curs_add_wchstr.3x.html">curs_add_wchstr(3x)</A></STRONG>
+<STRONG><A HREF="curs_add_wchstr.3x.html">curs_add_wchstr(3x)</A></STRONG> <STRONG><A HREF="curs_add_wchstr.3x.html">curs_add_wchstr(3x)</A></STRONG>
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
- <STRONG>add_wchstr</STRONG>, <STRONG>add_wchnstr</STRONG>, <STRONG>wadd_wchstr</STRONG>, <STRONG>wadd_wchnstr</STRONG>,
- <STRONG>mvadd_wchstr</STRONG>, <STRONG>mvadd_wchnstr</STRONG>, <STRONG>mvwadd_wchstr</STRONG>, <STRONG>mvwadd_wchnstr</STRONG>
- - add an array of complex characters (and attributes) to a
- curses window
+ <STRONG>add_wchstr</STRONG>, <STRONG>add_wchnstr</STRONG>, <STRONG>wadd_wchstr</STRONG>, <STRONG>wadd_wchnstr</STRONG>, <STRONG>mvadd_wchstr</STRONG>,
+ <STRONG>mvadd_wchnstr</STRONG>, <STRONG>mvwadd_wchstr</STRONG>, <STRONG>mvwadd_wchnstr</STRONG> - add an array of complex
+ characters (and attributes) to a curses window
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
- These functions copy the (null-terminated) array of com-
- plex characters <EM>wchstr</EM> into the window image structure
- starting at the current cursor position. The four func-
- tions with <EM>n</EM> as the last argument copy at most <EM>n</EM> elements,
- but no more than will fit on the line. If <STRONG>n</STRONG>=<STRONG>-1</STRONG> then the
- whole array is copied, to the maximum number of characters
- that will fit on the line.
+ These functions copy the (null-terminated) array of complex characters
+ <EM>wchstr</EM> into the window image structure starting at the current cursor
+ position. The four functions with <EM>n</EM> as the last argument copy at most
+ <EM>n</EM> elements, but no more than will fit on the line. If <STRONG>n</STRONG>=<STRONG>-1</STRONG> then the
+ whole array is copied, to the maximum number of characters that will
+ fit on the line.
- The window cursor is <EM>not</EM> advanced. These functions work
- faster than <STRONG>waddnstr</STRONG>. On the other hand:
+ The window cursor is <EM>not</EM> advanced. These functions work faster than
+ <STRONG>waddnstr</STRONG>. On the other hand:
- <STRONG>o</STRONG> they do not perform checking (such as for the newline,
- backspace, or carriage return characters),
+ <STRONG>o</STRONG> they do not perform checking (such as for the newline, backspace,
+ or carriage return characters),
<STRONG>o</STRONG> they do not advance the current cursor position,
- <STRONG>o</STRONG> they do not expand other control characters to ^-es-
- capes, and
+ <STRONG>o</STRONG> they do not expand other control characters to ^-escapes, and
- <STRONG>o</STRONG> they truncate the string if it crosses the right mar-
- gin, rather than wrapping it around to the new line.
+ <STRONG>o</STRONG> they truncate the string if it crosses the right margin, rather
+ than wrapping it around to the new line.
- These functions end successfully on encountering a null
- <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM>, or when they have filled the current line. If a
- complex character cannot completely fit at the end of the
- current line, the remaining columns are filled with the
- background character and rendition.
+ These functions end successfully on encountering a null <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM>, or
+ when they have filled the current line. If a complex character cannot
+ completely fit at the end of the current line, the remaining columns
+ are filled with the background character and rendition.
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
- All functions return the integer <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG>
- on success.
+ All functions return the integer <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> on success.
- X/Open does not define any error conditions. This imple-
- mentation returns an error if the window pointer is null.
+ X/Open does not define any error conditions. This implementation re-
+ turns an error if the window pointer is null.
- Functions with a "mv" prefix first perform a cursor move-
- ment using <STRONG>wmove</STRONG>, and return an error if the position is
- outside the window, or if the window pointer is null.
+ Functions with a "mv" prefix first perform a cursor movement using
+ <STRONG>wmove</STRONG>, and return an error if the position is outside the window, or if
+ the window pointer is null.
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
- These entry points are described in the XSI Curses stan-
- dard, Issue 4.
+ These entry points are described in the XSI Curses standard, Issue 4.
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="curs_addwstr.3x.html">curs_addwstr(3x)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>.
- Comparable functions in the narrow-character (ncurses) li-
- brary are described in <STRONG><A HREF="curs_addchstr.3x.html">curs_addchstr(3x)</A></STRONG>.
+ Comparable functions in the narrow-character (ncurses) library are de-
+ scribed in <STRONG><A HREF="curs_addchstr.3x.html">curs_addchstr(3x)</A></STRONG>.
- <STRONG><A HREF="curs_add_wchstr.3x.html">curs_add_wchstr(3x)</A></STRONG>
+ <STRONG><A HREF="curs_add_wchstr.3x.html">curs_add_wchstr(3x)</A></STRONG>
</PRE>
<div class="nav">
<ul>
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************
- * @Id: curs_addch.3x,v 1.39 2017/04/17 00:14:02 tom Exp @
+ * @Id: curs_addch.3x,v 1.41 2017/05/05 18:15:29 tom Exp @
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML>
<BODY>
<H1 class="no-header">curs_addch 3x</H1>
<PRE>
-<STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG> <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>
+<STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG> <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
- <STRONG>addch</STRONG>, <STRONG>waddch</STRONG>, <STRONG>mvaddch</STRONG>, <STRONG>mvwaddch</STRONG>, <STRONG>echochar</STRONG>, <STRONG>wechochar</STRONG> -
- add a character (with attributes) to a <STRONG>curses</STRONG> window, then
- advance the cursor
+ <STRONG>addch</STRONG>, <STRONG>waddch</STRONG>, <STRONG>mvaddch</STRONG>, <STRONG>mvwaddch</STRONG>, <STRONG>echochar</STRONG>, <STRONG>wechochar</STRONG> - add a character
+ (with attributes) to a <STRONG>curses</STRONG> window, then advance the cursor
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
</PRE><H3><a name="h3-Adding-characters">Adding characters</a></H3><PRE>
- The <STRONG>addch</STRONG>, <STRONG>waddch</STRONG>, <STRONG>mvaddch</STRONG> and <STRONG>mvwaddch</STRONG> routines put the
- character <EM>ch</EM> into the given window at its current window
- position, which is then advanced. They are analogous to
- <STRONG>putchar(3)</STRONG> in <STRONG>stdio(3)</STRONG>. If the advance is at the right
- margin:
-
- <STRONG>o</STRONG> The cursor automatically wraps to the beginning of the
- next line.
-
- <STRONG>o</STRONG> At the bottom of the current scrolling region, and if
- <STRONG>scrollok</STRONG> is enabled, the scrolling region is scrolled
- up one line.
-
- <STRONG>o</STRONG> If <STRONG>scrollok</STRONG> is not enabled, writing a character at the
- lower right margin succeeds. However, an error is
- returned because it is not possible to wrap to a new
- line
-
- If <EM>ch</EM> is a tab, newline, carriage return or backspace, the
- cursor is moved appropriately within the window:
-
- <STRONG>o</STRONG> Backspace moves the cursor one character left; at the
- left edge of a window it does nothing.
-
- <STRONG>o</STRONG> Carriage return moves the cursor to the window left
- margin on the current line.
-
- <STRONG>o</STRONG> Newline does a <STRONG>clrtoeol</STRONG>, then moves the cursor to the
- window left margin on the next line, scrolling the
- window if on the last line.
-
- <STRONG>o</STRONG> Tabs are considered to be at every eighth column. The
- tab interval may be altered by setting the <STRONG>TABSIZE</STRONG>
- variable.
-
- If <EM>ch</EM> is any other control character, it is drawn in <STRONG>^</STRONG><EM>X</EM>
- notation. Calling <STRONG>winch</STRONG> after adding a control character
- does not return the character itself, but instead returns
- the ^-representation of the control character.
-
- Video attributes can be combined with a character argument
- passed to <STRONG>addch</STRONG> or related functions by logical-ORing them
- into the character. (Thus, text, including attributes,
- can be copied from one place to another using <STRONG><A HREF="curs_inch.3x.html">inch(3x)</A></STRONG> and
- <STRONG>addch</STRONG>.) See the <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG> page for values of prede-
- fined video attribute constants that can be usefully OR'ed
+ The <STRONG>addch</STRONG>, <STRONG>waddch</STRONG>, <STRONG>mvaddch</STRONG> and <STRONG>mvwaddch</STRONG> routines put the character <EM>ch</EM>
+ into the given window at its current window position, which is then
+ advanced. They are analogous to <STRONG>putchar(3)</STRONG> in <STRONG>stdio(3)</STRONG>. If the
+ advance is at the right margin:
+
+ <STRONG>o</STRONG> The cursor automatically wraps to the beginning of the next line.
+
+ <STRONG>o</STRONG> At the bottom of the current scrolling region, and if <STRONG>scrollok</STRONG> is
+ enabled, the scrolling region is scrolled up one line.
+
+ <STRONG>o</STRONG> If <STRONG>scrollok</STRONG> is not enabled, writing a character at the lower right
+ margin succeeds. However, an error is returned because it is not
+ possible to wrap to a new line
+
+ If <EM>ch</EM> is a tab, newline, carriage return or backspace, the cursor is
+ moved appropriately within the window:
+
+ <STRONG>o</STRONG> Backspace moves the cursor one character left; at the left edge of
+ a window it does nothing.
+
+ <STRONG>o</STRONG> Carriage return moves the cursor to the window left margin on the
+ current line.
+
+ <STRONG>o</STRONG> Newline does a <STRONG>clrtoeol</STRONG>, then moves the cursor to the window left
+ margin on the next line, scrolling the window if on the last line.
+
+ <STRONG>o</STRONG> Tabs are considered to be at every eighth column. The tab interval
+ may be altered by setting the <STRONG>TABSIZE</STRONG> variable.
+
+ If <EM>ch</EM> is any other control character, it is drawn in <STRONG>^</STRONG><EM>X</EM> notation.
+ Calling <STRONG>winch</STRONG> after adding a control character does not return the
+ character itself, but instead returns the ^-representation of the con-
+ trol character.
+
+ Video attributes can be combined with a character argument passed to
+ <STRONG>addch</STRONG> or related functions by logical-ORing them into the character.
+ (Thus, text, including attributes, can be copied from one place to
+ another using <STRONG><A HREF="curs_inch.3x.html">inch(3x)</A></STRONG> and <STRONG>addch</STRONG>.) See the <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG> page for val-
+ ues of predefined video attribute constants that can be usefully OR'ed
into characters.
</PRE><H3><a name="h3-Echoing-characters">Echoing characters</a></H3><PRE>
- The <STRONG>echochar</STRONG> and <STRONG>wechochar</STRONG> routines are equivalent to a
- call to <STRONG>addch</STRONG> followed by a call to <STRONG><A HREF="curs_refresh.3x.html">refresh(3x)</A></STRONG>, or a call
- to <STRONG>waddch</STRONG> followed by a call to <STRONG>wrefresh</STRONG>. The knowledge
- that only a single character is being output is used and,
- for non-control characters, a considerable performance
- gain may be seen by using these routines instead of their
- equivalents.
+ The <STRONG>echochar</STRONG> and <STRONG>wechochar</STRONG> routines are equivalent to a call to <STRONG>addch</STRONG>
+ followed by a call to <STRONG><A HREF="curs_refresh.3x.html">refresh(3x)</A></STRONG>, or a call to <STRONG>waddch</STRONG> followed by a
+ call to <STRONG>wrefresh</STRONG>. The knowledge that only a single character is being
+ output is used and, for non-control characters, a considerable perfor-
+ mance gain may be seen by using these routines instead of their equiva-
+ lents.
</PRE><H3><a name="h3-Line-Graphics">Line Graphics</a></H3><PRE>
- The following variables may be used to add line drawing
- characters to the screen with routines of the <STRONG>addch</STRONG> fam-
- ily. The default character listed below is used if the
- <STRONG>acsc</STRONG> capability does not define a terminal-specific
- replacement for it, or if the terminal and locale configu-
- ration requires Unicode but the library is unable to use
- Unicode.
+ The following variables may be used to add line drawing characters to
+ the screen with routines of the <STRONG>addch</STRONG> family. The default character
+ listed below is used if the <STRONG>acsc</STRONG> capability does not define a terminal-
+ specific replacement for it, or if the terminal and locale configura-
+ tion requires Unicode but the library is unable to use Unicode.
The names are taken from VT100 nomenclature.
- <EM>Name</EM> <EM>Default</EM> <EM>Description</EM>
- --------------------------------------------------
- ACS_BLOCK # solid square block
- ACS_BOARD # board of squares
- ACS_BTEE + bottom tee
- ACS_BULLET o bullet
- ACS_CKBOARD : checker board (stipple)
- ACS_DARROW v arrow pointing down
- ACS_DEGREE ' degree symbol
- ACS_DIAMOND + diamond
- ACS_GEQUAL > greater-than-or-equal-to
- ACS_HLINE - horizontal line
- ACS_LANTERN # lantern symbol
- ACS_LARROW < arrow pointing left
- ACS_LEQUAL < less-than-or-equal-to
- ACS_LLCORNER + lower left-hand corner
- ACS_LRCORNER + lower right-hand corner
- ACS_LTEE + left tee
- ACS_NEQUAL ! not-equal
- ACS_PI * greek pi
- ACS_PLMINUS # plus/minus
- ACS_PLUS + plus
- ACS_RARROW > arrow pointing right
- ACS_RTEE + right tee
- ACS_S1 - scan line 1
- ACS_S3 - scan line 3
- ACS_S7 - scan line 7
- ACS_S9 _ scan line 9
- ACS_STERLING f pound-sterling symbol
- ACS_TTEE + top tee
- ACS_UARROW ^ arrow pointing up
- ACS_ULCORNER + upper left-hand corner
- ACS_URCORNER + upper right-hand corner
- ACS_VLINE | vertical line
+ <STRONG>ACS</STRONG> <STRONG>ACS</STRONG> <STRONG>acsc</STRONG> <STRONG>Glyph</STRONG>
+ <STRONG>Name</STRONG> <STRONG>Default</STRONG> <STRONG>char</STRONG> <STRONG>Name</STRONG>
+ ---------------------------------------------------------
+ ACS_BLOCK # 0 solid square block
+ ACS_BOARD # h board of squares
+ ACS_BTEE + v bottom tee
+ ACS_BULLET o ~ bullet
+ ACS_CKBOARD : a checker board (stipple)
+ ACS_DARROW v . arrow pointing down
+ ACS_DEGREE ' f degree symbol
+ ACS_DIAMOND + ` diamond
+ ACS_GEQUAL > > greater-than-or-equal-to
+ ACS_HLINE - q horizontal line
+ ACS_LANTERN # i lantern symbol
+ ACS_LARROW < , arrow pointing left
+ ACS_LEQUAL < y less-than-or-equal-to
+ ACS_LLCORNER + m lower left-hand corner
+ ACS_LRCORNER + j lower right-hand corner
+ ACS_LTEE + t left tee
+ ACS_NEQUAL ! | not-equal
+ ACS_PI * { greek pi
+ ACS_PLMINUS # g plus/minus
+ ACS_PLUS + n plus
+ ACS_RARROW > + arrow pointing right
+ ACS_RTEE + u right tee
+ ACS_S1 - o scan line 1
+ ACS_S3 - p scan line 3
+ ACS_S7 - r scan line 7
+ ACS_S9 _ s scan line 9
+ ACS_STERLING f } pound-sterling symbol
+ ACS_TTEE + w top tee
+ ACS_UARROW ^ - arrow pointing up
+ ACS_ULCORNER + l upper left-hand corner
+ ACS_URCORNER + k upper right-hand corner
+ ACS_VLINE | x vertical line
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
- All routines return the integer <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> on
- success (the SVr4 manuals specify only "an integer value
- other than <STRONG>ERR</STRONG>") upon successful completion, unless other-
- wise noted in the preceding routine descriptions.
+ All routines return the integer <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> on success (the
+ SVr4 manuals specify only "an integer value other than <STRONG>ERR</STRONG>") upon suc-
+ cessful completion, unless otherwise noted in the preceding routine
+ descriptions.
- Functions with a "mv" prefix first perform a cursor move-
- ment using <STRONG>wmove</STRONG>, and return an error if the position is
- outside the window, or if the window pointer is null.
+ Functions with a "mv" prefix first perform a cursor movement using
+ <STRONG>wmove</STRONG>, and return an error if the position is outside the window, or if
+ the window pointer is null.
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
- Note that <STRONG>addch</STRONG>, <STRONG>mvaddch</STRONG>, <STRONG>mvwaddch</STRONG>, and <STRONG>echochar</STRONG> may be
- macros.
+ Note that <STRONG>addch</STRONG>, <STRONG>mvaddch</STRONG>, <STRONG>mvwaddch</STRONG>, and <STRONG>echochar</STRONG> may be macros.
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
- All these functions are described in the XSI Curses stan-
- dard, Issue 4. The defaults specified for forms-drawing
- characters apply in the POSIX locale.
-
- X/Open Curses states that the <EM>ACS</EM><STRONG>_</STRONG> definitions are <STRONG>char</STRONG>
- constants. For the wide-character implementation (see
- <STRONG>curs_add_wch</STRONG>), there are analogous <EM>WACS</EM><STRONG>_</STRONG> definitions which
- are <STRONG>cchar_t</STRONG> constants.
-
- Some ACS symbols (ACS_S3, ACS_S7, ACS_LEQUAL, ACS_GEQUAL,
- ACS_PI, ACS_NEQUAL, ACS_STERLING) were not documented in
- any publicly released System V. However, many publicly
- available terminfos include <STRONG>acsc</STRONG> strings in which their
- key characters (pryz{|}) are embedded, and a second-hand
- list of their character descriptions has come to light.
- The ACS-prefixed names for them were invented for
- <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG>.
-
- The <EM>displayed</EM> values for the <EM>ACS</EM><STRONG>_</STRONG> and <EM>WACS</EM><STRONG>_</STRONG> constants
- depend on
-
- <STRONG>o</STRONG> the library configuration, i.e., <STRONG>ncurses</STRONG> versus <STRONG>ncurs-</STRONG>
- <STRONG>esw</STRONG>, where the latter is capable of displaying Unicode
- while the former is not, and
+ All these functions are described in the XSI Curses standard, Issue 4.
+ The defaults specified for forms-drawing characters apply in the POSIX
+ locale.
+
+ X/Open Curses states that the <EM>ACS</EM><STRONG>_</STRONG> definitions are <STRONG>char</STRONG> constants. For
+ the wide-character implementation (see <STRONG>curs_add_wch</STRONG>), there are analo-
+ gous <EM>WACS</EM><STRONG>_</STRONG> definitions which are <STRONG>cchar_t</STRONG> constants.
+
+ Some ACS symbols (ACS_S3, ACS_S7, ACS_LEQUAL, ACS_GEQUAL, ACS_PI,
+ ACS_NEQUAL, ACS_STERLING) were not documented in any publicly released
+ System V. However, many publicly available terminfos include <STRONG>acsc</STRONG>
+ strings in which their key characters (pryz{|}) are embedded, and a
+ second-hand list of their character descriptions has come to light.
+ The ACS-prefixed names for them were invented for <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG>.
+
+ The <EM>displayed</EM> values for the <EM>ACS</EM><STRONG>_</STRONG> and <EM>WACS</EM><STRONG>_</STRONG> constants depend on
+
+ <STRONG>o</STRONG> the library configuration, i.e., <STRONG>ncurses</STRONG> versus <STRONG>ncursesw</STRONG>, where the
+ latter is capable of displaying Unicode while the former is not,
+ and
<STRONG>o</STRONG> whether the <EM>locale</EM> uses UTF-8 encoding.
- In certain cases, the terminal is unable to display line-
- drawing characters except by using UTF-8 (see the discus-
- sion of <STRONG>NCURSES_NO_UTF8_ACS</STRONG> in <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG>).
+ In certain cases, the terminal is unable to display line-drawing char-
+ acters except by using UTF-8 (see the discussion of <STRONG>NCURSES_NO_UTF8_ACS</STRONG>
+ in <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG>).
- The <STRONG>TABSIZE</STRONG> variable is implemented in some versions of
- curses, but is not part of X/Open curses.
+ The <STRONG>TABSIZE</STRONG> variable is implemented in some versions of curses, but is
+ not part of X/Open curses.
- If <EM>ch</EM> is a carriage return, the cursor is moved to the
- beginning of the current row of the window. This is true
- of other implementations, but is not documented.
+ If <EM>ch</EM> is a carriage return, the cursor is moved to the beginning of the
+ current row of the window. This is true of other implementations, but
+ is not documented.
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
- <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>, <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>, <STRONG><A HREF="curs_inch.3x.html">curs_inch(3x)</A></STRONG>,
- <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>,
- <STRONG>putc(3)</STRONG>.
+ <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>, <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>, <STRONG><A HREF="curs_inch.3x.html">curs_inch(3x)</A></STRONG>, <STRONG>curs_out-</STRONG>
+ <STRONG><A HREF="curs_outopts.3x.html">opts(3x)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>, <STRONG>putc(3)</STRONG>.
- Comparable functions in the wide-character (ncursesw)
- library are described in <STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG>.
+ Comparable functions in the wide-character (ncursesw) library are
+ described in <STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG>.
- <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>
+ <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>
</PRE>
<div class="nav">
<ul>
<BODY>
<H1 class="no-header">curs_addchstr 3x</H1>
<PRE>
-<STRONG><A HREF="curs_addchstr.3x.html">curs_addchstr(3x)</A></STRONG> <STRONG><A HREF="curs_addchstr.3x.html">curs_addchstr(3x)</A></STRONG>
+<STRONG><A HREF="curs_addchstr.3x.html">curs_addchstr(3x)</A></STRONG> <STRONG><A HREF="curs_addchstr.3x.html">curs_addchstr(3x)</A></STRONG>
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
- <STRONG>addchstr</STRONG>, <STRONG>addchnstr</STRONG>, <STRONG>waddchstr</STRONG>, <STRONG>waddchnstr</STRONG>, <STRONG>mvaddchstr</STRONG>,
- <STRONG>mvaddchnstr</STRONG>, <STRONG>mvwaddchstr</STRONG>, <STRONG>mvwaddchnstr</STRONG> - add a string of
- characters (and attributes) to a <STRONG>curses</STRONG> window
+ <STRONG>addchstr</STRONG>, <STRONG>addchnstr</STRONG>, <STRONG>waddchstr</STRONG>, <STRONG>waddchnstr</STRONG>, <STRONG>mvaddchstr</STRONG>, <STRONG>mvaddchnstr</STRONG>,
+ <STRONG>mvwaddchstr</STRONG>, <STRONG>mvwaddchnstr</STRONG> - add a string of characters (and attributes)
+ to a <STRONG>curses</STRONG> window
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
- These functions copy the (null-terminated) <EM>chstr</EM> array in-
- to the window image structure starting at the current cur-
- sor position. The four functions with <EM>n</EM> as the last argu-
- ment copy at most <EM>n</EM> elements, but no more than will fit on
- the line. If <STRONG>n</STRONG>=<STRONG>-1</STRONG> then the whole array is copied, to the
- maximum number of characters that will fit on the line.
+ These functions copy the (null-terminated) <EM>chstr</EM> array into the window
+ image structure starting at the current cursor position. The four
+ functions with <EM>n</EM> as the last argument copy at most <EM>n</EM> elements, but no
+ more than will fit on the line. If <STRONG>n</STRONG>=<STRONG>-1</STRONG> then the whole array is
+ copied, to the maximum number of characters that will fit on the line.
- The window cursor is <EM>not</EM> advanced. These functions work
- faster than <STRONG>waddnstr</STRONG>. On the other hand:
+ The window cursor is <EM>not</EM> advanced. These functions work faster than
+ <STRONG>waddnstr</STRONG>. On the other hand:
- <STRONG>o</STRONG> they do not perform checking (such as for the newline,
- backspace, or carriage return characters),
+ <STRONG>o</STRONG> they do not perform checking (such as for the newline, backspace,
+ or carriage return characters),
<STRONG>o</STRONG> they do not advance the current cursor position,
- <STRONG>o</STRONG> they do not expand other control characters to ^-es-
- capes, and
+ <STRONG>o</STRONG> they do not expand other control characters to ^-escapes, and
- <STRONG>o</STRONG> they truncate the string if it crosses the right mar-
- gin, rather than wrapping it around to the new line.
+ <STRONG>o</STRONG> they truncate the string if it crosses the right margin, rather
+ than wrapping it around to the new line.
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
- All functions return the integer <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG>
- on success.
+ All functions return the integer <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> on success.
- X/Open does not define any error conditions. This imple-
- mentation returns an error if the window pointer is null.
+ X/Open does not define any error conditions. This implementation re-
+ turns an error if the window pointer is null.
- Functions with a "mv" prefix first perform a cursor move-
- ment using <STRONG>wmove</STRONG>, and return an error if the position is
- outside the window, or if the window pointer is null.
+ Functions with a "mv" prefix first perform a cursor movement using
+ <STRONG>wmove</STRONG>, and return an error if the position is outside the window, or if
+ the window pointer is null.
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
- These entry points are described in the XSI Curses stan-
- dard, Issue 4.
+ These entry points are described in the XSI Curses standard, Issue 4.
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="curs_addstr.3x.html">curs_addstr(3x)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>.
- Comparable functions in the wide-character (ncursesw) li-
- brary are described in <STRONG><A HREF="curs_add_wchstr.3x.html">curs_add_wchstr(3x)</A></STRONG>.
+ Comparable functions in the wide-character (ncursesw) library are de-
+ scribed in <STRONG><A HREF="curs_add_wchstr.3x.html">curs_add_wchstr(3x)</A></STRONG>.
- <STRONG><A HREF="curs_addchstr.3x.html">curs_addchstr(3x)</A></STRONG>
+ <STRONG><A HREF="curs_addchstr.3x.html">curs_addchstr(3x)</A></STRONG>
</PRE>
<div class="nav">
<ul>
<BODY>
<H1 class="no-header">curs_addstr 3x</H1>
<PRE>
-<STRONG><A HREF="curs_addstr.3x.html">curs_addstr(3x)</A></STRONG> <STRONG><A HREF="curs_addstr.3x.html">curs_addstr(3x)</A></STRONG>
+<STRONG><A HREF="curs_addstr.3x.html">curs_addstr(3x)</A></STRONG> <STRONG><A HREF="curs_addstr.3x.html">curs_addstr(3x)</A></STRONG>
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
- <STRONG>addstr</STRONG>, <STRONG>addnstr</STRONG>, <STRONG>waddstr</STRONG>, <STRONG>waddnstr</STRONG>, <STRONG>mvaddstr</STRONG>, <STRONG>mvaddnstr</STRONG>,
- <STRONG>mvwaddstr</STRONG>, <STRONG>mvwaddnstr</STRONG> - add a string of characters to a
- <STRONG>curses</STRONG> window and advance cursor
+ <STRONG>addstr</STRONG>, <STRONG>addnstr</STRONG>, <STRONG>waddstr</STRONG>, <STRONG>waddnstr</STRONG>, <STRONG>mvaddstr</STRONG>, <STRONG>mvaddnstr</STRONG>, <STRONG>mvwaddstr</STRONG>,
+ <STRONG>mvwaddnstr</STRONG> - add a string of characters to a <STRONG>curses</STRONG> window and advance
+ cursor
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
- These functions write the (null-terminated) character
- string <EM>str</EM> on the given window. It is similar to calling
- <STRONG>waddch</STRONG> once for each character in the string.
+ These functions write the (null-terminated) character string <EM>str</EM> on the
+ given window. It is similar to calling <STRONG>waddch</STRONG> once for each character
+ in the string.
- The <EM>mv</EM> functions perform cursor movement once, before
- writing any characters. Thereafter, the cursor is ad-
- vanced as a side-effect of writing to the window.
+ The <EM>mv</EM> functions perform cursor movement once, before writing any char-
+ acters. Thereafter, the cursor is advanced as a side-effect of writing
+ to the window.
- The four functions with <EM>n</EM> as the last argument write at
- most <EM>n</EM> characters, or until a terminating null is reached.
- If <EM>n</EM> is -1, then the entire string will be added.
+ The four functions with <EM>n</EM> as the last argument write at most <EM>n</EM> charac-
+ ters, or until a terminating null is reached. If <EM>n</EM> is -1, then the en-
+ tire string will be added.
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
- All functions return the integer <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG>
- on success.
+ All functions return the integer <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> on success.
- X/Open does not define any error conditions. This imple-
- mentation returns an error
+ X/Open does not define any error conditions. This implementation re-
+ turns an error
<STRONG>o</STRONG> if the window pointer is null or
<STRONG>o</STRONG> if the corresponding calls to <STRONG>waddch</STRONG> return an error.
- Functions with a "mv" prefix first perform a cursor move-
- ment using <STRONG>wmove</STRONG>, and return an error if the position is
- outside the window, or if the window pointer is null.
+ Functions with a "mv" prefix first perform a cursor movement using
+ <STRONG>wmove</STRONG>, and return an error if the position is outside the window, or if
+ the window pointer is null.
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
- These functions are described in the XSI Curses standard,
- Issue 4.
+ These functions are described in the XSI Curses standard, Issue 4.
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
- <STRONG><A HREF="curs_addstr.3x.html">curs_addstr(3x)</A></STRONG>
+ <STRONG><A HREF="curs_addstr.3x.html">curs_addstr(3x)</A></STRONG>
</PRE>
<div class="nav">
<ul>
<BODY>
<H1 class="no-header">curs_addwstr 3x</H1>
<PRE>
-<STRONG><A HREF="curs_addwstr.3x.html">curs_addwstr(3x)</A></STRONG> <STRONG><A HREF="curs_addwstr.3x.html">curs_addwstr(3x)</A></STRONG>
+<STRONG><A HREF="curs_addwstr.3x.html">curs_addwstr(3x)</A></STRONG> <STRONG><A HREF="curs_addwstr.3x.html">curs_addwstr(3x)</A></STRONG>
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
- <STRONG>addwstr</STRONG>, <STRONG>addnwstr</STRONG>, <STRONG>waddwstr</STRONG>, <STRONG>waddnwstr</STRONG>, <STRONG>mvaddwstr</STRONG>,
- <STRONG>mvaddnwstr</STRONG>, <STRONG>mvwaddwstr</STRONG>, <STRONG>mvwaddnwstr</STRONG> - add a string of wide
- characters to a <STRONG>curses</STRONG> window and advance cursor
+ <STRONG>addwstr</STRONG>, <STRONG>addnwstr</STRONG>, <STRONG>waddwstr</STRONG>, <STRONG>waddnwstr</STRONG>, <STRONG>mvaddwstr</STRONG>, <STRONG>mvaddnwstr</STRONG>,
+ <STRONG>mvwaddwstr</STRONG>, <STRONG>mvwaddnwstr</STRONG> - add a string of wide characters to a <STRONG>curses</STRONG>
+ window and advance cursor
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
- These functions write the characters of the (null-termi-
- nated) <STRONG>wchar_t</STRONG> character string <EM>wstr</EM> on the given window.
- It is similar to constructing a <STRONG>cchar_t</STRONG> for each wchar_t
- in the string, then calling <STRONG>wadd_wch</STRONG> for the resulting
- <STRONG>cchar_t</STRONG>.
+ These functions write the characters of the (null-terminated) <STRONG>wchar_t</STRONG>
+ character string <EM>wstr</EM> on the given window. It is similar to construct-
+ ing a <STRONG>cchar_t</STRONG> for each wchar_t in the string, then calling <STRONG>wadd_wch</STRONG> for
+ the resulting <STRONG>cchar_t</STRONG>.
- The <EM>mv</EM> functions perform cursor movement once, before
- writing any characters. Thereafter, the cursor is ad-
- vanced as a side-effect of writing to the window.
+ The <EM>mv</EM> functions perform cursor movement once, before writing any char-
+ acters. Thereafter, the cursor is advanced as a side-effect of writing
+ to the window.
- The four functions with <EM>n</EM> as the last argument write at
- most <EM>n</EM> <STRONG>wchar_t</STRONG> characters, or until a terminating null is
- reached. If <EM>n</EM> is -1, then the entire string will be
- added.
+ The four functions with <EM>n</EM> as the last argument write at most <EM>n</EM> <STRONG>wchar_t</STRONG>
+ characters, or until a terminating null is reached. If <EM>n</EM> is -1, then
+ the entire string will be added.
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
- All functions return the integer <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG>
- on success.
+ All functions return the integer <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> on success.
- X/Open does not define any error conditions. This imple-
- mentation returns an error
+ X/Open does not define any error conditions. This implementation re-
+ turns an error
<STRONG>o</STRONG> if the window pointer is null or
<STRONG>o</STRONG> if the string pointer is null or
- <STRONG>o</STRONG> if the corresponding calls to <STRONG>wadd_wch</STRONG> return an er-
- ror.
+ <STRONG>o</STRONG> if the corresponding calls to <STRONG>wadd_wch</STRONG> return an error.
- Functions with a "mv" prefix first perform a cursor move-
- ment using <STRONG>wmove</STRONG>, and return an error if the position is
- outside the window, or if the window pointer is null.
+ Functions with a "mv" prefix first perform a cursor movement using
+ <STRONG>wmove</STRONG>, and return an error if the position is outside the window, or if
+ the window pointer is null.
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
- These functions are described in the XSI Curses standard,
- Issue 4.
+ These functions are described in the XSI Curses standard, Issue 4.
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
- <STRONG><A HREF="curs_addwstr.3x.html">curs_addwstr(3x)</A></STRONG>
+ <STRONG><A HREF="curs_addwstr.3x.html">curs_addwstr(3x)</A></STRONG>
</PRE>
<div class="nav">
<ul>
<BODY>
<H1 class="no-header">curs_attr 3x</H1>
<PRE>
-<STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG> <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>
+<STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG> <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
- <STRONG>attr_get</STRONG>, <STRONG>wattr_get</STRONG>, <STRONG>attr_set</STRONG>, <STRONG>wattr_set</STRONG>, <STRONG>attr_off</STRONG>,
- <STRONG>wattr_off</STRONG>, <STRONG>attr_on</STRONG>, <STRONG>wattr_on</STRONG>, <STRONG>attroff</STRONG>, <STRONG>wattroff</STRONG>, <STRONG>attron</STRONG>,
- <STRONG>wattron</STRONG>, <STRONG>attrset</STRONG>, <STRONG>wattrset</STRONG>, <STRONG>chgat</STRONG>, <STRONG>wchgat</STRONG>, <STRONG>mvchgat</STRONG>,
- <STRONG>mvwchgat</STRONG>, <STRONG>color_set</STRONG>, <STRONG>wcolor_set</STRONG>, <STRONG>standend</STRONG>, <STRONG>wstandend</STRONG>,
- <STRONG>standout</STRONG>, <STRONG>wstandout</STRONG> - <STRONG>curses</STRONG> character and window
- attribute control routines
+ <STRONG>attr_get</STRONG>, <STRONG>wattr_get</STRONG>, <STRONG>attr_set</STRONG>, <STRONG>wattr_set</STRONG>, <STRONG>attr_off</STRONG>, <STRONG>wattr_off</STRONG>, <STRONG>attr_on</STRONG>,
+ <STRONG>wattr_on</STRONG>, <STRONG>attroff</STRONG>, <STRONG>wattroff</STRONG>, <STRONG>attron</STRONG>, <STRONG>wattron</STRONG>, <STRONG>attrset</STRONG>, <STRONG>wattrset</STRONG>, <STRONG>chgat</STRONG>,
+ <STRONG>wchgat</STRONG>, <STRONG>mvchgat</STRONG>, <STRONG>mvwchgat</STRONG>, <STRONG>color_set</STRONG>, <STRONG>wcolor_set</STRONG>, <STRONG>standend</STRONG>, <STRONG>wstandend</STRONG>,
+ <STRONG>standout</STRONG>, <STRONG>wstandout</STRONG> - <STRONG>curses</STRONG> character and window attribute control
+ routines
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
<STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
<STRONG>int</STRONG> <STRONG>attr_get(attr_t</STRONG> <STRONG>*</STRONG><EM>attrs</EM><STRONG>,</STRONG> <STRONG>short</STRONG> <STRONG>*</STRONG><EM>pair</EM><STRONG>,</STRONG> <STRONG>void</STRONG> <STRONG>*</STRONG><EM>opts</EM><STRONG>);</STRONG>
- <STRONG>int</STRONG> <STRONG>wattr_get(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>attr_t</STRONG> <STRONG>*</STRONG><EM>attrs</EM><STRONG>,</STRONG> <STRONG>short</STRONG> <STRONG>*</STRONG><EM>pair</EM><STRONG>,</STRONG>
- <STRONG>void</STRONG> <STRONG>*</STRONG><EM>opts</EM><STRONG>);</STRONG>
+ <STRONG>int</STRONG> <STRONG>wattr_get(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>attr_t</STRONG> <STRONG>*</STRONG><EM>attrs</EM><STRONG>,</STRONG> <STRONG>short</STRONG> <STRONG>*</STRONG><EM>pair</EM><STRONG>,</STRONG> <STRONG>void</STRONG> <STRONG>*</STRONG><EM>opts</EM><STRONG>);</STRONG>
<STRONG>int</STRONG> <STRONG>attr_set(attr_t</STRONG> <EM>attrs</EM><STRONG>,</STRONG> <STRONG>short</STRONG> <EM>pair</EM><STRONG>,</STRONG> <STRONG>void</STRONG> <STRONG>*</STRONG><EM>opts</EM><STRONG>);</STRONG>
- <STRONG>int</STRONG> <STRONG>wattr_set(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>attr_t</STRONG> <EM>attrs</EM><STRONG>,</STRONG> <STRONG>short</STRONG> <EM>pair</EM><STRONG>,</STRONG> <STRONG>void</STRONG>
- <STRONG>*</STRONG><EM>opts</EM><STRONG>);</STRONG>
+ <STRONG>int</STRONG> <STRONG>wattr_set(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>attr_t</STRONG> <EM>attrs</EM><STRONG>,</STRONG> <STRONG>short</STRONG> <EM>pair</EM><STRONG>,</STRONG> <STRONG>void</STRONG> <STRONG>*</STRONG><EM>opts</EM><STRONG>);</STRONG>
<STRONG>int</STRONG> <STRONG>attr_off(attr_t</STRONG> <EM>attrs</EM><STRONG>,</STRONG> <STRONG>void</STRONG> <STRONG>*</STRONG><EM>opts</EM><STRONG>);</STRONG>
<STRONG>int</STRONG> <STRONG>wattr_off(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>attr_t</STRONG> <EM>attrs</EM><STRONG>,</STRONG> <STRONG>void</STRONG> <STRONG>*</STRONG><EM>opts</EM><STRONG>);</STRONG>
<STRONG>int</STRONG> <STRONG>attrset(int</STRONG> <EM>attrs</EM><STRONG>);</STRONG>
<STRONG>int</STRONG> <STRONG>wattrset(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>attrs</EM><STRONG>);</STRONG>
- <STRONG>int</STRONG> <STRONG>chgat(int</STRONG> <EM>n</EM><STRONG>,</STRONG> <STRONG>attr_t</STRONG> <EM>attr</EM><STRONG>,</STRONG> <STRONG>short</STRONG> <EM>pair</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>void</STRONG>
- <STRONG>*</STRONG><EM>opts</EM><STRONG>);</STRONG>
+ <STRONG>int</STRONG> <STRONG>chgat(int</STRONG> <EM>n</EM><STRONG>,</STRONG> <STRONG>attr_t</STRONG> <EM>attr</EM><STRONG>,</STRONG> <STRONG>short</STRONG> <EM>pair</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>void</STRONG> <STRONG>*</STRONG><EM>opts</EM><STRONG>);</STRONG>
<STRONG>int</STRONG> <STRONG>wchgat(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG>
<STRONG>int</STRONG> <EM>n</EM><STRONG>,</STRONG> <STRONG>attr_t</STRONG> <EM>attr</EM><STRONG>,</STRONG> <STRONG>short</STRONG> <EM>pair</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>void</STRONG> <STRONG>*</STRONG><EM>opts</EM><STRONG>);</STRONG>
<STRONG>int</STRONG> <STRONG>mvchgat(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG>
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
- These routines manipulate the current attributes of the
- named window, which then apply to all characters that are
- written into the window with <STRONG>waddch</STRONG>, <STRONG>waddstr</STRONG> and <STRONG>wprintw</STRONG>.
- Attributes are a property of the character, and move with
- the character through any scrolling and insert/delete
- line/character operations. To the extent possible, they
- are displayed as appropriate modifications to the graphic
- rendition of characters put on the screen.
+ These routines manipulate the current attributes of the named window,
+ which then apply to all characters that are written into the window
+ with <STRONG>waddch</STRONG>, <STRONG>waddstr</STRONG> and <STRONG>wprintw</STRONG>. Attributes are a property of the
+ character, and move with the character through any scrolling and in-
+ sert/delete line/character operations. To the extent possible, they
+ are displayed as appropriate modifications to the graphic rendition of
+ characters put on the screen.
- These routines do not affect the attributes used when
- erasing portions of the window. See <STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG> for
- functions which modify the attributes used for erasing and
- clearing.
+ These routines do not affect the attributes used when erasing portions
+ of the window. See <STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG> for functions which modify the at-
+ tributes used for erasing and clearing.
- Routines which do not have a <STRONG>WINDOW*</STRONG> parameter apply to
- <STRONG>stdscr</STRONG>. For example, <STRONG>attr_set</STRONG> is the <STRONG>stdscr</STRONG> variant of
- <STRONG>wattr_set</STRONG>.
+ Routines which do not have a <STRONG>WINDOW*</STRONG> parameter apply to <STRONG>stdscr</STRONG>. For
+ example, <STRONG>attr_set</STRONG> is the <STRONG>stdscr</STRONG> variant of <STRONG>wattr_set</STRONG>.
</PRE><H3><a name="h3-Window-attributes">Window attributes</a></H3><PRE>
There are two sets of functions:
- <STRONG>o</STRONG> functions for manipulating the window attributes and
- color: <STRONG>wattr_set</STRONG> and <STRONG>wattr_get</STRONG>.
+ <STRONG>o</STRONG> functions for manipulating the window attributes and color: <STRONG>wat-</STRONG>
+ <STRONG>tr_set</STRONG> and <STRONG>wattr_get</STRONG>.
- <STRONG>o</STRONG> functions for manipulating only the window attributes
- (not color): <STRONG>wattr_on</STRONG> and <STRONG>wattr_off</STRONG>.
+ <STRONG>o</STRONG> functions for manipulating only the window attributes (not color):
+ <STRONG>wattr_on</STRONG> and <STRONG>wattr_off</STRONG>.
- The <STRONG>wattr_set</STRONG> function sets the current attributes of the
- given window to <EM>attrs</EM>, with color specified by <EM>pair</EM>.
+ The <STRONG>wattr_set</STRONG> function sets the current attributes of the given window
+ to <EM>attrs</EM>, with color specified by <EM>pair</EM>.
Use <STRONG>wattr_get</STRONG> to retrieve attributes for the given window.
- Use <STRONG>attr_on</STRONG> and <STRONG>wattr_on</STRONG> to turn on window attributes,
- i.e., values OR'd together in <EM>attr</EM>, without affecting oth-
- er attributes. Use <STRONG>attr_off</STRONG> and <STRONG>wattr_off</STRONG> to turn off
- window attributes, again values OR'd together in <EM>attr</EM>,
- without affecting other attributes.
+ Use <STRONG>attr_on</STRONG> and <STRONG>wattr_on</STRONG> to turn on window attributes, i.e., values
+ OR'd together in <EM>attr</EM>, without affecting other attributes. Use <STRONG>at-</STRONG>
+ <STRONG>tr_off</STRONG> and <STRONG>wattr_off</STRONG> to turn off window attributes, again values OR'd
+ together in <EM>attr</EM>, without affecting other attributes.
</PRE><H3><a name="h3-Legacy-window-attributes">Legacy window attributes</a></H3><PRE>
- Most of the window attribute routines are extensions of
- older routines which assume that color pairs are OR'd into
- the attribute parameter. These older routines use the
- same name, omitting an underscore (<STRONG>_</STRONG>).
+ Most of the window attribute routines are extensions of older routines
+ which assume that color pairs are OR'd into the attribute parameter.
+ These older routines use the same name, omitting an underscore (<STRONG>_</STRONG>).
- The <STRONG>attrset</STRONG> routine is a legacy feature predating SVr4
- curses but kept in X/Open Curses for the same reason that
- SVr4 curses kept it: compatibility.
+ The <STRONG>attrset</STRONG> routine is a legacy feature predating SVr4 curses but kept
+ in X/Open Curses for the same reason that SVr4 curses kept it: compati-
+ bility.
- The remaining <STRONG>attr</STRONG>* functions operate exactly like the
- corresponding <STRONG>attr_</STRONG>* functions, except that they take ar-
- guments of type <STRONG>int</STRONG> rather than <STRONG>attr_t</STRONG>.
+ The remaining <STRONG>attr</STRONG>* functions operate exactly like the corresponding
+ <STRONG>attr_</STRONG>* functions, except that they take arguments of type <STRONG>int</STRONG> rather
+ than <STRONG>attr_t</STRONG>.
- There is no corresponding <STRONG>attrget</STRONG> function as such in
- X/Open Curses, although ncurses provides <STRONG>getattrs</STRONG> (see
- <STRONG><A HREF="curs_legacy.3x.html">curs_legacy(3x)</A></STRONG>).
+ There is no corresponding <STRONG>attrget</STRONG> function as such in X/Open Curses,
+ although ncurses provides <STRONG>getattrs</STRONG> (see <STRONG><A HREF="curs_legacy.3x.html">curs_legacy(3x)</A></STRONG>).
</PRE><H3><a name="h3-Change-character-rendition">Change character rendition</a></H3><PRE>
- The routine <STRONG>chgat</STRONG> changes the attributes of a given number
- of characters starting at the current cursor location of
- <STRONG>stdscr</STRONG>. It does not update the cursor and does not per-
- form wrapping. A character count of -1 or greater than
- the remaining window width means to change attributes all
- the way to the end of the current line. The <STRONG>wchgat</STRONG> func-
- tion generalizes this to any window; the <STRONG>mvwchgat</STRONG> function
- does a cursor move before acting.
+ The routine <STRONG>chgat</STRONG> changes the attributes of a given number of charac-
+ ters starting at the current cursor location of <STRONG>stdscr</STRONG>. It does not
+ update the cursor and does not perform wrapping. A character count of
+ -1 or greater than the remaining window width means to change at-
+ tributes all the way to the end of the current line. The <STRONG>wchgat</STRONG> func-
+ tion generalizes this to any window; the <STRONG>mvwchgat</STRONG> function does a cur-
+ sor move before acting.
- In these functions, the color <EM>pair</EM> argument is a color-
- pair index (as in the first argument of <STRONG>init_pair</STRONG>, see
- <STRONG><A HREF="curs_color.3x.html">curs_color(3x)</A></STRONG>).
+ In these functions, the color <EM>pair</EM> argument is a color-pair index (as
+ in the first argument of <STRONG>init_pair</STRONG>, see <STRONG><A HREF="curs_color.3x.html">curs_color(3x)</A></STRONG>).
</PRE><H3><a name="h3-Change-window-color">Change window color</a></H3><PRE>
- The routine <STRONG>color_set</STRONG> sets the current color of the given
- window to the foreground/background combination described
- by the color <EM>pair</EM> parameter.
+ The routine <STRONG>color_set</STRONG> sets the current color of the given window to the
+ foreground/background combination described by the color <EM>pair</EM> parame-
+ ter.
</PRE><H3><a name="h3-Standout">Standout</a></H3><PRE>
- The routine <STRONG>standout</STRONG> is the same as <STRONG>attron(A_STANDOUT)</STRONG>.
- The routine <STRONG>standend</STRONG> is the same as <STRONG>attrset(A_NORMAL)</STRONG> or
- <STRONG>attrset(0)</STRONG>, that is, it turns off all attributes.
+ The routine <STRONG>standout</STRONG> is the same as <STRONG>attron(A_STANDOUT)</STRONG>. The routine
+ <STRONG>standend</STRONG> is the same as <STRONG>attrset(A_NORMAL)</STRONG> or <STRONG>attrset(0)</STRONG>, that is, it
+ turns off all attributes.
X/Open does not mark these "restricted", because
<STRONG>o</STRONG> they have well established legacy use, and
- <STRONG>o</STRONG> there is no ambiguity about the way the attributes
- might be combined with a color pair.
+ <STRONG>o</STRONG> there is no ambiguity about the way the attributes might be com-
+ bined with a color pair.
</PRE><H2><a name="h2-VIDEO-ATTRIBUTES">VIDEO ATTRIBUTES</a></H2><PRE>
- The following video attributes, defined in <STRONG><curses.h></STRONG>, can
- be passed to the routines <STRONG>attron</STRONG>, <STRONG>attroff</STRONG>, and <STRONG>attrset</STRONG>, or
- OR'd with the characters passed to <STRONG>addch</STRONG> (see <STRONG>curs_add-</STRONG>
- <STRONG><A HREF="curs_addch.3x.html">ch(3x)</A></STRONG>).
+ The following video attributes, defined in <STRONG><curses.h></STRONG>, can be passed to
+ the routines <STRONG>attron</STRONG>, <STRONG>attroff</STRONG>, and <STRONG>attrset</STRONG>, or OR'd with the characters
+ passed to <STRONG>addch</STRONG> (see <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>).
<EM>Name</EM> <EM>Description</EM>
-----------------------------------------------------------
<STRONG>A_ITALIC</STRONG> Italics (non-X/Open extension)
<STRONG>A_CHARTEXT</STRONG> Bit-mask to extract a character
- These video attributes are supported by <STRONG>attr_on</STRONG> and relat-
- ed functions (which also support the attributes recognized
- by <STRONG>attron</STRONG>, etc.):
+ These video attributes are supported by <STRONG>attr_on</STRONG> and related functions
+ (which also support the attributes recognized by <STRONG>attron</STRONG>, etc.):
<EM>Name</EM> <EM>Description</EM>
-----------------------------------------
<STRONG>WA_TOP</STRONG> Top highlight
<STRONG>WA_VERTICAL</STRONG> Vertical highlight
- The return values of many of these routines are not mean-
- ingful (they are implemented as macro-expanded assignments
- and simply return their argument). The SVr4 manual page
- claims (falsely) that these routines always return <STRONG>1</STRONG>.
+ The return values of many of these routines are not meaningful (they
+ are implemented as macro-expanded assignments and simply return their
+ argument). The SVr4 manual page claims (falsely) that these routines
+ always return <STRONG>1</STRONG>.
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
These functions may be macros:
- <STRONG>attroff</STRONG>, <STRONG>wattroff</STRONG>, <STRONG>attron</STRONG>, <STRONG>wattron</STRONG>, <STRONG>attrset</STRONG>, <STRONG>wat-</STRONG>
- <STRONG>trset</STRONG>, <STRONG>standend</STRONG> and <STRONG>standout</STRONG>.
+ <STRONG>attroff</STRONG>, <STRONG>wattroff</STRONG>, <STRONG>attron</STRONG>, <STRONG>wattron</STRONG>, <STRONG>attrset</STRONG>, <STRONG>wattrset</STRONG>, <STRONG>standend</STRONG>
+ and <STRONG>standout</STRONG>.
- Color pair values can only be OR'd with attributes if the
- pair number is less than 256. The alternate functions
- such as <STRONG>color_set</STRONG> can pass a color pair value directly.
- However, ncurses ABI 4 and 5 simply OR this value within
- the alternate functions. You must use ncurses ABI 6 to
+ Color pair values can only be OR'd with attributes if the pair number
+ is less than 256. The alternate functions such as <STRONG>color_set</STRONG> can pass a
+ color pair value directly. However, ncurses ABI 4 and 5 simply OR this
+ value within the alternate functions. You must use ncurses ABI 6 to
support more than 256 color pairs.
</PRE><H2><a name="h2-EXTENSIONS">EXTENSIONS</a></H2><PRE>
- This implementation provides the <STRONG>A_ITALIC</STRONG> attribute for
- terminals which have the <STRONG>enter_italics_mode</STRONG> (<STRONG>sitm</STRONG>) and <STRONG>ex-</STRONG>
- <STRONG>it_italics_mode</STRONG> (<STRONG>ritm</STRONG>) capabilities. Italics are not men-
- tioned in X/Open Curses. Unlike the other video at-
- tributes, <STRONG>A_ITALIC</STRONG> is unrelated to the <STRONG>set_attributes</STRONG> ca-
- pabilities. This implementation makes the assumption that
- <STRONG>exit_attribute_mode</STRONG> may also reset italics.
-
- Each of the functions added by XSI Curses has a parameter
- <EM>opts</EM>, which X/Open Curses still (after more than twenty
- years) documents as reserved for future use, saying that
- it should be <STRONG>NULL</STRONG>. This implementation uses that parame-
- ter in ABI 6 for the functions which have a color-pair pa-
- rameter to support <EM>extended</EM> <EM>color</EM> <EM>pairs</EM>:
-
- <STRONG>o</STRONG> For functions which modify the color, e.g., <STRONG>wattr_set</STRONG>,
- if <EM>opts</EM> is set it is treated as a pointer to <STRONG>int</STRONG>, and
- used to set the color pair instead of the <STRONG>short</STRONG> <EM>pair</EM>
- parameter.
-
- <STRONG>o</STRONG> For functions which retrieve the color, e.g., <STRONG>wat-</STRONG>
- <STRONG>tr_get</STRONG>, if <EM>opts</EM> is set it is treated as a pointer to
- <STRONG>int</STRONG>, and used to retrieve the color pair as an <STRONG>int</STRONG>
- value, in addition retrieving it via the standard
- pointer to <STRONG>short</STRONG> parameter.
-
- The remaining functions which have <EM>opts</EM>, but do not manip-
- ulate color, e.g., <STRONG>wattr_on</STRONG> and <STRONG>wattr_off</STRONG> are not used by
- this implementation except to check that they are <STRONG>NULL</STRONG>.
+ This implementation provides the <STRONG>A_ITALIC</STRONG> attribute for terminals which
+ have the <STRONG>enter_italics_mode</STRONG> (<STRONG>sitm</STRONG>) and <STRONG>exit_italics_mode</STRONG> (<STRONG>ritm</STRONG>) capa-
+ bilities. Italics are not mentioned in X/Open Curses. Unlike the oth-
+ er video attributes, <STRONG>A_ITALIC</STRONG> is unrelated to the <STRONG>set_attributes</STRONG> capa-
+ bilities. This implementation makes the assumption that <STRONG>exit_at-</STRONG>
+ <STRONG>tribute_mode</STRONG> may also reset italics.
+
+ Each of the functions added by XSI Curses has a parameter <EM>opts</EM>, which
+ X/Open Curses still (after more than twenty years) documents as re-
+ served for future use, saying that it should be <STRONG>NULL</STRONG>. This implementa-
+ tion uses that parameter in ABI 6 for the functions which have a color-
+ pair parameter to support <EM>extended</EM> <EM>color</EM> <EM>pairs</EM>:
+
+ <STRONG>o</STRONG> For functions which modify the color, e.g., <STRONG>wattr_set</STRONG>, if <EM>opts</EM> is
+ set it is treated as a pointer to <STRONG>int</STRONG>, and used to set the color
+ pair instead of the <STRONG>short</STRONG> <EM>pair</EM> parameter.
+
+ <STRONG>o</STRONG> For functions which retrieve the color, e.g., <STRONG>wattr_get</STRONG>, if <EM>opts</EM> is
+ set it is treated as a pointer to <STRONG>int</STRONG>, and used to retrieve the
+ color pair as an <STRONG>int</STRONG> value, in addition retrieving it via the stan-
+ dard pointer to <STRONG>short</STRONG> parameter.
+
+ The remaining functions which have <EM>opts</EM>, but do not manipulate color,
+ e.g., <STRONG>wattr_on</STRONG> and <STRONG>wattr_off</STRONG> are not used by this implementation except
+ to check that they are <STRONG>NULL</STRONG>.
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
- These functions are supported in the XSI Curses standard,
- Issue 4. The standard defined the dedicated type for
- highlights, <STRONG>attr_t</STRONG>, which was not defined in SVr4 curses.
- The functions taking <STRONG>attr_t</STRONG> arguments were not supported
- under SVr4.
-
- Very old versions of this library did not force an update
- of the screen when changing the attributes. Use <STRONG>touchwin</STRONG>
- to force the screen to match the updated attributes.
-
- The XSI Curses standard states that whether the tradition-
- al functions <STRONG>attron</STRONG>/<STRONG>attroff</STRONG>/<STRONG>attrset</STRONG> can manipulate at-
- tributes other than <STRONG>A_BLINK</STRONG>, <STRONG>A_BOLD</STRONG>, <STRONG>A_DIM</STRONG>, <STRONG>A_REVERSE</STRONG>,
- <STRONG>A_STANDOUT</STRONG>, or <STRONG>A_UNDERLINE</STRONG> is "unspecified". Under this
- implementation as well as SVr4 curses, these functions
- correctly manipulate all other highlights (specifically,
- <STRONG>A_ALTCHARSET</STRONG>, <STRONG>A_PROTECT</STRONG>, and <STRONG>A_INVIS</STRONG>).
+ These functions are supported in the XSI Curses standard, Issue 4. The
+ standard defined the dedicated type for highlights, <STRONG>attr_t</STRONG>, which was
+ not defined in SVr4 curses. The functions taking <STRONG>attr_t</STRONG> arguments were
+ not supported under SVr4.
+
+ Very old versions of this library did not force an update of the screen
+ when changing the attributes. Use <STRONG>touchwin</STRONG> to force the screen to
+ match the updated attributes.
+
+ The XSI Curses standard states that whether the traditional functions
+ <STRONG>attron</STRONG>/<STRONG>attroff</STRONG>/<STRONG>attrset</STRONG> can manipulate attributes other than <STRONG>A_BLINK</STRONG>,
+ <STRONG>A_BOLD</STRONG>, <STRONG>A_DIM</STRONG>, <STRONG>A_REVERSE</STRONG>, <STRONG>A_STANDOUT</STRONG>, or <STRONG>A_UNDERLINE</STRONG> is "unspecified".
+ Under this implementation as well as SVr4 curses, these functions cor-
+ rectly manipulate all other highlights (specifically, <STRONG>A_ALTCHARSET</STRONG>,
+ <STRONG>A_PROTECT</STRONG>, and <STRONG>A_INVIS</STRONG>).
XSI Curses added these entry points:
- <STRONG>attr_get</STRONG>, <STRONG>attr_on</STRONG>, <STRONG>attr_off</STRONG>, <STRONG>attr_set</STRONG>, <STRONG>wattr_on</STRONG>,
- <STRONG>wattr_off</STRONG>, <STRONG>wattr_get</STRONG>, <STRONG>wattr_set</STRONG>
+ <STRONG>attr_get</STRONG>, <STRONG>attr_on</STRONG>, <STRONG>attr_off</STRONG>, <STRONG>attr_set</STRONG>, <STRONG>wattr_on</STRONG>, <STRONG>wattr_off</STRONG>, <STRONG>wat-</STRONG>
+ <STRONG>tr_get</STRONG>, <STRONG>wattr_set</STRONG>
- The new functions are intended to work with a new series
- of highlight macros prefixed with <STRONG>WA_</STRONG>. The older macros
- have direct counterparts in the newer set of names:
+ The new functions are intended to work with a new series of highlight
+ macros prefixed with <STRONG>WA_</STRONG>. The older macros have direct counterparts in
+ the newer set of names:
<EM>Name</EM> <EM>Description</EM>
------------------------------------------------------------
<STRONG>WA_BOLD</STRONG> Extra bright or bold
<STRONG>WA_ALTCHARSET</STRONG> Alternate character set
- The XSI curses standard specifies that each pair of corre-
- sponding <STRONG>A_</STRONG> and <STRONG>WA_</STRONG>-using functions operates on the same
- current-highlight information.
+ The XSI curses standard specifies that each pair of corresponding <STRONG>A_</STRONG>
+ and <STRONG>WA_</STRONG>-using functions operates on the same current-highlight informa-
+ tion.
- The XSI standard extended conformance level adds new high-
- lights <STRONG>A_HORIZONTAL</STRONG>, <STRONG>A_LEFT</STRONG>, <STRONG>A_LOW</STRONG>, <STRONG>A_RIGHT</STRONG>, <STRONG>A_TOP</STRONG>, <STRONG>A_VER-</STRONG>
- <STRONG>TICAL</STRONG> (and corresponding <STRONG>WA_</STRONG> macros for each). As of Au-
- gust 2013, no known terminal provides these highlights
- (i.e., via the <STRONG>sgr1</STRONG> capability).
+ The XSI standard extended conformance level adds new highlights <STRONG>A_HORI-</STRONG>
+ <STRONG>ZONTAL</STRONG>, <STRONG>A_LEFT</STRONG>, <STRONG>A_LOW</STRONG>, <STRONG>A_RIGHT</STRONG>, <STRONG>A_TOP</STRONG>, <STRONG>A_VERTICAL</STRONG> (and corresponding
+ <STRONG>WA_</STRONG> macros for each). As of August 2013, no known terminal provides
+ these highlights (i.e., via the <STRONG>sgr1</STRONG> capability).
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
- All routines return the integer <STRONG>OK</STRONG> on success, or <STRONG>ERR</STRONG> on
- failure.
+ All routines return the integer <STRONG>OK</STRONG> on success, or <STRONG>ERR</STRONG> on failure.
X/Open does not define any error conditions.
<STRONG>o</STRONG> returns an error if the window pointer is null.
- <STRONG>o</STRONG> returns an error if the color pair parameter for <STRONG>wcol-</STRONG>
- <STRONG>or_set</STRONG> is outside the range 0..COLOR_PAIRS-1.
+ <STRONG>o</STRONG> returns an error if the color pair parameter for <STRONG>wcolor_set</STRONG> is out-
+ side the range 0..COLOR_PAIRS-1.
- <STRONG>o</STRONG> does not return an error if either of the parameters
- of <STRONG>wattr_get</STRONG> used for retrieving attribute or color-
- pair values is <STRONG>NULL</STRONG>.
+ <STRONG>o</STRONG> does not return an error if either of the parameters of <STRONG>wattr_get</STRONG>
+ used for retrieving attribute or color-pair values is <STRONG>NULL</STRONG>.
- Functions with a "mv" prefix first perform a cursor move-
- ment using <STRONG>wmove</STRONG>, and return an error if the position is
- outside the window, or if the window pointer is null.
+ Functions with a "mv" prefix first perform a cursor movement using
+ <STRONG>wmove</STRONG>, and return an error if the position is outside the window, or if
+ the window pointer is null.
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
- <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>, <STRONG><A HREF="curs_addstr.3x.html">curs_addstr(3x)</A></STRONG>,
- <STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG>, <STRONG><A HREF="curs_printw.3x.html">curs_printw(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>
+ <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>, <STRONG><A HREF="curs_addstr.3x.html">curs_addstr(3x)</A></STRONG>, <STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG>,
+ <STRONG><A HREF="curs_printw.3x.html">curs_printw(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>
- <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>
+ <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>
</PRE>
<div class="nav">
<ul>
<BODY>
<H1 class="no-header">curs_beep 3x</H1>
<PRE>
-<STRONG><A HREF="curs_beep.3x.html">curs_beep(3x)</A></STRONG> <STRONG><A HREF="curs_beep.3x.html">curs_beep(3x)</A></STRONG>
+<STRONG><A HREF="curs_beep.3x.html">curs_beep(3x)</A></STRONG> <STRONG><A HREF="curs_beep.3x.html">curs_beep(3x)</A></STRONG>
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
- The <STRONG>beep</STRONG> and <STRONG>flash</STRONG> routines are used to alert the terminal
- user. The routine <STRONG>beep</STRONG> sounds an audible alarm on the
- terminal, if possible; otherwise it flashes the screen
- (visible bell). The routine <STRONG>flash</STRONG> flashes the screen, and
- if that is not possible, sounds the alert. If neither
- alert is possible, nothing happens. Nearly all terminals
- have an audible alert (bell or beep), but only some can
- flash the screen.
+ The <STRONG>beep</STRONG> and <STRONG>flash</STRONG> routines are used to alert the terminal user. The
+ routine <STRONG>beep</STRONG> sounds an audible alarm on the terminal, if possible; oth-
+ erwise it flashes the screen (visible bell). The routine <STRONG>flash</STRONG> flashes
+ the screen, and if that is not possible, sounds the alert. If neither
+ alert is possible, nothing happens. Nearly all terminals have an audi-
+ ble alert (bell or beep), but only some can flash the screen.
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
- These routines return <STRONG>OK</STRONG> if they succeed in beeping or
- flashing, <STRONG>ERR</STRONG> otherwise.
+ These routines return <STRONG>OK</STRONG> if they succeed in beeping or flashing, <STRONG>ERR</STRONG>
+ otherwise.
</PRE><H2><a name="h2-EXTENSIONS">EXTENSIONS</a></H2><PRE>
- SVr4's beep and flash routines always returned <STRONG>OK</STRONG>, so it
- was not possible to tell when the beep or flash failed.
+ SVr4's beep and flash routines always returned <STRONG>OK</STRONG>, so it was not possi-
+ ble to tell when the beep or flash failed.
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
- These functions are described in the XSI Curses standard,
- Issue 4. Like SVr4, it specifies that they always return
- <STRONG>OK</STRONG>.
+ These functions are described in the XSI Curses standard, Issue 4.
+ Like SVr4, it specifies that they always return <STRONG>OK</STRONG>.
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
- <STRONG><A HREF="curs_beep.3x.html">curs_beep(3x)</A></STRONG>
+ <STRONG><A HREF="curs_beep.3x.html">curs_beep(3x)</A></STRONG>
</PRE>
<div class="nav">
<ul>
<BODY>
<H1 class="no-header">curs_bkgd 3x</H1>
<PRE>
-<STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG> <STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG>
+<STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG> <STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG>
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
- <STRONG>bkgdset</STRONG>, <STRONG>wbkgdset</STRONG>, <STRONG>bkgd</STRONG>, <STRONG>wbkgd</STRONG>, <STRONG>getbkgd</STRONG> - <STRONG>curses</STRONG> window
- background manipulation routines
+ <STRONG>bkgdset</STRONG>, <STRONG>wbkgdset</STRONG>, <STRONG>bkgd</STRONG>, <STRONG>wbkgd</STRONG>, <STRONG>getbkgd</STRONG> - <STRONG>curses</STRONG> window background
+ manipulation routines
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
</PRE><H3><a name="h3-bkgdset">bkgdset</a></H3><PRE>
- The <STRONG>bkgdset</STRONG> and <STRONG>wbkgdset</STRONG> routines manipulate the back-
- ground of the named window. The window background is a
- <STRONG>chtype</STRONG> consisting of any combination of attributes (i.e.,
- rendition) and a character. The attribute part of the
- background is combined (OR'ed) with all non-blank charac-
- ters that are written into the window with <STRONG>waddch</STRONG>. Both
- the character and attribute parts of the background are
- combined with the blank characters. The background
- becomes a property of the character and moves with the
- character through any scrolling and insert/delete
+ The <STRONG>bkgdset</STRONG> and <STRONG>wbkgdset</STRONG> routines manipulate the background of the
+ named window. The window background is a <STRONG>chtype</STRONG> consisting of any com-
+ bination of attributes (i.e., rendition) and a character. The
+ attribute part of the background is combined (OR'ed) with all non-blank
+ characters that are written into the window with <STRONG>waddch</STRONG>. Both the
+ character and attribute parts of the background are combined with the
+ blank characters. The background becomes a property of the character
+ and moves with the character through any scrolling and insert/delete
line/character operations.
- To the extent possible on a particular terminal, the
- attribute part of the background is displayed as the
- graphic rendition of the character put on the screen.
+ To the extent possible on a particular terminal, the attribute part of
+ the background is displayed as the graphic rendition of the character
+ put on the screen.
</PRE><H3><a name="h3-bkgd">bkgd</a></H3><PRE>
- The <STRONG>bkgd</STRONG> and <STRONG>wbkgd</STRONG> functions set the background property
- of the current or specified window and then apply this
- setting to every character position in that window:
+ The <STRONG>bkgd</STRONG> and <STRONG>wbkgd</STRONG> functions set the background property of the current
+ or specified window and then apply this setting to every character
+ position in that window:
- <STRONG>o</STRONG> The rendition of every character on the screen is
- changed to the new background rendition.
+ <STRONG>o</STRONG> The rendition of every character on the screen is changed to the
+ new background rendition.
- <STRONG>o</STRONG> Wherever the former background character appears, it
- is changed to the new background character.
+ <STRONG>o</STRONG> Wherever the former background character appears, it is changed to
+ the new background character.
</PRE><H3><a name="h3-getbkgd">getbkgd</a></H3><PRE>
- The <STRONG>getbkgd</STRONG> function returns the given window's current
- background character/attribute pair.
+ The <STRONG>getbkgd</STRONG> function returns the given window's current background
+ character/attribute pair.
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
- The routines <STRONG>bkgd</STRONG> and <STRONG>wbkgd</STRONG> return the integer <STRONG>OK</STRONG>. The
- SVr4.0 manual says "or a non-negative integer if <STRONG>immedok</STRONG>
- is set", but this appears to be an error.
+ The routines <STRONG>bkgd</STRONG> and <STRONG>wbkgd</STRONG> return the integer <STRONG>OK</STRONG>. The SVr4.0 manual
+ says "or a non-negative integer if <STRONG>immedok</STRONG> is set", but this appears to
+ be an error.
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
- These functions are described in the XSI Curses standard,
- Issue 4. It specifies that <STRONG>bkgd</STRONG> and <STRONG>wbkgd</STRONG> return <STRONG>ERR</STRONG> on
- failure, but gives no failure conditions.
+ These functions are described in the XSI Curses standard, Issue 4. It
+ specifies that <STRONG>bkgd</STRONG> and <STRONG>wbkgd</STRONG> return <STRONG>ERR</STRONG> on failure, but gives no fail-
+ ure conditions.
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
- <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>, <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>, <STRONG>curs_out-</STRONG>
- <STRONG><A HREF="curs_outopts.3x.html">opts(3x)</A></STRONG>
+ <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>, <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>, <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>
- <STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG>
+ <STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG>
</PRE>
<div class="nav">
<ul>
<BODY>
<H1 class="no-header">curs_bkgrnd 3x</H1>
<PRE>
-<STRONG><A HREF="curs_bkgrnd.3x.html">curs_bkgrnd(3x)</A></STRONG> <STRONG><A HREF="curs_bkgrnd.3x.html">curs_bkgrnd(3x)</A></STRONG>
+<STRONG><A HREF="curs_bkgrnd.3x.html">curs_bkgrnd(3x)</A></STRONG> <STRONG><A HREF="curs_bkgrnd.3x.html">curs_bkgrnd(3x)</A></STRONG>
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
- <STRONG>bkgrnd</STRONG>, <STRONG>wbkgrnd</STRONG>, <STRONG>bkgrndset</STRONG>, <STRONG>wbkgrndset</STRONG>, <STRONG>getbkgrnd</STRONG>, <STRONG>wget-</STRONG>
- <STRONG>bkgrnd</STRONG> - <STRONG>curses</STRONG> window complex background manipulation
- routines
+ <STRONG>bkgrnd</STRONG>, <STRONG>wbkgrnd</STRONG>, <STRONG>bkgrndset</STRONG>, <STRONG>wbkgrndset</STRONG>, <STRONG>getbkgrnd</STRONG>, <STRONG>wgetbkgrnd</STRONG> - <STRONG>curses</STRONG>
+ window complex background manipulation routines
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
</PRE><H3><a name="h3-bkgrndset">bkgrndset</a></H3><PRE>
- The <STRONG>bkgrndset</STRONG> and <STRONG>wbkgrndset</STRONG> routines manipulate the back-
- ground of the named window. The window background is a
- <STRONG>cchar_t</STRONG> consisting of any combination of attributes (i.e.,
- rendition) and a complex character. The attribute part of
- the background is combined (OR'ed) with all non-blank
- characters that are written into the window with <STRONG>waddch</STRONG>.
- Both the character and attribute parts of the background
- are combined with the blank characters. The background
- becomes a property of the character and moves with the
- character through any scrolling and insert/delete
- line/character operations.
-
- To the extent possible on a particular terminal, the
- attribute part of the background is displayed as the
- graphic rendition of the character put on the screen.
+ The <STRONG>bkgrndset</STRONG> and <STRONG>wbkgrndset</STRONG> routines manipulate the background of the
+ named window. The window background is a <STRONG>cchar_t</STRONG> consisting of any
+ combination of attributes (i.e., rendition) and a complex character.
+ The attribute part of the background is combined (OR'ed) with all non-
+ blank characters that are written into the window with <STRONG>waddch</STRONG>. Both
+ the character and attribute parts of the background are combined with
+ the blank characters. The background becomes a property of the charac-
+ ter and moves with the character through any scrolling and
+ insert/delete line/character operations.
+
+ To the extent possible on a particular terminal, the attribute part of
+ the background is displayed as the graphic rendition of the character
+ put on the screen.
</PRE><H3><a name="h3-bkgrnd">bkgrnd</a></H3><PRE>
- The <STRONG>bkgrnd</STRONG> and <STRONG>wbkgrnd</STRONG> functions set the background prop-
- erty of the current or specified window and then apply
- this setting to every character position in that window:
+ The <STRONG>bkgrnd</STRONG> and <STRONG>wbkgrnd</STRONG> functions set the background property of the
+ current or specified window and then apply this setting to every char-
+ acter position in that window:
- <STRONG>o</STRONG> The rendition of every character on the screen is
- changed to the new background rendition.
+ <STRONG>o</STRONG> The rendition of every character on the screen is changed to the
+ new background rendition.
- <STRONG>o</STRONG> Wherever the former background character appears, it
- is changed to the new background character.
+ <STRONG>o</STRONG> Wherever the former background character appears, it is changed to
+ the new background character.
</PRE><H3><a name="h3-getbkgrnd">getbkgrnd</a></H3><PRE>
- The <STRONG>getbkgrnd</STRONG> function returns the given window's current
- background character/attribute pair via the <STRONG>wch</STRONG> pointer.
- If the given window pointer is null, the character is not
- updated (but no error returned).
+ The <STRONG>getbkgrnd</STRONG> function returns the given window's current background
+ character/attribute pair via the <STRONG>wch</STRONG> pointer. If the given window
+ pointer is null, the character is not updated (but no error returned).
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
- The <STRONG>bkgrndset</STRONG> and <STRONG>wbkgrndset</STRONG> routines do not return a
- value.
+ The <STRONG>bkgrndset</STRONG> and <STRONG>wbkgrndset</STRONG> routines do not return a value.
- Upon successful completion, the other functions return <STRONG>OK</STRONG>.
- Otherwise, they return <STRONG>ERR</STRONG>:
+ Upon successful completion, the other functions return <STRONG>OK</STRONG>. Otherwise,
+ they return <STRONG>ERR</STRONG>:
<STRONG>o</STRONG> A null window pointer is treated as an error.
- <STRONG><A HREF="curs_bkgrnd.3x.html">curs_bkgrnd(3x)</A></STRONG>
+ <STRONG><A HREF="curs_bkgrnd.3x.html">curs_bkgrnd(3x)</A></STRONG>
</PRE>
<div class="nav">
<ul>
<BODY>
<H1 class="no-header">curs_border 3x</H1>
<PRE>
-<STRONG><A HREF="curs_border.3x.html">curs_border(3x)</A></STRONG> <STRONG><A HREF="curs_border.3x.html">curs_border(3x)</A></STRONG>
+<STRONG><A HREF="curs_border.3x.html">curs_border(3x)</A></STRONG> <STRONG><A HREF="curs_border.3x.html">curs_border(3x)</A></STRONG>
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
- <STRONG>border</STRONG>, <STRONG>wborder</STRONG>, <STRONG>box</STRONG>, <STRONG>hline</STRONG>, <STRONG>whline</STRONG>, <STRONG>vline</STRONG>, <STRONG>wvline</STRONG>,
- <STRONG>mvhline</STRONG>, <STRONG>mvwhline</STRONG>, <STRONG>mvvline</STRONG>, <STRONG>mvwvline</STRONG> - create <STRONG>curses</STRONG>
- borders, horizontal and vertical lines
+ <STRONG>border</STRONG>, <STRONG>wborder</STRONG>, <STRONG>box</STRONG>, <STRONG>hline</STRONG>, <STRONG>whline</STRONG>, <STRONG>vline</STRONG>, <STRONG>wvline</STRONG>, <STRONG>mvhline</STRONG>, <STRONG>mvwhline</STRONG>,
+ <STRONG>mvvline</STRONG>, <STRONG>mvwvline</STRONG> - create <STRONG>curses</STRONG> borders, horizontal and vertical
+ lines
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
- The <STRONG>border</STRONG>, <STRONG>wborder</STRONG> and <STRONG>box</STRONG> routines draw a box around the
- edges of a window. Other than the window, each argument
- is a character with attributes:
+ The <STRONG>border</STRONG>, <STRONG>wborder</STRONG> and <STRONG>box</STRONG> routines draw a box around the edges of a
+ window. Other than the window, each argument is a character with at-
+ tributes:
<EM>ls</EM> - left side,
<EM>rs</EM> - right side,
<EM>bl</EM> - bottom left-hand corner, and
<EM>br</EM> - bottom right-hand corner.
- If any of these arguments is zero, then the corresponding
- default values (defined in <STRONG>curses.h</STRONG>) are used instead:
+ If any of these arguments is zero, then the corresponding default val-
+ ues (defined in <STRONG>curses.h</STRONG>) are used instead:
<STRONG>ACS_VLINE</STRONG>,
<STRONG>ACS_VLINE</STRONG>,
<STRONG>ACS_LLCORNER</STRONG>,
<STRONG>ACS_LRCORNER</STRONG>.
- <STRONG>box(</STRONG><EM>win</EM><STRONG>,</STRONG> <EM>verch</EM><STRONG>,</STRONG> <EM>horch</EM><STRONG>)</STRONG> is a shorthand for the following
- call: <STRONG>wborder(</STRONG><EM>win</EM><STRONG>,</STRONG> <EM>verch</EM><STRONG>,</STRONG> <EM>verch</EM><STRONG>,</STRONG> <EM>horch</EM><STRONG>,</STRONG> <EM>horch</EM><STRONG>,</STRONG> <STRONG>0,</STRONG> <STRONG>0,</STRONG> <STRONG>0,</STRONG>
- <STRONG>0)</STRONG>.
+ <STRONG>box(</STRONG><EM>win</EM><STRONG>,</STRONG> <EM>verch</EM><STRONG>,</STRONG> <EM>horch</EM><STRONG>)</STRONG> is a shorthand for the following call: <STRONG>wbor-</STRONG>
+ <STRONG>der(</STRONG><EM>win</EM><STRONG>,</STRONG> <EM>verch</EM><STRONG>,</STRONG> <EM>verch</EM><STRONG>,</STRONG> <EM>horch</EM><STRONG>,</STRONG> <EM>horch</EM><STRONG>,</STRONG> <STRONG>0,</STRONG> <STRONG>0,</STRONG> <STRONG>0,</STRONG> <STRONG>0)</STRONG>.
- The <STRONG>hline</STRONG> and <STRONG>whline</STRONG> functions draw a horizontal (left to
- right) line using <EM>ch</EM> starting at the current cursor posi-
- tion in the window. The current cursor position is not
- changed. The line is at most <EM>n</EM> characters long, or as
- many as fit into the window.
+ The <STRONG>hline</STRONG> and <STRONG>whline</STRONG> functions draw a horizontal (left to right) line
+ using <EM>ch</EM> starting at the current cursor position in the window. The
+ current cursor position is not changed. The line is at most <EM>n</EM> charac-
+ ters long, or as many as fit into the window.
- The <STRONG>vline</STRONG> and <STRONG>wvline</STRONG> functions draw a vertical (top to
- bottom) line using <EM>ch</EM> starting at the current cursor posi-
- tion in the window. The current cursor position is not
- changed. The line is at most <EM>n</EM> characters long, or as
- many as fit into the window.
+ The <STRONG>vline</STRONG> and <STRONG>wvline</STRONG> functions draw a vertical (top to bottom) line us-
+ ing <EM>ch</EM> starting at the current cursor position in the window. The cur-
+ rent cursor position is not changed. The line is at most <EM>n</EM> characters
+ long, or as many as fit into the window.
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
- All routines return the integer <STRONG>OK</STRONG>. The SVr4.0 manual
- says "or a non-negative integer if <STRONG>immedok</STRONG> is set", but
- this appears to be an error.
+ All routines return the integer <STRONG>OK</STRONG>. The SVr4.0 manual says "or a non-
+ negative integer if <STRONG>immedok</STRONG> is set", but this appears to be an error.
- X/Open does not define any error conditions. This imple-
- mentation returns an error if the window pointer is null.
+ X/Open does not define any error conditions. This implementation re-
+ turns an error if the window pointer is null.
- Functions with a "mv" prefix first perform a cursor move-
- ment using <STRONG>wmove</STRONG>, and return an error if the position is
- outside the window, or if the window pointer is null.
+ Functions with a "mv" prefix first perform a cursor movement using
+ <STRONG>wmove</STRONG>, and return an error if the position is outside the window, or if
+ the window pointer is null.
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
- The borders generated by these functions are <EM>inside</EM> bor-
- ders (this is also true of SVr4 curses, though the fact is
- not documented).
+ The borders generated by these functions are <EM>inside</EM> borders (this is
+ also true of SVr4 curses, though the fact is not documented).
Note that <STRONG>border</STRONG> and <STRONG>box</STRONG> may be macros.
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
- These functions are described in the XSI Curses standard,
- Issue 4. The standard specifies that they return <STRONG>ERR</STRONG> on
- failure, but specifies no error conditions.
+ These functions are described in the XSI Curses standard, Issue 4. The
+ standard specifies that they return <STRONG>ERR</STRONG> on failure, but specifies no
+ error conditions.
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
- <STRONG><A HREF="curs_border.3x.html">curs_border(3x)</A></STRONG>
+ <STRONG><A HREF="curs_border.3x.html">curs_border(3x)</A></STRONG>
</PRE>
<div class="nav">
<ul>
<BODY>
<H1 class="no-header">curs_border_set 3x</H1>
<PRE>
-<STRONG><A HREF="curs_border_set.3x.html">curs_border_set(3x)</A></STRONG> <STRONG><A HREF="curs_border_set.3x.html">curs_border_set(3x)</A></STRONG>
+<STRONG><A HREF="curs_border_set.3x.html">curs_border_set(3x)</A></STRONG> <STRONG><A HREF="curs_border_set.3x.html">curs_border_set(3x)</A></STRONG>
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
- <STRONG>border_set</STRONG>, <STRONG>wborder_set</STRONG>, <STRONG>box_set</STRONG>, <STRONG>hline_set</STRONG>, <STRONG>whline_set</STRONG>,
- <STRONG>mvhline_set</STRONG>, <STRONG>mvwhline_set</STRONG>, <STRONG>vline_set</STRONG>, <STRONG>wvline_set</STRONG>,
- <STRONG>mvvline_set</STRONG>, <STRONG>mvwvline_set</STRONG> - create <STRONG>curses</STRONG> borders or lines
- using complex characters and renditions
+ <STRONG>border_set</STRONG>, <STRONG>wborder_set</STRONG>, <STRONG>box_set</STRONG>, <STRONG>hline_set</STRONG>, <STRONG>whline_set</STRONG>, <STRONG>mvhline_set</STRONG>,
+ <STRONG>mvwhline_set</STRONG>, <STRONG>vline_set</STRONG>, <STRONG>wvline_set</STRONG>, <STRONG>mvvline_set</STRONG>, <STRONG>mvwvline_set</STRONG> - create
+ <STRONG>curses</STRONG> borders or lines using complex characters and renditions
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
- The <STRONG>border_set</STRONG> and <STRONG>wborder_set</STRONG> functions draw a border
- around the edges of the current or specified window.
- These functions do not change the cursor position, and do
- not wrap.
+ The <STRONG>border_set</STRONG> and <STRONG>wborder_set</STRONG> functions draw a border around the edges
+ of the current or specified window. These functions do not change the
+ cursor position, and do not wrap.
- Other than the window, each argument is a complex charac-
- ter with attributes:
+ Other than the window, each argument is a complex character with at-
+ tributes:
<EM>ls</EM> - left side,
<EM>rs</EM> - right side,
<EM>ts</EM> - top side,
<EM>bl</EM> - bottom left-hand corner, and
<EM>br</EM> - bottom right-hand corner.
- If any of these arguments is zero, then the corresponding
- default values (defined in <STRONG>curses.h</STRONG>) are used instead:
+ If any of these arguments is zero, then the corresponding default val-
+ ues (defined in <STRONG>curses.h</STRONG>) are used instead:
<STRONG>WACS_VLINE</STRONG>,
<STRONG>WACS_VLINE</STRONG>,
<STRONG>WACS_HLINE</STRONG>,
<STRONG>WACS_LLCORNER</STRONG>, and
<STRONG>WACS_LRCORNER</STRONG>.
- <STRONG>box_set(</STRONG><EM>win</EM>, <EM>verch</EM><STRONG>,</STRONG> <EM>horch</EM><STRONG>);</STRONG> is a shorthand for the follow-
- ing call:
+ <STRONG>box_set(</STRONG><EM>win</EM>, <EM>verch</EM><STRONG>,</STRONG> <EM>horch</EM><STRONG>);</STRONG> is a shorthand for the following call:
<STRONG>wborder_set(</STRONG><EM>win</EM><STRONG>,</STRONG> <EM>verch</EM><STRONG>,</STRONG> <EM>verch</EM><STRONG>,</STRONG>
<EM>horch</EM><STRONG>,</STRONG> <EM>horch</EM><STRONG>,</STRONG> <STRONG>NULL,</STRONG> <STRONG>NULL,</STRONG> <STRONG>NULL,</STRONG> <STRONG>NULL);</STRONG>
- The <STRONG>*line_set</STRONG> functions use <EM>wch</EM> to draw a line starting at
- the current cursor position in the window. The line is at
- most <EM>n</EM> characters long or as many as fit into the window.
- The current cursor position is not changed.
+ The <STRONG>*line_set</STRONG> functions use <EM>wch</EM> to draw a line starting at the current
+ cursor position in the window. The line is at most <EM>n</EM> characters long
+ or as many as fit into the window. The current cursor position is not
+ changed.
- The <STRONG>hline_set</STRONG>, <STRONG>mvhline_set</STRONG>, <STRONG>mvwhline_set</STRONG>, and <STRONG>whline_set</STRONG>
- functions draw a line proceeding toward the last column of
- the same line.
+ The <STRONG>hline_set</STRONG>, <STRONG>mvhline_set</STRONG>, <STRONG>mvwhline_set</STRONG>, and <STRONG>whline_set</STRONG> functions draw
+ a line proceeding toward the last column of the same line.
- The <STRONG>vline_set</STRONG>, <STRONG>mvvline_set</STRONG>, <STRONG>mvwvline_set</STRONG>, and <STRONG>wvline_set</STRONG>
- functions draw a line proceeding toward the last line of
- the window.
+ The <STRONG>vline_set</STRONG>, <STRONG>mvvline_set</STRONG>, <STRONG>mvwvline_set</STRONG>, and <STRONG>wvline_set</STRONG> functions draw
+ a line proceeding toward the last line of the window.
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
- Note that <STRONG>border_set</STRONG>, <STRONG>hline_set</STRONG>, <STRONG>mvhline_set</STRONG>, <STRONG>mvvline_set</STRONG>,
- <STRONG>mvwhline_set</STRONG>, <STRONG>mvwvline_set</STRONG>, and <STRONG>vline_set</STRONG> may be macros.
+ Note that <STRONG>border_set</STRONG>, <STRONG>hline_set</STRONG>, <STRONG>mvhline_set</STRONG>, <STRONG>mvvline_set</STRONG>, <STRONG>mvwh-</STRONG>
+ <STRONG>line_set</STRONG>, <STRONG>mvwvline_set</STRONG>, and <STRONG>vline_set</STRONG> may be macros.
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
- Upon successful completion, these functions return <STRONG>OK</STRONG>.
- Otherwise, they return <STRONG>ERR</STRONG>.
+ Upon successful completion, these functions return <STRONG>OK</STRONG>. Otherwise, they
+ return <STRONG>ERR</STRONG>.
- Functions using a window parameter return an error if it
- is null.
+ Functions using a window parameter return an error if it is null.
- Functions with a "mv" prefix first perform a cursor move-
- ment using <STRONG>wmove</STRONG>, and return an error if the position is
- outside the window, or if the window pointer is null.
+ Functions with a "mv" prefix first perform a cursor movement using
+ <STRONG>wmove</STRONG>, and return an error if the position is outside the window, or if
+ the window pointer is null.
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
- <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG>, <STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG>, <STRONG><A HREF="curs_border.3x.html">curs_border(3x)</A></STRONG>, <STRONG>curs_out-</STRONG>
- <STRONG><A HREF="curs_outopts.3x.html">opts(3x)</A></STRONG>
+ <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG>, <STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG>, <STRONG><A HREF="curs_border.3x.html">curs_border(3x)</A></STRONG>, <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>
- <STRONG><A HREF="curs_border_set.3x.html">curs_border_set(3x)</A></STRONG>
+ <STRONG><A HREF="curs_border_set.3x.html">curs_border_set(3x)</A></STRONG>
</PRE>
<div class="nav">
<ul>
<BODY>
<H1 class="no-header">curs_clear 3x</H1>
<PRE>
-<STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG> <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>
+<STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG> <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
- <STRONG>erase</STRONG>, <STRONG>werase</STRONG>, <STRONG>clear</STRONG>, <STRONG>wclear</STRONG>, <STRONG>clrtobot</STRONG>, <STRONG>wclrtobot</STRONG>,
- <STRONG>clrtoeol</STRONG>, <STRONG>wclrtoeol</STRONG> - clear all or part of a <STRONG>curses</STRONG> window
+ <STRONG>erase</STRONG>, <STRONG>werase</STRONG>, <STRONG>clear</STRONG>, <STRONG>wclear</STRONG>, <STRONG>clrtobot</STRONG>, <STRONG>wclrtobot</STRONG>, <STRONG>clrtoeol</STRONG>, <STRONG>wclrtoeol</STRONG>
+ - clear all or part of a <STRONG>curses</STRONG> window
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
- The <STRONG>erase</STRONG> and <STRONG>werase</STRONG> routines copy blanks to every posi-
- tion in the window, clearing the screen.
+ The <STRONG>erase</STRONG> and <STRONG>werase</STRONG> routines copy blanks to every position in the win-
+ dow, clearing the screen.
- The <STRONG>clear</STRONG> and <STRONG>wclear</STRONG> routines are like <STRONG>erase</STRONG> and <STRONG>werase</STRONG>,
- but they also call <STRONG>clearok</STRONG>, so that the screen is cleared
- completely on the next call to <STRONG>wrefresh</STRONG> for that window
- and repainted from scratch.
+ The <STRONG>clear</STRONG> and <STRONG>wclear</STRONG> routines are like <STRONG>erase</STRONG> and <STRONG>werase</STRONG>, but they also
+ call <STRONG>clearok</STRONG>, so that the screen is cleared completely on the next call
+ to <STRONG>wrefresh</STRONG> for that window and repainted from scratch.
- The <STRONG>clrtobot</STRONG> and <STRONG>wclrtobot</STRONG> routines erase from the cursor
- to the end of screen. That is, they erase all lines below
- the cursor in the window. Also, the current line to the
- right of the cursor, inclusive, is erased.
+ The <STRONG>clrtobot</STRONG> and <STRONG>wclrtobot</STRONG> routines erase from the cursor to the end of
+ screen. That is, they erase all lines below the cursor in the window.
+ Also, the current line to the right of the cursor, inclusive, is
+ erased.
- The <STRONG>clrtoeol</STRONG> and <STRONG>wclrtoeol</STRONG> routines erase the current line
- to the right of the cursor, inclusive, to the end of the
- current line.
+ The <STRONG>clrtoeol</STRONG> and <STRONG>wclrtoeol</STRONG> routines erase the current line to the right
+ of the cursor, inclusive, to the end of the current line.
- Blanks created by erasure have the current background ren-
- dition (as set by <STRONG>wbkgdset</STRONG>) merged into them.
+ Blanks created by erasure have the current background rendition (as set
+ by <STRONG>wbkgdset</STRONG>) merged into them.
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
- All routines return the integer <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on
- failure. The SVr4.0 manual says "or a non-negative inte-
- ger if <STRONG>immedok</STRONG> is set", but this appears to be an error.
+ All routines return the integer <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on failure. The
+ SVr4.0 manual says "or a non-negative integer if <STRONG>immedok</STRONG> is set", but
+ this appears to be an error.
- X/Open defines no error conditions. In this implementa-
- tion, functions using a window pointer parameter return an
- error if it is null.
+ X/Open defines no error conditions. In this implementation, functions
+ using a window pointer parameter return an error if it is null.
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
- Note that <STRONG>erase</STRONG>, <STRONG>werase</STRONG>, <STRONG>clear</STRONG>, <STRONG>wclear</STRONG>, <STRONG>clrtobot</STRONG>, and <STRONG>clr-</STRONG>
- <STRONG>toeol</STRONG> may be macros.
+ Note that <STRONG>erase</STRONG>, <STRONG>werase</STRONG>, <STRONG>clear</STRONG>, <STRONG>wclear</STRONG>, <STRONG>clrtobot</STRONG>, and <STRONG>clrtoeol</STRONG> may be
+ macros.
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
- These functions are described in the XSI Curses standard,
- Issue 4. The standard specifies that they return <STRONG>ERR</STRONG> on
- failure, but specifies no error conditions.
+ These functions are described in the XSI Curses standard, Issue 4. The
+ standard specifies that they return <STRONG>ERR</STRONG> on failure, but specifies no
+ error conditions.
- Some historic curses implementations had, as an undocu-
- mented feature, the ability to do the equivalent of
- <STRONG>clearok(...,</STRONG> <STRONG>1)</STRONG> by saying <STRONG>touchwin(stdscr)</STRONG> or <STRONG>clear(std-</STRONG>
- <STRONG>scr)</STRONG>. This will not work under ncurses.
+ Some historic curses implementations had, as an undocumented feature,
+ the ability to do the equivalent of <STRONG>clearok(...,</STRONG> <STRONG>1)</STRONG> by saying <STRONG>touch-</STRONG>
+ <STRONG>win(stdscr)</STRONG> or <STRONG>clear(stdscr)</STRONG>. This will not work under ncurses.
- This implementation, and others such as Solaris, sets the
- current position to 0,0 after erasing via <STRONG>werase</STRONG> and
- <STRONG>wclear</STRONG>. That fact is not documented in other implementa-
- tions, and may not be true of implementations which were
- not derived from SVr4 source.
+ This implementation, and others such as Solaris, sets the current posi-
+ tion to 0,0 after erasing via <STRONG>werase</STRONG> and <STRONG>wclear</STRONG>. That fact is not doc-
+ umented in other implementations, and may not be true of implementa-
+ tions which were not derived from SVr4 source.
- Not obvious from the description, most implementations
- clear the screen after <STRONG>wclear</STRONG> even for a subwindow or de-
- rived window. If you do not want to clear the screen dur-
- ing the next <STRONG>wrefresh</STRONG>, use <STRONG>werase</STRONG> instead.
+ Not obvious from the description, most implementations clear the screen
+ after <STRONG>wclear</STRONG> even for a subwindow or derived window. If you do not
+ want to clear the screen during the next <STRONG>wrefresh</STRONG>, use <STRONG>werase</STRONG> instead.
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
- <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>, <STRONG>curs_vari-</STRONG>
- <STRONG><A HREF="curs_variables.3x.html">ables(3x)</A></STRONG>
+ <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>
- <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>
+ <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>
</PRE>
<div class="nav">
<ul>
<BODY>
<H1 class="no-header">curs_color 3x</H1>
<PRE>
-<STRONG><A HREF="curs_color.3x.html">curs_color(3x)</A></STRONG> <STRONG><A HREF="curs_color.3x.html">curs_color(3x)</A></STRONG>
+<STRONG><A HREF="curs_color.3x.html">curs_color(3x)</A></STRONG> <STRONG><A HREF="curs_color.3x.html">curs_color(3x)</A></STRONG>
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
- <STRONG>start_color</STRONG>, <STRONG>has_colors</STRONG>, <STRONG>can_change_color</STRONG>, <STRONG>init_pair</STRONG>,
- <STRONG>init_color</STRONG>, <STRONG>color_content</STRONG>, <STRONG>pair_content</STRONG>, <STRONG>COLOR_PAIR</STRONG>,
- <STRONG>PAIR_NUMBER</STRONG> - <STRONG>curses</STRONG> color manipulation routines
+ <STRONG>start_color</STRONG>, <STRONG>has_colors</STRONG>, <STRONG>can_change_color</STRONG>, <STRONG>init_pair</STRONG>, <STRONG>init_color</STRONG>,
+ <STRONG>color_content</STRONG>, <STRONG>pair_content</STRONG>, <STRONG>COLOR_PAIR</STRONG>, <STRONG>PAIR_NUMBER</STRONG> - <STRONG>curses</STRONG> color
+ manipulation routines
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
<STRONG>int</STRONG> <STRONG>init_extended_pair(int</STRONG> <STRONG>pair,</STRONG> <STRONG>int</STRONG> <STRONG>f,</STRONG> <STRONG>int</STRONG> <STRONG>b);</STRONG>
<STRONG>int</STRONG> <STRONG>init_extended_color(int</STRONG> <STRONG>color,</STRONG> <STRONG>int</STRONG> <STRONG>r,</STRONG> <STRONG>int</STRONG> <STRONG>g,</STRONG> <STRONG>int</STRONG> <STRONG>b);</STRONG>
- <STRONG>int</STRONG> <STRONG>color_content(short</STRONG> <STRONG>color,</STRONG> <STRONG>short</STRONG> <STRONG>*r,</STRONG> <STRONG>short</STRONG> <STRONG>*g,</STRONG> <STRONG>short</STRONG>
- <STRONG>*b);</STRONG>
+ <STRONG>int</STRONG> <STRONG>color_content(short</STRONG> <STRONG>color,</STRONG> <STRONG>short</STRONG> <STRONG>*r,</STRONG> <STRONG>short</STRONG> <STRONG>*g,</STRONG> <STRONG>short</STRONG> <STRONG>*b);</STRONG>
<STRONG>int</STRONG> <STRONG>pair_content(short</STRONG> <STRONG>pair,</STRONG> <STRONG>short</STRONG> <STRONG>*f,</STRONG> <STRONG>short</STRONG> <STRONG>*b);</STRONG>
/* extensions */
- <STRONG>int</STRONG> <STRONG>extended_color_content(int</STRONG> <STRONG>color,</STRONG> <STRONG>int</STRONG> <STRONG>*r,</STRONG> <STRONG>int</STRONG> <STRONG>*g,</STRONG> <STRONG>int</STRONG>
- <STRONG>*b);</STRONG>
+ <STRONG>int</STRONG> <STRONG>extended_color_content(int</STRONG> <STRONG>color,</STRONG> <STRONG>int</STRONG> <STRONG>*r,</STRONG> <STRONG>int</STRONG> <STRONG>*g,</STRONG> <STRONG>int</STRONG> <STRONG>*b);</STRONG>
<STRONG>int</STRONG> <STRONG>extended_pair_content(int</STRONG> <STRONG>pair,</STRONG> <STRONG>int</STRONG> <STRONG>*f,</STRONG> <STRONG>int</STRONG> <STRONG>*b);</STRONG>
<STRONG>int</STRONG> <STRONG>COLOR_PAIR(int</STRONG> <STRONG>n);</STRONG>
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
</PRE><H3><a name="h3-Overview">Overview</a></H3><PRE>
- <STRONG>curses</STRONG> supports color attributes on terminals with that
- capability. To use these routines <STRONG>start_color</STRONG> must be
- called, usually right after <STRONG>initscr</STRONG>. Colors are always
- used in pairs (referred to as color-pairs). A color-pair
- consists of a foreground color (for characters) and a
- background color (for the blank field on which the charac-
- ters are displayed). A programmer initializes a color-
- pair with the routine <STRONG>init_pair</STRONG>. After it has been ini-
- tialized, <STRONG>COLOR_PAIR</STRONG>(<EM>n</EM>) can be used to convert the pair to
- a video attribute.
-
- If a terminal is capable of redefining colors, the pro-
- grammer can use the routine <STRONG>init_color</STRONG> to change the defi-
- nition of a color. The routines <STRONG>has_colors</STRONG> and
- <STRONG>can_change_color</STRONG> return <STRONG>TRUE</STRONG> or <STRONG>FALSE</STRONG>, depending on
- whether the terminal has color capabilities and whether
- the programmer can change the colors. The routine <STRONG>col-</STRONG>
- <STRONG>or_content</STRONG> allows a programmer to extract the amounts of
- red, green, and blue components in an initialized color.
- The routine <STRONG>pair_content</STRONG> allows a programmer to find out
- how a given color-pair is currently defined.
+ <STRONG>curses</STRONG> supports color attributes on terminals with that capability. To
+ use these routines <STRONG>start_color</STRONG> must be called, usually right after
+ <STRONG>initscr</STRONG>. Colors are always used in pairs (referred to as color-pairs).
+ A color-pair consists of a foreground color (for characters) and a
+ background color (for the blank field on which the characters are dis-
+ played). A programmer initializes a color-pair with the routine
+ <STRONG>init_pair</STRONG>. After it has been initialized, <STRONG>COLOR_PAIR</STRONG>(<EM>n</EM>) can be used to
+ convert the pair to a video attribute.
+
+ If a terminal is capable of redefining colors, the programmer can use
+ the routine <STRONG>init_color</STRONG> to change the definition of a color. The rou-
+ tines <STRONG>has_colors</STRONG> and <STRONG>can_change_color</STRONG> return <STRONG>TRUE</STRONG> or <STRONG>FALSE</STRONG>, depending
+ on whether the terminal has color capabilities and whether the program-
+ mer can change the colors. The routine <STRONG>color_content</STRONG> allows a program-
+ mer to extract the amounts of red, green, and blue components in an
+ initialized color. The routine <STRONG>pair_content</STRONG> allows a programmer to
+ find out how a given color-pair is currently defined.
</PRE><H3><a name="h3-Color-Rendering">Color Rendering</a></H3><PRE>
- The <STRONG>curses</STRONG> library combines these inputs to produce the
- actual foreground and background colors shown on the
- screen:
+ The <STRONG>curses</STRONG> library combines these inputs to produce the actual fore-
+ ground and background colors shown on the screen:
<STRONG>o</STRONG> per-character video attributes (e.g., via <STRONG>waddch</STRONG>),
<STRONG>o</STRONG> the background character (e.g., <STRONG>wbkgdset</STRONG>).
- Per-character and window attributes are usually set by a
- parameter containing video attributes including a color
- pair value. Some functions such as <STRONG>wattr_set</STRONG> use a sepa-
- rate parameter which is the color pair number.
+ Per-character and window attributes are usually set by a parameter con-
+ taining video attributes including a color pair value. Some functions
+ such as <STRONG>wattr_set</STRONG> use a separate parameter which is the color pair num-
+ ber.
- The background character is a special case: it includes a
- character value, just as if it were passed to <STRONG>waddch</STRONG>.
+ The background character is a special case: it includes a character
+ value, just as if it were passed to <STRONG>waddch</STRONG>.
- The <STRONG>curses</STRONG> library does the actual work of combining these
- color pairs in an internal function called from <STRONG>waddch</STRONG>:
+ The <STRONG>curses</STRONG> library does the actual work of combining these color pairs
+ in an internal function called from <STRONG>waddch</STRONG>:
- <STRONG>o</STRONG> If the parameter passed to <STRONG>waddch</STRONG> is <EM>blank</EM>, and it us-
- es the special color pair 0,
+ <STRONG>o</STRONG> If the parameter passed to <STRONG>waddch</STRONG> is <EM>blank</EM>, and it uses the special
+ color pair 0,
<STRONG>o</STRONG> <STRONG>curses</STRONG> next checks the window attribute.
- <STRONG>o</STRONG> If the window attribute does not use color pair 0,
- <STRONG>curses</STRONG> uses the color pair from the window at-
- tribute.
+ <STRONG>o</STRONG> If the window attribute does not use color pair 0, <STRONG>curses</STRONG> uses
+ the color pair from the window attribute.
<STRONG>o</STRONG> Otherwise, <STRONG>curses</STRONG> uses the background character.
- <STRONG>o</STRONG> If the parameter passed to <STRONG>waddch</STRONG> is <EM>not</EM> <EM>blank</EM>, or it
- does not use the special color pair 0, <STRONG>curses</STRONG> prefers
- the color pair from the parameter, if it is nonzero.
- Otherwise, it tries the window attribute next, and fi-
- nally the background character.
+ <STRONG>o</STRONG> If the parameter passed to <STRONG>waddch</STRONG> is <EM>not</EM> <EM>blank</EM>, or it does not use
+ the special color pair 0, <STRONG>curses</STRONG> prefers the color pair from the
+ parameter, if it is nonzero. Otherwise, it tries the window at-
+ tribute next, and finally the background character.
- Some <STRONG>curses</STRONG> functions such as <STRONG>wprintw</STRONG> call <STRONG>waddch</STRONG>. Those
- do not combine its parameter with a color pair. Conse-
- quently those calls use only the window attribute or the
- background character.
+ Some <STRONG>curses</STRONG> functions such as <STRONG>wprintw</STRONG> call <STRONG>waddch</STRONG>. Those do not com-
+ bine its parameter with a color pair. Consequently those calls use on-
+ ly the window attribute or the background character.
</PRE><H2><a name="h2-CONSTANTS">CONSTANTS</a></H2><PRE>
- In <STRONG><curses.h></STRONG> the following macros are defined. These are
- the standard colors (ISO-6429). <STRONG>curses</STRONG> also assumes that
- <STRONG>COLOR_BLACK</STRONG> is the default background color for all termi-
- nals.
+ In <STRONG><curses.h></STRONG> the following macros are defined. These are the standard
+ colors (ISO-6429). <STRONG>curses</STRONG> also assumes that <STRONG>COLOR_BLACK</STRONG> is the default
+ background color for all terminals.
<STRONG>COLOR_BLACK</STRONG>
<STRONG>COLOR_RED</STRONG>
<STRONG>COLOR_CYAN</STRONG>
<STRONG>COLOR_WHITE</STRONG>
- Some terminals support more than the eight (8) "ANSI" col-
- ors. There are no standard names for those additional
- colors.
+ Some terminals support more than the eight (8) "ANSI" colors. There
+ are no standard names for those additional colors.
</PRE><H2><a name="h2-VARIABLES">VARIABLES</a></H2><PRE>
</PRE><H3><a name="h3-COLORS">COLORS</a></H3><PRE>
- is initialized by <STRONG>start_color</STRONG> to the maximum number of
- colors the terminal can support.
+ is initialized by <STRONG>start_color</STRONG> to the maximum number of colors the ter-
+ minal can support.
</PRE><H3><a name="h3-COLOR_PAIRS">COLOR_PAIRS</a></H3><PRE>
- is initialized by <STRONG>start_color</STRONG> to the maximum number of
- color pairs the terminal can support.
+ is initialized by <STRONG>start_color</STRONG> to the maximum number of color pairs the
+ terminal can support.
</PRE><H2><a name="h2-FUNCTIONS">FUNCTIONS</a></H2><PRE>
</PRE><H3><a name="h3-start_color">start_color</a></H3><PRE>
- The <STRONG>start_color</STRONG> routine requires no arguments. It must be
- called if the programmer wants to use colors, and before
- any other color manipulation routine is called. It is
- good practice to call this routine right after <STRONG>initscr</STRONG>.
- <STRONG>start_color</STRONG> does this:
-
- <STRONG>o</STRONG> It initializes two global variables, <STRONG>COLORS</STRONG> and <STRONG>COL-</STRONG>
- <STRONG>OR_PAIRS</STRONG> (respectively defining the maximum number of
- colors and color-pairs the terminal can support).
-
- <STRONG>o</STRONG> It initializes the special color pair <STRONG>0</STRONG> to the default
- foreground and background colors. No other color
- pairs are initialized.
-
- <STRONG>o</STRONG> It restores the colors on the terminal to the values
- they had when the terminal was just turned on.
-
- <STRONG>o</STRONG> If the terminal supports the <STRONG>initc</STRONG> (<STRONG>initialize_color</STRONG>)
- capability, <STRONG>start_color</STRONG> initializes its internal table
- representing the red, green and blue components of the
- color palette.
-
- The components depend on whether the terminal uses CGA
- (aka "ANSI") or HLS (i.e., the <STRONG>hls</STRONG> (<STRONG>hue_lightness_sat-</STRONG>
- <STRONG>uration</STRONG>) capability is set). The table is initialized
- first for eight basic colors (black, red, green, yel-
- low, blue, magenta, cyan, and white), and after that
- (if the terminal supports more than eight colors) the
+ The <STRONG>start_color</STRONG> routine requires no arguments. It must be called if
+ the programmer wants to use colors, and before any other color manipu-
+ lation routine is called. It is good practice to call this routine
+ right after <STRONG>initscr</STRONG>. <STRONG>start_color</STRONG> does this:
+
+ <STRONG>o</STRONG> It initializes two global variables, <STRONG>COLORS</STRONG> and <STRONG>COLOR_PAIRS</STRONG> (re-
+ spectively defining the maximum number of colors and color-pairs
+ the terminal can support).
+
+ <STRONG>o</STRONG> It initializes the special color pair <STRONG>0</STRONG> to the default foreground
+ and background colors. No other color pairs are initialized.
+
+ <STRONG>o</STRONG> It restores the colors on the terminal to the values they had when
+ the terminal was just turned on.
+
+ <STRONG>o</STRONG> If the terminal supports the <STRONG>initc</STRONG> (<STRONG>initialize_color</STRONG>) capability,
+ <STRONG>start_color</STRONG> initializes its internal table representing the red,
+ green and blue components of the color palette.
+
+ The components depend on whether the terminal uses CGA (aka "ANSI")
+ or HLS (i.e., the <STRONG>hls</STRONG> (<STRONG>hue_lightness_saturation</STRONG>) capability is
+ set). The table is initialized first for eight basic colors
+ (black, red, green, yellow, blue, magenta, cyan, and white), and
+ after that (if the terminal supports more than eight colors) the
components are initialized to <STRONG>1000</STRONG>.
- <STRONG>start_color</STRONG> does not attempt to set the terminal's
- color palette to match its built-in table. An appli-
- cation may use <STRONG>init_color</STRONG> to alter the internal table
- along with the terminal's color.
+ <STRONG>start_color</STRONG> does not attempt to set the terminal's color palette to
+ match its built-in table. An application may use <STRONG>init_color</STRONG> to al-
+ ter the internal table along with the terminal's color.
- These limits apply to color values and color pairs. Val-
- ues outside these limits are not legal, and may result in
- a runtime error:
+ These limits apply to color values and color pairs. Values outside
+ these limits are not legal, and may result in a runtime error:
- <STRONG>o</STRONG> <STRONG>COLORS</STRONG> corresponds to the terminal database's <STRONG>max_col-</STRONG>
- <STRONG>ors</STRONG> capability, (see <STRONG><A HREF="max_colterminfo.5.html">terminfo(5)</A></STRONG>).
+ <STRONG>o</STRONG> <STRONG>COLORS</STRONG> corresponds to the terminal database's <STRONG>max_colors</STRONG> capabili-
+ ty, (see <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>).
- <STRONG>o</STRONG> color values are expected to be in the range <STRONG>0</STRONG> to <STRONG>COL-</STRONG>
- <STRONG>ORS-1</STRONG>, inclusive (including <STRONG>0</STRONG> and <STRONG>COLORS-1</STRONG>).
+ <STRONG>o</STRONG> color values are expected to be in the range <STRONG>0</STRONG> to <STRONG>COLORS-1</STRONG>, inclu-
+ sive (including <STRONG>0</STRONG> and <STRONG>COLORS-1</STRONG>).
- <STRONG>o</STRONG> a special color value <STRONG>-1</STRONG> is used in certain extended
- functions to denote the <EM>default</EM> <EM>color</EM> (see <STRONG>use_de-</STRONG>
- <STRONG>fault_colors</STRONG>).
+ <STRONG>o</STRONG> a special color value <STRONG>-1</STRONG> is used in certain extended functions to
+ denote the <EM>default</EM> <EM>color</EM> (see <STRONG>use_default_colors</STRONG>).
- <STRONG>o</STRONG> <STRONG>COLOR_PAIRS</STRONG> corresponds to the terminal database's
- <STRONG>max_pairs</STRONG> capability, (see <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>).
+ <STRONG>o</STRONG> <STRONG>COLOR_PAIRS</STRONG> corresponds to the terminal database's <STRONG>max_pairs</STRONG> capa-
+ bility, (see <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>).
- <STRONG>o</STRONG> legal color pair values are in the range <STRONG>1</STRONG> to <STRONG>COL-</STRONG>
- <STRONG>OR_PAIRS-1</STRONG>, inclusive.
+ <STRONG>o</STRONG> legal color pair values are in the range <STRONG>1</STRONG> to <STRONG>COLOR_PAIRS-1</STRONG>, inclu-
+ sive.
<STRONG>o</STRONG> color pair <STRONG>0</STRONG> is special; it denotes "no color".
- Color pair <STRONG>0</STRONG> is assumed to be white on black, but is
- actually whatever the terminal implements before color
- is initialized. It cannot be modified by the applica-
- tion.
+ Color pair <STRONG>0</STRONG> is assumed to be white on black, but is actually what-
+ ever the terminal implements before color is initialized. It can-
+ not be modified by the application.
</PRE><H3><a name="h3-has_colors">has_colors</a></H3><PRE>
- The <STRONG>has_colors</STRONG> routine requires no arguments. It returns
- <STRONG>TRUE</STRONG> if the terminal can manipulate colors; otherwise, it
- returns <STRONG>FALSE</STRONG>. This routine facilitates writing terminal-
- independent programs. For example, a programmer can use
- it to decide whether to use color or some other video at-
- tribute.
+ The <STRONG>has_colors</STRONG> routine requires no arguments. It returns <STRONG>TRUE</STRONG> if the
+ terminal can manipulate colors; otherwise, it returns <STRONG>FALSE</STRONG>. This rou-
+ tine facilitates writing terminal-independent programs. For example, a
+ programmer can use it to decide whether to use color or some other
+ video attribute.
</PRE><H3><a name="h3-can_change_color">can_change_color</a></H3><PRE>
- The <STRONG>can_change_color</STRONG> routine requires no arguments. It
- returns <STRONG>TRUE</STRONG> if the terminal supports colors and can
- change their definitions; other, it returns <STRONG>FALSE</STRONG>. This
- routine facilitates writing terminal-independent programs.
+ The <STRONG>can_change_color</STRONG> routine requires no arguments. It returns <STRONG>TRUE</STRONG> if
+ the terminal supports colors and can change their definitions; other,
+ it returns <STRONG>FALSE</STRONG>. This routine facilitates writing terminal-indepen-
+ dent programs.
</PRE><H3><a name="h3-init_pair">init_pair</a></H3><PRE>
- The <STRONG>init_pair</STRONG> routine changes the definition of a color-
- pair. It takes three arguments: the number of the color-
- pair to be changed, the foreground color number, and the
- background color number. For portable applications:
+ The <STRONG>init_pair</STRONG> routine changes the definition of a color-pair. It takes
+ three arguments: the number of the color-pair to be changed, the fore-
+ ground color number, and the background color number. For portable ap-
+ plications:
- <STRONG>o</STRONG> The first argument must be a legal color pair value.
- If default colors are used (see <STRONG>use_default_colors</STRONG>)
- the upper limit is adjusted to allow for extra pairs
- which use a default color in foreground and/or back-
- ground.
+ <STRONG>o</STRONG> The first argument must be a legal color pair value. If default
+ colors are used (see <STRONG>use_default_colors</STRONG>) the upper limit is adjust-
+ ed to allow for extra pairs which use a default color in foreground
+ and/or background.
- <STRONG>o</STRONG> The second and third arguments must be legal color
- values.
+ <STRONG>o</STRONG> The second and third arguments must be legal color values.
- If the color-pair was previously initialized, the screen
- is refreshed and all occurrences of that color-pair are
- changed to the new definition.
+ If the color-pair was previously initialized, the screen is refreshed
+ and all occurrences of that color-pair are changed to the new defini-
+ tion.
- As an extension, ncurses allows you to set color pair <STRONG>0</STRONG>
- via the <STRONG><A HREF="default_colors.3x.html">assume_default_colors(3x)</A></STRONG> routine, or to specify
- the use of default colors (color number <STRONG>-1</STRONG>) if you first
- invoke the <STRONG><A HREF="default_colors.3x.html">use_default_colors(3x)</A></STRONG> routine.
+ As an extension, ncurses allows you to set color pair <STRONG>0</STRONG> via the <STRONG>as-</STRONG>
+ <STRONG><A HREF="assume_default_colors.3x.html">sume_default_colors(3x)</A></STRONG> routine, or to specify the use of default col-
+ ors (color number <STRONG>-1</STRONG>) if you first invoke the <STRONG><A HREF="default_colors.3x.html">use_default_colors(3x)</A></STRONG>
+ routine.
</PRE><H3><a name="h3-init_color">init_color</a></H3><PRE>
- The <STRONG>init_color</STRONG> routine changes the definition of a color.
- It takes four arguments: the number of the color to be
- changed followed by three RGB values (for the amounts of
- red, green, and blue components).
+ The <STRONG>init_color</STRONG> routine changes the definition of a color. It takes
+ four arguments: the number of the color to be changed followed by three
+ RGB values (for the amounts of red, green, and blue components).
- <STRONG>o</STRONG> The first argument must be a legal color value; de-
- fault colors are not allowed here. (See the section
- <STRONG>Colors</STRONG> for the default color index.)
+ <STRONG>o</STRONG> The first argument must be a legal color value; default colors are
+ not allowed here. (See the section <STRONG>Colors</STRONG> for the default color
+ index.)
- <STRONG>o</STRONG> Each of the last three arguments must be a value in
- the range <STRONG>0</STRONG> through <STRONG>1000</STRONG>.
+ <STRONG>o</STRONG> Each of the last three arguments must be a value in the range <STRONG>0</STRONG>
+ through <STRONG>1000</STRONG>.
- When <STRONG>init_color</STRONG> is used, all occurrences of that color on
- the screen immediately change to the new definition.
+ When <STRONG>init_color</STRONG> is used, all occurrences of that color on the screen
+ immediately change to the new definition.
</PRE><H3><a name="h3-color_content">color_content</a></H3><PRE>
- The <STRONG>color_content</STRONG> routine gives programmers a way to find
- the intensity of the red, green, and blue (RGB) components
- in a color. It requires four arguments: the color number,
- and three addresses of <STRONG>short</STRONG>s for storing the information
- about the amounts of red, green, and blue components in
- the given color.
+ The <STRONG>color_content</STRONG> routine gives programmers a way to find the intensity
+ of the red, green, and blue (RGB) components in a color. It requires
+ four arguments: the color number, and three addresses of <STRONG>short</STRONG>s for
+ storing the information about the amounts of red, green, and blue com-
+ ponents in the given color.
- <STRONG>o</STRONG> The first argument must be a legal color value, i.e.,
- <STRONG>0</STRONG> through <STRONG>COLORS-1</STRONG>, inclusive.
+ <STRONG>o</STRONG> The first argument must be a legal color value, i.e., <STRONG>0</STRONG> through
+ <STRONG>COLORS-1</STRONG>, inclusive.
- <STRONG>o</STRONG> The values that are stored at the addresses pointed to
- by the last three arguments are in the range <STRONG>0</STRONG> (no
- component) through <STRONG>1000</STRONG> (maximum amount of component),
- inclusive.
+ <STRONG>o</STRONG> The values that are stored at the addresses pointed to by the last
+ three arguments are in the range <STRONG>0</STRONG> (no component) through <STRONG>1000</STRONG>
+ (maximum amount of component), inclusive.
</PRE><H3><a name="h3-pair_content">pair_content</a></H3><PRE>
- The <STRONG>pair_content</STRONG> routine allows programmers to find out
- what colors a given color-pair consists of. It requires
- three arguments: the color-pair number, and two addresses
- of <STRONG>short</STRONG>s for storing the foreground and the background
- color numbers.
+ The <STRONG>pair_content</STRONG> routine allows programmers to find out what colors a
+ given color-pair consists of. It requires three arguments: the color-
+ pair number, and two addresses of <STRONG>short</STRONG>s for storing the foreground and
+ the background color numbers.
- <STRONG>o</STRONG> The first argument must be a legal color value, i.e.,
- in the range <STRONG>1</STRONG> through <STRONG>COLOR_PAIRS-1</STRONG>, inclusive.
+ <STRONG>o</STRONG> The first argument must be a legal color value, i.e., in the range
+ <STRONG>1</STRONG> through <STRONG>COLOR_PAIRS-1</STRONG>, inclusive.
- <STRONG>o</STRONG> The values that are stored at the addresses pointed to
- by the second and third arguments are in the range <STRONG>0</STRONG>
- through <STRONG>COLORS</STRONG>, inclusive.
+ <STRONG>o</STRONG> The values that are stored at the addresses pointed to by the sec-
+ ond and third arguments are in the range <STRONG>0</STRONG> through <STRONG>COLORS</STRONG>, inclu-
+ sive.
</PRE><H3><a name="h3-PAIR_NUMBER">PAIR_NUMBER</a></H3><PRE>
- <STRONG>PAIR_NUMBER(</STRONG><EM>attrs</EM>) extracts the color value from its <EM>attrs</EM>
- parameter and returns it as a color pair number.
+ <STRONG>PAIR_NUMBER(</STRONG><EM>attrs</EM>) extracts the color value from its <EM>attrs</EM> parameter
+ and returns it as a color pair number.
</PRE><H3><a name="h3-COLOR_PAIR">COLOR_PAIR</a></H3><PRE>
- Its inverse <STRONG>COLOR_PAIR(</STRONG><EM>n</EM><STRONG>)</STRONG> converts a color pair number to
- an attribute. Attributes can hold color pairs in the
- range 0 to 255. If you need a color pair larger than
- that, you must use functions such as <STRONG>attr_set</STRONG> (which pass
- the color pair as a separate parameter) rather than the
+ Its inverse <STRONG>COLOR_PAIR(</STRONG><EM>n</EM><STRONG>)</STRONG> converts a color pair number to an attribute.
+ Attributes can hold color pairs in the range 0 to 255. If you need a
+ color pair larger than that, you must use functions such as <STRONG>attr_set</STRONG>
+ (which pass the color pair as a separate parameter) rather than the
legacy functions such as <STRONG>attrset</STRONG>.
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
- The routines <STRONG>can_change_color</STRONG> and <STRONG>has_colors</STRONG> return <STRONG>TRUE</STRONG>
- or <STRONG>FALSE</STRONG>.
-
- All other routines return the integer <STRONG>ERR</STRONG> upon failure and
- an <STRONG>OK</STRONG> (SVr4 specifies only "an integer value other than
- <STRONG>ERR</STRONG>") upon successful completion.
-
- X/Open defines no error conditions. This implementation
- will return <STRONG>ERR</STRONG> on attempts to use color values outside
- the range <STRONG>0</STRONG> to <STRONG>COLORS</STRONG>-1 (except for the default colors ex-
- tension), or use color pairs outside the range <STRONG>0</STRONG> to <STRONG>COL-</STRONG>
- <STRONG>OR_PAIRS-1</STRONG>. Color values used in <STRONG>init_color</STRONG> must be in
- the range <STRONG>0</STRONG> to <STRONG>1000</STRONG>. An error is returned from all func-
- tions if the terminal has not been initialized. An error
- is returned from secondary functions such as <STRONG>init_pair</STRONG> if
- <STRONG>start_color</STRONG> was not called.
+ The routines <STRONG>can_change_color</STRONG> and <STRONG>has_colors</STRONG> return <STRONG>TRUE</STRONG> or <STRONG>FALSE</STRONG>.
+
+ All other routines return the integer <STRONG>ERR</STRONG> upon failure and an <STRONG>OK</STRONG> (SVr4
+ specifies only "an integer value other than <STRONG>ERR</STRONG>") upon successful com-
+ pletion.
+
+ X/Open defines no error conditions. This implementation will return
+ <STRONG>ERR</STRONG> on attempts to use color values outside the range <STRONG>0</STRONG> to <STRONG>COLORS</STRONG>-1
+ (except for the default colors extension), or use color pairs outside
+ the range <STRONG>0</STRONG> to <STRONG>COLOR_PAIRS-1</STRONG>. Color values used in <STRONG>init_color</STRONG> must be
+ in the range <STRONG>0</STRONG> to <STRONG>1000</STRONG>. An error is returned from all functions if the
+ terminal has not been initialized. An error is returned from secondary
+ functions such as <STRONG>init_pair</STRONG> if <STRONG>start_color</STRONG> was not called.
<STRONG>init_color</STRONG>
- returns an error if the terminal does not support
- this feature, e.g., if the <STRONG>initialize_color</STRONG> capa-
- bility is absent from the terminal description.
+ returns an error if the terminal does not support this feature,
+ e.g., if the <STRONG>initialize_color</STRONG> capability is absent from the
+ terminal description.
<STRONG>start_color</STRONG>
- returns an error if the color table cannot be al-
- located.
+ returns an error if the color table cannot be allocated.
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
- In the <STRONG>ncurses</STRONG> implementation, there is a separate color
- activation flag, color palette, color pairs table, and as-
- sociated <STRONG>COLORS</STRONG> and <STRONG>COLOR_PAIRS</STRONG> counts for each screen;
- the <STRONG>start_color</STRONG> function only affects the current screen.
- The SVr4/XSI interface is not really designed with this in
- mind, and historical implementations may use a single
- shared color palette.
-
- Setting an implicit background color via a color pair af-
- fects only character cells that a character write opera-
- tion explicitly touches. To change the background color
- used when parts of a window are blanked by erasing or
- scrolling operations, see <STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG>.
-
- Several caveats apply on older x86 machines (e.g., i386,
- i486) with VGA-compatible graphics:
-
- <STRONG>o</STRONG> COLOR_YELLOW is actually brown. To get yellow, use
- COLOR_YELLOW combined with the <STRONG>A_BOLD</STRONG> attribute.
-
- <STRONG>o</STRONG> The A_BLINK attribute should in theory cause the back-
- ground to go bright. This often fails to work, and
- even some cards for which it mostly works (such as the
- Paradise and compatibles) do the wrong thing when you
- try to set a bright "yellow" background (you get a
+ In the <STRONG>ncurses</STRONG> implementation, there is a separate color activation
+ flag, color palette, color pairs table, and associated <STRONG>COLORS</STRONG> and <STRONG>COL-</STRONG>
+ <STRONG>OR_PAIRS</STRONG> counts for each screen; the <STRONG>start_color</STRONG> function only affects
+ the current screen. The SVr4/XSI interface is not really designed with
+ this in mind, and historical implementations may use a single shared
+ color palette.
+
+ Setting an implicit background color via a color pair affects only
+ character cells that a character write operation explicitly touches.
+ To change the background color used when parts of a window are blanked
+ by erasing or scrolling operations, see <STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG>.
+
+ Several caveats apply on older x86 machines (e.g., i386, i486) with
+ VGA-compatible graphics:
+
+ <STRONG>o</STRONG> COLOR_YELLOW is actually brown. To get yellow, use COLOR_YELLOW
+ combined with the <STRONG>A_BOLD</STRONG> attribute.
+
+ <STRONG>o</STRONG> The A_BLINK attribute should in theory cause the background to go
+ bright. This often fails to work, and even some cards for which it
+ mostly works (such as the Paradise and compatibles) do the wrong
+ thing when you try to set a bright "yellow" background (you get a
blinking yellow foreground instead).
<STRONG>o</STRONG> Color RGB values are not settable.
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
- This implementation satisfies XSI Curses's minimum maxi-
- mums for <STRONG>COLORS</STRONG> and <STRONG>COLOR_PAIRS</STRONG>.
+ This implementation satisfies XSI Curses's minimum maximums for <STRONG>COLORS</STRONG>
+ and <STRONG>COLOR_PAIRS</STRONG>.
- The <STRONG>init_pair</STRONG> routine accepts negative values of fore-
- ground and background color to support the <STRONG>use_de-</STRONG>
- <STRONG><A HREF="use_default_colors.3x.html">fault_colors(3x)</A></STRONG> extension, but only if that routine has
- been first invoked.
+ The <STRONG>init_pair</STRONG> routine accepts negative values of foreground and back-
+ ground color to support the <STRONG><A HREF="default_colors.3x.html">use_default_colors(3x)</A></STRONG> extension, but only
+ if that routine has been first invoked.
- The assumption that <STRONG>COLOR_BLACK</STRONG> is the default background
- color for all terminals can be modified using the <STRONG>as-</STRONG>
- <STRONG><A HREF="assume_default_colors.3x.html">sume_default_colors(3x)</A></STRONG> extension.
+ The assumption that <STRONG>COLOR_BLACK</STRONG> is the default background color for all
+ terminals can be modified using the <STRONG><A HREF="default_colors.3x.html">assume_default_colors(3x)</A></STRONG> exten-
+ sion.
- This implementation checks the pointers, e.g., for the
- values returned by <STRONG>color_content</STRONG> and <STRONG>pair_content</STRONG>, and
- will treat those as optional parameters when null.
+ This implementation checks the pointers, e.g., for the values returned
+ by <STRONG>color_content</STRONG> and <STRONG>pair_content</STRONG>, and will treat those as optional pa-
+ rameters when null.
- X/Open Curses does not specify a limit for the number of
- colors and color pairs which a terminal can support. How-
- ever, in its use of <STRONG>short</STRONG> for the parameters, it carries
- over SVr4's implementation detail for the compiled termin-
- fo database, which uses signed 16-bit numbers. This im-
- plementation provides extended versions of those functions
- which use <STRONG>short</STRONG> parameters, allowing applications to use
- larger color- and pair-numbers.
+ X/Open Curses does not specify a limit for the number of colors and
+ color pairs which a terminal can support. However, in its use of <STRONG>short</STRONG>
+ for the parameters, it carries over SVr4's implementation detail for
+ the compiled terminfo database, which uses signed 16-bit numbers. This
+ implementation provides extended versions of those functions which use
+ <STRONG>short</STRONG> parameters, allowing applications to use larger color- and pair-
+ numbers.
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
- <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3x)</A></STRONG>, <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>, <STRONG>curs_vari-</STRONG>
- <STRONG><A HREF="curs_variables.3x.html">ables(3x)</A></STRONG>, <STRONG><A HREF="default_colors.3x.html">default_colors(3x)</A></STRONG>
+ <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3x)</A></STRONG>, <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>, <STRONG>de-</STRONG>
+ <STRONG><A HREF="default_colors.3x.html">fault_colors(3x)</A></STRONG>
- <STRONG><A HREF="curs_color.3x.html">curs_color(3x)</A></STRONG>
+ <STRONG><A HREF="curs_color.3x.html">curs_color(3x)</A></STRONG>
</PRE>
<div class="nav">
<ul>
<BODY>
<H1 class="no-header">curs_delch 3x</H1>
<PRE>
-<STRONG><A HREF="curs_delch.3x.html">curs_delch(3x)</A></STRONG> <STRONG><A HREF="curs_delch.3x.html">curs_delch(3x)</A></STRONG>
+<STRONG><A HREF="curs_delch.3x.html">curs_delch(3x)</A></STRONG> <STRONG><A HREF="curs_delch.3x.html">curs_delch(3x)</A></STRONG>
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
- <STRONG>delch</STRONG>, <STRONG>wdelch</STRONG>, <STRONG>mvdelch</STRONG>, <STRONG>mvwdelch</STRONG> - delete character under
- the cursor in a <STRONG>curses</STRONG> window
+ <STRONG>delch</STRONG>, <STRONG>wdelch</STRONG>, <STRONG>mvdelch</STRONG>, <STRONG>mvwdelch</STRONG> - delete character under the cursor in
+ a <STRONG>curses</STRONG> window
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
- These routines delete the character under the cursor; all
- characters to the right of the cursor on the same line are
- moved to the left one position and the last character on
- the line is filled with a blank. The cursor position does
- not change (after moving to <EM>y</EM>, <EM>x</EM>, if specified). (This
- does not imply use of the hardware delete character fea-
+ These routines delete the character under the cursor; all characters to
+ the right of the cursor on the same line are moved to the left one
+ position and the last character on the line is filled with a blank.
+ The cursor position does not change (after moving to <EM>y</EM>, <EM>x</EM>, if speci-
+ fied). (This does not imply use of the hardware delete character fea-
ture.)
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
- All routines return the integer <STRONG>ERR</STRONG> upon failure and an <STRONG>OK</STRONG>
- (SVr4 specifies only "an integer value other than <STRONG>ERR</STRONG>")
- upon successful completion.
+ All routines return the integer <STRONG>ERR</STRONG> upon failure and an <STRONG>OK</STRONG> (SVr4 speci-
+ fies only "an integer value other than <STRONG>ERR</STRONG>") upon successful comple-
+ tion.
- Functions with a "mv" prefix first perform a cursor move-
- ment using <STRONG>wmove</STRONG>, and return an error if the position is
- outside the window, or if the window pointer is null.
+ Functions with a "mv" prefix first perform a cursor movement using
+ <STRONG>wmove</STRONG>, and return an error if the position is outside the window, or if
+ the window pointer is null.
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
- These functions are described in the XSI Curses standard,
- Issue 4. The standard specifies that they return <STRONG>ERR</STRONG> on
- failure, but specifies no error conditions.
+ These functions are described in the XSI Curses standard, Issue 4. The
+ standard specifies that they return <STRONG>ERR</STRONG> on failure, but specifies no
+ error conditions.
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
- <STRONG><A HREF="curs_delch.3x.html">curs_delch(3x)</A></STRONG>
+ <STRONG><A HREF="curs_delch.3x.html">curs_delch(3x)</A></STRONG>
</PRE>
<div class="nav">
<ul>
<BODY>
<H1 class="no-header">curs_deleteln 3x</H1>
<PRE>
-<STRONG><A HREF="curs_deleteln.3x.html">curs_deleteln(3x)</A></STRONG> <STRONG><A HREF="curs_deleteln.3x.html">curs_deleteln(3x)</A></STRONG>
+<STRONG><A HREF="curs_deleteln.3x.html">curs_deleteln(3x)</A></STRONG> <STRONG><A HREF="curs_deleteln.3x.html">curs_deleteln(3x)</A></STRONG>
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
- <STRONG>deleteln</STRONG>, <STRONG>wdeleteln</STRONG>, <STRONG>insdelln</STRONG>, <STRONG>winsdelln</STRONG>, <STRONG>insertln</STRONG>, <STRONG>win-</STRONG>
- <STRONG>sertln</STRONG> - delete and insert lines in a <STRONG>curses</STRONG> window
+ <STRONG>deleteln</STRONG>, <STRONG>wdeleteln</STRONG>, <STRONG>insdelln</STRONG>, <STRONG>winsdelln</STRONG>, <STRONG>insertln</STRONG>, <STRONG>winsertln</STRONG> - delete
+ and insert lines in a <STRONG>curses</STRONG> window
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
- The <STRONG>deleteln</STRONG> and <STRONG>wdeleteln</STRONG> routines delete the line under
- the cursor in the window; all lines below the current line
- are moved up one line. The bottom line of the window is
- cleared. The cursor position does not change.
-
- The <STRONG>insdelln</STRONG> and <STRONG>winsdelln</STRONG> routines, for positive <EM>n</EM>,
- insert <EM>n</EM> lines into the specified window above the current
- line. The <EM>n</EM> bottom lines are lost. For negative <EM>n</EM>,
- delete <EM>n</EM> lines (starting with the one under the cursor),
- and move the remaining lines up. The bottom <EM>n</EM> lines are
+ The <STRONG>deleteln</STRONG> and <STRONG>wdeleteln</STRONG> routines delete the line under the cursor in
+ the window; all lines below the current line are moved up one line.
+ The bottom line of the window is cleared. The cursor position does not
+ change.
+
+ The <STRONG>insdelln</STRONG> and <STRONG>winsdelln</STRONG> routines, for positive <EM>n</EM>, insert <EM>n</EM> lines
+ into the specified window above the current line. The <EM>n</EM> bottom lines
+ are lost. For negative <EM>n</EM>, delete <EM>n</EM> lines (starting with the one under
+ the cursor), and move the remaining lines up. The bottom <EM>n</EM> lines are
cleared. The current cursor position remains the same.
- The <STRONG>insertln</STRONG> and <STRONG>winsertln</STRONG> routines insert a blank line
- above the current line and the bottom line is lost.
+ The <STRONG>insertln</STRONG> and <STRONG>winsertln</STRONG> routines insert a blank line above the cur-
+ rent line and the bottom line is lost.
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
- All routines return the integer <STRONG>ERR</STRONG> upon failure and an <STRONG>OK</STRONG>
- (SVr4 specifies only "an integer value other than <STRONG>ERR</STRONG>")
- upon successful completion.
+ All routines return the integer <STRONG>ERR</STRONG> upon failure and an <STRONG>OK</STRONG> (SVr4 speci-
+ fies only "an integer value other than <STRONG>ERR</STRONG>") upon successful comple-
+ tion.
- X/Open defines no error conditions. In this implementa-
- tion, if the window parameter is null, an error is
- returned.
+ X/Open defines no error conditions. In this implementation, if the
+ window parameter is null, an error is returned.
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
- These functions are described in the XSI Curses standard,
- Issue 4. The standard specifies that they return <STRONG>ERR</STRONG> on
- failure, but specifies no error conditions.
+ These functions are described in the XSI Curses standard, Issue 4. The
+ standard specifies that they return <STRONG>ERR</STRONG> on failure, but specifies no
+ error conditions.
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
Note that all but <STRONG>winsdelln</STRONG> may be macros.
- These routines do not require a hardware line delete or
- insert feature in the terminal. In fact, they will not
- use hardware line delete/insert unless <STRONG>idlok(...,</STRONG> <STRONG>TRUE)</STRONG>
- has been set on the current window.
+ These routines do not require a hardware line delete or insert feature
+ in the terminal. In fact, they will not use hardware line
+ delete/insert unless <STRONG>idlok(...,</STRONG> <STRONG>TRUE)</STRONG> has been set on the current win-
+ dow.
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
- <STRONG><A HREF="curs_deleteln.3x.html">curs_deleteln(3x)</A></STRONG>
+ <STRONG><A HREF="curs_deleteln.3x.html">curs_deleteln(3x)</A></STRONG>
</PRE>
<div class="nav">
<ul>
<BODY>
<H1 class="no-header">curs_extend 3x</H1>
<PRE>
-<STRONG><A HREF="curs_extend.3x.html">curs_extend(3x)</A></STRONG> <STRONG><A HREF="curs_extend.3x.html">curs_extend(3x)</A></STRONG>
+<STRONG><A HREF="curs_extend.3x.html">curs_extend(3x)</A></STRONG> <STRONG><A HREF="curs_extend.3x.html">curs_extend(3x)</A></STRONG>
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
- <STRONG>curses_version</STRONG>, <STRONG>use_extended_names</STRONG> - miscellaneous curses
- extensions
+ <STRONG>curses_version</STRONG>, <STRONG>use_extended_names</STRONG> - miscellaneous curses extensions
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
- These functions are extensions to the curses library which
- do not fit easily into other categories.
+ These functions are extensions to the curses library which do not fit
+ easily into other categories.
</PRE><H3><a name="h3-curses_version">curses_version</a></H3><PRE>
- Use <STRONG>curses_version</STRONG> to get the version number, including
- patch level of the library, e.g., <STRONG>5.0.19991023</STRONG>
+ Use <STRONG>curses_version</STRONG> to get the version number, including patch level of
+ the library, e.g., <STRONG>5.0.19991023</STRONG>
</PRE><H3><a name="h3-use_extended_names">use_extended_names</a></H3><PRE>
- The <STRONG>use_extended_names</STRONG> function controls whether the call-
- ing application is able to use user-defined or nonstandard
- names which may be compiled into the terminfo description,
- i.e., via the terminfo or termcap interfaces. Normally
- these names are available for use, since the essential
- decision is made by using the <STRONG>-x</STRONG> option of <STRONG>tic</STRONG> to compile
- extended terminal definitions. However you can disable
- this feature to ensure compatibility with other implemen-
- tations of curses.
+ The <STRONG>use_extended_names</STRONG> function controls whether the calling applica-
+ tion is able to use user-defined or nonstandard names which may be com-
+ piled into the terminfo description, i.e., via the terminfo or termcap
+ interfaces. Normally these names are available for use, since the
+ essential decision is made by using the <STRONG>-x</STRONG> option of <STRONG>tic</STRONG> to compile
+ extended terminal definitions. However you can disable this feature to
+ ensure compatibility with other implementations of curses.
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
- <STRONG>curses_version</STRONG> returns a pointer to static memory; you
- should not free this in your application.
+ <STRONG>curses_version</STRONG> returns a pointer to static memory; you should not free
+ this in your application.
- <STRONG>use_extended_names</STRONG> returns the previous state, allowing
- you to save this and restore it.
+ <STRONG>use_extended_names</STRONG> returns the previous state, allowing you to save
+ this and restore it.
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
- These routines are specific to ncurses. They were not
- supported on Version 7, BSD or System V implementations.
- It is recommended that any code depending on them be con-
- ditioned using NCURSES_VERSION.
+ These routines are specific to ncurses. They were not supported on
+ Version 7, BSD or System V implementations. It is recommended that any
+ code depending on them be conditioned using NCURSES_VERSION.
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
- <STRONG><A HREF="curs_getch.3x.html">curs_getch(3x)</A></STRONG>, <STRONG><A HREF="curs_mouse.3x.html">curs_mouse(3x)</A></STRONG>, <STRONG><A HREF="curs_print.3x.html">curs_print(3x)</A></STRONG>,
- <STRONG><A HREF="curs_util.3x.html">curs_util(3x)</A></STRONG>, <STRONG><A HREF="default_colors.3x.html">default_colors(3x)</A></STRONG>, <STRONG><A HREF="define_key.3x.html">define_key(3x)</A></STRONG>, <STRONG>key-</STRONG>
- <STRONG><A HREF="keybound.3x.html">bound(3x)</A></STRONG>, <STRONG><A HREF="keyok.3x.html">keyok(3x)</A></STRONG>, <STRONG><A HREF="resizeterm.3x.html">resizeterm(3x)</A></STRONG>, <STRONG><A HREF="wresize.3x.html">wresize(3x)</A></STRONG>.
+ <STRONG><A HREF="curs_getch.3x.html">curs_getch(3x)</A></STRONG>, <STRONG><A HREF="curs_mouse.3x.html">curs_mouse(3x)</A></STRONG>, <STRONG><A HREF="curs_print.3x.html">curs_print(3x)</A></STRONG>, <STRONG><A HREF="curs_util.3x.html">curs_util(3x)</A></STRONG>,
+ <STRONG><A HREF="default_colors.3x.html">default_colors(3x)</A></STRONG>, <STRONG><A HREF="define_key.3x.html">define_key(3x)</A></STRONG>, <STRONG><A HREF="keybound.3x.html">keybound(3x)</A></STRONG>, <STRONG><A HREF="keyok.3x.html">keyok(3x)</A></STRONG>,
+ <STRONG><A HREF="resizeterm.3x.html">resizeterm(3x)</A></STRONG>, <STRONG><A HREF="wresize.3x.html">wresize(3x)</A></STRONG>.
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
- <STRONG><A HREF="curs_extend.3x.html">curs_extend(3x)</A></STRONG>
+ <STRONG><A HREF="curs_extend.3x.html">curs_extend(3x)</A></STRONG>
</PRE>
<div class="nav">
<ul>
<BODY>
<H1 class="no-header">curs_get_wch 3x</H1>
<PRE>
-<STRONG><A HREF="curs_get_wch.3x.html">curs_get_wch(3x)</A></STRONG> <STRONG><A HREF="curs_get_wch.3x.html">curs_get_wch(3x)</A></STRONG>
+<STRONG><A HREF="curs_get_wch.3x.html">curs_get_wch(3x)</A></STRONG> <STRONG><A HREF="curs_get_wch.3x.html">curs_get_wch(3x)</A></STRONG>
</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
- <STRONG>get_wch</STRONG>, <STRONG>wget_wch</STRONG>, <STRONG>mvget_wch</STRONG>, <STRONG>mvwget_wch</STRONG>, <STRONG>unget_wch</STRONG> - get
- (or push back) a wide character from curses terminal
- keyboard
+ <STRONG>get_wch</STRONG>, <STRONG>wget_wch</STRONG>, <STRONG>mvget_wch</STRONG>, <STRONG>mvwget_wch</STRONG>, <STRONG>unget_wch</STRONG> - get (or push
+ back) a wide character from curses terminal keyboard
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
- The <STRONG>get_wch</STRONG>, <STRONG>wget_wch</STRONG>, <STRONG>mvget_wch</STRONG>, and <STRONG>mvwget_wch</STRONG> functions
- read a character from the terminal associated with the
- current or specified window. In no-delay mode, if no in-
- put is waiting, the value <STRONG>ERR</STRONG> is returned. In delay mode,
- the program waits until the system passes text through to
- the program. Depending on the setting of <STRONG>cbreak</STRONG>, this is
- after one character (cbreak mode), or after the first new-
- line (nocbreak mode). In half-delay mode, the program
- waits until the user types a character or the specified
- timeout interval has elapsed.
-
- Unless <STRONG>noecho</STRONG> has been set, these routines echo the char-
- acter into the designated window.
-
- If the window is not a pad and has been moved or modified
- since the last call to <STRONG>wrefresh</STRONG>, <STRONG>wrefresh</STRONG> will be called
- before another character is read.
-
- If <STRONG>keypad</STRONG> is enabled, these functions respond to the
- pressing of a function key by setting the object pointed
- to by <EM>wch</EM> to the keycode assigned to the function key, and
- returning <STRONG>KEY_CODE_YES</STRONG>. If a character (such as escape)
- that could be the beginning of a function key is received,
- curses sets a timer. If the remainder of the sequence
- does arrive within the designated time, curses passes
- through the character; otherwise, curses returns the func-
- tion key value. For this reason, many terminals experi-
- ence a delay between the time a user presses the escape
- key and the time the escape is returned to the program.
-
- The keycodes returned by these functions are the same as
- those returned by <STRONG>wgetch</STRONG>:
-
- <STRONG>o</STRONG> The predefined function keys are listed in <STRONG><curses.h></STRONG>
- as macros with values outside the range of 8-bit char-
- acters. Their names begin with <STRONG>KEY_</STRONG>.
-
- <STRONG>o</STRONG> Other (user-defined) function keys which may be de-
- fined using <STRONG><A HREF="define_key.3x.html">define_key(3x)</A></STRONG> have no names, but also are
- expected to have values outside the range of 8-bit
- characters.
-
- The <STRONG>unget_wch</STRONG> function pushes the wide character <EM>wch</EM> back
- onto the head of the input queue, so the wide character is
- returned by the next call to <STRONG>get_wch</STRONG>. The pushback of one
- character is guaranteed. If the program calls <STRONG>unget_wch</STRONG>
- too many times without an intervening call to <STRONG>get_wch</STRONG>, the
- operation may fail.
+ The <STRONG>get_wch</STRONG>, <STRONG>wget_wch</STRONG>, <STRONG>mvget_wch</STRONG>, and <STRONG>mvwget_wch</STRONG> functions read a char-
+ acter from the terminal associated with the current or specified win-
+ dow. In no-delay mode, if no input is waiting, the value <STRONG>ERR</STRONG> is re-
+ turned. In delay mode, the program waits until the system passes text
+ through to the program. Depending on the setting of <STRONG>cbreak</STRONG>, this is
+ after one character (cbreak mode), or after the first newline (nocbreak
+ mode). In half-delay mode, the program waits until the user types a
+ character or the specified timeout interval has elapsed.
+
+ Unless <STRONG>noecho</STRONG> has been set, these routines echo the character into the
+ designated window.
+
+ If the window is not a pad and has been moved or modified since the
+ last call to <STRONG>wrefresh</STRONG>, <STRONG>wrefresh</STRONG> will be called before another character
+ is read.
+
+ If <STRONG>keypad</STRONG> is enabled, these functions respond to the pressing of a
+ function key by setting the object pointed to by <EM>wch</EM> to the keycode as-
+ signed to the function key, and returning <STRONG>KEY_CODE_YES</STRONG>. If a character
+ (such as escape) that could be the beginning of a function key is re-
+ ceived, curses sets a timer. If the remainder of the sequence does ar-
+ rive within the designated time, curses passes through the character;
+ otherwise, curses returns the function key value. For this reason,
+ many terminals experience a delay between the time a user presses the
+ escape key and the time the escape is returned to the program.
+
+ The keycodes returned by these functions are the same as those returned
+ by <STRONG>wgetch</STRONG>:
+
+ <STRONG>o</STRONG> The predefined function keys are listed in <STRONG><curses.h></STRONG> as macros
+ with values outside the range of 8-bit characters. Their names be-
+ gin with <STRONG>KEY_</STRONG>.
+
+ <STRONG>o</STRONG> Other (user-defined) function keys which may be defined using <STRONG>de-</STRONG>
+ <STRONG><A HREF="define_key.3x.html">fine_key(3x)</A></STRONG> have no names, but also are expected to have values
+ outside the range of 8-bit characters.
+
+ The <STRONG>unget_wch</STRONG> function pushes the wide character <EM>wch</EM> back onto the head
+ of the input queue, so the wide character is returned by the next call
+ to <STRONG>get_wch</STRONG>. The pushback of one character is guaranteed. If the pro-
+ gram calls <STRONG>unget_wch</STRONG> too many times