Import ncurses-5.0-release to update the 5.0-prerelease that we had.

This commit is contained in:
Peter Wemm 2000-01-26 16:43:25 +00:00
parent 0e3d540892
commit 1759abf3ae
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/vendor/ncurses/dist/; revision=56639
svn path=/vendor/ncurses/5.0/; revision=56641; tag=vendor/ncurses/5.0
86 changed files with 4649 additions and 1593 deletions

View File

@ -22,8 +22,8 @@
manual pages are provided for the library and tools.
The ncurses distribution is available via anonymous FTP at the GNU
distribution site [1]ftp://ftp.gnu.org/pub/gnu. It is also available
at [2]ftp://ftp.clark.net/pub/dickey/ncurses.
distribution site [1]ftp://ftp.gnu.org/pub/gnu/ncurses. It is also
available at [2]ftp://ftp.clark.net/pub/dickey/ncurses.
Release Notes
@ -63,8 +63,8 @@
%x, %o as per XSI.
* We made additional changes to reduce impact by future interface
changes:
+ change key_names[] array to static since it is not part of
the curses interface.
+ rename key_names[] array to _nc_key_names since it is not
part of the curses interface.
+ move macro winch to a function, to hide details of struct
ldat
* modify configure script to embed ABI in shared libraries for HP-UX
@ -140,7 +140,6 @@
The ncurses package is fully compatible with SVr4 (System V Release 4)
curses:
* All 257 of the SVr4 calls have been implemented (and are
documented).
* Full support for SVr4 curses features including keyboard mapping,
@ -160,7 +159,6 @@
HP/UX and AIX ports.
The ncurses package also has many useful extensions over SVr4:
* The API is 8-bit clean and base-level conformant with the X/OPEN
curses specification, XSI curses (that is, it implements all BASE
level features, but not all EXTENDED features). Most
@ -168,7 +166,7 @@
support are implemented, including many function calls not
supported under SVr4 curses (but portability of all calls is
documented so you can use the SVr4 subset only).
* Unlike SVr4 curses, ncurses can write to the rightmost-bottommost
* Unlike SVr3 curses, ncurses can write to the rightmost-bottommost
corner of the screen if your terminal has an insert-character
capability.
* Ada95 and C++ bindings.
@ -253,29 +251,37 @@
The ncurses code has been tested with a wide variety of applications
including (versions starting with those noted):
cdk
Curses Development Kit [3]Curses Development Kit
[4]ftp://ftp.clark.net/pub/dickey/cdk.
ded
directory-editor [3]ftp://ftp.clark.net/pub/dickey/ded.
directory-editor [5]ftp://ftp.clark.net/pub/dickey/ded.
dialog
the underlying application used in Slackware's setup, and the
basis for similar applications on GNU/Linux.
lynx-2.7
lynx
the character-screen WWW browser
Midnight Commander 4.1
file manager
mutt 0.88
mutt
mail utility
ncftp 2.0
ncftp
file-transfer utility
nvi
New vi versions 1.50 are able to use ncurses versions 1.9.7 and
later.
tin
newsreader, supporting color, MIME
[6]ftp://ftp.akk.uni-karlsruhe.de/pub/news/clients/tin-unoff.
taper
tape archive utility
@ -284,26 +290,22 @@
as well as some that use ncurses for the terminfo support alone:
minicom-1.75
minicom
terminal emulator
tin-unoff
tin 1.4 newsreader, supporting color, MIME
[4]ftp://ftp.akk.uni-karlsruhe.de/pub/news/clients/tin-unoff.
vile
vi-like-emacs [5]ftp://ftp.clark.net/pub/dickey/vile.
vi-like-emacs [7]ftp://ftp.clark.net/pub/dickey/vile.
The ncurses distribution includes a selection of test programs
(including a few games).
Who's Who and What's What
The original developers of ncurses are [6]Zeyd Ben-Halim and [7]Eric
S. Raymond. Ongoing work is being done by [8]Thomas Dickey and
[9]Jürgen Pfeifer. [10]Florian La Roche acts as the maintainer for the
The original developers of ncurses are [8]Zeyd Ben-Halim and [9]Eric
S. Raymond. Ongoing work is being done by [10]Thomas Dickey and
[11]Jürgen Pfeifer. [12]Thomas Dickey acts as the maintainer for the
Free Software Foundation, which holds the copyright on ncurses.
Contact the current maintainers at [11]bug-ncurses@gnu.org.
Contact the current maintainers at [13]bug-ncurses@gnu.org.
To join the ncurses mailing list, please write email to
bug-ncurses-request@gnu.org containing the line:
@ -313,7 +315,7 @@ Who's Who and What's What
and testing of this package.
Beta versions of ncurses and patches to the current release are made
available at [12]ftp://ftp.clark.net/pub/dickey/ncurses.
available at [14]ftp://ftp.clark.net/pub/dickey/ncurses.
Future Plans
@ -328,24 +330,26 @@ Other Related Resources
The distribution includes and uses a version of the terminfo-format
terminal description file maintained by Eric Raymond.
[13]http://earthspace.net/~esr/terminfo.
[15]http://earthspace.net/~esr/terminfo.
You can find lots of information on terminal-related topics not
covered in the terminfo file at [14]Richard Shuford's archive.
covered in the terminfo file at [16]Richard Shuford's archive.
References
1. ftp://ftp.gnu.org/pub/gnu
1. ftp://ftp.gnu.org/pub/gnu/ncurses
2. ftp://ftp.clark.net/pub/dickey/ncurses
3. ftp://ftp.clark.net/pub/dickey/ded
4. ftp://ftp.akk.uni-karlsruhe.de/pub/news/clients/tin-unoff
5. ftp://ftp.clark.net/pub/dickey/vile
6. mailto:zmbenhal@netcom.com
7. http://www.ccil.org/~esr/home.html
8. mailto:dickey@clark.net
9. mailto:juergen.pfeifer@gmx.net
10. mailto:florian@gnu.org
11. mailto:bug-ncurses@gnu.org
12. ftp://ftp.clark.net/pub/dickey/ncurses
13. http://earthspace.net/~esr/terminfo
14. http://www.cs.utk.edu/~shuford/terminal_index.html
3. http://www.vexus.ca/CDK.html
4. ftp://ftp.clark.net/pub/dickey/cdk
5. ftp://ftp.clark.net/pub/dickey/ded
6. ftp://ftp.akk.uni-karlsruhe.de/pub/news/clients/tin-unoff
7. ftp://ftp.clark.net/pub/dickey/vile
8. mailto:zmbenhal@netcom.com
9. http://www.ccil.org/~esr/home.html
10. mailto:dickey@clark.net
11. mailto:juergen.pfeifer@gmx.net
12. mailto:dickey@clark.net
13. mailto:bug-ncurses@gnu.org
14. ftp://ftp.clark.net/pub/dickey/ncurses
15. http://earthspace.net/~esr/terminfo
16. http://www.cs.utk.edu/~shuford/terminal_index.html

View File

@ -1,4 +1,4 @@
-- $Id: INSTALL,v 1.32 1999/07/24 21:06:24 tom Exp $
-- $Id: INSTALL,v 1.33 1999/09/18 23:04:36 tom Exp $
---------------------------------------------------------------------
How to install Ncurses/Terminfo on your system
---------------------------------------------------------------------
@ -195,12 +195,17 @@ INSTALLATION PROCEDURE:
See the BSD CONVERSION NOTES section below for a few more details.
6. The c++ directory has C++ classes that are built on top of ncurses and
panels. You need to have c++ (and its libraries) installed before you can
panels. You must have c++ (and its libraries) installed before you can
compile and run the demo.
If you do not have C++, you must use the --without-cxx option to tell
the configure script to not attempt to build the C++ bindings.
Use --without-cxx-binding to tell configure to not build the C++ bindings
and demo.
If you do not have C++, you must use the --without-cxx option to tell
the configure script to not attempt to determine the type of 'bool'
which may be supported by C++. IF YOU USE THIS OPTION, BE ADVISED THAT
YOU MAY NOT BE ABLE TO COMPILE (OR RUN) NCURSES APPLICATIONS WITH C++.
7. If you're running an older Linux, you must either (a) tell Linux that the
console terminal type is `linux' or (b) make a link to or copy of the
linux entry in the appropriate place under your terminfo directory, named

View File

@ -626,6 +626,7 @@
./ncurses/base/safe_sprintf.c
./ncurses/base/sigaction.c
./ncurses/base/tries.c
./ncurses/base/version.c
./ncurses/base/vsscanf.c
./ncurses/base/wresize.c
./ncurses/curses.priv.h
@ -770,8 +771,10 @@
./test/bs.c
./test/cardfile.c
./test/cardfile.dat
./test/configure
./test/configure.in
./test/ditto.c
./test/dots.c
./test/filter.c
./test/firework.c
./test/firstlast.c

View File

@ -159,6 +159,7 @@ libncurses-routines = \
base/safe_sprintf \
base/sigaction \
base/tries \
base/version \
base/vsscanf \
base/wresize \
codes \

View File

@ -1,4 +1,4 @@
-- $Id: NEWS,v 1.474 1999/08/22 00:12:43 tom Exp $
-- $Id: NEWS,v 1.504 1999/10/24 00:31:05 tom Exp $
This is a log of changes that ncurses has gone through since Zeyd started
working with Pavel Curtis' original work, pcurses, in 1992.
@ -6,6 +6,152 @@ working with Pavel Curtis' original work, pcurses, in 1992.
Changes through 1.9.9e are recorded by Zeyd M. Ben-Halim.
Changes since 1.9.9e are recorded by Thomas Dickey.
19991023 5.0 release for upload to ftp.gnu.org
+ effective with release of 5.0, change NCURSES_VERSION_PATCH to
4-digit year.
+ add function curses_version(), to return ncurses library version
(request by Bob van der Poel).
+ remove rmam, smam from cygwin terminfo entry.
+ modify FreeBSD cons25 terminfo entry to add cnorm and cvvis, as well
as update ncv to indicate that 'dim' conflicts with colors.
+ modify configure script to use symbolic links for FreeBSD shared
libraries by default.
+ correct ranf() function in rain and worm programs to ensure it does
not return 1.0
+ hide the cursor in hanoi.c if it is running automatically.
+ amend lrtest.c to account for optimizations that exploit margin
wrapping.
+ add a simple terminfo demo, dots.c
+ modify SIGINT/SIGQUIT handler to set a flag used in _nc_outch() to
tell it to use write() rather than putc(), since the latter is not
safe in a signal handler according to POSIX.
+ add/use internal macros _nc_flush() and NC_OUTPUT to hide details
of output-file pointer in ncurses library.
+ uncomment CC_SHARED_OPTS (see 971115), since they are needed for SCO
OpenServer.
+ correct CC_SHARED_OPTS for building shared libraries for SCO
OpenServer.
+ remove usleep() from alternatives in napms(), since it may interact
with alarm(), causing a process to be interrupted by SIGALRM (with
advice from Bela Lubkin).
+ modify terminal_interface-curses-forms.ads.m4 to build/work with
GNAT 3.10 (patch by Juergen Pfeifer).
+ remove part of CF_GPP_LIBRARY configure-script macro, which did not
work with gcc 2.7.2.3
+ minor fix to test/tclock.c to avoid beeping more than once per second
+ add 's' and ' ' decoding to test/rain.c
991016 pre-release
+ corrected BeOS code for lib_twait.c, making nodelay() function work.
991009 pre-release
+ correct ncurses' value for cursor-column in PutCharLR(), which was
off-by-one in one case (patch by Ilya Zakharevich).
+ fix some minor errors in position_check() debugging code, found while
using this to validate the PutCharLR() patch.
+ modify firework, lrtest, worm examples to be resizable, and to
recognize 'q' for quit, 's' for single-step and ' ' for resume.
+ restore reverted change to terminal_interface-curses-forms.ads.m4,
add a note on building with gnat 3.10p to Ada95/TODO.
+ add a copy of the standalone configure script for the test-directory
to simplify testing on SCO and Solaris.
991002 pre-release
+ minor fixes for _nc_msec_cost(), color_content(), pair_content(),
_nc_freewin(), ClrBottom() and onscreen_mvcur() (analysis by Philippe
Blain, comments by Alexander Lukyanov).
+ simplify definition of PANEL and eliminate internal functions
_nc_calculate_obscure(), _nc_free_obscure() and _nc_override(),
(patch by Juergen Pfeifer, based on analysis by Philippe Blain
<bledp@voila.fr>)).
+ change renaming of dft_fgbg.3x to use_default_colors.3ncurses in
man_db.renames, since Debian is not concerned with 14-character
filename limitation (from Debian bug report by Josip Rodin
<joy@cibalia.gkvk.hr>).
+ corrected scoansi terminfo entry by testing with scoterm and console.
+ revert change from 990614 to terminal_interface-curses-forms.ads.m4,
since this does not work for gnat 3.10p
+ modify tclock example to be resizable (if ncurses' sigwinch handler
is used), and in color.
+ use $(CC) rather than 'gcc' in MK_SHARED_LIB symbols, used for Linux
shared library rules.
990925 pre-release
+ add newer NetBSD console terminfo entries
+ add amiga-8bit terminfo entry (from Henning 'Faroul' Peters
<Faroul@beyond.kn-bremen.de>)
+ remove -lcurses -ltermcap from configure script's check for the gpm
library, since they are not really necessary (a properly configured
gpm library has no dependency on any curses library), and if the
curses library is not installed, this would cause the test to fail.
+ modify tic's -C option so that terminfo "use=" clauses are translated
to "tc=" clauses even when running it as captoinfo.
+ modify CF_STDCPP_LIBRARY configure macro to perform its check only
for GNU C++, since that library conflicts with SGI's libC on IRIX-6.2
+ modify CF_SHARED_OPTS configure macro to support build on NetBSD with
ELF libraries (patch by Bernd Ernesti <bernd@arresum.inka.de>).
+ correct a problem in libpanel, where the _nc_top_panel variable was
not set properly when bottom_panel() is called to hide a panel which
is the only one on the stack (report/analysis by Michael Andres
<ma@suse.de>, patch by Juergen Pfeifer).
990918 pre-release
+ add acsc string to HP 70092 terminfo entry (patch by Joerg Wunsch
<j@interface-business.de>).
+ add top-level uninstall.data and uninstall.man makefile rules.
+ correct logic of CF_LINK_FUNCS configure script, from BeOS changes so
that hard-links work on Unix again.
+ change default value of cf_cv_builtin_bool to 1 as suggested by
Jeremy Buhler, making it less likely that a conflicting declaration
of bool will be seen when compiling with C++.
990911 pre-release
+ improved configure checks for builtin.h
+ minor changes to C++ binding (remove static initializations, and make
configure-test for parameter initializations) for features not
allowed by vendor's C++ compilers (reported by Martin Mokrejs, this
applies to SGI, though I found SCO has the same characteristics).
+ corrected quoting of ETIP_xxx definitions which support old versions
of g++, e.g., those using -lg++
+ remove 'L' code from safe_sprintf.c, since 'long double' is not
widely portable. safe_sprintf.c is experimental, however, and
exists mainly as a fallback for systems without snprintf (reported
by Martin Mokrejs <mmokrejs@natur.cuni.cz>, for IRIX 6.2)
+ modify definition of _nc_tinfo_fkeys in broken-linker configuration
so that it is not unnecessarily made extern (Jeffrey C Honig).
990904 pre-release
+ move definition for builtin.h in configure tests to specific check
for libg++, since qt uses the same filename incompatibly.
+ correct logic of lib_termcap.c tgetstr function, which did not copy
the result to the buffer parameter. Testing shows Solaris does
update this, though of course tgetent's buffer is untouched (from
mpc.lists.freebsd.current newsgroup item by Peter Edwards
<peter.edwards@ireland.com>).
+ corrected beterm terminfo entry, which lists some capabilities which
are not actually provided by the BeOS Terminal.
+ add special logic to replace select() calls on BeOS, whose select()
function works only for sockets.
+ correct missing escape in mkterm.h.awk.in, which caused part
of the copyright noticed to be omitted (reported by Peter
Wemm <peter@netplex.com.au>).
> several small changes to make the c++ binding and demo work on OS/2
EMX (related to a clean reinstall of EMX):
+ correct library-prefix for c++ binding; none is needed.
+ add $x suffix to make_hash and make_keys so 'make distclean' works.
+ correct missing $x suffix for tack, c++ demo executables.
+ split CF_CXX_LIBRARY into CF_GPP_LIBRARY (for -lg++) and
CF_STDCPP_LIBRARY (for -lstdc++)
990828 pre-release
+ add cygwin terminfo entry -TD
+ modify CF_PROG_EXT configure macro to set .exe extension for cygwin.
+ add configure option --without-cxx-binding, modifying the existing
--without-cxx option to check only for the C++ compiler
characteristics. Whether or not the C++ binding is needed, the
configure script checks for the size/type of bool, to make ncurses
match. Otherwise C++ applications cannot use ncurses.
990821 pre-release
+ updated configure macros CF_MAKEFLAGS, CF_CHECK_ERRNO
+ minor corrections to beterm terminfo entry.
@ -104,9 +250,9 @@ Changes since 1.9.9e are recorded by Thomas Dickey.
handle SIGTSTP if neither is available (from report by Philippe De
Muyter).
> patch by Philippe De Muyter:
+ in tic.c, use `unlink' if `remove' is not available.
+ in tic.c, use `unlink' if `remove' is not available.
+ use only `unsigned' as fallback value for `speed_t'. Some files used
`short' instead.
`short' instead.
990616 pre-release
+ fix some compiler warnings in tack.
@ -122,7 +268,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey.
in the binding. It should have no effect on the generated code.
+ improve the man page for field_buffer() to tell the people, that the
whole buffer including leading/trailing spaces is returned. This is
a common source of confusion, so it's better to document it clearly.
a common source of confusion, so it's better to document it clearly.
990614 pre-release
> patch by Juergen Pfeifer:
@ -133,7 +279,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey.
990612 pre-release
+ modify lib_endwin.c to avoid calling reset_shell_mode(), return ERR
if it appears that curses was never initialized, e.g., by initscr().
if it appears that curses was never initialized, e.g., by initscr().
For instance, this guards against setting the terminal modes to
strange values if endwin() is called after setupterm(). In the same
context, Solaris curses will dump core.
@ -159,9 +305,9 @@ Changes since 1.9.9e are recorded by Thomas Dickey.
+ minor fix to build tack on CLIX (mismatched const).
> patch by Juergen Pfeifer:
+ change Juergen's old email address with new one in the files where it
is referenced. The Ada95 HTML pages are regenerated.
is referenced. The Ada95 HTML pages are regenerated.
+ update MANIFEST to list the tack files.
990509 pre-release
+ minor fixes to make 'tack' build/link on NeXT (reported by Francisco
A. Tomei Torres).
@ -221,13 +367,13 @@ Changes since 1.9.9e are recorded by Thomas Dickey.
+ change inequality in hashmap.c which checks the distance traveled by
a chunk so that ^D command in nvi (scrolls 1/2 screen) will use
scrolling logic (patch by Alexander Lukyanov, reported by Jeffrey
Honig).
C Honig).
990314 pre-release
+ modify lib_color.c to handle a special case where the curscr
attributes have been made obsolete (patch by Alexander Lukyanov).
+ update BSD/OS console terminfo entries to use klone+sgr and
klone+color (patch by Jeffrey Honig).
klone+color (patch by Jeffrey C Honig).
+ update glibc addon configure script for extended capabilities.
+ correct a couple of warnings in the --enable-const configuration.
+ make comp_hash build properly with _nc_strdup(), on NeXT (reported by
@ -340,7 +486,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey.
+ cache last result from _nc_baudrate, for performance (suggested by
Alexander Lukyanov).
+ modify ClrUpdate() function to workaround a problem in nvi, which
uses redrawwin in SIGTSTP handling. Jeffrey Honig reported that
uses redrawwin in SIGTSTP handling. Jeffrey C Honig reported that
ncurses repainted the screen with nulls before resuming normal
operation (patch by Alexander Lukyanov).
+ generalize is_xterm() function a little by letting xterm/rxvt/kterm

View File

@ -1,4 +1,4 @@
-- $Id: README,v 1.17 1998/02/15 01:26:47 tom Exp $
-- $Id: README,v 1.19 1999/10/23 20:39:24 tom Exp $
-------------------------------------------------------------------------------
README file for the ncurses package
@ -18,7 +18,7 @@ You should be reading this file in a directory called: ncurses-d.d, where d.d
is the current version number (see the dist.mk file in this directory for
that). There should be a number of subdirectories, including `c++', `form',
`man', `menu', `misc', `ncurses', `panel', `progs', `test', 'tack' and `Ada95'.
(The 'tack' program is distributed separately).
(The 'tack' program may be distributed separately).
A full build/install of this package typically installs several libraries, a
handful of utilities, and a database hierarchy. Here is an inventory of the
@ -114,7 +114,7 @@ Pavel Curtis:
Zeyd M. Ben-Halim:
port of original to Linux and many enhancements.
Thomas Dickey (maintainer since 1.9.9e):
Thomas Dickey (maintainer for 1.9.9g through 4.1, resuming with FSF's 5.0):
configuration scripts, porting, mods to adhere to XSI Curses in the
areas of background color, terminal modes. Also memory leak testing,
the wresize, default colors and key definition extensions and numerous

View File

@ -1,5 +1,5 @@
dnl***************************************************************************
dnl Copyright (c) 1998 Free Software Foundation, Inc. *
dnl Copyright (c) 1998,1999 Free Software Foundation, Inc. *
dnl *
dnl Permission is hereby granted, free of charge, to any person obtaining a *
dnl copy of this software and associated documentation files (the *
@ -28,7 +28,7 @@ dnl***************************************************************************
dnl
dnl Author: Thomas E. Dickey <dickey@clark.net> 1996,1997,1998
dnl
dnl $Id: aclocal.m4,v 1.162 1999/08/22 00:13:21 tom Exp $
dnl $Id: aclocal.m4,v 1.179 1999/10/23 21:49:25 tom Exp $
dnl Macros used in NCURSES auto-configuration script.
dnl
dnl ---------------------------------------------------------------------------
@ -154,7 +154,11 @@ AC_CACHE_VAL(cf_cv_type_of_bool,[
AC_TRY_RUN([
#include <stdlib.h>
#include <stdio.h>
#if HAVE_BUILTIN_H
#if HAVE_GXX_BUILTIN_H
#include <g++/builtin.h>
#elif HAVE_GPP_BUILTIN_H
#include <gpp/builtin.h>
#elif HAVE_BUILTIN_H
#include <builtin.h>
#endif
main()
@ -350,26 +354,35 @@ fi
])dnl
dnl ---------------------------------------------------------------------------
dnl If we're trying to use g++, test if libg++ is installed (a rather common
dnl problem :-). If we have the compiler but no library, we'll be able to
dnl configure, but won't be able to build the c++ demo program.
AC_DEFUN([CF_CXX_LIBRARY],
dnl Check if the C++ compiler accepts duplicate parameter initialization. This
dnl is a late feature for the standard and is not in some recent compilers
dnl (1999/9/11).
AC_DEFUN([CF_CPP_PARAM_INIT],
[
cf_cxx_library=unknown
if test $ac_cv_prog_gxx = yes; then
AC_MSG_CHECKING([for libg++])
cf_save="$LIBS"
LIBS="$LIBS -lg++ -lm"
AC_TRY_LINK([
#include <builtin.h>
],
[float foo=abs(1.0)],
[cf_cxx_library=yes
CXXLIBS="$CXXLIBS -lg++ -lm"],
[cf_cxx_library=no])
LIBS="$cf_save"
AC_MSG_RESULT($cf_cxx_library)
if test -n "$CXX" ; then
AC_CACHE_CHECK(if $CXX accepts parameter initialization,cf_cv_cpp_param_init,[
AC_LANG_CPLUSPLUS
AC_TRY_RUN([
class TEST {
private:
int value;
public:
TEST(int x = 1);
~TEST();
};
TEST::TEST(int x = 1) // some compilers do not like second initializer
{
value = x;
}
void main() { }
],
[cf_cv_cpp_param_init=yes],
[cf_cv_cpp_param_init=no],
[cf_cv_cpp_param_init=unknown])
])
fi
test "$cf_cv_cpp_param_init" = yes && AC_DEFINE(CPP_HAS_PARAM_INIT)
])dnl
dnl ---------------------------------------------------------------------------
AC_DEFUN([CF_DIRS_TO_MAKE],
@ -410,8 +423,8 @@ do
AC_TRY_COMPILE([
#include <etip.h.in>
],[],[
test -n "$cf_math" && AC_DEFINE(ETIP_NEEDS_${cf_math})
test -n "$cf_excp" && AC_DEFINE(ETIP_NEEDS_${cf_excp})
test -n "$cf_math" && AC_DEFINE_UNQUOTED(ETIP_NEEDS_${cf_math})
test -n "$cf_excp" && AC_DEFINE_UNQUOTED(ETIP_NEEDS_${cf_excp})
cf_result="$cf_math $cf_excp"
break
],[])
@ -473,7 +486,7 @@ cat > conftest.i <<EOF
EOF
if test -n "$GCC"
then
AC_CHECKING([for gcc __attribute__ directives])
AC_CHECKING([for $CC __attribute__ directives])
changequote(,)dnl
cat > conftest.$ac_ext <<EOF
#line __oline__ "configure"
@ -500,7 +513,7 @@ EOF
do
CF_UPPER(CF_ATTRIBUTE,$cf_attribute)
cf_directive="__attribute__(($cf_attribute))"
echo "checking for gcc $cf_directive" 1>&AC_FD_CC
echo "checking for $CC $cf_directive" 1>&AC_FD_CC
case $cf_attribute in
scanf|printf)
cat >conftest.h <<EOF
@ -546,7 +559,7 @@ then
int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
EOF
changequote([,])dnl
AC_CHECKING([for gcc warning options])
AC_CHECKING([for $CC warning options])
cf_save_CFLAGS="$CFLAGS"
EXTRA_CFLAGS="-W -Wall"
cf_warn_CONST=""
@ -625,6 +638,50 @@ esac
changequote([, ])dnl
])
dnl ---------------------------------------------------------------------------
dnl If we're trying to use g++, test if libg++ is installed (a rather common
dnl problem :-). If we have the compiler but no library, we'll be able to
dnl configure, but won't be able to build the c++ demo program.
AC_DEFUN([CF_GPP_LIBRARY],
[
cf_cxx_library=unknown
case $cf_cv_system_name in #(vi
os2*) #(vi
cf_gpp_libname=gpp
;;
*)
cf_gpp_libname=g++
;;
esac
if test $ac_cv_prog_gxx = yes; then
AC_MSG_CHECKING([for lib$cf_gpp_libname])
cf_save="$LIBS"
LIBS="$LIBS -l$cf_gpp_libname -lm"
AC_TRY_LINK([
#include <$cf_gpp_libname/builtin.h>
],
[//float foo=abs(1.0);
two_arg_error_handler_t foo2 = lib_error_handler],
[cf_cxx_library=yes
CXXLIBS="$CXXLIBS -l$cf_gpp_libname -lm"
if test "$cf_gpp_libname" = cpp ; then
AC_DEFINE(HAVE_GPP_BUILTIN_H)
else
AC_DEFINE(HAVE_GXX_BUILTIN_H)
fi],
[AC_TRY_LINK([
#include <builtin.h>
],
[//float foo=abs(1.0);
two_arg_error_handler_t foo2 = lib_error_handler],
[cf_cxx_library=yes
CXXLIBS="$CXXLIBS -l$cf_gpp_libname -lm"
AC_DEFINE(HAVE_BUILTIN_H)],
[cf_cxx_library=no])])
LIBS="$cf_save"
AC_MSG_RESULT($cf_cxx_library)
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl Insert text into the help-message, for readability, from AC_ARG_WITH.
AC_DEFUN([CF_HELP_MESSAGE],
[AC_DIVERT_HELP([$1])dnl
@ -675,6 +732,8 @@ AC_DEFUN([CF_LIB_PREFIX],
os2) $1='' ;;
*) $1='lib' ;;
esac
LIB_PREFIX=[$]$1
AC_SUBST(LIB_PREFIX)
])dnl
dnl ---------------------------------------------------------------------------
dnl Append definitions and rules for the given models to the subdirectory
@ -821,10 +880,12 @@ done
cat >> Makefile <<CF_EOF
install.data ::
install.data \
uninstall.data ::
cd misc && \$(MAKE) \$(CF_MFLAGS) \[$]@
install.man ::
install.man \
uninstall.man ::
cd man && \$(MAKE) \$(CF_MFLAGS) \[$]@
distclean ::
@ -935,8 +996,15 @@ AC_DEFUN([CF_LIB_SUFFIX],
profile) $2='_p.a' ;;
shared)
case $cf_cv_system_name in
openbsd*|netbsd*|freebsd*)
openbsd*|freebsd*)
$2='.so.$(REL_VERSION)' ;;
netbsd*)
if test -f /usr/libexec/ld.elf_so; then
$2='.so'
else
$2='.so.$(REL_VERSION)'
fi
;;
hpux*) $2='.sl' ;;
*) $2='.so' ;;
esac
@ -1058,7 +1126,9 @@ int main()
}
],[
cf_cv_link_funcs="$cf_cv_link_funcs $cf_func"
eval 'ac_cv_func_'$cf_func'=yes'],[
eval 'ac_cv_func_'$cf_func'=yes'
CF_UPPER(cf_FUNC,$cf_func)
AC_DEFINE_UNQUOTED(HAVE_$cf_FUNC)],[
eval 'ac_cv_func_'$cf_func'=no'],[
eval 'ac_cv_func_'$cf_func'=error'])
done
@ -1076,7 +1146,7 @@ AC_DEFUN([CF_MAKEFLAGS],
AC_MSG_CHECKING([for makeflags variable])
AC_CACHE_VAL(cf_cv_makeflags,[
cf_cv_makeflags=''
for cf_option in '-$(MAKEFLAGS)' '$(MFLAGS)'
for cf_option in '-$(MAKEFLAGS)' '$(MFLAGS)'
do
cat >cf_makeflags.tmp <<CF_EOF
all :
@ -1367,9 +1437,13 @@ case $cf_cv_system_name in
os2*)
# We make sure -Zexe is not used -- it would interfere with @PROG_EXT@
CFLAGS="$CFLAGS -Zmt -D__ST_MT_ERRNO__"
CXXFLAGS="$CXXFLAGS -Zmt -D__ST_MT_ERRNO__"
LDFLAGS=`echo "$LDFLAGS -Zmt -Zcrtdll" | sed "s/-Zexe//g"`
PROG_EXT=".exe"
;;
cygwin*)
PROG_EXT=".exe"
;;
esac
AC_SUBST(PROG_EXT)
])dnl
@ -1521,18 +1595,32 @@ AC_DEFUN([CF_SHARED_OPTS],
fi
test $cf_cv_shlib_version = auto && cf_cv_shlib_version=rel
if test $cf_cv_shlib_version = no ; then
MK_SHARED_LIB='gcc -shared -Wl,-stats,-lc -o $[@]'
MK_SHARED_LIB='$(CC) -shared -Wl,-stats,-lc -o $[@]'
else
MK_SHARED_LIB='gcc -shared -Wl,-soname,`basename $[@].$(ABI_VERSION)`,-stats,-lc -o $[@]'
MK_SHARED_LIB='$(CC) -shared -Wl,-soname,`basename $[@].$(ABI_VERSION)`,-stats,-lc -o $[@]'
fi
;;
openbsd2*)
CC_SHARED_OPTS='-fpic -DPIC'
MK_SHARED_LIB='$(LD) -Bshareable -soname,`basename $[@].$(ABI_VERSION)` -o $[@]'
;;
openbsd*|netbsd*|freebsd*)
openbsd*|freebsd*)
CC_SHARED_OPTS='-fpic -DPIC'
MK_SHARED_LIB='$(LD) -Bshareable -o $[@]'
test $cf_cv_shlib_version = auto && cf_cv_shlib_version=rel
;;
netbsd*)
CC_SHARED_OPTS='-fpic -DPIC'
test $cf_cv_ld_rpath = yes && cf_ld_rpath_opt="-Wl,-rpath,"
if test $DFT_LWR_MODEL = "shared" && test $cf_cv_ld_rpath = yes ; then
LOCAL_LDFLAGS='-Wl,-rpath,../lib'
LOCAL_LDFLAGS2='-Wl,-rpath,../../lib'
EXTRA_LDFLAGS="-Wl,-rpath,\$(libdir) $EXTRA_LDFLAGS"
MK_SHARED_LIB='$(CC) -shared -Wl,-soname,`basename $[@].$(ABI_VERSION)` -o $[@]'
test $cf_cv_shlib_version = auto && cf_cv_shlib_version=rel
else
MK_SHARED_LIB='$(LD) -Bshareable -o $[@]'
fi
;;
osf*|mls+*)
# tested with OSF/1 V3.2 and 'cc'
@ -1556,9 +1644,9 @@ AC_DEFUN([CF_SHARED_OPTS],
sco3.2v5*) # (also uw2* and UW7) hops 13-Apr-98
# tested with osr5.0.5
if test $ac_cv_prog_gcc = yes; then
CC_SHARED_OPTS='-melf -fpic'
CC_SHARED_OPTS='-fpic'
else
CC_SHARED_OPTS='-KPIC'
CC_SHARED_OPTS='-belf -KPIC'
fi
MK_SHARED_LIB='$(LD) -dy -G -h `basename [$]@.$(ABI_VERSION)` -o [$]@'
if test $cf_cv_ld_rpath = yes ; then
@ -1799,7 +1887,7 @@ do
SRC_SUBDIRS="$SRC_SUBDIRS $cf_dir"
done
SRC_SUBDIRS="$SRC_SUBDIRS misc test"
test $cf_cxx_library != no && SRC_SUBDIRS="$SRC_SUBDIRS c++"
test $cf_with_cxx_binding != no && SRC_SUBDIRS="$SRC_SUBDIRS c++"
ADA_SUBDIRS=
if test "$cf_cv_prog_gnat_correct" = yes && test -d $srcdir/Ada95; then
@ -1822,6 +1910,35 @@ if test -n "$ADA_SUBDIRS"; then
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl Check for -lstdc++, which is GNU's standard C++ library.
AC_DEFUN([CF_STDCPP_LIBRARY],
[
if test -n "$GXX" ; then
case $cf_cv_system_name in #(vi
os2*) #(vi
cf_stdcpp_libname=stdcpp
;;
*)
cf_stdcpp_libname=stdc++
;;
esac
AC_CACHE_CHECK(for library $cf_stdcpp_libname,cf_cv_libstdcpp,[
cf_save="$LIBS"
LIBS="$LIBS -l$cf_stdcpp_libname -lm"
AC_TRY_LINK([
#include <strstream.h>],[
char buf[80];
strstreambuf foo(buf, sizeof(buf))
//destroy foo
],
[cf_cv_libstdcpp=yes],
[cf_cv_libstdcpp=no])
LIBS="$cf_save"
])
test $cf_cv_libstdcpp = yes && CXXLIBS="$CXXLIBS -l$cf_stdcpp_libname"
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl Remove "-g" option from the compiler options
AC_DEFUN([CF_STRIP_G_OPT],
[$1=`echo ${$1} | sed -e 's/-g //' -e 's/-g$//'`])dnl

View File

@ -1,6 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN">
<!--
$Id: announce.html,v 1.30 1999/05/16 17:01:39 juergen Exp $
$Id: announce.html,v 1.34 1999/10/23 21:13:11 tom Exp $
-->
<HTML>
<HEAD>
@ -32,7 +32,7 @@ the library and tools.<P>
The ncurses distribution is available via anonymous FTP at
the GNU distribution site
<A HREF="ftp://ftp.gnu.org/pub/gnu">ftp://ftp.gnu.org/pub/gnu</A>.
<A HREF="ftp://ftp.gnu.org/pub/gnu/ncurses">ftp://ftp.gnu.org/pub/gnu/ncurses</A>.
It is also available at
<A HREF="ftp://ftp.clark.net/pub/dickey/ncurses">ftp://ftp.clark.net/pub/dickey/ncurses</A>.
@ -85,8 +85,8 @@ Interface changes:
<li>We made additional changes to reduce impact by future interface
changes:
<ul>
<li>change key_names[] array to static since it is not part of the curses
interface.
<li>rename key_names[] array to _nc_key_names since it is not part of
the curses interface.
<li>move macro winch to a function, to hide details of struct ldat
</ul>
@ -184,7 +184,7 @@ Major bug fixes:
<H1>Features of Ncurses</H1>
The ncurses package is fully compatible with SVr4 (System V Release 4) curses:<P>
The ncurses package is fully compatible with SVr4 (System V Release 4) curses:
<UL>
<LI>All 257 of the SVr4 calls have been implemented (and are documented).
@ -203,7 +203,7 @@ are bit-for-bit-compatible with the entry format SVr4 curses uses.
entries for use with less capable <STRONG>curses</STRONG>/<STRONG>terminfo</STRONG>
versions such as the HP/UX and AIX ports.</UL>
The ncurses package also has many useful extensions over SVr4:<P>
The ncurses package also has many useful extensions over SVr4:
<UL>
<LI>The API is 8-bit clean and base-level conformant with the X/OPEN curses
@ -212,7 +212,7 @@ but not all EXTENDED features). Most EXTENDED-level features not directly
concerned with wide-character support are implemented, including many
function calls not supported under SVr4 curses (but portability of all
calls is documented so you can use the SVr4 subset only).
<LI>Unlike SVr4 curses, ncurses can write to the rightmost-bottommost corner
<LI>Unlike SVr3 curses, ncurses can write to the rightmost-bottommost corner
of the screen if your terminal has an insert-character capability.
<LI>Ada95 and C++ bindings.
<LI>Support for mouse event reporting with X Window xterm and OS/2 console windows.
@ -290,24 +290,31 @@ according to gcc -Wall. The library has been checked for malloc leaks and
arena corruption by the Purify memory-allocation tester.<P>
The ncurses code has been tested with a wide variety of applications
including (versions starting with those noted):<P>
including (versions starting with those noted):
<DL>
<DT> cdk
<DD> Curses Development Kit
<A HREF="http://www.vexus.ca/CDK.html">Curses Development Kit</a>
<A HREF="ftp://ftp.clark.net/pub/dickey/cdk">ftp://ftp.clark.net/pub/dickey/cdk</A>.
<DT> ded
<DD> directory-editor
<A HREF="ftp://ftp.clark.net/pub/dickey/ded">ftp://ftp.clark.net/pub/dickey/ded</A>.
<DT> dialog
<DD> the underlying application used in Slackware's setup, and the basis
for similar applications on GNU/Linux.
<DT> lynx-2.7
<DT> lynx
<DD> the character-screen WWW browser
<DT> Midnight Commander 4.1
<DD> file manager
<DT> mutt 0.88
<DT> mutt
<DD> mail utility
<DT> ncftp 2.0
<DT> ncftp
<DD> file-transfer utility
<DT> nvi
<DD> New vi versions 1.50 are able to use ncurses versions 1.9.7 and later.
<DT> tin
<DD> newsreader, supporting color, MIME
<A HREF="ftp://ftp.akk.uni-karlsruhe.de/pub/news/clients/tin-unoff">ftp://ftp.akk.uni-karlsruhe.de/pub/news/clients/tin-unoff</A>.
<DT> taper
<DD> tape archive utility
<DT> vh-1.6
@ -315,11 +322,8 @@ for similar applications on GNU/Linux.
</DL>
as well as some that use ncurses for the terminfo support alone:
<DL>
<DT> minicom-1.75
<DT> minicom
<DD> terminal emulator
<DT> tin-unoff
<DD> tin 1.4 newsreader, supporting color, MIME
<A HREF="ftp://ftp.akk.uni-karlsruhe.de/pub/news/clients/tin-unoff">ftp://ftp.akk.uni-karlsruhe.de/pub/news/clients/tin-unoff</A>.
<DT> vile
<DD> vi-like-emacs
<A HREF="ftp://ftp.clark.net/pub/dickey/vile">ftp://ftp.clark.net/pub/dickey/vile</A>.
@ -338,7 +342,7 @@ Ongoing work is being done by
<A HREF="mailto:dickey@clark.net">Thomas Dickey</A>
and
<A HREF="mailto:juergen.pfeifer@gmx.net">J&uuml;rgen Pfeifer</A>.
<A HREF="mailto:florian@gnu.org">Florian La Roche</A>
<A HREF="mailto:dickey@clark.net">Thomas Dickey</A>
acts as the maintainer for the Free Software Foundation, which holds the
copyright on ncurses.
Contact the current maintainers at

View File

@ -1,6 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN">
<!--
$Id: announce.html.in,v 1.30 1999/05/16 17:01:39 juergen Exp $
$Id: announce.html.in,v 1.34 1999/10/23 20:52:29 tom Exp $
-->
<HTML>
<HEAD>
@ -32,7 +32,7 @@ the library and tools.<P>
The ncurses distribution is available via anonymous FTP at
the GNU distribution site
<A HREF="ftp://ftp.gnu.org/pub/gnu">ftp://ftp.gnu.org/pub/gnu</A>.
<A HREF="ftp://ftp.gnu.org/pub/gnu/ncurses">ftp://ftp.gnu.org/pub/gnu/ncurses</A>.
It is also available at
<A HREF="ftp://ftp.clark.net/pub/dickey/ncurses">ftp://ftp.clark.net/pub/dickey/ncurses</A>.
@ -85,8 +85,8 @@ Interface changes:
<li>We made additional changes to reduce impact by future interface
changes:
<ul>
<li>change key_names[] array to static since it is not part of the curses
interface.
<li>rename key_names[] array to _nc_key_names since it is not part of
the curses interface.
<li>move macro winch to a function, to hide details of struct ldat
</ul>
@ -184,7 +184,7 @@ Major bug fixes:
<H1>Features of Ncurses</H1>
The ncurses package is fully compatible with SVr4 (System V Release 4) curses:<P>
The ncurses package is fully compatible with SVr4 (System V Release 4) curses:
<UL>
<LI>All 257 of the SVr4 calls have been implemented (and are documented).
@ -203,7 +203,7 @@ are bit-for-bit-compatible with the entry format SVr4 curses uses.
entries for use with less capable <STRONG>curses</STRONG>/<STRONG>terminfo</STRONG>
versions such as the HP/UX and AIX ports.</UL>
The ncurses package also has many useful extensions over SVr4:<P>
The ncurses package also has many useful extensions over SVr4:
<UL>
<LI>The API is 8-bit clean and base-level conformant with the X/OPEN curses
@ -212,7 +212,7 @@ but not all EXTENDED features). Most EXTENDED-level features not directly
concerned with wide-character support are implemented, including many
function calls not supported under SVr4 curses (but portability of all
calls is documented so you can use the SVr4 subset only).
<LI>Unlike SVr4 curses, ncurses can write to the rightmost-bottommost corner
<LI>Unlike SVr3 curses, ncurses can write to the rightmost-bottommost corner
of the screen if your terminal has an insert-character capability.
<LI>Ada95 and C++ bindings.
<LI>Support for mouse event reporting with X Window xterm and OS/2 console windows.
@ -290,24 +290,31 @@ according to gcc -Wall. The library has been checked for malloc leaks and
arena corruption by the Purify memory-allocation tester.<P>
The ncurses code has been tested with a wide variety of applications
including (versions starting with those noted):<P>
including (versions starting with those noted):
<DL>
<DT> cdk
<DD> Curses Development Kit
<A HREF="http://www.vexus.ca/CDK.html">Curses Development Kit</a>
<A HREF="ftp://ftp.clark.net/pub/dickey/cdk">ftp://ftp.clark.net/pub/dickey/cdk</A>.
<DT> ded
<DD> directory-editor
<A HREF="ftp://ftp.clark.net/pub/dickey/ded">ftp://ftp.clark.net/pub/dickey/ded</A>.
<DT> dialog
<DD> the underlying application used in Slackware's setup, and the basis
for similar applications on GNU/Linux.
<DT> lynx-2.7
<DT> lynx
<DD> the character-screen WWW browser
<DT> Midnight Commander 4.1
<DD> file manager
<DT> mutt 0.88
<DT> mutt
<DD> mail utility
<DT> ncftp 2.0
<DT> ncftp
<DD> file-transfer utility
<DT> nvi
<DD> New vi versions 1.50 are able to use ncurses versions 1.9.7 and later.
<DT> tin
<DD> newsreader, supporting color, MIME
<A HREF="ftp://ftp.akk.uni-karlsruhe.de/pub/news/clients/tin-unoff">ftp://ftp.akk.uni-karlsruhe.de/pub/news/clients/tin-unoff</A>.
<DT> taper
<DD> tape archive utility
<DT> vh-1.6
@ -315,11 +322,8 @@ for similar applications on GNU/Linux.
</DL>
as well as some that use ncurses for the terminfo support alone:
<DL>
<DT> minicom-1.75
<DT> minicom
<DD> terminal emulator
<DT> tin-unoff
<DD> tin 1.4 newsreader, supporting color, MIME
<A HREF="ftp://ftp.akk.uni-karlsruhe.de/pub/news/clients/tin-unoff">ftp://ftp.akk.uni-karlsruhe.de/pub/news/clients/tin-unoff</A>.
<DT> vile
<DD> vi-like-emacs
<A HREF="ftp://ftp.clark.net/pub/dickey/vile">ftp://ftp.clark.net/pub/dickey/vile</A>.
@ -338,7 +342,7 @@ Ongoing work is being done by
<A HREF="mailto:dickey@clark.net">Thomas Dickey</A>
and
<A HREF="mailto:juergen.pfeifer@gmx.net">J&uuml;rgen Pfeifer</A>.
<A HREF="mailto:florian@gnu.org">Florian La Roche</A>
<A HREF="mailto:dickey@clark.net">Thomas Dickey</A>
acts as the maintainer for the Free Software Foundation, which holds the
copyright on ncurses.
Contact the current maintainers at

View File

@ -1,6 +1,6 @@
# $Id: Makefile.in,v 1.48 1999/07/31 09:47:11 juergen Exp $
# $Id: Makefile.in,v 1.51 1999/10/23 20:13:02 tom Exp $
##############################################################################
# Copyright (c) 1998 Free Software Foundation, Inc. #
# Copyright (c) 1998,1999 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
@ -36,6 +36,10 @@
SHELL = /bin/sh
CF_MFLAGS = @cf_cv_makeflags@
@SET_MAKE@
x = @PROG_EXT@
MODEL = ../@DFT_OBJ_SUBDIR@
INSTALL_PREFIX = @INSTALL_PREFIX@
srcdir = @srcdir@
@ -63,17 +67,17 @@ CCFLAGS = $(CPPFLAGS) $(CXXFLAGS)
CFLAGS_NORMAL = $(CCFLAGS)
CFLAGS_DEBUG = $(CCFLAGS) @CXX_G_OPT@ -DTRACE
CFLAGS_PROFILE = $(CCFLAGS) -pg
CFLAGS_SHARED = $(CCFLAGS) # @CC_SHARED_OPTS@
CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@
CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@)
REL_VERSION = @cf_cv_rel_version@
ABI_VERSION = @cf_cv_abi_version@
LINK = @LINK_PROGS@ $(CXX)
LINK = @LINK_PROGS@ $(CXX) @CXXLDFLAGS@
LIBROOT = ncurses++
LIBNAME = lib$(LIBROOT).a
LIBNAME = @LIB_PREFIX@$(LIBROOT).a
LDFLAGS = @EXTRA_LDFLAGS@ -L../lib -L$(libdir) \
-l$(LIBROOT) \
@ -90,7 +94,7 @@ LDFLAGS_DEFAULT = $(LDFLAGS_@DFT_UPR_MODEL@)
AUTO_SRC = \
etip.h
all: $(AUTO_SRC) ../lib/$(LIBNAME) demo
all: $(AUTO_SRC) ../lib/$(LIBNAME) demo$x
sources : $(AUTO_SRC)
@ -116,7 +120,7 @@ OBJS_DEMO = $(MODEL)/demo.o
$(MODEL)/demo.o : $(srcdir)/demo.cc \
$(cursesf_h) $(cursesm_h) $(cursesapp_h)
demo: $(OBJS_DEMO) \
demo$x: $(OBJS_DEMO) \
../lib/$(LIBNAME) \
@TEST_DEPS@
@ECHO_LINK@ $(LINK) -o $@ $(OBJS_DEMO) $(LDFLAGS_DEFAULT)
@ -140,7 +144,7 @@ mostlyclean ::
-rm -f core tags TAGS *~ *.ln *.atac trace
clean :: mostlyclean
-rm -f demo $(AUTO_SRC) ../lib/$(LIBNAME) $(LIB_OBJS) $(OBJS_DEMO)
-rm -f demo$x $(AUTO_SRC) ../lib/$(LIBNAME) $(LIB_OBJS) $(OBJS_DEMO)
distclean :: clean
-rm -f Makefile

View File

@ -35,7 +35,7 @@
#include "cursesw.h"
#include "internal.h"
MODULE_ID("$Id: cursespad.cc,v 1.1 1999/07/31 09:47:21 juergen Exp $")
MODULE_ID("$Id: cursespad.cc,v 1.2 1999/09/11 23:25:54 tom Exp $")
NCursesPad::NCursesPad(int lines, int cols)
: NCursesWindow(),
@ -188,8 +188,8 @@ int NCursesPad::noutrefresh() {
}
void NCursesPad::setWindow(NCursesWindow& view,
int v_grid = 1,
int h_grid = 1)
int v_grid NCURSES_PARAM_INIT(1),
int h_grid NCURSES_PARAM_INIT(1))
{
viewWin = &view;
min_row = min_col = 0;

View File

@ -19,13 +19,13 @@
modified by Ulrich Drepper (drepper@karlsruhe.gmd.de)
and Anatoly Ivasyuk (anatoly@nick.csh.rit.edu)
modified by Juergen Pfeifer (juergen.pfeifer@gmx.net)
modified by Juergen Pfeifer (juergen.pfeifer@gmx.net)
*/
#include "cursesw.h"
#include "internal.h"
MODULE_ID("$Id: cursesw.cc,v 1.13 1999/07/31 09:46:30 juergen Exp $")
MODULE_ID("$Id: cursesw.cc,v 1.15 1999/09/11 23:26:29 tom Exp $")
#define COLORS_NEED_INITIALIZATION -1
#define COLORS_NOT_INITIALIZED 0
@ -51,7 +51,7 @@ NCursesWindow::scanw(const char* fmt, ...)
char buf[BUFSIZ];
int result = wgetstr(w, buf);
if (result == OK) {
strstreambuf ss(buf, BUFSIZ);
strstreambuf ss(buf, sizeof(buf));
result = ss.vscan(fmt, (_IO_va_list)args);
}
va_end(args);
@ -73,7 +73,7 @@ NCursesWindow::scanw(int y, int x, const char* fmt, ...)
if (result == OK) {
result = wgetstr(w, buf);
if (result == OK) {
strstreambuf ss(buf, BUFSIZ);
strstreambuf ss(buf, sizeof(buf));
result = ss.vscan(fmt, (_IO_va_list)args);
}
}
@ -144,7 +144,7 @@ NCursesWindow::initialize() {
NCursesWindow::NCursesWindow() {
if (!b_initialized)
initialize();
w = (WINDOW *)0;
init();
alloced = FALSE;
@ -172,7 +172,7 @@ NCursesWindow::NCursesWindow(WINDOW* &window)
{
if (!b_initialized)
initialize();
w = window;
init();
alloced = FALSE;
@ -183,7 +183,7 @@ NCursesWindow::NCursesWindow(WINDOW* &window)
NCursesWindow::NCursesWindow(NCursesWindow& win, int l, int c,
int begin_y, int begin_x, char absrel)
{
if (absrel == 'a') { // absolute origin
if (absrel == 'a') { // absolute origin
begin_y -= win.begy();
begin_x -= win.begx();
}
@ -205,7 +205,8 @@ NCursesWindow::NCursesWindow(NCursesWindow& win, int l, int c,
count++;
}
NCursesWindow::NCursesWindow(NCursesWindow& win, bool do_box = TRUE)
NCursesWindow::NCursesWindow(NCursesWindow& win,
bool do_box NCURSES_PARAM_INIT(TRUE))
{
w = :: derwin(win.w,win.height()-2,win.width()-2,1,1);
if (w == 0) {
@ -224,7 +225,7 @@ NCursesWindow::NCursesWindow(NCursesWindow& win, bool do_box = TRUE)
win.touchwin();
}
}
NCursesWindow NCursesWindow::Clone() {
WINDOW *d = ::dupwin(w);
NCursesWindow W(d);
@ -343,7 +344,7 @@ int NCursesWindow::colorInitialized = COLORS_NOT_INITIALIZED;
void
NCursesWindow::useColors(void)
{
if (colorInitialized == COLORS_NOT_INITIALIZED) {
if (colorInitialized == COLORS_NOT_INITIALIZED) {
if (b_initialized) {
if (::has_colors()) {
::start_color();
@ -358,12 +359,12 @@ NCursesWindow::useColors(void)
}
short
NCursesWindow::getcolor(int getback) const
NCursesWindow::getcolor(int getback) const
{
short fore, back;
if (colorInitialized==COLORS_ARE_REALLY_THERE) {
if (pair_content(PAIR_NUMBER(w->_attrs), &fore, &back))
if (pair_content((short)PAIR_NUMBER(w->_attrs), &fore, &back))
err_handler("Can't get color pair");
}
else {
@ -383,7 +384,7 @@ int NCursesWindow::NumberOfColors()
}
short
NCursesWindow::getcolor() const
NCursesWindow::getcolor() const
{
if (colorInitialized==COLORS_ARE_REALLY_THERE)
return PAIR_NUMBER(w->_attrs);
@ -404,7 +405,7 @@ int
NCursesWindow::setpalette(short fore, short back)
{
if (colorInitialized==COLORS_ARE_REALLY_THERE)
return setpalette(fore, back, PAIR_NUMBER(w->_attrs));
return setpalette(fore, back, (short)PAIR_NUMBER(w->_attrs));
else
return OK;
}
@ -416,7 +417,7 @@ NCursesWindow::setcolor(short pair)
if (colorInitialized==COLORS_ARE_REALLY_THERE) {
if ((pair < 1) || (pair > COLOR_PAIRS))
err_handler("Can't set color pair");
attroff(A_COLOR);
attrset(COLOR_PAIR(pair));
}
@ -426,6 +427,6 @@ NCursesWindow::setcolor(short pair)
extern "C" int _nc_has_mouse(void);
bool NCursesWindow::has_mouse() const {
return ((::has_key(KEY_MOUSE) || ::_nc_has_mouse())
return ((::has_key(KEY_MOUSE) || ::_nc_has_mouse())
? TRUE : FALSE);
}

View File

@ -2,7 +2,7 @@
#ifndef _CURSESW_H
#define _CURSESW_H
// $Id: cursesw.h,v 1.16 1999/07/31 09:46:43 juergen Exp $
// $Id: cursesw.h,v 1.18 1999/10/23 15:16:53 tom Exp $
#include <etip.h>
#include <stdio.h>
@ -933,7 +933,7 @@ class NCursesWindow
// position.
int insch(int y, int x, chtype ch) {
return ::mvwinsch(w,y,x,ch); }
return ::mvwinsch(w,y,x,(char)ch); }
// Move cursor to requested position and then insert the attributed
// character before that position.
@ -958,10 +958,10 @@ class NCursesWindow
int attron (chtype at) { return ::wattron (w, at); }
// Switch on the window attributes;
int attroff(chtype at) { return ::wattroff(w, at); }
int attroff(chtype at) { return ::wattroff(w, (int) at); }
// Switch off the window attributes;
int attrset(chtype at) { return ::wattrset(w, at); }
int attrset(chtype at) { return ::wattrset(w, (int) at); }
// Set the window attributes;
int color_set(short color_pair_number, void* opts=NULL) {
@ -1232,6 +1232,21 @@ class NCursesColorWindow : public NCursesWindow {
useColors(); }
};
// These enum definitions really belong inside the NCursesPad class, but only
// recent compilers support that feature.
typedef enum {
REQ_PAD_REFRESH = KEY_MAX + 1,
REQ_PAD_UP,
REQ_PAD_DOWN,
REQ_PAD_LEFT,
REQ_PAD_RIGHT,
REQ_PAD_EXIT
} Pad_Request;
const Pad_Request PAD_LOW = REQ_PAD_REFRESH; // lowest op-code
const Pad_Request PAD_HIGH = REQ_PAD_EXIT; // highest op-code
// -------------------------------------------------------------------------
// Pad Support. We allow an association of a pad with a "real" window
// through which the pad may be viewed.
@ -1248,21 +1263,9 @@ class NCursesPad : public NCursesWindow {
NCursesWindow* Win(void) const {
// Get the window into which the pad should be copied (if any)
return (viewSub?viewSub:(viewWin?viewWin:NULL));
return (viewSub?viewSub:(viewWin?viewWin:0));
}
typedef enum {
REQ_PAD_REFRESH = KEY_MAX + 1,
REQ_PAD_UP,
REQ_PAD_DOWN,
REQ_PAD_LEFT,
REQ_PAD_RIGHT,
REQ_PAD_EXIT
} Pad_Request;
static const Pad_Request PAD_LOW = REQ_PAD_REFRESH; // lowest op-code
static const Pad_Request PAD_HIGH = REQ_PAD_EXIT; // highest op-code
NCursesWindow* getWindow(void) const {
return viewWin;
}
@ -1341,9 +1344,6 @@ class NCursesPad : public NCursesWindow {
// will be framed (by a box() command) and the interior of the box is the
// viewport subwindow. On the frame we display scrollbar sliders.
class NCursesFramedPad : public NCursesPad {
private:
static const char* const msg = "Operation not allowed";
protected:
virtual void OnOperation(int pad_req);
@ -1361,12 +1361,12 @@ class NCursesFramedPad : public NCursesPad {
}
void setWindow(NCursesWindow& view, int v_grid = 1, int h_grid = 1) {
err_handler(msg);
err_handler("Operation not allowed");
}
// Disable this call; the viewport is already defined
void setSubWindow(NCursesWindow& sub) {
err_handler(msg);
err_handler("Operation not allowed");
}
// Disable this call; the viewport subwindow is already defined

View File

@ -6,7 +6,7 @@
* Demo code for NCursesMenu and NCursesForm written by
* Juergen Pfeifer <juergen.pfeifer@gmx.net>
*
* $Id: demo.cc,v 1.17 1999/07/31 09:47:17 juergen Exp $
* $Id: demo.cc,v 1.18 1999/09/11 18:57:54 tom Exp $
*/
#include "cursesapp.h"
@ -333,7 +333,7 @@ private:
NCursesPanel* P;
NCursesMenuItem** I;
UserData *u;
static const int n_items = 7;
#define n_items 7
public:
MyMenu ()

View File

@ -1,5 +1,5 @@
#!/bin/sh
# $Id: edit_cfg.sh,v 1.4 1998/02/11 12:13:41 tom Exp $
# $Id: edit_cfg.sh,v 1.7 1999/09/12 02:00:14 tom Exp $
##############################################################################
# Copyright (c) 1998 Free Software Foundation, Inc. #
# #
@ -37,7 +37,12 @@
# $2 = etip.h
#
for name in \
CPP_HAS_PARAM_INIT \
ETIP_NEEDS_MATH_EXCEPTION \
ETIP_NEEDS_MATH_H \
HAVE_BUILTIN_H \
HAVE_GXX_BUILTIN_H \
HAVE_GPP_BUILTIN_H \
HAVE_TYPEINFO \
HAVE_VALUES_H
do

View File

@ -1,6 +1,6 @@
// * This makes emacs happy -*-Mode: C++;-*-
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
* Copyright (c) 1998,1999 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -31,7 +31,7 @@
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1997 *
****************************************************************************/
// $Id: etip.h.in,v 1.10 1999/05/16 17:29:47 juergen Exp $
// $Id: etip.h.in,v 1.13 1999/09/12 02:01:59 tom Exp $
#ifndef _ETIP_H
#define _ETIP_H
@ -41,6 +41,14 @@
#define HAVE_BUILTIN_H 0
#endif
#ifndef HAVE_GXX_BUILTIN_H
#define HAVE_GXX_BUILTIN_H 0
#endif
#ifndef HAVE_GPP_BUILTIN_H
#define HAVE_GPP_BUILTIN_H 0
#endif
#ifndef HAVE_TYPEINFO
#define HAVE_TYPEINFO 0
#endif
@ -57,6 +65,10 @@
#define ETIP_NEEDS_MATH_EXCEPTION 0
#endif
#ifndef CPP_HAS_PARAM_INIT
#define CPP_HAS_PARAM_INIT 0
#endif
#ifdef __GNUG__
# if ((__GNUG__ <= 2) && (__GNUC_MINOR__ < 8))
# if HAVE_TYPEINFO
@ -66,7 +78,7 @@
#endif
#if defined(__GNUG__)
# if HAVE_BUILTIN_H
# if HAVE_BUILTIN_H || HAVE_GXX_BUILTIN_H || HAVE_GPP_BUILTIN_H
# if ETIP_NEEDS_MATH_H
# if ETIP_NEEDS_MATH_EXCEPTION
# undef exception
@ -76,7 +88,13 @@
# endif
# undef exception
# define exception builtin_exception
# include <builtin.h>
# if HAVE_GPP_BUILTIN_H
# include <gpp/builtin.h>
# elif HAVE_GXX_BUILTIN_H
# include <g++/builtin.h>
# else
# include <builtin.h>
# endif
# undef exception
# endif
#elif defined (__SUNPRO_CC)
@ -96,6 +114,13 @@ extern "C" {
#include <errno.h>
}
// Language features
#if CPP_HAS_PARAM_INIT
#define NCURSES_PARAM_INIT(value) = value
#else
#define NCURSES_PARAM_INIT(value) /*nothing*/
#endif
// Forward Declarations
class NCursesPanel;
class NCursesMenu;

File diff suppressed because it is too large Load Diff

View File

@ -28,10 +28,10 @@ dnl***************************************************************************
dnl
dnl Author: Thomas E. Dickey <dickey@clark.net> 1996,1997
dnl
dnl $Id: configure.in,v 1.169 1999/08/21 20:33:10 tom Exp $
dnl $Id: configure.in,v 1.179 1999/10/24 00:32:42 tom Exp $
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.12.971222)
AC_REVISION($Revision: 1.169 $)
AC_REVISION($Revision: 1.179 $)
AC_INIT(ncurses/base/lib_initscr.c)
AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
@ -105,19 +105,29 @@ AC_SUBST(LDCONFIG)
dnl DEFECT in autoconf 2.12: an attempt to set policy, this breaks the
dnl configure script by not letting us test if C++
dnl is present, making this option necessary.
AC_MSG_CHECKING(if you want to build with C++)
AC_MSG_CHECKING(if you want to ensure bool is consistent with C++)
AC_ARG_WITH(cxx,
[ --without-cxx suppress check for C++, don't build demo],
[ --without-cxx do not adjust ncurses bool to match C++],
[cf_with_cxx=$withval],
[cf_with_cxx=yes])
AC_MSG_RESULT($cf_with_cxx)
if test "X$cf_with_cxx" != Xno ; then
AC_PROG_CXX
if test "X$cf_with_cxx" = Xno ; then
CXX=""
GXX=""
else
AC_PROG_CXX
fi
changequote(,)dnl
if test -n "$GXX" ; then case "`${CXX-g++} --version`" in 1*|2.[0-6]*) GXX=""; CXX=""; ac_cv_prog_gxx=no; cf_cxx_library=no ; echo No: templates do not work;; esac; fi
changequote([,])dnl
AC_MSG_CHECKING(if you want to build C++ binding and demo)
AC_ARG_WITH(cxx-binding,
[ --without-cxx-binding do not build C++ binding and demo],
[cf_with_cxx_binding=$withval],
[cf_with_cxx_binding=$cf_with_cxx])
AC_MSG_RESULT($cf_with_cxx_binding)
AC_MSG_CHECKING(if you want to build with Ada95)
AC_ARG_WITH(ada,
[ --without-ada suppress check for Ada95, don't build demo],
@ -254,7 +264,7 @@ if test $with_gpm = yes ; then
SHLIB_LIST="-lgpm $SHLIB_LIST"
AC_DEFINE(HAVE_LIBGPM)
AC_CHECK_HEADERS(gpm.h)
],,-lcurses -ltermcap)
],AC_MSG_WARN(Cannot link with gpm library - read the FAQ))
fi
TINFO_LIST="$SHLIB_LIST"
@ -294,7 +304,6 @@ LIB_PREFIX=$LIB_DIR/$cf_prefix
AC_SUBST(LIB_PREFIX)
dnl Not all ports of gcc support the -g option
dnl autoconf 2.12 uses different symbol for -g option than autoconf 2.10, etc.
if test X"$CC_G_OPT" = X"" ; then
CC_G_OPT='-g'
@ -324,7 +333,6 @@ AC_ARG_ENABLE(rpath,
AC_MSG_RESULT($cf_cv_ld_rpath)
CF_SHARED_OPTS
if test "$CC_SHARED_OPTS" = "unknown"; then
for model in $cf_list_models; do
if test "$model" = "shared"; then
@ -744,12 +752,12 @@ strstr \
tcgetattr \
tcgetpgrp \
times \
usleep \
vfscanf \
vsnprintf \
vsscanf \
)
if test "$with_getcap" = "yes" ; then
CF_CGETENT
fi
@ -779,21 +787,32 @@ dnl Check for C++ compiler characteristics (and ensure that it's there!)
CF_BOOL_DECL(cf_cv_cc_bool_type)
if test -n "$CXX" ; then
AC_LANG_CPLUSPLUS
CF_STDCPP_LIBRARY
case "`${CXX-g++} --version`" in
2.7*)
CF_CXX_LIBRARY
;;
*)
1*|2.[0-6]*)
cf_cxx_library=yes
;;
2.7*)
CF_GPP_LIBRARY
;;
*)
cf_cxx_library=no
;;
esac
AC_CHECK_HEADERS(builtin.h typeinfo)
AC_CHECK_HEADERS(typeinfo)
CF_BOOL_DECL
CF_BOOL_SIZE
CF_ETIP_DEFINES
CF_CPP_PARAM_INIT
case $cf_cv_system_name in #(vi
sco3.2v5*)
CXXLDFLAGS="-u main"
;;
esac
AC_SUBST(CXXLDFLAGS)
else
cf_cxx_library=no
cf_cv_builtin_bool=0
cf_cv_builtin_bool=1
# Just because we are not configuring against C++ right now does not
# mean that a user will not want to use C++. Some distributors disable
@ -961,7 +980,7 @@ cf_cv_do_symlinks="$cf_cv_do_symlinks"
cf_cv_rel_version="$cf_cv_rel_version"
cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
cf_cv_system_name="$cf_cv_system_name"
cf_cxx_library="$cf_cxx_library"
cf_with_cxx_binding="$cf_with_cxx_binding"
target="$target"
],sort)dnl

View File

@ -1,4 +1,4 @@
# $Id: dist.mk,v 1.162 1999/08/21 23:40:17 tom Exp $
# $Id: dist.mk,v 1.172 1999/10/23 12:29:39 tom Exp $
# Makefile for creating ncurses distributions.
#
# This only needs to be used directly as a makefile by developers, but
@ -10,7 +10,7 @@ SHELL = /bin/sh
# These define the major/minor/patch versions of ncurses.
NCURSES_MAJOR = 5
NCURSES_MINOR = 0
NCURSES_PATCH = 990821
NCURSES_PATCH = 19991023
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)

View File

@ -5,7 +5,7 @@ BEGIN {
print " * *"
print " * Permission is hereby granted, free of charge, to any person obtaining a *"
print " * copy of this software and associated documentation files (the *"
print " * "Software"), to deal in the Software without restriction, including *"
print " * \"Software\"), to deal in the Software without restriction, including *"
print " * without limitation the rights to use, copy, modify, merge, publish, *"
print " * distribute, distribute with modifications, sublicense, and/or sell *"
print " * copies of the Software, and to permit persons to whom the Software is *"
@ -14,7 +14,7 @@ BEGIN {
print " * The above copyright notice and this permission notice shall be included *"
print " * in all copies or substantial portions of the Software. *"
print " * *"
print " * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *"
print " * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS *"
print " * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *"
print " * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *"
print " * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *"
@ -33,7 +33,7 @@ BEGIN {
print "/* and: Eric S. Raymond <esr@snark.thyrsus.com> */"
print "/****************************************************************************/"
print ""
print "/* $Id: MKterm.h.awk.in,v 1.35 1999/02/24 01:04:55 tom Exp $ */"
print "/* $Id: MKterm.h.awk.in,v 1.36 1999/09/01 22:36:52 Peter.Wemm Exp $ */"
print ""
print "/*"
print "** term.h -- Definition of struct term"

View File

@ -31,7 +31,7 @@
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
****************************************************************************/
/* $Id: curses.h.in,v 1.84 1999/07/24 20:15:42 tom Exp $ */
/* $Id: curses.h.in,v 1.85 1999/10/23 12:33:54 tom Exp $ */
#ifndef __NCURSES_H
#define __NCURSES_H
@ -312,6 +312,7 @@ extern int TABSIZE;
extern int ESCDELAY; /* ESC expire time in milliseconds */
extern char *keybound (int, int);
extern const char *curses_version (void);
extern int define_key (char *, int);
extern int keyok (int, bool);
extern int resizeterm (int, int);

View File

@ -157,8 +157,17 @@ struct tinfo_fkeys {
chtype code;
};
#ifdef BROKEN_LINKER
#define _nc_tinfo_fkeys _nc_tinfo_fkeysf()
extern struct tinfo_fkeys *_nc_tinfo_fkeysf(void);
#else
extern struct tinfo_fkeys _nc_tinfo_fkeys[];
#endif
/*
* The file comp_captab.c contains an array of these structures, one
* per possible capability. These are indexed by a hash table array of

View File

@ -26,7 +26,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
.\" $Id: curs_initscr.3x,v 1.7 1998/03/11 21:12:53 juergen Exp $
.\" $Id: curs_initscr.3x,v 1.8 1999/09/18 23:52:30 tom Exp $
.TH curs_initscr 3X ""
.SH NAME
\fBinitscr\fR, \fBnewterm\fR, \fBendwin\fR,
@ -105,6 +105,11 @@ Note that \fBinitscr\fR and \fBnewterm\fR may be macros.
These functions are described in the XSI Curses standard, Issue 4. It
specifies that portable applications must not call \fBinitscr\fR more than
once.
Old versions of curses, e.g., BSD 4.4, may have returned a null pointer
from \fBinitscr\fR when an error is detected, rather than exiting.
It is safe but redundant to check the return value of \fBinitscr\fR
in XSI Curses.
.SH SEE ALSO
\fBcurses\fR(3X), \fBcurs_kernel\fR(3X), \fBcurs_refresh\fR(3X),
\fBcurs_slk\fR(3X), \fBcurs_util\fR(3X)

View File

@ -1,6 +1,6 @@
'\" t
.\"***************************************************************************
.\" Copyright (c) 1998 Free Software Foundation, Inc. *
.\" Copyright (c) 1998,1999 Free Software Foundation, Inc. *
.\" *
.\" Permission is hereby granted, free of charge, to any person obtaining a *
.\" copy of this software and associated documentation files (the *
@ -27,7 +27,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
.'" $Id: curs_mouse.3x,v 1.12 1999/01/09 22:53:22 tom Exp $
.'" $Id: curs_mouse.3x,v 1.13 1999/09/11 17:28:28 tom Exp $
.TH curs_mouse 3X ""
.SH NAME
\fBgetmouse\fR, \fBungetmouse\fR,
@ -171,9 +171,8 @@ These calls were designed for \fBncurses\fR(3X), and are not found in SVr4
curses, 4.4BSD curses, or any other previous version of curses.
The feature macro \fBNCURSES_MOUSE_VERSION\fR is provided so the preprocessor
can be used to test whether these features are present (its value is 1). NOTE:
THIS INTERFACE IS EXPERIMENTAL AND IS SUBJECT TO CHANGE WITHOUT NOTICE! If the
interface is changed, the value of \fBNCURSES_MOUSE_VERSION\fR will be
can be used to test whether these features are present (its value is 1).
If the interface is changed, the value of \fBNCURSES_MOUSE_VERSION\fR will be
incremented.
The order of the \fBMEVENT\fR structure members is not guaranteed.
@ -181,7 +180,7 @@ Additional fields may be added to the structure in the future.
Under \fBncurses\fR(3X), these calls are implemented using either
xterm's built-in mouse-tracking API or Alessandro Rubini's gpm server.
If you are using something other than xterm there is no gpm daemon
If you are using something other than xterm and there is no gpm daemon
running on your machine, mouse events will not be visible to
\fBncurses\fR(3X) (and the \fBwmousemask\fR function will always
return \fB0\fR).
@ -195,7 +194,14 @@ if they have been enabled by \fBwmousemask\fR. Instead, the xterm mouse
report sequence will appear in the string read.
Mouse events under xterm will not be detected correctly in a window with
its keypad bit off.
its keypad bit off, since they are interpreted as a variety of function key.
Your terminfo description must have \fBkmous\fR set to "\\E[M" (the beginning
of the response from xterm for mouse clicks).
Because there are no standard terminal responses that would serve to identify
terminals which support the xterm mouse protocol, \fBncurses\fR assumes that
if your $DISPLAY environment variable is set, and \fBkmous\fR is defined in
the terminal description, then the terminal may send mouse events.
.SH SEE ALSO
\fBcurses\fR(3X).
.\"#

View File

@ -26,7 +26,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
.\" $Id: curs_termcap.3x,v 1.11 1998/07/18 02:45:56 tom Exp $
.\" $Id: curs_termcap.3x,v 1.12 1999/09/05 01:02:07 tom Exp $
.TH curs_termcap 3X ""
.ds n 5
.SH NAME
@ -71,6 +71,9 @@ or -1 if it is not available.
The \fBtgetstr\fR routine returns the string entry for \fIid\fR,
or zero if it is not available.
Use \fBtputs\fR to output the returned string.
The return value will also be copied to the buffer pointed to by \fIarea\fR,
and the \fIarea\fR value will be updated to point past the null ending
this value.
The \fBtgoto\fR routine instantiates the parameters into the given capability.
The output from this routine is to be passed to \fBtputs\fR.

View File

@ -26,7 +26,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
.\" $Id: curs_terminfo.3x,v 1.11 1999/07/31 21:41:29 tom Exp $
.\" $Id: curs_terminfo.3x,v 1.12 1999/10/17 01:11:59 tom Exp $
.TH curs_terminfo 3X ""
.ds n 5
.SH NAME
@ -244,6 +244,14 @@ In System V Release 4, the third argument of \fBtputs\fR has the type
The XSI Curses standard prototypes \fBtparm\fR with a fixed number of parameters,
rather than a variable argument list.
XSI notes that after calling \fBmvcur\fR, the curses state may not match the
actual terminal state, and that an application should touch and refresh
the window before resuming normal curses calls.
Both ncurses and System V Release 4 curses implement \fBmvcur\fR using
the SCREEN data allocated in either \fBinitscr\fR or \fBnewterm\fR.
So though it is documented as a terminfo function,
\fBmvcur\fR is really a curses function which is not well specified.
.SH SEE ALSO
\fBcurses\fR(3X), \fBcurs_initscr\fR(3X), \fBcurs_kernel\fR(3X), \fBcurs_termcap\fR(3X),
\fBputc\fR(3S), \fBterminfo\fR(\*n)

View File

@ -1,4 +1,4 @@
# $Id: man_db.renames,v 0.14 1999/02/20 12:43:56 tom Exp $
# $Id: man_db.renames,v 0.15 1999/10/02 23:28:13 tom Exp $
# Manual-page renamings for the man_db program
#
captoinfo.1m captoinfo.1
@ -45,7 +45,7 @@ curs_util.3x util.3ncurses
curs_window.3x window.3ncurses
curses.3x ncurses.3ncurses
define_key.3x define_key.3ncurses
dft_fgbg.3x dft_fgbg.3ncurses
dft_fgbg.3x use_default_colors.3ncurses
form.3x form.3form
form_cursor.3x cursor.3form
form_data.3x data.3form

View File

@ -1,6 +1,6 @@
'\" t
.\"***************************************************************************
.\" Copyright (c) 1998 Free Software Foundation, Inc. *
.\" Copyright (c) 1998,1999 Free Software Foundation, Inc. *
.\" *
.\" Permission is hereby granted, free of charge, to any person obtaining a *
.\" copy of this software and associated documentation files (the *
@ -27,7 +27,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
.\" $Id: ncurses.3x,v 1.34 1999/07/24 21:37:35 tom Exp $
.\" $Id: ncurses.3x,v 1.35 1999/10/23 19:50:07 tom Exp $
.hy 0
.TH ncurses 3X ""
.ds n 5

View File

@ -1,5 +1,5 @@
LIBRARY form4 INITINSTANCE TERMINSTANCE
DESCRIPTION "NCurses-4-2-981212, module form"
LIBRARY form5 INITINSTANCE TERMINSTANCE
DESCRIPTION "NCurses-5-0-990828, module form"
CODE LOADONCALL
DATA LOADONCALL NONSHARED MULTIPLE
EXPORTS
@ -26,10 +26,6 @@ EXPORTS
"_nc_Set_Form_Page" @26 NONAME
"_nc_Synchronize_Attributes" @27 NONAME
"_nc_Synchronize_Options" @28 NONAME
"_nc_ada_getvarg" @29 NONAME
"_nc_ada_normalize_field_opts" @61 NONAME
"_nc_ada_normalize_form_opts" @62 NONAME
"_nc_get_field" @63 NONAME
"current_field" @102 NONAME
"data_ahead" @133 NONAME
"data_behind" @134 NONAME
@ -59,8 +55,8 @@ EXPORTS
"form_opts_off" @130 NONAME
"form_opts_on" @129 NONAME
"form_page" @117 NONAME
"form_request_by_name" @64 NONAME
"form_request_name" @65 NONAME
"form_request_by_name" @29 NONAME
"form_request_name" @61 NONAME
"form_sub" @104 NONAME
"form_term" @106 NONAME
"form_userptr" @131 NONAME

View File

@ -666,9 +666,7 @@ Source-Form Translation
getenv()
lib_newterm.c
lib_baudrate.c
lib_kernel.c
various tty-manipulation and system calls

View File

@ -1,5 +1,5 @@
LIBRARY menu4 INITINSTANCE TERMINSTANCE
DESCRIPTION "NCurses-4-2-981212, module menu"
LIBRARY menu5 INITINSTANCE TERMINSTANCE
DESCRIPTION "NCurses-5-0-990828, module menu"
CODE LOADONCALL
DATA LOADONCALL NONSHARED MULTIPLE
EXPORTS
@ -14,10 +14,7 @@ EXPORTS
"_nc_New_TopRow_and_CurrentItem" @69 NONAME
"_nc_Post_Item" @70 NONAME
"_nc_Show_Menu" @71 NONAME
"_nc_ada_normalize_item_opts" @72 NONAME
"_nc_ada_normalize_menu_opts" @73 NONAME
"_nc_get_item" @74 NONAME
"_nc_menu_cursor_pos" @75 NONAME
"_nc_menu_cursor_pos" @72 NONAME
"current_item" @2 NONAME
"free_item" @23 NONAME
"free_menu" @24 NONAME
@ -46,9 +43,9 @@ EXPORTS
"menu_opts_on" @31 NONAME
"menu_pad" @32 NONAME
"menu_pattern" @17 NONAME
"menu_request_by_name" @76 NONAME
"menu_request_name" @77 NONAME
"menu_spacing" @78 NONAME
"menu_request_by_name" @73 NONAME
"menu_request_name" @74 NONAME
"menu_spacing" @75 NONAME
"menu_sub" @12 NONAME
"menu_term" @10 NONAME
"menu_userptr" @19 NONAME
@ -74,7 +71,7 @@ EXPORTS
"set_menu_opts" @50 NONAME
"set_menu_pad" @51 NONAME
"set_menu_pattern" @52 NONAME
"set_menu_spacing" @79 NONAME
"set_menu_spacing" @76 NONAME
"set_menu_sub" @53 NONAME
"set_menu_term" @54 NONAME
"set_menu_userptr" @55 NONAME

View File

@ -1,5 +1,5 @@
LIBRARY ncurses4 INITINSTANCE TERMINSTANCE
DESCRIPTION "NCurses-4-2-981212, module ncurses"
LIBRARY ncurses5 INITINSTANCE TERMINSTANCE
DESCRIPTION "NCurses-5-0-990828, module ncurses"
CODE LOADONCALL
DATA LOADONCALL NONSHARED MULTIPLE
EXPORTS
@ -16,42 +16,42 @@ EXPORTS
"TABSIZE" @512 NONAME
"UP" @661 NONAME
"_nc_access" @6 NONAME
"_nc_ada_getbegyx" @7 NONAME
"_nc_ada_getmaxyx" @8 NONAME
"_nc_ada_getparyx" @9 NONAME
"_nc_ada_getyx" @10 NONAME
"_nc_ada_isscroll" @15 NONAME
"_nc_ada_mouse_event" @16 NONAME
"_nc_ada_mouse_mask" @22 NONAME
"_nc_ada_vcheck" @23 NONAME
"_nc_add_to_try" @25 NONAME
"_nc_background" @27 NONAME
"_nc_add_to_try" @7 NONAME
"_nc_align_termtype" @8 NONAME
"_nc_background" @9 NONAME
"_nc_baudrate" @10 NONAME
"_nc_cap_hash_table" @805 NONAME
"_nc_capalias_table" @806 NONAME
"_nc_capcmp" @707 NONAME
"_nc_captoinfo" @829 NONAME
"_nc_check_termtype" @15 NONAME
"_nc_comment_end" @819 NONAME
"_nc_comment_start" @818 NONAME
"_nc_copy_entry" @16 NONAME
"_nc_copy_termtype" @22 NONAME
"_nc_curr_col" @816 NONAME
"_nc_curr_file_pos" @817 NONAME
"_nc_curr_line" @815 NONAME
"_nc_curr_token" @803 NONAME
"_nc_do_color" @1037 NONAME
"_nc_doalloc" @51 NONAME
"_nc_do_xmc_glitch" @23 NONAME
"_nc_doalloc" @25 NONAME
"_nc_entry_match" @710 NONAME
"_nc_err_abort" @826 NONAME
"_nc_expand_try" @54 NONAME
"_nc_expanded" @58 NONAME
"_nc_expand_try" @27 NONAME
"_nc_expanded" @51 NONAME
"_nc_fallback" @625 NONAME
"_nc_find_entry" @809 NONAME
"_nc_find_type_entry" @810 NONAME
"_nc_first_name" @622 NONAME
"_nc_free_entries" @712 NONAME
"_nc_freeall" @59 NONAME
"_nc_freewin" @60 NONAME
"_nc_get_curterm" @63 NONAME
"_nc_free_termtype" @54 NONAME
"_nc_freeall" @58 NONAME
"_nc_freewin" @59 NONAME
"_nc_get_hash_table" @60 NONAME
"_nc_get_table" @808 NONAME
"_nc_get_token" @811 NONAME
"_nc_get_tty_mode" @63 NONAME
"_nc_get_type" @823 NONAME
"_nc_getenv_num" @65 NONAME
"_nc_has_mouse" @67 NONAME
@ -61,79 +61,89 @@ EXPORTS
"_nc_info_hash_table" @804 NONAME
"_nc_infoalias_table" @807 NONAME
"_nc_infotocap" @830 NONAME
"_nc_init_acs" @91 NONAME
"_nc_init_entry" @702 NONAME
"_nc_init_keytry" @92 NONAME
"_nc_keep_tic_dir" @93 NONAME
"_nc_key_names" @95 NONAME
"_nc_keypad" @1024 NONAME
"_nc_lib_traceatr" @91 NONAME
"_nc_lib_tracedmp" @92 NONAME
"_nc_make_oldhash" @93 NONAME
"_nc_lib_traceatr" @96 NONAME
"_nc_lib_tracedmp" @97 NONAME
"_nc_lib_tracemouse" @98 NONAME
"_nc_make_oldhash" @103 NONAME
"_nc_makenew" @1025 NONAME
"_nc_memmove" @95 NONAME
"_nc_memmove" @106 NONAME
"_nc_merge_entry" @704 NONAME
"_nc_msec_cost" @96 NONAME
"_nc_msec_cost" @116 NONAME
"_nc_mvcur_init" @1014 NONAME
"_nc_mvcur_resume" @97 NONAME
"_nc_mvcur_resume" @117 NONAME
"_nc_mvcur_wrap" @1015 NONAME
"_nc_name_match" @623 NONAME
"_nc_nulls_sent" @98 NONAME
"_nc_oldnums" @103 NONAME
"_nc_nulls_sent" @118 NONAME
"_nc_oldnums" @119 NONAME
"_nc_ospeed" @120 NONAME
"_nc_outch" @1026 NONAME
"_nc_outstr" @1033 NONAME
"_nc_panelhook" @106 NONAME
"_nc_panelhook" @127 NONAME
"_nc_panic_mode" @814 NONAME
"_nc_parse_entry" @706 NONAME
"_nc_printf_string" @116 NONAME
"_nc_printf_string" @129 NONAME
"_nc_push_token" @812 NONAME
"_nc_read_entry" @620 NONAME
"_nc_read_entry_source" @709 NONAME
"_nc_read_file_entry" @621 NONAME
"_nc_read_termcap" @117 NONAME
"_nc_remove_key" @118 NONAME
"_nc_read_termcap" @130 NONAME
"_nc_remove_key" @132 NONAME
"_nc_remove_string" @137 NONAME
"_nc_render" @1027 NONAME
"_nc_reset_input" @813 NONAME
"_nc_resolve_uses" @711 NONAME
"_nc_ripoffline" @119 NONAME
"_nc_ripoffline" @142 NONAME
"_nc_save_str" @703 NONAME
"_nc_screen_chain" @120 NONAME
"_nc_screen_init" @127 NONAME
"_nc_screen_resume" @129 NONAME
"_nc_screen_wrap" @130 NONAME
"_nc_scroll_oldhash" @132 NONAME
"_nc_screen_chain" @143 NONAME
"_nc_screen_init" @144 NONAME
"_nc_screen_resume" @145 NONAME
"_nc_screen_wrap" @146 NONAME
"_nc_scroll_oldhash" @147 NONAME
"_nc_scroll_optimize" @1029 NONAME
"_nc_scroll_window" @1030 NONAME
"_nc_scrolln" @137 NONAME
"_nc_set_buffer" @142 NONAME
"_nc_set_curterm" @143 NONAME
"_nc_scrolln" @148 NONAME
"_nc_set_buffer" @152 NONAME
"_nc_set_source" @822 NONAME
"_nc_set_tty_mode" @158 NONAME
"_nc_set_type" @824 NONAME
"_nc_set_writedir" @144 NONAME
"_nc_set_writedir" @159 NONAME
"_nc_setupscreen" @1031 NONAME
"_nc_sigaction" @145 NONAME
"_nc_sigaction" @160 NONAME
"_nc_signal_handler" @1034 NONAME
"_nc_slk_format" @146 NONAME
"_nc_slk_initialize" @147 NONAME
"_nc_slk_format" @161 NONAME
"_nc_slk_initialize" @162 NONAME
"_nc_start_line" @821 NONAME
"_nc_suppress_warnings" @828 NONAME
"_nc_synchook" @1035 NONAME
"_nc_syntax" @820 NONAME
"_nc_syserr_abort" @825 NONAME
"_nc_tail" @701 NONAME
"_nc_tic_dir" @148 NONAME
"_nc_tic_expand" @152 NONAME
"_nc_tic_written" @158 NONAME
"_nc_tic_dir" @167 NONAME
"_nc_tic_expand" @169 NONAME
"_nc_tic_written" @170 NONAME
"_nc_timed_wait" @1036 NONAME
"_nc_trace_buf" @159 NONAME
"_nc_tracebits" @160 NONAME
"_nc_tinfo_fkeys" @172 NONAME
"_nc_trace_buf" @178 NONAME
"_nc_trace_tries" @183 NONAME
"_nc_trace_xnames" @184 NONAME
"_nc_tracebits" @185 NONAME
"_nc_tracing" @1010 NONAME
"_nc_trans_string" @161 NONAME
"_nc_trans_string" @186 NONAME
"_nc_user_definable" @187 NONAME
"_nc_visbuf" @1012 NONAME
"_nc_visbuf2" @162 NONAME
"_nc_vsscanf" @167 NONAME
"_nc_visbuf2" @188 NONAME
"_nc_vsscanf" @189 NONAME
"_nc_waddch_nosync" @1028 NONAME
"_nc_warning" @827 NONAME
"_nc_wrap_entry" @705 NONAME
"_nc_write_entry" @708 NONAME
"_tracechar" @403 NONAME
"_tracemouse" @404 NONAME
"acs_map" @506 NONAME
"addch" @1 NONAME
"addchnstr" @2 NONAME
@ -141,8 +151,8 @@ EXPORTS
"addnstr" @4 NONAME
"addstr" @5 NONAME
"attr_get" @14 NONAME
"attr_off" @169 NONAME
"attr_on" @170 NONAME
"attr_off" @193 NONAME
"attr_on" @211 NONAME
"attr_set" @17 NONAME
"attroff" @11 NONAME
"attron" @12 NONAME
@ -164,14 +174,14 @@ EXPORTS
"clrtobot" @33 NONAME
"clrtoeol" @34 NONAME
"color_content" @35 NONAME
"color_set" @172 NONAME
"color_set" @234 NONAME
"copywin" @37 NONAME
"cur_term" @515 NONAME
"curs_set" @38 NONAME
"curscr" @501 NONAME
"def_prog_mode" @39 NONAME
"def_shell_mode" @40 NONAME
"define_key" @178 NONAME
"define_key" @238 NONAME
"del_curterm" @641 NONAME
"delay_output" @41 NONAME
"delch" @42 NONAME
@ -188,7 +198,7 @@ EXPORTS
"filter" @55 NONAME
"flash" @56 NONAME
"flushinp" @57 NONAME
"getbkgd" @183 NONAME
"getbkgd" @240 NONAME
"getch" @61 NONAME
"getmouse" @356 NONAME
"getnstr" @62 NONAME
@ -198,7 +208,7 @@ EXPORTS
"has_colors" @69 NONAME
"has_ic" @70 NONAME
"has_il" @71 NONAME
"has_key" @184 NONAME
"has_key" @242 NONAME
"hline" @72 NONAME
"idcok" @74 NONAME
"idlok" @75 NONAME
@ -206,7 +216,6 @@ EXPORTS
"inch" @77 NONAME
"inchnstr" @78 NONAME
"inchstr" @79 NONAME
"init_acs" @1013 NONAME
"init_color" @81 NONAME
"init_pair" @82 NONAME
"initscr" @80 NONAME
@ -221,16 +230,16 @@ EXPORTS
"is_linetouched" @100 NONAME
"is_wintouched" @101 NONAME
"isendwin" @99 NONAME
"key_names" @185 NONAME
"keybound" @251 NONAME
"keyname" @102 NONAME
"keyok" @186 NONAME
"keyok" @263 NONAME
"keypad" @104 NONAME
"killchar" @105 NONAME
"leaveok" @107 NONAME
"longname" @108 NONAME
"mcprint" @187 NONAME
"mcprint" @266 NONAME
"meta" @109 NONAME
"mouse_trafo" @188 NONAME
"mouse_trafo" @270 NONAME
"mouseinterval" @360 NONAME
"mousemask" @358 NONAME
"move" @110 NONAME
@ -314,7 +323,7 @@ EXPORTS
"reset_prog_mode" @222 NONAME
"reset_shell_mode" @223 NONAME
"resetty" @221 NONAME
"resizeterm" @189 NONAME
"resizeterm" @272 NONAME
"restartterm" @643 NONAME
"ripoffline" @224 NONAME
"savetty" @225 NONAME
@ -330,13 +339,13 @@ EXPORTS
"set_term" @236 NONAME
"setscrreg" @235 NONAME
"setupterm" @644 NONAME
"slk_attr" @193 NONAME
"slk_attr_set" @211 NONAME
"slk_attr" @274 NONAME
"slk_attr_set" @276 NONAME
"slk_attroff" @237 NONAME
"slk_attron" @239 NONAME
"slk_attrset" @241 NONAME
"slk_clear" @243 NONAME
"slk_color" @234 NONAME
"slk_color" @278 NONAME
"slk_init" @244 NONAME
"slk_label" @245 NONAME
"slk_noutrefresh" @246 NONAME
@ -364,7 +373,7 @@ EXPORTS
"tigetflag" @260 NONAME
"tigetnum" @261 NONAME
"tigetstr" @262 NONAME
"timeout" @238 NONAME
"timeout" @284 NONAME
"tparm" @653 NONAME
"tputs" @655 NONAME
"trace" @405 NONAME
@ -374,13 +383,14 @@ EXPORTS
"ungetch" @265 NONAME
"ungetmouse" @357 NONAME
"untouchwin" @267 NONAME
"use_default_colors" @240 NONAME
"use_default_colors" @285 NONAME
"use_env" @268 NONAME
"use_extended_names" @286 NONAME
"vidattr" @269 NONAME
"vidputs" @271 NONAME
"vline" @273 NONAME
"vw_printw" @242 NONAME
"vw_scanw" @251 NONAME
"vw_printw" @287 NONAME
"vw_scanw" @294 NONAME
"vwprintw" @275 NONAME
"vwscanw" @277 NONAME
"waddch" @279 NONAME
@ -391,7 +401,7 @@ EXPORTS
"wattr_get" @291 NONAME
"wattr_off" @293 NONAME
"wattr_on" @292 NONAME
"wattr_set" @263 NONAME
"wattr_set" @297 NONAME
"wattroff" @289 NONAME
"wattron" @288 NONAME
"wattrset" @290 NONAME
@ -402,7 +412,7 @@ EXPORTS
"wclear" @302 NONAME
"wclrtobot" @303 NONAME
"wclrtoeol" @304 NONAME
"wcolor_set" @266 NONAME
"wcolor_set" @298 NONAME
"wcursyncup" @305 NONAME
"wdelch" @306 NONAME
"wdeleteln" @307 NONAME
@ -423,7 +433,7 @@ EXPORTS
"winsnstr" @328 NONAME
"winsstr" @329 NONAME
"winstr" @330 NONAME
"wmouse_trafo" @270 NONAME
"wmouse_trafo" @300 NONAME
"wmove" @338 NONAME
"wnoutrefresh" @339 NONAME
"wprintw" @340 NONAME

View File

@ -1,5 +1,5 @@
LIBRARY panel4 INITINSTANCE TERMINSTANCE
DESCRIPTION "NCurses-4-2-981212, module panel"
LIBRARY panel5 INITINSTANCE TERMINSTANCE
DESCRIPTION "NCurses-5-0-990828, module panel"
CODE LOADONCALL
DATA LOADONCALL NONSHARED MULTIPLE
EXPORTS

View File

@ -3,7 +3,7 @@
# This version of terminfo.src is distributed with ncurses.
#
# Version 10.2.1
# $Date: 1999/08/22 00:05:28 $
# $Date: 1999/10/24 00:28:48 $
# terminfo syntax
#
# Eric S. Raymond (current maintainer)
@ -532,24 +532,23 @@ nansi.sysk|nansisysk|PC-DOS Public Domain NANSI.SYS with keypad redefined for vi
beterm|BeOS Terminal,
am, eo, mir, msgr, xenl, xon,
colors#8, cols#80, it#8, lines#25, ncv#5, pairs#64,
bel=^G, blink=\E[5m, bold=\E[1m, clear=\E[H\E[J, cr=^M,
bel=^G, bold=\E[1m, clear=\E[H\E[J, cr=^M,
csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=^J, cuf1=\E[C,
cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, dch=\E[%p1%dP,
dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J,
el=\E[K, flash=\E[?5h\E[?5l$<200/>, home=\E[H,
hpa=\E[%i%p1%dG, ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@,
il=\E[%p1%dL, il1=\E[L, ind=^J, invis=\E[8m, kb2=\E[G,
kbs=^H, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A,
kend=\E[4~, kf1=\E[11~, kf10=\E[20~, kf11=\E[21~,
kf12=\E[22~, kf2=\E[12~, kf3=\E[13~, kf4=\E[14~,
kf5=\E[15~, kf6=\E[16~, kf7=\E[17~, kf8=\E[18~, kf9=\E[19~,
khome=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, kspd=^Z,
nel=^M^J, op=\E[m, rc=\E8, rev=\E[7m, ri=\EM, rmir=\E[4l,
rmso=\E[m, rmul=\E[24m, rs1=\Ec, sc=\E7, setab=\E[4%p1%dm,
setaf=\E[3%p1%dm, setb=\E[%p1%{40}%+%cm,
setf=\E[%p1%{30}%+%cm, sgr0=\E[0;10m, smir=\E[4h,
smso=\E[7m, smul=\E[4m, u6=\E[%i%p1%d;%p2%dR, u7=\E[6n,
u8=\E[?6c, u9=\E[c, vpa=\E[%i%p1%dd,
dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K,
home=\E[H, hpa=\E[%i%p1%dG, ht=^I, hts=\EH, ich=\E[%p1%d@,
ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=^J, kbs=^H,
kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A,
kdch1=\E[3~, kend=\E[4~, kf1=\E[11~, kf10=\E[20~,
kf11=\E[21~, kf12=\E[22~, kf2=\E[12~, kf3=\E[13~,
kf4=\E[14~, kf5=\E[15~, kf6=\E[16~, kf7=\E[17~, kf8=\E[18~,
kf9=\E[19~, khome=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~,
kspd=^Z, nel=^M^J, op=\E[m, rc=\E8, rev=\E[7m, ri=\EM,
rmir=\E[4l, rmso=\E[m, rmul=\E[24m, rs1=\Ec, sc=\E7,
setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
setb=\E[%p1%{40}%+%cm, setf=\E[%p1%{30}%+%cm,
sgr0=\E[0;10m, smir=\E[4h, smso=\E[7m, smul=\E[4m,
u6=\E[%i%p1%d;%p2%dR, u7=\E[6n, vpa=\E[%i%p1%dd,
#### Linux consoles
#
@ -675,6 +674,8 @@ linux-lat|linux with latin1 or latin2 alternate character set,
# I renamed GS/GE/HM/EN/PU/PD/RT and added klone+sgr-dumb, based
# on the <smacs>=\E[12m -- esr)
#
# klone+sgr-dumb is an error since the acsc does not match -TD
#
# In this description based on SCO's keyboard(HW) manpage list of default function key
# values:
# F13-F24 are shifted F1-F12
@ -682,24 +683,28 @@ linux-lat|linux with latin1 or latin2 alternate character set,
# F37-F48 are shift+control F1-F12
scoansi|SCO Extended ANSI standard crt,
am, eo, xon,
cols#80, it#8, lines#25,
colors#8, cols#80, it#8, lines#25, pairs#64,
acsc=0[5566778899\:\:;;<<==>>FFGGHHIIJJKKLLMMNNOOPPQQRRSSTTUUVVWWXX`ja0fxgqh2jYk?lZm@nEqDtCu4vAwBx3~y,
blink=\E[5m, bold=\E[1m, cbt=\E[Z, clear=\E[H\E[2J,
cub1=\E[D, cud1=\E[B, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH,
cuu1=\E[A, dch1=\E[P, dl1=\E[M, ed=\E[J, el=\E[K, home=\E[H,
ht=^I, ich1=\E[@, il1=\E[L, ind=\E[S, kbs=^H, kcub1=\E[D,
kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kend=\E[F, kf1=\E[M,
kf10=\E[V, kf12=\E[W, kf13=\E[Y, kf14=\E[Z, kf15=\E[a,
kf16=\E[b, kf17=\E[c, kf18=\E[d, kf19=\E[e, kf2=\E[N,
kf20=\E[f, kf21=\E[g, kf22=\E[h, kf23=\E[i, kf24=\E[j,
kf25=\E[k, kf26=\E[l, kf27=\E[m, kf28=\E[n, kf29=\E[o,
kf3=\E[O, kf30=\E[p, kf31=\E[q, kf32=\E[r, kf33=\E[s,
kf34=\E[t, kf35=\E[u, kf36=\E[v, kf37=\E[w, kf38=\E[x,
kf39=\E[y, kf4=\E[P, kf40=\E[z, kf41=\E[@, kf42=\E[[,
kf43=\E[\\, kf44=\E[], kf45=\E[\014kf46=\E[_, kf47=\E[`,
kf48=\E[{, kf5=\E[Q, kf6=\E[R, kf7=\E[S, kf8=\E[T, kf9=\E[U,
khome=\E[H, kich1=\E[L, knp=\E[G, kpp=\E[I, krdo=\E[F,
ri=\E[T,
use=klone+sgr-dumb,
ht=^I, ich1=\E[@, il1=\E[L, ind=\E[S, invis=\E[8m, kbeg=\E[E,
kbs=^H, kcbt=\E[Z, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C,
kcuu1=\E[A, kend=\E[F, kf1=\E[M, kf10=\E[V, kf11=\E[W,
kf12=\E[X, kf13=\E[Y, kf15=\E[a, kf16=\E[b, kf17=\E[c,
kf18=\E[d, kf19=\E[e, kf2=\E[N, kf20=\E[f, kf21=\E[g,
kf22=\E[h, kf23=\E[i, kf24=\E[j, kf25=\E[k, kf26=\E[l,
kf27=\E[m, kf28=\E[n, kf29=\E[o, kf3=\E[O, kf30=\E[p,
kf31=\E[q, kf32=\E[r, kf33=\E[s, kf34=\E[t, kf35=\E[u,
kf36=\E[v, kf37=\E[w, kf38=\E[x, kf39=\E[y, kf4=\E[P,
kf40=\E[z, kf41=\E[@, kf42=\E[[, kf43=\E[\\, kf44=\E[],
kf45=\E[\^, kf46=\E[_, kf47=\E[`, kf48=\E[{, kf5=\E[Q,
kf6=\E[R, kf7=\E[S, kf8=\E[T, kf9=\E[U, khome=\E[H,
kich1=\E[L, knp=\E[G, kpp=\E[I, op=\E[37;40m, rev=\E[7m,
ri=\E[T, rmacs=\E[10m, rmso=\E[m, rmul=\E[m,
setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;12%;m,
sgr0=\E[0;10m, smacs=\E[12m, smso=\E[7m, smul=\E[4m,
# This actually describes the generic SVr4 display driver for Intel boxes.
# The <dim=\E[2m> isn't documented and therefore may not be reliable.
@ -920,7 +925,7 @@ att7300|unixpc|pc7300|3b1|s4|AT&T UNIX PC Model 7300,
#
# control-tab \[072q
#
iris-ansi|IRIS emulating 40 line ANSI terminal (almost VT100),
iris-ansi|iris-ansi-net|IRIS emulating 40 line ANSI terminal (almost VT100),
am,
cols#80, it#8, lines#40,
bel=^G, bold=\E[1m, clear=\E[H\E[2J,
@ -1188,6 +1193,46 @@ x68k|x68k-ite|NetBSD/x68k ITE,
cols#96, lines#32,
kclr=\E[9~, khlp=\E[28~, use=vt220,
# <tv@pobox.com>:
# Entry for the DNARD OpenFirmware console, close to ANSI but not quite.
#
# (still unfinished, but good enough so far.)
ofcons,
bw,
cols#80, lines#30,
bel=^G, blink=\2337;2m, bold=\2331m, clear=^L, cr=^M,
cub=\233%p1%dD, cub1=\233D, cud=\233%p1%dB, cud1=\233B,
cuf=\233%p1%dC, cuf1=\233C, cup=\233%i%p1%d;%p2%dH,
cuu=\233%p1%dA, cuu1=\233A, dch=\233%p1%dP, dch1=\233P,
dim=\2332m, dl=\233%p1%dM, dl1=\233M, ed=\233J, el=\233K,
flash=^G, ht=^I, ich=\233%p1%d@, ich1=\233@, il=\233%p1%dL,
il1=\233L, ind=^J, invis=\2338m, kbs=^H, kcub1=\233D,
kcud1=\233B, kcuf1=\233C, kcuu1=\233A, kdch1=\233P,
kf1=\2330P, kf10=\2330M, kf2=\2330Q, kf3=\2330W,
kf4=\2330x, kf5=\2330t, kf6=\2330u, kf7=\2330q, kf8=\2330r,
kf9=\2330p, knp=\233/, kpp=\233?, nel=^M^J, rev=\2337m,
rmso=\2330m, rmul=\2330m, sgr0=\2330m,
# NetBSD "wscons" emulator in vt220 mode
# These are micro-minimal and probably need to be redone for real
# after the manner of the pcvt entries.
wsvt25|NetBSD wscons in 25 line DEC VT220 mode,
cols#80, lines#25, use=vt220,
wsvt25m|NetBSD wscons in 25 line DEC VT220 mode with Meta,
km,
cols#80, lines#25, use=vt220,
# `rasterconsole' provided by 4.4BSD, NetBSD and OpenBSD on SPARC, and
# DECstation/pmax.
rcons|BSD rasterconsole,
use=sun-il,
# Color version of above. Color currenly only provided by NetBSD.
rcons-color|BSD rasterconsole with ANSI color,
bce,
colors#8, pairs#64,
op=\E[m, setab=\E[4%dm, setaf=\E[3%dm, use=rcons,
#### FreeBSD console entries
#
# From: Andrey Chernov <ache@astral.msk.su> 29 Mar 1996
@ -1213,22 +1258,23 @@ x68k|x68k-ite|NetBSD/x68k ITE,
# Note that this disables standout with color.
cons25w|ansiw|ansi80x25-raw|freebsd console (25-line raw mode),
am, bce, bw, eo, msgr, npc,
colors#8, cols#80, it#8, lines#25, ncv#5, pairs#64,
colors#8, cols#80, it#8, lines#25, ncv#21, pairs#64,
bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, clear=\E[H\E[J,
cr=^M, cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=\E[B,
cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH,
cuu=\E[%p1%dA, cuu1=\E[A, dch=\E[%p1%dP, dch1=\E[P,
dim=\E[30;1m, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K,
home=\E[H, hpa=\E[%i%p1%d`, ht=^I, ich=\E[%p1%d@,
ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=\E[S,
indn=\E[%p1%dS, kb2=\E[E, kbs=^H, kcbt=\E[Z, kcub1=\E[D,
kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kdch1=\177, kend=\E[F,
kf1=\E[M, kf10=\E[V, kf11=\E[W, kf12=\E[X, kf2=\E[N,
kf3=\E[O, kf4=\E[P, kf5=\E[Q, kf6=\E[R, kf7=\E[S, kf8=\E[T,
kf9=\E[U, khome=\E[H, kich1=\E[L, knp=\E[G, kpp=\E[I,
nel=\E[E, op=\E[x, rev=\E[7m, ri=\E[T, rin=\E[%p1%dT,
rmso=\E[m, rs1=\E[x\E[m\Ec, setab=\E[4%p1%dm,
setaf=\E[3%p1%dm, sgr0=\E[m, smso=\E[7m, vpa=\E[%i%p1%dd,
cnorm=\E[=0C, cr=^M, cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB,
cud1=\E[B, cuf=\E[%p1%dC, cuf1=\E[C,
cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
cvvis=\E[=1C, dch=\E[%p1%dP, dch1=\E[P, dim=\E[30;1m,
dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, home=\E[H,
hpa=\E[%i%p1%d`, ht=^I, ich=\E[%p1%d@, ich1=\E[@,
il=\E[%p1%dL, il1=\E[L, ind=\E[S, indn=\E[%p1%dS, kb2=\E[E,
kbs=^H, kcbt=\E[Z, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C,
kcuu1=\E[A, kdch1=\177, kend=\E[F, kf1=\E[M, kf10=\E[V,
kf11=\E[W, kf12=\E[X, kf2=\E[N, kf3=\E[O, kf4=\E[P, kf5=\E[Q,
kf6=\E[R, kf7=\E[S, kf8=\E[T, kf9=\E[U, khome=\E[H,
kich1=\E[L, knp=\E[G, kpp=\E[I, nel=\E[E, op=\E[x, rev=\E[7m,
ri=\E[T, rin=\E[%p1%dT, rmso=\E[m, rs1=\E[x\E[m\Ec,
setab=\E[4%p1%dm, setaf=\E[3%p1%dm, sgr0=\E[m,
smso=\E[7m, vpa=\E[%i%p1%dd,
cons25|ansis|ansi80x25|freebsd console (25-line ansi mode),
acsc=-\030.^Y0\333`\004a\260f\370g\361h\261i\025j\331k\277l\332m\300n\305q\304t\303u\264v\301w\302x\263y\363z\362~\371,
use=cons25w,
@ -2737,11 +2783,7 @@ screen3|older VT 100/ANSI X3.64 virtual terminal,
# answerback string: "ncsa-vt220-8"
# setup keys: all disabled
#
# Application mode is not used. The documented function-key mapping refers to
# the Apple Extended Keyboard (e.g., NCSA Telnet's F1 corresponds to a VT220
# F6). We use the VT220-style codes, however, since the numeric keypad (VT100)
# PF1-PF4 are available on some keyboards and many applications require these
# as F1-F4.
# Application mode is not used.
#
# Other special mappings:
# Apple VT220
@ -2758,7 +2800,7 @@ screen3|older VT 100/ANSI X3.64 virtual terminal,
# The status-line manipulation is a mapping of the xterm-compatible control
# sequences for setting the window-title. So you must use tsl and fsl in
# pairs, since the latter ends the string that is loaded to the window-title.
ncsa-m|ncsa-vt220|ncsa-vt220-8|NCSA Telnet 2.6 for Macintosh in vt220-8 mode,
ncsa-m|ncsa-vt220-8|NCSA Telnet 2.6 for Macintosh in vt220-8 mode,
am, hs, km, mir, msgr, xenl,
acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l,
@ -2770,14 +2812,13 @@ ncsa-m|ncsa-vt220|ncsa-vt220-8|NCSA Telnet 2.6 for Macintosh in vt220-8 mode,
dsl=\E]0;\007, ed=\E[J, el=\E[K, el1=\E[1K, enacs=\E)0,
flash=\E[?5h\E[?5l, fsl=^G, home=\E[H, ht=^I, hts=\EH,
ich=\E[%p1%d@, if=/usr/share/tabset/vt100,
il=\E[%p1%dL, il1=\E[L, ind=^J,
il=\E[%p1%dL, il1=\E[L, ind=\n$<150*>,
is2=\E7\E[r\E[m\E[?7h\E[?1;4;6l\E[4l\E8\E>, kbs=^H,
kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A,
kdch1=\E[4~, kend=\E[5~, kf1=\EOP, kf10=\E[21~,
kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~,
kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~,
kf19=\E[33~, kf2=\EOQ, kf20=\E[34~, kf3=\EOR, kf4=\EOS,
kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, khlp=\E[1~,
kdch1=\E[4~, kend=\E[5~, kf1=\E[17~, kf10=\E[28~,
kf11=\E[29~, kf12=\E[31~, kf13=\E[32~, kf14=\E[33~,
kf15=\E[34~, kf2=\E[18, kf3=\E[19~, kf4=\E[20~, kf5=\E[21~,
kf6=\E23~, kf7=\E[24~, kf8=\E[25~, kf9=\E[26~, khlp=\E[1~,
khome=\E[2~, knp=\E[6~, kpp=\E[3~, mc4=\E[4i, mc5=\E[5i,
rc=\E8, rev=\E[7m, rf=/usr/share/tabset/vt100, ri=\EM,
rmacs=^O, rmam=\E[?7l, rmcup=\E[2J\E8, rmir=\E[4l,
@ -2795,6 +2836,19 @@ ncsa-ns|NCSA Telnet 2.7 for Macintosh in vt220-8 mode,
ncsa-m-ns|NCSA Telnet 2.6 for Macintosh in vt220-8 mode,
hs@,
dsl@, fsl@, tsl@, use=ncsa-m,
# alternate -TD:
# The documented function-key mapping refers to the Apple Extended Keyboard
# (e.g., NCSA Telnet's F1 corresponds to a VT220 F6). We use the VT220-style
# codes, however, since the numeric keypad (VT100) PF1-PF4 are available on
# some keyboards and many applications require these as F1-F4.
#
ncsa-vt220|NCSA Telnet using vt220-compatible function keys,
kf1=\EOP, kf10=\E[21~, kf11=\E[23~, kf12=\E[24~,
kf13=\E[25~, kf14=\E[26~, kf15=\E[28~, kf16=\E[29~,
kf17=\E[31~, kf18=\E[32~, kf19=\E[33~, kf2=\EOQ,
kf20=\E[34~, kf3=\EOR, kf4=\EOS, kf6=\E[17~, kf7=\E[18~,
kf8=\E[19~, kf9=\E[20~,
use=ncsa,
#### Pilot Pro Palm-Top
#
@ -3212,6 +3266,19 @@ mono-emx|stupid monochrome ansi terminal with only one kind of emphasis,
kich1=\0R, kll=\0O, knp=\0Q, kpp=\0I, nel=^M^J, rev=\E[7m,
sgr0=\E[0m,
# Use this for cygwin32 (tested with beta 19.1)
# underline is colored bright magenta
# shifted kf1-kf12 are kf11-kf22
cygwin|ansi emulation for cygwin32,
kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A,
kdch1=\E[3~, kend=\E[4~, kf1=\E[[A, kf10=\E[21~,
kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~,
kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~,
kf19=\E[33~, kf2=\E[[B, kf20=\E[34~, kf3=\E[[C, kf4=\E[[D,
kf5=\E[[E, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
khome=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, rmam@, smam@,
use=ansi.sys,
# This entry fits the Windows NT console when the _POSIX_TERM environment
# variable is set to 'on'. While the Windows NT POSIX console is seldom used,
# the Telnet client supplied with both the Windows for WorkGroup 3.11 TCP/IP
@ -3922,22 +3989,22 @@ hp700-wy|HP700/41 emulating wyse30,
sgr0=\EG0$<10/>, smir=\Eq, smso=\EG4$<10/>,
smul=\EG8$<10/>, tbc=\E0, vpa=\E[%p1%{32}%+%c,
# (hp70092: added empty <acsc> to avoid warnings re <smacs>/<rmacs> --esr)
hp70092|hp70092a|hp70092A|HP 700/92,
hp70092|hp70092a|hp70092A|70092|HP 700/92,
am, da, db, xhp,
cols#80, lh#2, lines#24, lm#0, lw#8, nlab#8,
acsc=, bel=^G, blink=\E&dA, bold=\E&dB, cbt=\Ei,
clear=\E&a0y0C\EJ, cr=^M, cub1=^H, cud1=\EB, cuf1=\EC,
cup=\E&a%p1%dy%p2%dC, cuu1=\EA, dch1=\EP, dim=\E&dH,
dl1=\EM, el=\EK, hpa=\E&a%p1%dC, ht=^I, hts=\E1, il1=\EL,
kbs=^H, kclr=\EJ, kctab=\E2, kcub1=\ED, kcud1=\EB, kcuf1=\EC,
kcuu1=\EA, kdch1=\EP, kdl1=\EM, ked=\EJ, kel=\EK, kf1=\Ep,
kf2=\Eq, kf3=\Er, kf4=\Es, kf5=\Et, kf6=\Eu, kf7=\Ev, kf8=\Ew,
khome=\Eh, khts=\E1, kich1=\EQ, kil1=\EL, kind=\ES, kll=\EF,
knp=\EU, kpp=\EV, kri=\ET, krmir=\ER, ktbc=\E3, rev=\E&dB,
ri=\ET, rmacs=^O, rmir=\ER, rmkx=\E&s0A, rmln=\E&j@,
rmso=\E&d@, rmul=\E&d@, sgr0=\E&d@, smacs=^N, smir=\EQ,
smkx=\E&s1A, smln=\E&jB, smso=\E&dJ, smul=\E&dD, tbc=\E3,
vpa=\E&a%p1%dY,
acsc=0cjgktlrmfn/q\,t5u6v8w7x., bel=^G, blink=\E&dA,
bold=\E&dB, cbt=\Ei, clear=\E&a0y0C\EJ, cr=^M, cub1=^H,
cud1=\EB, cuf1=\EC, cup=\E&a%p1%dy%p2%dC, cuu1=\EA,
dch1=\EP, dim=\E&dH, dl1=\EM, el=\EK, hpa=\E&a%p1%dC, ht=^I,
hts=\E1, il1=\EL, kbs=^H, kclr=\EJ, kctab=\E2, kcub1=\ED,
kcud1=\EB, kcuf1=\EC, kcuu1=\EA, kdch1=\EP, kdl1=\EM,
ked=\EJ, kel=\EK, kf1=\Ep, kf2=\Eq, kf3=\Er, kf4=\Es, kf5=\Et,
kf6=\Eu, kf7=\Ev, kf8=\Ew, khome=\Eh, khts=\E1, kich1=\EQ,
kil1=\EL, kind=\ES, kll=\EF, knp=\EU, kpp=\EV, kri=\ET,
krmir=\ER, ktbc=\E3, rev=\E&dB, ri=\ET, rmacs=^O, rmir=\ER,
rmkx=\E&s0A, rmln=\E&j@, rmso=\E&d@, rmul=\E&d@,
sgr0=\E&d@, smacs=^N, smir=\EQ, smkx=\E&s1A, smln=\E&jB,
smso=\E&dJ, smul=\E&dD, tbc=\E3, vpa=\E&a%p1%dY,
bobcat|sbobcat|HP 9000 model 300 console,
am, da, db, mir, xhp,
@ -13775,6 +13842,12 @@ amiga-h|Hans Verkuil's Amiga ANSI,
rmul=\2330m, rs1=\Ec, sgr0=\2330m, smacs=^N, smcup=\233?7l,
smso=\2337m, smul=\2334m,
# From: Henning 'Faroul' Peters <Faroul@beyond.kn-bremen.de>, 25 Sep 1999
amiga-8bit|Amiga ANSI using 8-bit controls,
acsc=, dl=\233%p1%dM, dl1=\233M, il=\233%p1%dL, il1=\233L,
ind=\204, indn@, ri=\215, rin@,
use=amiga-h,
# Commodore B-128 microcomputer from Doug Tyrol <det@HEL-ACE.ARPA>
# I'm trying to write a termcap for a commodore b-128, and I'm
# having a little trouble. I've had to map most of my control characters
@ -17245,6 +17318,31 @@ v3220|LANPAR Vision II model 3220/3221/3222,
# 1999/8/21
# * corrections to beterm entry -TD
#
# 1999/8/28
# * add cygwin entry -TD
#
# 1999/9/4
# * minor corrections for beterm entry -TD
#
# 1999/9/18
# * add acsc string to HP 70092 terminfo entry -Joerg Wunsch
#
# 1999/9/25
# * add amiga-8bit entry
# * add console entries from NetBSD: ofcons, wsvt25, wsvt25m, rcons,
# rcons-color, based on
# ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/share/termcap/termcap.src
# * add alias for iris-ansi-net
#
# 1999/10/2
# * corrected scoansi entry's acsc, some function keys, add color -TD
#
# 1999/10/23
# * add cnorm, cvvis to cons25w, and modify ncv to add 'dim' -TD
# * reorder ncsa entries to make ncsa-vt220 use the alternate function
# key mapping, leaving Potorti's entries more like he named them -TD
# * remove enter/exit am-mode from cygwin -TD
#
# The following sets edit modes for GNU EMACS.
# Local Variables:
# fill-prefix:"\t"

View File

@ -1,4 +1,4 @@
# $Id: Makefile.in,v 1.62 1999/02/18 11:58:20 tom Exp $
# $Id: Makefile.in,v 1.63 1999/09/01 22:35:53 tom Exp $
##############################################################################
# Copyright (c) 1998 Free Software Foundation, Inc. #
# #
@ -210,8 +210,8 @@ mostlyclean ::
clean :: mostlyclean
-rm -f $(AUTO_SRC)
-rm -f make_keys
-rm -f make_hash
-rm -f make_keys$x
-rm -f make_hash$x
distclean :: clean
-rm -f Makefile

View File

@ -42,7 +42,7 @@
#include <curses.priv.h>
#include <term.h> /* beep, flash */
MODULE_ID("$Id: lib_beep.c,v 1.6 1998/06/29 19:34:16 Alexander.V.Lukyanov Exp $")
MODULE_ID("$Id: lib_beep.c,v 1.7 1999/10/22 21:39:09 tom Exp $")
/*
* beep()
@ -62,11 +62,11 @@ int beep(void)
if (bell) {
TPUTS_TRACE("bell");
res = putp(bell);
fflush(SP->_ofp);
_nc_flush();
} else if (flash_screen) {
TPUTS_TRACE("flash_screen");
res = putp(flash_screen);
fflush(SP->_ofp);
_nc_flush();
}
returnCode(res);

View File

@ -41,7 +41,7 @@
#include <term.h>
MODULE_ID("$Id: lib_color.c,v 1.35 1999/03/15 01:45:14 Alexander.V.Lukyanov Exp $")
MODULE_ID("$Id: lib_color.c,v 1.36 1999/10/03 00:20:37 Philippe.Blain Exp $")
/*
* These should be screen structure members. They need to be globals for
@ -345,7 +345,7 @@ bool has_colors(void)
int color_content(short color, short *r, short *g, short *b)
{
T((T_CALLED("color_content(%d,%p,%p,%p)"), color, r, g, b));
if (color < 0 || color > COLORS)
if (color < 0 || color >= COLORS)
returnCode(ERR);
if (r) *r = SP->_color_table[color].red;
@ -358,7 +358,7 @@ int pair_content(short pair, short *f, short *b)
{
T((T_CALLED("pair_content(%d,%p,%p)"), pair, f, b));
if ((pair < 0) || (pair > COLOR_PAIRS))
if ((pair < 0) || (pair >= COLOR_PAIRS))
returnCode(ERR);
if (f) *f = ((SP->_color_pairs[pair] >> C_SHIFT) & C_MASK);
if (b) *b = (SP->_color_pairs[pair] & C_MASK);

View File

@ -42,7 +42,7 @@
#include <curses.priv.h>
#include <term.h> /* beep, flash */
MODULE_ID("$Id: lib_flash.c,v 1.3 1998/06/29 19:34:16 Alexander.V.Lukyanov Exp $")
MODULE_ID("$Id: lib_flash.c,v 1.4 1999/10/22 21:39:06 tom Exp $")
/*
* flash()
@ -62,11 +62,11 @@ int flash(void)
if (flash_screen) {
TPUTS_TRACE("flash_screen");
res = putp(flash_screen);
fflush(SP->_ofp);
_nc_flush();
} else if (bell) {
TPUTS_TRACE("bell");
res = putp(bell);
fflush(SP->_ofp);
_nc_flush();
}
returnCode(res);

View File

@ -39,7 +39,7 @@
extern int malloc_errfd; /* FIXME */
#endif
MODULE_ID("$Id: lib_freeall.c,v 1.14 1999/04/03 23:17:06 tom Exp $")
MODULE_ID("$Id: lib_freeall.c,v 1.15 1999/10/22 21:40:10 tom Exp $")
static void free_slk(SLK *p)
{
@ -101,8 +101,6 @@ void _nc_freeall(void)
free_slk(SP->_slk);
FreeIfNeeded(SP->_color_pairs);
FreeIfNeeded(SP->_color_table);
/* it won't free buffer anyway */
/* _nc_set_buffer(SP->_ofp, FALSE);*/
#if !BROKEN_LINKER
FreeAndNull(SP);
#endif

View File

@ -85,7 +85,7 @@
#endif
#endif
MODULE_ID("$Id: lib_mouse.c,v 1.44 1999/07/24 21:10:48 tom Exp $")
MODULE_ID("$Id: lib_mouse.c,v 1.45 1999/10/22 21:39:02 tom Exp $")
#define MY_TRACE TRACE_ICALLS|TRACE_IEVENT
@ -531,7 +531,7 @@ static void mouse_activate(bool on)
#endif
}
}
(void) fflush(SP->_ofp);
_nc_flush();
}
/**************************************************************************

View File

@ -42,7 +42,7 @@
#include <curses.priv.h>
MODULE_ID("$Id: lib_newwin.c,v 1.20 1998/05/23 23:21:32 Alexander.V.Lukyanov Exp $")
MODULE_ID("$Id: lib_newwin.c,v 1.21 1999/10/03 00:42:03 tom Exp $")
void _nc_freewin(WINDOW *win)
{
@ -60,7 +60,7 @@ int i;
if (! (win->_flags & _SUBWIN)) {
for (i = 0; i <= win->_maxy && win->_line[i].text; i++)
free(win->_line[i].text);
FreeIfNeeded(win->_line[i].text);
}
free(win->_line);
free(win);

View File

@ -43,7 +43,7 @@
#include <curses.priv.h>
MODULE_ID("$Id: lib_nl.c,v 1.3 1998/10/14 15:14:08 Alexander.V.Lukyanov Exp $")
MODULE_ID("$Id: lib_nl.c,v 1.4 1999/10/22 22:31:51 tom Exp $")
#ifdef __EMX__
#include <io.h>
@ -57,8 +57,8 @@ int nl(void)
SP->_nl = TRUE;
#ifdef __EMX__
fflush(SP->_ofp);
_fsetmode(SP->_ofp, "t");
_nc_flush();
_fsetmode(NC_OUTPUT, "t");
#endif
returnCode(OK);
@ -71,8 +71,8 @@ int nonl(void)
SP->_nl = FALSE;
#ifdef __EMX__
fflush(SP->_ofp);
_fsetmode(SP->_ofp, "b");
_nc_flush();
_fsetmode(NC_OUTPUT, "b");
#endif
returnCode(OK);

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
* Copyright (c) 1998,1999 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -33,7 +33,7 @@
#include <curses.priv.h>
#include <ctype.h>
MODULE_ID("$Id: safe_sprintf.c,v 1.10 1999/02/27 19:56:37 tom Exp $")
MODULE_ID("$Id: safe_sprintf.c,v 1.11 1999/09/11 18:03:27 tom Exp $")
#if USE_SAFE_SPRINTF
@ -112,7 +112,6 @@ _nc_printf_length(const char *fmt, va_list ap)
case 'Z': /* FALLTHRU */
case 'h': /* FALLTHRU */
case 'l': /* FALLTHRU */
case 'L': /* FALLTHRU */
done = FALSE;
type = *fmt;
break;
@ -134,10 +133,7 @@ _nc_printf_length(const char *fmt, va_list ap)
case 'E': /* FALLTHRU */
case 'g': /* FALLTHRU */
case 'G': /* FALLTHRU */
if (type == 'L')
VA_FLOAT(long double);
else
VA_FLOAT(double);
VA_FLOAT(double);
used = 'f';
break;
case 'c':

View File

@ -0,0 +1,48 @@
/****************************************************************************
* Copyright (c) 1999 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* "Software"), to deal in the Software without restriction, including *
* without limitation the rights to use, copy, modify, merge, publish, *
* distribute, distribute with modifications, sublicense, and/or sell *
* copies of the Software, and to permit persons to whom the Software is *
* furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included *
* in all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
* *
* Except as contained in this notice, the name(s) of the above copyright *
* holders shall not be used in advertising or otherwise to promote the *
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************/
/****************************************************************************
* Author: Thomas E. Dickey <dickey@clark.net> 1999 *
****************************************************************************/
#include <curses.priv.h>
MODULE_ID("$Id: version.c,v 1.1 1999/10/23 13:28:49 tom Exp $")
const char *
curses_version(void)
{
static char my_version[80];
T((T_CALLED("curses_version()")));
sprintf(my_version, "ncurses %d.%d.%d",
NCURSES_VERSION_MAJOR,
NCURSES_VERSION_MINOR,
NCURSES_VERSION_PATCH);
returnPtr(my_version);
}

View File

@ -33,7 +33,7 @@
/*
* $Id: curses.priv.h,v 1.142 1999/07/04 01:21:35 tom Exp $
* $Id: curses.priv.h,v 1.144 1999/10/22 23:15:37 tom Exp $
*
* curses.priv.h
*
@ -388,6 +388,8 @@ struct screen {
/* hashes for old and new lines */
unsigned long *oldhash, *newhash;
bool _cleanup; /* cleanup after int/quit signal */
};
extern SCREEN *_nc_screen_chain;
@ -734,6 +736,9 @@ extern int *_nc_oldnums;
if ((SP->_buffered != 0) != flag) \
_nc_set_buffer(SP->_ofp, flag)
#define NC_OUTPUT ((SP != 0) ? SP->_ofp : stdout)
#define _nc_flush() (void)fflush(NC_OUTPUT)
/*
* On systems with a broken linker, define 'SP' as a function to force the
* linker to pull in the data-only module with 'SP'.

View File

@ -1209,7 +1209,7 @@ void filter(void)
#undef newterm
SCREEN *newterm(
char *term,
char *name,
FILE *ofp,
FILE *ifp)
{ return(*(SCREEN **)0); }
@ -1402,7 +1402,7 @@ int wnoutrefresh(
#undef restartterm
int restartterm(
char *term,
char *termp,
int filenum,
int *errret)
{ return(*(int *)0); }
@ -1520,7 +1520,7 @@ int wsetscrreg(
#undef set_term
SCREEN *set_term(
SCREEN *screen)
SCREEN *screenp)
{ return(*(SCREEN **)0); }
#undef delscreen
@ -1938,6 +1938,8 @@ int use_default_colors(void)
/* ./base/lib_freeall.c */
#include <term_entry.h>
#undef _nc_freeall
void _nc_freeall(void)
{ /* void */ }
@ -1958,17 +1960,8 @@ int resizeterm(
int ToCols)
{ return(*(int *)0); }
/* ./trace/trace_tries.c */
#undef _nc_trace_tries
void _nc_trace_tries(
struct tries *tree)
{ /* void */ }
/* ./trace/trace_xnames.c */
#include <term_entry.h>
#undef _nc_trace_xnames
void _nc_trace_xnames(
TERMTYPE *tp)
@ -1996,6 +1989,12 @@ int _nc_remove_string(
char *string)
{ return(*(int *)0); }
/* ./base/version.c */
#undef curses_version
const char *curses_version(void)
{ return(*(const char **)0); }
/* ./base/wresize.c */
#undef wresize
@ -2013,6 +2012,15 @@ int _nc_access(
int mode)
{ return(*(int *)0); }
/* ./tinfo/add_tries.c */
#undef _nc_add_to_try
void _nc_add_to_try(
struct tries **tree,
char *str,
unsigned short code)
{ /* void */ }
/* ./tinfo/alloc_entry.c */
#undef _nc_init_entry
@ -2151,7 +2159,7 @@ void _nc_syserr_abort(
char *_nc_tic_expand(
const char *srcp,
bool tic_format,
bool numbers)
int numbers)
{ return(*(char **)0); }
/* ./tinfo/comp_hash.c */
@ -2293,11 +2301,12 @@ char *_nc_home_terminfo(void)
#include <init_keytry.h>
#undef _nc_tinfo_fkeys
struct tinfo_fkeys _nc_tinfo_fkeys[];
#endif
#undef _nc_tinfo_fkeysf
struct tinfo_fkeys *_nc_tinfo_fkeysf(void)
{ return(*(struct tinfo_fkeys **)0); }
#undef _nc_init_keytry
void _nc_init_keytry(void)
{ /* void */ }
@ -2341,12 +2350,12 @@ TERMINAL *cur_term;
#undef set_curterm
TERMINAL *set_curterm(
TERMINAL *term)
TERMINAL *termp)
{ return(*(TERMINAL **)0); }
#undef del_curterm
int del_curterm(
TERMINAL *term)
TERMINAL *termp)
{ return(*(int *)0); }
/* ./tinfo/lib_data.c */
@ -2835,13 +2844,11 @@ char *_nc_trace_buf(
size_t want)
{ return(*(char **)0); }
/* ./tinfo/add_tries.c */
/* ./trace/trace_tries.c */
#undef _nc_add_to_try
void _nc_add_to_try(
struct tries **tree,
char *str,
unsigned short code)
#undef _nc_trace_tries
void _nc_trace_tries(
struct tries *tree)
{ /* void */ }
/* ./unctrl.c */

View File

@ -1,4 +1,4 @@
# $Id: modules,v 1.69 1999/07/18 02:38:37 tom Exp $
# $Id: modules,v 1.70 1999/10/23 12:39:12 tom Exp $
##############################################################################
# Copyright (c) 1998,1999 Free Software Foundation, Inc. #
# #
@ -130,6 +130,7 @@ lib_print lib $(tinfo) ../include/term.h
resizeterm lib $(base) ../include/term.h
trace_xnames lib $(trace) ../include/term.h $(INCDIR)/term_entry.h
tries lib $(base)
version lib $(base)
wresize lib $(base) ../include/term.h
# Support for termcap (and tic, etc.), which can be a separate library

View File

@ -32,7 +32,7 @@
/* cursor_visible,cursor_normal,cursor_invisible */
#include <tic.h> /* struct tinfo_fkeys */
MODULE_ID("$Id: init_keytry.c,v 1.1 1999/02/18 22:39:11 tom Exp $")
MODULE_ID("$Id: init_keytry.c,v 1.2 1999/09/11 17:32:57 Jeffrey.Honig Exp $")
/*
** _nc_init_keytry()
@ -41,12 +41,23 @@ MODULE_ID("$Id: init_keytry.c,v 1.1 1999/02/18 22:39:11 tom Exp $")
**
*/
#ifdef BROKEN_LINKER
#undef _nc_tinfo_fkeys
#endif
/* LINT_PREPRO
#if 0*/
#include <init_keytry.h>
/* LINT_PREPRO
#endif*/
#ifdef BROKEN_LINKER
struct tinfo_fkeys *_nc_tinfo_fkeysf(void)
{
return _nc_tinfo_fkeys;
}
#endif
void _nc_init_keytry(void)
{
size_t n;

View File

@ -58,7 +58,7 @@
#endif
#endif
MODULE_ID("$Id: lib_napms.c,v 1.5 1999/06/06 00:42:47 R.Lindsay.Todd Exp $")
MODULE_ID("$Id: lib_napms.c,v 1.6 1999/10/21 23:01:41 tom Exp $")
int napms(int ms)
{
@ -71,8 +71,6 @@ int napms(int ms)
ts.tv_nsec = (ms % 1000) * 1000000;
nanosleep(&ts, NULL);
}
#elif HAVE_USLEEP
usleep(1000*(unsigned)ms);
#elif USE_FUNC_POLL
{
struct pollfd fds[1];

View File

@ -44,7 +44,7 @@
#include <term.h> /* keypad_xmit, keypad_local, meta_on, meta_off */
/* cursor_visible,cursor_normal,cursor_invisible */
MODULE_ID("$Id: lib_options.c,v 1.35 1999/07/04 00:18:28 tom Exp $")
MODULE_ID("$Id: lib_options.c,v 1.36 1999/10/22 21:38:57 tom Exp $")
int idlok(WINDOW *win, bool flag)
{
@ -193,7 +193,7 @@ int cursor = SP->_cursor;
break;
}
SP->_cursor = vis;
(void) fflush(SP->_ofp);
_nc_flush();
returnCode(cursor==-1 ? 1 : cursor);
}
@ -244,13 +244,13 @@ int _nc_keypad(bool flag)
{
TPUTS_TRACE("keypad_xmit");
putp(keypad_xmit);
(void) fflush(SP->_ofp);
_nc_flush();
}
else if (! flag && keypad_local)
{
TPUTS_TRACE("keypad_local");
putp(keypad_local);
(void) fflush(SP->_ofp);
_nc_flush();
}
if (flag && !SP->_tried) {

View File

@ -39,7 +39,7 @@
#define __INTERNAL_CAPS_VISIBLE
#include <term_entry.h>
MODULE_ID("$Id: lib_termcap.c,v 1.28 1999/02/27 22:12:58 tom Exp $")
MODULE_ID("$Id: lib_termcap.c,v 1.29 1999/09/05 01:06:43 tom Exp $")
/*
some of the code in here was contributed by:
@ -162,7 +162,7 @@ int i;
*
***************************************************************************/
char *tgetstr(NCURSES_CONST char *id, char **area GCC_UNUSED)
char *tgetstr(NCURSES_CONST char *id, char **area)
{
int i;
@ -175,6 +175,12 @@ int i;
if (!strncmp(id, capname, 2)) {
T(("found match : %s", _nc_visbuf(tp->Strings[i])));
/* setupterm forces cancelled strings to null */
if (area != 0
&& *area != 0
&& VALID_STRING(tp->Strings[i])) {
(void) strcpy(*area, tp->Strings[i]);
*area += strlen(*area) + 1;
}
returnPtr(tp->Strings[i]);
}
}

View File

@ -46,9 +46,7 @@
#include <termcap.h> /* ospeed */
#include <tic.h>
MODULE_ID("$Id: lib_tputs.c,v 1.39 1999/02/25 10:44:29 tom Exp $")
#define OUTPUT ((SP != 0) ? SP->_ofp : stdout)
MODULE_ID("$Id: lib_tputs.c,v 1.41 1999/10/22 23:31:24 tom Exp $")
char PC; /* used by termcap library */
speed_t ospeed; /* used by termcap library */
@ -70,7 +68,7 @@ int delay_output(int ms)
for (_nc_nulls_sent += nullcount; nullcount > 0; nullcount--)
my_outch(PC);
if (my_outch == _nc_outch)
(void) fflush(OUTPUT);
_nc_flush();
}
returnCode(OK);
@ -82,7 +80,17 @@ int _nc_outch(int ch)
_nc_outchars++;
#endif /* TRACE */
putc(ch, OUTPUT);
if (SP != 0
&& SP->_cleanup) {
char tmp = ch;
/*
* POSIX says write() is safe in a signal handler, but the
* buffered I/O is not.
*/
write(fileno(NC_OUTPUT), &tmp, 1);
} else {
putc(ch, NC_OUTPUT);
}
return OK;
}

View File

@ -38,7 +38,7 @@
#include <curses.priv.h>
#include <term.h> /* cur_term */
MODULE_ID("$Id: lib_ttyflags.c,v 1.2 1999/07/24 22:36:12 tom Exp $")
MODULE_ID("$Id: lib_ttyflags.c,v 1.3 1999/10/22 21:38:55 tom Exp $")
#undef tabs
@ -133,7 +133,7 @@ int reset_shell_mode(void)
if (SP)
{
_nc_keypad(FALSE);
fflush(SP->_ofp);
_nc_flush();
NC_BUFFERED(FALSE);
}
returnCode(_nc_set_tty_mode(&cur_term->Ottyb));

View File

@ -37,7 +37,7 @@
*/
#include <curses.priv.h>
MODULE_ID("$Id: make_keys.c,v 1.6 1999/02/22 16:55:20 tom Exp $")
MODULE_ID("$Id: make_keys.c,v 1.7 1999/09/11 17:32:57 Jeffrey.Honig Exp $")
#include <names.c>
@ -103,6 +103,9 @@ int main(int argc, char *argv[])
"",
"/* This file was generated by MAKE_KEYS */",
"",
"#ifdef BROKEN_LINKER",
"static",
"#endif",
"struct tinfo_fkeys _nc_tinfo_fkeys[] = {",
0
};

View File

@ -153,7 +153,7 @@
#include <term.h>
#include <ctype.h>
MODULE_ID("$Id: lib_mvcur.c,v 1.57 1999/06/26 22:16:04 tom Exp $")
MODULE_ID("$Id: lib_mvcur.c,v 1.60 1999/10/03 01:08:27 Alexander.V.Lukyanov Exp $")
#define STRLEN(s) (s != 0) ? strlen(s) : 0
@ -246,10 +246,10 @@ int _nc_msec_cost(const char *const cap, int affcnt)
{
if (isdigit(*cp))
number = number * 10 + (*cp - '0');
else if (*cp == '.')
number += (*++cp - 10) / 10.0;
else if (*cp == '*')
number *= affcnt;
else if (*cp == '.' && (*++cp != '>') && isdigit(*cp))
number += (*cp - '0') / 10.0;
}
cum_cost += number * 10;
@ -734,6 +734,7 @@ onscreen_mvcur(int yold,int xold,int ynew,int xnew, bool ovw)
{
char use[OPT_SIZE], *sp;
int tactic = 0, newcost, usecost = INFINITY;
int t5_cr_cost;
#if defined(MAIN) || defined(NCURSES_TEST)
struct timeval before, after;
@ -817,13 +818,14 @@ onscreen_mvcur(int yold,int xold,int ynew,int xnew, bool ovw)
* tactic #5: use left margin for wrap to right-hand side,
* unless strange wrap behavior indicated by xenl might hose us.
*/
t5_cr_cost = (xold>0 ? SP->_cr_cost : 0);
if (auto_left_margin && !eat_newline_glitch
&& yold > 0 && cursor_left
&& ((newcost=relative_move(NULL, yold-1, screen_columns-1, ynew, xnew, ovw)) != INFINITY)
&& SP->_cr_cost + SP->_cub1_cost + newcost + newcost < usecost)
&& t5_cr_cost + SP->_cub1_cost + newcost < usecost)
{
tactic = 5;
usecost = SP->_cr_cost + SP->_cub1_cost + newcost;
usecost = t5_cr_cost + SP->_cub1_cost + newcost;
}
/*

View File

@ -48,7 +48,7 @@
#define _POSIX_SOURCE
#endif
MODULE_ID("$Id: lib_tstp.c,v 1.19 1999/07/24 22:47:20 tom Exp $")
MODULE_ID("$Id: lib_tstp.c,v 1.20 1999/10/22 23:11:09 tom Exp $")
#if defined(SIGTSTP) && (HAVE_SIGACTION || HAVE_SIGVEC)
#define USE_SIGTSTP 1
@ -199,13 +199,16 @@ static void tstp(int dummy GCC_UNUSED)
static void cleanup(int sig)
{
static int nested;
/*
* Actually, doing any sort of I/O from within an signal handler is
* "unsafe". But we'll _try_ to clean up the screen and terminal
* settings on the way out.
*/
if (sig == SIGINT
|| sig == SIGQUIT) {
if (!nested++
&& (sig == SIGINT
|| sig == SIGQUIT)) {
#if HAVE_SIGACTION || HAVE_SIGVEC
sigaction_t act;
sigemptyset(&act.sa_mask);
@ -219,6 +222,11 @@ static void cleanup(int sig)
SCREEN *scan = _nc_screen_chain;
while(scan)
{
if (SP != 0
&& SP->_ofp != 0
&& isatty(fileno(SP->_ofp))) {
SP->_cleanup = TRUE;
}
set_term(scan);
endwin();
if (SP)

View File

@ -40,6 +40,10 @@
** comments, none of the original code remains - T.Dickey).
*/
#ifdef __BEOS__
#include <OS.h>
#endif
#include <curses.priv.h>
#if USE_FUNC_POLL
@ -57,28 +61,32 @@
# endif
#endif
#ifdef __BEOS__
/* BeOS select() only works on sockets. Use the tty hack instead */
#include <socket.h>
#define select check_select
#endif
MODULE_ID("$Id: lib_twait.c,v 1.34 1999/10/16 21:25:10 tom Exp $")
MODULE_ID("$Id: lib_twait.c,v 1.32 1998/06/06 22:44:14 tom Exp $")
static int _nc_gettime(void)
static long _nc_gettime(bool first)
{
int res;
long res;
#if HAVE_GETTIMEOFDAY
# define PRECISE_GETTIME 1
struct timeval t;
gettimeofday(&t, (struct timezone *)0);
res = t.tv_sec*1000 + t.tv_usec/1000;
static struct timeval t0;
struct timeval t1;
gettimeofday(&t1, (struct timezone *)0);
if (first) {
t0 = t1;
}
res = (t1.tv_sec - t0.tv_sec) * 1000
+ (t1.tv_usec - t0.tv_usec) / 1000;
#else
# define PRECISE_GETTIME 0
res = time(0)*1000;
static time_t t0;
time_t t1 = time((time_t*)0);
if (first) {
t0 = t1;
}
res = (t1 - t0) * 1000;
#endif
T(("time: %d msec", res));
T(("%s time: %ld msec", first ? "get" : "elapsed", res));
return res;
}
@ -104,18 +112,19 @@ int result;
#if USE_FUNC_POLL
struct pollfd fds[2];
#elif defined(__BEOS__)
#elif HAVE_SELECT
static fd_set set;
#endif
int starttime, returntime;
long starttime, returntime;
T(("start twait: %d milliseconds, mode: %d", milliseconds, mode));
#if PRECISE_GETTIME
retry:
#endif
starttime = _nc_gettime();
starttime = _nc_gettime(TRUE);
count = 0;
@ -133,6 +142,40 @@ int starttime, returntime;
}
result = poll(fds, count, milliseconds);
#elif defined(__BEOS__)
/*
* BeOS's select() is declared in socket.h, so the configure script does
* not see it. That's just as well, since that function works only for
* sockets. This (using snooze and ioctl) was distilled from Be's patch
* for ncurses which uses a separate thread to simulate select().
*
* FIXME: the return values from the ioctl aren't very clear if we get
* interrupted.
*/
result = 0;
if (mode & 1) {
bigtime_t d;
bigtime_t useconds = milliseconds * 1000;
int n, howmany;
if (useconds == 0) /* we're here to go _through_ the loop */
useconds = 1;
for (d = 0; d < useconds; d += 5000) {
n = 0;
howmany = ioctl(0, 'ichr', &n);
if (howmany >= 0 && n > 0) {
result = 1;
break;
}
if (useconds > 1)
snooze(5000);
milliseconds -= 5;
}
} else if (milliseconds > 0) {
snooze(milliseconds * 1000);
milliseconds = 0;
}
#elif HAVE_SELECT
/*
* select() modifies the fd_set arguments; do this in the
@ -160,10 +203,10 @@ int starttime, returntime;
}
#endif
returntime = _nc_gettime();
returntime = _nc_gettime(FALSE);
if (milliseconds >= 0)
milliseconds -= returntime-starttime;
milliseconds -= (returntime - starttime);
#if PRECISE_GETTIME
/*
@ -203,6 +246,8 @@ int starttime, returntime;
count++;
}
}
#elif defined(__BEOS__)
result = 1; /* redundant, but simple */
#elif HAVE_SELECT
if ((mode & 2)
&& (fd = SP->_mouse_fd) >= 0

View File

@ -42,6 +42,10 @@
*
*-----------------------------------------------------------------*/
#ifdef __BEOS__
#include <OS.h>
#endif
#include <curses.priv.h>
#if defined(TRACE) && HAVE_SYS_TIMES_H && HAVE_TIMES
@ -67,15 +71,9 @@
#endif
#endif
#ifdef __BEOS__
/* BeOS select() only works on sockets. Use the tty hack instead */
#include <socket.h>
#define select check_select
#endif
#include <term.h>
MODULE_ID("$Id: tty_update.c,v 1.111 1999/02/27 20:07:56 tom Exp $")
MODULE_ID("$Id: tty_update.c,v 1.117 1999/10/22 23:28:46 tom Exp $")
/*
* This define controls the line-breakout optimization. Every once in a
@ -97,10 +95,10 @@ MODULE_ID("$Id: tty_update.c,v 1.111 1999/02/27 20:07:56 tom Exp $")
static inline chtype ClrBlank ( WINDOW *win );
static int ClrBottom(int total);
static int InsStr( chtype *line, int count );
static void ClearScreen( chtype blank );
static void ClrUpdate( void );
static void DelChar( int count );
static void InsStr( chtype *line, int count );
static void TransformLine( int const lineno );
#ifdef POSITION_DEBUG
@ -110,29 +108,40 @@ static void TransformLine( int const lineno );
*
****************************************************************************/
void position_check(int expected_y, int expected_x, char *legend)
static void position_check(int expected_y, int expected_x, char *legend)
/* check to see if the real cursor position matches the virtual */
{
static char buf[9];
char buf[20];
int y, x;
if (_nc_tracing)
if (!_nc_tracing || (expected_y < 0 && expected_x < 0))
return;
memset(buf, '\0', sizeof(buf));
(void) write(1, "\033[6n", 4); /* only works on ANSI-compatibles */
(void) read(0, (void *)buf, 8);
putp("\033[6n"); /* only works on ANSI-compatibles */
_nc_flush();
(void) read(0, buf, sizeof(buf)-1);
_tracef("probe returned %s", _nc_visbuf(buf));
/* try to interpret as a position report */
if (sscanf(buf, "\033[%d;%dR", &y, &x) != 2)
if (sscanf(buf, "\033[%d;%dR", &y, &x) != 2) {
_tracef("position probe failed in %s", legend);
else if (y - 1 != expected_y || x - 1 != expected_x)
_tracef("position seen (%d, %d) doesn't match expected one (%d, %d) in %s",
y-1, x-1, expected_y, expected_x, legend);
else
_tracef("position matches OK in %s", legend);
} else {
if (expected_x < 0)
expected_x = x - 1;
if (expected_y < 0)
expected_y = y - 1;
if (y - 1 != expected_y || x - 1 != expected_x) {
beep();
_tracef("position seen (%d, %d) doesn't match expected one (%d, %d) in %s",
y-1, x-1, expected_y, expected_x, legend);
} else {
_tracef("position matches OK in %s", legend);
}
}
}
#else
#define position_check(expected_y, expected_x, legend) /* nothing */
#endif /* POSITION_DEBUG */
/****************************************************************************
@ -148,9 +157,7 @@ static inline void GoTo(int const row, int const col)
TR(TRACE_MOVE, ("GoTo(%d, %d) from (%d, %d)",
row, col, SP->_cursrow, SP->_curscol));
#ifdef POSITION_DEBUG
position_check(SP->_cursrow, SP->_curscol, "GoTo");
#endif /* POSITION_DEBUG */
/*
* Force restore even if msgr is on when we're in an alternate
@ -168,6 +175,7 @@ static inline void GoTo(int const row, int const col)
mvcur(SP->_cursrow, SP->_curscol, row, col);
SP->_cursrow = row;
SP->_curscol = col;
position_check(SP->_cursrow, SP->_curscol, "GoTo2");
}
static inline void PutAttrChar(chtype ch)
@ -179,10 +187,14 @@ static inline void PutAttrChar(chtype ch)
_tracechtype(ch),
SP->_cursrow, SP->_curscol));
UpdateAttrs(ch);
putc((int)TextOf(ch), SP->_ofp);
if (SP->_cleanup) {
_nc_outch((int)TextOf(ch));
} else {
putc((int)TextOf(ch), SP->_ofp); /* macro's fastest... */
#ifdef TRACE
_nc_outchars++;
_nc_outchars++;
#endif /* TRACE */
}
SP->_curscol++;
if (char_padding) {
TPUTS_TRACE("char_padding");
@ -212,6 +224,21 @@ static bool check_pending(void)
{
have_pending = TRUE;
}
#elif defined(__BEOS__)
/*
* BeOS's select() is declared in socket.h, so the configure script does
* not see it. That's just as well, since that function works only for
* sockets. This (using snooze and ioctl) was distilled from Be's patch
* for ncurses which uses a separate thread to simulate select().
*
* FIXME: the return values from the ioctl aren't very clear if we get
* interrupted.
*/
int n = 0;
int howmany = ioctl(0, 'ichr', &n);
if (howmany >= 0 && n > 0) {
have_pending = TRUE;
}
#elif HAVE_SELECT
fd_set fdset;
struct timeval ktimeout;
@ -229,7 +256,7 @@ static bool check_pending(void)
}
if (have_pending) {
SP->_fifohold = 5;
fflush(SP->_ofp);
_nc_flush();
}
return FALSE;
}
@ -261,6 +288,8 @@ static void PutCharLR(chtype const ch)
putp(exit_am_mode);
PutAttrChar(ch);
SP->_curscol--;
position_check(SP->_cursrow, SP->_curscol, "exit_am_mode");
TPUTS_TRACE("enter_am_mode");
putp(enter_am_mode);
@ -307,6 +336,7 @@ static void wrap_cursor(void)
{
SP->_curscol--;
}
position_check(SP->_cursrow, SP->_curscol, "wrap_cursor");
}
static inline void PutChar(chtype const ch)
@ -320,9 +350,7 @@ static inline void PutChar(chtype const ch)
if (SP->_curscol >= screen_columns)
wrap_cursor();
#ifdef POSITION_DEBUG
position_check(SP->_cursrow, SP->_curscol, "PutChar");
#endif /* POSITION_DEBUG */
}
/*
@ -753,7 +781,7 @@ struct tms before, after;
*/
UpdateAttrs(A_NORMAL);
fflush(SP->_ofp);
_nc_flush();
curscr->_attrs = newscr->_attrs;
/* curscr->_bkgd = newscr->_bkgd; */
@ -901,13 +929,14 @@ chtype blank = newscr->_line[total-1].text[last-1]; /* lower right char */
if ((tstLine == 0) || (last > (int)lenLine)) {
tstLine = typeRealloc(chtype, last, tstLine);
if (tstLine != 0) {
lenLine = last;
for (col = 0; col < last; col++)
tstLine[col] = blank;
}
}
if (tstLine != 0) {
lenLine = last;
for (col = 0; col < last; col++)
tstLine[col] = blank;
for (row = total-1; row >= 0; row--) {
if (memcmp(tstLine, newscr->_line[row].text, length))
break;
@ -1212,9 +1241,7 @@ static void ClearScreen(chtype blank)
TPUTS_TRACE("clear_screen");
putp(clear_screen);
SP->_cursrow = SP->_curscol = 0;
#ifdef POSITION_DEBUG
position_check(SP->_cursrow, SP->_curscol, "ClearScreen");
#endif /* POSITION_DEBUG */
} else if (clr_eos) {
SP->_cursrow = SP->_curscol = -1;
GoTo(0,0);
@ -1252,7 +1279,7 @@ static void ClearScreen(chtype blank)
**
*/
static int InsStr(chtype *line, int count)
static void InsStr(chtype *line, int count)
{
T(("InsStr(%p,%d) called", line, count));
@ -1267,7 +1294,6 @@ static int InsStr(chtype *line, int count)
line++;
count--;
}
return(OK);
} else if (enter_insert_mode && exit_insert_mode) {
TPUTS_TRACE("enter_insert_mode");
putp(enter_insert_mode);
@ -1283,7 +1309,6 @@ static int InsStr(chtype *line, int count)
}
TPUTS_TRACE("exit_insert_mode");
putp(exit_insert_mode);
return(OK);
} else {
while (count) {
TPUTS_TRACE("insert_character");
@ -1297,8 +1322,8 @@ static int InsStr(chtype *line, int count)
line++;
count--;
}
return(OK);
}
position_check(SP->_cursrow, SP->_curscol, "InsStr");
}
/*
@ -1332,14 +1357,8 @@ static void DelChar(int count)
void _nc_outstr(const char *str)
{
FILE *ofp = SP ? SP->_ofp : stdout;
(void) fputs(str, ofp);
(void) fflush(ofp);
#ifdef TRACE
_nc_outchars += strlen(str);
#endif /* TRACE */
(void) putp(str);
_nc_flush();
}
/*

View File

@ -35,7 +35,7 @@
*/
#include "panel.priv.h"
MODULE_ID("$Id: p_above.c,v 1.2 1998/02/11 12:14:01 tom Exp $")
MODULE_ID("$Id: p_above.c,v 1.3 1999/09/18 11:03:28 juergen Exp $")
PANEL*
panel_above(const PANEL *pan)
@ -44,7 +44,7 @@ panel_above(const PANEL *pan)
{
/* if top and bottom are equal, we have no or only the pseudo panel;
if not, we return the panel above the pseudo panel */
return(_nc_bottom_panel==_nc_top_panel ? (PANEL*)0 : _nc_bottom_panel->above);
return(EMPTY_STACK() ? (PANEL*)0 : _nc_bottom_panel->above);
}
else
return(pan->above);

View File

@ -35,7 +35,7 @@
*/
#include "panel.priv.h"
MODULE_ID("$Id: p_below.c,v 1.2 1998/02/11 12:14:01 tom Exp $")
MODULE_ID("$Id: p_below.c,v 1.3 1999/09/18 11:03:33 juergen Exp $")
PANEL*
panel_below(const PANEL *pan)
@ -43,11 +43,11 @@ panel_below(const PANEL *pan)
if(!pan)
{
/* if top and bottom are equal, we have no or only the pseudo panel */
return(_nc_top_panel==_nc_bottom_panel ? (PANEL*)0 : _nc_top_panel);
return(EMPTY_STACK() ? (PANEL*)0 : _nc_top_panel);
}
else
{
/* we must not return the pseudo panel */
return(pan->below==_nc_bottom_panel ? (PANEL*) 0 : pan->below);
return(Is_Pseudo(pan->below) ? (PANEL*) 0 : pan->below);
}
}

View File

@ -36,18 +36,44 @@
*/
#include "panel.priv.h"
MODULE_ID("$Id: p_bottom.c,v 1.2 1998/02/11 12:14:01 tom Exp $")
MODULE_ID("$Id: p_bottom.c,v 1.5 1999/09/29 15:22:32 juergen Exp $")
/*+-------------------------------------------------------------------------
__panel_link_bottom(pan) - link panel into stack at bottom
--------------------------------------------------------------------------*/
static void
panel_link_bottom(PANEL *pan)
{
#ifdef TRACE
dStack("<lb%d>",1,pan);
if(_nc_panel_is_linked(pan))
return;
#endif
pan->above = (PANEL *)0;
pan->below = (PANEL *)0;
assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel);
pan->below = _nc_bottom_panel;
pan->above = _nc_bottom_panel->above;
if (pan->above)
pan->above->below = pan;
_nc_bottom_panel->above = pan;
dStack("<lb%d>",9,pan);
}
int
bottom_panel(PANEL *pan)
{
if(!pan)
return(ERR);
if(pan == _nc_bottom_panel)
if(Is_Bottom(pan))
return(OK);
dBug(("--> bottom_panel %s", USER_PTR(pan->user)));
if(_nc_panel_is_linked(pan))
(void)hide_panel(pan);
_nc_panel_link_bottom(pan);
panel_link_bottom(pan);
return(OK);
}

View File

@ -36,12 +36,12 @@
*/
#include "panel.priv.h"
MODULE_ID("$Id: p_hidden.c,v 1.2 1998/02/11 12:14:01 tom Exp $")
MODULE_ID("$Id: p_hidden.c,v 1.3 1999/09/18 11:04:19 juergen Exp $")
int
panel_hidden(const PANEL *pan)
{
if(!pan)
return(ERR);
return(_nc_panel_is_linked(pan) ? TRUE : FALSE);
return(_nc_panel_is_linked(pan) ? FALSE : TRUE);
}

View File

@ -36,7 +36,7 @@
*/
#include "panel.priv.h"
MODULE_ID("$Id: p_hide.c,v 1.2 1998/02/11 12:14:01 tom Exp $")
MODULE_ID("$Id: p_hide.c,v 1.3 1999/09/29 15:22:32 juergen Exp $")
/*+-------------------------------------------------------------------------
__panel_unlink(pan) - unlink panel from stack
@ -53,8 +53,7 @@ __panel_unlink(PANEL *pan)
return;
#endif
_nc_override(pan,P_TOUCH);
_nc_free_obscure(pan);
PANEL_UPDATE(pan,(PANEL*)0);
prev = pan->below;
next = pan->above;
@ -72,8 +71,6 @@ __panel_unlink(PANEL *pan)
if(pan == _nc_top_panel)
_nc_top_panel = prev;
_nc_calculate_obscure();
pan->above = (PANEL *)0;
pan->below = (PANEL *)0;
dStack("<u%d>",9,pan);

View File

@ -36,7 +36,7 @@
*/
#include "panel.priv.h"
MODULE_ID("$Id: p_move.c,v 1.2 1998/02/11 12:14:01 tom Exp $")
MODULE_ID("$Id: p_move.c,v 1.3 1999/09/29 15:22:32 juergen Exp $")
int
move_panel(PANEL *pan, int starty, int startx)
@ -46,14 +46,9 @@ move_panel(PANEL *pan, int starty, int startx)
if(!pan)
return(ERR);
if(_nc_panel_is_linked(pan))
_nc_override(pan,P_TOUCH);
PANEL_UPDATE(pan,(PANEL*)0);
win = pan->win;
if(mvwin(win,starty,startx))
return(ERR);
getbegyx(win, pan->wstarty, pan->wstartx);
pan->wendy = pan->wstarty + getmaxy(win);
pan->wendx = pan->wstartx + getmaxx(win);
if(_nc_panel_is_linked(pan))
_nc_calculate_obscure();
return(OK);
}

View File

@ -36,7 +36,7 @@
*/
#include "panel.priv.h"
MODULE_ID("$Id: p_new.c,v 1.2 1998/02/11 12:14:01 tom Exp $")
MODULE_ID("$Id: p_new.c,v 1.4 1999/09/29 15:22:32 juergen Exp $")
/*+-------------------------------------------------------------------------
Get root (i.e. stdscr's) panel.
@ -54,18 +54,14 @@ root_panel(void)
PANEL* pan = _nc_stdscr_pseudo_panel;
WINDOW* win = stdscr;
pan->win = win;
getbegyx(win, pan->wstarty, pan->wstartx);
pan->wendy = pan->wstarty + getmaxy(win);
pan->wendx = pan->wstartx + getmaxx(win);
pan->below = (PANEL*)0;
pan->above = (PANEL*)0;
pan->obscure = (PANELCONS*)0;
#ifdef TRACE
pan->user = "stdscr";
#else
pan->user = (void*)0;
#endif
_nc_panel_link_bottom(pan);
_nc_bottom_panel = _nc_top_panel = pan;
}
}
return _nc_stdscr_pseudo_panel;
@ -84,15 +80,11 @@ new_panel(WINDOW *win)
pan->win = win;
pan->above = (PANEL *)0;
pan->below = (PANEL *)0;
getbegyx(win, pan->wstarty, pan->wstartx);
pan->wendy = pan->wstarty + getmaxy(win);
pan->wendx = pan->wstartx + getmaxx(win);
#ifdef TRACE
pan->user = "new";
#else
pan->user = (char *)0;
#endif
pan->obscure = (PANELCONS *)0;
(void)show_panel(pan);
}
return(pan);

View File

@ -36,7 +36,7 @@
*/
#include "panel.priv.h"
MODULE_ID("$Id: p_replace.c,v 1.2 1998/02/11 12:14:01 tom Exp $")
MODULE_ID("$Id: p_replace.c,v 1.3 1999/09/29 15:22:32 juergen Exp $")
int
replace_panel(PANEL *pan, WINDOW *win)
@ -44,9 +44,7 @@ replace_panel(PANEL *pan, WINDOW *win)
if(!pan)
return(ERR);
if(_nc_panel_is_linked(pan))
_nc_override(pan,P_TOUCH);
PANEL_UPDATE(pan,(PANEL*)0);
pan->win = win;
if(_nc_panel_is_linked(pan))
_nc_calculate_obscure();
return(OK);
}

View File

@ -36,7 +36,7 @@
*/
#include "panel.priv.h"
MODULE_ID("$Id: p_show.c,v 1.2 1998/02/11 12:14:01 tom Exp $")
MODULE_ID("$Id: p_show.c,v 1.5 1999/09/29 15:22:32 juergen Exp $")
static void
panel_link_top(PANEL *pan)
@ -47,17 +47,15 @@ panel_link_top(PANEL *pan)
return;
#endif
assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel);
pan->above = (PANEL *)0;
pan->below = (PANEL *)0;
if(_nc_top_panel)
{
_nc_top_panel->above = pan;
pan->below = _nc_top_panel;
}
_nc_top_panel->above = pan;
pan->below = _nc_top_panel;
_nc_top_panel = pan;
if(!_nc_bottom_panel)
_nc_bottom_panel = pan;
_nc_calculate_obscure();
dStack("<lt%d>",9,pan);
}
@ -66,11 +64,16 @@ show_panel(PANEL *pan)
{
if(!pan)
return(ERR);
if(pan == _nc_top_panel)
if (Is_Top(pan))
return(OK);
dBug(("--> show_panel %s", USER_PTR(pan->user)));
if(_nc_panel_is_linked(pan))
(void)hide_panel(pan);
panel_link_top(pan);
return(OK);
}

View File

@ -36,7 +36,7 @@
*/
#include "panel.priv.h"
MODULE_ID("$Id: p_update.c,v 1.2 1998/02/11 12:14:01 tom Exp $")
MODULE_ID("$Id: p_update.c,v 1.3 1999/09/29 15:22:32 juergen Exp $")
void
update_panels(void)
@ -45,9 +45,9 @@ update_panels(void)
dBug(("--> update_panels"));
pan = _nc_bottom_panel;
while(pan)
while(pan && pan->above)
{
_nc_override(pan,P_UPDATE);
PANEL_UPDATE(pan,pan->above);
pan = pan->above;
}

View File

@ -34,7 +34,7 @@
/* panel.c -- implementation of panels library, some core routines */
#include "panel.priv.h"
MODULE_ID("$Id: panel.c,v 1.16 1998/09/19 21:26:31 Todd.Miller Exp $")
MODULE_ID("$Id: panel.c,v 1.18 1999/09/29 15:22:32 juergen Exp $")
#ifdef TRACE
#ifndef TRACE_TXT
@ -62,7 +62,7 @@ _nc_dPanel(const char *text, const PANEL *pan)
text, USER_PTR(pan->user),
(pan->below) ? USER_PTR(pan->below->user) : "--",
(pan->above) ? USER_PTR(pan->above->user) : "--",
pan->wstarty, pan->wstartx);
PSTARTY(pan), PSTARTX(pan));
}
#endif
@ -128,181 +128,9 @@ _nc_Touchline(const PANEL *pan, int start, int count)
}
#endif
/*+-------------------------------------------------------------------------
__panels_overlapped(pan1,pan2) - check panel overlapped
--------------------------------------------------------------------------*/
static INLINE bool
__panels_overlapped(register const PANEL *pan1, register const PANEL *pan2)
{
if(!pan1 || !pan2)
return(FALSE);
dBug(("__panels_overlapped %s %s", USER_PTR(pan1->user), USER_PTR(pan2->user)));
/* pan1 intersects with pan2 ? */
if( (((pan1->wstarty >= pan2->wstarty) && (pan1->wstarty < pan2->wendy)) ||
((pan2->wstarty >= pan1->wstarty) && (pan2->wstarty < pan1->wendy))) &&
(((pan1->wstartx >= pan2->wstartx) && (pan1->wstartx < pan2->wendx)) ||
((pan2->wstartx >= pan1->wstartx) && (pan2->wstartx < pan1->wendx)))
) return(TRUE);
else {
dBug((" no"));
return(FALSE);
}
}
/*+-------------------------------------------------------------------------
_nc_free_obscure(pan)
--------------------------------------------------------------------------*/
void
_nc_free_obscure(PANEL *pan)
{
PANELCONS *tobs = pan->obscure; /* "this" one */
PANELCONS *nobs; /* "next" one */
while(tobs)
{
nobs = tobs->above;
free((char *)tobs);
tobs = nobs;
}
pan->obscure = (PANELCONS *)0;
}
/*+-------------------------------------------------------------------------
__override(pan,show)
--------------------------------------------------------------------------*/
void
_nc_override(const PANEL *pan, int show)
{
int y;
PANEL *pan2;
PANELCONS *tobs = pan->obscure; /* "this" one */
dBug(("_nc_override %s,%d", USER_PTR(pan->user),show));
switch (show)
{
case P_TOUCH:
Touchpan(pan);
/* The following while loop will now mark all panel window lines
* obscured by use or obscuring us as touched, so they will be
* updated.
*/
break;
case P_UPDATE:
while(tobs && (tobs->pan != pan))
tobs = tobs->above;
/* The next loop will now only go through the panels obscuring pan;
* it updates all the lines in the obscuring panels in sync. with
* the lines touched in pan itself. This is called in update_panels()
* in a loop from the bottom_panel to the top_panel, resulting in
* the desired update effect.
*/
break;
default:
return;
}
while(tobs)
{
if((pan2 = tobs->pan) != pan) {
dBug(("test obs pan=%s pan2=%s", USER_PTR(pan->user), USER_PTR(pan2->user)));
for(y = pan->wstarty; y < pan->wendy; y++) {
if( (y >= pan2->wstarty) && (y < pan2->wendy) &&
((is_linetouched(pan->win,y - pan->wstarty) == TRUE)) )
Touchline(pan2,y - pan2->wstarty,1);
}
}
tobs = tobs->above;
}
}
/*+-------------------------------------------------------------------------
__calculate_obscure()
--------------------------------------------------------------------------*/
void
_nc_calculate_obscure(void)
{
PANEL *pan;
PANEL *pan2;
PANELCONS *tobs; /* "this" one */
PANELCONS *lobs = (PANELCONS *)0; /* last one */
pan = _nc_bottom_panel;
while(pan)
{
if(pan->obscure)
_nc_free_obscure(pan);
dBug(("--> __calculate_obscure %s", USER_PTR(pan->user)));
lobs = (PANELCONS *)0; /* last one */
pan2 = _nc_bottom_panel;
/* This loop builds a list of panels obsured by pan or obscuring
pan; pan itself is in the list; all panels before pan are
obscured by pan, all panels after pan are obscuring pan. */
while(pan2)
{
if(__panels_overlapped(pan,pan2))
{
if(!(tobs = (PANELCONS *)malloc(sizeof(PANELCONS))))
return;
tobs->pan = pan2;
dPanel("obscured",pan2);
tobs->above = (PANELCONS *)0;
if(lobs)
lobs->above = tobs;
else
pan->obscure = tobs;
lobs = tobs;
}
pan2 = pan2->above;
}
_nc_override(pan,P_TOUCH);
pan = pan->above;
}
}
/*+-------------------------------------------------------------------------
_nc_panel_is_linked(pan) - check to see if panel is in the stack
--------------------------------------------------------------------------*/
bool
_nc_panel_is_linked(const PANEL *pan)
{
/* This works! The only case where it would fail is, when the list has
only one element. But this could only be the pseudo panel at the bottom */
return ( ((pan->above!=(PANEL *)0) ||
(pan->below!=(PANEL *)0) ||
(pan==_nc_bottom_panel)) ? TRUE : FALSE );
}
/*+-------------------------------------------------------------------------
__panel_link_bottom(pan) - link panel into stack at bottom
--------------------------------------------------------------------------*/
void
_nc_panel_link_bottom(PANEL *pan)
{
#ifdef TRACE
dStack("<lb%d>",1,pan);
if(_nc_panel_is_linked(pan))
return;
#ifndef TRACE
# ifndef __GNUC__
/* Some C compilers need something defined in a source file */
static char GCC_UNUSED dummy;
# endif
#endif
pan->above = (PANEL *)0;
pan->below = (PANEL *)0;
if(_nc_bottom_panel)
{ /* the stdscr pseudo panel always stays real bottom;
so we insert after bottom panel*/
pan->below = _nc_bottom_panel;
pan->above = _nc_bottom_panel->above;
if (pan->above)
pan->above->below = pan;
_nc_bottom_panel->above = pan;
}
else
_nc_bottom_panel = pan;
if(!_nc_top_panel)
_nc_top_panel = pan;
assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel);
_nc_calculate_obscure();
dStack("<lb%d>",9,pan);
}

View File

@ -40,37 +40,31 @@
typedef struct panel
{
WINDOW *win;
int wstarty;
int wendy;
int wstartx;
int wendx;
struct panel *below;
struct panel *above;
NCURSES_CONST void *user;
struct panelcons *obscure;
}
PANEL;
WINDOW *win;
struct panel *below;
struct panel *above;
NCURSES_CONST void *user;
} PANEL;
#if defined(__cplusplus)
extern "C" {
#endif
extern WINDOW *panel_window(const PANEL *);
extern void update_panels(void);
extern int hide_panel(PANEL *);
extern int show_panel(PANEL *);
extern int del_panel(PANEL *);
extern int top_panel(PANEL *);
extern int bottom_panel(PANEL *);
extern PANEL *new_panel(WINDOW *);
extern PANEL *panel_above(const PANEL *);
extern PANEL *panel_below(const PANEL *);
extern int set_panel_userptr(PANEL *, NCURSES_CONST void *);
extern WINDOW* panel_window(const PANEL *);
extern void update_panels(void);
extern int hide_panel(PANEL *);
extern int show_panel(PANEL *);
extern int del_panel(PANEL *);
extern int top_panel(PANEL *);
extern int bottom_panel(PANEL *);
extern PANEL* new_panel(WINDOW *);
extern PANEL* panel_above(const PANEL *);
extern PANEL* panel_below(const PANEL *);
extern int set_panel_userptr(PANEL *, NCURSES_CONST void *);
extern NCURSES_CONST void* panel_userptr(const PANEL *);
extern int move_panel(PANEL *, int, int);
extern int replace_panel(PANEL *,WINDOW *);
extern int panel_hidden(const PANEL *);
extern int move_panel(PANEL *, int, int);
extern int replace_panel(PANEL *,WINDOW *);
extern int panel_hidden(const PANEL *);
#if defined(__cplusplus)
}

View File

@ -1,4 +1,4 @@
/* $Id: panel.priv.h,v 1.8 1997/10/21 10:19:37 juergen Exp $ */
/* $Id: panel.priv.h,v 1.10 1999/09/29 15:21:58 juergen Exp $ */
#ifndef _PANEL_PRIV_H
#define _PANEL_PRIV_H
@ -28,20 +28,12 @@
# define INLINE
#endif
typedef struct panelcons
{
struct panelcons *above;
struct panel *pan;
} PANELCONS;
#ifdef USE_RCS_IDS
# define MODULE_ID(id) static const char Ident[] = id;
#else
# define MODULE_ID(id) /*nothing*/
#endif
#define P_TOUCH (0)
#define P_UPDATE (1)
#ifdef TRACE
extern const char *_nc_my_visbuf(const void *);
@ -76,10 +68,47 @@ typedef struct panelcons
#define _nc_top_panel _nc_panelhook()->top_panel
#define _nc_bottom_panel _nc_panelhook()->bottom_panel
extern void _nc_panel_link_bottom(PANEL*);
extern bool _nc_panel_is_linked(const PANEL*);
extern void _nc_calculate_obscure(void);
extern void _nc_free_obscure(PANEL*);
extern void _nc_override(const PANEL*,int);
#define EMPTY_STACK() (_nc_top_panel==_nc_bottom_panel)
#define Is_Bottom(p) (((p)!=(PANEL*)0) && !EMPTY_STACK() && (_nc_bottom_panel->above==(p)))
#define Is_Top(p) (((p)!=(PANEL*)0) && !EMPTY_STACK() && (_nc_top_panel==(p)))
#define Is_Pseudo(p) ((p) && ((p)==_nc_bottom_panel))
/*+-------------------------------------------------------------------------
_nc_panel_is_linked(pan) - check to see if panel is in the stack
--------------------------------------------------------------------------*/
/* This works! The only case where it would fail is, when the list has
only one element. But this could only be the pseudo panel at the bottom */
#define _nc_panel_is_linked(p) ((((p)->above!=(PANEL*)0)||((p)->below!=(PANEL*)0)||((p)==_nc_bottom_panel)) ? TRUE : FALSE)
#define PSTARTX(pan) ((pan)->win->_begx)
#define PENDX(pan) ((pan)->win->_begx + getmaxx((pan)->win))
#define PSTARTY(pan) ((pan)->win->_begy)
#define PENDY(pan) ((pan)->win->_begy + getmaxy((pan)->win))
/*+-------------------------------------------------------------------------
PANELS_OVERLAPPED(pan1,pan2) - check panel overlapped
---------------------------------------------------------------------------*/
#define PANELS_OVERLAPPED(pan1,pan2) \
(( !(pan1) || !(pan2) || \
PSTARTY(pan1) >= PENDY(pan2) || PENDY(pan1) <= PSTARTY(pan2) ||\
PSTARTX(pan1) >= PENDX(pan2) || PENDX(pan1) <= PSTARTX(pan2) ) \
? FALSE : TRUE)
#define PANEL_UPDATE(pan,panstart) { int y; PANEL* pan2 = panstart;\
if (!pan2) {\
Touchpan(pan);\
pan2 = _nc_bottom_panel;\
}\
while(pan2) {\
if ((pan2 != pan) && PANELS_OVERLAPPED(pan,pan2)) {\
for(y = PSTARTY(pan); y < PENDY(pan); y++) {\
if( (y >= PSTARTY(pan2)) && (y < PENDY(pan2)) &&\
((is_linetouched(pan->win,y - PSTARTY(pan)) == TRUE)) )\
Touchline(pan2,y - PSTARTY(pan2),1);\
}\
}\
pan2 = pan2->above;\
}\
}
#endif /* _PANEL_PRIV_H */

View File

@ -42,7 +42,7 @@
#include <dump_entry.h>
#include <term_entry.h>
MODULE_ID("$Id: tic.c,v 1.51 1999/06/19 21:35:36 Philippe.De.Muyter Exp $")
MODULE_ID("$Id: tic.c,v 1.52 1999/09/25 22:47:54 tom Exp $")
const char *_nc_progname = "tic";
@ -661,7 +661,7 @@ bool check_only = FALSE;
len = dump_entry(&qp->tterm, limited, numbers, NULL);
for (j = 0; j < qp->nuses; j++)
len += dump_uses((char *)(qp->uses[j].parent), infodump);
len += dump_uses((char *)(qp->uses[j].parent), !capdump);
(void) putchar('\n');
if (debug_level != 0 && !limited)
printf("# length=%d\n", len);

View File

@ -1,4 +1,4 @@
# $Id: Makefile.in,v 1.7 1998/03/28 21:41:21 tom Exp $
# $Id: Makefile.in,v 1.9 1999/09/18 23:33:48 tom Exp $
# Makefile for tack
#
# The variable 'srcdir' refers to the source-distribution, and can be set with
@ -15,6 +15,7 @@ THIS = Makefile
CF_MFLAGS = @cf_cv_makeflags@
@SET_MAKE@
x = @PROG_EXT@
MODEL = ../@DFT_OBJ_SUBDIR@
INSTALL_PREFIX = @INSTALL_PREFIX@
@ -65,26 +66,28 @@ LINT = @LINT@
LINT_OPTS = @LINT_OPTS@
LINT_LIBS = -lncurses @LIBS@
PROGS = tack
PROGS = tack$x
# Default library, for linking applications
DEPS_CURSES = ../lib/libncurses@DFT_DEP_SUFFIX@
################################################################################
all: $(PROGS)
all: $(PROGS)
install: install.tack
uninstall: uninstall.tack
sources:
install: install.tack
uninstall: uninstall.tack
# this line simplifies the configure-script
install.libs:
uninstall.libs:
install.tack: $(PROGS) $(INSTALL_PREFIX)$(bindir)
$(INSTALL_PROGRAM) tack $(INSTALL_PREFIX)$(bindir)/tack
$(INSTALL_PROGRAM) tack$x $(INSTALL_PREFIX)$(bindir)/tack$x
uninstall.tack:
-@rm -f $(INSTALL_PREFIX)$(bindir)/tack
-@rm -f $(INSTALL_PREFIX)$(bindir)/tack$x
$(INSTALL_PREFIX)$(bindir) :
$(srcdir)/../mkinstalldirs $@
@ -111,7 +114,7 @@ DEPS_TACK = \
$(MODEL)/sysdep.o \
$(MODEL)/tack.o
tack: $(DEPS_TACK) $(DEPS_CURSES)
tack$x: $(DEPS_TACK) $(DEPS_CURSES)
@ECHO_LINK@ $(LINK) $(DEPS_TACK) $(LDFLAGS_DEFAULT) -o $@
#

View File

@ -24,6 +24,10 @@
* global has no effect.
*/
#if defined(__BEOS__)
#include <OS.h>
#endif
#include <tack.h>
#include <signal.h>
@ -39,7 +43,7 @@
#endif
#endif
MODULE_ID("$Id: sysdep.c,v 1.5 1999/08/21 21:42:25 tom Exp $")
MODULE_ID("$Id: sysdep.c,v 1.6 1999/09/04 13:45:00 tom Exp $")
#if DECL_ERRNO
extern int errno;
@ -174,13 +178,13 @@ tty_reset(void)
void
tty_init(void)
{ /* ATT terminal init */
#ifdef F_GETFL
#if defined(F_GETFL) && defined(O_NDELAY)
int flags;
flags = fcntl(fileno(stdin), F_GETFL, 0);
nodelay_read = flags & O_NDELAY;
#else
nodelay_read = FALSE;
nodelay_read = FALSE;
#endif
not_a_tty = FALSE;
if (tcgetattr(fileno(stdin), &old_modes) == -1) {
@ -302,10 +306,20 @@ char_ready(void)
return i;
}
#else
#if defined(__BEOS__)
int
char_ready(void)
{
int n = 0;
int howmany = ioctl(0, 'ichr', &n);
return (howmany >= 0 && n > 0);
}
#else
#define char_ready() 1
#endif
#endif
#endif
/*
** spin_flush()

View File

@ -1,6 +1,6 @@
# $Id: Makefile.in,v 1.51 1999/04/10 21:31:59 tom Exp $
# $Id: Makefile.in,v 1.54 1999/10/23 20:01:19 tom Exp $
##############################################################################
# Copyright (c) 1998 Free Software Foundation, Inc. #
# Copyright (c) 1998,1999 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
@ -55,7 +55,7 @@ CCFLAGS = $(CPPFLAGS) $(CFLAGS)
CFLAGS_NORMAL = $(CCFLAGS)
CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE
CFLAGS_PROFILE = $(CCFLAGS) -pg
CFLAGS_SHARED = $(CCFLAGS) # @CC_SHARED_OPTS@
CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@
CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@)
@ -85,6 +85,7 @@ TESTS = \
bs$x \
cardfile$x \
ditto$x \
dots$x \
filter$x \
firework$x \
firstlast$x \
@ -121,6 +122,9 @@ cardfile$x: $(MODEL)/cardfile.o $(LOCAL_LIBS)
ditto$x: $(MODEL)/ditto.o $(LOCAL_LIBS)
@ECHO_LINK@ $(LINK) -o $@ $(MODEL)/ditto.o $(LDFLAGS_DEFAULT)
dots$x: $(MODEL)/dots.o $(LOCAL_LIBS)
@ECHO_LINK@ $(LINK) -o $@ $(MODEL)/dots.o $(LDFLAGS_DEFAULT)
filter$x: $(MODEL)/filter.o $(LOCAL_LIBS)
@ECHO_LINK@ $(LINK) -o $@ $(MODEL)/filter.o $(LDFLAGS_DEFAULT)

1949
contrib/ncurses/test/configure vendored Executable file

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
dnl***************************************************************************
dnl Copyright (c) 1998 Free Software Foundation, Inc. *
dnl Copyright (c) 1998,1999 Free Software Foundation, Inc. *
dnl *
dnl Permission is hereby granted, free of charge, to any person obtaining a *
dnl copy of this software and associated documentation files (the *
@ -28,7 +28,7 @@ dnl***************************************************************************
dnl
dnl Author: Thomas E. Dickey <dickey@clark.net> 1996,1997,1998
dnl
dnl $Id: configure.in,v 1.24 1998/05/16 20:48:14 tom Exp $
dnl $Id: configure.in,v 1.27 1999/10/23 20:01:42 tom Exp $
dnl This is a simple configuration-script for the ncurses test programs that
dnl allows the test-directory to be separately configured against a reference
dnl system (i.e., sysvr4 curses)
@ -53,8 +53,9 @@ DFT_UPR_MODEL="NORMAL" AC_SUBST(DFT_UPR_MODEL)
ECHO_LINK='@ echo linking $@ ... ;' AC_SUBST(ECHO_LINK)
EXTRA_LIBS="" AC_SUBST(EXTRA_LIBS)
LD="ld" AC_SUBST(LD)
LD_MODEL="" AC_SUBST(LD_MODEL)
LDFLAGS_SHARED="" AC_SUBST(LDFLAGS_SHARED)
LD_MODEL="" AC_SUBST(LD_MODEL)
LD_SHARED_OPTS="" AC_SUBST(LD_SHARED_OPTS)
LIB_NAME=curses AC_SUBST(LIB_NAME)
LIB_PREFIX="-l" AC_SUBST(LIB_PREFIX)
LINK_TESTS="" AC_SUBST(LINK_TESTS)
@ -128,6 +129,7 @@ unistd.h \
)
AC_CHECK_FUNCS( \
curses_version \
gettimeofday \
napms \
resizeterm \

143
contrib/ncurses/test/dots.c Normal file
View File

@ -0,0 +1,143 @@
/****************************************************************************
* Copyright (c) 1999 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* "Software"), to deal in the Software without restriction, including *
* without limitation the rights to use, copy, modify, merge, publish, *
* distribute, distribute with modifications, sublicense, and/or sell *
* copies of the Software, and to permit persons to whom the Software is *
* furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included *
* in all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
* *
* Except as contained in this notice, the name(s) of the above copyright *
* holders shall not be used in advertising or otherwise to promote the *
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************/
/*
* Author: Thomas E. Dickey <dickey@clark.net> 1999
*
* $Id: dots.c,v 1.2 1999/10/23 13:24:32 tom Exp $
*
* A simple demo of the terminfo interface.
*/
#include <test.priv.h>
#include <term.h> /* for tparm() */
#include <time.h>
#include <signal.h>
#define valid(s) ((s != 0) && s != (char *)-1)
static bool interrupted = FALSE;
static int
outc(int c)
{
if (interrupted) {
char tmp = c;
write(STDOUT_FILENO, &tmp, 1);
} else {
putc(c, stdout);
}
return 0;
}
static bool
outs(char *s)
{
if (valid(s)) {
tputs(s, 1, outc);
return TRUE;
}
return FALSE;
}
static void
cleanup(void)
{
outs(exit_attribute_mode);
if (!outs(orig_colors))
outs(orig_pair);
outs(clear_screen);
outs(cursor_normal);
}
static void
onsig(int n GCC_UNUSED)
{
interrupted = TRUE;
cleanup();
exit(EXIT_FAILURE);
}
static float
ranf(void)
{
long r = (rand() & 077777);
return ((float) r / 32768.);
}
int
main(
int argc GCC_UNUSED,
char *argv[]GCC_UNUSED)
{
int x, y, z, j, p;
float r;
float c;
for (j = SIGHUP; j <= SIGTERM; j++)
if (signal(j, SIG_IGN) != SIG_IGN)
signal(j, onsig);
srand(time(0));
setupterm((char *) 0, 1, (int *) 0);
outs(clear_screen);
outs(cursor_invisible);
if (max_colors > 1) {
if (!valid(set_a_foreground)
|| !valid(set_a_background)
|| (!valid(orig_colors) && !valid(orig_pair)))
max_colors = -1;
}
r = (float) (lines - 4);
c = (float) (columns - 4);
for (;;) {
x = (int) (c * ranf()) + 2;
y = (int) (r * ranf()) + 2;
p = (ranf() > 0.9) ? '*' : ' ';
tputs(tparm(cursor_address, y, x), 1, outc);
if (max_colors > 0) {
z = ranf() * max_colors;
if (ranf() > 0.01) {
tputs(tparm(set_a_foreground, z), 1, outc);
} else {
tputs(tparm(set_a_background, z), 1, outc);
}
} else if (valid(exit_attribute_mode)
&& valid(enter_reverse_mode)) {
if (ranf() <= 0.01)
outs((ranf() > 0.6) ? enter_reverse_mode :
exit_attribute_mode);
}
outc(p);
fflush(stdout);
}
}

View File

@ -1,154 +1,174 @@
/*
* $Id: firework.c,v 1.11 1997/11/01 19:36:25 tom Exp $
* $Id: firework.c,v 1.15 1999/10/16 21:33:39 tom Exp $
*/
#include <test.priv.h>
#include <term.h> /* for tparm() */
#include <signal.h>
#include <ctype.h>
#include <time.h>
static int get_colour(chtype *);
static void explode(int row, int col);
static void showit(void);
static RETSIGTYPE onsig(int sig);
static int my_bg = COLOR_BLACK;
int main(
int argc GCC_UNUSED,
char *argv[] GCC_UNUSED)
static void
cleanup(void)
{
int j;
int start,end,row,diff,flag = 0,direction;
unsigned seed;
for (j=SIGHUP;j<=SIGTERM;j++)
if (signal(j,SIG_IGN)!=SIG_IGN)
signal(j,onsig);
initscr();
if (has_colors()) {
start_color();
#ifdef NCURSES_VERSION
if (use_default_colors() == OK)
my_bg = -1;
#endif
}
curs_set(0);
seed = time((time_t *)0);
srand(seed);
cbreak();
for (;;) {
do {
start = rand() % (COLS -3);
end = rand() % (COLS - 3);
start = (start < 2) ? 2 : start;
end = (end < 2) ? 2 : end;
direction = (start > end) ? -1 : 1;
diff = abs(start-end);
} while (diff<2 || diff>=LINES-2);
attrset(A_NORMAL);
for (row=0;row<diff;row++) {
mvprintw(LINES - row,start + (row * direction),
(direction < 0) ? "\\" : "/");
if (flag++) {
showit();
erase();
flag = 0;
}
}
if (flag++) {
showit();
flag = 0;
}
seed = time((time_t *)0);
srand(seed);
explode(LINES-row,start+(diff*direction));
erase();
showit();
}
curs_set(1);
endwin();
}
static RETSIGTYPE
onsig(int n GCC_UNUSED)
{
curs_set(1);
endwin();
cleanup();
exit(EXIT_FAILURE);
}
static
void explode(int row, int col)
{
chtype bold;
erase();
mvprintw(row,col,"-");
showit();
init_pair(1,get_colour(&bold),my_bg);
attrset(COLOR_PAIR(1) | bold);
mvprintw(row-1,col-1," - ");
mvprintw(row,col-1,"-+-");
mvprintw(row+1,col-1," - ");
showit();
init_pair(1,get_colour(&bold),my_bg);
attrset(COLOR_PAIR(1) | bold);
mvprintw(row-2,col-2," --- ");
mvprintw(row-1,col-2,"-+++-");
mvprintw(row, col-2,"-+#+-");
mvprintw(row+1,col-2,"-+++-");
mvprintw(row+2,col-2," --- ");
showit();
init_pair(1,get_colour(&bold),my_bg);
attrset(COLOR_PAIR(1) | bold);
mvprintw(row-2,col-2," +++ ");
mvprintw(row-1,col-2,"++#++");
mvprintw(row, col-2,"+# #+");
mvprintw(row+1,col-2,"++#++");
mvprintw(row+2,col-2," +++ ");
showit();
init_pair(1,get_colour(&bold),my_bg);
attrset(COLOR_PAIR(1) | bold);
mvprintw(row-2,col-2," # ");
mvprintw(row-1,col-2,"## ##");
mvprintw(row, col-2,"# #");
mvprintw(row+1,col-2,"## ##");
mvprintw(row+2,col-2," # ");
showit();
init_pair(1,get_colour(&bold),my_bg);
attrset(COLOR_PAIR(1) | bold);
mvprintw(row-2,col-2," # # ");
mvprintw(row-1,col-2,"# #");
mvprintw(row, col-2," ");
mvprintw(row+1,col-2,"# #");
mvprintw(row+2,col-2," # # ");
showit();
}
static
int get_colour(chtype *bold)
{
int attr;
attr = (rand() % 16) + 1;
*bold = A_NORMAL;
if (attr > 8) {
*bold = A_BOLD;
attr &= 7;
}
return(attr);
}
static void
showit(void)
{
refresh();
napms(120);
int ch;
napms(120);
if ((ch = getch()) != ERR) {
#ifdef KEY_RESIZE
if (ch == KEY_RESIZE) {
erase();
} else
#endif
if (ch == 'q') {
cleanup();
exit(EXIT_SUCCESS);
} else if (ch == 's') {
nodelay(stdscr, FALSE);
} else if (ch == ' ') {
nodelay(stdscr, TRUE);
}
}
}
static
int
get_colour(chtype * bold)
{
int attr;
attr = (rand() % 16) + 1;
*bold = A_NORMAL;
if (attr > 8) {
*bold = A_BOLD;
attr &= 7;
}
return (attr);
}
static
void
explode(int row, int col)
{
chtype bold;
erase();
mvprintw(row, col, "-");
showit();
init_pair(1, get_colour(&bold), my_bg);
attrset(COLOR_PAIR(1) | bold);
mvprintw(row - 1, col - 1, " - ");
mvprintw(row + 0, col - 1, "-+-");
mvprintw(row + 1, col - 1, " - ");
showit();
init_pair(1, get_colour(&bold), my_bg);
attrset(COLOR_PAIR(1) | bold);
mvprintw(row - 2, col - 2, " --- ");
mvprintw(row - 1, col - 2, "-+++-");
mvprintw(row + 0, col - 2, "-+#+-");
mvprintw(row + 1, col - 2, "-+++-");
mvprintw(row + 2, col - 2, " --- ");
showit();
init_pair(1, get_colour(&bold), my_bg);
attrset(COLOR_PAIR(1) | bold);
mvprintw(row - 2, col - 2, " +++ ");
mvprintw(row - 1, col - 2, "++#++");
mvprintw(row + 0, col - 2, "+# #+");
mvprintw(row + 1, col - 2, "++#++");
mvprintw(row + 2, col - 2, " +++ ");
showit();
init_pair(1, get_colour(&bold), my_bg);
attrset(COLOR_PAIR(1) | bold);
mvprintw(row - 2, col - 2, " # ");
mvprintw(row - 1, col - 2, "## ##");
mvprintw(row + 0, col - 2, "# #");
mvprintw(row + 1, col - 2, "## ##");
mvprintw(row + 2, col - 2, " # ");
showit();
init_pair(1, get_colour(&bold), my_bg);
attrset(COLOR_PAIR(1) | bold);
mvprintw(row - 2, col - 2, " # # ");
mvprintw(row - 1, col - 2, "# #");
mvprintw(row + 0, col - 2, " ");
mvprintw(row + 1, col - 2, "# #");
mvprintw(row + 2, col - 2, " # # ");
showit();
}
int
main(
int argc GCC_UNUSED,
char *argv[]GCC_UNUSED)
{
int j;
int start, end, row, diff, flag = 0, direction;
unsigned seed;
for (j = SIGHUP; j <= SIGTERM; j++)
if (signal(j, SIG_IGN) != SIG_IGN)
signal(j, onsig);
initscr();
noecho();
cbreak();
keypad(stdscr, TRUE);
nodelay(stdscr, TRUE);
if (has_colors()) {
start_color();
#ifdef NCURSES_VERSION
if (use_default_colors() == OK)
my_bg = -1;
#endif
}
curs_set(0);
seed = time((time_t *) 0);
srand(seed);
for (;;) {
do {
start = rand() % (COLS - 3);
end = rand() % (COLS - 3);
start = (start < 2) ? 2 : start;
end = (end < 2) ? 2 : end;
direction = (start > end) ? -1 : 1;
diff = abs(start - end);
} while (diff < 2 || diff >= LINES - 2);
attrset(A_NORMAL);
for (row = 0; row < diff; row++) {
mvprintw(LINES - row, start + (row * direction),
(direction < 0) ? "\\" : "/");
if (flag++) {
showit();
erase();
flag = 0;
}
}
if (flag++) {
showit();
flag = 0;
}
seed = time((time_t *) 0);
srand(seed);
explode(LINES - row, start + (diff * direction));
erase();
showit();
}
}

View File

@ -14,7 +14,7 @@
*
* Date: 05.Nov.90
*
* $Id: hanoi.c,v 1.15 1997/10/18 20:11:20 tom Exp $
* $Id: hanoi.c,v 1.16 1999/10/23 15:01:01 tom Exp $
*/
#include <test.priv.h>
@ -118,8 +118,10 @@ unsigned char AutoFlag = 0;
fprintf(stderr, "Min screen length 24 lines\n");
return EXIT_FAILURE;
}
if(AutoFlag)
if(AutoFlag) {
curs_set(0);
leaveok(stdscr, TRUE); /* Attempt to remove cursor */
}
InitTiles(NTiles);
DisplayTiles();
if(AutoFlag) {
@ -148,7 +150,6 @@ unsigned char AutoFlag = 0;
}
}
}
curs_set(1);
endwin();
return EXIT_SUCCESS;
}

View File

@ -6,42 +6,125 @@
* This can't be part of the ncurses test-program, because ncurses rips off the
* bottom line to do labels.
*
* $Id: lrtest.c,v 0.7 1998/02/12 23:49:11 tom Exp $
* $Id: lrtest.c,v 0.14 1999/10/23 19:44:35 tom Exp $
*/
#include <test.priv.h>
#include <term.h>
typedef struct {
int y, x, mode, dir, inc;
chtype value;
} MARK;
/*
* Make a couple of markers go 'round the border to demonstrate that we can
* really write to all positions properly.
*/
static void
show(MARK * m)
{
mvaddch(m->y, m->x, m->value);
if (m->mode == 0) { /* along the x-direction */
m->x += m->inc;
if (m->x >= COLS) {
m->x = COLS - 1;
m->inc = -m->dir * m->inc;
m->y += m->inc;
m->mode = 1;
} else if (m->x < 0) {
m->x = 0;
m->inc = -m->dir * m->inc;
m->y += m->inc;
m->mode = 1;
}
} else { /* along the y-direction */
m->y += m->inc;
if (m->y >= LINES) {
m->y = LINES - 1;
m->inc = m->dir * m->inc;
m->x += m->inc;
m->mode = 0;
} else if (m->y < 0) {
m->y = 0;
m->inc = m->dir * m->inc;
m->x += m->inc;
m->mode = 0;
}
}
}
int
main(
int argc GCC_UNUSED,
char *argv[] GCC_UNUSED)
int argc GCC_UNUSED,
char *argv[]GCC_UNUSED)
{
initscr();
static MARK marks[] =
{
{0, 0, 0, -1, 1, '+' | A_BOLD},
{0, 0, 1, 1, 2, 'X'},
{0, 0, 1, -1, 3, 'Y'},
{0, 8, 0, -1, 1, '+' | A_BOLD},
{0, 9, 0, -1, 1, '+' | A_BOLD},
{1, 0, 1, 1, 1, '*' | A_REVERSE},
{2, 0, 1, 1, 1, '*' | A_REVERSE}
};
move(LINES/2-1, 4);
if (!has_ic())
{
initscr();
noecho();
cbreak();
nodelay(stdscr, TRUE);
curs_set(0);
#ifdef KEY_RESIZE
keypad(stdscr, TRUE);
restart:
#endif
move(LINES / 2 - 1, 4);
if (!(has_ic()
/* see PutCharLR() */
|| auto_right_margin
|| (enter_am_mode && exit_am_mode))) {
addstr("Your terminal lacks the capabilities needed to address the\n");
move(LINES/2, 4);
move(LINES / 2, 4);
addstr("lower-right-hand corner of the screen.\n");
}
else
{
} else {
addstr("This is a test of access to the lower right corner.\n");
move(LINES/2, 4);
move(LINES / 2, 4);
addstr("If the top of the box is missing, the test failed.\n");
move(LINES/2+1, 4);
move(LINES / 2 + 1, 4);
addstr("Please report this (with a copy of your terminfo entry).\n");
move(LINES/2+2, 4);
move(LINES / 2 + 2, 4);
addstr("to the ncurses maintainers, at bug-ncurses@gnu.org.\n");
}
box(stdscr, 0, 0);
move(LINES-1, COLS-1);
for (;;) {
int ch;
unsigned n;
refresh();
box(stdscr, 0, 0);
for (n = 0; n < sizeof(marks) / sizeof(marks[0]); n++) {
show(&marks[n]);
}
getch();
if ((ch = getch()) > 0) {
if (ch == 'q')
break;
else if (ch == 's')
nodelay(stdscr, FALSE);
else if (ch == ' ')
nodelay(stdscr, TRUE);
#ifdef KEY_RESIZE
else if (ch == KEY_RESIZE) {
erase();
goto restart;
}
#endif
}
napms(50);
}
curs_set(1);
endwin();
return 0;
}

View File

@ -1,5 +1,5 @@
# Test-Program modules
# $Id: modules,v 1.10 1999/04/10 21:36:00 tom Exp $
# $Id: modules,v 1.11 1999/10/23 00:41:02 tom Exp $
##############################################################################
# Copyright (c) 1999 Free Software Foundation, Inc. #
# #
@ -36,6 +36,7 @@ blue progs $(srcdir) ../include/term.h
bs progs $(srcdir)
cardfile progs $(srcdir) ../include/panel.h ../include/menu.h ../include/form.h
ditto progs $(srcdir)
dots progs $(srcdir) ../include/term.h
filter progs $(srcdir)
firework progs $(srcdir) ../include/term.h
firstlast progs $(srcdir)

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
* Copyright (c) 1998,1999 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -39,7 +39,7 @@ DESCRIPTION
AUTHOR
Author: Eric S. Raymond <esr@snark.thyrsus.com> 1993
$Id: ncurses.c,v 1.118 1999/08/10 00:37:30 tom Exp $
$Id: ncurses.c,v 1.120 1999/10/23 20:01:30 tom Exp $
***************************************************************************/
@ -3186,7 +3186,16 @@ main(int argc, char *argv[])
*/
endwin();
#if HAVE_CURSES_VERSION
(void) printf("Welcome to %s. Press ? for help.\n", curses_version());
#elif defined(NCURSES_VERSION_MAJOR) && defined(NCURSES_VERSION_MINOR) && defined(NCURSES_VERSION_PATCH)
(void) printf("Welcome to ncurses %d.%d.%d. Press ? for help.\n",
NCURSES_VERSION_MAJOR,
NCURSES_VERSION_MINOR,
NCURSES_VERSION_PATCH);
#else
(void) puts("Welcome to ncurses. Press ? for help.");
#endif
do {
(void) puts("This is the ncurses main menu");

View File

@ -1,5 +1,5 @@
/*
* $Id: rain.c,v 1.11 1997/09/18 18:36:46 tom Exp $
* $Id: rain.c,v 1.13 1999/10/23 01:31:26 tom Exp $
*/
#include <test.priv.h>
@ -100,6 +100,12 @@ float c;
curs_set(1);
endwin();
return(EXIT_SUCCESS);
case 's':
nodelay(stdscr, FALSE);
break;
case ' ':
nodelay(stdscr, TRUE);
break;
#ifdef KEY_RESIZE
case(KEY_RESIZE):
r = (float)(LINES - 4);
@ -122,10 +128,6 @@ onsig(int n GCC_UNUSED)
static float
ranf(void)
{
float rv;
long r = rand();
r &= 077777;
rv =((float)r/32767.);
return rv;
long r = (rand() & 077777);
return ((float) r / 32768.);
}

View File

@ -1,6 +1,5 @@
#include "test.priv.h"
#include <float.h>
#include <math.h>
#include <time.h>
@ -19,9 +18,9 @@
would be a precalc table for the 60 hand positions, so
that the floating point stuff can be ditched. As I said,
it was a 20 hackup minute job.]
COMING SOON: tfishtank. Be the envy of your mac-owning
colleagues.
colleagues.
*/
/* To compile: cc -o tclock tclock.c -lcurses -lm */
@ -40,145 +39,188 @@
/* Plot a point */
static void
plot(int x,int y,char col)
plot(int x, int y, char col)
{
mvaddch(y,x,(chtype)col);
mvaddch(y, x, (chtype) col);
}
/* Draw a diagonal(arbitrary) line using Bresenham's alogrithm. */
static void
dline(int from_x, int from_y, int x2, int y2, char ch)
dline(int pair, int from_x, int from_y, int x2, int y2, char ch)
{
int dx,dy;
int ax,ay;
int sx,sy;
int x,y;
int d;
dx=x2-from_x;
dy=y2-from_y;
ax=abs(dx*2);
ay=abs(dy*2);
int dx, dy;
int ax, ay;
int sx, sy;
int x, y;
int d;
sx=sign(dx);
sy=sign(dy);
if (has_colors())
attrset(COLOR_PAIR(pair));
x=from_x;
y=from_y;
if(ax>ay)
{
d=ay-(ax/2);
while(1)
{
plot(x,y,ch);
if(x==x2) return;
if(d>=0)
{
y+=sy;
d-=ax;
}
x+=sx;
d+=ay;
}
dx = x2 - from_x;
dy = y2 - from_y;
ax = abs(dx * 2);
ay = abs(dy * 2);
sx = sign(dx);
sy = sign(dy);
x = from_x;
y = from_y;
if (ax > ay) {
d = ay - (ax / 2);
while (1) {
plot(x, y, ch);
if (x == x2)
return;
if (d >= 0) {
y += sy;
d -= ax;
}
x += sx;
d += ay;
}
else
{
d=ax-(ay/2);
while(1)
{
plot(x,y,ch);
if(y==y2) return;
if(d>=0)
{
x+=sx;
d-=ay;
}
y+=sy;
d+=ax;
}
} else {
d = ax - (ay / 2);
while (1) {
plot(x, y, ch);
if (y == y2)
return;
if (d >= 0) {
x += sx;
d -= ay;
}
y += sy;
d += ax;
}
}
}
int
main(
int argc GCC_UNUSED,
char *argv[] GCC_UNUSED)
int argc GCC_UNUSED,
char *argv[]GCC_UNUSED)
{
int i,cx,cy;
double mradius, hradius, mangle, hangle;
double sangle, sradius, hours;
int hdx, hdy;
int mdx, mdy;
int sdx, sdy;
time_t tim;
struct tm *t;
char szChar[10];
initscr();
noecho();
int i, cx, cy;
double mradius, hradius, mangle, hangle;
double sangle, sradius, hours;
int hdx, hdy;
int mdx, mdy;
int sdx, sdy;
int ch;
int lastbeep = -1;
time_t tim;
struct tm *t;
char szChar[10];
int my_bg = COLOR_BLACK;
cx=39;
cy=12;
mradius=9;
hradius=6;
sradius=8;
initscr();
noecho();
cbreak();
nodelay(stdscr, TRUE);
curs_set(0);
for(i=0;i<12;i++)
{
sangle=(i+1)*(2.0*PI)/12.0;
sradius=10;
sdx = A2X(sangle, sradius);
sdy = A2Y(sangle, sradius);
sprintf(szChar,"%d",i+1);
if (has_colors()) {
start_color();
#ifdef NCURSES_VERSION
if (use_default_colors() == OK)
my_bg = -1;
#endif
init_pair(1, COLOR_RED, my_bg);
init_pair(2, COLOR_MAGENTA, my_bg);
init_pair(3, COLOR_GREEN, my_bg);
}
#ifdef KEY_RESIZE
keypad(stdscr, TRUE);
restart:
#endif
cx = (COLS - 1) / 2; /* 39 */
cy = LINES / 2; /* 12 */
ch = (cx > cy) ? cy : cx; /* usually cy */
mradius = (3 * cy) / 4; /* 9 */
hradius = cy / 2; /* 6 */
sradius = (2 * cy) / 3; /* 8 */
mvaddstr((int)(cy-sdy),(int)(cx+sdx),szChar);
}
for (i = 0; i < 12; i++) {
sangle = (i + 1) * (2.0 * PI) / 12.0;
sradius = (5 * cy) / 6; /* 10 */
sdx = A2X(sangle, sradius);
sdy = A2Y(sangle, sradius);
sprintf(szChar, "%d", i + 1);
mvaddstr(0,0,"ASCII Clock by Howard Jones (ha.jones@ic.ac.uk),1994");
mvaddstr(cy - sdy, cx + sdx, szChar);
}
sradius=8;
for(;;)
{
napms(1000);
mvaddstr(0, 0, "ASCII Clock by Howard Jones (ha.jones@ic.ac.uk),1994");
tim = time(0);
t = localtime(&tim);
sradius = 8;
for (;;) {
napms(1000);
hours = (t->tm_hour + (t->tm_min/60.0));
if(hours>12.0) hours -= 12.0;
tim = time(0);
t = localtime(&tim);
mangle = ((t->tm_min) * (2 * PI)/60.0);
mdx = A2X(mangle, mradius);
mdy = A2Y(mangle, mradius);
hangle = ((hours) * (2.0 * PI)/12.0);
hdx = A2X(hangle, hradius);
hdy = A2Y(hangle, hradius);
sangle = ((t->tm_sec) * (2.0 * PI)/60.0);
sdx = A2X(sangle, sradius);
sdy = A2Y(sangle, sradius);
hours = (t->tm_hour + (t->tm_min / 60.0));
if (hours > 12.0)
hours -= 12.0;
plot(cx+sdx,cy-sdy,'O');
dline(cx,cy,cx+hdx,cy-hdy,'.');
dline(cx,cy,cx+mdx,cy-mdy,'#');
mangle = ((t->tm_min) * (2 * PI) / 60.0);
mdx = A2X(mangle, mradius);
mdy = A2Y(mangle, mradius);
mvaddstr(23,0,ctime(&tim));
refresh();
if ((t->tm_sec % 5) == 0) beep();
hangle = ((hours) * (2.0 * PI) / 12.0);
hdx = A2X(hangle, hradius);
hdy = A2Y(hangle, hradius);
plot(cx+sdx,cy-sdy,' ');
dline(cx,cy,cx+hdx,cy-hdy,' ');
dline(cx,cy,cx+mdx,cy-mdy,' ');
}
sangle = ((t->tm_sec) * (2.0 * PI) / 60.0);
sdx = A2X(sangle, sradius);
sdy = A2Y(sangle, sradius);
return 0;
dline(3, cx, cy, cx + mdx, cy - mdy, '#');
attrset(A_REVERSE);
dline(2, cx, cy, cx + hdx, cy - hdy, '.');
attroff(A_REVERSE);
if (has_colors())
attrset(COLOR_PAIR(1));
plot(cx + sdx, cy - sdy, 'O');
if (has_colors())
attrset(COLOR_PAIR(0));
mvaddstr(LINES - 2, 0, ctime(&tim));
refresh();
if ((t->tm_sec % 5) == 0
&& t->tm_sec != lastbeep) {
lastbeep = t->tm_sec;
beep();
}
if ((ch = getch()) != ERR) {
#ifdef KEY_RESIZE
if (ch == KEY_RESIZE) {
erase();
goto restart;
}
#endif
break;
}
plot(cx + sdx, cy - sdy, ' ');
dline(0, cx, cy, cx + hdx, cy - hdy, ' ');
dline(0, cx, cy, cx + mdx, cy - mdy, ' ');
}
curs_set(1);
endwin();
return 0;
}

View File

@ -34,26 +34,27 @@
traces will be dumped. The program stops and waits for one character of
input at the beginning and end of the interval.
$Id: worm.c,v 1.23 1999/03/06 22:52:04 tom Exp $
$Id: worm.c,v 1.26 1999/10/23 01:31:40 tom Exp $
*/
#include <test.priv.h>
#include <term.h> /* for tparm() */
#include <signal.h>
#define cursor(col,row) move(row,col)
#define typeAlloc(type,n) (type *) malloc(n * sizeof(type))
#define typeRealloc(type,n,p) (type *) realloc(p, n * sizeof(type))
short *ref[128];
static chtype flavor[]={
'O' , '*', '#', '$', '%', '0', '@',
static chtype flavor[] =
{
'O', '*', '#', '$', '%', '0', '@',
};
#define MAXWORMS (sizeof(flavor)/sizeof(chtype))
static const short xinc[]={
1, 1, 1, 0, -1, -1, -1, 0
}, yinc[]={
-1, 0, 1, 1, 1, 0, -1, -1
static const short xinc[] =
{
1, 1, 1, 0, -1, -1, -1, 0
}, yinc[] =
{
-1, 0, 1, 1, 1, 0, -1, -1
};
static struct worm {
int orientation, head;
@ -61,12 +62,13 @@ static struct worm {
} worm[40];
static const char *field;
static int length=16, number=3;
static chtype trail=' ';
static int length = 16, number = 3;
static chtype trail = ' ';
#ifdef TRACE
int generation, trace_start, trace_end, singlestep;
#endif /* TRACE */
/* *INDENT-OFF* */
static const struct options {
int nopts;
int opts[3];
@ -152,63 +154,90 @@ static const struct options {
{ 0, { 0, 0, 0 } },
{ 0, { 0, 0, 0 } }
};
/* *INDENT-ON* */
static RETSIGTYPE onsig(int sig);
static float ranf(void);
static void
cleanup(void)
{
standend();
refresh();
curs_set(1);
endwin();
}
static RETSIGTYPE
onsig(int sig GCC_UNUSED)
{
cleanup();
exit(EXIT_FAILURE);
}
static float
ranf(void)
{
long r = (rand() & 077777);
return ((float) r / 32768.);
}
int
main(int argc, char *argv[])
{
int x, y;
int n;
struct worm *w;
const struct options *op;
int h;
short *ip;
int last, bottom;
short **ref;
int x, y;
int n;
int ch;
struct worm *w;
const struct options *op;
int h;
short *ip;
int last, bottom;
for (x=1;x<argc;x++) {
register char *p;
p=argv[x];
if (*p=='-') p++;
switch (*p) {
case 'f':
field="WORM";
break;
case 'l':
if (++x==argc) goto usage;
if ((length=atoi(argv[x]))<2||length>1024) {
fprintf(stderr,"%s: Invalid length\n",*argv);
return EXIT_FAILURE;
}
break;
case 'n':
if (++x==argc) goto usage;
if ((number=atoi(argv[x]))<1||number>40) {
fprintf(stderr,"%s: Invalid number of worms\n",*argv);
return EXIT_FAILURE;
}
break;
case 't':
trail='.';
break;
for (x = 1; x < argc; x++) {
char *p;
p = argv[x];
if (*p == '-')
p++;
switch (*p) {
case 'f':
field = "WORM";
break;
case 'l':
if (++x == argc)
goto usage;
if ((length = atoi(argv[x])) < 2 || length > 1024) {
fprintf(stderr, "%s: Invalid length\n", *argv);
return EXIT_FAILURE;
}
break;
case 'n':
if (++x == argc)
goto usage;
if ((number = atoi(argv[x])) < 1 || number > 40) {
fprintf(stderr, "%s: Invalid number of worms\n", *argv);
return EXIT_FAILURE;
}
break;
case 't':
trail = '.';
break;
#ifdef TRACE
case 'S':
singlestep = TRUE;
break;
case 'T':
trace_start = atoi(argv[++x]);
trace_end = atoi(argv[++x]);
break;
case 'N':
_nc_optimize_enable ^= OPTIMIZE_ALL; /* declared by ncurses */
break;
case 'S':
singlestep = TRUE;
break;
case 'T':
trace_start = atoi(argv[++x]);
trace_end = atoi(argv[++x]);
break;
case 'N':
_nc_optimize_enable ^= OPTIMIZE_ALL; /* declared by ncurses */
break;
#endif /* TRACE */
default:
usage:
fprintf(stderr, "usage: %s [-field] [-length #] [-number #] [-trail]\n",*argv);
return EXIT_FAILURE;
}
default:
usage:
fprintf(stderr,
"usage: %s [-field] [-length #] [-number #] [-trail]\n", *argv);
return EXIT_FAILURE;
}
}
signal(SIGINT, onsig);
@ -219,154 +248,183 @@ int last, bottom;
curs_set(0);
bottom = LINES-1;
last = COLS-1;
bottom = LINES - 1;
last = COLS - 1;
#ifdef A_COLOR
if (has_colors())
{
if (has_colors()) {
int bg = COLOR_BLACK;
start_color();
#ifdef NCURSES_VERSION
if (use_default_colors() == OK)
bg = -1;
#endif
init_pair(COLOR_GREEN, COLOR_GREEN, bg);
init_pair(COLOR_RED, COLOR_RED, bg);
init_pair(COLOR_CYAN, COLOR_CYAN, bg);
init_pair(COLOR_WHITE, COLOR_WHITE, bg);
init_pair(COLOR_MAGENTA, COLOR_MAGENTA, bg);
init_pair(COLOR_BLUE, COLOR_BLUE, bg);
init_pair(COLOR_YELLOW, COLOR_YELLOW, bg);
flavor[0] |= COLOR_PAIR(COLOR_GREEN) | A_BOLD;
flavor[1] |= COLOR_PAIR(COLOR_RED) | A_BOLD;
flavor[2] |= COLOR_PAIR(COLOR_CYAN) | A_BOLD;
flavor[3] |= COLOR_PAIR(COLOR_WHITE) | A_BOLD;
flavor[4] |= COLOR_PAIR(COLOR_MAGENTA) | A_BOLD;
flavor[5] |= COLOR_PAIR(COLOR_BLUE) | A_BOLD;
flavor[6] |= COLOR_PAIR(COLOR_YELLOW) | A_BOLD;
#define SET_COLOR(num, fg) \
init_pair(num+1, fg, bg); \
flavor[num] |= COLOR_PAIR(num+1) | A_BOLD
SET_COLOR(0, COLOR_GREEN);
SET_COLOR(1, COLOR_RED);
SET_COLOR(2, COLOR_CYAN);
SET_COLOR(3, COLOR_WHITE);
SET_COLOR(4, COLOR_MAGENTA);
SET_COLOR(5, COLOR_BLUE);
SET_COLOR(6, COLOR_YELLOW);
}
#endif /* A_COLOR */
ip=(short *)malloc(LINES*COLS*sizeof (short));
for (n=0;n<LINES;) {
ref[n++]=ip; ip+=COLS;
ref = typeAlloc(short *, LINES);
for (y = 0; y < LINES; y++) {
ref[y] = typeAlloc(short, COLS);
for (x = 0; x < COLS; x++) {
ref[y][x] = 0;
}
}
for (ip=ref[0],n=LINES*COLS;--n>=0;) *ip++=0;
#ifdef BADCORNER
/* if addressing the lower right corner doesn't work in your curses */
ref[bottom][last]=1;
ref[bottom][last] = 1;
#endif /* BADCORNER */
for (n=number, w= &worm[0];--n>=0;w++) {
w->orientation=w->head=0;
if (!(ip=(short *)malloc((length+1)*sizeof (short)))) {
fprintf(stderr,"%s: out of memory\n",*argv);
return EXIT_FAILURE;
}
w->xpos=ip;
for (x=length;--x>=0;) *ip++ = -1;
if (!(ip=(short *)malloc((length+1)*sizeof (short)))) {
fprintf(stderr,"%s: out of memory\n",*argv);
return EXIT_FAILURE;
}
w->ypos=ip;
for (y=length;--y>=0;) *ip++ = -1;
for (n = number, w = &worm[0]; --n >= 0; w++) {
w->orientation = w->head = 0;
if (!(ip = typeAlloc(short, (length + 1)))) {
fprintf(stderr, "%s: out of memory\n", *argv);
return EXIT_FAILURE;
}
w->xpos = ip;
for (x = length; --x >= 0;)
*ip++ = -1;
if (!(ip = typeAlloc(short, (length + 1)))) {
fprintf(stderr, "%s: out of memory\n", *argv);
return EXIT_FAILURE;
}
w->ypos = ip;
for (y = length; --y >= 0;)
*ip++ = -1;
}
if (field) {
register const char *p;
p=field;
for (y=bottom;--y>=0;) {
for (x=COLS;--x>=0;) {
addch((chtype)(*p++));
if (!*p) p=field;
}
addch('\n');
}
const char *p;
p = field;
for (y = bottom; --y >= 0;) {
for (x = COLS; --x >= 0;) {
addch((chtype) (*p++));
if (!*p)
p = field;
}
}
}
napms(10);
refresh();
#ifndef TRACE
nodelay(stdscr, TRUE);
#endif
for (;;) {
#ifdef TRACE
if (trace_start || trace_end) {
if (generation == trace_start) {
trace(TRACE_CALLS);
getch();
} else if (generation == trace_end) {
trace(0);
getch();
if (trace_start || trace_end) {
if (generation == trace_start) {
trace(TRACE_CALLS);
getch();
} else if (generation == trace_end) {
trace(0);
getch();
}
if (singlestep && generation > trace_start && generation < trace_end)
getch();
generation++;
}
#else
if ((ch = getch()) > 0) {
#ifdef KEY_RESIZE
if (ch == KEY_RESIZE) {
if (last != COLS - 1) {
for (y = 0; y <= bottom; y++) {
ref[y] = typeRealloc(short, COLS, ref[y]);
for (x = last + 1; x < COLS; x++)
ref[y][x] = 0;
}
if (singlestep && generation > trace_start && generation < trace_end)
getch();
generation++;
last = COLS - 1;
}
if (bottom != LINES - 1) {
ref = typeRealloc(short *, LINES, ref);
for (y = COLS; y <= bottom; y++)
free(ref[y]);
for (y = bottom + 1; y < LINES; y++) {
ref[y] = typeAlloc(short, COLS);
for (x = 0; x < COLS; x++)
ref[y][x] = 0;
}
bottom = LINES - 1;
}
}
#endif
/*
* Make it simple to put this into single-step mode, or resume
* normal operation -TD
*/
if (ch == 'q') {
cleanup();
return (EXIT_SUCCESS);
} else if (ch == 's') {
nodelay(stdscr, FALSE);
} else if (ch == ' ') {
nodelay(stdscr, TRUE);
}
}
#endif /* TRACE */
for (n=0,w= &worm[0];n<number;n++,w++) {
if ((x=w->xpos[h=w->head])<0) {
cursor(x=w->xpos[h]=0,y=w->ypos[h]=bottom);
addch(flavor[n % MAXWORMS]);
ref[y][x]++;
}
else y=w->ypos[h];
if (++h==length) h=0;
if (w->xpos[w->head=h]>=0) {
register int x1, y1;
x1=w->xpos[h]; y1=w->ypos[h];
if (--ref[y1][x1]==0) {
cursor(x1,y1); addch(trail);
}
}
op= &(x==0 ? (y==0 ? upleft : (y==bottom ? lowleft : left)) :
(x==last ? (y==0 ? upright : (y==bottom ? lowright : right)) :
(y==0 ? upper : (y==bottom ? lower : normal))))[w->orientation];
switch (op->nopts) {
case 0:
refresh();
curs_set(1);
endwin();
return EXIT_SUCCESS;
case 1:
w->orientation=op->opts[0];
break;
default:
w->orientation=op->opts[(int)(ranf()*(float)op->nopts)];
}
cursor(x+=xinc[w->orientation], y+=yinc[w->orientation]);
if (y < 0 ) y = 0;
addch(flavor[n % MAXWORMS]);
ref[w->ypos[h]=y][w->xpos[h]=x]++;
for (n = 0, w = &worm[0]; n < number; n++, w++) {
if ((x = w->xpos[h = w->head]) < 0) {
move(y = w->ypos[h] = bottom, x = w->xpos[h] = 0);
addch(flavor[n % MAXWORMS]);
ref[y][x]++;
} else {
y = w->ypos[h];
}
if (x > last)
x = last;
if (y > bottom)
y = bottom;
if (++h == length)
h = 0;
if (w->xpos[w->head = h] >= 0) {
int x1, y1;
x1 = w->xpos[h];
y1 = w->ypos[h];
if (y1 < LINES
&& x1 < COLS
&& --ref[y1][x1] == 0) {
move(y1, x1);
addch(trail);
}
napms(10);
refresh();
}
op = &(x == 0 ? (y == 0 ? upleft : (y == bottom ? lowleft :
left)) :
(x == last ? (y == 0 ? upright : (y == bottom ? lowright :
right)) :
(y == 0 ? upper : (y == bottom ? lower : normal))))[w->orientation];
switch (op->nopts) {
case 0:
cleanup();
return EXIT_SUCCESS;
case 1:
w->orientation = op->opts[0];
break;
default:
w->orientation = op->opts[(int) (ranf() * (float) op->nopts)];
}
move(y += yinc[w->orientation], x += xinc[w->orientation]);
if (y < 0)
y = 0;
addch(flavor[n % MAXWORMS]);
ref[w->ypos[h] = y][w->xpos[h] = x]++;
}
napms(10);
refresh();
}
}
static RETSIGTYPE
onsig(int sig GCC_UNUSED)
{
standend();
refresh();
curs_set(1);
endwin();
exit(EXIT_FAILURE);
}
static float
ranf(void)
{
float rv;
long r = rand();
r &= 077777;
rv =((float)r/32767.);
return rv;
}