]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 5.7 - patch 20090613
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 14 Jun 2009 00:39:29 +0000 (00:39 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 14 Jun 2009 00:39:29 +0000 (00:39 +0000)
+ 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
configure
configure.in
dist.mk
include/Makefile.in
include/curses.h.in
include/ncurses_dll.h.in [moved from include/ncurses_dll.h with 91% similarity]
ncurses/tinfo/lib_data.c
ncurses/tty/MKexpanded.sh
ncurses/tty/lib_vidattr.c

diff --git a/NEWS b/NEWS
index a9750c74c0d4ed043086437880d17fcd6b6b4790..70fd5511c5a53449c37b269cd9d4757bcf6c5f8f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
 -- 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
 -------------------------------------------------------------------------------
 
 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.
 
 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.
 
 20090607
        + fix a regression in lib_tputs.c, from ongoing merges.
 
index 2410394e4da524c2e3d5b9e9c4463e43fee7025a..1a6cd7b2e6c6340ec5ba6010a4afde9e6b24380a 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
 #! /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.
 #
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by Autoconf 2.52.20081225.
 #
@@ -17294,7 +17294,7 @@ else
 MAKE_PC_FILES="#"
 fi
 
 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
 ac_config_commands="$ac_config_commands default"
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
   # 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" ;;
   # 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" ;;
   "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
 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
   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
 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=:)
       -) 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;;
 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 $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;;
 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
 
   * )   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
 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=:)
       -) 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;;
 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 $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;;
 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
   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\(.*[^/]\)//*[^/][^/]*/*$' \| \
 echo "$as_me: $ac_file is unchanged" >&6;}
     else
       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
index 4272689d99c9915a59e8bb0e36c0e3385b10b7eb..379a705ddcd23a4821ea12ffc37ac177ec1d1027 100644 (file)
@@ -28,14 +28,14 @@ dnl***************************************************************************
 dnl
 dnl Author: Thomas E. Dickey 1995-on
 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)
 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)
 
 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 \
 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 \
        include/termcap.h \
        include/unctrl.h \
        $SUB_MAKEFILES \
diff --git a/dist.mk b/dist.mk
index abd9cb3ecdaa9eff04aa5c5ed8d411b16052ed8b..18b1d1662add70b9b4dd99ee7f831acdccd18dee 100644 (file)
--- a/dist.mk
+++ b/dist.mk
@@ -25,7 +25,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
 # 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
 # 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
 # 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)
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 1a48a1700a86401ce2965b2ecdc5ad240ad12c22..59d2cfc8f21b012d5107db835cf1445ecb54ccb9 100644 (file)
@@ -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.                #
 #                                                                            #
 ##############################################################################
 # Copyright (c) 1998,2000,2001 Free Software Foundation, Inc.                #
 #                                                                            #
@@ -72,6 +72,7 @@ AUTO_SRC = \
        curses.h \
        hashsize.h \
        ncurses_def.h \
        curses.h \
        hashsize.h \
        ncurses_def.h \
+       ncurses_dll.h \
        parametrized.h \
        term.h
 
        parametrized.h \
        term.h
 
index 3fae546d8d816a1609f6dff1dc33b044b90ae2c7..0220752b935f3a90f531efca0ecc12f4d99d1a5c 100644 (file)
@@ -32,7 +32,7 @@
  *     and: Thomas E. Dickey                        1996-on                 *
  ****************************************************************************/
 
  *     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
 
 #ifndef __NCURSES_H
 #define __NCURSES_H
 #define NCURSES_REENTRANT @cf_cv_enable_reentrant@
 #endif
 
 #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.
  */
 /*
  * The internal type used for window dimensions.
  */
similarity index 91%
rename from include/ncurses_dll.h
rename to include/ncurses_dll.h.in
index 047d5c7d390ba97140ce0aa413d073918b9e3299..82c9b85ca542a8454d58be2c6bb405d1240fdfa8 100644 (file)
  * sale, use or other dealings in this Software without prior written       *
  * authorization.                                                           *
  ****************************************************************************/
  * 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
 
 
 #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           */
 /* 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           */
index 71261eda1077b24bcd5f3fbe2f1961a0e5fb4dd3..897522d90e3835ae39f704a8ecfe9843db797515 100644 (file)
@@ -30,6 +30,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                 *
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
  *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                                                 *
  ****************************************************************************/
 
 /*
  ****************************************************************************/
 
 /*
@@ -41,7 +42,7 @@
 
 #include <curses.priv.h>
 
 
 #include <curses.priv.h>
 
-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
 
 /*
  * OS/2's native linker complains if we don't initialize public data when
index bf9acf21aa434088e5d894bbda68d2f91cda806d..845e77592583f9a07b42e2f2f8f3abb2e8a68000 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 ##############################################################################
 #! /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"), #
 #                                                                            #
 # 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 <dickey@clark.net> 1997
 #
 #
 # Author: Thomas E. Dickey <dickey@clark.net> 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,
 #
 # 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 <<EOF
 /* generated by MKexpanded.sh */
 
 cat <<EOF
 /* generated by MKexpanded.sh */
+#define NEED_NCURSES_CH_T 1
 #include <curses.priv.h>
 #include <term.h>
 #if NCURSES_EXPANDED
 #include <curses.priv.h>
 #include <term.h>
 #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);
 }
 {
        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)
 {
 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)
 {
 }
 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)
 {
 }
 NCURSES_EXPORT(void) _nc_UpdateAttrs (NCURSES_CH_T c)
 {
-       UpdateAttrs(c);
+       _nc_safe_UpdateAttrs(CURRENT_SCREEN,c);
 }
 EOF
 
 }
 EOF
 
index cf0ca4379e7b9f749cb733ac1f0e92db2489dadb..88f1e1a246656134ad30cd55b28d28a666e0f853 100644 (file)
  */
 
 #include <curses.priv.h>
  */
 
 #include <curses.priv.h>
-#include <term.h>
 
 #ifndef CUR
 
 #ifndef CUR
-#define CUR SP_TERMTYPE 
+#define CUR SP_TERMTYPE
 #endif
 
 #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); \
 
 #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))) { \
                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;
 #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)
 
     /* 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);
 }
 
     returnCode(OK);
 }
 
+#if NCURSES_SP_FUNCS
 NCURSES_EXPORT(int)
 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,
                                     newmode,
-                                    NCURSES_SP_NAME(_nc_outch));
+                                    _nc_outc_wrapper);
 }
 }
+#endif
 
 
-#if NCURSES_SP_FUNCS
 NCURSES_EXPORT(int)
 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)
 {
 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
 
 }
 #endif
 
@@ -333,6 +338,12 @@ NCURSES_SP_NAME(termattrs) (NCURSES_SP_DCL0)
 {
     chtype attrs = A_NORMAL;
 
 {
     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;
     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;
 
     if (SP_PARM->_coloron)
        attrs |= A_COLOR;
 
+#endif
     returnChtype(attrs);
 }
 
     returnChtype(attrs);
 }