Import ncurses 5.6-20080209 snapshot onto the vender branch

This commit is contained in:
Rong-En Fan 2008-02-11 13:37:14 +00:00
parent 536bf19adc
commit d8977eaf36
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/vendor/ncurses/dist/; revision=176187
svn path=/vendor/ncurses/5.6-20080209/; revision=176189; tag=vendor/ncurses/5.6-20080209
31 changed files with 4160 additions and 202 deletions

View File

@ -571,6 +571,7 @@
./man/curs_termattrs.3x
./man/curs_termcap.3x
./man/curs_terminfo.3x
./man/curs_threads.3x
./man/curs_touch.3x
./man/curs_trace.3x
./man/curs_util.3x
@ -810,6 +811,7 @@
./ncurses/curses.priv.h
./ncurses/fifo_defs.h
./ncurses/llib-lncurses
./ncurses/llib-lncursest
./ncurses/llib-lncursesw
./ncurses/modules
./ncurses/tinfo/MKcaptab.awk

View File

@ -1,5 +1,5 @@
-------------------------------------------------------------------------------
-- Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2007,2008 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 --
@ -25,7 +25,7 @@
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
-- $Id: NEWS,v 1.1188 2007/12/22 23:56:08 tom Exp $
-- $Id: NEWS,v 1.1206 2008/02/09 23:49:39 tom Exp $
-------------------------------------------------------------------------------
This is a log of changes that ncurses has gone through since Zeyd started
@ -45,6 +45,54 @@ See the AUTHORS file for the corresponding full names.
Changes through 1.9.9e did not credit all contributions;
it is not possible to add this information.
20080209
+ update test programs to build/work with various UNIX curses for
comparisons. This was to reinvestigate statement in X/Open curses
that insnstr and winsnstr perform wrapping. None of the Unix-branded
implementations do this, as noted in manpage (cf: 20040228).
20080203
+ modify _nc_setupscreen() to set the legacy-coding value the same
for both narrow/wide models. It had been set only for wide model,
but is needed to make unctrl() work with locale in the narrow model.
+ improve waddch() and winsch() handling of EILSEQ from mbrtowc() by
using unctrl() to display illegal bytes rather than trying to append
further bytes to make up a valid sequence (reported by Andrey A
Chernov).
+ modify unctrl() to check codes in 128-255 range versus isprint().
If they are not printable, and locale was set, use a "M-" or "~"
sequence.
20080126
+ improve threading in test/worm.c (wrap refresh calls, and KEY_RESIZE
handling). Now it hangs in napms(), no matter whether nanosleep()
or poll() or select() are used on Linux.
20080119
+ fixes to build with --disable-ext-funcs
+ add manpage for use_window and use_screen.
+ add set_tabsize() and set_escdelay() functions.
20080112
+ remove recursive-mutex definitions, finish threading demo for worm.c
+ remove a redundant adjustment of lines in resizeterm.c's
adjust_window() which caused occasional misadjustment of stdscr when
softkeys were used.
20080105
+ several improvements to terminfo entries based on xterm #230 -TD
+ modify MKlib_gen.sh to handle keyname/key_name prototypes, so the
"link_test" builds properly.
+ fix for toe command-line options -u/-U to ensure filename is given.
+ fix allocation-size for command-line parsing in infocmp from 20070728
(report by Miroslav Lichvar)
+ improve resizeterm() by moving ripped-off lines, and repainting the
soft-keys (report by Katarina Machalkova)
+ add clarification in wclear's manpage noting that the screen will be
cleared even if a subwindow is cleared (prompted by Christer Enfors
question).
+ change test/ncurses.c soft-key tests to work with KEY_RESIZE.
20071222
+ continue implementing support for threading demo by adding mutex
for delwin().

View File

@ -1,5 +1,5 @@
##############################################################################
# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. #
# Copyright (c) 1998-2007,2008 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"), #
@ -25,7 +25,7 @@
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
# $Id: dist.mk,v 1.620 2007/12/22 20:41:31 tom Exp $
# $Id: dist.mk,v 1.629 2008/02/09 15:32:57 tom Exp $
# Makefile for creating ncurses distributions.
#
# This only needs to be used directly as a makefile by developers, but
@ -37,7 +37,7 @@ SHELL = /bin/sh
# These define the major/minor/patch versions of ncurses.
NCURSES_MAJOR = 5
NCURSES_MINOR = 6
NCURSES_PATCH = 20071222
NCURSES_PATCH = 20080209
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
* Copyright (c) 1998-2007,2008 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 *
@ -32,7 +32,7 @@
#include "form.priv.h"
MODULE_ID("$Id: frm_driver.c,v 1.85 2007/11/24 21:32:53 tom Exp $")
MODULE_ID("$Id: frm_driver.c,v 1.86 2008/01/19 20:11:03 tom Exp $")
/*----------------------------------------------------------------------------
This is the core module of the form library. It contains the majority
@ -676,7 +676,7 @@ Field_Grown(FIELD *field, int amount)
new_bp[new_buflen] = myZEROS;
}
#if USE_WIDEC_SUPPORT
#if USE_WIDEC_SUPPORT && NCURSES_EXT_FUNCS
if (wresize(field->working, 1, Buffer_Length(field) + 1) == ERR)
result = FALSE;
#endif

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
* Copyright (c) 1998-2007,2008 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 *
@ -32,7 +32,7 @@
* and: Thomas E. Dickey 1996-on *
****************************************************************************/
/* $Id: curses.h.in,v 1.181 2007/11/18 00:32:03 tom Exp $ */
/* $Id: curses.h.in,v 1.183 2008/01/19 20:03:48 tom Exp $ */
#ifndef __NCURSES_H
#define __NCURSES_H
@ -827,7 +827,6 @@ extern NCURSES_EXPORT(int) getpary (const WINDOW *); /* generated */
/*
* These functions are extensions - not in X/Open Curses.
*/
#undef NCURSES_EXT_FUNCS
#if @NCURSES_EXT_FUNCS@
#undef NCURSES_EXT_FUNCS
#define NCURSES_EXT_FUNCS @NCURSES_PATCH@
@ -841,6 +840,8 @@ extern NCURSES_EXPORT(int) key_defined (const char *);
extern NCURSES_EXPORT(int) keyok (int, bool);
extern NCURSES_EXPORT(int) resize_term (int, int);
extern NCURSES_EXPORT(int) resizeterm (int, int);
extern NCURSES_EXPORT(int) set_escdelay (int);
extern NCURSES_EXPORT(int) set_tabsize (int);
extern NCURSES_EXPORT(int) use_default_colors (void);
extern NCURSES_EXPORT(int) use_extended_names (bool);
extern NCURSES_EXPORT(int) use_legacy_coding (int);

View File

@ -1,6 +1,6 @@
# $Id: ncurses_defs,v 1.35 2007/10/06 21:18:16 tom Exp $
# $Id: ncurses_defs,v 1.38 2008/02/10 00:12:03 tom Exp $
##############################################################################
# Copyright (c) 2000-2006,2007 Free Software Foundation, Inc. #
# Copyright (c) 2000-2007,2008 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"), #
@ -46,6 +46,8 @@ HAVE_BSD_CGETENT
HAVE_BSD_SIGNAL_H
HAVE_BTOWC
HAVE_BUILTIN_H
HAVE_CHGAT 1
HAVE_COLOR_SET 1
HAVE_DIRENT_H
HAVE_ERRNO
HAVE_FCNTL_H
@ -58,6 +60,7 @@ HAVE_GETEGID
HAVE_GETEUID
HAVE_GETMAXX 1
HAVE_GETNSTR
HAVE_GETPARX 1
HAVE_GETOPT_H
HAVE_GETTIMEOFDAY
HAVE_GETTTYNAM

View File

@ -1,5 +1,5 @@
.\"***************************************************************************
.\" Copyright (c) 1998,2005 Free Software Foundation, Inc. *
.\" Copyright (c) 1998-2005,2007 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 *
@ -26,7 +26,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
.\" $Id: curs_clear.3x,v 1.10 2005/10/01 19:34:43 tom Exp $
.\" $Id: curs_clear.3x,v 1.11 2007/12/29 15:58:38 tom Exp $
.TH curs_clear 3X ""
.na
.hy 0
@ -105,6 +105,12 @@ via \fBwerase()\fP and \fBwclear()\fP.
That fact is not documented in other implementations,
and may not be true of implementations
which were not derived from SVr4 source.
.PP
Not obvious from the description,
most implementations clear the screen after \fBwclear\fP
even for a subwindow or derived window.
If you do not want to clear the screen during the next \fBwrefresh\fP,
use \fBwerase\fP instead.
.SH SEE ALSO
\fBcurses\fR(3X), \fBcurs_outopts\fR(3X), \fBcurs_refresh\fR(3X)
.\"#

View File

@ -0,0 +1,113 @@
.\"***************************************************************************
.\" Copyright (c) 2008 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. *
.\"***************************************************************************
.\"
.\" $Id: curs_threads.3x,v 1.4 2008/01/19 23:29:24 tom Exp $
.TH curs_threads 3X ""
.na
.hy 0
.SH NAME
\fBuse_screen\fR,
\fBuse_window\fR - \fBcurses\fR thread support
.ad
.hy
.SH SYNOPSIS
\fB#include <curses.h>\fR
.sp
\fBtypedef int (*NCURSES_CALLBACK)(WINDOW *, void *);\fR
.br
\fBint set_escdelay(int size);\fR
.br
\fBint set_tabsize(int size);\fR
.br
\fBint use_screen(SCREEN *scr, NCURSES_CALLBACK func, void *data);\fR
.br
\fBint use_window(WINDOW *win, NCURSES_CALLBACK func, void *data);\fR
.br
.SH DESCRIPTION
This implementation can be configured to provide rudimentary support
for multi-threaded applications.
This makes a different set of libraries, e.g., \fIlibncursest\fP since
the binary interfaces are different.
.PP
Rather than modify the interfaces to pass a thread specifier to
each function, it adds a few functions which can be used in any
configuration which hide the mutex's needed to prevent concurrent
use of the global variables when configured for threading.
.PP
In addition to forcing access to members of the \fBWINDOW\fP structure
to be via functions (see \fBcurs_opaque\fP(3x)),
it makes functions of the common global variables,
e.g.,
COLORS,
COLOR_PAIRS,
COLS,
ESCDELAY,
LINES,
TABSIZE
curscr,
newscr and
ttytype.
Those variables are maintained as read-only values, stored in the \fBSCREEN\fP
structure.
.PP
Even this is not enough to make a thread-safe application using curses.
A multi-threaded application would be expected to have threads updating
separate windows (within the same device),
or updating on separate screens (on different devices).
Also, a few of the global variables are considered writable by some
applications.
The functions described here address these special situations.
.PP
The ESCDELAY and TABSIZE global variables are modified by some applications.
To modify them in any configuration,
use the \fBset_escdelay\fP or \fBset_tabsize\fP functions.
Other global variables are not modifiable.
.PP
The \fBuse_window\fP and \fBuse_screen\fP functions provide coarse
granularity mutexes for their respective \fBWINDOW\fP and \fBSCREEN\fP
parameters, and call a user-supplied function,
passing it a \fIdata\fP parameter,
and returning the value from the user-supplied function to the application.
.SH RETURN VALUE
These functions all return TRUE or FALSE, except as noted.
.SH NOTES
Both a macro and a function are provided for each name.
.SH PORTABILITY
These routines are specific to ncurses.
They were not supported on Version 7, BSD or System V implementations.
It is recommended that any code depending on ncurses extensions
be conditioned using NCURSES_VERSION.
.SH SEE ALSO
\fBcurses\fR(3X),
\fBcurs_opaque\fR(3X)
.\"#
.\"# The following sets edit modes for GNU EMACS
.\"# Local Variables:
.\"# mode:nroff
.\"# fill-column:79
.\"# End:

View File

@ -1,5 +1,5 @@
##############################################################################
# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. #
# Copyright (c) 1998-2007,2008 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"), #
@ -25,7 +25,7 @@
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
# $Id: man_db.renames,v 0.39 2007/04/07 23:06:31 tom Exp $
# $Id: man_db.renames,v 0.40 2008/01/19 18:28:50 tom Exp $
# Manual-page renamings for the man_db program
#
# Files:
@ -84,6 +84,7 @@ curs_slk.3x slk.3ncurses
curs_termattrs.3x termattrs.3ncurses
curs_termcap.3x termcap.3ncurses
curs_terminfo.3x terminfo.3ncurses
curs_threads.3x threads.3ncurses
curs_touch.3x touch.3ncurses
curs_trace.3x trace.3ncurses
curs_util.3x util.3ncurses
@ -116,9 +117,9 @@ form_userptr.3x userptr.3form
form_win.3x win.3form
infocmp.1m infocmp.1
infotocap.1m infotocap.1
key_defined.3x key_defined.3ncurses
keybound.3x keybound.3ncurses
keyok.3x keyok.3ncurses
key_defined.3x key_defined.3ncurses
legacy_coding.3x legacy_coding.3ncurses
menu.3x menu.3menu
menu_attributes.3x attributes.3menu

View File

@ -1,6 +1,6 @@
# $Id: manlinks.sed,v 1.12 2003/12/20 13:17:56 tom Exp $
# $Id: manlinks.sed,v 1.13 2008/01/19 23:31:17 tom Exp $
##############################################################################
# Copyright (c) 2000-2002,2003 Free Software Foundation, Inc. #
# Copyright (c) 2000-2003,2008 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"), #
@ -35,6 +35,7 @@
/\.\\"/d
/^\.br/d
/^\.sp/d
/typedef/d
s/^\.IX//
s/\\f.//g
s/[:,]/ /g

View File

@ -1,5 +1,5 @@
.\"***************************************************************************
.\" Copyright (c) 1998-2004,2006 Free Software Foundation, Inc. *
.\" Copyright (c) 1998-2006,2008 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 *
@ -26,7 +26,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
.\" $Id: toe.1m,v 1.20 2006/12/24 17:20:37 tom Exp $
.\" $Id: toe.1m,v 1.21 2008/01/05 20:57:16 tom Exp $
.TH @TOE@ 1M ""
.ds n 5
.ds d @TERMINFO@
@ -37,10 +37,14 @@
.br
.SH DESCRIPTION
.PP
With no options, \fBtoe\fR lists all available terminal types by primary name
with descriptions. File arguments specify the directories to be scanned; if no
such arguments are given, your default terminfo directory is scanned. If you
also specify the \fB-h\fR option, a directory header will be issued as each
With no options,
\fBtoe\fR lists all available terminal types by primary name
with descriptions.
File arguments specify the directories to be scanned; if no
such arguments are given,
your default terminfo directory is scanned.
If you also specify the \fB-h\fR option,
a directory header will be issued as each
directory is entered.
.PP
There are other options intended for use by terminfo file maintainers:
@ -50,16 +54,25 @@ report on all of the terminal databases which ncurses would search,
rather than only the first one that it finds.
.TP
\fB-u\fR \fIfile\fR
says to issue a report on dependencies in the given file. This report condenses
the `use' relation: each line consists of the primary name of a terminal that
has use capabilities, followed by a colon, followed by the
says to write a report to the standard output,
listing dependencies in the given terminfo/termcap source file.
The report condenses the `use' relation:
each line consists of the primary name of a terminal that
has use capabilities,
followed by a colon,
followed by the
whitespace-separated primary names of all terminals which occur in those use
capabilities, followed by a newline
capabilities,
followed by a newline
.TP
\fB-U\fR \fIfile\fR
says to issue a report on reverse dependencies in the given file. This report
reverses the `use' relation: each line consists of the primary name of a
terminal that occurs in use capabilities, followed by a colon, followed by the
says to write a report to the standard output,
listing reverse dependencies in the given terminfo/termcap source file.
The report reverses the `use' relation:
each line consists of the primary name of a
terminal that occurs in use capabilities,
followed by a colon,
followed by the
whitespace-separated primary names of all terminals which depend on it,
followed by a newline.
.TP
@ -70,7 +83,8 @@ The optional parameter \fIn\fR is a number from 1 to 10,
interpreted as for \fB@TIC@\fR(1M).
.TP
\fB-V\fR
reports the version of ncurses which was used in this program, and exits.
reports the version of ncurses which was used in this program,
and exits.
.SH FILES
.TP 5
\fB\*d/?/*\fR

View File

@ -6,8 +6,8 @@
# Report bugs and new terminal descriptions to
# bug-ncurses@gnu.org
#
# $Revision: 1.318 $
# $Date: 2007/11/03 19:02:01 $
# $Revision: 1.326 $
# $Date: 2007/11/12 00:22:07 $
#
# The original header is preserved below for reference. It is noted that there
# is a "newer" version which differs in some cosmetic details (but actually
@ -3017,10 +3017,8 @@ xterm-xf86-v44|xterm terminal emulator (XFree86 4.4 Window System),
cnorm=\E[?12l\E[?25h, cvvis=\E[?12;25h, indn=\E[%p1%dS,
rin=\E[%p1%dT, use=xterm-xf86-v43,
# This is the most common alias for xterm-new.
xterm-xfree86|xterm terminal emulator (XFree86),
use=xterm-new,
# use=xterm-old,
use=xterm-xf86-v44,
# This version reflects the current xterm features.
xterm-new|modern xterm terminal emulator,
@ -3048,7 +3046,16 @@ xterm-new|modern xterm terminal emulator,
# The meta key may also be used as a modifier in this scheme, adding another
# bit to the parameter.
xterm+pcfkeys|fragment for PC-style fkeys,
use=xterm+pcf2, use=xterm+pcc2,
use=xterm+app, use=xterm+pcf2, use=xterm+pcc2,
use=xterm+pce2,
#
xterm+noapp|fragment with cursor keys in normal mode,
kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kend=\E[F,
khome=\E[H,
xterm+app|fragment with cursor keys in application mode,
kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kend=\EOF,
khome=\EOH,
#
# The "PC-style" modifier scheme was introduced in xterm patch #94 (1999/3/27)
# and revised in patch #167 (2002/8/24). Some other terminal emulators copied
@ -3071,28 +3078,39 @@ xterm+pcfkeys|fragment for PC-style fkeys,
# that might apply to xterm+pcfkeys with different values of that resource.
xterm+pcc3|fragment with modifyCursorKeys:3,
kLFT=\E[>1;2D, kRIT=\E[>1;2C, kind=\E[>1;2B,
kri=\E[>1;2A, kDN=\E[>1;2B, kDN5=\E[>1;5B, kDN6=\E[>1;6B,
kLFT5=\E[>1;5D, kLFT6=\E[>1;6D, kRIT5=\E[>1;5C,
kRIT6=\E[>1;6C, kUP=\E[>1;2A, kUP5=\E[>1;5A,
kUP6=\E[>1;6A,
kri=\E[>1;2A, kDN=\E[>1;2B, kDN3=\E[>1;3B, kDN4=\E[>1;4B,
kDN5=\E[>1;5B, kDN6=\E[>1;6B, kDN7=\E[>1;7B,
kLFT3=\E[>1;3D, kLFT4=\E[>1;4D, kLFT5=\E[>1;5D,
kLFT6=\E[>1;6D, kLFT7=\E[>1;7D, kRIT3=\E[>1;3C,
kRIT4=\E[>1;4C, kRIT5=\E[>1;5C, kRIT6=\E[>1;6C,
kRIT7=\E[>1;7C, kUP=\E[>1;2A, kUP3=\E[>1;3A,
kUP4=\E[>1;4A, kUP5=\E[>1;5A, kUP6=\E[>1;6A,
kUP7=\E[>1;7A,
xterm+pcc2|fragment with modifyCursorKeys:2,
kLFT=\E[1;2D, kRIT=\E[1;2C, kind=\E[1;2B, kri=\E[1;2A,
kDN=\E[1;2B, kDN5=\E[1;5B, kDN6=\E[1;6B, kLFT5=\E[1;5D,
kLFT6=\E[1;6D, kRIT5=\E[1;5C, kRIT6=\E[1;6C, kUP=\E[1;2A,
kUP5=\E[1;5A, kUP6=\E[1;6A,
kDN=\E[1;2B, kDN3=\E[1;3B, kDN4=\E[1;4B, kDN5=\E[1;5B,
kDN6=\E[1;6B, kDN7=\E[1;7B, kLFT3=\E[1;3D, kLFT4=\E[1;4D,
kLFT5=\E[1;5D, kLFT6=\E[1;6D, kLFT7=\E[1;7D,
kRIT3=\E[1;3C, kRIT4=\E[1;4C, kRIT5=\E[1;5C,
kRIT6=\E[1;6C, kRIT7=\E[1;7C, kUP=\E[1;2A, kUP3=\E[1;3A,
kUP4=\E[1;4A, kUP5=\E[1;5A, kUP6=\E[1;6A, kUP7=\E[1;7A,
xterm+pcc1|fragment with modifyCursorKeys:1,
kLFT=\E[2D, kRIT=\E[2C, kind=\E[2B, kri=\E[2A, kDN=\E[2B,
kDN5=\E[5B, kDN6=\E[6B, kLFT5=\E[5D, kLFT6=\E[6D,
kRIT5=\E[5C, kRIT6=\E[6C, kUP=\E[2A, kUP5=\E[5A,
kUP6=\E[6A,
kDN3=\E[3B, kDN4=\E[4B, kDN5=\E[5B, kDN6=\E[6B, kDN7=\E[7B,
kLFT3=\E[3D, kLFT4=\E[4D, kLFT5=\E[5D, kLFT6=\E[6D,
kLFT7=\E[7D, kRIT3=\E[3C, kRIT4=\E[4C, kRIT5=\E[5C,
kRIT6=\E[6C, kRIT7=\E[7C, kUP=\E[2A, kUP3=\E[3A,
kUP4=\E[4A, kUP5=\E[5A, kUP6=\E[6A, kUP7=\E[7A,
xterm+pcc0|fragment with modifyCursorKeys:0,
kLFT=\EO2D, kRIT=\EO2C, kind=\EO2B, kri=\EO2A, kDN=\EO2B,
kDN5=\EO5B, kDN6=\EO6B, kLFT5=\EO5D, kLFT6=\EO6D,
kRIT5=\EO5C, kRIT6=\EO6C, kUP=\EO2A, kUP5=\EO5A,
kUP6=\EO6A,
kDN3=\EO3B, kDN4=\EO4B, kDN5=\EO5B, kDN6=\EO6B, kDN7=\EO7B,
kLFT3=\EO3D, kLFT4=\EO4D, kLFT5=\EO5D, kLFT6=\EO6D,
kLFT7=\EO7D, kRIT3=\EO3C, kRIT4=\EO4C, kRIT5=\EO5C,
kRIT6=\EO6C, kRIT7=\EO7C, kUP=\EO2A, kUP3=\EO3A,
kUP4=\EO4A, kUP5=\EO5A, kUP6=\EO6A, kUP7=\EO7A,
#
# Here are corresponding fragments from xterm patch #216:
@ -3136,6 +3154,32 @@ xterm+pcf2|fragment with modifyFunctionKeys:2,
kf61=\E[1;4P, kf62=\E[1;4Q, kf63=\E[1;4R, kf7=\E[18~,
kf8=\E[19~, kf9=\E[20~,
#
# Chunks from xterm #230:
xterm+pce2|fragment with modifyCursorKeys:2,
kDC=\E[3;2~, kEND=\E[1;2F, kHOM=\E[1;2H, kIC=\E[2;2~,
kNXT=\E[6;2~, kPRV=\E[5;2~, kich1=\E[2~, knp=\E[6~,
kpp=\E[5~, kDC3=\E[3;3~, kDC4=\E[3;4~, kDC5=\E[3;5~,
kDC6=\E[3;6~, kDC7=\E[3;7~, kEND3=\E[1;3F, kEND4=\E[1;4F,
kEND5=\E[1;5F, kEND6=\E[1;6F, kEND7=\E[1;7F,
kHOM3=\E[1;3H, kHOM4=\E[1;4H, kHOM5=\E[1;5H,
kHOM6=\E[1;6H, kHOM7=\E[1;7H, kIC3=\E[2;3~, kIC4=\E[2;4~,
kIC5=\E[2;5~, kIC6=\E[2;6~, kIC7=\E[2;7~, kNXT3=\E[6;3~,
kNXT4=\E[6;4~, kNXT5=\E[6;5~, kNXT6=\E[6;6~,
kNXT7=\E[6;7~, kPRV3=\E[5;3~, kPRV4=\E[5;4~,
kPRV5=\E[5;5~, kPRV6=\E[5;6~, kPRV7=\E[5;7~,
use=xterm+edit,
xterm+edit|fragment for 6-key editing-keypad,
kdch1=\E[3~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~,
use=xterm+pc+edit,
xterm+pc+edit|fragment for pc-style editing keypad,
kend=\E[4~, khome=\E[1~,
xterm+vt+edit|fragment for vt220-style editing keypad,
kfnd=\E[1~, kslt=\E[4~,
#
# Those chunks use the new-style (the xterm oldFunctionKeys resource is false).
# Alternatively, the same scheme with old-style function keys as in xterm-r6
# is shown here (because that is used in mrxvt and mlterm):
@ -3163,8 +3207,8 @@ xterm-basic|modern xterm terminal emulator - common,
flash=\E[?5h$<100/>\E[?5l, home=\E[H, hpa=\E[%i%p1%dG,
ht=^I, hts=\EH, ich=\E[%p1%d@, il=\E[%p1%dL, il1=\E[L,
ind=^J, invis=\E[8m, is2=\E[!p\E[?3;4l\E[4l\E>, kbs=^H,
kdch1=\E[3~, kmous=\E[M, mc0=\E[i, mc4=\E[4i, mc5=\E[5i,
meml=\El, memu=\Em, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM,
kmous=\E[M, mc0=\E[i, mc4=\E[4i, mc5=\E[5i, meml=\El,
memu=\Em, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM,
rmacs=\E(B, rmam=\E[?7l, rmcup=\E[?1049l, rmir=\E[4l,
rmkx=\E[?1l\E>, rmm=\E[?1034l, rmso=\E[27m, rmul=\E[24m,
rs1=\Ec, rs2=\E[!p\E[?3;4l\E[4l\E>, sc=\E7,
@ -3310,7 +3354,8 @@ xterm-vt220|xterm emulating vt220,
kf17=\E[31~, kf18=\E[32~, kf19=\E[33~, kf20=\E[34~,
kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
khome=\E[1~, kich1=\E[2~, kmous=\E[M, knp=\E[6~, kpp=\E[5~,
use=xterm-basic, use=vt220+keypad,
use=xterm+app, use=xterm+edit, use=xterm-basic,
use=vt220+keypad,
xterm-vt52|xterm emulating dec vt52,
cols#80, it#8, lines#24,
@ -3321,11 +3366,11 @@ xterm-vt52|xterm emulating dec vt52,
kcuf1=\EC, kcuu1=\EA, nel=^M^J, ri=\EI, rmacs=\EG, smacs=\EF,
xterm-noapp|xterm with cursor keys in normal mode,
kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, rmcup@,
rmkx=\E>, smcup@, smkx=\E=, use=xterm,
rmcup@, rmkx=\E>, smcup@, smkx=\E=, use=xterm+noapp,
use=xterm,
xterm-24|vs100|xterms|xterm terminal emulator (X Window System),
lines#24, use=xterm,
lines#24, use=xterm-old,
# This is xterm for ncurses.
xterm|xterm terminal emulator (X Window System),
@ -3349,7 +3394,7 @@ xterm+sl-twm|access X title line (pacify twm-descended window managers),
#
# xterm with bold instead of underline
xterm-bold|xterm terminal emulator (X11R6 Window System) standout w/bold,
smso=\E[7m, smul=\E[1m, use=xterm,
smso=\E[7m, smul=\E[1m, use=xterm-old,
# (kterm: this had extension capabilities ":KJ:TY=ascii:" -- esr)
# (kterm should not invoke DEC Graphics as the alternate character set
# -- Kenji Rikitake)
@ -21607,6 +21652,15 @@ v3220|LANPAR Vision II model 3220/3221/3222,
# 2007-11-03
# * correct acsc strings for h19 and z100 (Benjamin Sittler)
#
# 2007-11-11
# * use xterm-xf86-v44 for "xterm-xfree86", reflecting changes to
# xterm starting with patch #216 -TD
# * make legacy xterm entries such as xterm-24 inherit from xterm-old,
# to match xterm #230 -TD
# * extend xterm+pccX entries to match xterm #230 -TD
# * add xterm+app, xterm+noapp, from xterm #230 -TD
# * add/use xterm+pce2 from xterm #230, in xterm+pcfkeys -TD
#
# The following sets edit modes for GNU EMACS.
# Local Variables:
# fill-prefix:"\t"

View File

@ -2,10 +2,10 @@
#
# MKlib_gen.sh -- generate sources from curses.h macro definitions
#
# ($Id: MKlib_gen.sh,v 1.29 2007/08/18 13:17:14 tom Exp $)
# ($Id: MKlib_gen.sh,v 1.30 2008/01/05 23:21:10 tom Exp $)
#
##############################################################################
# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. #
# Copyright (c) 1998-2007,2008 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"), #
@ -422,4 +422,5 @@ $preprocessor $TMP 2>/dev/null \
| sed \
-e 's/^.*T_CALLED.*returnCode( \([a-z].*) \));/ return \1;/' \
-e 's/^.*T_CALLED.*returnCode( \((wmove.*) \));/ return \1;/' \
-e 's/gen_//' \
| sed -f $ED4

View File

@ -1,6 +1,6 @@
# $Id: MKunctrl.awk,v 1.14 2007/07/28 21:13:21 tom Exp $
# $Id: MKunctrl.awk,v 1.21 2008/02/03 20:24:30 tom Exp $
##############################################################################
# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. #
# Copyright (c) 1998-2007,2008 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"), #
@ -27,13 +27,20 @@
# authorization. #
##############################################################################
#
# Author: Thomas E. Dickey <dickey@clark.net> 1997
# Author: Thomas E. Dickey (1997-on)
#
BEGIN {
print "/* generated by MKunctrl.awk */"
print ""
print "#include <curses.priv.h>"
print "#include <ctype.h>"
print ""
print "#if USE_WIDEC_SUPPORT"
print "#if HAVE_WCTYPE_H"
print "#include <wctype.h>"
print "#endif"
print "#endif"
print ""
print "#undef unctrl"
print ""
@ -69,6 +76,12 @@ END {
} else if (ch >= 128 && ch < 160) {
part = sprintf("~\\%03o", ch - 64);
offset = offset + 3;
} else if (ch == 255) {
part = "~?";
offset = offset + 3;
} else if (ch >= 160) {
part = sprintf("M-\\%03o", ch - 128);
offset = offset + 4;
} else {
gap = gap " "
part = sprintf("\\%03o", ch);
@ -88,14 +101,13 @@ END {
blob = blob "\"";
print ""
print "#if NCURSES_EXT_FUNCS"
if (bigstrings) {
blob = blob "\n#if NCURSES_EXT_FUNCS"
blob = blob "\n/* printable values in 128-255 range */"
printf "static const short unctrl_c1[] = {"
} else {
printf "static const char* const unctrl_c1[] = {"
}
for ( ch = 128; ch < 160; ch++ ) {
for ( ch = 128; ch < 256; ch++ ) {
gap = ","
if ((ch % 8) == 0) {
if (ch != 128)
@ -111,7 +123,7 @@ END {
if (((ch + 1) % 8) != 0)
gap = gap " "
} else {
if (ch >= 128 && ch < 160) {
if (ch >= 128) {
printf "\"\\%03o\"", ch
gap = gap " "
}
@ -123,8 +135,7 @@ END {
}
}
print "};"
print "#endif /* NCURSES_EXT_FUNCS */"
blob = blob "\"\n#endif /* NCURSES_EXT_FUNCS */\n"
blob = blob "\"\n"
print ""
if (bigstrings) {
@ -134,22 +145,41 @@ END {
} else {
stringname = "unctrl"
}
print "\tint check = ChCharOf(ch);"
print "\tconst char *result;"
print ""
print "\tif (check >= 0 && check < (int)SIZEOF(unctrl_table)) {"
print "#if NCURSES_EXT_FUNCS"
print "\t\tif ((SP != 0)"
print "\t\t && (SP->_legacy_coding > 1)"
print "\t\t && (check >= 128)"
print "\t\t && (check < 160))"
print "\tint check = ChCharOf(ch);"
print "\tconst char *result;"
print ""
print "\tif (check >= 0 && check < (int)SIZEOF(unctrl_table)) {"
print "#if NCURSES_EXT_FUNCS"
print "\t\tif ((SP != 0)"
print "\t\t && (SP->_legacy_coding > 1)"
print "\t\t && (check >= 128)"
print "\t\t && (check < 160))"
printf "\t\t\tresult = %s_c1[check - 128];\n", stringname;
print "\t\telse"
print "#endif /* NCURSES_EXT_FUNCS */"
print "\t\telse"
print "#if USE_WIDEC_SUPPORT"
print "\t\tif ((check >= 160)"
print "\t\t && (check < 256)"
print "\t\t && ((SP != 0)"
print "\t\t && ((SP->_legacy_coding > 0)"
print "\t\t || (SP->_legacy_coding == 0"
print "\t\t && (isprint(check) || iswprint(check))))))"
printf "\t\t\tresult = %s_c1[check - 128];\n", stringname;
print "\t\telse"
print "#else"
print "\t\tif ((check >= 160)"
print "\t\t && (check < 256)"
print "\t\t && ((SP != 0)"
print "\t\t && ((SP->_legacy_coding > 0)"
print "\t\t || (SP->_legacy_coding == 0"
print "\t\t && isprint(check)))))"
printf "\t\t\tresult = %s_c1[check - 128];\n", stringname;
print "\t\telse"
print "#endif /* USE_WIDEC_SUPPORT */"
print "#endif /* NCURSES_EXT_FUNCS */"
printf "\t\t\tresult = %s_table[check];\n", stringname;
print "\t} else {"
print "\t\tresult = 0;"
print "\t}"
print "\treturn (NCURSES_CONST char *)result;"
print "}"
print "\t} else {"
print "\t\tresult = 0;"
print "\t}"
print "\treturn (NCURSES_CONST char *)result;"
print "}"
}

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. *
* Copyright (c) 1998-2006,2008 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 *
@ -36,7 +36,7 @@
#include <curses.priv.h>
#include <ctype.h>
MODULE_ID("$Id: lib_addch.c,v 1.104 2006/10/14 20:31:19 tom Exp $")
MODULE_ID("$Id: lib_addch.c,v 1.108 2008/02/03 18:50:27 tom Exp $")
static const NCURSES_CH_T blankchar = NewChar(BLANK_TEXT);
@ -219,17 +219,15 @@ _nc_build_wch(WINDOW *win, ARG_CH_T ch)
attr_t attrs = AttrOf(CHDEREF(ch));
SetChar(CHDEREF(ch), result, attrs);
WINDOW_EXT(win, addch_used) = 0;
} else {
if (len == -1) {
/*
* An error occurred. We could either discard everything,
* or assume that the error was in the previous input.
* Try the latter.
*/
TR(TRACE_VIRTPUT, ("Alert! mbrtowc returns error"));
buffer[0] = CharOf(CHDEREF(ch));
WINDOW_EXT(win, addch_used) = 1;
}
} else if (len == -1) {
/*
* An error occurred. We could either discard everything,
* or assume that the error was in the previous input.
* Try the latter.
*/
TR(TRACE_VIRTPUT, ("Alert! mbrtowc returns error"));
/* handle this with unctrl() */
WINDOW_EXT(win, addch_used) = 0;
}
return len;
}
@ -264,13 +262,16 @@ waddch_literal(WINDOW *win, NCURSES_CH_T ch)
if (WINDOW_EXT(win, addch_used) != 0 || !Charable(ch)) {
int len = _nc_build_wch(win, CHREF(ch));
if (len > 0) {
if (len >= -1) {
/* handle EILSEQ */
if (is8bits(CharOf(ch))) {
const char *s = unctrl((chtype) CharOf(ch));
if (s[1] != 0) {
return waddstr(win, s);
}
}
if (len == -1)
return waddch(win, ' ');
} else {
return OK;
}

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
* Copyright (c) 1998-2007,2008 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 *
@ -41,7 +41,7 @@
#include <curses.priv.h>
MODULE_ID("$Id: lib_getch.c,v 1.80 2007/09/29 20:39:34 tom Exp $")
MODULE_ID("$Id: lib_getch.c,v 1.82 2008/01/19 21:07:30 tom Exp $")
#include <fifo_defs.h>
@ -56,6 +56,24 @@ NCURSES_EXPORT_VAR(int)
ESCDELAY = 1000; /* max interval betw. chars in funkeys, in millisecs */
#endif
#if NCURSES_EXT_FUNCS
NCURSES_EXPORT(int)
set_escdelay(int value)
{
int code = OK;
#if USE_REENTRANT
if (SP) {
SP->_ESCDELAY = value;
} else {
code = ERR;
}
#else
ESCDELAY = value;
#endif
return code;
}
#endif
#ifdef NCURSES_WGETCH_EVENTS
#define TWAIT_MASK 7
#else

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2004,2005 Free Software Foundation, Inc. *
* Copyright (c) 1998-2005,2008 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 *
@ -43,7 +43,7 @@
#include <curses.priv.h>
#include <ctype.h>
MODULE_ID("$Id: lib_insch.c,v 1.24 2005/02/26 19:27:28 tom Exp $")
MODULE_ID("$Id: lib_insch.c,v 1.25 2008/02/03 00:14:37 tom Exp $")
/*
* Insert the given character, updating the current location to simplify
@ -95,7 +95,8 @@ _nc_insert_ch(WINDOW *win, chtype ch)
} else if (is8bits(ChCharOf(ch)) && iscntrl(ChCharOf(ch))) {
s = unctrl(ChCharOf(ch));
while (*s != '\0') {
if ((code = _nc_insert_ch(win, ChAttrOf(ch) | UChar(*s))) != OK)
code = _nc_insert_ch(win, ChAttrOf(ch) | UChar(*s));
if (code != OK)
break;
++s;
}
@ -107,8 +108,23 @@ _nc_insert_ch(WINDOW *win, chtype ch)
*/
SetChar2(wch, ch);
wch = _nc_render(win, wch);
if (_nc_build_wch(win, &wch) >= 0)
count = _nc_build_wch(win, &wch);
if (count > 0) {
code = wins_wch(win, &wch);
} else if (count == -1) {
/* handle EILSEQ */
if (is8bits(ch)) {
s = unctrl(ChCharOf(ch));
while (*s != '\0') {
code = _nc_insert_ch(win, ChAttrOf(ch) | UChar(*s));
if (code != OK)
break;
++s;
}
} else {
code = ERR;
}
}
}
#endif
break;

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
* Copyright (c) 1998-2007,2008 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 *
@ -48,7 +48,7 @@
#include <term.h> /* clear_screen, cup & friends, cur_term */
#include <tic.h>
MODULE_ID("$Id: lib_newterm.c,v 1.67 2007/04/21 20:47:32 tom Exp $")
MODULE_ID("$Id: lib_newterm.c,v 1.68 2008/01/12 20:24:40 tom Exp $")
#ifndef ONLCR /* Allows compilation under the QNX 4.2 OS */
#define ONLCR 0
@ -123,7 +123,7 @@ newterm(NCURSES_CONST char *name, FILE *ofp, FILE *ifp)
{
int value;
int errret;
int slk_format = _nc_slk_format;
int slk_format = _nc_globals.slk_format;
SCREEN *current;
SCREEN *result = 0;

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
* Copyright (c) 1998-2007,2008 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 *
@ -41,7 +41,7 @@
#include <curses.priv.h>
MODULE_ID("$Id: lib_newwin.c,v 1.42 2007/12/22 23:20:18 tom Exp $")
MODULE_ID("$Id: lib_newwin.c,v 1.44 2008/01/13 00:28:13 tom Exp $")
static WINDOW *
remove_window_from_screen(WINDOW *win)
@ -234,7 +234,7 @@ _nc_makenew(int num_lines, int num_columns, int begy, int begx, int flags)
{
pthread_mutexattr_t recattr;
memset(&recattr, 0, sizeof(recattr));
pthread_mutexattr_settype(&recattr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutexattr_settype(&recattr, PTHREAD_MUTEX_NORMAL);
pthread_mutex_init(&(wp->mutex_use_window), &recattr);
}
#endif

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
* Copyright (c) 1998-2007,2008 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 *
@ -44,7 +44,7 @@
#include <term.h> /* cur_term */
#include <tic.h>
MODULE_ID("$Id: lib_set_term.c,v 1.100 2007/09/08 21:23:43 tom Exp $")
MODULE_ID("$Id: lib_set_term.c,v 1.103 2008/02/03 20:31:08 tom Exp $")
NCURSES_EXPORT(SCREEN *)
set_term(SCREEN *screenp)
@ -221,9 +221,6 @@ extract_fgbg(char *src, int *result)
}
#endif
#define ripoff_sp _nc_prescreen.rsp
#define ripoff_stack _nc_prescreen.rippedoff
/* OS-independent screen initializations */
NCURSES_EXPORT(int)
_nc_setupscreen(int slines GCC_UNUSED,
@ -232,6 +229,7 @@ _nc_setupscreen(int slines GCC_UNUSED,
bool filtered,
int slk_format)
{
char *env;
int bottom_stolen = 0;
bool support_cookies = USE_XMC_SUPPORT;
ripoff_t *rop;
@ -504,13 +502,12 @@ _nc_setupscreen(int slines GCC_UNUSED,
_nc_init_wacs();
SP->_screen_acs_fix = (_nc_unicode_locale() && _nc_locale_breaks_acs());
{
char *env = _nc_get_locale();
SP->_legacy_coding = ((env == 0)
|| !strcmp(env, "C")
|| !strcmp(env, "POSIX"));
}
#endif
env = _nc_get_locale();
SP->_legacy_coding = ((env == 0)
|| !strcmp(env, "C")
|| !strcmp(env, "POSIX"));
T(("legacy-coding %d", SP->_legacy_coding));
_nc_idcok = TRUE;
_nc_idlok = FALSE;
@ -568,10 +565,12 @@ _nc_setupscreen(int slines GCC_UNUSED,
? SP->_lines_avail - count
: 0),
0);
if (w)
if (w) {
rop->win = w;
rop->hook(w, scolumns);
else
} else {
returnCode(ERR);
}
if (rop->line < 0)
bottom_stolen += count;
else
@ -622,6 +621,7 @@ _nc_ripoffline(int line, int (*init) (WINDOW *, int))
NCURSES_EXPORT(int)
ripoffline(int line, int (*init) (WINDOW *, int))
{
START_TRACE();
T((T_CALLED("ripoffline(%d,%p)"), line, init));
if (line == 0)

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2004,2005 Free Software Foundation, Inc. *
* Copyright (c) 1998-2005,2008 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 *
@ -45,7 +45,7 @@
#include <ctype.h>
#include <term.h> /* num_labels, label_*, plab_norm */
MODULE_ID("$Id: lib_slk.c,v 1.30 2005/01/08 21:56:36 tom Exp $")
MODULE_ID("$Id: lib_slk.c,v 1.31 2008/01/12 20:21:00 tom Exp $")
/*
* We'd like to move these into the screen context structure, but cannot,
@ -56,7 +56,6 @@ _nc_slk_format = 0; /* one more than format specified in slk_init() */
/*
* Paint the info line for the PC style SLK emulation.
*
*/
static void
slk_paint_info(WINDOW *win)
@ -119,12 +118,12 @@ _nc_slk_initialize(WINDOW *stwin, int cols)
SP->_slk->maxlab = ((num_labels > 0)
? num_labels
: MAX_SKEY(_nc_slk_format));
: MAX_SKEY(_nc_globals.slk_format));
SP->_slk->maxlen = ((num_labels > 0)
? label_width * label_height
: MAX_SKEY_LEN(_nc_slk_format));
SP->_slk->labcnt = ((SP->_slk->maxlab < MAX_SKEY(_nc_slk_format))
? MAX_SKEY(_nc_slk_format)
: MAX_SKEY_LEN(_nc_globals.slk_format));
SP->_slk->labcnt = ((SP->_slk->maxlab < MAX_SKEY(_nc_globals.slk_format))
? MAX_SKEY(_nc_globals.slk_format)
: SP->_slk->maxlab);
if (SP->_slk->maxlen <= 0
@ -148,7 +147,7 @@ _nc_slk_initialize(WINDOW *stwin, int cols)
memset(SP->_slk->ent[i].form_text, ' ', max_length);
SP->_slk->ent[i].visible = (i < SP->_slk->maxlab);
}
if (_nc_slk_format >= 3) { /* PC style */
if (_nc_globals.slk_format >= 3) { /* PC style */
int gap = (cols - 3 * (3 + 4 * max_length)) / 2;
if (gap < 1)
@ -161,7 +160,7 @@ _nc_slk_initialize(WINDOW *stwin, int cols)
}
slk_paint_info(stwin);
} else {
if (_nc_slk_format == 2) { /* 4-4 */
if (_nc_globals.slk_format == 2) { /* 4-4 */
int gap = cols - (SP->_slk->maxlab * max_length) - 6;
if (gap < 1)
@ -172,7 +171,7 @@ _nc_slk_initialize(WINDOW *stwin, int cols)
x += (i == 3) ? gap : 1;
}
} else {
if (_nc_slk_format == 1) { /* 1 -> 3-2-3 */
if (_nc_globals.slk_format == 1) { /* 1 -> 3-2-3 */
int gap = (cols - (SP->_slk->maxlab * max_length) - 5)
/ 2;
@ -196,8 +195,8 @@ _nc_slk_initialize(WINDOW *stwin, int cols)
* per default no SLK keys and may call slk_init again to
* define a new layout. (juergen 03-Mar-1999)
*/
SP->slk_format = _nc_slk_format;
_nc_slk_format = 0;
SP->slk_format = _nc_globals.slk_format;
_nc_globals.slk_format = 0;
returnCode(res);
}

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2001,2006 Free Software Foundation, Inc. *
* Copyright (c) 1998-2006,2007 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 *
@ -29,6 +29,8 @@
/****************************************************************************
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
* and: Juergen Pfeifer 1996-1999 *
* and: Thomas E. Dickey 1996-on *
****************************************************************************/
/*
@ -38,24 +40,27 @@
*/
#include <curses.priv.h>
MODULE_ID("$Id: lib_slkclear.c,v 1.9 2006/05/27 19:21:19 tom Exp $")
MODULE_ID("$Id: lib_slkclear.c,v 1.10 2007/12/29 17:51:47 tom Exp $")
NCURSES_EXPORT(int)
slk_clear(void)
{
int rc = ERR;
T((T_CALLED("slk_clear()")));
if (SP == NULL || SP->_slk == NULL)
returnCode(ERR);
SP->_slk->hidden = TRUE;
/* For simulated SLK's it's looks much more natural to
inherit those attributes from the standard screen */
SP->_slk->win->_nc_bkgd = stdscr->_nc_bkgd;
WINDOW_ATTRS(SP->_slk->win) = WINDOW_ATTRS(stdscr);
if (SP->_slk->win == stdscr) {
returnCode(OK);
} else {
werase(SP->_slk->win);
returnCode(wrefresh(SP->_slk->win));
if (SP != NULL && SP->_slk != NULL) {
SP->_slk->hidden = TRUE;
/* For simulated SLK's it looks much more natural to
inherit those attributes from the standard screen */
SP->_slk->win->_nc_bkgd = stdscr->_nc_bkgd;
WINDOW_ATTRS(SP->_slk->win) = WINDOW_ATTRS(stdscr);
if (SP->_slk->win == stdscr) {
rc = OK;
} else {
werase(SP->_slk->win);
rc = wrefresh(SP->_slk->win);
}
}
returnCode(rc);
}

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2000,2007 Free Software Foundation, Inc. *
* Copyright (c) 1998-2007,2008 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 *
@ -29,6 +29,7 @@
/****************************************************************************
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
* and: Thomas E. Dickey 1996-on *
****************************************************************************/
/*
@ -38,7 +39,7 @@
*/
#include <curses.priv.h>
MODULE_ID("$Id: lib_slkinit.c,v 1.6 2007/05/12 18:14:21 tom Exp $")
MODULE_ID("$Id: lib_slkinit.c,v 1.7 2008/01/12 20:23:39 tom Exp $")
NCURSES_EXPORT(int)
slk_init(int format)
@ -46,9 +47,9 @@ slk_init(int format)
int code = ERR;
T((T_CALLED("slk_init(%d)"), format));
if (format >= 0 && format <= 3 && !_nc_slk_format) {
_nc_slk_format = 1 + format;
code = _nc_ripoffline(-SLK_LINES(_nc_slk_format), _nc_slk_initialize);
if (format >= 0 && format <= 3 && !_nc_globals.slk_format) {
_nc_globals.slk_format = 1 + format;
code = _nc_ripoffline(-SLK_LINES(_nc_globals.slk_format), _nc_slk_initialize);
}
returnCode(code);
}

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
* Copyright (c) 1998-2007,2008 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 *
@ -41,7 +41,7 @@
#include <curses.priv.h>
#include <term.h>
MODULE_ID("$Id: resizeterm.c,v 1.24 2007/12/22 23:20:31 tom Exp $")
MODULE_ID("$Id: resizeterm.c,v 1.30 2008/01/12 22:26:56 tom Exp $")
#define stolen_lines (screen_lines - SP->_lines_avail)
@ -81,6 +81,10 @@ show_window_sizes(const char *name)
}
#endif
/*
* Return true if the given dimensions do not match the internal terminal
* structure's size.
*/
NCURSES_EXPORT(bool)
is_term_resized(int ToLines, int ToCols)
{
@ -91,6 +95,48 @@ is_term_resized(int ToLines, int ToCols)
|| ToCols != screen_columns));
}
/*
*/
static ripoff_t *
ripped_window(WINDOW *win)
{
ripoff_t *result = 0;
ripoff_t *rop;
if (win != 0) {
for (rop = ripoff_stack; (rop - ripoff_stack) < N_RIPS; rop++) {
if (rop->win == win && rop->line != 0) {
result = rop;
break;
}
}
}
return result;
}
/*
* Returns the number of lines from the bottom for the beginning of a ripped
* off window.
*/
static int
ripped_bottom(WINDOW *win)
{
int result = 0;
ripoff_t *rop;
if (win != 0) {
for (rop = ripoff_stack; (rop - ripoff_stack) < N_RIPS; rop++) {
if (rop->line < 0) {
result -= rop->line;
if (rop->win == win) {
break;
}
}
}
}
return result;
}
/*
* Return the number of levels of child-windows under the current window.
*/
@ -141,33 +187,45 @@ adjust_window(WINDOW *win, int ToLines, int ToCols, int stolen EXTRA_DCLS)
int bottom = CurLines + SP->_topstolen - stolen;
int myLines = win->_maxy + 1;
int myCols = win->_maxx + 1;
ripoff_t *rop = ripped_window(win);
T((T_CALLED("adjust_window(%p,%d,%d) currently %ldx%ld at %ld,%ld"),
T((T_CALLED("adjust_window(%p,%d,%d)%s depth %d/%d currently %ldx%ld at %ld,%ld"),
win, ToLines, ToCols,
(rop != 0) ? " (rip)" : "",
parent_depth(win),
child_depth(win),
(long) getmaxy(win), (long) getmaxx(win),
(long) getbegy(win), (long) getbegx(win)));
(long) getbegy(win) + win->_yoffset, (long) getbegx(win)));
if (win->_begy >= bottom) {
if (rop != 0 && rop->line < 0) {
/*
* If it is a ripped-off window at the bottom of the screen, simply
* move it to the same relative position.
*/
win->_begy = ToLines - ripped_bottom(win) - 0 - win->_yoffset;
} else if (win->_begy >= bottom) {
/*
* If it is below the bottom of the new screen, move up by the same
* amount that the screen shrank.
*/
win->_begy += (ToLines - CurLines);
} else {
if (myLines == CurLines - stolen
&& ToLines != CurLines)
if (myLines == (CurLines - stolen)
&& ToLines != CurLines) {
myLines = ToLines - stolen;
else if (myLines == CurLines
&& ToLines != CurLines)
} else if (myLines == CurLines
&& ToLines != CurLines) {
myLines = ToLines;
}
}
if (myLines > ToLines)
if (myLines > ToLines) {
myLines = ToLines;
}
if (myCols > ToCols)
myCols = ToCols;
if (myLines == CurLines
&& ToLines != CurLines)
myLines = ToLines;
if (myCols == CurCols
&& ToCols != CurCols)
myCols = ToCols;
@ -347,13 +405,49 @@ resizeterm(int ToLines, int ToCols)
SP->_sig_winch = FALSE;
if (is_term_resized(ToLines, ToCols)) {
#if USE_SIGWINCH
ripoff_t *rop;
bool slk_visible = (SP != 0
&& SP->_slk != 0
&& !(SP->_slk->hidden));
if (slk_visible) {
slk_clear();
}
#endif
result = resize_term(ToLines, ToCols);
#if USE_SIGWINCH
ungetch(KEY_RESIZE); /* so application can know this */
clearok(curscr, TRUE); /* screen contents are unknown */
#endif
result = resize_term(ToLines, ToCols);
/* ripped-off lines are a special case: if we did not lengthen
* them, we haven't moved them either. repaint them, too.
*
* for the rest - stdscr and other windows - the client has to
* decide which to repaint, since without panels, ncurses does
* not know which are really on top.
*/
for (rop = ripoff_stack; (rop - ripoff_stack) < N_RIPS; rop++) {
if (rop->win != stdscr
&& rop->win != 0
&& rop->line < 0) {
if (rop->hook != _nc_slk_initialize) {
touchwin(rop->win);
wnoutrefresh(rop->win);
}
}
}
/* soft-keys are a special case: we _know_ how to repaint them */
if (slk_visible) {
slk_restore();
slk_touch();
slk_refresh();
}
#endif
}
}

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 2007 Free Software Foundation, Inc. *
* Copyright (c) 2007,2008 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 *
@ -32,7 +32,7 @@
#include <curses.priv.h>
MODULE_ID("$Id: use_window.c,v 1.2 2007/10/20 19:57:55 tom Exp $")
MODULE_ID("$Id: use_window.c,v 1.3 2008/01/13 00:36:22 tom Exp $")
#ifdef USE_PTHREADS
NCURSES_EXPORT(void)
@ -43,7 +43,7 @@ _nc_lock_window(WINDOW *win)
_nc_lock_global(windowlist);
for (p = _nc_windows; p != 0; p = p->next) {
if (&(p->win) == win) {
pthread_mutex_lock(&(p->mutex_use_window));
_nc_mutex_lock(&(p->mutex_use_window));
break;
}
}
@ -58,7 +58,7 @@ _nc_unlock_window(WINDOW *win)
_nc_lock_global(windowlist);
for (p = _nc_windows; p != 0; p = p->next) {
if (&(p->win) == win) {
pthread_mutex_unlock(&(p->mutex_use_window));
_nc_mutex_unlock(&(p->mutex_use_window));
break;
}
}

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
* Copyright (c) 1998-2007,2008 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 *
@ -34,7 +34,7 @@
/*
* $Id: curses.priv.h,v 1.353 2007/12/23 00:15:38 tom Exp $
* $Id: curses.priv.h,v 1.357 2008/01/13 00:33:10 tom Exp $
*
* curses.priv.h
*
@ -314,9 +314,12 @@ color_t;
#ifdef USE_PTHREADS
#if USE_REENTRANT
#include <pthread.h>
#define _nc_lock_global(name) pthread_mutex_lock(&_nc_globals.mutex_##name)
#define _nc_try_global(name) pthread_mutex_trylock(&_nc_globals.mutex_##name)
#define _nc_unlock_global(name) pthread_mutex_unlock(&_nc_globals.mutex_##name)
extern NCURSES_EXPORT(int) _nc_mutex_lock(pthread_mutex_t *);
extern NCURSES_EXPORT(int) _nc_mutex_trylock(pthread_mutex_t *);
extern NCURSES_EXPORT(int) _nc_mutex_unlock(pthread_mutex_t *);
#define _nc_lock_global(name) _nc_mutex_lock(&_nc_globals.mutex_##name)
#define _nc_try_global(name) _nc_mutex_trylock(&_nc_globals.mutex_##name)
#define _nc_unlock_global(name) _nc_mutex_unlock(&_nc_globals.mutex_##name)
extern NCURSES_EXPORT(void) _nc_lock_window(WINDOW *);
extern NCURSES_EXPORT(void) _nc_unlock_window(WINDOW *);
@ -417,6 +420,7 @@ typedef struct _SLK {
#endif /* USE_TERMLIB */
typedef struct {
WINDOW *win; /* the window used in the hook */
int line; /* lines to take, < 0 => from bottom*/
int (*hook)(WINDOW *, int); /* callback for user */
} ripoff_t;
@ -539,6 +543,8 @@ typedef struct {
char *first_name;
char **keyname_table;
int slk_format;
char *safeprint_buf;
size_t safeprint_used;
@ -623,6 +629,9 @@ typedef struct {
#endif
} NCURSES_PRESCREEN;
#define ripoff_sp _nc_prescreen.rsp
#define ripoff_stack _nc_prescreen.rippedoff
extern NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen;
/*
@ -1603,7 +1612,6 @@ extern NCURSES_EXPORT_VAR(SCREEN *) SP;
#define screen_lines SP->_lines
#define screen_columns SP->_columns
extern NCURSES_EXPORT_VAR(int) _nc_slk_format; /* != 0 if slk_init() called */
extern NCURSES_EXPORT(int) _nc_slk_initialize (WINDOW *, int);
/*

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2005,2007 Free Software Foundation, Inc. *
* Copyright (c) 1998-2007,2008 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 *
@ -41,7 +41,7 @@
#include <curses.priv.h>
MODULE_ID("$Id: lib_data.c,v 1.34 2007/10/20 21:49:10 tom Exp $")
MODULE_ID("$Id: lib_data.c,v 1.39 2008/01/13 01:21:59 tom Exp $")
/*
* OS/2's native linker complains if we don't initialize public data when
@ -131,6 +131,8 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = {
NULL, /* first_name */
NULL, /* keyname_table */
0, /* slk_format */
NULL, /* safeprint_buf */
0, /* safeprint_used */
@ -177,10 +179,10 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = {
#endif /* TRACE */
#ifdef USE_PTHREADS
PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP, /* mutex_set_SP */
PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP, /* mutex_use_screen */
PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP, /* mutex_use_window */
PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP, /* mutex_windowlist */
PTHREAD_MUTEX_INITIALIZER, /* mutex_set_SP */
PTHREAD_MUTEX_INITIALIZER, /* mutex_use_screen */
PTHREAD_MUTEX_INITIALIZER, /* mutex_use_window */
PTHREAD_MUTEX_INITIALIZER, /* mutex_windowlist */
PTHREAD_MUTEX_INITIALIZER, /* mutex_tst_tracef */
PTHREAD_MUTEX_INITIALIZER, /* mutex_tracef */
0, /* nested_tracef */
@ -191,7 +193,7 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = {
#define STACK_FRAME_0s { STACK_FRAME_0 }
#define NUM_VARS_0s { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }
#define RIPOFF_0 { 0,0 }
#define RIPOFF_0 { 0,0,0 }
#define RIPOFF_0s { RIPOFF_0 }
NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen = {
@ -231,3 +233,24 @@ NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen = {
#endif
};
/* *INDENT-ON* */
/******************************************************************************/
#ifdef USE_PTHREADS
NCURSES_EXPORT(int)
_nc_mutex_lock(pthread_mutex_t *obj)
{
return pthread_mutex_lock(obj);
}
NCURSES_EXPORT(int)
_nc_mutex_trylock(pthread_mutex_t *obj)
{
return pthread_mutex_trylock(obj);
}
NCURSES_EXPORT(int)
_nc_mutex_unlock(pthread_mutex_t *obj)
{
return pthread_mutex_unlock(obj);
}
#endif /* USE_PTHREADS */

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
* Copyright (c) 1998-2007,2008 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 *
@ -53,7 +53,7 @@
#include <term.h> /* lines, columns, cur_term */
MODULE_ID("$Id: lib_setup.c,v 1.100 2007/09/01 20:58:26 tom Exp $")
MODULE_ID("$Id: lib_setup.c,v 1.102 2008/01/19 21:07:45 tom Exp $")
/****************************************************************************
*
@ -99,6 +99,9 @@ MODULE_ID("$Id: lib_setup.c,v 1.100 2007/09/01 20:58:26 tom Exp $")
# endif
#endif
/*
* Wrap global variables in this module.
*/
#if USE_REENTRANT
NCURSES_EXPORT(char *)
NCURSES_PUBLIC_VAR(ttytype) (void)
@ -128,6 +131,24 @@ NCURSES_EXPORT_VAR(int) COLS = 0;
NCURSES_EXPORT_VAR(int) TABSIZE = 0;
#endif
#if NCURSES_EXT_FUNCS
NCURSES_EXPORT(int)
set_tabsize(int value)
{
int code = OK;
#if USE_REENTRANT
if (SP) {
SP->_TABSIZE = value;
} else {
code = ERR;
}
#else
TABSIZE = value;
#endif
return code;
}
#endif
#if USE_SIGWINCH
/*
* If we have a pending SIGWINCH, set the flag in each screen.

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
* Copyright (c) 1998-2007,2008 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 *
@ -42,7 +42,7 @@
#include <dump_entry.h>
MODULE_ID("$Id: infocmp.c,v 1.94 2007/11/17 23:34:26 tom Exp $")
MODULE_ID("$Id: infocmp.c,v 1.96 2008/01/19 21:08:07 tom Exp $")
#define L_CURL "{"
#define R_CURL "}"
@ -1215,6 +1215,8 @@ dump_termtype(TERMTYPE *term)
NUM_STRINGS(term) - STRCOUNT);
(void) printf("#endif /* NCURSES_XNAMES */\n");
#else
(void) term;
#endif /* NCURSES_XNAMES */
(void) printf("\t%s\n", R_CURL);
}
@ -1450,7 +1452,7 @@ main(int argc, char *argv[])
}
}
maxterms = (argc + 1 - optind);
maxterms = (argc + 2 - optind);
tfile = typeMalloc(path, maxterms);
tname = typeCalloc(char *, maxterms);
entries = typeCalloc(ENTRY, maxterms);

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
* Copyright (c) 1998-2007,2008 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 *
@ -44,7 +44,7 @@
#include <hashed_db.h>
#endif
MODULE_ID("$Id: toe.c,v 1.46 2007/10/13 22:26:38 tom Exp $")
MODULE_ID("$Id: toe.c,v 1.48 2008/01/05 20:41:26 tom Exp $")
#define isDotname(name) (!strcmp(name, ".") || !strcmp(name, ".."))
@ -316,6 +316,7 @@ main(int argc, char *argv[])
bool direct_dependencies = FALSE;
bool invert_dependencies = FALSE;
bool header = FALSE;
char *report_file = 0;
int i;
int code;
int this_opt, last_opt = '?';
@ -323,7 +324,7 @@ main(int argc, char *argv[])
_nc_progname = _nc_rootname(argv[0]);
while ((this_opt = getopt(argc, argv, "0123456789ahuvUV")) != -1) {
while ((this_opt = getopt(argc, argv, "0123456789ahu:vU:V")) != -1) {
/* handle optional parameter */
if (isdigit(this_opt)) {
switch (last_opt) {
@ -349,12 +350,14 @@ main(int argc, char *argv[])
break;
case 'u':
direct_dependencies = TRUE;
report_file = optarg;
break;
case 'v':
v_opt = 1;
break;
case 'U':
invert_dependencies = TRUE;
report_file = optarg;
break;
case 'V':
puts(curses_version());
@ -365,15 +368,15 @@ main(int argc, char *argv[])
}
set_trace_level(v_opt);
if (direct_dependencies || invert_dependencies) {
if (freopen(argv[optind], "r", stdin) == 0) {
if (report_file != 0) {
if (freopen(report_file, "r", stdin) == 0) {
(void) fflush(stdout);
fprintf(stderr, "%s: can't open %s\n", _nc_progname, argv[optind]);
fprintf(stderr, "%s: can't open %s\n", _nc_progname, report_file);
ExitProgram(EXIT_FAILURE);
}
/* parse entries out of the source file */
_nc_set_source(argv[optind]);
_nc_set_source(report_file);
_nc_read_entry_source(stdin, 0, FALSE, FALSE, NULLHOOK);
}