+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: NEWS,v 1.1409 2009/07/19 00:09:05 tom Exp $
+-- $Id: NEWS,v 1.1410 2009/07/25 15:50:22 tom Exp $
-------------------------------------------------------------------------------
This is a log of changes that ncurses has gone through since Zeyd started
-------------------------------------------------------------------------------
This is a log of changes that ncurses has gone through since Zeyd started
Changes through 1.9.9e did not credit all contributions;
it is not possible to add this information.
Changes through 1.9.9e did not credit all contributions;
it is not possible to add this information.
+20090725
+ + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
+
20090718
+ fix a null-pointer check in _nc_format_slks() in lib_slk.c, from
20070704 changes.
20090718
+ fix a null-pointer check in _nc_format_slks() in lib_slk.c, from
20070704 changes.
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: dist.mk,v 1.709 2009/07/15 23:12:22 tom Exp $
+# $Id: dist.mk,v 1.710 2009/07/25 15:38:47 tom Exp $
# Makefile for creating ncurses distributions.
#
# This only needs to be used directly as a makefile by developers, but
# Makefile for creating ncurses distributions.
#
# This only needs to be used directly as a makefile by developers, but
# These define the major/minor/patch versions of ncurses.
NCURSES_MAJOR = 5
NCURSES_MINOR = 7
# These define the major/minor/patch versions of ncurses.
NCURSES_MAJOR = 5
NCURSES_MINOR = 7
-NCURSES_PATCH = 20090718
+NCURSES_PATCH = 20090725
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
#include <curses.priv.h>
#include <ctype.h>
#include <curses.priv.h>
#include <ctype.h>
-MODULE_ID("$Id: lib_addch.c,v 1.119 2009/05/15 23:47:26 tom Exp $")
+MODULE_ID("$Id: lib_addch.c,v 1.120 2009/07/25 14:38:19 tom Exp $")
static const NCURSES_CH_T blankchar = NewChar(BLANK_TEXT);
static const NCURSES_CH_T blankchar = NewChar(BLANK_TEXT);
#if NCURSES_SP_FUNCS
#define DeriveSP() SCREEN *sp = _nc_screen_of(win);
#else
#if NCURSES_SP_FUNCS
#define DeriveSP() SCREEN *sp = _nc_screen_of(win);
#else
-#define DeriveSP() /*nothing*/
+#define DeriveSP() /*nothing */
#endif
if_WIDEC({
DeriveSP();
#endif
if_WIDEC({
DeriveSP();
switch (t) {
case '\t':
#if USE_REENTRANT
switch (t) {
case '\t':
#if USE_REENTRANT
- tabsize = sp->_TABSIZE;
+ tabsize = *ptrTabsize(sp);
#else
tabsize = TABSIZE;
#endif
#else
tabsize = TABSIZE;
#endif
-MODULE_ID("$Id: lib_getch.c,v 1.104 2009/07/04 20:41:13 tom Exp $")
+MODULE_ID("$Id: lib_getch.c,v 1.106 2009/07/25 17:02:03 tom Exp $")
#include <fifo_defs.h>
#if USE_REENTRANT
#define GetEscdelay(sp) *_nc_ptr_Escdelay(sp)
#include <fifo_defs.h>
#if USE_REENTRANT
#define GetEscdelay(sp) *_nc_ptr_Escdelay(sp)
-NCURSES_EXPORT(int *)
-_nc_ptr_Escdelay(SCREEN *sp)
-{
- return ptrEscdelay(sp);
-}
NCURSES_EXPORT(int)
NCURSES_PUBLIC_VAR(ESCDELAY) (void)
{
return *(_nc_ptr_Escdelay(CURRENT_SCREEN));
}
NCURSES_EXPORT(int)
NCURSES_PUBLIC_VAR(ESCDELAY) (void)
{
return *(_nc_ptr_Escdelay(CURRENT_SCREEN));
}
+
+NCURSES_EXPORT(int *)
+_nc_ptr_Escdelay(SCREEN *sp)
+{
+ return ptrEscdelay(sp);
+}
#else
#define GetEscdelay(sp) ESCDELAY
#else
#define GetEscdelay(sp) ESCDELAY
-NCURSES_EXPORT_VAR (int)
- ESCDELAY = 1000; /* max interval betw. chars in funkeys, in millisecs */
+NCURSES_EXPORT_VAR(int) ESCDELAY = 1000;
#endif
#if NCURSES_EXT_FUNCS
#endif
#if NCURSES_EXT_FUNCS
#ifndef CUR
#define CUR SP_TERMTYPE
#endif
#ifndef CUR
#define CUR SP_TERMTYPE
#endif
-MODULE_ID("$Id: lib_options.c,v 1.65 2009/07/04 18:14:31 tom Exp $")
-
-static int _nc_meta(SCREEN *, bool);
+MODULE_ID("$Id: lib_options.c,v 1.69 2009/07/25 16:05:16 tom Exp $")
NCURSES_EXPORT(int)
idlok(WINDOW *win, bool flag)
{
NCURSES_EXPORT(int)
idlok(WINDOW *win, bool flag)
{
-#if NCURSES_SP_FUNCS
- SCREEN *sp = CURRENT_SCREEN;
-#endif
T((T_CALLED("idlok(%p,%d)"), win, flag));
if (win) {
T((T_CALLED("idlok(%p,%d)"), win, flag));
if (win) {
- _nc_idlok = win->_idlok = (flag && (has_il() || change_scroll_region));
- returnCode(OK);
- } else
- returnCode(ERR);
+ SCREEN *sp = _nc_screen_of(win);
+ if (sp && IsTermInfo(sp)) {
+ sp->_nc_sp_idlok =
+ win->_idlok = (flag && (NCURSES_SP_NAME(has_il) (NCURSES_SP_ARG)
+ || change_scroll_region));
+ res = OK;
+ }
+ }
+ returnCode(res);
}
NCURSES_EXPORT(void)
idcok(WINDOW *win, bool flag)
{
}
NCURSES_EXPORT(void)
idcok(WINDOW *win, bool flag)
{
-#if NCURSES_SP_FUNCS
- SCREEN *sp = CURRENT_SCREEN;
-#endif
T((T_CALLED("idcok(%p,%d)"), win, flag));
T((T_CALLED("idcok(%p,%d)"), win, flag));
- if (win)
- _nc_idcok = win->_idcok = (flag && has_ic());
-
+ if (win) {
+ SCREEN *sp = _nc_screen_of(win);
+ sp->_nc_sp_idcok = win->_idcok = (flag && NCURSES_SP_NAME(has_ic) (NCURSES_SP_ARG));
+ }
returnVoid;
}
NCURSES_EXPORT(int)
NCURSES_SP_NAME(halfdelay) (NCURSES_SP_DCLx int t)
{
returnVoid;
}
NCURSES_EXPORT(int)
NCURSES_SP_NAME(halfdelay) (NCURSES_SP_DCLx int t)
{
- T((T_CALLED("halfdelay(%d)"), t));
+ T((T_CALLED("halfdelay(%p,%d)"), SP_PARM, t));
- if (t < 1 || t > 255 || SP_PARM == 0)
+ if (t < 1 || t > 255 || !IsValidTIScreen(SP_PARM))
+ NCURSES_SP_NAME(cbreak) (NCURSES_SP_ARG);
SP_PARM->_cbreak = t + 1;
returnCode(OK);
}
SP_PARM->_cbreak = t + 1;
returnCode(OK);
}
if (win) {
win->_use_keypad = flag;
if (win) {
win->_use_keypad = flag;
- returnCode(_nc_keypad(SP, flag));
+ returnCode(_nc_keypad(_nc_screen_of(win), flag));
} else
returnCode(ERR);
}
} else
returnCode(ERR);
}
NCURSES_EXPORT(int)
meta(WINDOW *win GCC_UNUSED, bool flag)
{
NCURSES_EXPORT(int)
meta(WINDOW *win GCC_UNUSED, bool flag)
{
+ int result = ERR;
+ SCREEN *sp = (win == 0) ? CURRENT_SCREEN : _nc_screen_of(win);
/* Ok, we stay relaxed and don't signal an error if win is NULL */
T((T_CALLED("meta(%p,%d)"), win, flag));
/* Ok, we stay relaxed and don't signal an error if win is NULL */
T((T_CALLED("meta(%p,%d)"), win, flag));
- result = _nc_meta(SP, flag);
+
+ /* Ok, we stay relaxed and don't signal an error if win is NULL */
+
+ if (sp != 0) {
+ sp->_use_meta = flag;
+#ifdef USE_TERM_DRIVER
+ if (IsTermInfo(sp)) {
+ if (flag) {
+ NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "meta_on", meta_on);
+ } else {
+ NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "meta_off", meta_off);
+ }
+ }
+#else
+ if (flag) {
+ NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "meta_on", meta_on);
+ } else {
+ NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "meta_off", meta_off);
+ }
+#endif
+ result = OK;
+ }
NCURSES_EXPORT(int)
NCURSES_SP_NAME(curs_set) (NCURSES_SP_DCLx int vis)
{
NCURSES_EXPORT(int)
NCURSES_SP_NAME(curs_set) (NCURSES_SP_DCLx int vis)
{
T((T_CALLED("curs_set(%p,%d)"), SP_PARM, vis));
T((T_CALLED("curs_set(%p,%d)"), SP_PARM, vis));
if (SP_PARM != 0 && vis >= 0 && vis <= 2) {
int cursor = SP_PARM->_cursor;
if (SP_PARM != 0 && vis >= 0 && vis <= 2) {
int cursor = SP_PARM->_cursor;
+ bool bBuiltIn = !IsTermInfo(SP_PARM);
- switch (vis) {
- case 2:
- result = _nc_putp_flush("cursor_visible", cursor_visible);
- break;
- case 1:
- result = _nc_putp_flush("cursor_normal", cursor_normal);
- break;
- case 0:
- result = _nc_putp_flush("cursor_invisible", cursor_invisible);
- break;
- }
- if (result != ERR)
- result = (cursor == -1 ? 1 : cursor);
+ if (!bBuiltIn) {
+ switch (vis) {
+ case 2:
+ code = NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx
+ "cursor_visible",
+ cursor_visible);
+ break;
+ case 1:
+ code = NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx
+ "cursor_normal",
+ cursor_normal);
+ break;
+ case 0:
+ code = NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx
+ "cursor_invisible",
+ cursor_invisible);
+ break;
+ }
+ } else
+ code = ERR;
+ if (code != ERR)
+ code = (cursor == -1 ? 1 : cursor);
SP_PARM->_cursor = vis;
}
}
SP_PARM->_cursor = vis;
}
}
NCURSES_EXPORT(int)
NCURSES_SP_NAME(typeahead) (NCURSES_SP_DCLx int fd)
{
NCURSES_EXPORT(int)
NCURSES_SP_NAME(typeahead) (NCURSES_SP_DCLx int fd)
{
- T((T_CALLED("typeahead(%d)"), fd));
- if (SP_PARM != 0) {
+ T((T_CALLED("typeahead(%p, %d)"), SP_PARM, fd));
+ if (IsValidTIScreen(SP_PARM)) {
SP_PARM->_checkfd = fd;
returnCode(OK);
} else {
SP_PARM->_checkfd = fd;
returnCode(OK);
} else {
|| has_key_internal(keycode, tp->sibling));
}
|| has_key_internal(keycode, tp->sibling));
}
+#ifdef USE_TERM_DRIVER
+NCURSES_EXPORT(int)
+_nc_tinfo_has_key(SCREEN *sp, int keycode)
+{
+ return IsValidTIScreen(sp) ?
+ has_key_internal(keycode, sp->_keytry) : 0;
+}
+#else
NCURSES_EXPORT(int)
NCURSES_SP_NAME(has_key) (NCURSES_SP_DCLx int keycode)
{
NCURSES_EXPORT(int)
NCURSES_SP_NAME(has_key) (NCURSES_SP_DCLx int keycode)
{
return NCURSES_SP_NAME(has_key) (CURRENT_SCREEN, keycode);
}
#endif
return NCURSES_SP_NAME(has_key) (CURRENT_SCREEN, keycode);
}
#endif
#endif /* NCURSES_EXT_FUNCS */
#endif /* NCURSES_EXT_FUNCS */
-/*
- * Internal entrypoints use SCREEN* parameter to obtain capabilities rather
- * than cur_term.
- */
-#undef CUR
-#define CUR SP_TERMTYPE
-
NCURSES_EXPORT(int)
NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_DCLx
const char *name, const char *value)
{
NCURSES_EXPORT(int)
NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_DCLx
const char *name, const char *value)
{
- int rc = _nc_putp(name, value);
+ int rc = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx name, value);
if (rc != ERR) {
_nc_flush();
}
return rc;
}
if (rc != ERR) {
_nc_flush();
}
return rc;
}
+#if 0 && NCURSES_SP_FUNCS
NCURSES_EXPORT(int)
_nc_putp_flush(const char *name, const char *value)
{
NCURSES_EXPORT(int)
_nc_putp_flush(const char *name, const char *value)
{
+#ifdef USE_TERM_DRIVER
+ rc = CallDriver_1(sp, kpad, flag);
+ if (rc == OK)
+ sp->_keypad_on = flag;
+#else
- (void) _nc_putp_flush("keypad_xmit", keypad_xmit);
+ (void) NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx
+ "keypad_xmit",
+ keypad_xmit);
} else if (!flag && keypad_local) {
} else if (!flag && keypad_local) {
- (void) _nc_putp_flush("keypad_local", keypad_local);
+ (void) NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx
+ "keypad_local",
+ keypad_local);
}
if (flag && !sp->_tried) {
}
if (flag && !sp->_tried) {
}
sp->_keypad_on = flag;
rc = OK;
}
sp->_keypad_on = flag;
rc = OK;
-
-static int
-_nc_meta(SCREEN *sp, bool flag)
-{
- int result = ERR;
-
- /* Ok, we stay relaxed and don't signal an error if win is NULL */
-
- if (sp != 0) {
- sp->_use_meta = flag;
-
- if (flag) {
- _nc_putp("meta_on", meta_on);
- } else {
- _nc_putp("meta_off", meta_off);
- }
- result = OK;
- }
- return result;
-}
-MODULE_ID("$Id: setbuf.c,v 1.14 2009/05/09 23:09:00 tom Exp $")
+MODULE_ID("$Id: setbuf.c,v 1.15 2009/05/23 22:13:44 tom Exp $")
/*
* If the output file descriptor is connected to a tty (the typical case) it
/*
* If the output file descriptor is connected to a tty (the typical case) it
NCURSES_EXPORT(void)
NCURSES_SP_NAME(_nc_set_buffer) (NCURSES_SP_DCLx FILE *ofp, bool buffered)
{
NCURSES_EXPORT(void)
NCURSES_SP_NAME(_nc_set_buffer) (NCURSES_SP_DCLx FILE *ofp, bool buffered)
{
+ int Cols;
+ int Lines;
+
+ if (0 == SP_PARM)
+ return;
+
+ Cols = *(ptrCols(SP_PARM));
+ Lines = *(ptrLines(SP_PARM));
+
/* optional optimization hack -- do before any output to ofp */
#if HAVE_SETVBUF || HAVE_SETBUFFER
if (SP_PARM->_buffered != buffered) {
/* optional optimization hack -- do before any output to ofp */
#if HAVE_SETVBUF || HAVE_SETBUFFER
if (SP_PARM->_buffered != buffered) {
setmode(ofp, O_BINARY);
#endif
if (buffered != 0) {
setmode(ofp, O_BINARY);
#endif
if (buffered != 0) {
- buf_len = min(LINES * (COLS + 6), 2800);
+ buf_len = min(Lines * (Cols + 6), 2800);
if ((buf_ptr = SP_PARM->_setbuf) == 0) {
if ((buf_ptr = typeMalloc(char, buf_len)) == NULL)
return;
if ((buf_ptr = SP_PARM->_setbuf) == 0) {
if ((buf_ptr = typeMalloc(char, buf_len)) == NULL)
return;
NCURSES_EXPORT(void)
_nc_set_buffer(FILE *ofp, bool buffered)
{
NCURSES_EXPORT(void)
_nc_set_buffer(FILE *ofp, bool buffered)
{
- return NCURSES_SP_NAME(_nc_set_buffer) (CURRENT_SCREEN, ofp, buffered);
+ NCURSES_SP_NAME(_nc_set_buffer) (CURRENT_SCREEN, ofp, buffered);
#include <wctype.h>
#endif
#include <wctype.h>
#endif
-MODULE_ID("$Id: lib_add_wch.c,v 1.7 2009/07/04 21:59:25 tom Exp $")
+MODULE_ID("$Id: lib_add_wch.c,v 1.8 2009/07/25 14:38:01 tom Exp $")
/* clone/adapt lib_addch.c */
static const cchar_t blankchar = NewChar(BLANK_TEXT);
/* clone/adapt lib_addch.c */
static const cchar_t blankchar = NewChar(BLANK_TEXT);
NCURSES_SIZE_T x, y;
wchar_t *s;
int tabsize = 8;
NCURSES_SIZE_T x, y;
wchar_t *s;
int tabsize = 8;
+#if USE_REENTRANT
+ SCREEN *sp = _nc_screen_of(win);
+#endif
/*
* If we are using the alternate character set, forget about locale.
/*
* If we are using the alternate character set, forget about locale.
switch (CharOf(ch)) {
case '\t':
#if USE_REENTRANT
switch (CharOf(ch)) {
case '\t':
#if USE_REENTRANT
- tabsize = sp->_TABSIZE;
+ tabsize = *ptrTabsize(sp);
#else
tabsize = TABSIZE;
#endif
#else
tabsize = TABSIZE;
#endif