]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 5.7 - patch 20090228
authorThomas E. Dickey <dickey@invisible-island.net>
Sat, 28 Feb 2009 23:06:36 +0000 (23:06 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sat, 28 Feb 2009 23:06:36 +0000 (23:06 +0000)
+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
+ modify declaration of cur_term when broken-linker is used, but
  enable-reentrant is not, to match pre-5.7 (report by Charles Wilson).

19 files changed:
NEWS
dist.mk
form/fld_def.c
include/MKterm.h.awk.in
menu/m_cursor.c
menu/m_driver.c
menu/m_global.c
menu/m_post.c
menu/menu.priv.h
misc/ncu-indent
ncurses/base/lib_getch.c
ncurses/base/lib_mouse.c
ncurses/curses.priv.h
ncurses/tinfo/lib_cur_term.c
ncurses/tinfo/lib_options.c
ncurses/tinfo/lib_tputs.c
ncurses/trace/lib_trace.c
ncurses/trace/lib_traceatr.c
test/railroad.c

diff --git a/NEWS b/NEWS
index 2830d23cab9022f3bbfde4005e4e65a5eb6544d3..fe62f4b33ec0022de910e7744814637dbff4506f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.1365 2009/02/22 02:05:30 tom Exp $
+-- $Id: NEWS,v 1.1367 2009/02/28 22:38:03 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.
 
+20090228
+       + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
+       + modify declaration of cur_term when broken-linker is used, but
+         enable-reentrant is not, to match pre-5.7 (report by Charles Wilson).
+
 20090221
        + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
 
diff --git a/dist.mk b/dist.mk
index fe733c52d2706d52657d84453d7ead63098a1203..73758882b2d626e76cafed4db23b11087d8cc9b2 100644 (file)
--- 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.687 2009/02/21 21:20:20 tom Exp $
+# $Id: dist.mk,v 1.688 2009/02/28 14:49:13 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 = 20090221
+NCURSES_PATCH = 20090228
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 3559ba67241c0665fbc444bda251b49a9ec7306d..b8c69d30a4292d8572ed4069b5a1d4274fbc2005 100644 (file)
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_def.c,v 1.36 2007/10/13 19:29:58 tom Exp $")
+MODULE_ID("$Id: fld_def.c,v 1.37 2009/02/28 19:00:51 juergen Exp $")
 
 /* this can't be readonly */
 static FIELD default_field =
@@ -252,8 +252,8 @@ _nc_Free_Type(FIELD *field)
   if (field->type != 0)
     {
       field->type->ref--;
+      _nc_Free_Argument(field->type, (TypeArgument *)(field->arg));
     }
-  _nc_Free_Argument(field->type, (TypeArgument *)(field->arg));
 }
 
 /*---------------------------------------------------------------------------
index 5fc20529b11b360cd40f6231da3ac24dba140d3c..c0e826bf6eb25f699fec6dd793cc15877a7f5559 100644 (file)
@@ -1,7 +1,7 @@
 # vile:awkmode
 BEGIN          {
                    print  "/****************************************************************************"
-                   print  " * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *"
+                   print  " * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *"
                    print  " *                                                                          *"
                    print  " * Permission is hereby granted, free of charge, to any person obtaining a  *"
                    print  " * copy of this software and associated documentation files (the            *"
@@ -34,7 +34,7 @@ BEGIN         {
                    print  "/*    and: Thomas E. Dickey                        1995-on                  */"
                    print  "/****************************************************************************/"
                    print  ""
-                   print  "/* $Id: MKterm.h.awk.in,v 1.50 2008/05/24 23:13:59 tom Exp $ */"
+                   print  "/* $Id: MKterm.h.awk.in,v 1.53 2009/02/28 21:27:45 tom Exp $ */"
                    print  ""
                    print  "/*"
                    print  "**  term.h -- Definition of struct term"
@@ -228,8 +228,16 @@ END                {
                        print  "    char *      _termname;      /* used for termname() */"
                        print  "} TERMINAL;"
                        print  ""
-                       print  "#if @BROKEN_LINKER@ || @cf_cv_enable_reentrant@"
+                       print  "#if @BROKEN_LINKER@ && !@cf_cv_enable_reentrant@"
+                       print  "extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;"
+                       print  "#elif @cf_cv_enable_reentrant@"
                        print  "NCURSES_WRAPPED_VAR(TERMINAL *, cur_term);"
+                       print  "#define cur_term   NCURSES_PUBLIC_VAR(cur_term())"
+                       print  "#else"
+                       print  "extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;"
+                       print  "#endif"
+                       print  ""
+                       print  "#if @BROKEN_LINKER@ || @cf_cv_enable_reentrant@"
                        print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolnames);"
                        print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolcodes);"
                        print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolfnames);"
@@ -240,7 +248,6 @@ END         {
                        print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strcodes);"
                        print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strfnames);"
                        print  ""
-                       print  "#define cur_term   NCURSES_PUBLIC_VAR(cur_term())"
                        print  "#define boolnames  NCURSES_PUBLIC_VAR(boolnames())"
                        print  "#define boolcodes  NCURSES_PUBLIC_VAR(boolcodes())"
                        print  "#define boolfnames NCURSES_PUBLIC_VAR(boolfnames())"
@@ -253,8 +260,6 @@ END         {
                        print  ""
                        print  "#else"
                        print  ""
-                       print  "extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;"
-                       print  ""
                        print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolnames[];"
                        print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolcodes[];"
                        print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolfnames[];"
index 0293f9073c32c295795700106566a8fd60b8a9f4..77f9c759269f4eb5e8189a170f83a68659dc7030 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2004,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2005,2009 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            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_cursor.c,v 1.20 2005/10/22 23:03:32 tom Exp $")
+MODULE_ID("$Id: m_cursor.c,v 1.21 2009/02/28 21:02:46 juergen Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu
@@ -90,7 +90,7 @@ pos_menu_cursor(const MENU * menu)
 
   if (E_OK == err)
     {
-      win = menu->userwin ? menu->userwin : stdscr;
+      win = Get_Menu_UserWin(menu);
       sub = menu->usersub ? menu->usersub : win;
       assert(win && sub);
 
index d418e6a2255767f35060c46ee2ef9ea618f977ea..5b7a89e386a5170c8ac4ebb5095d059a99444621 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 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            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_driver.c,v 1.27 2008/08/03 22:08:22 tom Exp $")
+MODULE_ID("$Id: m_driver.c,v 1.28 2009/02/28 21:02:46 juergen Exp $")
 
 /* Macros */
 
@@ -197,7 +197,7 @@ _nc_Match_Next_Character_In_Item_Name
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu
-|   Function      :  int menu_driver(MENU *menu, int c)
+|   Function      :  int menu_driver(MENUmenu, int c)
 |
 |   Description   :  Central dispatcher for the menu. Translates the logical
 |                    request 'c' into a menu action.
index 28e836dd644e01a5eb009c4c46818e1be88326d4..267c8564287739a33d91ff167dc68a339cfa83ee 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2004,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2005,2009 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            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_global.c,v 1.23 2005/12/31 21:51:52 tom Exp $")
+MODULE_ID("$Id: m_global.c,v 1.24 2009/02/28 21:02:46 juergen Exp $")
 
 static char mark[] = "-";
 /* *INDENT-OFF* */
@@ -496,7 +496,7 @@ _nc_Link_Items(MENU * menu)
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
-|   Function      :  void _nc_Show_Menu(const MENU *menu)
+|   Function      :  void _nc_Show_Menu(const MENUmenu)
 |   
 |   Description   :  Update the window that is associated with the menu
 |
@@ -543,8 +543,10 @@ _nc_Show_Menu(const MENU * menu)
 |   Return Values :  -
 +--------------------------------------------------------------------------*/
 NCURSES_EXPORT(void)
-  _nc_New_TopRow_and_CurrentItem
-  (MENU * menu, int new_toprow, ITEM * new_current_item)
+_nc_New_TopRow_and_CurrentItem(
+                               MENU * menu,
+                               int new_toprow,
+                               ITEM * new_current_item)
 {
   ITEM *cur_item;
   bool mterm_called = FALSE;
index 657d0f18420be2411c77c7f548d6c6d20d278862..6caac6a8313589a3c5d1ebf3d57a423ea9d5194b 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2004,2009 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            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_post.c,v 1.26 2004/12/25 23:57:04 tom Exp $")
+MODULE_ID("$Id: m_post.c,v 1.27 2009/02/28 21:02:46 juergen Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu
@@ -255,7 +255,7 @@ _nc_Draw_Menu(const MENU * menu)
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu
-|   Function      :  int post_menu(MENU *)
+|   Function      :  int post_menu(MENU* menu)
 |
 |   Description   :  Post a menu to the screen. This makes it visible.
 |
@@ -329,7 +329,7 @@ post_menu(MENU * menu)
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu
-|   Function      :  int unpost_menu(MENU *)
+|   Function      :  int unpost_menu(MENU*)
 |
 |   Description   :  Detach menu from screen
 |
index 10d3537594da4dbebc3e1cab8f088a31ce50b1ad..99580a38d1c221936608f5583df1a180c2a71a9e 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2004,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2005,2009 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            *
@@ -30,7 +30,7 @@
  *   Author:  Juergen Pfeifer, 1995,1997                                    *
  ****************************************************************************/
 
-/* $Id: menu.priv.h,v 1.22 2005/01/16 01:02:23 tom Exp $ */
+/* $Id: menu.priv.h,v 1.23 2009/02/28 21:02:57 juergen Exp $ */
 
 /***************************************************************************
 * Module menu.priv.h                                                       *
@@ -56,8 +56,12 @@ extern NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu;
 /* Normalize menu to default if none was given */
 #define Normalize_Menu( menu ) ((menu)=(menu)?(menu):&_nc_Default_Menu)
 
+#define Get_Menu_Screen( menu ) (menu->userwin ? \
+                                _nc_screen_of(menu->userwin) : CURRENT_SCREEN)
+
 /* Get the user defined (framing) window of the menu */
-#define Get_Menu_UserWin(menu) ((menu)->userwin ? (menu)->userwin : stdscr)
+#define Get_Menu_UserWin(menu) ((menu)->userwin ? \
+    (menu)->userwin : CURRENT_SCREEN->_stdscr)
 
 /* Normalize menu window */
 #define Get_Menu_Window(  menu ) \
index 862a108a3b3185cc9c59b0c371f49abe73ff7f41..671f7574f7761b6abf8ee556836b7745c26af89a 100755 (executable)
@@ -26,7 +26,7 @@
 #* sale, use or other dealings in this Software without prior written       *
 #* authorization.                                                           *
 #****************************************************************************/
-# $Id: ncu-indent,v 1.17 2008/08/03 15:46:44 tom Exp $
+# $Id: ncu-indent,v 1.20 2009/02/21 20:56:23 tom Exp $
 NOOP=no
 OPTS='
 --blank-lines-after-procedures
@@ -44,6 +44,8 @@ OPTS='
 --swallow-optional-blank-lines
 --tab-size8
 
+-T NCURSES_SP_ARGx
+-T NCURSES_SP_DCLx
 -T NCURSES_EXPORT_VAR
 -T NCURSES_INLINE
 -T SCREEN
@@ -88,11 +90,12 @@ do
                mv "$name" "$save"
                sed \
                        -e '/EMPTY_MODULE(/s/)$/);/' \
+                       -e 's,\(MODULEID(\),//\1,' \
                        -e '/MODULE_ID(/s/)$/);/' \
                        -e 's,\<GCC_NORETURN;,;//GCC_NORETURN;,' \
                        -e 's,\<GCC_PRINTFLIKE(,;//GCC_PRINTFLIKE(,' \
                        -e 's,\<GCC_SCANFLIKE(,;//GCC_SCANFLIKE(,' \
-                       -e 's,\(\<NCURSES_EXPORT_VAR\>\),//\1,' \
+                       -e 's,\(\<NCURSES_EXPORT_VAR\>.*;\),//\1,' \
                        "$save" >"$test"
                cp "$test" "$name"
                chmod u+w "$name"
@@ -100,11 +103,12 @@ do
                ${INDENT_PROG-indent} -npro $OPTS "$name"
                sed \
                        -e '/EMPTY_MODULE(/s/);$/)/' \
+                       -e 's,//\(MODULEID(\),\1,' \
                        -e '/MODULE_ID(/s/);$/)/' \
                        -e 's,;[        ]*//GCC_NORETURN;, GCC_NORETURN;,' \
                        -e 's,;[        ]*//GCC_PRINTFLIKE(, GCC_PRINTFLIKE(,' \
                        -e 's,;[        ]*//GCC_SCANFLIKE(, GCC_SCANFLIKE(,' \
-                       -e 's,//\(\<NCURSES_EXPORT_VAR\>\),\1,' \
+                       -e 's,//\(\<NCURSES_EXPORT_VAR\>[ ]*\),\1,' \
                        "$name" >"$test"
                mv "$test" "$name"
                rm -f "${name}~"
index 22173242852452310b403dc4166abfb5e69e4766..cfec16e61815a61bc7b1767e9905d8c40af35bc0 100644 (file)
@@ -42,7 +42,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_getch.c,v 1.100 2009/02/15 00:36:00 tom Exp $")
+MODULE_ID("$Id: lib_getch.c,v 1.101 2009/02/28 19:16:40 tom Exp $")
 
 #include <fifo_defs.h>
 
@@ -94,9 +94,9 @@ _nc_use_meta(WINDOW *win)
 }
 
 #ifdef NCURSES_WGETCH_EVENTS
-#define TWAIT_MASK 7
+#define TWAIT_MASK (TW_ANY | TW_EVENT)
 #else
-#define TWAIT_MASK 3
+#define TWAIT_MASK TW_ANY
 #endif
 
 /*
@@ -119,7 +119,7 @@ check_mouse_activity(SCREEN *sp, int delay EVENTLIST_2nd(_nc_eventlist * evl))
        && (sp->_sysmouse_head < sp->_sysmouse_tail)
        && (rc == 0)
        && (errno == EINTR)) {
-       rc |= 2;
+       rc |= TW_MOUSE;
     }
 #endif
     return rc;
@@ -183,7 +183,7 @@ fifo_push(SCREEN *sp EVENTLIST_2nd(_nc_eventlist * evl))
     } else
        mask = 0;
 
-    if (mask & 4) {
+    if (mask & TW_EVENT) {
        T(("fifo_push: ungetch KEY_EVENT"));
        _nc_ungetch(sp, KEY_EVENT);
        return KEY_EVENT;
@@ -195,7 +195,7 @@ fifo_push(SCREEN *sp EVENTLIST_2nd(_nc_eventlist * evl))
 #endif
 
 #if USE_GPM_SUPPORT || USE_EMX_MOUSE
-    if ((sp->_mouse_fd >= 0) && (mask & 2)) {
+    if ((sp->_mouse_fd >= 0) && (mask & TW_MOUSE)) {
        sp->_mouse_event(sp);
        ch = KEY_MOUSE;
        n = 1;
@@ -270,12 +270,12 @@ recur_wrefresh(WINDOW *win)
 {
 #ifdef USE_PTHREADS
     SCREEN *sp = _nc_screen_of(win);
-    if (_nc_use_pthreads && sp != SP) {
+    if (_nc_use_pthreads && sp != CURRENT_SCREEN) {
        SCREEN *save_SP;
 
        /* temporarily switch to the window's screen to check/refresh */
        _nc_lock_global(curses);
-       save_SP = SP;
+       save_SP = CURRENT_SCREEN;
        _nc_set_screen(sp);
        recur_wrefresh(win);
        _nc_set_screen(save_SP);
@@ -296,12 +296,12 @@ recur_wgetnstr(WINDOW *win, char *buf)
 
     if (sp != 0) {
 #ifdef USE_PTHREADS
-       if (_nc_use_pthreads && sp != SP) {
+       if (_nc_use_pthreads && sp != CURRENT_SCREEN) {
            SCREEN *save_SP;
 
            /* temporarily switch to the window's screen to get cooked input */
            _nc_lock_global(curses);
-           save_SP = SP;
+           save_SP = CURRENT_SCREEN;
            _nc_set_screen(sp);
            rc = recur_wgetnstr(win, buf);
            _nc_set_screen(save_SP);
@@ -412,7 +412,7 @@ _nc_wgetch(WINDOW *win,
            rc = check_mouse_activity(sp, delay EVENTLIST_2nd(evl));
 
 #ifdef NCURSES_WGETCH_EVENTS
-           if (rc & 4) {
+           if (rc & TW_EVENT) {
                *result = KEY_EVENT;
                returnCode(KEY_CODE_YES);
            }
@@ -437,7 +437,7 @@ _nc_wgetch(WINDOW *win,
         * increase the wait with mouseinterval().
         */
        int runcount = 0;
-       int rc;
+       int rc = 0;
 
        do {
            ch = kgetch(sp EVENTLIST_2nd(evl));
@@ -452,10 +452,10 @@ _nc_wgetch(WINDOW *win,
            (ch == KEY_MOUSE
             && (((rc = check_mouse_activity(sp, sp->_maxclick
                                             EVENTLIST_2nd(evl))) != 0
-                 && !(rc & 4))
+                 && !(rc & TW_EVENT))
                 || !sp->_mouse_parse(sp, runcount)));
 #ifdef NCURSES_WGETCH_EVENTS
-       if ((rc & 4) && !ch == KEY_EVENT) {
+       if ((rc & TW_EVENT) && !(ch == KEY_EVENT)) {
            _nc_ungetch(sp, ch);
            ch = KEY_EVENT;
        }
@@ -655,7 +655,7 @@ kgetch(SCREEN *sp EVENTLIST_2nd(_nc_eventlist * evl))
            TR(TRACE_IEVENT, ("waiting for rest of sequence"));
            rc = check_mouse_activity(sp, timeleft EVENTLIST_2nd(evl));
 #ifdef NCURSES_WGETCH_EVENTS
-           if (rc & 4) {
+           if (rc & TW_EVENT) {
                TR(TRACE_IEVENT, ("interrupted by a user event"));
                /* FIXME Should have preserved remainder timeleft for reuse... */
                peek = head;    /* Restart interpreting later */
index d19189f7d6e97eac6555569ae780126949d05a36..c7af9ce24f16734579a13be572e6915afaaf5cd1 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 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            *
@@ -79,9 +79,8 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_mouse.c,v 1.104 2008/11/30 01:37:27 tom Exp $")
+MODULE_ID("$Id: lib_mouse.c,v 1.105 2009/02/28 21:09:20 tom Exp $")
 
-#include <term.h>
 #include <tic.h>
 
 #if USE_GPM_SUPPORT
@@ -150,7 +149,7 @@ make an error
 #define LIBGPM_SONAME "libgpm.so"
 #endif
 
-#define GET_DLSYM(name) (my_##name = (TYPE_##name) dlsym(SP->_dlopen_gpm, #name))
+#define GET_DLSYM(name) (my_##name = (TYPE_##name) dlsym(SP_PARM->_dlopen_gpm, #name))
 
 #endif                         /* USE_GPM_SUPPORT */
 
@@ -164,13 +163,13 @@ static void _nc_mouse_wrap(SCREEN *);
 #define LastEV(sp)     ((sp)->_mouse_events + EV_MAX - 1)
 
 #undef  NEXT
-#define NEXT(ep)       ((ep >= LastEV(sp)) \
-                        ? FirstEV(sp) \
+#define NEXT(ep)       ((ep >= LastEV(SP_PARM)) \
+                        ? FirstEV(SP_PARM) \
                         : ep + 1)
 
 #undef  PREV
-#define PREV(ep)       ((ep <= FirstEV(sp)) \
-                        ? LastEV(sp) \
+#define PREV(ep)       ((ep <= FirstEV(SP_PARM)) \
+                        ? LastEV(SP_PARM) \
                         : ep - 1)
 
 #define IndexEV(sp, ep)        (ep - FirstEV(sp))
@@ -340,7 +339,7 @@ sysmouse_server(SCREEN *sp)
 static void
 handle_sysmouse(int sig GCC_UNUSED)
 {
-    sysmouse_server(SP);
+    sysmouse_server(CURRENT_SCREEN);
 }
 #endif /* USE_SYSMOUSE */
 
@@ -359,7 +358,9 @@ enable_xterm_mouse(SCREEN *sp, int enable)
 #if USE_EMX_MOUSE
     sp->_emxmouse_activated = enable;
 #else
-    putp(TPARM_1(sp->_mouse_xtermcap, enable));
+    NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx
+                              "xterm-mouse",
+                              TPARM_1(sp->_mouse_xtermcap, enable));
 #endif
     sp->_mouse_active = enable;
 }
@@ -398,7 +399,7 @@ allow_gpm_mouse(void)
 static void
 unload_gpm_library(SCREEN *sp)
 {
-    if (SP->_dlopen_gpm != 0) {
+    if (sp->_dlopen_gpm != 0) {
        T(("unload GPM library"));
        sp->_mouse_gpm_loaded = FALSE;
        sp->_mouse_fd = -1;
@@ -943,7 +944,7 @@ mouse_activate(SCREEN *sp, bool on)
        switch (sp->_mouse_type) {
        case M_XTERM:
 #if NCURSES_EXT_FUNCS
-           keyok(KEY_MOUSE, on);
+           NCURSES_SP_NAME(keyok) (NCURSES_SP_ARGx KEY_MOUSE, on);
 #endif
            TPUTS_TRACE("xterm mouse initialization");
            enable_xterm_mouse(sp, 1);
@@ -995,7 +996,7 @@ mouse_activate(SCREEN *sp, bool on)
            return;
        }
     }
-    _nc_flush();
+    NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG);
 }
 
 /**************************************************************************
@@ -1270,13 +1271,13 @@ _nc_mouse_resume(SCREEN *sp)
  *
  **************************************************************************/
 
-static int
-_nc_getmouse(SCREEN *sp, MEVENT * aevent)
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(getmouse) (NCURSES_SP_DCLx MEVENT * aevent)
 {
-    T((T_CALLED("getmouse(%p)"), aevent));
+    T((T_CALLED("getmouse(%p,%p)"), SP_PARM, aevent));
 
-    if ((aevent != 0) && (sp != 0) && (sp->_mouse_type != M_NONE)) {
-       MEVENT *eventp = sp->_mouse_eventp;
+    if ((aevent != 0) && (SP_PARM != 0) && (SP_PARM->_mouse_type != M_NONE)) {
+       MEVENT *eventp = SP_PARM->_mouse_eventp;
        /* compute the current-event pointer */
        MEVENT *prev = PREV(eventp);
 
@@ -1284,8 +1285,8 @@ _nc_getmouse(SCREEN *sp, MEVENT * aevent)
        *aevent = *prev;
 
        TR(TRACE_IEVENT, ("getmouse: returning event %s from slot %ld",
-                         _nc_tracemouse(sp, prev),
-                         (long) IndexEV(sp, prev)));
+                         _nc_tracemouse(SP_PARM, prev),
+                         (long) IndexEV(SP_PARM, prev)));
 
        prev->id = INVALID_EVENT;       /* so the queue slot becomes free */
        returnCode(OK);
@@ -1293,57 +1294,61 @@ _nc_getmouse(SCREEN *sp, MEVENT * aevent)
     returnCode(ERR);
 }
 
+#if NCURSES_SP_FUNCS
 /* grab a copy of the current mouse event */
 NCURSES_EXPORT(int)
 getmouse(MEVENT * aevent)
 {
-    return _nc_getmouse(SP, aevent);
+    return NCURSES_SP_NAME(getmouse) (CURRENT_SCREEN, aevent);
 }
+#endif
 
-static int
-_nc_ungetmouse(SCREEN *sp, MEVENT * aevent)
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(ungetmouse) (NCURSES_SP_DCLx MEVENT * aevent)
 {
     int result = ERR;
 
-    T((T_CALLED("ungetmouse(%p)"), aevent));
+    T((T_CALLED("ungetmouse(%p,%p)"), SP_PARM, aevent));
 
-    if (aevent != 0 && sp != 0) {
-       MEVENT *eventp = sp->_mouse_eventp;
+    if (aevent != 0 && SP_PARM != 0) {
+       MEVENT *eventp = SP_PARM->_mouse_eventp;
 
        /* stick the given event in the next-free slot */
        *eventp = *aevent;
 
        /* bump the next-free pointer into the circular list */
-       sp->_mouse_eventp = NEXT(eventp);
+       SP_PARM->_mouse_eventp = NEXT(eventp);
 
        /* push back the notification event on the keyboard queue */
-       result = _nc_ungetch(sp, KEY_MOUSE);
+       result = NCURSES_SP_NAME(ungetch) (NCURSES_SP_ARGx KEY_MOUSE);
     }
     returnCode(result);
 }
 
+#if NCURSES_SP_FUNCS
 /* enqueue a synthesized mouse event to be seen by the next wgetch() */
 NCURSES_EXPORT(int)
 ungetmouse(MEVENT * aevent)
 {
-    return _nc_ungetmouse(SP, aevent);
+    return NCURSES_SP_NAME(ungetmouse) (CURRENT_SCREEN, aevent);
 }
+#endif
 
 NCURSES_EXPORT(mmask_t)
-mousemask(mmask_t newmask, mmask_t * oldmask)
+NCURSES_SP_NAME(mousemask) (NCURSES_SP_DCLx mmask_t newmask, mmask_t * oldmask)
 /* set the mouse event mask */
 {
     mmask_t result = 0;
 
-    T((T_CALLED("mousemask(%#lx,%p)"), (unsigned long) newmask, oldmask));
+    T((T_CALLED("mousemask(%p,%#lx,%p)"), SP_PARM, (unsigned long) newmask, oldmask));
 
-    if (SP != 0) {
+    if (SP_PARM != 0) {
        if (oldmask)
-           *oldmask = SP->_mouse_mask;
+           *oldmask = SP_PARM->_mouse_mask;
 
-       if (newmask || SP->_mouse_initialized) {
-           _nc_mouse_init(SP);
-           if (SP->_mouse_type != M_NONE) {
+       if (newmask || SP_PARM->_mouse_initialized) {
+           _nc_mouse_init(SP_PARM);
+           if (SP_PARM->_mouse_type != M_NONE) {
                result = newmask &
                    (REPORT_MOUSE_POSITION
                     | BUTTON_ALT
@@ -1355,15 +1360,23 @@ mousemask(mmask_t newmask, mmask_t * oldmask)
                     | BUTTON_DOUBLE_CLICKED
                     | BUTTON_TRIPLE_CLICKED);
 
-               mouse_activate(SP, (bool) (result != 0));
+               mouse_activate(SP_PARM, (bool) (result != 0));
 
-               SP->_mouse_mask = result;
+               SP_PARM->_mouse_mask = result;
            }
        }
     }
     returnBits(result);
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(mmask_t)
+mousemask(mmask_t newmask, mmask_t * oldmask)
+{
+    return NCURSES_SP_NAME(mousemask) (CURRENT_SCREEN, newmask, oldmask);
+}
+#endif
+
 NCURSES_EXPORT(bool)
 wenclose(const WINDOW *win, int y, int x)
 /* check to see if given window encloses given screen location */
@@ -1383,17 +1396,17 @@ wenclose(const WINDOW *win, int y, int x)
 }
 
 NCURSES_EXPORT(int)
-mouseinterval(int maxclick)
+NCURSES_SP_NAME(mouseinterval) (NCURSES_SP_DCLx int maxclick)
 /* set the maximum mouse interval within which to recognize a click */
 {
     int oldval;
 
-    T((T_CALLED("mouseinterval(%d)"), maxclick));
+    T((T_CALLED("mouseinterval(%p,%d)"), SP_PARM, maxclick));
 
-    if (SP != 0) {
-       oldval = SP->_maxclick;
+    if (SP_PARM != 0) {
+       oldval = SP_PARM->_maxclick;
        if (maxclick >= 0)
-           SP->_maxclick = maxclick;
+           SP_PARM->_maxclick = maxclick;
     } else {
        oldval = DEFAULT_MAXCLICK;
     }
@@ -1401,19 +1414,35 @@ mouseinterval(int maxclick)
     returnCode(oldval);
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+mouseinterval(int maxclick)
+{
+    return NCURSES_SP_NAME(mouseinterval) (CURRENT_SCREEN, maxclick);
+}
+#endif
+
 /* This may be used by other routines to ask for the existence of mouse
    support */
 NCURSES_EXPORT(bool)
 _nc_has_mouse(SCREEN *sp)
 {
-    return ((sp->_mouse_type == M_NONE) ? FALSE : TRUE);
+    return (((0 == sp) || (sp->_mouse_type == M_NONE)) ? FALSE : TRUE);
+}
+
+NCURSES_EXPORT(bool)
+NCURSES_SP_NAME(has_mouse) (NCURSES_SP_DCL0)
+{
+    return _nc_has_mouse(SP_PARM);
 }
 
+#if NCURSES_SP_FUNCS
 NCURSES_EXPORT(bool)
 has_mouse(void)
 {
-    return _nc_has_mouse(SP);
+    return _nc_has_mouse(CURRENT_SCREEN);
 }
+#endif
 
 NCURSES_EXPORT(bool)
 wmouse_trafo(const WINDOW *win, int *pY, int *pX, bool to_screen)
index 20ca3623a19f32677863f5b69a9656191d62c3bd..95f66529bdab3d7d7a7a333b0fa1490443896ccb 100644 (file)
  *  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                                                 *
  ****************************************************************************/
 
 
 /*
- * $Id: curses.priv.h,v 1.402 2009/02/21 22:54:34 tom Exp $
+ * $Id: curses.priv.h,v 1.403 2009/02/28 20:55:48 tom Exp $
  *
  *     curses.priv.h
  *
@@ -1628,6 +1629,8 @@ extern NCURSES_EXPORT(int) _nc_getenv_num (const char *);
 extern NCURSES_EXPORT(int) _nc_keypad (SCREEN *, bool);
 extern NCURSES_EXPORT(int) _nc_ospeed (int);
 extern NCURSES_EXPORT(int) _nc_outch (int);
+extern NCURSES_EXPORT(int) _nc_putp(const char *, const char *);
+extern NCURSES_EXPORT(int) _nc_putp_flush(const char *, const char *);
 extern NCURSES_EXPORT(int) _nc_read_termcap_entry (const char *const, TERMTYPE *const);
 extern NCURSES_EXPORT(int) _nc_setupscreen (int, int, FILE *, bool, int);
 extern NCURSES_EXPORT(int) _nc_timed_wait (SCREEN *, int, int, int * EVENTLIST_2nd(_nc_eventlist *));
@@ -1699,7 +1702,7 @@ extern NCURSES_EXPORT_VAR(int *) _nc_oldnums;
 
 #define NC_BUFFERED(flag) _nc_set_buffer(SP->_ofp, flag)
 
-#define NC_OUTPUT ((SP != 0) ? SP->_ofp : stdout)
+#define NC_OUTPUT ((SP_PARM != 0) ? SP_PARM->_ofp : stdout)
 
 /*
  * On systems with a broken linker, define 'SP' as a function to force the
@@ -1763,6 +1766,7 @@ extern NCURSES_EXPORT(int) _nc_ripoffline (int line, int (*init)(WINDOW *,int));
 /*
  * Exported entrypoints beyond the published API
  */
+#if NCURSES_SP_FUNCS
 extern NCURSES_EXPORT(WINDOW *) _nc_curscr_of(SCREEN*);
 extern NCURSES_EXPORT(WINDOW *) _nc_newscr_of(SCREEN*);
 extern NCURSES_EXPORT(WINDOW *) _nc_stdscr_of(SCREEN*);
@@ -1794,6 +1798,10 @@ extern NCURSES_EXPORT(bool)     NCURSES_SP_NAME(_nc_is_term_resized)(SCREEN*,int
 extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_resize_term)(SCREEN*,int,int);
 extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_resizeterm)(SCREEN*,int,int);
 
+extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(_nc_outch)(SCREEN*, int ch);
+extern NCURSES_EXPORT(void)    NCURSES_SP_NAME(_nc_flush)(SCREEN*);
+extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(_nc_putp)(SCREEN*, const char *, const char *);
+extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(_nc_putp_flush)(SCREEN*, const char *, const char *);
 extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_tgetent)(SCREEN*,char*,const char *);
 extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_tputs)(SCREEN*,const char*,int,int(*)(SCREEN*, int));
 extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_savetty)(SCREEN*);
@@ -1813,6 +1821,14 @@ extern NCURSES_EXPORT(int)      _nc_tinfo_mcprint(SCREEN*,char*,int);
 extern NCURSES_EXPORT(wchar_t *) NCURSES_SP_NAME(_nc_wunctrl)(SCREEN*, cchar_t *);
 #endif
 
+/* FIXME - move these to curses.h.in */
+extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(getmouse) (SCREEN*, MEVENT *);
+extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(ungetmouse) (SCREEN*, MEVENT *);
+extern NCURSES_EXPORT(mmask_t) NCURSES_SP_NAME(mousemask) (SCREEN*, mmask_t, mmask_t *);
+extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(mouseinterval) (SCREEN*, int);
+extern NCURSES_EXPORT(bool)    NCURSES_SP_NAME(has_mouse) (SCREEN*);
+#endif /* NCURSES_SP_FUNCS */
+
 #ifdef __cplusplus
 }
 #endif
index 626578d5c08b93b8a72738b2228ef2497cf4223e..64ff4c29700a5672d4a5f1655c00b532d8aa4c3a 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 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            *
 #include <term_entry.h>                /* TTY, cur_term */
 #include <termcap.h>           /* ospeed */
 
-MODULE_ID("$Id: lib_cur_term.c,v 1.18 2008/08/16 19:22:55 tom Exp $")
+MODULE_ID("$Id: lib_cur_term.c,v 1.19 2009/02/28 15:49:58 tom Exp $")
 
 #undef CUR
 #define CUR termp->type.
 
-#if BROKEN_LINKER || USE_REENTRANT
+#if BROKEN_LINKER && !USE_REENTRANT
+NCURSES_EXPORT_VAR(TERMINAL *) cur_term = 0;
+#elif BROKEN_LINKER || USE_REENTRANT
 NCURSES_EXPORT(TERMINAL *)
 NCURSES_PUBLIC_VAR(cur_term) (void)
 {
index 82aa6d64547cdcb0f5cd9bc4db5d5c410454b549..cfce6c941051665976d789a445be9acf8c5a4811 100644 (file)
@@ -44,7 +44,7 @@
 
 #include <term.h>
 
-MODULE_ID("$Id: lib_options.c,v 1.59 2009/02/15 00:48:40 tom Exp $")
+MODULE_ID("$Id: lib_options.c,v 1.60 2009/02/28 21:07:56 tom Exp $")
 
 static int _nc_curs_set(SCREEN *, int);
 static int _nc_meta(SCREEN *, bool);
@@ -221,8 +221,9 @@ has_key(int keycode)
 #undef CUR
 #define CUR (sp->_term)->type.
 
-static int
-_nc_putp(const char *name GCC_UNUSED, const char *value)
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_DCLx
+                          const char *name GCC_UNUSED, const char *value)
 {
     int rc = ERR;
 
@@ -233,8 +234,17 @@ _nc_putp(const char *name GCC_UNUSED, const char *value)
     return rc;
 }
 
-static int
-_nc_putp_flush(const char *name, const char *value)
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+_nc_putp(const char *name, const char *value)
+{
+    return NCURSES_SP_NAME(_nc_putp) (CURRENT_SCREEN, name, value);
+}
+#endif
+
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_DCLx
+                                const char *name, const char *value)
 {
     int rc = _nc_putp(name, value);
     if (rc != ERR) {
@@ -243,6 +253,14 @@ _nc_putp_flush(const char *name, const char *value)
     return rc;
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+_nc_putp_flush(const char *name, const char *value)
+{
+    return NCURSES_SP_NAME(_nc_putp_flush) (CURRENT_SCREEN, name, value);
+}
+#endif
+
 /* Turn the keypad on/off
  *
  * Note:  we flush the output because changing this mode causes some terminals
@@ -262,12 +280,12 @@ _nc_keypad(SCREEN *sp, bool flag)
         * has wgetch() reading in more than one thread.  putp() and below
         * may use SP explicitly.
         */
-       if (_nc_use_pthreads && sp != SP) {
+       if (_nc_use_pthreads && sp != CURRENT_SCREEN) {
            SCREEN *save_sp;
 
            /* cannot use use_screen(), since that is not in tinfo library */
            _nc_lock_global(curses);
-           save_sp = SP;
+           save_sp = CURRENT_SCREEN;
            _nc_set_screen(sp);
            rc = _nc_keypad(sp, flag);
            _nc_set_screen(save_sp);
@@ -330,8 +348,8 @@ _nc_meta(SCREEN *sp, bool flag)
 
     /* Ok, we stay relaxed and don't signal an error if win is NULL */
 
-    if (SP != 0) {
-       SP->_use_meta = flag;
+    if (sp != 0) {
+       sp->_use_meta = flag;
 
        if (flag) {
            _nc_putp("meta_on", meta_on);
index 27e36136460a615e5ef2fe696ddd589c4445a4fc..0b12624ee005c75757114736846a9a04dfa9d9fa 100644 (file)
@@ -47,7 +47,7 @@
 #include <termcap.h>           /* ospeed */
 #include <tic.h>
 
-MODULE_ID("$Id: lib_tputs.c,v 1.67 2009/02/15 00:49:44 tom Exp $")
+MODULE_ID("$Id: lib_tputs.c,v 1.68 2009/02/28 21:08:18 tom Exp $")
 
 NCURSES_EXPORT_VAR(char) PC = 0;              /* used by termcap library */
 NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed = 0;        /* used by termcap library */
@@ -102,18 +102,26 @@ delay_output(int ms)
 #endif
 
 NCURSES_EXPORT(void)
-_nc_flush(void)
+NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_DCL0)
 {
     (void) fflush(NC_OUTPUT);
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(void)
+_nc_flush(void)
+{
+    NCURSES_SP_NAME(_nc_flush) (CURRENT_SCREEN);
+}
+#endif
+
 NCURSES_EXPORT(int)
-_nc_outch(int ch)
+NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_DCLx int ch)
 {
     COUNT_OUTCHARS(1);
 
-    if (SP != 0
-       && SP->_cleanup) {
+    if (SP_PARM != 0
+       && SP_PARM->_cleanup) {
        char tmp = ch;
        /*
         * POSIX says write() is safe in a signal handler, but the
@@ -126,6 +134,14 @@ _nc_outch(int ch)
     return OK;
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+_nc_outch(int ch)
+{
+    return NCURSES_SP_NAME(_nc_outch) (CURRENT_SCREEN, ch);
+}
+#endif
+
 NCURSES_EXPORT(int)
 putp(const char *string)
 {
index 743b1f64f1aeaf39476190b7a89f1e08bb7fc4cd..0c733cd8307cd076e4e4032509e60559e1b40db8 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 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            *
@@ -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                 *
+ *     and: Juergen Pfeifer                                                 *
  ****************************************************************************/
 
 /*
@@ -46,7 +47,7 @@
 
 #include <ctype.h>
 
-MODULE_ID("$Id: lib_trace.c,v 1.71 2008/08/23 18:04:29 tom Exp $")
+MODULE_ID("$Id: lib_trace.c,v 1.72 2009/02/28 20:37:37 tom Exp $")
 
 NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0; /* always define this */
 
@@ -56,26 +57,26 @@ NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0; /* always define this */
 NCURSES_EXPORT(const char *)
 NCURSES_PUBLIC_VAR(_nc_tputs_trace) (void)
 {
-    return SP ? SP->_tputs_trace : _nc_prescreen._tputs_trace;
+    return CURRENT_SCREEN ? CURRENT_SCREEN->_tputs_trace : _nc_prescreen._tputs_trace;
 }
 NCURSES_EXPORT(long)
 NCURSES_PUBLIC_VAR(_nc_outchars) (void)
 {
-    return SP ? SP->_outchars : _nc_prescreen._outchars;
+    return CURRENT_SCREEN ? CURRENT_SCREEN->_outchars : _nc_prescreen._outchars;
 }
 NCURSES_EXPORT(void)
 _nc_set_tputs_trace(const char *s)
 {
-    if (SP)
-       SP->_tputs_trace = s;
+    if (CURRENT_SCREEN)
+       CURRENT_SCREEN->_tputs_trace = s;
     else
        _nc_prescreen._tputs_trace = s;
 }
 NCURSES_EXPORT(void)
 _nc_count_outchars(long increment)
 {
-    if (SP)
-       SP->_outchars += increment;
+    if (CURRENT_SCREEN)
+       CURRENT_SCREEN->_outchars += increment;
     else
        _nc_prescreen._outchars += increment;
 }
index 45a03cea05feb194988e2455077354e2244f03b5..50920f2405e8342c92efc254206501b8c37c1c6b 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 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            *
@@ -30,6 +30,7 @@
  *  Author: Thomas Dickey                           1996-on                 *
  *     and: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Juergen Pfeifer                                                 *
  ****************************************************************************/
 
 /*
@@ -39,7 +40,7 @@
 #include <curses.priv.h>
 #include <term.h>              /* acs_chars */
 
-MODULE_ID("$Id: lib_traceatr.c,v 1.63 2008/08/03 16:24:53 tom Exp $")
+MODULE_ID("$Id: lib_traceatr.c,v 1.64 2009/02/28 21:10:20 tom Exp $")
 
 #define COLOR_OF(c) ((c < 0) ? "default" : (c > 7 ? color_of(c) : colors[c].name))
 
@@ -228,7 +229,7 @@ _nc_altcharset_name(attr_t attr, chtype ch)
     if ((attr & A_ALTCHARSET) && (acs_chars != 0)) {
        char *cp;
        char *found = 0;
-       const ALT_NAMES *sp;
+       const ALT_NAMES *strp;
 
        for (cp = acs_chars; cp[0] && cp[1]; cp += 2) {
            if (ChCharOf(cp[1]) == ChCharOf(ch)) {
@@ -239,9 +240,9 @@ _nc_altcharset_name(attr_t attr, chtype ch)
 
        if (found != 0) {
            ch = ChCharOf(*found);
-           for (sp = names; sp->val; sp++)
-               if (sp->val == ch) {
-                   result = sp->name;
+           for (strp = names; strp->val; strp++)
+               if (strp->val == ch) {
+                   result = strp->name;
                    break;
                }
        }
@@ -260,7 +261,8 @@ _tracechtype2(int bufnum, chtype ch)
        if ((found = _nc_altcharset_name(ChAttrOf(ch), ch)) != 0) {
            (void) _nc_trace_bufcat(bufnum, found);
        } else
-           (void) _nc_trace_bufcat(bufnum, _nc_tracechar(SP, (int) ChCharOf(ch)));
+           (void) _nc_trace_bufcat(bufnum, _nc_tracechar(CURRENT_SCREEN,
+                                   (int) ChCharOf(ch)));
 
        if (ChAttrOf(ch) != A_NORMAL) {
            (void) _nc_trace_bufcat(bufnum, " | ");
@@ -320,7 +322,7 @@ _tracecchar_t2(int bufnum, const cchar_t *ch)
                        if (PUTC_ch != L'\0') {
                            /* it could not be a multibyte sequence */
                            (void) _nc_trace_bufcat(bufnum,
-                                                   _nc_tracechar(SP,
+                                                   _nc_tracechar(CURRENT_SCREEN,
                                                                  UChar(ch->chars[PUTC_i])));
                        }
                        break;
@@ -329,7 +331,7 @@ _tracecchar_t2(int bufnum, const cchar_t *ch)
                        if (n)
                            (void) _nc_trace_bufcat(bufnum, ", ");
                        (void) _nc_trace_bufcat(bufnum,
-                                               _nc_tracechar(SP,
+                                               _nc_tracechar(CURRENT_SCREEN,
                                                              UChar(PUTC_buf[n])));
                    }
                }
index 160823d43cfc8e653efe12faeda7cc79350e9dba..72ff8670d07857c1a94b042a0b217d4edcb6cb7f 100644 (file)
@@ -29,7 +29,7 @@
 /*
  * Author: Thomas E. Dickey - 2000
  *
- * $Id: railroad.c,v 1.16 2008/02/09 18:08:43 tom Exp $
+ * $Id: railroad.c,v 1.17 2008/12/07 02:07:41 juergen Exp $
  *
  * A simple demo of the termcap interface.
  */
@@ -82,7 +82,7 @@ Backup(void)
 }
 
 static void
-ShowCursor(int flag)
+MyShowCursor(int flag)
 {
     if (startC != 0 && finisC != 0) {
        tputs(flag ? startC : finisC, 1, outc);
@@ -166,7 +166,7 @@ cleanup(void)
 {
     Underline(0);
     StandOut(0);
-    ShowCursor(1);
+    MyShowCursor(1);
 }
 
 static void
@@ -214,14 +214,14 @@ railroad(char **args)
        startC = tgetstr("ve", &ap);
        finisC = tgetstr("vi", &ap);
 
-       ShowCursor(0);
+       MyShowCursor(0);
 
        CATCHALL(onsig);
 
        while (*args) {
            ShowSign(*args++);
        }
-       ShowCursor(1);
+       MyShowCursor(1);
     }
 }