From 18865150079f74b17047633094e3994516af8a41 Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Sun, 24 May 2009 01:18:15 +0000 Subject: [PATCH] ncurses 5.7 - patch 20090523 + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). --- NEWS | 5 +++- dist.mk | 4 +-- include/curses.h.in | 3 +- include/curses.tail | 3 +- ncurses/base/lib_beep.c | 14 +++++---- ncurses/base/lib_delwin.c | 19 +++++++++---- ncurses/base/lib_dft_fgbg.c | 43 +++++++++++++++------------- ncurses/base/lib_flash.c | 14 +++++---- ncurses/base/lib_slkinit.c | 22 ++++++++++---- ncurses/base/wresize.c | 12 +++++--- ncurses/curses.priv.h | 34 ++++++++++++++++------ ncurses/tinfo/MKcodes.awk | 4 +-- ncurses/tinfo/lib_options.c | 27 ++---------------- ncurses/tinfo/lib_termcap.c | 57 +++++++++++++++++++++++++++---------- ncurses/tinfo/lib_tputs.c | 23 +++++++++++++-- 15 files changed, 182 insertions(+), 102 deletions(-) diff --git a/NEWS b/NEWS index 7d93054a..98b5d4d2 100644 --- a/NEWS +++ b/NEWS @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.1388 2009/05/17 00:20:31 tom Exp $ +-- $Id: NEWS,v 1.1389 2009/05/23 22:48:27 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,9 @@ 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. +20090523 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + 20090516 + work around antique BSD game's manipulation of stdscr, etc., versus SCREEN's copy of the pointer (Debian #528411). diff --git a/dist.mk b/dist.mk index de34e5de..f52e386d 100644 --- a/dist.mk +++ b/dist.mk @@ -25,7 +25,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: dist.mk,v 1.700 2009/05/15 23:35:19 tom Exp $ +# $Id: dist.mk,v 1.701 2009/05/23 18:08:28 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 = 20090516 +NCURSES_PATCH = 20090523 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/include/curses.h.in b/include/curses.h.in index 665645b2..3fae546d 100644 --- a/include/curses.h.in +++ b/include/curses.h.in @@ -32,7 +32,7 @@ * and: Thomas E. Dickey 1996-on * ****************************************************************************/ -/* $Id: curses.h.in,v 1.200 2009/05/16 23:27:59 tom Exp $ */ +/* $Id: curses.h.in,v 1.201 2009/05/23 21:31:35 tom Exp $ */ #ifndef __NCURSES_H #define __NCURSES_H @@ -917,6 +917,7 @@ extern NCURSES_EXPORT(char) NCURSES_SP_NAME(erasechar) (SCREEN*);/* implemented extern NCURSES_EXPORT(void) NCURSES_SP_NAME(filter) (SCREEN*); /* implemented */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(flash) (SCREEN*); /* implemented */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(flushinp) (SCREEN*); /* implemented */ +extern NCURSES_EXPORT(WINDOW *) NCURSES_SP_NAME(getwin) (SCREEN*, FILE *); /* implemented */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(halfdelay)(SCREEN*, int); /* implemented */ extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_colors) (SCREEN*); /* implemented */ extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_ic) (SCREEN*); /* implemented */ diff --git a/include/curses.tail b/include/curses.tail index fb2b8c84..9477a150 100644 --- a/include/curses.tail +++ b/include/curses.tail @@ -1,4 +1,4 @@ -/* $Id: curses.tail,v 1.18 2009/04/18 21:30:52 tom Exp $ */ +/* $Id: curses.tail,v 1.19 2009/05/23 19:19:43 tom Exp $ */ /* * vile:cmode: * This file is part of ncurses, designed to be appended after curses.h.in @@ -120,6 +120,7 @@ extern NCURSES_EXPORT(int) has_key (int); /* do we have given key? */ #if NCURSES_SP_FUNCS extern NCURSES_EXPORT(int) NCURSES_SP_NAME(has_key) (SCREEN*, int); /* do we have given key? */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(mcprint) (SCREEN*, char *, int); /* direct data to printer */ #endif /* Debugging : use with libncurses_g.a */ diff --git a/ncurses/base/lib_beep.c b/ncurses/base/lib_beep.c index 0093a382..0bad4c16 100644 --- a/ncurses/base/lib_beep.c +++ b/ncurses/base/lib_beep.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2009 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 * @@ -41,13 +41,12 @@ */ #include -#include /* beep, flash */ #ifndef CUR -#define CUR SP_TERMTYPE +#define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_beep.c,v 1.13 2009/05/10 00:48:29 tom Exp $") +MODULE_ID("$Id: lib_beep.c,v 1.14 2009/05/23 19:33:20 tom Exp $") /* * beep() @@ -62,8 +61,12 @@ NCURSES_SP_NAME(beep) (NCURSES_SP_DCL0) { int res = ERR; - T((T_CALLED("beep()"))); + T((T_CALLED("beep(%p)"), SP_PARM)); +#ifdef USE_TERM_DRIVER + if (SP_PARM != 0) + res = CallDriver_1(SP_PARM, doBeepOrFlash, TRUE); +#else /* FIXME: should make sure that we are not in altchar mode */ if (cur_term == 0) { res = ERR; @@ -76,6 +79,7 @@ NCURSES_SP_NAME(beep) (NCURSES_SP_DCL0) res = putp(flash_screen); _nc_flush(); } +#endif returnCode(res); } diff --git a/ncurses/base/lib_delwin.c b/ncurses/base/lib_delwin.c index e7a4b89d..59fa3f77 100644 --- a/ncurses/base/lib_delwin.c +++ b/ncurses/base/lib_delwin.c @@ -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 * @@ -29,6 +29,8 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2008 * ****************************************************************************/ /* @@ -40,15 +42,18 @@ #include -MODULE_ID("$Id: lib_delwin.c,v 1.18 2009/05/09 18:30:57 tom Exp $") +MODULE_ID("$Id: lib_delwin.c,v 1.19 2009/05/23 19:56:55 tom Exp $") static bool cannot_delete(WINDOW *win) { WINDOWLIST *p; bool result = TRUE; +#ifdef USE_SP_WINDOWLIST + SCREEN *sp = _nc_screen_of(win); +#endif - for (each_window(SP, p)) { + for (each_window(SP_PARM, p)) { if (&(p->win) == win) { result = FALSE; } else if ((p->win._flags & _SUBWIN) != 0 @@ -72,11 +77,13 @@ delwin(WINDOW *win) || cannot_delete(win)) { result = ERR; } else { - +#if NCURSES_SP_FUNCS + SCREEN *sp = _nc_screen_of(win); +#endif if (win->_flags & _SUBWIN) touchwin(win->_parent); - else if (curscr != 0) - touchwin(curscr); + else if (CurScreen(SP_PARM) != 0) + touchwin(CurScreen(SP_PARM)); result = _nc_freewin(win); } diff --git a/ncurses/base/lib_dft_fgbg.c b/ncurses/base/lib_dft_fgbg.c index 1d8f5d24..eda19761 100644 --- a/ncurses/base/lib_dft_fgbg.c +++ b/ncurses/base/lib_dft_fgbg.c @@ -32,13 +32,12 @@ ****************************************************************************/ #include -#include #ifndef CUR -#define CUR SP_TERMTYPE +#define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_dft_fgbg.c,v 1.21 2009/05/10 00:48:29 tom Exp $") +MODULE_ID("$Id: lib_dft_fgbg.c,v 1.23 2009/05/23 23:04:15 tom Exp $") /* * Modify the behavior of color-pair 0 so that the library doesn't assume that @@ -47,7 +46,7 @@ MODULE_ID("$Id: lib_dft_fgbg.c,v 1.21 2009/05/10 00:48:29 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(use_default_colors) (NCURSES_SP_DCL0) { - T((T_CALLED("use_default_colors()"))); + T((T_CALLED("use_default_colors(%p)"), SP_PARM)); returnCode(NCURSES_SP_NAME(assume_default_colors) (NCURSES_SP_ARGx -1, -1)); } @@ -66,25 +65,29 @@ use_default_colors(void) NCURSES_EXPORT(int) NCURSES_SP_NAME(assume_default_colors) (NCURSES_SP_DCLx int fg, int bg) { - T((T_CALLED("assume_default_colors(%d,%d)"), fg, bg)); + int code = ERR; - if (!orig_pair && !orig_colors) - returnCode(ERR); + T((T_CALLED("assume_default_colors(%p,%d,%d)"), SP_PARM, fg, bg)); +#ifdef USE_TERM_DRIVER + if (SP_PARM != 0) + code = CallDriver_2(SP_PARM, defaultcolors, fg, bg); +#else + if ((orig_pair || orig_colors) && !initialize_pair) { - if (initialize_pair) /* don't know how to handle this */ - returnCode(ERR); - - SP_PARM->_default_color = isDefaultColor(fg) || isDefaultColor(bg); - SP_PARM->_has_sgr_39_49 = (tigetflag("AX") == TRUE); - SP_PARM->_default_fg = isDefaultColor(fg) ? COLOR_DEFAULT : (fg & C_MASK); - SP_PARM->_default_bg = isDefaultColor(bg) ? COLOR_DEFAULT : (bg & C_MASK); - if (SP_PARM->_color_pairs != 0) { - bool save = SP_PARM->_default_color; - SP_PARM->_default_color = TRUE; - init_pair(0, (short) fg, (short) bg); - SP_PARM->_default_color = save; + SP_PARM->_default_color = isDefaultColor(fg) || isDefaultColor(bg); + SP_PARM->_has_sgr_39_49 = (tigetflag("AX") == TRUE); + SP_PARM->_default_fg = isDefaultColor(fg) ? COLOR_DEFAULT : (fg & C_MASK); + SP_PARM->_default_bg = isDefaultColor(bg) ? COLOR_DEFAULT : (bg & C_MASK); + if (SP_PARM->_color_pairs != 0) { + bool save = SP_PARM->_default_color; + SP_PARM->_default_color = TRUE; + init_pair(0, (short) fg, (short) bg); + SP_PARM->_default_color = save; + } + code = OK; } - returnCode(OK); +#endif + returnCode(code); } #if NCURSES_SP_FUNCS diff --git a/ncurses/base/lib_flash.c b/ncurses/base/lib_flash.c index 68fea134..8fbf91cf 100644 --- a/ncurses/base/lib_flash.c +++ b/ncurses/base/lib_flash.c @@ -41,13 +41,12 @@ */ #include -#include /* beep, flash */ #ifndef CUR -#define CUR SP_TERMTYPE +#define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_flash.c,v 1.9 2009/05/10 00:48:29 tom Exp $") +MODULE_ID("$Id: lib_flash.c,v 1.10 2009/05/23 19:37:09 tom Exp $") /* * flash() @@ -62,8 +61,11 @@ NCURSES_SP_NAME(flash) (NCURSES_SP_DCL0) { int res = ERR; - T((T_CALLED("flash()"))); - + T((T_CALLED("flash(%p)"), SP_PARM)); +#ifdef USE_TERM_DRIVER + if (SP_PARM != 0) + res = CallDriver_1(SP_PARM, doBeepOrFlash, FALSE); +#else /* FIXME: should make sure that we are not in altchar mode */ if (flash_screen) { TPUTS_TRACE("flash_screen"); @@ -74,7 +76,7 @@ NCURSES_SP_NAME(flash) (NCURSES_SP_DCL0) res = putp(bell); _nc_flush(); } - +#endif returnCode(res); } diff --git a/ncurses/base/lib_slkinit.c b/ncurses/base/lib_slkinit.c index 29cfeedb..e7fa1221 100644 --- a/ncurses/base/lib_slkinit.c +++ b/ncurses/base/lib_slkinit.c @@ -30,6 +30,7 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -39,7 +40,13 @@ */ #include -MODULE_ID("$Id: lib_slkinit.c,v 1.10 2009/05/09 18:32:07 tom Exp $") +MODULE_ID("$Id: lib_slkinit.c,v 1.11 2009/05/23 23:32:57 tom Exp $") + +#ifdef USE_SP_RIPOFF +#define SoftkeyFormat SP_PARM->slk_format +#else +#define SoftkeyFormat _nc_globals.slk_format +#endif NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_init) (NCURSES_SP_DCLx int format) @@ -48,11 +55,16 @@ NCURSES_SP_NAME(slk_init) (NCURSES_SP_DCLx int format) T((T_CALLED("slk_init(%p,%d)"), SP_PARM, format)); - if (SP_PARM && format >= 0 && format <= 3 && !SP_PARM->slk_format && - SP_PARM->_prescreen) { - SP_PARM->slk_format = 1 + format; + if (format >= 0 + && format <= 3 +#ifdef USE_SP_RIPOFF + && SP_PARM + && SP_PARM->_prescreen +#endif + && !SoftkeyFormat) { + SoftkeyFormat = 1 + format; code = NCURSES_SP_NAME(_nc_ripoffline) (NCURSES_SP_ARGx - -SLK_LINES(SP_PARM->slk_format), + -SLK_LINES(SoftkeyFormat), _nc_slk_initialize); } returnCode(code); diff --git a/ncurses/base/wresize.c b/ncurses/base/wresize.c index 49e0d58a..e441b669 100644 --- a/ncurses/base/wresize.c +++ b/ncurses/base/wresize.c @@ -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 * @@ -27,12 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 1996-2002 * + * Author: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer * ****************************************************************************/ #include -MODULE_ID("$Id: wresize.c,v 1.30 2009/05/09 18:37:43 tom Exp $") +MODULE_ID("$Id: wresize.c,v 1.31 2009/05/23 19:50:16 tom Exp $") static int cleanup_lines(struct ldat *data, int length) @@ -53,10 +54,13 @@ repair_subwindows(WINDOW *cmp) WINDOWLIST *wp; struct ldat *pline = cmp->_line; int row; +#ifdef USE_SP_WINDOWLIST + SCREEN *sp = _nc_screen_of(cmp); +#endif _nc_lock_global(curses); - for (each_window(SP, wp)) { + for (each_window(SP_PARM, wp)) { WINDOW *tst = &(wp->win); if (tst->_parent == cmp) { diff --git a/ncurses/curses.priv.h b/ncurses/curses.priv.h index 007ed445..f6d4c47b 100644 --- a/ncurses/curses.priv.h +++ b/ncurses/curses.priv.h @@ -35,7 +35,7 @@ /* - * $Id: curses.priv.h,v 1.416 2009/05/10 01:01:51 tom Exp $ + * $Id: curses.priv.h,v 1.417 2009/05/23 23:01:44 tom Exp $ * * curses.priv.h * @@ -194,9 +194,14 @@ extern NCURSES_EXPORT(void *) _nc_memmove (void *, const void *, size_t); #endif /* - * Terminal drivers... + * Options for terminal drivers, etc... */ -#define USE_TERM_DRIVER 0 +#if 0 +#define USE_SP_RIPOFF 1 +#define USE_SP_TERMTYPE 1 +#define USE_SP_WINDOWLIST 1 +#define USE_TERM_DRIVER 1 +#endif /* * Note: ht/cbt expansion flakes out randomly under Linux 1.1.47, but only @@ -678,8 +683,10 @@ typedef struct { int tgetent_index; long tgetent_sequence; +#ifndef USE_SP_WINDOWLIST WINDOWLIST *_nc_windowlist; #define WindowList(sp) _nc_globals._nc_windowlist +#endif #if USE_HOME_TERMINFO char *home_terminfo; @@ -740,8 +747,10 @@ typedef struct { bool use_env; bool filter_mode; attr_t previous_attr; +#ifndef USE_SP_RIPOFF ripoff_t rippedoff[N_RIPS]; ripoff_t *rsp; +#endif TPARM_STATE tparm_state; TTY *saved_tty; /* savetty/resetty information */ #if NCURSES_NO_PADDING @@ -1002,7 +1011,7 @@ struct screen { char tracechr_buf[40]; char tracemse_buf[TRACEMSE_MAX]; #endif -#if 0 +#ifdef USE_SP_WINDOWLIST WINDOWLIST* _windowlist; #define WindowList(sp) (sp)->_windowlist #endif @@ -1805,6 +1814,7 @@ extern NCURSES_EXPORT_VAR(SCREEN *) SP; #define screen_columns(sp) (sp)->_columns extern NCURSES_EXPORT(int) _nc_slk_initialize (WINDOW *, int); +extern NCURSES_EXPORT(int) _nc_format_slks (SCREEN *, int); /* * Some constants related to SLK's @@ -1830,6 +1840,9 @@ extern NCURSES_EXPORT(int) _nc_ripoffline (int line, int (*init)(WINDOW *,int)); #define MSG_NO_MEMORY "Out of memory" #define MSG_NO_INPUTS "Premature EOF" +extern NCURSES_EXPORT(int) _nc_set_tty_mode(TTY *); +extern NCURSES_EXPORT(int) _nc_get_tty_mode(TTY *); + /* timed_wait flag definitions */ #define TW_NONE 0 #define TW_INPUT 1 @@ -1937,13 +1950,20 @@ typedef struct DriverTCB extern NCURSES_EXPORT_VAR(const color_t*) _nc_cga_palette; extern NCURSES_EXPORT_VAR(const color_t*) _nc_hls_palette; +#ifdef USE_TERM_DRIVER +extern NCURSES_EXPORT(int) _nc_tinfo_has_key(SCREEN*, int); +extern NCURSES_EXPORT(int) _nc_tinfo_doupdate(SCREEN *sp); +extern NCURSES_EXPORT(int) _nc_tinfo_mvcur(SCREEN*,int,int,int,int); +extern NCURSES_EXPORT(int) _nc_get_driver(TERMINAL_CONTROL_BLOCK*, const char*, int*); +#endif + #ifdef __MINGW32__ #include extern NCURSES_EXPORT_VAR(TERM_DRIVER) _nc_WIN_DRIVER; #endif extern NCURSES_EXPORT_VAR(TERM_DRIVER) _nc_TINFO_DRIVER; -#if USE_TERM_DRIVER +#ifdef USE_TERM_DRIVER #define IsTermInfo(sp) (TCBOf(sp) && ((TCBOf(sp)->drv->isTerminfo))) #else #define IsTermInfo(sp) TRUE @@ -1988,7 +2008,7 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_get_tty_mode)(SCREEN*,TTY*); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_mcprint)(SCREEN*,char*, int); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_msec_cost)(SCREEN*, const char *, int); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_outch)(SCREEN*, int); -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_putp)(SCREEN*, const char *, const char *); +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_resetty)(SCREEN*); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_resize_term)(SCREEN*,int,int); @@ -2022,8 +2042,6 @@ extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_scroll_optimize)(SCREEN*); extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_set_buffer)(SCREEN*, FILE *, bool); extern NCURSES_EXPORT(void) _nc_cookie_init(SCREEN *sp); -extern NCURSES_EXPORT(int) _nc_tinfo_doupdate(SCREEN *sp); -extern NCURSES_EXPORT(int) _nc_tinfo_mcprint(SCREEN*,char*,int); #if defined(TRACE) || defined(SCROLLDEBUG) || defined(HASHDEBUG) extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_linedump)(SCREEN*); diff --git a/ncurses/tinfo/MKcodes.awk b/ncurses/tinfo/MKcodes.awk index 16cbe642..49e2ebc2 100644 --- a/ncurses/tinfo/MKcodes.awk +++ b/ncurses/tinfo/MKcodes.awk @@ -25,7 +25,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: MKcodes.awk,v 1.7 2009/03/28 18:22:39 Charles.Wilson Exp $ +# $Id: MKcodes.awk,v 1.8 2009/05/23 19:09:54 tom Exp $ function large_item(value) { result = sprintf("%d,", offset); offset = offset + length(value) + 1; @@ -117,7 +117,7 @@ END { print " if ((*value = typeCalloc(NCURSES_CONST char *, size + 1)) != 0) {" print " unsigned n;" print " for (n = 0; n < size; ++n) {" - print " (*value)[n] = _nc_code_blob + offsets[n];" + print " (*value)[n] = (NCURSES_CONST char *) _nc_code_blob + offsets[n];" print " }" print " }" print " }" diff --git a/ncurses/tinfo/lib_options.c b/ncurses/tinfo/lib_options.c index e8125319..f22d6c5c 100644 --- a/ncurses/tinfo/lib_options.c +++ b/ncurses/tinfo/lib_options.c @@ -45,10 +45,10 @@ #include #ifndef CUR -#define CUR SP_TERMTYPE +#define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_options.c,v 1.63 2009/05/10 00:48:29 tom Exp $") +MODULE_ID("$Id: lib_options.c,v 1.64 2009/05/23 23:58:07 tom Exp $") static int _nc_meta(SCREEN *, bool); @@ -262,28 +262,7 @@ has_key(int keycode) * than cur_term. */ #undef CUR -#define CUR SP_TERMTYPE - -NCURSES_EXPORT(int) -NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_DCLx - const char *name GCC_UNUSED, const char *value) -{ - int rc = ERR; - - if (value) { - TPUTS_TRACE(name); - rc = putp(value); - } - return rc; -} - -#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 +#define CUR SP_TERMTYPE NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_DCLx diff --git a/ncurses/tinfo/lib_termcap.c b/ncurses/tinfo/lib_termcap.c index 4c0097db..fbaacb42 100644 --- a/ncurses/tinfo/lib_termcap.c +++ b/ncurses/tinfo/lib_termcap.c @@ -30,6 +30,7 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer * * * * some of the code in here was contributed by: * * Magnus Bengtsson, d6mbeng@dtek.chalmers.se (Nov'93) * @@ -46,10 +47,10 @@ #include #ifndef CUR -#define CUR SP_TERMTYPE +#define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_termcap.c,v 1.65 2009/05/10 00:48:29 tom Exp $") +MODULE_ID("$Id: lib_termcap.c,v 1.66 2009/05/23 23:47:34 tom Exp $") NCURSES_EXPORT_VAR(char *) UP = 0; NCURSES_EXPORT_VAR(char *) BC = 0; @@ -80,11 +81,8 @@ NCURSES_EXPORT_VAR(char *) BC = 0; ***************************************************************************/ NCURSES_EXPORT(int) -tgetent(char *bufp, const char *name) +NCURSES_SP_NAME(tgetent) (NCURSES_SP_DCLx char *bufp, const char *name) { -#if NCURSES_SP_FUNCS - SCREEN *sp = CURRENT_SCREEN; -#endif int errcode; int n; bool found_cache = FALSE; @@ -118,7 +116,7 @@ tgetent(char *bufp, const char *name) */ if (LAST_TRM != 0 && LAST_TRM != cur_term) { TERMINAL *trm = LAST_TRM; - del_curterm(LAST_TRM); + NCURSES_SP_NAME(del_curterm) (NCURSES_SP_ARGx LAST_TRM); for (CacheInx = 0; CacheInx < TGETENT_MAX; ++CacheInx) if (LAST_TRM == trm) LAST_TRM = 0; @@ -171,8 +169,8 @@ tgetent(char *bufp, const char *name) LAST_BUF = bufp; LAST_USE = TRUE; - SetNoPadding(SP); - (void) baudrate(); /* sets ospeed as a side-effect */ + SetNoPadding(SP_PARM); + (void) NCURSES_SP_NAME(baudrate) (NCURSES_SP_ARG); /* sets ospeed as a side-effect */ /* LINT_PREPRO #if 0*/ @@ -184,6 +182,14 @@ tgetent(char *bufp, const char *name) returnCode(errcode); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +tgetent(char *bufp, const char *name) +{ + return NCURSES_SP_NAME(tgetent) (CURRENT_SCREEN, bufp, name); +} +#endif + /*************************************************************************** * * tgetflag(str) @@ -194,7 +200,7 @@ tgetent(char *bufp, const char *name) ***************************************************************************/ NCURSES_EXPORT(int) -tgetflag(NCURSES_CONST char *id) +NCURSES_SP_NAME(tgetflag) (NCURSES_SP_DCLx NCURSES_CONST char *id) { unsigned i; @@ -212,6 +218,14 @@ tgetflag(NCURSES_CONST char *id) returnCode(0); /* Solaris does this */ } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +tgetflag(NCURSES_CONST char *id) +{ + return NCURSES_SP_NAME(tgetflag) (CURRENT_SCREEN, id); +} +#endif + /*************************************************************************** * * tgetnum(str) @@ -222,7 +236,7 @@ tgetflag(NCURSES_CONST char *id) ***************************************************************************/ NCURSES_EXPORT(int) -tgetnum(NCURSES_CONST char *id) +NCURSES_SP_NAME(tgetnum) (NCURSES_SP_DCLx NCURSES_CONST char *id) { unsigned i; @@ -241,6 +255,14 @@ tgetnum(NCURSES_CONST char *id) returnCode(ABSENT_NUMERIC); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +tgetnum(NCURSES_CONST char *id) +{ + return NCURSES_SP_NAME(tgetnum) (CURRENT_SCREEN, id); +} +#endif + /*************************************************************************** * * tgetstr(str, area) @@ -251,11 +273,8 @@ tgetnum(NCURSES_CONST char *id) ***************************************************************************/ NCURSES_EXPORT(char *) -tgetstr(NCURSES_CONST char *id, char **area) +NCURSES_SP_NAME(tgetstr) (NCURSES_SP_DCLx NCURSES_CONST char *id, char **area) { -#if NCURSES_SP_FUNCS - SCREEN *sp = CURRENT_SCREEN; -#endif unsigned i; char *result = NULL; @@ -288,6 +307,14 @@ tgetstr(NCURSES_CONST char *id, char **area) returnPtr(result); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(char *) +tgetstr(NCURSES_CONST char *id, char **area) +{ + return NCURSES_SP_NAME(tgetstr) (CURRENT_SCREEN, id, area); +} +#endif + #if NO_LEAKS NCURSES_EXPORT(void) _nc_tgetent_leaks(void) diff --git a/ncurses/tinfo/lib_tputs.c b/ncurses/tinfo/lib_tputs.c index e3dc8d32..0bea1b78 100644 --- a/ncurses/tinfo/lib_tputs.c +++ b/ncurses/tinfo/lib_tputs.c @@ -48,11 +48,10 @@ #endif #include -#include /* padding_baud_rate, xon_xoff */ #include /* ospeed */ #include -MODULE_ID("$Id: lib_tputs.c,v 1.73 2009/05/10 00:54:17 tom Exp $") +MODULE_ID("$Id: lib_tputs.c,v 1.74 2009/05/23 23:56:23 tom Exp $") NCURSES_EXPORT_VAR(char) PC = 0; /* used by termcap library */ NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed = 0; /* used by termcap library */ @@ -158,12 +157,32 @@ NCURSES_SP_NAME(putp) (NCURSES_SP_DCLx const char *string) string, 1, NCURSES_SP_NAME(_nc_outch)); } +NCURSES_EXPORT(int) +NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_DCLx + const char *name GCC_UNUSED, + const char *string) +{ + int rc = ERR; + + if (string != 0) { + TPUTS_TRACE(name); + rc = NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx string); + } + return rc; +} + #if NCURSES_SP_FUNCS NCURSES_EXPORT(int) putp(const char *string) { return NCURSES_SP_NAME(putp) (CURRENT_SCREEN, string); } + +NCURSES_EXPORT(int) +_nc_putp(const char *name, const char *string) +{ + return NCURSES_SP_NAME(_nc_putp) (CURRENT_SCREEN, name, string); +} #endif NCURSES_EXPORT(int) -- 2.44.0