Added Gnu termcap 1.3.1

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7722 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2004-06-01 09:30:19 +00:00
parent d4266f2d0b
commit 5a42e3e556
24 changed files with 45680 additions and 0 deletions

View File

@ -3,3 +3,4 @@ SubDir OBOS_TOP src libs ;
SubInclude OBOS_TOP src libs freetype2 ;
SubInclude OBOS_TOP src libs zlib ;
SubInclude OBOS_TOP src libs png ;
SubInclude OBOS_TOP src libs termcap ;

340
src/libs/termcap/COPYING Normal file
View File

@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

180
src/libs/termcap/ChangeLog Normal file
View File

@ -0,0 +1,180 @@
2002-02-25 Gary Wong <gtw@gnu.org>
* version.c: Version 1.3.1.
* configure.in: Update obselete macros.
* termcap.src: Regenerated from version 11.0.1 master file.
* tparam.c [!emacs]: Move #define of bcopy to after
#include <string.h>. Reported by Oleg Kornilov and Iyer Viswanathan.
* termcap.c [!emacs]: Replace ospeed for building standalone
libtermcap, for binary compatibility.
2001-05-28 Gerd Moellmann <gerd@gnu.org>
* termcap.c (speeds): Put in #if 0.
2000-12-08 Gerd Moellmann <gerd@gnu.org>
* tparam.c (tparam1): Change the way buffers are reallocated to be
portable and less obfuscated.
* termcap.c (tgetent): Change the way buffers are reallocated to
be portable and less obfuscated.
2000-11-19 Gerd Moellmann <gerd@gnu.org>
* termcap.c (ospeed): Remove.
(tputs) [!emacs]: Remove unused code.
(tgetent): Avoid a compiler warning.
2000-06-20 Dave Love <fx@gnu.org>
* tparam.c [emacs]: Include lisp.h.
* termcap.c [emacs]: Test HAVE_FCNTL_H, not USG5. Include lisp.h
and unistd.h.
2000-04-13 Gerd Moellmann <gerd@gnu.org>
* tparam.c (tparam1): Abort when encountering an unknown `%'-specifier.
Wed Aug 16 20:45:44 1995 David J. MacKenzie <djm@geech.gnu.ai.mit.edu>
* version.c: Version 1.3.
* termcap.c (tgetent): Use the user-supplied buffer even if we
don't find a matching terminal, so the program can set the buffer
if they want (`less' does this). From Bob Pegram
<pegram@emba.uvm.edu>.
Wed Jul 26 11:44:51 1995 David J. MacKenzie <djm@geech.gnu.ai.mit.edu>
* termcap.c: TERMCAP_NAME -> TERMCAP_FILE.
* configure.in: Add --enable-install-termcap and --with-termcap
options.
* Makefile.in: Add hooks for new configure options.
* Makefile.in (DISTFILES): Add termcap.src.
(DEFS): Remove -DNO_ARG_ARRAY.
(install-data, uninstall-data): New targets.
* tparam.c (tparam): Remove arg array version and the #ifdef.
* termcap.c: Move #define of bcopy to after #include <string.h>.
* termcap.h: Prototype the arg to the tputs outfun arg.
* Makefile.in: realclean -> maintainer-clean. Use @prefix@ and
@exec_prefix@.
* Makefile.in (DISTFILES): Add install-sh.
Fri Apr 7 14:57:45 1995 Richard Stallman <rms@mole.gnu.ai.mit.edu>
* termcap.c (tgetent): Don't try to return the allocated address.
Always return 1 if successful.
Tue Feb 14 02:34:43 1995 Richard Stallman <rms@pogo.gnu.ai.mit.edu>
* termcap.c (speeds): Make it ints. Add some higher speeds.
(tputs) [emacs]: If speed is high, convert to smaller units.
(tputs): Really use SPEED to calculate PADCOUNT.
Sat Dec 17 07:20:24 1994 Richard Stallman <rms@mole.gnu.ai.mit.edu>
* termcap.c (tgetst1): Let ^? stand for DEL character.
Thu Jun 30 04:35:50 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
* configure.in: Use AC_HAVE_HEADERS instead of AC_UNISTD_H.
Add AC_PROG_RANLIB.
* Makefile.in (AR, RANLIB): New variables.
(install, libtermcap.a): Use them instead of hard-wired commands.
Sat Jun 4 12:21:41 1994 Roland McGrath (roland@geech.gnu.ai.mit.edu)
* termcap.c [HAVE_CONFIG_H]: Include <sys/file.h>, and include
<fcntl.h> #ifdef USG5, so we get O_* defns.
Wed May 25 19:05:30 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
* termcap.c (O_RDONLY): Define to 0 if not already defined.
(tgetent): Use O_RDONLY instead of explicit 0 in call to open.
Wed Jan 5 22:20:15 1993 Morten Welinder (terra@diku.dk)
* termcap.c (tgetent) [INTERNAL_TERMINAL]: Fake internal terminal
without reading any files.
(valid_file_name, tgetent) [MSDOS]: Drive letter support.
(tgetent) [MSDOS]: Use text mode for database.
Fri Dec 17 00:22:43 1993 Mike Long (mike.long@analog.com)
* termcap.c (tgetent): Replaced literal filenames for termcap
database with preprocessor symbol TERMCAP_NAME.
(TERMCAP_NAME): Define if not defined.
Fri Sep 10 00:35:07 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
* Makefile.in (.c.o): Put -I. before -I$(srcdir).
* termcap.c: Include <config.h> instead of "config.h".
* tparam.c: Likewise.
Thu Jul 29 20:53:30 1993 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu)
* Makefile.in (config.status): Run config.status --recheck, not
configure, to get the right args passed.
Thu Apr 15 12:45:10 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
* Version 1.2.
* tparam.c [!emacs] (xmalloc, xrealloc, memory_out): New functions.
(tparam1): Use them.
* termcap.c, tparam.c: Use NULL or '\0' where appropriate
instead of 0. Rename some vars.
* termcap.c (tgetent): If EOF is reached on termcap file,
free allocated resources before returning.
* termcap.c (tgetent): Use /etc/termcap if TERMCAP is an entry
for a term type other than TERM.
From pjr@jet.UK (Paul J Rippin).
Sat Apr 10 23:55:12 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu)
* tparam.c (tparam1): Don't set the 0200 bit on a non-0 character code.
From junio@twinsun.COM (Junio Hamano).
Tue Dec 8 22:02:15 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
* termcap.c, tparam.c: Use HAVE_STRING_H instead of USG.
Thu Dec 3 13:47:56 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
* termcap.c, tparam.c [HAVE_CONFIG_H]: Include config.h.
Fri Oct 23 12:35:29 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
* termcap.h [__STDC__]: Add consts. From Franc,ois Pinard.
Tue Oct 13 15:52:21 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
* Version 1.1.
Tue Sep 29 21:04:39 1992 David J. MacKenzie (djm@geech.gnu.ai.mit.edu)
* termcap.[ch], tparam.c: Fix some lint.
* version.c: New file.
Local Variables:
mode: indented-text
left-margin: 8
version-control: never
End:

183
src/libs/termcap/INSTALL Normal file
View File

@ -0,0 +1,183 @@
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.
The file `configure.in' is used to create `configure' by a program
called `autoconf'. You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
Or on systems that have the `env' program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not supports the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory. After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' can not figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it can not guess the host type, give it the
`--host=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
CPU-COMPANY-SYSTEM
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
If you are building compiler tools for cross-compiling, you can also
use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of
system on which you are compiling the package.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Operation Controls
==================
`configure' recognizes the following options to control how it
operates.
`--cache-file=FILE'
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.
`--help'
Print a summary of the options to `configure', and exit.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--version'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`configure' also accepts some other, not widely useful, options.

14
src/libs/termcap/Jamfile Normal file
View File

@ -0,0 +1,14 @@
SubDir OBOS_TOP src libs termcap ;
# set some additional defines
{
SubDirCcFlags -DHAVE_STRING_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DTERMCAP_FILE=\'\"/etc/termcap\"\' ;
}
StaticLibrary termcap :
termcap.c tparam.c version.c
: STATIC_LIBRARY_DIR
;
MakeLocate termcap : $(OBOS_ETC_DIR) ;
File termcap : termcap.src ;

View File

@ -0,0 +1,138 @@
# Makefile for GNU termcap library.
# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#### Start of system configuration section. ####
srcdir = @srcdir@
VPATH = @srcdir@
CC = @CC@
AR = ar
RANLIB = @RANLIB@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
MAKEINFO = makeinfo
DEFS = @DEFS@ -DTERMCAP_FILE=\"$(termcapfile)\"
CFLAGS = -g
prefix = @prefix@
exec_prefix = @exec_prefix@
# Directory in which to install libtermcap.a.
libdir = $(exec_prefix)/lib
# Directory in which to install termcap.h.
includedir = $(prefix)/include
# Directory in which to optionally also install termcap.h,
# so compilers besides gcc can find it by default.
# If it is empty or not defined, termcap.h will only be installed in
# includedir.
oldincludedir = /usr/include
# Directory in which to install the documentation info files.
infodir = $(prefix)/info
# File to which `install-data' should install the data file
# if --enable-install-termcap was given.
termcapfile = @termcapfile@
#### End of system configuration section. ####
SHELL = /bin/sh
SRCS = termcap.c tparam.c version.c
OBJS = termcap.o tparam.o version.o
HDRS = termcap.h
DISTFILES = $(SRCS) $(HDRS) ChangeLog COPYING README INSTALL NEWS \
termcap.src termcap.texi termcap.info* \
texinfo.tex Makefile.in configure configure.in mkinstalldirs install-sh
all: libtermcap.a info
.c.o:
$(CC) -c $(CPPFLAGS) $(DEFS) -I. -I$(srcdir) $(CFLAGS) $<
install: all installdirs @installdata@
$(INSTALL_DATA) libtermcap.a $(libdir)/libtermcap.a
-$(RANLIB) $(libdir)/libtermcap.a
cd $(srcdir); $(INSTALL_DATA) termcap.h $(includedir)/termcap.h
-cd $(srcdir); test -z "$(oldincludedir)" || \
$(INSTALL_DATA) termcap.h $(oldincludedir)/termcap.h
cd $(srcdir); for f in termcap.info*; \
do $(INSTALL_DATA) $$f $(infodir)/$$f; done
uninstall: @uninstalldata@
rm -f $(libdir)/libtermcap.a $(includedir)/termcap.h
test -z "$(oldincludedir)" || rm -f $(oldincludedir)/termcap.h
rm -f $(infodir)/termcap.info*
# These are separate targets to avoid trashing the user's existing
# termcap file unexpectedly.
install-data:
$(INSTALL_DATA) ${srcdir}/termcap.src ${termcapfile}
uninstall-data:
rm -f ${termcapfile}
installdirs:
$(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(libdir) \
$(includedir) $(infodir)
Makefile: Makefile.in config.status
$(SHELL) config.status
config.status: configure
$(SHELL) config.status --recheck
configure: configure.in
cd $(srcdir) && autoconf
libtermcap.a: $(OBJS)
$(AR) rc $@ $(OBJS)
-$(RANLIB) $@
info: termcap.info
termcap.info: termcap.texi
$(MAKEINFO) $(srcdir)/termcap.texi --output=$@
TAGS: $(SRCS)
etags $(SRCS)
clean:
rm -f *.a *.o core
mostlyclean: clean
distclean: clean
rm -f Makefile config.status config.cache config.log
maintainer-clean: distclean
@echo "This command is intended for maintainers to use;"
@echo "rebuilding the deleted files requires makeinfo."
rm -f TAGS *.info*
dist: $(DISTFILES)
echo termcap-`sed -e '/version_string/!d' -e 's/[^0-9]*\([0-9a-z.]*\).*/\1/' -e q version.c` > .fname
rm -rf `cat .fname`
mkdir `cat .fname`
ln $(DISTFILES) `cat .fname`
tar chzf `cat .fname`.tar.gz `cat .fname`
rm -rf `cat .fname` .fname

25
src/libs/termcap/NEWS Normal file
View File

@ -0,0 +1,25 @@
Major changes in release 1.3.1:
Termcap data file updated.
Bug fixes and portability changes.
Major changes in release 1.3:
Termcap data file is now included in distribution and may optionally
be installed, or used in a non-default location.
Support for a fake internal terminal (no external files).
Higher tty speeds supported.
Portability tweaks.
Major changes in release 1.2:
For `%.', only set the high bit on NUL.
Fix a file descriptor and memory leak.
Add const in termcap.h prototypes.
Configuration improvements.
Major changes in release 1.1:
Fix portability problems.
Improve configuration and installation.
Fix compiler warnings.

34
src/libs/termcap/README Normal file
View File

@ -0,0 +1,34 @@
This is the GNU termcap library -- a library of C functions that
enable programs to send control strings to terminals in a way
independent of the terminal type. The GNU termcap library does not
place an arbitrary limit on the size of termcap entries, unlike most
other termcap libraries.
Most of this package is also distributed with GNU Emacs, but it is
available in this separate distribution to make it easier to install
as -ltermcap. However, use of termcap is discouraged. Termcap is
being phased out in favor of the terminfo-based ncurses library, which
contains an emulation of the termcap library routines in addition to
an excellent curses implementation. ncurses is available from the
usual GNU archive sites.
See the file INSTALL for compilation and installation instructions.
Additionally:
This package contains termcap.src, the latest official termcap data
file. By default, it is not installed. The current version contains
some entries that are more than 1023 bytes long, which is the largest
value that is safe to use with the many historical applications that
only allocate a 1024 byte termcap buffer (telnet, for example). If
you make sure that all of your programs allocate buffers of at least
2500 bytes, or let the termcap library do it by passing a NULL
pointer, then it is safe to install the new termcap file, as described
below.
You can give configure two special options:
--enable-install-termcap install the termcap data file
--with-termcap=FILE use data file FILE instead of /etc/termcap
Please report any bugs in this library to bug-gnu-emacs@prep.ai.mit.edu.
You can check which version of the library you have by using the RCS
`ident' command on libtermcap.a.

998
src/libs/termcap/configure vendored Normal file
View File

@ -0,0 +1,998 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version 2.4
# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
# Defaults:
ac_help=
ac_default_prefix=/usr/local
# Any additions from configure.in:
ac_help="$ac_help
--enable-install-termcap install the termcap data file"
ac_help="$ac_help
--with-termcap=FILE use data file FILE instead of /etc/termcap"
# Initialize some variables set by options.
# The variables have the same names as the options, with
# dashes changed to underlines.
build=NONE
cache_file=./config.cache
exec_prefix=NONE
host=NONE
no_create=
nonopt=NONE
no_recursion=
prefix=NONE
program_prefix=NONE
program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
srcdir=
target=NONE
verbose=
x_includes=NONE
x_libraries=NONE
# Initialize some other variables.
subdirs=
ac_prev=
for ac_option
do
# If the previous option needs an argument, assign it.
if test -n "$ac_prev"; then
eval "$ac_prev=\$ac_option"
ac_prev=
continue
fi
case "$ac_option" in
-*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) ac_optarg= ;;
esac
# Accept the important Cygnus configure options, so we can diagnose typos.
case "$ac_option" in
-build | --build | --buil | --bui | --bu | --b)
ac_prev=build ;;
-build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*)
build="$ac_optarg" ;;
-cache-file | --cache-file | --cache-fil | --cache-fi \
| --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
ac_prev=cache_file ;;
-cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
| --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
cache_file="$ac_optarg" ;;
-disable-* | --disable-*)
ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
# Reject names that are not valid shell variable names.
if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
{ echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
fi
ac_feature=`echo $ac_feature| sed 's/-/_/g'`
eval "enable_${ac_feature}=no" ;;
-enable-* | --enable-*)
ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
# Reject names that are not valid shell variable names.
if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
{ echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
fi
ac_feature=`echo $ac_feature| sed 's/-/_/g'`
case "$ac_option" in
*=*) ;;
*) ac_optarg=yes ;;
esac
eval "enable_${ac_feature}='$ac_optarg'" ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
| --exec | --exe | --ex)
ac_prev=exec_prefix ;;
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
| --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
| --exec=* | --exe=* | --ex=*)
exec_prefix="$ac_optarg" ;;
-gas | --gas | --ga | --g)
# Obsolete; use --with-gas.
with_gas=yes ;;
-help | --help | --hel | --he)
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat << EOF
Usage: configure [options] [host]
Options: [defaults in brackets after descriptions]
Configuration:
--cache-file=FILE cache test results in FILE
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
[$ac_default_prefix]
--exec-prefix=PREFIX install architecture-dependent files in PREFIX
[same as prefix]
--srcdir=DIR find the sources in DIR [configure dir or ..]
--program-prefix=PREFIX prepend PREFIX to installed program names
--program-suffix=SUFFIX append SUFFIX to installed program names
--program-transform-name=PROGRAM run sed PROGRAM on installed program names
Host type:
--build=BUILD configure for building on BUILD [BUILD=HOST]
--host=HOST configure for HOST [guessed]
--target=TARGET configure for TARGET [TARGET=HOST]
Features and packages:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--x-includes=DIR X include files are in DIR
--x-libraries=DIR X library files are in DIR
--enable and --with options recognized:$ac_help
EOF
exit 0 ;;
-host | --host | --hos | --ho)
ac_prev=host ;;
-host=* | --host=* | --hos=* | --ho=*)
host="$ac_optarg" ;;
-nfp | --nfp | --nf)
# Obsolete; use --without-fp.
with_fp=no ;;
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
| --no-cr | --no-c)
no_create=yes ;;
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
no_recursion=yes ;;
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
ac_prev=prefix ;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
prefix="$ac_optarg" ;;
-program-prefix | --program-prefix | --program-prefi | --program-pref \
| --program-pre | --program-pr | --program-p)
ac_prev=program_prefix ;;
-program-prefix=* | --program-prefix=* | --program-prefi=* \
| --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
program_prefix="$ac_optarg" ;;
-program-suffix | --program-suffix | --program-suffi | --program-suff \
| --program-suf | --program-su | --program-s)
ac_prev=program_suffix ;;
-program-suffix=* | --program-suffix=* | --program-suffi=* \
| --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
program_suffix="$ac_optarg" ;;
-program-transform-name | --program-transform-name \
| --program-transform-nam | --program-transform-na \
| --program-transform-n | --program-transform- \
| --program-transform | --program-transfor \
| --program-transfo | --program-transf \
| --program-trans | --program-tran \
| --progr-tra | --program-tr | --program-t)
ac_prev=program_transform_name ;;
-program-transform-name=* | --program-transform-name=* \
| --program-transform-nam=* | --program-transform-na=* \
| --program-transform-n=* | --program-transform-=* \
| --program-transform=* | --program-transfor=* \
| --program-transfo=* | --program-transf=* \
| --program-trans=* | --program-tran=* \
| --progr-tra=* | --program-tr=* | --program-t=*)
program_transform_name="$ac_optarg" ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-site | --site | --sit)
ac_prev=site ;;
-site=* | --site=* | --sit=*)
site="$ac_optarg" ;;
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
srcdir="$ac_optarg" ;;
-target | --target | --targe | --targ | --tar | --ta | --t)
ac_prev=target ;;
-target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
target="$ac_optarg" ;;
-v | -verbose | --verbose | --verbos | --verbo | --verb)
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
echo "configure generated by autoconf version 2.4"
exit 0 ;;
-with-* | --with-*)
ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
# Reject names that are not valid shell variable names.
if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
{ echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
fi
ac_package=`echo $ac_package| sed 's/-/_/g'`
case "$ac_option" in
*=*) ;;
*) ac_optarg=yes ;;
esac
eval "with_${ac_package}='$ac_optarg'" ;;
-without-* | --without-*)
ac_package=`echo $ac_option|sed -e 's/-*without-//'`
# Reject names that are not valid shell variable names.
if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
{ echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
fi
ac_package=`echo $ac_package| sed 's/-/_/g'`
eval "with_${ac_package}=no" ;;
--x)
# Obsolete; use --with-x.
with_x=yes ;;
-x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
| --x-incl | --x-inc | --x-in | --x-i)
ac_prev=x_includes ;;
-x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
| --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
x_includes="$ac_optarg" ;;
-x-libraries | --x-libraries | --x-librarie | --x-librari \
| --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
ac_prev=x_libraries ;;
-x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
x_libraries="$ac_optarg" ;;
-*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
;;
*)
if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
echo "configure: warning: $ac_option: invalid host type" 1>&2
fi
if test "x$nonopt" != xNONE; then
{ echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
fi
nonopt="$ac_option"
;;
esac
done
if test -n "$ac_prev"; then
{ echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
fi
trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
# File descriptor usage:
# 0 standard input
# 1 file creation
# 2 errors and warnings
# 3 some systems may open it to /dev/tty
# 4 used on the Kubota Titan
# 6 checking for... messages and results
# 5 compiler messages saved in config.log
if test "$silent" = yes; then
exec 6>/dev/null
else
exec 6>&1
fi
exec 5>./config.log
echo "\
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
" 1>&5
# Strip out --no-create and --no-recursion so they do not pile up.
# Also quote any args containing shell metacharacters.
ac_configure_args=
for ac_arg
do
case "$ac_arg" in
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
| --no-cr | --no-c) ;;
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
*" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
ac_configure_args="$ac_configure_args '$ac_arg'" ;;
*) ac_configure_args="$ac_configure_args $ac_arg" ;;
esac
done
# NLS nuisances.
# Only set LANG and LC_ALL to C if already set.
# These must not be set unconditionally because not all systems understand
# e.g. LANG=C (notably SCO).
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
if test "${LANG+set}" = set; then LANG=C; export LANG; fi
# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -rf conftest* confdefs.h
# AIX cpp loses on an empty file, so make sure it contains at least a newline.
echo > confdefs.h
# A filename unique to this package, relative to the directory that
# configure is in, which we can look for to find out if srcdir is correct.
ac_unique_file=termcap.h
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
# Try the directory containing this script, then its parent.
ac_prog=$0
ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
srcdir=$ac_confdir
if test ! -r $srcdir/$ac_unique_file; then
srcdir=..
fi
else
ac_srcdir_defaulted=no
fi
if test ! -r $srcdir/$ac_unique_file; then
if test "$ac_srcdir_defaulted" = yes; then
{ echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
else
{ echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
fi
fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
# Prefer explicitly selected file to automatically selected ones.
if test -z "$CONFIG_SITE"; then
if test "x$prefix" != xNONE; then
CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
else
CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
fi
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
echo "loading site script $ac_site_file"
. "$ac_site_file"
fi
done
if test -r "$cache_file"; then
echo "loading cache $cache_file"
. $cache_file
else
echo "creating cache $cache_file"
> $cache_file
fi
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5 2>&5'
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5 2>&5'
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
ac_n= ac_c='
' ac_t=' '
else
ac_n=-n ac_c= ac_t=
fi
else
ac_n= ac_c='\c' ac_t=
fi
# Check whether --enable-install-termcap or --disable-install-termcap was given.
enableval="$enable_install_termcap"
if test -n "$enableval"; then
if test $enableval = yes; then
installdata=install-data uninstalldata=uninstall-data
fi
fi
# Check whether --with-termcap or --without-termcap was given.
withval="$with_termcap"
if test -n "$withval"; then
termcapfile=$withval
else
termcapfile=/etc/termcap
fi
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_CC="gcc"
break
fi
done
IFS="$ac_save_ifs"
test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="cc"
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
echo "$ac_t""$CC" 1>&6
else
echo "$ac_t""no" 1>&6
fi
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.c <<EOF
#ifdef __GNUC__
yes;
#endif
EOF
if ${CC-cc} -E conftest.c 2>&5 | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
fi
fi
echo "$ac_t""$ac_cv_prog_gcc" 1>&6
if test $ac_cv_prog_gcc = yes; then
GCC=yes
if test "${CFLAGS+set}" != set; then
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
if eval "test \"`echo '$''{'ac_cv_prog_gcc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo 'void f(){}' > conftest.c
if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
ac_cv_prog_gcc_g=yes
else
ac_cv_prog_gcc_g=no
fi
rm -f conftest*
fi
echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6
if test $ac_cv_prog_gcc_g = yes; then
CFLAGS="-g -O"
else
CFLAGS="-O"
fi
fi
else
GCC=
test "${CFLAGS+set}" = set || CFLAGS="-g"
fi
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$RANLIB"; then
ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_RANLIB="ranlib"
break
fi
done
IFS="$ac_save_ifs"
test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
fi
fi
RANLIB="$ac_cv_prog_RANLIB"
if test -n "$RANLIB"; then
echo "$ac_t""$RANLIB" 1>&6
else
echo "$ac_t""no" 1>&6
fi
ac_aux_dir=
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
if test -f $ac_dir/install-sh; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install-sh -c"
break
elif test -f $ac_dir/install.sh; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install.sh -c"
break
fi
done
if test -z "$ac_aux_dir"; then
{ echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
fi
ac_config_guess=$ac_aux_dir/config.guess
ac_config_sub=$ac_aux_dir/config.sub
ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
# incompatible versions:
# SysV /etc/install, /usr/sbin/install
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
# Account for people who put trailing slashes in PATH elements.
case "$ac_dir/" in
/|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
*)
# OSF1 and SCO ODT 3.0 have their own names for install.
for ac_prog in ginstall installbsd scoinst install; do
if test -f $ac_dir/$ac_prog; then
if test $ac_prog = install &&
grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
# OSF/1 installbsd also uses dspmsg, but is usable.
:
else
ac_cv_path_install="$ac_dir/$ac_prog -c"
break 2
fi
fi
done
;;
esac
done
IFS="$ac_save_ifs"
# As a last resort, use the slow shell script.
test -z "$ac_cv_path_install" && ac_cv_path_install="$ac_install_sh"
fi
INSTALL="$ac_cv_path_install"
fi
echo "$ac_t""$INSTALL" 1>&6
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
fi
if test -z "$CPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# This must be in double quotes, not single quotes, because CPP may get
# substituted into the Makefile and "${CC-cc}" will confuse make.
CPP="${CC-cc} -E"
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
#line 612 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
else
echo "$ac_err" >&5
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
#line 626 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
else
echo "$ac_err" >&5
rm -rf conftest*
CPP=/lib/cpp
fi
rm -f conftest*
fi
rm -f conftest*
ac_cv_prog_CPP="$CPP"
fi
CPP="$ac_cv_prog_CPP"
else
ac_cv_prog_CPP="$CPP"
fi
echo "$ac_t""$CPP" 1>&6
for ac_hdr in string.h unistd.h
do
ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 659 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
else
echo "$ac_err" >&5
rm -rf conftest*
eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
else
echo "$ac_t""no" 1>&6
fi
done
# If we cannot run a trivial program, we must be cross compiling.
echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&6
if eval "test \"`echo '$''{'ac_cv_c_cross'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
ac_cv_c_cross=yes
else
cat > conftest.$ac_ext <<EOF
#line 696 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
eval $ac_link
if test -s conftest && (./conftest; exit) 2>/dev/null; then
ac_cv_c_cross=no
else
ac_cv_c_cross=yes
fi
fi
rm -fr conftest*
fi
cross_compiling=$ac_cv_c_cross
echo "$ac_t""$ac_cv_c_cross" 1>&6
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 717 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>
EOF
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
ac_cv_header_stdc=yes
else
echo "$ac_err" >&5
rm -rf conftest*
ac_cv_header_stdc=no
fi
rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 739 "configure"
#include "confdefs.h"
#include <string.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "memchr" >/dev/null 2>&1; then
:
else
rm -rf conftest*
ac_cv_header_stdc=no
fi
rm -f conftest*
fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 757 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "free" >/dev/null 2>&1; then
:
else
rm -rf conftest*
ac_cv_header_stdc=no
fi
rm -f conftest*
fi
if test $ac_cv_header_stdc = yes; then
# /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
if test "$cross_compiling" = yes; then
ac_cv_header_stdc=no
else
cat > conftest.$ac_ext <<EOF
#line 778 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int main () { int i; for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
eval $ac_link
if test -s conftest && (./conftest; exit) 2>/dev/null; then
:
else
ac_cv_header_stdc=no
fi
fi
rm -fr conftest*
fi
fi
echo "$ac_t""$ac_cv_header_stdc" 1>&6
if test $ac_cv_header_stdc = yes; then
cat >> confdefs.h <<\EOF
#define STDC_HEADERS 1
EOF
fi
trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
# scripts and configure runs. It is not useful on other systems.
# If it contains results you don't want to keep, you may remove or edit it.
#
# By default, configure uses ./config.cache as the cache file,
# creating it if it does not exist already. You can give configure
# the --cache-file=FILE option to use a different cache file; that is
# what configure does when it calls configure scripts in
# subdirectories, so they share the cache.
# Giving --cache-file=/dev/null disables caching, for debugging configure.
# config.status only pays attention to the cache file if you give it the
# --recheck option to rerun configure.
#
EOF
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(set) 2>&1 |
sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \
>> confcache
if cmp -s $cache_file confcache; then
:
else
if test -w $cache_file; then
echo "updating cache $cache_file"
cat confcache > $cache_file
else
echo "not updating unwritable cache $cache_file"
fi
fi
rm -f confcache
trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
# Any assignment to VPATH causes Sun make to only execute
# the first set of double-colon rules, so remove it if not needed.
# If there is a colon in the path, we need to keep it.
if test "x$srcdir" = x.; then
ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
fi
trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
# Transform confdefs.h into DEFS.
# Protect against shell expansion while executing Makefile rules.
# Protect against Makefile macro expansion.
cat > conftest.defs <<\EOF
s%#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%-D\1=\2%g
s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
s%\[%\\&%g
s%\]%\\&%g
s%\$%$$%g
EOF
DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
rm -f conftest.defs
# Without the "./", some shells look in PATH for config.status.
: ${CONFIG_STATUS=./config.status}
echo creating $CONFIG_STATUS
rm -f $CONFIG_STATUS
cat > $CONFIG_STATUS <<EOF
#! /bin/sh
# Generated automatically by configure.
# Run this file to recreate the current configuration.
# This directory was configured as follows,
# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
#
# $0 $ac_configure_args
#
# Compiler output produced by configure, useful for debugging
# configure, is in ./config.log if it exists.
ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
for ac_option
do
case "\$ac_option" in
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
echo "$CONFIG_STATUS generated by autoconf version 2.4"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
*) echo "\$ac_cs_usage"; exit 1 ;;
esac
done
ac_given_srcdir=$srcdir
ac_given_INSTALL="$INSTALL"
trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
# Protect against being on the right side of a sed subst in config.status.
sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\\\&%]/\\\\&/g;
s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF
$ac_vpsub
$extrasub
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
s%@DEFS@%$DEFS%g
s%@LDFLAGS@%$LDFLAGS%g
s%@LIBS@%$LIBS%g
s%@exec_prefix@%$exec_prefix%g
s%@prefix@%$prefix%g
s%@program_transform_name@%$program_transform_name%g
s%@installdata@%$installdata%g
s%@uninstalldata@%$uninstalldata%g
s%@termcapfile@%$termcapfile%g
s%@CC@%$CC%g
s%@RANLIB@%$RANLIB%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@CPP@%$CPP%g
CEOF
EOF
cat >> $CONFIG_STATUS <<EOF
CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
# Support "outfile[:infile]", defaulting infile="outfile.in".
case "$ac_file" in
*:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
*) ac_file_in="${ac_file}.in" ;;
esac
# Adjust relative srcdir, etc. for subdirectories.
# Remove last slash and all that follows it. Not all systems have dirname.
ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
# The file is in a subdirectory.
test ! -d "$ac_dir" && mkdir "$ac_dir"
ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
# A "../" for each directory in $ac_dir_suffix.
ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
else
ac_dir_suffix= ac_dots=
fi
case "$ac_given_srcdir" in
.) srcdir=.
if test -z "$ac_dots"; then top_srcdir=.
else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
/*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
*) # Relative path.
srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
top_srcdir="$ac_dots$ac_given_srcdir" ;;
esac
case "$ac_given_INSTALL" in
[/$]*) INSTALL="$ac_given_INSTALL" ;;
*) INSTALL="$ac_dots$ac_given_INSTALL" ;;
esac
echo creating "$ac_file"
rm -f "$ac_file"
configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
case "$ac_file" in
*Makefile*) ac_comsub="1i\\
# $configure_input" ;;
*) ac_comsub= ;;
esac
sed -e "$ac_comsub
s%@configure_input@%$configure_input%g
s%@srcdir@%$srcdir%g
s%@top_srcdir@%$top_srcdir%g
s%@INSTALL@%$INSTALL%g
" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
fi; done
rm -f conftest.subs
exit 0
EOF
chmod +x $CONFIG_STATUS
rm -fr confdefs* $ac_clean_files
test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1

View File

@ -0,0 +1,23 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(termcap.h)
AC_ARG_ENABLE(install-termcap,
[ --enable-install-termcap install the termcap data file],
[if test $enableval = yes; then
installdata=install-data uninstalldata=uninstall-data
fi])
AC_SUBST(installdata)dnl
AC_SUBST(uninstalldata)dnl
AC_ARG_WITH(termcap,
[ --with-termcap=FILE use data file FILE instead of /etc/termcap],
termcapfile=$withval, termcapfile=/etc/termcap)
AC_SUBST(termcapfile)dnl
AC_PROG_CC
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_HAVE_HEADERS(string.h unistd.h)
AC_STDC_HEADERS
AC_OUTPUT(Makefile)

238
src/libs/termcap/install-sh Normal file
View File

@ -0,0 +1,238 @@
#! /bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
#
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
tranformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
true
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
else
instcmd=mkdir
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
then
true
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
true
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
true
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
shift
if [ ! -d "${pathcomp}" ] ;
then
$mkdirprog "${pathcomp}"
else
true
fi
pathcomp="${pathcomp}/"
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else
true
fi
# Make a temp file name in the proper directory.
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp &&
trap "rm -f ${dsttmp}" 0 &&
# and set any options; do chmod last to preserve setuid bits
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
# Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile &&
$doit $mvcmd $dsttmp $dstdir/$dstfile
fi &&
exit 0

View File

@ -0,0 +1,32 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain
errstatus=0
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d in ${1+"$@"} ; do
pathcomp="$pathcomp$d"
case "$pathcomp" in
-* ) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp" 1>&2
mkdir "$pathcomp" || errstatus=$?
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# mkinstalldirs ends here

813
src/libs/termcap/termcap.c Normal file
View File

@ -0,0 +1,813 @@
/* Work-alike for termcap, plus extra features.
Copyright (C) 1985, 86, 93, 94, 95, 2000, 2001
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* Emacs config.h may rename various library functions such as malloc. */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef emacs
#include <lisp.h> /* xmalloc is here */
/* Get the O_* definitions for open et al. */
#include <sys/file.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#else /* not emacs */
#ifdef STDC_HEADERS
#include <stdlib.h>
#include <string.h>
#else
char *getenv ();
char *malloc ();
char *realloc ();
#endif
/* Do this after the include, in case string.h prototypes bcopy. */
#if (defined(HAVE_STRING_H) || defined(STDC_HEADERS)) && !defined(bcopy)
#define bcopy(s, d, n) memcpy ((d), (s), (n))
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef _POSIX_VERSION
#include <fcntl.h>
#endif
#endif /* not emacs */
#ifndef NULL
#define NULL (char *) 0
#endif
#ifndef O_RDONLY
#define O_RDONLY 0
#endif
/* BUFSIZE is the initial size allocated for the buffer
for reading the termcap file.
It is not a limit.
Make it large normally for speed.
Make it variable when debugging, so can exercise
increasing the space dynamically. */
#ifndef BUFSIZE
#ifdef DEBUG
#define BUFSIZE bufsize
int bufsize = 128;
#else
#define BUFSIZE 2048
#endif
#endif
#ifndef TERMCAP_FILE
#define TERMCAP_FILE "/etc/termcap"
#endif
#ifndef emacs
static void
memory_out ()
{
write (2, "virtual memory exhausted\n", 25);
exit (1);
}
static char *
xmalloc (size)
unsigned size;
{
register char *tem = malloc (size);
if (!tem)
memory_out ();
return tem;
}
static char *
xrealloc (ptr, size)
char *ptr;
unsigned size;
{
register char *tem = realloc (ptr, size);
if (!tem)
memory_out ();
return tem;
}
#endif /* not emacs */
/* Looking up capabilities in the entry already found. */
/* The pointer to the data made by tgetent is left here
for tgetnum, tgetflag and tgetstr to find. */
static char *term_entry;
static char *tgetst1 ();
/* Search entry BP for capability CAP.
Return a pointer to the capability (in BP) if found,
0 if not found. */
static char *
find_capability (bp, cap)
register char *bp, *cap;
{
for (; *bp; bp++)
if (bp[0] == ':'
&& bp[1] == cap[0]
&& bp[2] == cap[1])
return &bp[4];
return NULL;
}
int
tgetnum (cap)
char *cap;
{
register char *ptr = find_capability (term_entry, cap);
if (!ptr || ptr[-1] != '#')
return -1;
return atoi (ptr);
}
int
tgetflag (cap)
char *cap;
{
register char *ptr = find_capability (term_entry, cap);
return ptr && ptr[-1] == ':';
}
/* Look up a string-valued capability CAP.
If AREA is non-null, it points to a pointer to a block in which
to store the string. That pointer is advanced over the space used.
If AREA is null, space is allocated with `malloc'. */
char *
tgetstr (cap, area)
char *cap;
char **area;
{
register char *ptr = find_capability (term_entry, cap);
if (!ptr || (ptr[-1] != '=' && ptr[-1] != '~'))
return NULL;
return tgetst1 (ptr, area);
}
#ifdef IS_EBCDIC_HOST
/* Table, indexed by a character in range 0200 to 0300 with 0200 subtracted,
gives meaning of character following \, or a space if no special meaning.
Sixteen characters per line within the string. */
static char esctab[]
= " \057\026 \047\014 \
\025 \015 \
\005 \013 \
";
#else
/* Table, indexed by a character in range 0100 to 0140 with 0100 subtracted,
gives meaning of character following \, or a space if no special meaning.
Eight characters per line within the string. */
static char esctab[]
= " \007\010 \033\014 \
\012 \
\015 \011 \013 \
";
#endif
/* PTR points to a string value inside a termcap entry.
Copy that value, processing \ and ^ abbreviations,
into the block that *AREA points to,
or to newly allocated storage if AREA is NULL.
Return the address to which we copied the value,
or NULL if PTR is NULL. */
static char *
tgetst1 (ptr, area)
char *ptr;
char **area;
{
register char *p, *r;
register int c;
register int size;
char *ret;
register int c1;
if (!ptr)
return NULL;
/* `ret' gets address of where to store the string. */
if (!area)
{
/* Compute size of block needed (may overestimate). */
p = ptr;
while ((c = *p++) && c != ':' && c != '\n')
;
ret = (char *) xmalloc (p - ptr + 1);
}
else
ret = *area;
/* Copy the string value, stopping at null or colon.
Also process ^ and \ abbreviations. */
p = ptr;
r = ret;
while ((c = *p++) && c != ':' && c != '\n')
{
if (c == '^')
{
c = *p++;
if (c == '?')
c = 0177;
else
c &= 037;
}
else if (c == '\\')
{
c = *p++;
if (c >= '0' && c <= '7')
{
c -= '0';
size = 0;
while (++size < 3 && (c1 = *p) >= '0' && c1 <= '7')
{
c *= 8;
c += c1 - '0';
p++;
}
}
#ifdef IS_EBCDIC_HOST
else if (c >= 0200 && c < 0360)
{
c1 = esctab[(c & ~0100) - 0200];
if (c1 != ' ')
c = c1;
}
#else
else if (c >= 0100 && c < 0200)
{
c1 = esctab[(c & ~040) - 0100];
if (c1 != ' ')
c = c1;
}
#endif
}
*r++ = c;
}
*r = '\0';
/* Update *AREA. */
if (area)
*area = r + 1;
return ret;
}
/* Outputting a string with padding. */
#ifndef emacs
short ospeed;
/* If OSPEED is 0, we use this as the actual baud rate. */
int tputs_baud_rate;
#endif
char PC;
#ifndef emacs
/* Actual baud rate if positive;
- baud rate / 100 if negative. */
static int speeds[] =
{
#ifdef VMS
0, 50, 75, 110, 134, 150, -3, -6, -12, -18,
-20, -24, -36, -48, -72, -96, -192
#else /* not VMS */
0, 50, 75, 110, 135, 150, -2, -3, -6, -12,
-18, -24, -48, -96, -192, -288, -384, -576, -1152
#endif /* not VMS */
};
#endif /* not emacs */
void
tputs (str, nlines, outfun)
register char *str;
int nlines;
register int (*outfun) ();
{
register int padcount = 0;
register int speed;
#ifdef emacs
extern int baud_rate;
speed = baud_rate;
/* For quite high speeds, convert to the smaller
units to avoid overflow. */
if (speed > 10000)
speed = - speed / 100;
#else
if (ospeed == 0)
speed = tputs_baud_rate;
else
speed = speeds[ospeed];
#endif
if (!str)
return;
while (*str >= '0' && *str <= '9')
{
padcount += *str++ - '0';
padcount *= 10;
}
if (*str == '.')
{
str++;
padcount += *str++ - '0';
}
if (*str == '*')
{
str++;
padcount *= nlines;
}
while (*str)
(*outfun) (*str++);
/* PADCOUNT is now in units of tenths of msec.
SPEED is measured in characters per 10 seconds
or in characters per .1 seconds (if negative).
We use the smaller units for larger speeds to avoid overflow. */
padcount *= speed;
padcount += 500;
padcount /= 1000;
if (speed < 0)
padcount = -padcount;
else
{
padcount += 50;
padcount /= 100;
}
while (padcount-- > 0)
(*outfun) (PC);
}
/* Finding the termcap entry in the termcap data base. */
struct termcap_buffer
{
char *beg;
int size;
char *ptr;
int ateof;
int full;
};
/* Forward declarations of static functions. */
static int scan_file ();
static char *gobble_line ();
static int compare_contin ();
static int name_match ();
#ifdef VMS
#include <rmsdef.h>
#include <fab.h>
#include <nam.h>
static int
valid_filename_p (fn)
char *fn;
{
struct FAB fab = cc$rms_fab;
struct NAM nam = cc$rms_nam;
char esa[NAM$C_MAXRSS];
fab.fab$l_fna = fn;
fab.fab$b_fns = strlen(fn);
fab.fab$l_nam = &nam;
fab.fab$l_fop = FAB$M_NAM;
nam.nam$l_esa = esa;
nam.nam$b_ess = sizeof esa;
return SYS$PARSE(&fab, 0, 0) == RMS$_NORMAL;
}
#else /* !VMS */
#ifdef MSDOS /* MW, May 1993 */
static int
valid_filename_p (fn)
char *fn;
{
return *fn == '/' || fn[1] == ':';
}
#else
#define valid_filename_p(fn) (*(fn) == '/')
#endif
#endif /* !VMS */
/* Find the termcap entry data for terminal type NAME
and store it in the block that BP points to.
Record its address for future use.
If BP is null, space is dynamically allocated.
Return -1 if there is some difficulty accessing the data base
of terminal types,
0 if the data base is accessible but the type NAME is not defined
in it, and some other value otherwise. */
int
tgetent (bp, name)
char *bp, *name;
{
register char *termcap_name;
register int fd;
struct termcap_buffer buf;
register char *bp1;
char *tc_search_point;
char *term;
int malloc_size = 0;
register int c;
char *tcenv = NULL; /* TERMCAP value, if it contains :tc=. */
char *indirect = NULL; /* Terminal type in :tc= in TERMCAP value. */
int filep;
#ifdef INTERNAL_TERMINAL
/* For the internal terminal we don't want to read any termcap file,
so fake it. */
if (!strcmp (name, "internal"))
{
term = INTERNAL_TERMINAL;
if (!bp)
{
malloc_size = 1 + strlen (term);
bp = (char *) xmalloc (malloc_size);
}
strcpy (bp, term);
goto ret;
}
#endif /* INTERNAL_TERMINAL */
/* For compatibility with programs like `less' that want to
put data in the termcap buffer themselves as a fallback. */
if (bp)
term_entry = bp;
termcap_name = getenv ("TERMCAP");
if (termcap_name && *termcap_name == '\0')
termcap_name = NULL;
#if defined (MSDOS) && !defined (TEST)
if (termcap_name && (*termcap_name == '\\'
|| *termcap_name == '/'
|| termcap_name[1] == ':'))
dostounix_filename(termcap_name);
#endif
filep = termcap_name && valid_filename_p (termcap_name);
/* If termcap_name is non-null and starts with / (in the un*x case, that is),
it is a file name to use instead of /etc/termcap.
If it is non-null and does not start with /,
it is the entry itself, but only if
the name the caller requested matches the TERM variable. */
if (termcap_name && !filep && !strcmp (name, getenv ("TERM")))
{
indirect = tgetst1 (find_capability (termcap_name, "tc"), (char **) 0);
if (!indirect)
{
if (!bp)
bp = termcap_name;
else
strcpy (bp, termcap_name);
goto ret;
}
else
{ /* It has tc=. Need to read /etc/termcap. */
tcenv = termcap_name;
termcap_name = NULL;
}
}
if (!termcap_name || !filep)
termcap_name = TERMCAP_FILE;
/* Here we know we must search a file and termcap_name has its name. */
#ifdef MSDOS
fd = open (termcap_name, O_RDONLY|O_TEXT, 0);
#else
fd = open (termcap_name, O_RDONLY, 0);
#endif
if (fd < 0)
return -1;
buf.size = BUFSIZE;
/* Add 1 to size to ensure room for terminating null. */
buf.beg = (char *) xmalloc (buf.size + 1);
term = indirect ? indirect : name;
if (!bp)
{
malloc_size = indirect ? strlen (tcenv) + 1 : buf.size;
bp = (char *) xmalloc (malloc_size);
}
tc_search_point = bp1 = bp;
if (indirect)
/* Copy the data from the environment variable. */
{
strcpy (bp, tcenv);
bp1 += strlen (tcenv);
}
while (term)
{
/* Scan the file, reading it via buf, till find start of main entry. */
if (scan_file (term, fd, &buf) == 0)
{
close (fd);
free (buf.beg);
if (malloc_size)
free (bp);
return 0;
}
/* Free old `term' if appropriate. */
if (term != name)
free (term);
/* If BP is malloc'd by us, make sure it is big enough. */
if (malloc_size)
{
int offset1 = bp1 - bp, offset2 = tc_search_point - bp;
malloc_size = offset1 + buf.size;
bp = termcap_name = (char *) xrealloc (bp, malloc_size);
bp1 = termcap_name + offset1;
tc_search_point = termcap_name + offset2;
}
/* Copy the line of the entry from buf into bp. */
termcap_name = buf.ptr;
while ((*bp1++ = c = *termcap_name++) && c != '\n')
/* Drop out any \ newline sequence. */
if (c == '\\' && *termcap_name == '\n')
{
bp1--;
termcap_name++;
}
*bp1 = '\0';
/* Does this entry refer to another terminal type's entry?
If something is found, copy it into heap and null-terminate it. */
tc_search_point = find_capability (tc_search_point, "tc");
term = tgetst1 (tc_search_point, (char **) 0);
}
close (fd);
free (buf.beg);
if (malloc_size)
bp = (char *) xrealloc (bp, bp1 - bp + 1);
ret:
term_entry = bp;
return 1;
}
/* Given file open on FD and buffer BUFP,
scan the file from the beginning until a line is found
that starts the entry for terminal type STR.
Return 1 if successful, with that line in BUFP,
or 0 if no entry is found in the file. */
static int
scan_file (str, fd, bufp)
char *str;
int fd;
register struct termcap_buffer *bufp;
{
register char *end;
bufp->ptr = bufp->beg;
bufp->full = 0;
bufp->ateof = 0;
*bufp->ptr = '\0';
lseek (fd, 0L, 0);
while (!bufp->ateof)
{
/* Read a line into the buffer. */
end = NULL;
do
{
/* if it is continued, append another line to it,
until a non-continued line ends. */
end = gobble_line (fd, bufp, end);
}
while (!bufp->ateof && end[-2] == '\\');
if (*bufp->ptr != '#'
&& name_match (bufp->ptr, str))
return 1;
/* Discard the line just processed. */
bufp->ptr = end;
}
return 0;
}
/* Return nonzero if NAME is one of the names specified
by termcap entry LINE. */
static int
name_match (line, name)
char *line, *name;
{
register char *tem;
if (!compare_contin (line, name))
return 1;
/* This line starts an entry. Is it the right one? */
for (tem = line; *tem && *tem != '\n' && *tem != ':'; tem++)
if (*tem == '|' && !compare_contin (tem + 1, name))
return 1;
return 0;
}
static int
compare_contin (str1, str2)
register char *str1, *str2;
{
register int c1, c2;
while (1)
{
c1 = *str1++;
c2 = *str2++;
while (c1 == '\\' && *str1 == '\n')
{
str1++;
while ((c1 = *str1++) == ' ' || c1 == '\t');
}
if (c2 == '\0')
{
/* End of type being looked up. */
if (c1 == '|' || c1 == ':')
/* If end of name in data base, we win. */
return 0;
else
return 1;
}
else if (c1 != c2)
return 1;
}
}
/* Make sure that the buffer <- BUFP contains a full line
of the file open on FD, starting at the place BUFP->ptr
points to. Can read more of the file, discard stuff before
BUFP->ptr, or make the buffer bigger.
Return the pointer to after the newline ending the line,
or to the end of the file, if there is no newline to end it.
Can also merge on continuation lines. If APPEND_END is
non-null, it points past the newline of a line that is
continued; we add another line onto it and regard the whole
thing as one line. The caller decides when a line is continued. */
static char *
gobble_line (fd, bufp, append_end)
int fd;
register struct termcap_buffer *bufp;
char *append_end;
{
register char *end;
register int nread;
register char *buf = bufp->beg;
register char *tem;
if (!append_end)
append_end = bufp->ptr;
while (1)
{
end = append_end;
while (*end && *end != '\n') end++;
if (*end)
break;
if (bufp->ateof)
return buf + bufp->full;
if (bufp->ptr == buf)
{
if (bufp->full == bufp->size)
{
bufp->size *= 2;
/* Add 1 to size to ensure room for terminating null. */
tem = (char *) xrealloc (buf, bufp->size + 1);
bufp->ptr = (bufp->ptr - buf) + tem;
append_end = (append_end - buf) + tem;
bufp->beg = buf = tem;
}
}
else
{
append_end -= bufp->ptr - buf;
bcopy (bufp->ptr, buf, bufp->full -= bufp->ptr - buf);
bufp->ptr = buf;
}
if (!(nread = read (fd, buf + bufp->full, bufp->size - bufp->full)))
bufp->ateof = 1;
bufp->full += nread;
buf[bufp->full] = '\0';
}
return end + 1;
}
#ifdef TEST
#ifdef NULL
#undef NULL
#endif
#include <stdio.h>
main (argc, argv)
int argc;
char **argv;
{
char *term;
char *buf;
term = argv[1];
printf ("TERM: %s\n", term);
buf = (char *) tgetent (0, term);
if ((int) buf <= 0)
{
printf ("No entry.\n");
return 0;
}
printf ("Entry: %s\n", buf);
tprint ("cm");
tprint ("AL");
printf ("co: %d\n", tgetnum ("co"));
printf ("am: %d\n", tgetflag ("am"));
}
tprint (cap)
char *cap;
{
char *x = tgetstr (cap, 0);
register char *y;
printf ("%s: ", cap);
if (x)
{
for (y = x; *y; y++)
if (*y <= ' ' || *y == 0177)
printf ("\\%0o", *y);
else
putchar (*y);
free (x);
}
else
printf ("none");
putchar ('\n');
}
#endif /* TEST */

View File

@ -0,0 +1,62 @@
/* Declarations for termcap library.
Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef _TERMCAP_H
#define _TERMCAP_H 1
#if __STDC__
extern int tgetent (char *buffer, const char *termtype);
extern int tgetnum (const char *name);
extern int tgetflag (const char *name);
extern char *tgetstr (const char *name, char **area);
extern char PC;
extern short ospeed;
extern void tputs (const char *string, int nlines, int (*outfun) (int));
extern char *tparam (const char *ctlstring, char *buffer, int size, ...);
extern char *UP;
extern char *BC;
extern char *tgoto (const char *cstring, int hpos, int vpos);
#else /* not __STDC__ */
extern int tgetent ();
extern int tgetnum ();
extern int tgetflag ();
extern char *tgetstr ();
extern char PC;
extern short ospeed;
extern void tputs ();
extern char *tparam ();
extern char *UP;
extern char *BC;
extern char *tgoto ();
#endif /* not __STDC__ */
#endif /* not _TERMCAP_H */

View File

@ -0,0 +1,80 @@
This is Info file ./termcap.info, produced by Makeinfo-1.55 from the
input file ./termcap.texi.
This file documents the termcap library of the GNU system.
Copyright (C) 1988 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.
Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided that
the entire resulting derived work is distributed under the terms of a
permission notice identical to this one.
Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that this permission notice may be stated in a
translation approved by the Foundation.

Indirect:
termcap.info-1: 874
termcap.info-2: 47411
termcap.info-3: 90390
termcap.info-4: 138827

Tag Table:
(Indirect)
Node: Top874
Node: Introduction4105
Node: Library5832
Node: Preparation6851
Node: Find8034
Node: Interrogate11492
Node: Initialize16800
Node: Padding18440
Node: Why Pad19146
Node: Not Enough20768
Node: Describe Padding23336
Node: Output Padding24826
Node: Parameters28441
Node: Encode Parameters30101
Node: Using Parameters36185
Node: tparam36780
Node: tgoto38806
Node: Data Base41361
Node: Format42257
Node: Capability Format44346
Node: Naming47411
Node: Inheriting51980
Node: Changing54224
Node: Capabilities55388
Node: Basic58127
Node: Screen Size62180
Node: Cursor Motion63920
Node: Wrapping74062
Node: Scrolling77091
Node: Windows82980
Node: Clearing83714
Node: Insdel Line85478
Node: Insdel Char90390
Node: Standout100375
Node: Underlining109433
Node: Cursor Visibility111852
Node: Bell112600
Node: Keypad113149
Node: Meta Key117864
Node: Initialization118818
Node: Pad Specs121369
Node: Status Line123422
Node: Half-Line125306
Node: Printer126108
Node: Summary127787
Node: Var Index138114
Node: Cap Index138827
Node: Index145991

End Tag Table

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,974 @@
This is Info file ./termcap.info, produced by Makeinfo-1.55 from the
input file ./termcap.texi.
This file documents the termcap library of the GNU system.
Copyright (C) 1988 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.
Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided that
the entire resulting derived work is distributed under the terms of a
permission notice identical to this one.
Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that this permission notice may be stated in a
translation approved by the Foundation.

File: termcap.info, Node: Naming, Next: Inheriting, Prev: Capability Format, Up: Data Base
Terminal Type Name Conventions
==============================
There are conventions for choosing names of terminal types. For one
thing, all letters should be in lower case. The terminal type for a
terminal in its most usual or most fundamental mode of operation should
not have a hyphen in it.
If the same terminal has other modes of operation which require
different terminal descriptions, these variant descriptions are given
names made by adding suffixes with hyphens. Such alternate descriptions
are used for two reasons:
* When the terminal has a switch that changes its behavior. Since
the computer cannot tell how the switch is set, the user must tell
the computer by choosing the appropriate terminal type name.
For example, the VT-100 has a setup flag that controls whether the
cursor wraps at the right margin. If this flag is set to "wrap",
you must use the terminal type `vt100-am'. Otherwise you must use
`vt100-nam'. Plain `vt100' is defined as a synonym for either
`vt100-am' or `vt100-nam' depending on the preferences of the
local site.
The standard suffix `-am' stands for "automatic margins".
* To give the user a choice in how to use the terminal. This is done
when the terminal has a switch that the computer normally controls.
For example, the Ann Arbor Ambassador can be configured with many
screen sizes ranging from 20 to 60 lines. Fewer lines make bigger
characters but more lines let you see more of what you are editing.
As a result, users have different preferences. Therefore, termcap
provides terminal types for many screen sizes. If you choose type
`aaa-30', the terminal will be configured to use 30 lines; if you
choose `aaa-48', 48 lines will be used, and so on.
Here is a list of standard suffixes and their conventional meanings:
`-w'
Short for "wide". This is a mode that gives the terminal more
columns than usual. This is normally a user option.
`-am'
"Automatic margins". This is an alternate description for use when
the terminal's margin-wrap switch is on; it contains the `am'
flag. The implication is that normally the switch is off and the
usual description for the terminal says that the switch is off.
`-nam'
"No automatic margins". The opposite of `-am', this names an
alternative description which lacks the `am' flag. This implies
that the terminal is normally operated with the margin-wrap switch
turned on, and the normal description of the terminal says so.
`-na'
"No arrows". This terminal description initializes the terminal to
keep its arrow keys in local mode. This is a user option.
`-rv'
"Reverse video". This terminal description causes text output for
normal video to appear as reverse, and text output for reverse
video to come out as normal. Often this description differs from
the usual one by interchanging the two strings which turn reverse
video on and off.
This is a user option; you can choose either the "reverse video"
variant terminal type or the normal terminal type, and termcap will
obey.
`-s'
"Status". Says to enable use of a status line which ordinary
output does not touch (*note Status Line::.).
Some terminals have a special line that is used only as a status
line. For these terminals, there is no need for an `-s' variant;
the status line commands should be defined by default. On other
terminals, enabling a status line means removing one screen line
from ordinary use and reducing the effective screen height. For
these terminals, the user can choose the `-s' variant type to
request use of a status line.
`-NLINES'
Says to operate with NLINES lines on the screen, for terminals
such as the Ambassador which provide this as an option. Normally
this is a user option; by choosing the terminal type, you control
how many lines termcap will use.
`-NPAGESp'
Says that the terminal has NPAGES pages worth of screen memory,
for terminals where this is a hardware option.
`-unk'
Says that description is not for direct use, but only for
reference in `tc' capabilities. Such a description is a kind of
subroutine, because it describes the common characteristics of
several variant descriptions that would use other suffixes in
place of `-unk'.

File: termcap.info, Node: Inheriting, Next: Changing, Prev: Naming, Up: Data Base
Inheriting from Related Descriptions
====================================
When two terminal descriptions are similar, their identical parts do
not need to be given twice. Instead, one of the two can be defined in
terms of the other, using the `tc' capability. We say that one
description "refers to" the other, or "inherits from" the other.
The `tc' capability must be the last one in the terminal description,
and its value is a string which is the name of another terminal type
which is referred to. For example,
N9|aaa|ambassador|aaa-30|ann arbor ambassador/30 lines:\
:ti=\E[2J\E[30;0;0;30p:\
:te=\E[60;0;0;30p\E[30;1H\E[J:\
:li#30:tc=aaa-unk:
defines the terminal type `aaa-30' (also known as plain `aaa') in terms
of `aaa-unk', which defines everything about the Ambassador that is
independent of screen height. The types `aaa-36', `aaa-48' and so on
for other screen heights are likewise defined to inherit from `aaa-unk'.
The capabilities overridden by `aaa-30' include `li', which says how
many lines there are, and `ti' and `te', which configure the terminal
to use that many lines.
The effective terminal description for type `aaa' consists of the
text shown above followed by the text of the description of `aaa-unk'.
The `tc' capability is handled automatically by `tgetent', which finds
the description thus referenced and combines the two descriptions
(*note Find::.). Therefore, only the implementor of the terminal
descriptions needs to think about using `tc'. Users and application
programmers do not need to be concerned with it.
Since the reference terminal description is used last, capabilities
specified in the referring description override any specifications of
the same capabilities in the reference description.
The referring description can cancel out a capability without
specifying any new value for it by means of a special trick. Write the
capability in the referring description, with the character `@' after
the capability name, as follows:
NZ|aaa-30-nam|ann arbor ambassador/30 lines/no automatic-margins:\
:am@:tc=aaa-30:

File: termcap.info, Node: Changing, Prev: Inheriting, Up: Data Base
When Changes in the Data Base Take Effect
=========================================
Each application program must read the terminal description from the
data base, so a change in the data base is effective for all jobs
started after the change is made.
The change will usually have no effect on a job that have been in
existence since before the change. The program probably read the
terminal description once, when it was started, and is continuing to
use what it read then. If the program does not have a feature for
reexamining the data base, then you will need to run it again (probably
killing the old job).
If the description in use is coming from the `TERMCAP' environment
variable, then the data base file is effectively overridden, and
changes in it will have no effect until you change the `TERMCAP'
variable as well. For example, some users' `.login' files
automatically copy the terminal description into `TERMCAP' to speed
startup of applications. If you have done this, you will need to
change the `TERMCAP' variable to make the changed data base take effect.

File: termcap.info, Node: Capabilities, Next: Summary, Prev: Data Base, Up: Top
Definitions of the Terminal Capabilities
****************************************
This section is divided into many subsections, each for one aspect of
use of display terminals. For writing a display program, you usually
need only check the subsections for the operations you want to use.
For writing a terminal description, you must read each subsection and
fill in the capabilities described there.
String capabilities that are display commands may require numeric
parameters (*note Parameters::.). Most such capabilities do not use
parameters. When a capability requires parameters, this is explicitly
stated at the beginning of its definition. In simple cases, the first
or second sentence of the definition mentions all the parameters, in
the order they should be given, using a name in upper case for each
one. For example, the `rp' capability is a command that requires two
parameters; its definition begins as follows:
String of commands to output a graphic character C, repeated N
times.
In complex cases or when there are many parameters, they are
described explicitly.
When a capability is described as obsolete, this means that programs
should not be written to look for it, but terminal descriptions should
still be written to provide it.
When a capability is described as very obsolete, this means that it
should be omitted from terminal descriptions as well.
* Menu:
* Basic:: Basic characteristics.
* Screen Size:: Screen size, and what happens when it changes.
* Cursor Motion:: Various ways to move the cursor.
* Wrapping:: What happens if you write a character in the last column.
* Scrolling:: Pushing text up and down on the screen.
* Windows:: Limiting the part of the window that output affects.
* Clearing:: Erasing one or many lines.
* Insdel Line:: Making new blank lines in mid-screen; deleting lines.
* Insdel Char:: Inserting and deleting characters within a line.
* Standout:: Highlighting some of the text.
* Underlining:: Underlining some of the text.
* Cursor Visibility:: Making the cursor more or less easy to spot.
* Bell:: Attracts user's attention; not localized on the screen.
* Keypad:: Recognizing when function keys or arrows are typed.
* Meta Key:: META acts like an extra shift key.
* Initialization:: Commands used to initialize or reset the terminal.
* Pad Specs:: Info for the kernel on how much padding is needed.
* Status Line:: A status line displays "background" information.
* Half-Line:: Moving by half-lines, for superscripts and subscripts.
* Printer:: Controlling auxiliary printers of display terminals.

File: termcap.info, Node: Basic, Next: Screen Size, Up: Capabilities
Basic Characteristics
=====================
This section documents the capabilities that describe the basic and
nature of the terminal, and also those that are relevant to the output
of graphic characters.
`os'
Flag whose presence means that the terminal can overstrike. This
means that outputting a graphic character does not erase whatever
was present in the same character position before. The terminals
that can overstrike include printing terminals, storage tubes (all
obsolete nowadays), and many bit-map displays.
`eo'
Flag whose presence means that outputting a space erases a
character position even if the terminal supports overstriking. If
this flag is not present and overstriking is supported, output of
a space has no effect except to move the cursor.
(On terminals that do not support overstriking, you can always
assume that outputting a space at a position erases whatever
character was previously displayed there.)
`gn'
Flag whose presence means that this terminal type is a generic type
which does not really describe any particular terminal. Generic
types are intended for use as the default type assigned when the
user connects to the system, with the intention that the user
should specify what type he really has. One example of a generic
type is the type `network'.
Since the generic type cannot say how to do anything interesting
with the terminal, termcap-using programs will always find that the
terminal is too weak to be supported if the user has failed to
specify a real terminal type in place of the generic one. The
`gn' flag directs these programs to use a different error message:
"You have not specified your real terminal type", rather than
"Your terminal is not powerful enough to be used".
`hc'
Flag whose presence means this is a hardcopy terminal.
`rp'
String of commands to output a graphic character C, repeated N
times. The first parameter value is the ASCII code for the desired
character, and the second parameter is the number of times to
repeat the character. Often this command requires padding
proportional to the number of times the character is repeated.
This effect can be had by using parameter arithmetic with
`%'-sequences to compute the amount of padding, then generating
the result as a number at the front of the string so that `tputs'
will treat it as padding.
`hz'
Flag whose presence means that the ASCII character `~' cannot be
output on this terminal because it is used for display commands.
Programs handle this flag by checking all text to be output and
replacing each `~' with some other character(s). If this is not
done, the screen will be thoroughly garbled.
The old Hazeltine terminals that required such treatment are
probably very rare today, so you might as well not bother to
support this flag.
`CC'
String whose presence means the terminal has a settable command
character. The value of the string is the default command
character (which is usually ESC).
All the strings of commands in the terminal description should be
written to use the default command character. If you are writing
an application program that changes the command character, use the
`CC' capability to figure out how to translate all the display
commands to work with the new command character.
Most programs have no reason to look at the `CC' capability.
`xb'
Flag whose presence identifies Superbee terminals which are unable
to transmit the characters ESC and `Control-C'. Programs which
support this flag are supposed to check the input for the code
sequences sent by the F1 and F2 keys, and pretend that ESC or
`Control-C' (respectively) had been read. But this flag is
obsolete, and not worth supporting.

File: termcap.info, Node: Screen Size, Next: Cursor Motion, Prev: Basic, Up: Capabilities
Screen Size
===========
A terminal description has two capabilities, `co' and `li', that
describe the screen size in columns and lines. But there is more to
the question of screen size than this.
On some operating systems the "screen" is really a window and the
effective width can vary. On some of these systems, `tgetnum' uses the
actual width of the window to decide what value to return for the `co'
capability, overriding what is actually written in the terminal
description. On other systems, it is up to the application program to
check the actual window width using a system call. For example, on BSD
4.3 systems, the system call `ioctl' with code `TIOCGWINSZ' will tell
you the current screen size.
On all window systems, termcap is powerless to advise the application
program if the user resizes the window. Application programs must deal
with this possibility in a system-dependent fashion. On some systems
the C shell handles part of the problem by detecting changes in window
size and setting the `TERMCAP' environment variable appropriately.
This takes care of application programs that are started subsequently.
It does not help application programs already running.
On some systems, including BSD 4.3, all programs using a terminal get
a signal named `SIGWINCH' whenever the screen size changes. Programs
that use termcap should handle this signal by using `ioctl TIOCGWINSZ'
to learn the new screen size.
`co'
Numeric value, the width of the screen in character positions.
Even hardcopy terminals normally have a `co' capability.
`li'
Numeric value, the height of the screen in lines.

File: termcap.info, Node: Cursor Motion, Next: Wrapping, Prev: Screen Size, Up: Capabilities
Cursor Motion
=============
Termcap assumes that the terminal has a "cursor", a spot on the
screen where a visible mark is displayed, and that most display
commands take effect at the position of the cursor. It follows that
moving the cursor to a specified location is very important.
There are many terminal capabilities for different cursor motion
operations. A terminal description should define as many as possible,
but most programs do not need to use most of them. One capability,
`cm', moves the cursor to an arbitrary place on the screen; this by
itself is sufficient for any application as long as there is no need to
support hardcopy terminals or certain old, weak displays that have only
relative motion commands. Use of other cursor motion capabilities is an
optimization, enabling the program to output fewer characters in some
common cases.
If you plan to use the relative cursor motion commands in an
application program, you must know what the starting cursor position
is. To do this, you must keep track of the cursor position and update
the records each time anything is output to the terminal, including
graphic characters. In addition, it is necessary to know whether the
terminal wraps after writing in the rightmost column. *Note Wrapping::.
One other motion capability needs special mention: `nw' moves the
cursor to the beginning of the following line, perhaps clearing all the
starting line after the cursor, or perhaps not clearing at all. This
capability is a least common denominator that is probably supported
even by terminals that cannot do most other things such as `cm' or `do'.
Even hardcopy terminals can support `nw'.
`cm'
String of commands to position the cursor at line L, column C.
Both parameters are origin-zero, and are defined relative to the
screen, not relative to display memory.
All display terminals except a few very obsolete ones support `cm',
so it is acceptable for an application program to refuse to
operate on terminals lacking `cm'.
`ho'
String of commands to move the cursor to the upper left corner of
the screen (this position is called the "home position"). In
terminals where the upper left corner of the screen is not the
same as the beginning of display memory, this command must go to
the upper left corner of the screen, not the beginning of display
memory.
Every display terminal supports this capability, and many
application programs refuse to operate if the `ho' capability is
missing.
`ll'
String of commands to move the cursor to the lower left corner of
the screen. On some terminals, moving up from home position does
this, but programs should never assume that will work. Just
output the `ll' string (if it is provided); if moving to home
position and then moving up is the best way to get there, the `ll'
command will do that.
`cr'
String of commands to move the cursor to the beginning of the line
it is on. If this capability is not specified, many programs
assume they can use the ASCII carriage return character for this.
`le'
String of commands to move the cursor left one column. Unless the
`bw' flag capability is specified, the effect is undefined if the
cursor is at the left margin; do not use this command there. If
`bw' is present, this command may be used at the left margin, and
it wraps the cursor to the last column of the preceding line.
`nd'
String of commands to move the cursor right one column. The
effect is undefined if the cursor is at the right margin; do not
use this command there, not even if `am' is present.
`up'
String of commands to move the cursor vertically up one line. The
effect of sending this string when on the top line is undefined;
programs should never use it that way.
`do'
String of commands to move the cursor vertically down one line.
The effect of sending this string when on the bottom line is
undefined; programs should never use it that way.
Some programs do use `do' to scroll up one line if used at the
bottom line, if `sf' is not defined but `sr' is. This is only to
compensate for certain old, incorrect terminal descriptions. (In
principle this might actually lead to incorrect behavior on other
terminals, but that seems to happen rarely if ever.) But the
proper solution is that the terminal description should define
`sf' as well as `do' if the command is suitable for scrolling.
The original idea was that this string would not contain a newline
character and therefore could be used without disabling the
kernel's usual habit of converting of newline into a
carriage-return newline sequence. But many terminal descriptions
do use newline in the `do' string, so this is not possible; a
program which sends the `do' string must disable output conversion
in the kernel (*note Initialize::.).
`bw'
Flag whose presence says that `le' may be used in column zero to
move to the last column of the preceding line. If this flag is
not present, `le' should not be used in column zero.
`nw'
String of commands to move the cursor to start of next line,
possibly clearing rest of line (following the cursor) before
moving.
`DO', `UP', `LE', `RI'
Strings of commands to move the cursor N lines down vertically, up
vertically, or N columns left or right. Do not attempt to move
past any edge of the screen with these commands; the effect of
trying that is undefined. Only a few terminal descriptions provide
these commands, and most programs do not use them.
`CM'
String of commands to position the cursor at line L, column C,
relative to display memory. Both parameters are origin-zero.
This capability is present only in terminals where there is a
difference between screen-relative and memory-relative addressing,
and not even in all such terminals.
`ch'
String of commands to position the cursor at column C in the same
line it is on. This is a special case of `cm' in which the
vertical position is not changed. The `ch' capability is provided
only when it is faster to output than `cm' would be in this
special case. Programs should not assume most display terminals
have `ch'.
`cv'
String of commands to position the cursor at line L in the same
column. This is a special case of `cm' in which the horizontal
position is not changed. The `cv' capability is provided only
when it is faster to output than `cm' would be in this special
case. Programs should not assume most display terminals have `cv'.
`sc'
String of commands to make the terminal save the current cursor
position. Only the last saved position can be used. If this
capability is present, `rc' should be provided also. Most
terminals have neither.
`rc'
String of commands to make the terminal restore the last saved
cursor position. If this capability is present, `sc' should be
provided also. Most terminals have neither.
`ff'
String of commands to advance to the next page, for a hardcopy
terminal.
`ta'
String of commands to move the cursor right to the next hardware
tab stop column. Missing if the terminal does not have any kind of
hardware tabs. Do not send this command if the kernel's terminal
modes say that the kernel is expanding tabs into spaces.
`bt'
String of commands to move the cursor left to the previous hardware
tab stop column. Missing if the terminal has no such ability; many
terminals do not. Do not send this command if the kernel's
terminal modes say that the kernel is expanding tabs into spaces.
The following obsolete capabilities should be included in terminal
descriptions when appropriate, but should not be looked at by new
programs.
`nc'
Flag whose presence means the terminal does not support the ASCII
carriage return character as `cr'. This flag is needed because
old programs assume, when the `cr' capability is missing, that
ASCII carriage return can be used for the purpose. We use `nc' to
tell the old programs that carriage return may not be used.
New programs should not assume any default for `cr', so they need
not look at `nc'. However, descriptions should contain `nc'
whenever they do not contain `cr'.
`xt'
Flag whose presence means that the ASCII tab character may not be
used for cursor motion. This flag exists because old programs
assume, when the `ta' capability is missing, that ASCII tab can be
used for the purpose. We use `xt' to tell the old programs not to
use tab.
New programs should not assume any default for `ta', so they need
not look at `xt' in connection with cursor motion. Note that `xt'
also has implications for standout mode (*note Standout::.). It
is obsolete in regard to cursor motion but not in regard to
standout.
In fact, `xt' means that the terminal is a Teleray 1061.
`bc'
Very obsolete alternative name for the `le' capability.
`bs'
Flag whose presence means that the ASCII character backspace may be
used to move the cursor left. Obsolete; look at `le' instead.
`nl'
Obsolete capability which is a string that can either be used to
move the cursor down or to scroll. The same string must scroll
when used on the bottom line and move the cursor when used on any
other line. New programs should use `do' or `sf', and ignore `nl'.
If there is no `nl' capability, some old programs assume they can
use the newline character for this purpose. These programs follow
a bad practice, but because they exist, it is still desirable to
define the `nl' capability in a terminal description if the best
way to move down is *not* a newline.

File: termcap.info, Node: Wrapping, Next: Scrolling, Prev: Cursor Motion, Up: Capabilities
Wrapping
========
"Wrapping" means moving the cursor from the right margin to the left
margin of the following line. Some terminals wrap automatically when a
graphic character is output in the last column, while others do not.
Most application programs that use termcap need to know whether the
terminal wraps. There are two special flag capabilities to describe
what the terminal does when a graphic character is output in the last
column.
`am'
Flag whose presence means that writing a character in the last
column causes the cursor to wrap to the beginning of the next line.
If `am' is not present, writing in the last column leaves the
cursor at the place where the character was written.
Writing in the last column of the last line should be avoided on
terminals with `am', as it may or may not cause scrolling to occur
(*note Scrolling::.). Scrolling is surely not what you would
intend.
If your program needs to check the `am' flag, then it also needs
to check the `xn' flag which indicates that wrapping happens in a
strange way. Many common terminals have the `xn' flag.
`xn'
Flag whose presence means that the cursor wraps in a strange way.
At least two distinct kinds of strange behavior are known; the
termcap data base does not contain anything to distinguish the two.
On Concept-100 terminals, output in the last column wraps the
cursor almost like an ordinary `am' terminal. But if the next
thing output is a newline, it is ignored.
DEC VT-100 terminals (when the wrap switch is on) do a different
strange thing: the cursor wraps only if the next thing output is
another graphic character. In fact, the wrap occurs when the
following graphic character is received by the terminal, before the
character is placed on the screen.
On both of these terminals, after writing in the last column a
following graphic character will be displayed in the first column
of the following line. But the effect of relative cursor motion
characters such as newline or backspace at such a time depends on
the terminal. The effect of erase or scrolling commands also
depends on the terminal. You can't assume anything about what
they will do on a terminal that has `xn'. So, to be safe, you
should never do these things at such a time on such a terminal.
To be sure of reliable results on a terminal which has the `xn'
flag, output a `cm' absolute positioning command after writing in
the last column. Another safe thing to do is to output
carriage-return newline, which will leave the cursor at the
beginning of the following line.
`LP'
Flag whose presence means that it is safe to write in the last
column of the last line without worrying about undesired
scrolling. `LP' indicates the DEC flavor of `xn' strangeness.

File: termcap.info, Node: Scrolling, Next: Windows, Prev: Wrapping, Up: Capabilities
Scrolling
=========
"Scrolling" means moving the contents of the screen up or down one or
more lines. Moving the contents up is "forward scrolling"; moving them
down is "reverse scrolling".
Scrolling happens after each line of output during ordinary output
on most display terminals. But in an application program that uses
termcap for random-access output, scrolling happens only when
explicitly requested with the commands in this section.
Some terminals have a "scroll region" feature. This lets you limit
the effect of scrolling to a specified range of lines. Lines outside
the range are unaffected when scrolling happens. The scroll region
feature is available if either `cs' or `cS' is present.
`sf'
String of commands to scroll the screen one line up, assuming it is
output with the cursor at the beginning of the bottom line.
`sr'
String of commands to scroll the screen one line down, assuming it
is output with the cursor at the beginning of the top line.
`do'
A few programs will try to use `do' to do the work of `sf'. This
is not really correct--it is an attempt to compensate for the
absence of a `sf' command in some old terminal descriptions.
Since these terminal descriptions do define `sr', perhaps at one
time the definition of `do' was different and it could be used for
scrolling as well. But it isn't desirable to combine these two
functions in one capability, since scrolling often requires more
padding than simply moving the cursor down. Defining `sf' and
`do' separately allows you to specify the padding properly. Also,
all sources agree that `do' should not be relied on to do
scrolling.
So the best approach is to add `sf' capabilities to the
descriptions of these terminals, copying the definition of `do' if
that does scroll.
`SF'
String of commands to scroll the screen N lines up, assuming it is
output with the cursor at the beginning of the bottom line.
`SR'
String of commands to scroll the screen N lines down, assuming it
is output with the cursor at the beginning of the top line.
`cs'
String of commands to set the scroll region. This command takes
two parameters, START and END, which are the line numbers
(origin-zero) of the first line to include in the scroll region
and of the last line to include in it. When a scroll region is
set, scrolling is limited to the specified range of lines; lines
outside the range are not affected by scroll commands.
Do not try to move the cursor outside the scroll region. The
region remains set until explicitly removed. To remove the scroll
region, use another `cs' command specifying the full height of the
screen.
The cursor position is undefined after the `cs' command is set, so
position the cursor with `cm' immediately afterward.
`cS'
String of commands to set the scroll region using parameters in
different form. The effect is the same as if `cs' were used.
Four parameters are required:
1. Total number of lines on the screen.
2. Number of lines above desired scroll region.
3. Number of lines below (outside of) desired scroll region.
4. Total number of lines on the screen, the same as the first
parameter.
This capability is a GNU extension that was invented to allow the
Ann Arbor Ambassador's scroll-region command to be described; it
could also be done by putting non-Unix `%'-sequences into a `cs'
string, but that would have confused Unix programs that used the
`cs' capability with the Unix termcap. Currently only GNU Emacs
uses the `cS' capability.
`ns'
Flag which means that the terminal does not normally scroll for
ordinary sequential output. For modern terminals, this means that
outputting a newline in ordinary sequential output with the cursor
on the bottom line wraps to the top line. For some obsolete
terminals, other things may happen.
The terminal may be able to scroll even if it does not normally do
so. If the `sf' capability is provided, it can be used for
scrolling regardless of `ns'.
`da'
Flag whose presence means that lines scrolled up off the top of the
screen may come back if scrolling down is done subsequently.
The `da' and `db' flags do not, strictly speaking, affect how to
scroll. But programs that scroll usually need to clear the lines
scrolled onto the screen, if these flags are present.
`db'
Flag whose presence means that lines scrolled down off the bottom
of the screen may come back if scrolling up is done subsequently.
`lm'
Numeric value, the number of lines of display memory that the
terminal has. A value of zero means that the terminal has more
display memory than can fit on the screen, but no fixed number of
lines. (The number of lines may depend on the amount of text in
each line.)
Any terminal description that defines `SF' should also define `sf';
likewise for `SR' and `sr'. However, many terminals can only scroll by
one line at a time, so it is common to find `sf' and not `SF', or `sr'
without `SR'.
Therefore, all programs that use the scrolling facilities should be
prepared to work with `sf' in the case that `SF' is absent, and
likewise with `sr'. On the other hand, an application program that
uses only `sf' and not `SF' is acceptable, though slow on some
terminals.
When outputting a scroll command with `tputs', the NLINES argument
should be the total number of lines in the portion of the screen being
scrolled. Very often these commands require padding proportional to
this number of lines. *Note Padding::.

File: termcap.info, Node: Windows, Next: Clearing, Prev: Scrolling, Up: Capabilities
Windows
=======
A "window", in termcap, is a rectangular portion of the screen to
which all display operations are restricted. Wrapping, clearing,
scrolling, insertion and deletion all operate as if the specified
window were all the screen there was.
`wi'
String of commands to set the terminal output screen window. This
string requires four parameters, all origin-zero:
1. The first line to include in the window.
2. The last line to include in the window.
3. The first column to include in the window.
4. The last column to include in the window.
Most terminals do not support windows.

File: termcap.info, Node: Clearing, Next: Insdel Line, Prev: Windows, Up: Capabilities
Clearing Parts of the Screen
============================
There are several terminal capabilities for clearing parts of the
screen to blank. All display terminals support the `cl' string, and
most display terminals support all of these capabilities.
`cl'
String of commands to clear the entire screen and position the
cursor at the upper left corner.
`cd'
String of commands to clear the line the cursor is on, and all the
lines below it, down to the bottom of the screen. This command
string should be used only with the cursor in column zero; their
effect is undefined if the cursor is elsewhere.
`ce'
String of commands to clear from the cursor to the end of the
current line.
`ec'
String of commands to clear N characters, starting with the
character that the cursor is on. This command string is expected
to leave the cursor position unchanged. The parameter N should
never be large enough to reach past the right margin; the effect
of such a large parameter would be undefined.
Clear to end of line (`ce') is extremely important in programs that
maintain an updating display. Nearly all display terminals support this
operation, so it is acceptable for a an application program to refuse to
work if `ce' is not present. However, if you do not want this
limitation, you can accomplish clearing to end of line by outputting
spaces until you reach the right margin. In order to do this, you must
know the current horizontal position. Also, this technique assumes
that writing a space will erase. But this happens to be true on all
the display terminals that fail to support `ce'.

File: termcap.info, Node: Insdel Line, Next: Insdel Char, Prev: Clearing, Up: Capabilities
Insert/Delete Line
==================
"Inserting a line" means creating a blank line in the middle of the
screen, and pushing the existing lines of text apart. In fact, the
lines above the insertion point do not change, while the lines below
move down, and one is normally lost at the bottom of the screen.
"Deleting a line" means causing the line to disappear from the
screen, closing up the gap by moving the lines below it upward. A new
line appears at the bottom of the screen. Usually this line is blank,
but on terminals with the `db' flag it may be a line previously moved
off the screen bottom by scrolling or line insertion.
Insertion and deletion of lines is useful in programs that maintain
an updating display some parts of which may get longer or shorter.
They are also useful in editors for scrolling parts of the screen, and
for redisplaying after lines of text are killed or inserted.
Many terminals provide commands to insert or delete a single line at
the cursor position. Some provide the ability to insert or delete
several lines with one command, using the number of lines to insert or
delete as a parameter. Always move the cursor to column zero before
using any of these commands.
`al'
String of commands to insert a blank line before the line the
cursor is on. The existing line, and all lines below it, are
moved down. The last line in the screen (or in the scroll region,
if one is set) disappears and in most circumstances is discarded.
It may not be discarded if the `db' is present (*note
Scrolling::.).
The cursor must be at the left margin before this command is used.
This command does not move the cursor.
`dl'
String of commands to delete the line the cursor is on. The
following lines move up, and a blank line appears at the bottom of
the screen (or bottom of the scroll region). If the terminal has
the `db' flag, a nonblank line previously pushed off the screen
bottom may reappear at the bottom.
The cursor must be at the left margin before this command is used.
This command does not move the cursor.
`AL'
String of commands to insert N blank lines before the line that
the cursor is on. It is like `al' repeated N times, except that
it is as fast as one `al'.
`DL'
String of commands to delete N lines starting with the line that
the cursor is on. It is like `dl' repeated N times, except that
it is as fast as one `dl'.
Any terminal description that defines `AL' should also define `al';
likewise for `DL' and `dl'. However, many terminals can only insert or
delete one line at a time, so it is common to find `al' and not `AL',
or `dl' without `DL'.
Therefore, all programs that use the insert and delete facilities
should be prepared to work with `al' in the case that `AL' is absent,
and likewise with `dl'. On the other hand, it is acceptable to write
an application that uses only `al' and `dl' and does not look for `AL'
or `DL' at all.
If a terminal does not support line insertion and deletion directly,
but does support a scroll region, the effect of insertion and deletion
can be obtained with scrolling. However, it is up to the individual
user program to check for this possibility and use the scrolling
commands to get the desired result. It is fairly important to implement
this alternate strategy, since it is the only way to get the effect of
line insertion and deletion on the popular VT100 terminal.
Insertion and deletion of lines is affected by the scroll region on
terminals that have a settable scroll region. This is useful when it is
desirable to move any few consecutive lines up or down by a few lines.
*Note Scrolling::.
The line pushed off the bottom of the screen is not lost if the
terminal has the `db' flag capability; instead, it is pushed into
display memory that does not appear on the screen. This is the same
thing that happens when scrolling pushes a line off the bottom of the
screen. Either reverse scrolling or deletion of a line can bring the
apparently lost line back onto the bottom of the screen. If the
terminal has the scroll region feature as well as `db', the pushed-out
line really is lost if a scroll region is in effect.
When outputting an insert or delete command with `tputs', the NLINES
argument should be the total number of lines from the cursor to the
bottom of the screen (or scroll region). Very often these commands
require padding proportional to this number of lines. *Note Padding::.
For `AL' and `DL' the NLINES argument should *not* depend on the
number of lines inserted or deleted; only the total number of lines
affected. This is because it is just as fast to insert two or N lines
with `AL' as to insert one line with `al'.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,220 @@
This is Info file ./termcap.info, produced by Makeinfo-1.55 from the
input file ./termcap.texi.
This file documents the termcap library of the GNU system.
Copyright (C) 1988 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.
Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided that
the entire resulting derived work is distributed under the terms of a
permission notice identical to this one.
Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that this permission notice may be stated in a
translation approved by the Foundation.

File: termcap.info, Node: Cap Index, Next: Index, Prev: Var Index, Up: Top
Capability Index
****************
* Menu:
* ae: Standout.
* al: Insdel Line.
* AL: Insdel Line.
* am: Wrapping.
* as: Standout.
* bc: Cursor Motion.
* bl: Bell.
* bs: Cursor Motion.
* bt: Cursor Motion.
* bw: Cursor Motion.
* CC: Basic.
* cd: Clearing.
* ce: Clearing.
* ch: Cursor Motion.
* cl: Clearing.
* cm: Cursor Motion.
* CM: Cursor Motion.
* co: Screen Size.
* cr: Cursor Motion.
* cS: Scrolling.
* cs: Scrolling.
* ct: Initialization.
* cv: Cursor Motion.
* da: Scrolling.
* dB: Pad Specs.
* db: Scrolling.
* dC: Pad Specs.
* DC: Insdel Char.
* dc: Insdel Char.
* dF: Pad Specs.
* dl: Insdel Line.
* DL: Insdel Line.
* dm: Insdel Char.
* dN: Pad Specs.
* do: Cursor Motion.
* DO: Cursor Motion.
* ds: Status Line.
* dT: Pad Specs.
* ec: Clearing.
* ed: Insdel Char.
* ei: Insdel Char.
* eo: Basic.
* es: Status Line.
* ff: Cursor Motion.
* fs: Status Line.
* gn: Basic.
* hc: Basic.
* hd: Half-Line.
* ho: Cursor Motion.
* hs: Status Line.
* hu: Half-Line.
* hz: Basic.
* i1: Initialization.
* i3: Initialization.
* IC: Insdel Char.
* ic: Insdel Char.
* if: Initialization.
* im: Insdel Char.
* in: Insdel Char.
* ip: Insdel Char.
* is: Initialization.
* it: Initialization.
* K1...K5: Keypad.
* k1...k9: Keypad.
* kA...kT: Keypad.
* ka...ku: Keypad.
* km: Meta Key.
* l0...l9: Keypad.
* le: Cursor Motion.
* LE: Cursor Motion.
* li: Screen Size.
* ll: Cursor Motion.
* lm: Scrolling.
* LP: Wrapping.
* mb: Standout.
* md: Standout.
* me: Standout.
* mh: Standout.
* mi: Insdel Char.
* mk: Standout.
* mm: Meta Key.
* mo: Meta Key.
* mp: Standout.
* mr: Standout.
* ms: Standout.
* ms: Underlining.
* nc: Cursor Motion.
* nd: Cursor Motion.
* NF: Initialization.
* nl: Cursor Motion.
* ns: Scrolling.
* nw: Cursor Motion.
* os: Basic.
* pb: Pad Specs.
* pc: Pad Specs.
* pf: Printer.
* pO: Printer.
* po: Printer.
* ps: Printer.
* rc: Cursor Motion.
* RI: Cursor Motion.
* rp: Basic.
* rs: Initialization.
* sa: Standout.
* sc: Cursor Motion.
* se: Standout.
* SF: Scrolling.
* sf: Scrolling.
* sg: Standout.
* so: Standout.
* SR: Scrolling.
* sr: Scrolling.
* st: Initialization.
* ta: Cursor Motion.
* te: Initialization.
* ti: Initialization.
* ts: Status Line.
* uc: Underlining.
* ue: Underlining.
* ug: Underlining.
* ul: Underlining.
* up: Cursor Motion.
* UP: Cursor Motion.
* us: Underlining.
* vb: Bell.
* ve: Cursor Visibility.
* vi: Cursor Visibility.
* vs: Cursor Visibility.
* wi: Windows.
* ws: Status Line.
* xb: Basic.
* xn: Wrapping.
* xs: Standout.
* xt: Cursor Motion.
* xt: Standout.

File: termcap.info, Node: Index, Prev: Cap Index, Up: Top
Concept Index
*************
* Menu:
* %: Encode Parameters.
* appearance modes: Standout.
* bell: Bell.
* clearing the screen: Clearing.
* command character: Basic.
* cursor motion: Cursor Motion.
* delete character: Insdel Char.
* delete line: Insdel Line.
* delete mode: Insdel Char.
* description format: Format.
* erasing: Clearing.
* generic terminal type: Basic.
* home position: Cursor Motion.
* inheritance: Inheriting.
* initialization: Initialization.
* insert character: Insdel Char.
* insert line: Insdel Line.
* insert mode: Insdel Char.
* line speed: Output Padding.
* magic cookie: Standout.
* meta key: Meta Key.
* names of terminal types: Naming.
* overstrike: Basic.
* padding: Pad Specs.
* padding: Padding.
* parameters: Parameters.
* printer: Printer.
* repeat output: Basic.
* reset: Initialization.
* screen size: Screen Size.
* screen size: Naming.
* screen size: Screen Size.
* scrolling: Scrolling.
* standout: Standout.
* status line: Status Line.
* Superbee: Basic.
* tab stops: Initialization.
* termcap: Introduction.
* terminal flags (kernel): Initialize.
* underlining: Underlining.
* visibility: Cursor Visibility.
* visible bell: Bell.
* window: Windows.
* wrapping: Wrapping.
* wrapping: Naming.

28787
src/libs/termcap/termcap.src Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

5992
src/libs/termcap/texinfo.tex Normal file

File diff suppressed because it is too large Load Diff

332
src/libs/termcap/tparam.c Normal file
View File

@ -0,0 +1,332 @@
/* Merge parameters into a termcap entry string.
Copyright (C) 1985, 87, 93, 95, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* Emacs config.h may rename various library functions such as malloc. */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef emacs
#include "lisp.h" /* for xmalloc */
#else
#ifdef STDC_HEADERS
#include <stdlib.h>
#include <string.h>
#else
char *malloc ();
char *realloc ();
#endif
/* Do this after the include, in case string.h prototypes bcopy. */
#if (defined(HAVE_STRING_H) || defined(STDC_HEADERS)) && !defined(bcopy)
#define bcopy(s, d, n) memcpy ((d), (s), (n))
#endif
#endif /* not emacs */
#ifndef NULL
#define NULL (char *) 0
#endif
#ifndef emacs
static void
memory_out ()
{
write (2, "virtual memory exhausted\n", 25);
exit (1);
}
static char *
xmalloc (size)
unsigned size;
{
register char *tem = malloc (size);
if (!tem)
memory_out ();
return tem;
}
static char *
xrealloc (ptr, size)
char *ptr;
unsigned size;
{
register char *tem = realloc (ptr, size);
if (!tem)
memory_out ();
return tem;
}
#endif /* not emacs */
/* Assuming STRING is the value of a termcap string entry
containing `%' constructs to expand parameters,
merge in parameter values and store result in block OUTSTRING points to.
LEN is the length of OUTSTRING. If more space is needed,
a block is allocated with `malloc'.
The value returned is the address of the resulting string.
This may be OUTSTRING or may be the address of a block got with `malloc'.
In the latter case, the caller must free the block.
The fourth and following args to tparam serve as the parameter values. */
static char *tparam1 ();
/* VARARGS 2 */
char *
tparam (string, outstring, len, arg0, arg1, arg2, arg3)
char *string;
char *outstring;
int len;
int arg0, arg1, arg2, arg3;
{
int arg[4];
arg[0] = arg0;
arg[1] = arg1;
arg[2] = arg2;
arg[3] = arg3;
return tparam1 (string, outstring, len, NULL, NULL, arg);
}
char *BC;
char *UP;
static char tgoto_buf[50];
char *
tgoto (cm, hpos, vpos)
char *cm;
int hpos, vpos;
{
int args[2];
if (!cm)
return NULL;
args[0] = vpos;
args[1] = hpos;
return tparam1 (cm, tgoto_buf, 50, UP, BC, args);
}
static char *
tparam1 (string, outstring, len, up, left, argp)
char *string;
char *outstring;
int len;
char *up, *left;
register int *argp;
{
register int c;
register char *p = string;
register char *op = outstring;
char *outend;
int outlen = 0;
register int tem;
int *old_argp = argp;
int doleft = 0;
int doup = 0;
outend = outstring + len;
while (1)
{
/* If the buffer might be too short, make it bigger. */
if (op + 5 >= outend)
{
register char *new;
int offset = op - outstring;
if (outlen == 0)
{
outlen = len + 40;
new = (char *) xmalloc (outlen);
bcopy (outstring, new, offset);
}
else
{
outlen *= 2;
new = (char *) xrealloc (outstring, outlen);
}
op = new + offset;
outend = new + outlen;
outstring = new;
}
c = *p++;
if (!c)
break;
if (c == '%')
{
c = *p++;
tem = *argp;
switch (c)
{
case 'd': /* %d means output in decimal. */
if (tem < 10)
goto onedigit;
if (tem < 100)
goto twodigit;
case '3': /* %3 means output in decimal, 3 digits. */
if (tem > 999)
{
*op++ = tem / 1000 + '0';
tem %= 1000;
}
*op++ = tem / 100 + '0';
case '2': /* %2 means output in decimal, 2 digits. */
twodigit:
tem %= 100;
*op++ = tem / 10 + '0';
onedigit:
*op++ = tem % 10 + '0';
argp++;
break;
case 'C':
/* For c-100: print quotient of value by 96, if nonzero,
then do like %+. */
if (tem >= 96)
{
*op++ = tem / 96;
tem %= 96;
}
case '+': /* %+x means add character code of char x. */
tem += *p++;
case '.': /* %. means output as character. */
if (left)
{
/* If want to forbid output of 0 and \n and \t,
and this is one of them, increment it. */
while (tem == 0 || tem == '\n' || tem == '\t')
{
tem++;
if (argp == old_argp)
doup++, outend -= strlen (up);
else
doleft++, outend -= strlen (left);
}
}
*op++ = tem ? tem : 0200;
case 'f': /* %f means discard next arg. */
argp++;
break;
case 'b': /* %b means back up one arg (and re-use it). */
argp--;
break;
case 'r': /* %r means interchange following two args. */
argp[0] = argp[1];
argp[1] = tem;
old_argp++;
break;
case '>': /* %>xy means if arg is > char code of x, */
if (argp[0] > *p++) /* then add char code of y to the arg, */
argp[0] += *p; /* and in any case don't output. */
p++; /* Leave the arg to be output later. */
break;
case 'a': /* %a means arithmetic. */
/* Next character says what operation.
Add or subtract either a constant or some other arg. */
/* First following character is + to add or - to subtract
or = to assign. */
/* Next following char is 'p' and an arg spec
(0100 plus position of that arg relative to this one)
or 'c' and a constant stored in a character. */
tem = p[2] & 0177;
if (p[1] == 'p')
tem = argp[tem - 0100];
if (p[0] == '-')
argp[0] -= tem;
else if (p[0] == '+')
argp[0] += tem;
else if (p[0] == '*')
argp[0] *= tem;
else if (p[0] == '/')
argp[0] /= tem;
else
argp[0] = tem;
p += 3;
break;
case 'i': /* %i means add one to arg, */
argp[0] ++; /* and leave it to be output later. */
argp[1] ++; /* Increment the following arg, too! */
break;
case '%': /* %% means output %; no arg. */
goto ordinary;
case 'n': /* %n means xor each of next two args with 140. */
argp[0] ^= 0140;
argp[1] ^= 0140;
break;
case 'm': /* %m means xor each of next two args with 177. */
argp[0] ^= 0177;
argp[1] ^= 0177;
break;
case 'B': /* %B means express arg as BCD char code. */
argp[0] += 6 * (tem / 10);
break;
case 'D': /* %D means weird Delta Data transformation. */
argp[0] -= 2 * (tem % 16);
break;
default:
abort ();
}
}
else
/* Ordinary character in the argument string. */
ordinary:
*op++ = c;
}
*op = 0;
while (doup-- > 0)
strcat (op, up);
while (doleft-- > 0)
strcat (op, left);
return outstring;
}
#ifdef DEBUG
main (argc, argv)
int argc;
char **argv;
{
char buf[50];
int args[3];
args[0] = atoi (argv[2]);
args[1] = atoi (argv[3]);
args[2] = atoi (argv[4]);
tparam1 (argv[1], buf, "LEFT", "UP", args);
printf ("%s\n", buf);
return 0;
}
#endif /* DEBUG */

View File

@ -0,0 +1,2 @@
/* Make the library identifiable with the RCS ident command. */
static char *version_string = "\n$Version: GNU termcap 1.3.1 $\n";