Skip to content

Commit

Permalink
Imported Upstream version 1.06
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasDickey authored and SamB committed Feb 6, 2012
1 parent 3e6278d commit bf1cb5c
Show file tree
Hide file tree
Showing 14 changed files with 227 additions and 98 deletions.
43 changes: 43 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,46 @@
2007-08-12 Thomas Dickey <tom@crayon>

* edit.c:
as of 2007/8/12, ncurses no longer exports the data _nc_info_hash_table.
Instead, use the function _nc_get_hash_table(), which is in ncurses 5.0

2007-08-11 Thomas Dickey <tom@crayon>

* HISTORY:
tweak to build with latest ncurses (does not rely on new api's)

2007-04-29 Thomas Dickey <tom@crayon>

* HISTORY, tack.h: mark 1.05

* configure: regen'd

* configure.in: update LIB_LINK symbol to match CF_WITH_LIBTOOL change

* tack.h: use SIG_ATOMIC_T

* sysdep.c:
move include of <signal.h> to tack.h so SIG_ATOMIC_T definition works.

* tack.c: use EXIT_FAILURE/EXIT_SUCCESS

* sysdep.c: use EXIT_FAILURE/EXIT_SUCCESS
use SIG_ATOMIC_T

* output.c: add braces for readability

* tack.h: trim whitespace

* scan.c, init.c: use EXIT_FAILURE/EXIT_SUCCESS

* configure.in, aclocal.m4: add CF_SIG_ATOMIC_T

* control.c: use SIG_ATOMIC_T

* Makefile.in:
update $(LINK) to work with ncurses after importing CF_WITH_LIBTOOL change
that moved $(CC) into $(LIBTOOL_LINK) symbol.

2007-04-08 Thomas Dickey <tom@crayon>

* configure: regen'd
Expand Down
2 changes: 2 additions & 0 deletions HISTORY
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

Current history:

2007/08/11 1.06 Updates to build with ncurses 5.6 patch 20070811
2007/04/29 1.05 Updates to build with ncurses 5.6 patch 20070428
2007/04/08 1.04 Fixes from Coverity scan for ncurses 5.6
2007/01/28 1.03 Separate releases of tack from ncurses tree.
2006/11/25 Fixes for ncurses tparm() prototype.
Expand Down
4 changes: 2 additions & 2 deletions Makefile.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $Id: Makefile.in,v 1.46 2007/04/08 15:57:15 tom Exp $
# $Id: Makefile.in,v 1.47 2007/04/29 20:49:12 tom Exp $
##############################################################################
# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. #
# #
Expand Down Expand Up @@ -98,7 +98,7 @@ ABI_VERSION = @cf_cv_abi_version@
LOCAL_LIBDIR = @top_builddir@/lib

LD = @LD@
LINK = @LINK_PROGS@ $(LIBTOOL_LINK) $(CC)
LINK = @LINK_PROGS@ $(LIBTOOL_LINK)
LDFLAGS = @EXTRA_LDFLAGS@ \
@TICS_ARGS@ @TINFO_ARGS@ @LDFLAGS@ @LD_MODEL@ @LIBS@

Expand Down
41 changes: 38 additions & 3 deletions aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dnl sale, use or other dealings in this Software without prior written *
dnl authorization. *
dnl***************************************************************************
dnl
dnl $Id: aclocal.m4,v 1.4 2007/04/08 13:58:18 tom Exp $
dnl $Id: aclocal.m4,v 1.5 2007/04/29 23:09:14 tom Exp $
dnl
dnl Author: Thomas E. Dickey
dnl
Expand Down Expand Up @@ -1203,7 +1203,7 @@ CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_nculib_root)
AC_DEFINE_UNQUOTED($cf_nculib_ROOT)
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_NCURSES_VERSION version: 11 updated: 2003/11/06 19:59:57
dnl CF_NCURSES_VERSION version: 12 updated: 2007/04/28 09:15:55
dnl ------------------
dnl Check for the version of ncurses, to aid in reporting bugs, etc.
dnl Call CF_CURSES_CPPFLAGS first, or CF_NCURSES_CPPFLAGS. We don't use
Expand Down Expand Up @@ -1234,7 +1234,7 @@ int main()
make an error
# endif
#endif
exit(0);
${cf_cv_main_return-return}(0);
}],[
cf_cv_ncurses_version=`cat $cf_tempfile`],,[
Expand Down Expand Up @@ -1494,6 +1494,41 @@ $1=`echo "$2" | \
-e 's/-[[UD]]$3\(=[[^ ]]*\)\?[$]//g'`
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_SIG_ATOMIC_T version: 2 updated: 2005/09/18 17:27:12
dnl ---------------
dnl signal handler, but there are some gcc depedencies in that recommendation.
dnl Try anyway.
AC_DEFUN([CF_SIG_ATOMIC_T],
[
AC_MSG_CHECKING(for signal global datatype)
AC_CACHE_VAL(cf_cv_sig_atomic_t,[
for cf_type in \
"volatile sig_atomic_t" \
"sig_atomic_t" \
"int"
do
AC_TRY_COMPILE([
#include <sys/types.h>
#include <signal.h>
#include <stdio.h>
extern $cf_type x;
$cf_type x;
static void handler(int sig)
{
x = 5;
}],
[signal(SIGINT, handler);
x = 1],
[cf_cv_sig_atomic_t=$cf_type],
[cf_cv_sig_atomic_t=no])
test "$cf_cv_sig_atomic_t" != no && break
done
])
AC_MSG_RESULT($cf_cv_sig_atomic_t)
test "$cf_cv_sig_atomic_t" != no && AC_DEFINE_UNQUOTED(SIG_ATOMIC_T, $cf_cv_sig_atomic_t)
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_SUBDIR_PATH version: 4 updated: 2006/11/18 17:13:19
dnl --------------
dnl Construct a search-list for a nonstandard header/lib-file
Expand Down
60 changes: 56 additions & 4 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,7 @@ LIBTOOL=""
LIB_CLEAN=""
LIB_COMPILE=""
LIB_INSTALL=""
LIB_LINK=""
LIB_LINK='$(CC)'
LIB_SUFFIX=""
LIB_UNINSTALL=""
LINK_PROGS=""
Expand Down Expand Up @@ -2754,7 +2754,7 @@ int main()
make an error
# endif
#endif
exit(0);
${cf_cv_main_return-return}(0);
}
EOF
if { (eval echo configure:2761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
Expand Down Expand Up @@ -3678,7 +3678,7 @@ int main()
make an error
# endif
#endif
exit(0);
${cf_cv_main_return-return}(0);
}
EOF
if { (eval echo configure:3685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
Expand Down Expand Up @@ -4304,7 +4304,7 @@ int main()
make an error
# endif
#endif
exit(0);
${cf_cv_main_return-return}(0);
}
EOF
if { (eval echo configure:4311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
Expand Down Expand Up @@ -5717,6 +5717,58 @@ EOF



echo $ac_n "checking for signal global datatype""... $ac_c" 1>&6
echo "configure:5722: checking for signal global datatype" >&5
if eval "test \"`echo '$''{'cf_cv_sig_atomic_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else

for cf_type in \
"volatile sig_atomic_t" \
"sig_atomic_t" \
"int"
do
cat > conftest.$ac_ext <<EOF
#line 5733 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
#include <stdio.h>
extern $cf_type x;
$cf_type x;
static void handler(int sig)
{
x = 5;
}
int main() {
signal(SIGINT, handler);
x = 1
; return 0; }
EOF
if { (eval echo configure:5751: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cf_cv_sig_atomic_t=$cf_type
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
cf_cv_sig_atomic_t=no
fi
rm -f conftest*
test "$cf_cv_sig_atomic_t" != no && break
done

fi

echo "$ac_t""$cf_cv_sig_atomic_t" 1>&6
test "$cf_cv_sig_atomic_t" != no && cat >> confdefs.h <<EOF
#define SIG_ATOMIC_T $cf_cv_sig_atomic_t
EOF



TICS_ARGS="$LIBS"
LIBS=

Expand Down
5 changes: 3 additions & 2 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dnl***************************************************************************
dnl
dnl Author: Thomas E. Dickey 2007
dnl
dnl $Id: configure.in,v 1.5 2007/04/08 15:27:21 tom Exp $
dnl $Id: configure.in,v 1.7 2007/04/29 23:47:26 tom Exp $
dnl This is a simple configuration-script for tack which makes it simpler to
dnl build outside the ncurses tree (provided that ncurses was configured using
dnl the --with-ticlib option).
Expand Down Expand Up @@ -69,7 +69,7 @@ LIBTOOL="" AC_SUBST(LIBTOOL)
LIB_CLEAN="" AC_SUBST(LIB_CLEAN)
LIB_COMPILE="" AC_SUBST(LIB_COMPILE)
LIB_INSTALL="" AC_SUBST(LIB_INSTALL)
LIB_LINK="" AC_SUBST(LIB_LINK)
LIB_LINK='$(CC)' AC_SUBST(LIB_LINK)
LIB_SUFFIX="" AC_SUBST(LIB_SUFFIX)
LIB_UNINSTALL="" AC_SUBST(LIB_UNINSTALL)
LINK_PROGS="" AC_SUBST(LINK_PROGS)
Expand Down Expand Up @@ -160,6 +160,7 @@ strstr \
)

CF_SYS_TIME_SELECT
CF_SIG_ATOMIC_T

TICS_ARGS="$LIBS"
LIBS=
Expand Down
4 changes: 2 additions & 2 deletions control.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <sys/time.h>
#endif

MODULE_ID("$Id: control.c,v 1.9 2006/06/24 21:27:53 tom Exp $")
MODULE_ID("$Id: control.c,v 1.10 2007/04/29 23:08:35 tom Exp $")

/* terminfo test program control subroutines */

Expand All @@ -42,7 +42,7 @@ char txt_longer_test_time[80]; /* +) use longer time */
char txt_shorter_test_time[80]; /* -) use shorter time */
static int pad_test_duration = 1; /* number of seconds for a pad test */
int auto_pad_mode; /* run the time tests */
int no_alarm_event; /* TRUE if the alarm has not gone off yet */
SIG_ATOMIC_T no_alarm_event; /* TRUE if the alarm has not gone off yet */
unsigned long usec_run_time; /* length of last test in microseconds */
static MY_TIMER stop_watch[MAX_TIMERS]; /* Hold the start timers */

Expand Down
16 changes: 8 additions & 8 deletions edit.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <time.h>
#include <tic.h>

MODULE_ID("$Id: edit.c,v 1.12 2007/04/08 15:24:23 tom Exp $")
MODULE_ID("$Id: edit.c,v 1.13 2007/08/12 14:22:25 tom Exp $")

/*
* Terminfo edit features
Expand Down Expand Up @@ -285,7 +285,7 @@ show_value(
put_clear();
}
op = t->flags & 255;
if ((nt = _nc_find_entry(buf, _nc_info_hash_table))) {
if ((nt = _nc_find_entry(buf, _nc_get_hash_table(FALSE)))) {
switch (nt->nte_type) {
case BOOLEAN:
if (op == SHOW_DELETE) {
Expand Down Expand Up @@ -386,7 +386,7 @@ get_string_cap_byname(
{
struct name_table_entry const *nt;

if ((nt = _nc_find_entry(name, _nc_info_hash_table))) {
if ((nt = _nc_find_entry(name, _nc_get_hash_table(FALSE)))) {
if (nt->nte_type == STRING) {
*long_name = strfnames[nt->nte_index];
return (CUR Strings[nt->nte_index]);
Expand Down Expand Up @@ -537,7 +537,7 @@ mark_cap(
struct name_table_entry const *nt;

alloc_arrays();
if ((nt = _nc_find_entry(name, _nc_info_hash_table))) {
if ((nt = _nc_find_entry(name, _nc_get_hash_table(FALSE)))) {
switch (nt->nte_type) {
case BOOLEAN:
flag_boolean[nt->nte_index] |= flag;
Expand Down Expand Up @@ -616,7 +616,7 @@ cap_index(
if (j) {
name[j] = '\0';
if ((nt = _nc_find_entry(name,
_nc_info_hash_table)) &&
_nc_get_hash_table(FALSE))) &&
(nt->nte_type == STRING)) {
*inx++ = nt->nte_index;
}
Expand Down Expand Up @@ -816,15 +816,15 @@ edit_init(void)
/* Lookup the translated strings */
for (i = 0; i < TM_last; i++) {
if ((nt = _nc_find_entry(TM_string[i].name,
_nc_info_hash_table)) && (nt->nte_type == STRING)) {
_nc_get_hash_table(FALSE))) && (nt->nte_type == STRING)) {
TM_string[i].index = nt->nte_index;
} else {
sprintf(temp, "TM_string lookup failed for: %s",
TM_string[i].name);
ptextln(temp);
}
}
if ((nt = _nc_find_entry("xon", _nc_info_hash_table)) != 0) {
if ((nt = _nc_find_entry("xon", _nc_get_hash_table(FALSE))) != 0) {
xon_index = nt->nte_index;
}
xon_shadow = xon_xoff;
Expand Down Expand Up @@ -859,7 +859,7 @@ change_one_entry(
*chp = pad[0];
return;
}
if ((nt = _nc_find_entry(pad, _nc_info_hash_table)) &&
if ((nt = _nc_find_entry(pad, _nc_get_hash_table(FALSE))) &&
(nt->nte_type == STRING)) {
x = nt->nte_index;
current_string = CUR Strings[x];
Expand Down
6 changes: 3 additions & 3 deletions init.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <tack.h>
#include <tic.h>

MODULE_ID("$Id: init.c,v 1.9 2007/04/08 15:03:45 tom Exp $")
MODULE_ID("$Id: init.c,v 1.10 2007/04/29 23:16:11 tom Exp $")

#if NCURSES_VERSION_MAJOR >= 5 || NCURSES_VERSION_PATCH >= 981219
#define _nc_get_curterm(p) _nc_get_tty_mode(p)
Expand Down Expand Up @@ -210,12 +210,12 @@ curses_setup(
} else {
fprintf(stderr, "Terminal not found: TERM=%s\n", tty_basename);
show_usage(exec_name);
ExitProgram(1);
ExitProgram(EXIT_FAILURE);
}
}
if (status == -1) {
fprintf(stderr, "Terminfo database is inaccessible\n");
ExitProgram(1);
ExitProgram(EXIT_FAILURE);
}
#if NO_LEAKS
_nc_free_termtype(&term);
Expand Down
Loading

0 comments on commit bf1cb5c

Please sign in to comment.