From 3ce2c58251fe1353768cc630103cdb12ecc8be0a Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Sun, 14 Jun 2009 00:39:29 +0000 Subject: [PATCH] ncurses 5.7 - patch 20090613 + move definition for NCURSES_WRAPPED_VAR back to ncurses_dll.h, to make includes of term.h without curses.h work (report by "Nix"). + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). --- NEWS | 7 +++- configure | 21 +++++----- configure.in | 5 ++- dist.mk | 4 +- include/Makefile.in | 3 +- include/curses.h.in | 9 +--- include/{ncurses_dll.h => ncurses_dll.h.in} | 9 +++- ncurses/tinfo/lib_data.c | 3 +- ncurses/tty/MKexpanded.sh | 23 ++++++++--- ncurses/tty/lib_vidattr.c | 46 +++++++++++++-------- 10 files changed, 82 insertions(+), 48 deletions(-) rename include/{ncurses_dll.h => ncurses_dll.h.in} (91%) diff --git a/NEWS b/NEWS index a9750c74..70fd5511 100644 --- a/NEWS +++ b/NEWS @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.1394 2009/06/07 14:02:55 tom Exp $ +-- $Id: NEWS,v 1.1396 2009/06/13 22:13:33 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,11 @@ 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. +20090613 + + move definition for NCURSES_WRAPPED_VAR back to ncurses_dll.h, to + make includes of term.h without curses.h work (report by "Nix"). + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + 20090607 + fix a regression in lib_tputs.c, from ongoing merges. diff --git a/configure b/configure index 2410394e..1a6cd7b2 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 1.470 . +# From configure.in Revision: 1.471 . # Guess values for system-dependent variables and create Makefiles. # Generated by Autoconf 2.52.20081225. # @@ -17294,7 +17294,7 @@ else MAKE_PC_FILES="#" fi -ac_config_files="$ac_config_files include/MKterm.h.awk include/curses.head:include/curses.h.in include/termcap.h include/unctrl.h $SUB_MAKEFILES Makefile" +ac_config_files="$ac_config_files include/MKterm.h.awk include/curses.head:include/curses.h.in include/ncurses_dll.h include/termcap.h include/unctrl.h $SUB_MAKEFILES Makefile" ac_config_commands="$ac_config_commands default" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -17662,13 +17662,14 @@ do # Handling of arguments. "include/MKterm.h.awk" ) CONFIG_FILES="$CONFIG_FILES include/MKterm.h.awk" ;; "include/curses.head" ) CONFIG_FILES="$CONFIG_FILES include/curses.head:include/curses.h.in" ;; + "include/ncurses_dll.h" ) CONFIG_FILES="$CONFIG_FILES include/ncurses_dll.h" ;; "include/termcap.h" ) CONFIG_FILES="$CONFIG_FILES include/termcap.h" ;; "include/unctrl.h" ) CONFIG_FILES="$CONFIG_FILES include/unctrl.h" ;; "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;; "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;; - *) { { echo "$as_me:17671: error: invalid argument: $ac_config_target" >&5 + *) { { echo "$as_me:17672: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac @@ -18059,7 +18060,7 @@ done; } esac if test x"$ac_file" != x-; then - { echo "$as_me:18062: creating $ac_file" >&5 + { echo "$as_me:18063: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi @@ -18077,7 +18078,7 @@ echo "$as_me: creating $ac_file" >&6;} -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:18080: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:18081: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; @@ -18090,7 +18091,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;} echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:18093: error: cannot find input file: $f" >&5 + { { echo "$as_me:18094: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; @@ -18156,7 +18157,7 @@ for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue * ) ac_file_in=$ac_file.in ;; esac - test x"$ac_file" != x- && { echo "$as_me:18159: creating $ac_file" >&5 + test x"$ac_file" != x- && { echo "$as_me:18160: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the @@ -18167,7 +18168,7 @@ echo "$as_me: creating $ac_file" >&6;} -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:18170: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:18171: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; @@ -18180,7 +18181,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;} echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:18183: error: cannot find input file: $f" >&5 + { { echo "$as_me:18184: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; @@ -18238,7 +18239,7 @@ cat >>$CONFIG_STATUS <<\EOF rm -f $tmp/in if test x"$ac_file" != x-; then if cmp -s $ac_file $tmp/config.h 2>/dev/null; then - { echo "$as_me:18241: $ac_file is unchanged" >&5 + { echo "$as_me:18242: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ diff --git a/configure.in b/configure.in index 4272689d..379a705d 100644 --- a/configure.in +++ b/configure.in @@ -28,14 +28,14 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey 1995-on dnl -dnl $Id: configure.in,v 1.470 2009/03/28 18:22:39 Charles.Wilson Exp $ +dnl $Id: configure.in,v 1.471 2009/06/13 21:40:19 tom Exp $ dnl Process this file with autoconf to produce a configure script. dnl dnl See http://invisible-island.net/autoconf/ for additional information. dnl dnl --------------------------------------------------------------------------- AC_PREREQ(2.13.20020210) -AC_REVISION($Revision: 1.470 $) +AC_REVISION($Revision: 1.471 $) AC_INIT(ncurses/base/lib_initscr.c) AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin) @@ -1867,6 +1867,7 @@ AC_SUBST(MAKE_PC_FILES) AC_OUTPUT( \ include/MKterm.h.awk \ include/curses.head:include/curses.h.in \ + include/ncurses_dll.h \ include/termcap.h \ include/unctrl.h \ $SUB_MAKEFILES \ diff --git a/dist.mk b/dist.mk index abd9cb3e..18b1d166 100644 --- a/dist.mk +++ b/dist.mk @@ -25,7 +25,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: dist.mk,v 1.704 2009/06/07 13:31:18 tom Exp $ +# $Id: dist.mk,v 1.705 2009/06/13 18:19:06 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 = 7 -NCURSES_PATCH = 20090607 +NCURSES_PATCH = 20090613 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/include/Makefile.in b/include/Makefile.in index 1a48a170..59d2cfc8 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.35 2001/12/08 18:50:06 tom Exp $ +# $Id: Makefile.in,v 1.36 2009/06/13 21:42:45 tom Exp $ ############################################################################## # Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. # # # @@ -72,6 +72,7 @@ AUTO_SRC = \ curses.h \ hashsize.h \ ncurses_def.h \ + ncurses_dll.h \ parametrized.h \ term.h diff --git a/include/curses.h.in b/include/curses.h.in index 3fae546d..0220752b 100644 --- a/include/curses.h.in +++ b/include/curses.h.in @@ -32,7 +32,7 @@ * and: Thomas E. Dickey 1996-on * ****************************************************************************/ -/* $Id: curses.h.in,v 1.201 2009/05/23 21:31:35 tom Exp $ */ +/* $Id: curses.h.in,v 1.202 2009/06/13 21:44:51 tom Exp $ */ #ifndef __NCURSES_H #define __NCURSES_H @@ -110,13 +110,6 @@ #define NCURSES_REENTRANT @cf_cv_enable_reentrant@ #endif -/* - * For reentrant code, we map the various global variables into SCREEN by - * using functions to access them. - */ -#define NCURSES_PUBLIC_VAR(name) @NCURSES_WRAP_PREFIX@##name -#define NCURSES_WRAPPED_VAR(type,name) extern type NCURSES_PUBLIC_VAR(name)(void) - /* * The internal type used for window dimensions. */ diff --git a/include/ncurses_dll.h b/include/ncurses_dll.h.in similarity index 91% rename from include/ncurses_dll.h rename to include/ncurses_dll.h.in index 047d5c7d..82c9b85c 100644 --- a/include/ncurses_dll.h +++ b/include/ncurses_dll.h.in @@ -25,11 +25,18 @@ * sale, use or other dealings in this Software without prior written * * authorization. * ****************************************************************************/ -/* $Id: ncurses_dll.h,v 1.8 2009/04/04 22:26:27 tom Exp $ */ +/* $Id: ncurses_dll.h.in,v 1.8 2009/04/04 22:26:27 tom Exp $ */ #ifndef NCURSES_DLL_H_incl #define NCURSES_DLL_H_incl 1 +/* + * For reentrant code, we map the various global variables into SCREEN by + * using functions to access them. + */ +#define NCURSES_PUBLIC_VAR(name) @NCURSES_WRAP_PREFIX@##name +#define NCURSES_WRAPPED_VAR(type,name) extern type NCURSES_PUBLIC_VAR(name)(void) + /* no longer needed on cygwin or mingw, thanks to auto-import */ /* but this structure may be useful at some point for an MSVC build */ /* so, for now unconditionally define the important flags */ diff --git a/ncurses/tinfo/lib_data.c b/ncurses/tinfo/lib_data.c index 71261eda..897522d9 100644 --- a/ncurses/tinfo/lib_data.c +++ b/ncurses/tinfo/lib_data.c @@ -30,6 +30,7 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer * ****************************************************************************/ /* @@ -41,7 +42,7 @@ #include -MODULE_ID("$Id: lib_data.c,v 1.54 2009/06/06 18:46:31 tom Exp $") +MODULE_ID("$Id: lib_data.c,v 1.55 2009/06/07 14:48:25 tom Exp $") /* * OS/2's native linker complains if we don't initialize public data when diff --git a/ncurses/tty/MKexpanded.sh b/ncurses/tty/MKexpanded.sh index bf9acf21..845e7759 100755 --- a/ncurses/tty/MKexpanded.sh +++ b/ncurses/tty/MKexpanded.sh @@ -1,6 +1,6 @@ #! /bin/sh ############################################################################## -# Copyright (c) 1998-2000,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 "Software"), # @@ -29,7 +29,7 @@ # # Author: Thomas E. Dickey 1997 # -# $Id: MKexpanded.sh,v 1.11 2005/01/02 01:06:40 tom Exp $ +# $Id: MKexpanded.sh,v 1.12 2008/11/16 00:19:59 juergen Exp $ # # Script to generate 'expanded.c', a dummy source that contains functions # corresponding to complex macros used in this library. By making functions, @@ -52,6 +52,7 @@ trap "rm -f $TMP" 0 1 2 5 15 cat < #include #if NCURSES_EXPANDED @@ -76,17 +77,29 @@ NCURSES_EXPORT(void) _nc_toggle_attr_off (attr_t *S, attr_t at) { toggle_attr_off(*S,at); } +NCURSES_EXPORT(int) _nc_safe_DelCharCost (SCREEN* sp, int count) +{ + return DelCharCost(sp,count); +} NCURSES_EXPORT(int) _nc_DelCharCost (int count) { - return DelCharCost(count); + return _nc_safe_DelCharCost (CURRENT_SCREEN, count); +} +NCURSES_EXPORT(int) _nc_safe_InsCharCost (SCREEN* sp, int count) +{ + return InsCharCost(sp, count); } NCURSES_EXPORT(int) _nc_InsCharCost (int count) { - return InsCharCost(count); + return _nc_safe_InsCharCost(CURRENT_SCREEN, count); +} +NCURSES_EXPORT(void) _nc_safe_UpdateAttrs (SCREEN* sp, NCURSES_CH_T c) +{ + UpdateAttrs(sp,c); } NCURSES_EXPORT(void) _nc_UpdateAttrs (NCURSES_CH_T c) { - UpdateAttrs(c); + _nc_safe_UpdateAttrs(CURRENT_SCREEN,c); } EOF diff --git a/ncurses/tty/lib_vidattr.c b/ncurses/tty/lib_vidattr.c index cf0ca437..88f1e1a2 100644 --- a/ncurses/tty/lib_vidattr.c +++ b/ncurses/tty/lib_vidattr.c @@ -64,13 +64,12 @@ */ #include -#include #ifndef CUR -#define CUR SP_TERMTYPE +#define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_vidattr.c,v 1.56 2009/05/10 00:48:29 tom Exp $") +MODULE_ID("$Id: lib_vidattr.c,v 1.57 2009/05/23 20:46:28 tom Exp $") #define doPut(mode) \ TPUTS_TRACE(#mode); \ @@ -90,8 +89,8 @@ MODULE_ID("$Id: lib_vidattr.c,v 1.56 2009/05/10 00:48:29 tom Exp $") if ((pair != old_pair) \ || (fix_pair0 && (pair == 0)) \ || (reverse ^ ((old_attr & A_REVERSE) != 0))) { \ - NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_ARGx \ - old_pair, pair, reverse, outc); \ + NCURSES_SP_NAME(_nc_do_color)(NCURSES_SP_ARGx \ + old_pair, pair, reverse, outc); \ } \ } @@ -113,7 +112,11 @@ NCURSES_SP_NAME(vidputs) (NCURSES_SP_DCLx #endif newmode &= A_ATTRIBUTES; - T((T_CALLED("vidputs(%s)"), _traceattr(newmode))); + + T((T_CALLED("vidputs(%p,%s)"), SP_PARM, _traceattr(newmode))); + + if (!IsTermInfo(SP_PARM)) + returnCode(ERR); /* this allows us to go on whether or not newterm() has been called */ if (SP_PARM) @@ -302,29 +305,31 @@ NCURSES_SP_NAME(vidputs) (NCURSES_SP_DCLx returnCode(OK); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) -NCURSES_SP_NAME(vidattr) (NCURSES_SP_DCLx - chtype newmode) +vidputs(chtype newmode, NCURSES_OUTC outc) { - return NCURSES_SP_NAME(vidputs) (NCURSES_SP_ARGx + SetSafeOutcWrapper(outc); + return NCURSES_SP_NAME(vidputs) (CURRENT_SCREEN, newmode, - NCURSES_SP_NAME(_nc_outch)); + _nc_outc_wrapper); } +#endif -#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) -vidputs(chtype newmode, NCURSES_OUTC outc) +NCURSES_SP_NAME(vidattr) (NCURSES_SP_DCLx chtype newmode) { - SetSafeOutcWrapper(outc); - return NCURSES_SP_NAME(vidputs) (CURRENT_SCREEN, newmode, _nc_outc_wrapper); + T((T_CALLED("vidattr(%p,%s)"), SP_PARM, _traceattr(newmode))); + returnCode(NCURSES_SP_NAME(vidputs) (NCURSES_SP_ARGx + newmode, + NCURSES_SP_NAME(_nc_outch))); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) vidattr(chtype newmode) { - T((T_CALLED("vidattr(%s)"), _traceattr(newmode))); - - returnCode(vidputs(newmode, _nc_outch)); + return NCURSES_SP_NAME(vidattr) (CURRENT_SCREEN, newmode); } #endif @@ -333,6 +338,12 @@ NCURSES_SP_NAME(termattrs) (NCURSES_SP_DCL0) { chtype attrs = A_NORMAL; + T((T_CALLED("termattrs(%p)"), SP_PARM)); +#ifdef USE_TERM_DRIVER + if (HasTerminal(SP_PARM)) + attrs = CallDriver(SP_PARM, conattr); +#else + T((T_CALLED("termattrs()"))); if (enter_alt_charset_mode) attrs |= A_ALTCHARSET; @@ -364,6 +375,7 @@ NCURSES_SP_NAME(termattrs) (NCURSES_SP_DCL0) if (SP_PARM->_coloron) attrs |= A_COLOR; +#endif returnChtype(attrs); } -- 2.45.0