+ 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).
-- 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
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).
# 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
# 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)
#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 =
if (field->type != 0)
{
field->type->ref--;
+ _nc_Free_Argument(field->type, (TypeArgument *)(field->arg));
}
- _nc_Free_Argument(field->type, (TypeArgument *)(field->arg));
}
/*---------------------------------------------------------------------------
# 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 *"
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"
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);"
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())"
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[];"
/****************************************************************************
- * 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 *
#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
if (E_OK == err)
{
- win = menu->userwin ? menu->userwin : stdscr;
+ win = Get_Menu_UserWin(menu);
sub = menu->usersub ? menu->usersub : win;
assert(win && sub);
/****************************************************************************
- * 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 *
#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 */
/*---------------------------------------------------------------------------
| Facility : libnmenu
-| Function : int menu_driver(MENU *menu, int c)
+| Function : int menu_driver(MENU* menu, int c)
|
| Description : Central dispatcher for the menu. Translates the logical
| request 'c' into a menu action.
/****************************************************************************
- * 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 *
#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* */
/*---------------------------------------------------------------------------
| Facility : libnmenu
-| Function : void _nc_Show_Menu(const MENU *menu)
+| Function : void _nc_Show_Menu(const MENU* menu)
|
| Description : Update the window that is associated with the 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;
/****************************************************************************
- * 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 *
#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
/*---------------------------------------------------------------------------
| Facility : libnmenu
-| Function : int post_menu(MENU *)
+| Function : int post_menu(MENU* menu)
|
| Description : Post a menu to the screen. This makes it visible.
|
/*---------------------------------------------------------------------------
| Facility : libnmenu
-| Function : int unpost_menu(MENU *)
+| Function : int unpost_menu(MENU*)
|
| Description : Detach menu from screen
|
/****************************************************************************
- * 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 *
* 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 *
/* 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 ) \
#* 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
--swallow-optional-blank-lines
--tab-size8
+-T NCURSES_SP_ARGx
+-T NCURSES_SP_DCLx
-T NCURSES_EXPORT_VAR
-T NCURSES_INLINE
-T SCREEN
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"
${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}~"
#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>
}
#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
/*
&& (sp->_sysmouse_head < sp->_sysmouse_tail)
&& (rc == 0)
&& (errno == EINTR)) {
- rc |= 2;
+ rc |= TW_MOUSE;
}
#endif
return rc;
} else
mask = 0;
- if (mask & 4) {
+ if (mask & TW_EVENT) {
T(("fifo_push: ungetch KEY_EVENT"));
_nc_ungetch(sp, KEY_EVENT);
return KEY_EVENT;
#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;
{
#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);
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);
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);
}
* increase the wait with mouseinterval().
*/
int runcount = 0;
- int rc;
+ int rc = 0;
do {
ch = kgetch(sp EVENTLIST_2nd(evl));
(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;
}
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 */
/****************************************************************************
- * 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 *
#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
#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 */
#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))
static void
handle_sysmouse(int sig GCC_UNUSED)
{
- sysmouse_server(SP);
+ sysmouse_server(CURRENT_SCREEN);
}
#endif /* USE_SYSMOUSE */
#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;
}
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;
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);
return;
}
}
- _nc_flush();
+ NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG);
}
/**************************************************************************
*
**************************************************************************/
-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);
*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);
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
| 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 */
}
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;
}
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)
* 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
*
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 *));
#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
/*
* 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*);
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*);
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
/****************************************************************************
- * 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)
{
#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);
#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;
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) {
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
* 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);
/* 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);
#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 */
#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
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)
{
/****************************************************************************
- * 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 *
* 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 *
****************************************************************************/
/*
#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 */
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;
}
/****************************************************************************
- * 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 *
* 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 *
****************************************************************************/
/*
#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))
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)) {
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;
}
}
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, " | ");
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;
if (n)
(void) _nc_trace_bufcat(bufnum, ", ");
(void) _nc_trace_bufcat(bufnum,
- _nc_tracechar(SP,
+ _nc_tracechar(CURRENT_SCREEN,
UChar(PUTC_buf[n])));
}
}
/*
* 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.
*/
}
static void
-ShowCursor(int flag)
+MyShowCursor(int flag)
{
if (startC != 0 && finisC != 0) {
tputs(flag ? startC : finisC, 1, outc);
{
Underline(0);
StandOut(0);
- ShowCursor(1);
+ MyShowCursor(1);
}
static void
startC = tgetstr("ve", &ap);
finisC = tgetstr("vi", &ap);
- ShowCursor(0);
+ MyShowCursor(0);
CATCHALL(onsig);
while (*args) {
ShowSign(*args++);
}
- ShowCursor(1);
+ MyShowCursor(1);
}
}