-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: NEWS,v 1.1383 2009/04/25 21:28:43 tom Exp $
+-- $Id: NEWS,v 1.1384 2009/05/02 22:27:02 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.
+20090502
+ + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
+ + add vwmterm terminfo entry (patch by Bryan Christ).
+
20090425
+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
* Demo code for NCursesMenu and NCursesForm written by
* Juergen Pfeifer
*
- * $Id: demo.cc,v 1.38 2008/08/04 17:16:57 tom Exp $
+ * $Id: demo.cc,v 1.39 2008/12/07 02:07:34 juergen Exp $
*/
#include "internal.h"
#include "cursesm.h"
#include "cursesf.h"
+#ifdef __MINGW32__
+#undef KEY_EVENT
+#endif
+
+#ifndef __MINGW32__
extern "C" unsigned int sleep(unsigned int);
+#endif
#undef index // needed for NeXT
* Author: Juergen Pfeifer, 1997 *
****************************************************************************/
-// $Id: internal.h,v 1.16 2008/10/25 21:35:44 tom Exp $
+// $Id: internal.h,v 1.17 2008/12/07 02:07:34 juergen Exp $
#ifndef NCURSES_CPLUS_INTERNAL_H
#define NCURSES_CPLUS_INTERNAL_H 1
#define MODULE_ID(id) /*nothing*/
#endif
+#ifdef __MINGW32__
+#include <nc_mingw.h>
+#undef KEY_EVENT
+#endif
+
#ifndef _QNX_SOURCE
#include <stdlib.h>
#include <string.h>
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: dist.mk,v 1.696 2009/04/25 17:43:20 tom Exp $
+# $Id: dist.mk,v 1.697 2009/05/02 17:26:04 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 = 20090425
+NCURSES_PATCH = 20090502
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
print "/* and: Thomas E. Dickey 1995-on */"
print "/****************************************************************************/"
print ""
- print "/* $Id: MKterm.h.awk.in,v 1.55 2009/04/25 18:02:27 tom Exp $ */"
+ print "/* $Id: MKterm.h.awk.in,v 1.56 2009/05/02 19:25:57 tom Exp $ */"
print ""
print "/*"
print "** term.h -- Definition of struct term"
print ""
print "extern NCURSES_EXPORT(TERMINAL *) NCURSES_SP_NAME(set_curterm) (SCREEN*, TERMINAL *);"
print "extern NCURSES_EXPORT(int) NCURSES_SP_NAME(del_curterm) (SCREEN*, TERMINAL *);"
+ print ""
+ print "extern NCURSES_EXPORT(int) NCURSES_SP_NAME(restartterm) (SCREEN*, NCURSES_CONST char *, int, int *);"
print "#endif /* NCURSES_SP_FUNCS */"
print ""
print "#ifdef __cplusplus"
* and: Thomas E. Dickey 1996-on *
****************************************************************************/
-/* $Id: curses.h.in,v 1.197 2009/04/25 21:03:34 tom Exp $ */
+/* $Id: curses.h.in,v 1.198 2009/05/02 21:59:55 tom Exp $ */
#ifndef __NCURSES_H
#define __NCURSES_H
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(typeahead) (SCREEN*, int); /* implemented */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(ungetch) (SCREEN*, int); /* implemented */
extern NCURSES_EXPORT(void) NCURSES_SP_NAME(use_env) (SCREEN*, bool); /* implemented */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vidattr) (SCREEN*, chtype); /* implemented */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vidputs) (SCREEN*, chtype, int (*)(int)); /* implemented */
#if @NCURSES_EXT_FUNCS@
extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(keybound) (SCREEN*, int, int);
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(assume_default_colors) (SCREEN*, int, int);
-/* $Id: curses.wide,v 1.37 2009/04/18 21:34:06 tom Exp $ */
+/* $Id: curses.wide,v 1.38 2009/05/02 23:12:00 tom Exp $ */
/*
* vile:cmode:
* This file is part of ncurses, designed to be appended after curses.h.in
extern NCURSES_EXPORT(attr_t) NCURSES_SP_NAME(term_attrs) (SCREEN*); /* implemented */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(unget_wch) (SCREEN*, const wchar_t); /* implemented */
extern NCURSES_EXPORT(wchar_t*) NCURSES_SP_NAME(wunctrl) (SCREEN*, cchar_t *); /* implemented */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vid_attr) (SCREEN*, attr_t, short, void *);
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vid_puts) (SCREEN*, attr_t, short, void *, int (*)(int));
#endif
#ifndef NCURSES_NOMACROS
-# $Id: ncurses_defs,v 1.40 2008/09/06 15:57:41 tom Exp $
+# $Id: ncurses_defs,v 1.41 2008/11/16 00:19:59 juergen Exp $
##############################################################################
# Copyright (c) 2000-2007,2008 Free Software Foundation, Inc. #
# #
NCURSES_EXT_FUNCS
NCURSES_NO_PADDING
NCURSES_PATHSEP ':'
-NDEBUG
NEED_PTEM_H
NO_LEAKS
PURE_TERMINFO
# Report bugs and new terminal descriptions to
# bug-ncurses@gnu.org
#
-# $Revision: 1.347 $
-# $Date: 2009/03/28 23:19:33 $
+# $Revision: 1.348 $
+# $Date: 2009/05/02 22:23:20 $
#
# The original header is preserved below for reference. It is noted that there
# is a "newer" version which differs in some cosmetic details (but actually
smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m, u6=\E[%i%d;%dR,
u7=\E[6n, vpa=\E[%i%p1%dd,
+#### VWM
+#
+# vwmterm is a terminal emulator written for the VWM console window manager
+#
+vwmterm|(vwm term),
+ am, bce, ccc, mir, msgr, npc, xenl, xon,
+ colors#8, pairs#64,
+ acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
+ bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l,
+ clear=\E[H\E[J, cnorm=\E[?25h, cr=^M, cub1=^H,
+ cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH,
+ cvvis=\E[?25h, dim=\E[2m, ed=\E[J, el=\E[K, home=\E[H,
+ il1=\E[L, ind=^J, invis=\E[8m, kcub1=\E[D, kcud1=\E[B,
+ kcuf1=\E[C, kcuu1=\E[A, kdch1=\E[3~, kend=\E[4~, kf1=\E[[A,
+ kf10=\E[21~, kf11=\E[22~, kf12=\E[23~, kf2=\E[[B,
+ kf3=\E[[C, kf4=\E[[D, kf5=\E[[E, kf6=\E[17~, kf7=\E[18~,
+ kf8=\E[19~, kf9=\E[20~, khome=\E[1~, knp=\E[6~, kpp=\E[5~,
+ rev=\E[7m, rmacs=\E[10m, rmam=\E[?7l, rmcup=\E[?1049l,
+ rs1=\E[H\E[J\E[m\Ec, setab=\E[4%p1%dm,
+ setaf=\E[3%p1%dm,
+ sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m,
+ sgr0=\E[0;10m, smacs=\E[11m, smam=\E[?7h,
+ smcup=\E[?1049h, smso=\E[3m, smul=\E[4m,
+
#### MGR
#
# MGR is a Bell Labs window system lighter-weight than X.
# * move function- and cursor-keys from emx-base to ansi.sys, and create
# a pfkey capability which handles F1-F48 -TD
#
+# 2009-05-02
+# * add vwmterm entry (Bryan Christ)
+#
# The following sets edit modes for GNU EMACS.
# Local Variables:
# fill-prefix:"\t"
/****************************************************************************
- * 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 2008 *
****************************************************************************/
/*
#define _POSIX_SOURCE
#endif
-#include <term.h> /* lines, columns, cur_term */
-
-MODULE_ID("$Id: lib_restart.c,v 1.10 2008/06/21 17:31:22 tom Exp $")
+MODULE_ID("$Id: lib_restart.c,v 1.11 2009/05/02 20:47:42 tom Exp $")
NCURSES_EXPORT(int)
-restartterm(NCURSES_CONST char *termp, int filenum, int *errret)
+NCURSES_SP_NAME(restartterm) (NCURSES_SP_DCLx
+ NCURSES_CONST char *termp,
+ int filenum,
+ int *errret)
{
int result;
- T((T_CALLED("restartterm(%s,%d,%p)"), termp, filenum, errret));
+ T((T_CALLED("restartterm(%p,%s,%d,%p)"), SP_PARM, termp, filenum, errret));
if (setupterm(termp, filenum, errret) != OK) {
result = ERR;
- } else if (SP != 0) {
- int saveecho = SP->_echo;
- int savecbreak = SP->_cbreak;
- int saveraw = SP->_raw;
- int savenl = SP->_nl;
+ } else if (SP_PARM != 0) {
+ int saveecho = SP_PARM->_echo;
+ int savecbreak = SP_PARM->_cbreak;
+ int saveraw = SP_PARM->_raw;
+ int savenl = SP_PARM->_nl;
- if (saveecho)
- echo();
- else
- noecho();
+ if (saveecho) {
+ NCURSES_SP_NAME(echo) (NCURSES_SP_ARG);
+ } else {
+ NCURSES_SP_NAME(noecho) (NCURSES_SP_ARG);
+ }
if (savecbreak) {
- cbreak();
- noraw();
+ NCURSES_SP_NAME(cbreak) (NCURSES_SP_ARG);
+ NCURSES_SP_NAME(noraw) (NCURSES_SP_ARG);
} else if (saveraw) {
- nocbreak();
- raw();
+ NCURSES_SP_NAME(nocbreak) (NCURSES_SP_ARG);
+ NCURSES_SP_NAME(raw) (NCURSES_SP_ARG);
+ } else {
+ NCURSES_SP_NAME(nocbreak) (NCURSES_SP_ARG);
+ NCURSES_SP_NAME(noraw) (NCURSES_SP_ARG);
+ }
+ if (savenl) {
+ NCURSES_SP_NAME(nl) (NCURSES_SP_ARG);
} else {
- nocbreak();
- noraw();
+ NCURSES_SP_NAME(nonl) (NCURSES_SP_ARG);
}
- if (savenl)
- nl();
- else
- nonl();
- reset_prog_mode();
+ NCURSES_SP_NAME(reset_prog_mode) (NCURSES_SP_ARG);
#if USE_SIZECHANGE
- _nc_update_screensize(SP);
+ _nc_update_screensize(SP_PARM);
#endif
result = OK;
}
returnCode(result);
}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+restartterm(NCURSES_CONST char *termp, int filenum, int *errret)
+{
+ return NCURSES_SP_NAME(restartterm) (CURRENT_SCREEN, termp, filenum, errret);
+}
+#endif
/*
- * $Id: curses.priv.h,v 1.410 2009/04/25 23:38:37 tom Exp $
+ * $Id: curses.priv.h,v 1.412 2009/05/02 21:28:57 tom Exp $
*
* curses.priv.h
*
#define GET_WINDOW_PAIR(w) (w)->_color
#define SET_WINDOW_PAIR(w,p) (w)->_color = (p)
#define SameAttrOf(a,b) (AttrOf(a) == AttrOf(b) && GetPair(a) == GetPair(b))
-#define VIDATTR(attr, pair) vid_attr(attr, pair, 0)
+
+#if NCURSES_SP_FUNCS
+#define VIDATTR(sp,attr,pair) NCURSES_SP_NAME(vid_attr)(sp, attr, pair, 0)
#else
+#define VIDATTR(sp,attr,pair) vid_attr(attr, pair, 0)
+#endif
+
+#else /* !(NCURSES_EXT_COLORS && USE_WIDEC_SUPPORT) */
#define if_EXT_COLORS(stmt) /* nothing */
#define SetPair(value,p) RemAttr(value, A_COLOR), \
SetAttr(value, AttrOf(value) | (A_COLOR & COLOR_PAIR(p)))
#define SET_WINDOW_PAIR(w,p) WINDOW_ATTRS(w) &= ALL_BUT_COLOR, \
WINDOW_ATTRS(w) |= (A_COLOR & COLOR_PAIR(p))
#define SameAttrOf(a,b) (AttrOf(a) == AttrOf(b))
-#define VIDATTR(attr, pair) vidattr(attr)
+
+#if NCURSES_SP_FUNCS
+#define VIDATTR(sp,attr,pair) NCURSES_SP_NAME(vidattr)(sp, attr)
+#else
+#define VIDATTR(sp,attr,pair) vidattr(attr)
#endif
+#endif /* NCURSES_EXT_COLORS && USE_WIDEC_SUPPORT */
+
#if NCURSES_NO_PADDING
#define GetNoPadding(sp) ((sp) ? (sp)->_no_padding : _nc_prescreen._no_padding)
#define SetNoPadding(sp) _nc_set_no_padding(sp)
#define ALL_BUT_COLOR ((chtype)~(A_COLOR))
#define NONBLANK_ATTR (A_NORMAL|A_BOLD|A_DIM|A_BLINK)
-#define XMC_CHANGES(c) ((c) & SP->_xmc_suppress)
+#define XMC_CHANGES(c) ((c) & SP_PARM->_xmc_suppress)
#define toggle_attr_on(S,at) {\
if (PAIR_NUMBER(at) > 0) {\
#if USE_XMC_SUPPORT
#define UpdateAttrs(sp,c) if (!SameAttrOf(SCREEN_ATTRS(sp), c)) { \
attr_t chg = AttrOf(SCREEN_ATTRS(sp)); \
- VIDATTR(AttrOf(c), GetPair(c)); \
+ VIDATTR(sp, AttrOf(c), GetPair(c)); \
if (magic_cookie_glitch > 0 \
&& XMC_CHANGES((chg ^ AttrOf(SCREEN_ATTRS(sp))))) { \
T(("%s @%d before glitch %d,%d", \
}
#else
#define UpdateAttrs(sp,c) if (!SameAttrOf(SCREEN_ATTRS(sp), c)) \
- VIDATTR(AttrOf(c), GetPair(c));
+ VIDATTR(sp, AttrOf(c), GetPair(c));
#endif
/*
/* lib_setup.c */
extern NCURSES_EXPORT(char *) _nc_get_locale(void);
-extern NCURSES_EXPORT(int) _nc_unicode_locale(void);
-extern NCURSES_EXPORT(int) _nc_locale_breaks_acs(TERMINAL *);
-extern NCURSES_EXPORT(int) _nc_setupterm(NCURSES_CONST char *, int, int *, bool);
-extern NCURSES_EXPORT(void) _nc_get_screensize(SCREEN *, int *, int *);
+extern NCURSES_EXPORT(int) _nc_unicode_locale(void);
+extern NCURSES_EXPORT(int) _nc_locale_breaks_acs(TERMINAL *);
+extern NCURSES_EXPORT(int) _nc_setupterm(NCURSES_CONST char *, int, int *, bool);
+extern NCURSES_EXPORT(void) _nc_get_screensize(SCREEN *, int *, int *);
/* lib_tstp.c */
#if USE_SIGWINCH
extern NCURSES_EXPORT(int) _nc_timed_wait (SCREEN *, int, int, int * EVENTLIST_2nd(_nc_eventlist *));
extern NCURSES_EXPORT(void) _nc_do_color (short, short, bool, int (*)(int));
extern NCURSES_EXPORT(void) _nc_flush (void);
-extern NCURSES_EXPORT(void) _nc_free_and_exit (int);
+extern NCURSES_EXPORT(void) _nc_free_and_exit (int) GCC_NORETURN;
extern NCURSES_EXPORT(void) _nc_free_entry (ENTRY *, TERMTYPE *);
extern NCURSES_EXPORT(void) _nc_freeall (void);
extern NCURSES_EXPORT(void) _nc_hash_map (void);
#define NC_BUFFERED(flag) _nc_set_buffer(SP->_ofp, flag)
-#define NC_OUTPUT ((SP_PARM != 0) ? SP_PARM->_ofp : stdout)
+#define NC_OUTPUT(sp) ((sp != 0) ? sp->_ofp : stdout)
/*
* On systems with a broken linker, define 'SP' as a function to force the
#define TW_ANY (TW_INPUT | TW_MOUSE)
#define TW_EVENT 4
+#define SetSafeOutcWrapper(outc) \
+ SCREEN* sp = CURRENT_SCREEN; \
+ if (sp==0) { \
+ struct screen dummy; \
+ sp = &dummy; \
+ memset(sp,0,sizeof(struct screen)); \
+ sp->_outch = _nc_outc_wrapper; \
+ }\
+ sp->jump = outc
+
+struct DriverTCB; /* Terminal Control Block forward declaration */
+typedef void* TERM_HANDLE;
+
+typedef struct _termInfo
+{
+ bool caninit;
+
+ bool hascolor;
+ bool initcolor;
+ bool canchange;
+
+ int tabsize;
+
+ int maxcolors;
+ int maxpairs;
+ int nocolorvideo;
+
+ int numlabels;
+ int labelwidth;
+ int labelheight;
+
+ const color_t* defaultPalette;
+} TerminalInfo;
+
+typedef struct term_driver {
+ bool isTerminfo;
+ bool (*CanHandle)(struct DriverTCB*,const char*,int*);
+ void (*init)(struct DriverTCB*);
+ void (*release)(struct DriverTCB*);
+ int (*size)(struct DriverTCB*, int* Line, int *Cols);
+ int (*sgmode)(struct DriverTCB*, bool setFlag, TTY*);
+ chtype (*conattr)(struct DriverTCB*);
+ int (*hwcur)(struct DriverTCB*, int yold, int xold, int y, int x);
+ int (*mode)(struct DriverTCB*, bool progFlag, bool defFlag);
+ bool (*rescol)(struct DriverTCB*);
+ bool (*rescolors)(struct DriverTCB*);
+ void (*color)(struct DriverTCB*,bool fore, int color, int(*)(SCREEN*,int));
+ int (*doBeepOrFlash)(struct DriverTCB*, bool);
+ void (*initpair)(struct DriverTCB*,short,short,short);
+ void (*initcolor)(struct DriverTCB*,short,short,short,short);
+ void (*docolor)(struct DriverTCB*,short,short,bool,int(*)(SCREEN*,int));
+ void (*initmouse)(struct DriverTCB*);
+ void (*setfilter)(struct DriverTCB*);
+ void (*hwlabel)(struct DriverTCB*,int,char*);
+ void (*hwlabelOnOff)(struct DriverTCB*,bool);
+ int (*update)(struct DriverTCB*);
+ int (*defaultcolors)(struct DriverTCB*,int,int);
+ int (*print)(struct DriverTCB*,char*,int);
+ int (*getsize)(struct DriverTCB*,int*,int*);
+ int (*setsize)(struct DriverTCB*,int,int);
+ void (*initacs)(struct DriverTCB*,chtype*,chtype*);
+ void (*scinit)(SCREEN *);
+ void (*scexit)(SCREEN *);
+ int (*twait)(struct DriverTCB*,int,int,int* EVENTLIST_2nd(_nc_eventlist*));
+ int (*read)(struct DriverTCB*,int*);
+ int (*nap)(struct DriverTCB*,int);
+ int (*kpad)(struct DriverTCB*, bool);
+ int (*kyOk)(struct DriverTCB*, int, bool);
+ bool (*kyExist)(struct DriverTCB*, int);
+} TERM_DRIVER;
+
+
+typedef struct DriverTCB
+{
+ TERMINAL term; /* needs to be the first Element !!! */
+ TERM_HANDLE inp; /* The input handle of the Terminal */
+ TERM_HANDLE out; /* The output handle of the Terminal in shell mode */
+ TERM_HANDLE hdl; /* The output handle of the Terminal in prog mode */
+ TERM_DRIVER* drv; /* The driver for that Terminal */
+ SCREEN* csp; /* The screen that owns that Terminal */
+ TerminalInfo info; /* Driver independent core capabilities of the Terminal */
+ void* prop; /* Driver dependent property storage to be used by the Driver */
+ long magic;
+} TERMINAL_CONTROL_BLOCK;
+
+#define NCDRV_MAGIC(id) (0x47110000 | (id&0xffff))
+#define NCDRV_TINFO 0x01
+#define NCDRV_WINCONSOLE 0x02
+
+#define TCBOf(sp) ((TERMINAL_CONTROL_BLOCK*)(TerminalOf(sp)))
+#define InfoOf(sp) TCBOf(sp)->info
+#define CallDriver(sp,method) TCBOf(sp)->drv->method(TCBOf(sp))
+#define CallDriver_1(sp,method,arg1) TCBOf(sp)->drv->method(TCBOf(sp),arg1)
+#define CallDriver_2(sp,method,arg1,arg2) TCBOf(sp)->drv->method(TCBOf(sp),arg1,arg2)
+#define CallDriver_3(sp,method,arg1,arg2,arg3) TCBOf(sp)->drv->method(TCBOf(sp),arg1,arg2,arg3)
+#define CallDriver_4(sp,method,arg1,arg2,arg3,arg4) TCBOf(sp)->drv->method(TCBOf(sp),arg1,arg2,arg3,arg4)
+
+extern NCURSES_EXPORT_VAR(const color_t*) _nc_cga_palette;
+extern NCURSES_EXPORT_VAR(const color_t*) _nc_hls_palette;
+
+#ifdef __MINGW32__
+#include <nc_mingw.h>
+extern NCURSES_EXPORT_VAR(TERM_DRIVER) _nc_WIN_DRIVER;
+#endif
+extern NCURSES_EXPORT_VAR(TERM_DRIVER) _nc_TINFO_DRIVER;
+
#define IsTermInfo(sp) TRUE
#define HasTInfoTerminal(sp) ((0!=TerminalOf(sp)) && IsTermInfo(sp))
#define IsValidTIScreen(sp) (HasTInfoTerminal(sp))
extern NCURSES_EXPORT(WINDOW *) _nc_stdscr_of(SCREEN*);
extern NCURSES_EXPORT(int) _nc_outc_wrapper(SCREEN*,int);
-extern NCURSES_EXPORT(TERMINAL*) NCURSES_SP_NAME(_nc_set_curterm)(SCREEN*,TERMINAL*);
+#if USE_REENTRANT
+extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(_nc_ttytype)(SCREEN*);
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_TABSIZE)(SCREEN*);
+extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(longname)(SCREEN*);
+#endif
#if NCURSES_EXT_FUNCS
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_set_tabsize)(SCREEN*, int);
#endif
-extern NCURSES_EXPORT(chtype) NCURSES_SP_NAME(_nc_acs_char)(SCREEN*,int);
-
/*
* We put the safe versions of various calls here as they are not published
* part of the API up to now
*/
extern NCURSES_EXPORT(SCREEN*) _nc_SP(void);
+extern NCURSES_EXPORT(TERMINAL*) NCURSES_SP_NAME(_nc_set_curterm)(SCREEN*,TERMINAL*);
+extern NCURSES_EXPORT(TERMINAL*) NCURSES_SP_NAME(cur_term)(SCREEN *sp);
extern NCURSES_EXPORT(WINDOW *) NCURSES_SP_NAME(_nc_makenew) (SCREEN*, int, int, int, int, int);
-extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(_nc_is_term_resized)(SCREEN*,int,int);
+extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(_nc_reset_colors)(SCREEN*);
extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(_nc_printf_string)(SCREEN*, const char *, va_list);
extern NCURSES_EXPORT(chtype) NCURSES_SP_NAME(_nc_acs_char)(SCREEN*,int);
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_curs_set)(SCREEN*,int);
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);
-extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_resizeterm)(SCREEN*,int,int);
-extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_restartterm)(SCREEN*,NCURSES_CONST char*,int,int*);
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_ripoffline)(SCREEN*, int, int (*)(WINDOW *,int));
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_savetty)(SCREEN*);
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_scr_init)(SCREEN*,const char*);
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_tigetnum)(SCREEN*,NCURSES_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_vid_attr)(SCREEN *, attr_t, short, void *);
-extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_vidattr)(SCREEN *, chtype);
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_vidputs)(SCREEN*,chtype,int(*) (SCREEN*, int));
extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_do_color)(SCREEN*, short, short, bool, int (*)(SCREEN*,int));
extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_do_xmc_glitch)(SCREEN*, attr_t);
extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_flush)(SCREEN*);
-extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_free_and_exit)(SCREEN*,int) GCC_NORETURN;
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_free_and_exit)(SCREEN*, int) GCC_NORETURN;
extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_freeall)(SCREEN*);
extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_hash_map)(SCREEN*);
extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_init_acs)(SCREEN*);
#include <term.h>
-MODULE_ID("$Id: lib_options.c,v 1.60 2009/02/28 21:07:56 tom Exp $")
+MODULE_ID("$Id: lib_options.c,v 1.61 2009/05/02 21:19:53 tom Exp $")
-static int _nc_curs_set(SCREEN *, int);
static int _nc_meta(SCREEN *, bool);
NCURSES_EXPORT(int)
/* curs_set() moved here to narrow the kernel interface */
NCURSES_EXPORT(int)
-curs_set(int vis)
+NCURSES_SP_NAME(curs_set) (NCURSES_SP_DCLx int vis)
{
- int result;
+ int result = ERR;
+
+ T((T_CALLED("curs_set(%p,%d)"), SP_PARM, vis));
+ if (SP_PARM != 0 && vis >= 0 && vis <= 2) {
+ int cursor = SP_PARM->_cursor;
- T((T_CALLED("curs_set(%d)"), vis));
- result = _nc_curs_set(SP, vis);
+ if (vis == cursor) {
+ result = cursor;
+ } else {
+ 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);
+ SP_PARM->_cursor = vis;
+ }
+ }
returnCode(result);
}
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+curs_set(int vis)
+{
+ return (NCURSES_SP_NAME(curs_set) (CURRENT_SCREEN, vis));
+}
+#endif
+
NCURSES_EXPORT(int)
NCURSES_SP_NAME(typeahead) (NCURSES_SP_DCLx int fd)
{
return (rc);
}
-static int
-_nc_curs_set(SCREEN *sp, int vis)
-{
- int result = ERR;
-
- T((T_CALLED("curs_set(%d)"), vis));
- if (sp != 0 && vis >= 0 && vis <= 2) {
- int cursor = sp->_cursor;
-
- if (vis == cursor) {
- result = cursor;
- } else {
- 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);
- sp->_cursor = vis;
- }
- }
- returnCode(result);
-}
-
static int
_nc_meta(SCREEN *sp, bool flag)
{
#include <termcap.h> /* ospeed */
#include <tic.h>
-MODULE_ID("$Id: lib_tputs.c,v 1.68 2009/02/28 21:08:18 tom Exp $")
+MODULE_ID("$Id: lib_tputs.c,v 1.70 2009/05/02 20:54:22 tom Exp $")
NCURSES_EXPORT_VAR(char) PC = 0; /* used by termcap library */
NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed = 0; /* used by termcap library */
NCURSES_EXPORT(void)
NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_DCL0)
{
- (void) fflush(NC_OUTPUT);
+ (void) fflush(NC_OUTPUT(SP_PARM));
}
#if NCURSES_SP_FUNCS
* POSIX says write() is safe in a signal handler, but the
* buffered I/O is not.
*/
- write(fileno(NC_OUTPUT), &tmp, 1);
+ write(fileno(NC_OUTPUT(SP_PARM)), &tmp, 1);
} else {
- putc(ch, NC_OUTPUT);
+ putc(ch, NC_OUTPUT(SP_PARM));
}
return OK;
}
#include <term.h>
#include <ctype.h>
-MODULE_ID("$Id: lib_mvcur.c,v 1.117 2009/04/26 00:15:22 tom Exp $")
+MODULE_ID("$Id: lib_mvcur.c,v 1.118 2009/05/02 20:38:58 tom Exp $")
#define WANT_CHAR(sp, y, x) (sp)->_newscr->_line[y].text[x] /* desired state */
#define BAUDRATE(sp) cur_term->_baudrate /* bits per second */
/* Set the scroll-region to a known state (the default) */
{
if (change_scroll_region) {
- TPUTS_TRACE("change_scroll_region");
- putp(TPARM_2(change_scroll_region, 0, screen_lines(CURRENT_SCREEN) - 1));
+ NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx
+ "change_scroll_region",
+ TPARM_2(change_scroll_region,
+ 0, screen_lines(SP_PARM) - 1));
}
}
{
/* initialize screen for cursor access */
if (enter_ca_mode) {
- TPUTS_TRACE("enter_ca_mode");
- putp(enter_ca_mode);
+ NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx
+ "enter_ca_mode",
+ enter_ca_mode);
}
/*
if (SP_PARM->_cursor != -1) {
int cursor = SP_PARM->_cursor;
SP_PARM->_cursor = -1;
- curs_set(cursor);
+ NCURSES_SP_NAME(curs_set) (NCURSES_SP_ARGx cursor);
}
}
NCURSES_SP_NAME(_nc_mvcur_init) (NCURSES_SP_DCL0)
/* initialize the cost structure */
{
- if (isatty(fileno(SP_PARM->_ofp)))
+ if (SP_PARM->_ofp && isatty(fileno(SP_PARM->_ofp)))
SP_PARM->_char_padding = ((BAUDBYTE * 1000 * 10)
/ (BAUDRATE(SP_PARM) > 0
? BAUDRATE(SP_PARM)
SP_PARM->_cup_ch_cost = NormalizedCost(
TPARM_2(SP_PARM->_address_cursor,
- 23, 23), 1);
+ 23, 23),
+ 1);
SP_PARM->_hpa_ch_cost = NormalizedCost(TPARM_1(column_address, 23), 1);
SP_PARM->_cuf_ch_cost = NormalizedCost(TPARM_1(parm_right_cursor, 23), 1);
SP_PARM->_inline_cost = min(SP_PARM->_cup_ch_cost,
/* set cursor to normal mode */
if (SP_PARM->_cursor != -1) {
int cursor = SP_PARM->_cursor;
- curs_set(1);
+ NCURSES_SP_NAME(curs_set) (NCURSES_SP_ARGx 1);
SP_PARM->_cursor = cursor;
}
if (exit_ca_mode) {
- TPUTS_TRACE("exit_ca_mode");
- putp(exit_ca_mode);
+ NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx
+ "exit_ca_mode",
+ exit_ca_mode);
}
/*
* Reset terminal's tab counter. There's a long-time bug that
* escape sequences that reset things as column positions.
* Utter a \r to reset this invisibly.
*/
- _nc_outch('\r');
+ NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_ARGx '\r');
}
#if NCURSES_SP_FUNCS
/* tactic #1: use local movement */
if (yold != -1 && xold != -1
&& ((newcost = relative_move(NCURSES_SP_ARGx
- NullResult, yold, xold, ynew, xnew,
- ovw)) != INFINITY)
+ NullResult,
+ yold, xold,
+ ynew, xnew, ovw)) != INFINITY)
&& newcost < usecost) {
tactic = 1;
usecost = newcost;
/* tactic #2: use carriage-return + local movement */
if (yold != -1 && carriage_return
&& ((newcost = relative_move(NCURSES_SP_ARGx
- NullResult, yold, 0, ynew, xnew, ovw))
- != INFINITY)
+ NullResult,
+ yold, 0,
+ ynew, xnew, ovw)) != INFINITY)
&& SP_PARM->_cr_cost + newcost < usecost) {
tactic = 2;
usecost = SP_PARM->_cr_cost + newcost;
/* tactic #3: use home-cursor + local movement */
if (cursor_home
&& ((newcost = relative_move(NCURSES_SP_ARGx
- NullResult, 0, 0, ynew, xnew, ovw)) != INFINITY)
+ NullResult,
+ 0, 0,
+ ynew, xnew, ovw)) != INFINITY)
&& SP_PARM->_home_cost + newcost < usecost) {
tactic = 3;
usecost = SP_PARM->_home_cost + newcost;
if (cursor_to_ll
&& ((newcost = relative_move(NCURSES_SP_ARGx
NullResult,
- screen_lines(SP_PARM) - 1, 0, ynew,
- xnew, ovw)) != INFINITY)
+ screen_lines(SP_PARM) - 1, 0,
+ ynew, xnew, ovw)) != INFINITY)
&& SP_PARM->_ll_cost + newcost < usecost) {
tactic = 4;
usecost = SP_PARM->_ll_cost + newcost;
t5_cr_cost = (xold > 0 ? SP_PARM->_cr_cost : 0);
if (auto_left_margin && !eat_newline_glitch
&& yold > 0 && cursor_left
- && ((newcost = relative_move(NCURSES_SP_ARGx NullResult,
- yold - 1,
- screen_columns(SP_PARM) - 1,
- ynew,
- xnew,
- ovw)) != INFINITY)
+ && ((newcost = relative_move(NCURSES_SP_ARGx
+ NullResult,
+ yold - 1, screen_columns(SP_PARM) - 1,
+ ynew, xnew, ovw)) != INFINITY)
&& t5_cr_cost + SP_PARM->_cub1_cost + newcost < usecost) {
tactic = 5;
usecost = t5_cr_cost + SP_PARM->_cub1_cost + newcost;
switch (tactic) {
case 1:
(void) relative_move(NCURSES_SP_ARGx
- &result, yold, xold,
+ &result,
+ yold, xold,
ynew, xnew, ovw);
break;
case 2:
(void) _nc_safe_strcpy(&result, carriage_return);
(void) relative_move(NCURSES_SP_ARGx
- &result, yold, 0,
+ &result,
+ yold, 0,
ynew, xnew, ovw);
break;
case 3:
break;
case 4:
(void) _nc_safe_strcpy(&result, cursor_to_ll);
- (void) relative_move(NCURSES_SP_ARGx &result,
+ (void) relative_move(NCURSES_SP_ARGx
+ &result,
screen_lines(SP_PARM) - 1, 0,
ynew, xnew, ovw);
break;
if (xold > 0)
(void) _nc_safe_strcat(&result, carriage_return);
(void) _nc_safe_strcat(&result, cursor_left);
- (void) relative_move(NCURSES_SP_ARGx &result,
+ (void) relative_move(NCURSES_SP_ARGx
+ &result,
yold - 1, screen_columns(SP_PARM) - 1,
ynew, xnew, ovw);
break;
TR(TRACE_CHARPUT, ("turning off (%#lx) %s before move",
(unsigned long) AttrOf(oldattr),
_traceattr(AttrOf(oldattr))));
- (void) VIDATTR(A_NORMAL, 0);
+ (void) VIDATTR(SP_PARM, A_NORMAL, 0);
}
if (xold >= screen_columns(SP_PARM)) {
if (l > 0) {
if (carriage_return) {
- TPUTS_TRACE("carriage_return");
- putp(carriage_return);
+ NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx
+ "carriage_return",
+ carriage_return);
} else
- _nc_outch('\r');
+ NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_ARGx '\r');
xold = 0;
while (l > 0) {
if (newline) {
- TPUTS_TRACE("newline");
- putp(newline);
+ NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx
+ "newline",
+ newline);
} else
- _nc_outch('\n');
+ NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_ARGx '\n');
l--;
}
}
TR(TRACE_CHARPUT, ("turning on (%#lx) %s after move",
(unsigned long) AttrOf(oldattr),
_traceattr(AttrOf(oldattr))));
- (void) VIDATTR(AttrOf(oldattr), GetPair(oldattr));
+ (void) VIDATTR(SP_PARM, AttrOf(oldattr), GetPair(oldattr));
}
}
returnCode(code);
#include <curses.priv.h>
#include <term.h>
-MODULE_ID("$Id: lib_vidattr.c,v 1.51 2009/02/21 21:43:40 tom Exp $")
+MODULE_ID("$Id: lib_vidattr.c,v 1.53 2009/05/02 22:35:03 tom Exp $")
#define doPut(mode) TPUTS_TRACE(#mode); tputs(mode, 1, outc)
#define PreviousAttr _nc_prescreen.previous_attr
NCURSES_EXPORT(int)
-vidputs(chtype newmode, int (*outc) (int))
+NCURSES_SP_NAME(vidputs) (NCURSES_SP_DCLx
+ chtype newmode,
+ int (*outc) (int))
{
attr_t turn_on, turn_off;
int pair;
bool reverse = FALSE;
- bool can_color = (SP == 0 || SP->_coloron);
+ bool can_color = (SP_PARM == 0 || SP_PARM->_coloron);
#if NCURSES_EXT_FUNCS
- bool fix_pair0 = (SP != 0 && SP->_coloron && !SP->_default_color);
+ bool fix_pair0 = (SP_PARM != 0 && SP_PARM->_coloron && !SP_PARM->_default_color);
#else
#define fix_pair0 FALSE
#endif
T((T_CALLED("vidputs(%s)"), _traceattr(newmode)));
/* this allows us to go on whether or not newterm() has been called */
- if (SP)
- PreviousAttr = AttrOf(SCREEN_ATTRS(SP));
+ if (SP_PARM)
+ PreviousAttr = AttrOf(SCREEN_ATTRS(SP_PARM));
TR(TRACE_ATTRS, ("previous attribute was %s", _traceattr(PreviousAttr)));
- if ((SP != 0)
+ if ((SP_PARM != 0)
&& (magic_cookie_glitch > 0)) {
#if USE_XMC_SUPPORT
static const chtype table[] =
* the terminfo max_attributes value.
*/
for (n = 0; n < SIZEOF(table); ++n) {
- if ((table[n] & SP->_ok_attributes) == 0) {
+ if ((table[n] & SP_PARM->_ok_attributes) == 0) {
newmode &= ~table[n];
} else if ((table[n] & newmode) != 0) {
if (used++ >= limit) {
}
}
#else
- newmode &= ~(SP->_xmc_suppress);
+ newmode &= ~(SP_PARM->_xmc_suppress);
#endif
TR(TRACE_ATTRS, ("suppressed attribute is %s", _traceattr(newmode)));
}
if (exit_attribute_mode) {
doPut(exit_attribute_mode);
} else {
- if (!SP || SP->_use_rmul) {
+ if (!SP_PARM || SP_PARM->_use_rmul) {
TurnOff(A_UNDERLINE, exit_underline_mode);
}
- if (!SP || SP->_use_rmso) {
+ if (!SP_PARM || SP_PARM->_use_rmso) {
TurnOff(A_STANDOUT, exit_standout_mode);
}
}
TurnOff(A_ALTCHARSET, exit_alt_charset_mode);
- if (!SP || SP->_use_rmul) {
+ if (!SP_PARM || SP_PARM->_use_rmul) {
TurnOff(A_UNDERLINE, exit_underline_mode);
}
- if (!SP || SP->_use_rmso) {
+ if (!SP_PARM || SP_PARM->_use_rmso) {
TurnOff(A_STANDOUT, exit_standout_mode);
}
if (reverse)
newmode |= A_REVERSE;
- if (SP)
- SetAttr(SCREEN_ATTRS(SP), newmode);
+ if (SP_PARM)
+ SetAttr(SCREEN_ATTRS(SP_PARM), newmode);
else
PreviousAttr = newmode;
returnCode(OK);
}
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(vidattr) (NCURSES_SP_DCLx
+ chtype newmode)
+{
+ return NCURSES_SP_NAME(vidputs) (NCURSES_SP_ARGx newmode, _nc_outch);
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+vidputs(chtype newmode, int (*outc) (int))
+{
+ return NCURSES_SP_NAME(vidputs) (CURRENT_SCREEN, newmode, outc);
+}
+
NCURSES_EXPORT(int)
vidattr(chtype newmode)
{
returnCode(vidputs(newmode, _nc_outch));
}
+#endif
NCURSES_EXPORT(chtype)
NCURSES_SP_NAME(termattrs) (NCURSES_SP_DCL0)
#include <ctype.h>
-MODULE_ID("$Id: tty_update.c,v 1.251 2009/04/25 23:46:09 tom Exp $")
+MODULE_ID("$Id: tty_update.c,v 1.252 2009/05/02 20:52:11 tom Exp $")
/*
* This define controls the line-breakout optimization. Every once in a
TR(TRACE_CHARPUT, ("turning off (%#lx) %s before wrapping",
(unsigned long) AttrOf(SCREEN_ATTRS(SP_PARM)),
_traceattr(AttrOf(SCREEN_ATTRS(SP_PARM)))));
- (void) VIDATTR(A_NORMAL, 0);
+ (void) VIDATTR(SP_PARM, A_NORMAL, 0);
}
} else {
SP_PARM->_curscol--;
/* reset color pairs and definitions */
if (SP_PARM->_coloron || SP_PARM->_color_defs)
- _nc_reset_colors ();
+ _nc_reset_colors();
/* restore user-defined colors, if any */
if (SP_PARM->_color_defs < 0) {
}
#endif
if (SP_PARM->_color_defs) {
- _nc_reset_colors ();
+ _nc_reset_colors();
}
}
/****************************************************************************
- * Copyright (c) 2002-2006,2007 Free Software Foundation, Inc. *
+ * Copyright (c) 2002-2007,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>
#include <term.h>
-MODULE_ID("$Id: lib_vid_attr.c,v 1.5 2007/06/30 22:03:02 tom Exp $")
+MODULE_ID("$Id: lib_vid_attr.c,v 1.7 2009/05/02 23:30:44 tom Exp $")
#define doPut(mode) TPUTS_TRACE(#mode); tputs(mode, 1, outc)
#define set_color(mode, pair) mode &= ALL_BUT_COLOR; mode |= COLOR_PAIR(pair)
NCURSES_EXPORT(int)
-vid_puts(attr_t newmode, short pair, void *opts GCC_UNUSED, int (*outc) (int))
+NCURSES_SP_NAME(vid_puts)(NCURSES_SP_DCLx
+ attr_t newmode,
+ short pair,
+ void *opts GCC_UNUSED,
+ int (*outc) (int))
{
#if NCURSES_EXT_COLORS
static attr_t previous_attr = A_NORMAL;
attr_t turn_on, turn_off;
bool reverse = FALSE;
- bool can_color = (SP == 0 || SP->_coloron);
+ bool can_color = (SP_PARM == 0 || SP_PARM->_coloron);
#if NCURSES_EXT_FUNCS
- bool fix_pair0 = (SP != 0 && SP->_coloron && !SP->_default_color);
+ bool fix_pair0 = (SP_PARM != 0 && SP_PARM->_coloron && !SP_PARM->_default_color);
#else
#define fix_pair0 FALSE
#endif
T((T_CALLED("vid_puts(%s,%d)"), _traceattr(newmode), pair));
/* this allows us to go on whether or not newterm() has been called */
- if (SP) {
- previous_attr = AttrOf(SCREEN_ATTRS(SP));
- previous_pair = GetPair(SCREEN_ATTRS(SP));
+ if (SP_PARM) {
+ previous_attr = AttrOf(SCREEN_ATTRS(SP_PARM));
+ previous_pair = GetPair(SCREEN_ATTRS(SP_PARM));
}
TR(TRACE_ATTRS, ("previous attribute was %s, %d",
_traceattr(previous_attr), previous_pair));
#if !USE_XMC_SUPPORT
- if ((SP != 0)
+ if ((SP_PARM != 0)
&& (magic_cookie_glitch > 0))
- newmode &= ~(SP->_xmc_suppress);
+ newmode &= ~(SP_PARM->_xmc_suppress);
#endif
/*
if (exit_attribute_mode) {
doPut(exit_attribute_mode);
} else {
- if (!SP || SP->_use_rmul) {
+ if (!SP_PARM || SP_PARM->_use_rmul) {
TurnOff(A_UNDERLINE, exit_underline_mode);
}
- if (!SP || SP->_use_rmso) {
+ if (!SP_PARM || SP_PARM->_use_rmso) {
TurnOff(A_STANDOUT, exit_standout_mode);
}
}
TurnOff(A_ALTCHARSET, exit_alt_charset_mode);
- if (!SP || SP->_use_rmul) {
+ if (!SP_PARM || SP_PARM->_use_rmul) {
TurnOff(A_UNDERLINE, exit_underline_mode);
}
- if (!SP || SP->_use_rmso) {
+ if (!SP_PARM || SP_PARM->_use_rmso) {
TurnOff(A_STANDOUT, exit_standout_mode);
}
if (reverse)
newmode |= A_REVERSE;
- if (SP) {
- SetAttr(SCREEN_ATTRS(SP), newmode);
- SetPair(SCREEN_ATTRS(SP), pair);
+ if (SP_PARM) {
+ SetAttr(SCREEN_ATTRS(SP_PARM), newmode);
+ SetPair(SCREEN_ATTRS(SP_PARM), pair);
} else {
previous_attr = newmode;
previous_pair = pair;
#undef vid_attr
NCURSES_EXPORT(int)
-vid_attr(attr_t newmode, short pair, void *opts)
+NCURSES_SP_NAME(vid_attr) (NCURSES_SP_DCLx
+ attr_t newmode,
+ short pair,
+ void *opts)
{
T((T_CALLED("vid_attr(%s,%d)"), _traceattr(newmode), pair));
returnCode(vid_puts(newmode, pair, opts, _nc_outch));
}
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+vid_puts(attr_t newmode, short pair, void *opts GCC_UNUSED, int (*outc) (int))
+{
+ return NCURSES_SP_NAME(vid_puts) (CURRENT_SCREEN, newmode, pair, opts, outc);
+}
+
+NCURSES_EXPORT(int)
+vid_attr(attr_t newmode, short pair, void *opts)
+{
+ return NCURSES_SP_NAME(vid_attr) (CURRENT_SCREEN, newmode, pair, opts);
+}
+#endif
+
/*
* This implementation uses the same mask values for A_xxx and WA_xxx, so
* we can use termattrs() for part of the logic.
/*
* Author: Thomas E. Dickey (1998-on)
*
- * $Id: ditto.c,v 1.32 2008/08/04 13:21:41 tom Exp $
+ * $Id: ditto.c,v 1.33 2008/11/16 00:19:59 juergen Exp $
*
* The program illustrates how to set up multiple screens from a single
* program.
{
int result = -1;
if (peek->sequence < fifo->sequence) {
- peek->sequence += 1;
result = fifo->data[THIS_FIFO(peek->sequence)];
+ peek->sequence += 1;
}
return result;
}
}
static void
-init_screen(SCREEN *sp GCC_UNUSED, void *arg)
+init_screen(
+#if HAVE_USE_WINDOW
+ SCREEN *sp GCC_UNUSED,
+#endif
+ void *arg)
{
DITTO *target = (DITTO *) arg;
int high, wide;
target->which1 = which1;
target->titles = source;
target->length = length;
+ target->fifo.head = -1;
target->screen = newterm((char *) 0, /* assume $TERM is the same */
target->output,
target->input);
}
static int
-close_screen(SCREEN *sp GCC_UNUSED, void *arg GCC_UNUSED)
+close_screen(
+#if HAVE_USE_WINDOW
+ SCREEN *sp GCC_UNUSED,
+#endif
+ void *arg GCC_UNUSED)
{
(void) sp;
(void) arg;
* Read data from the 'source' screen.
*/
static int
-read_screen(SCREEN *sp GCC_UNUSED, void *arg)
+read_screen(
+#if HAVE_USE_WINDOW
+ SCREEN *sp GCC_UNUSED,
+#endif
+ void *arg)
{
DDATA *data = (DDATA *) arg;
DITTO *ditto = &(data->ditto[data->source]);
* Write all of the data that's in fifos for the 'target' screen.
*/
static int
-write_screen(SCREEN *sp GCC_UNUSED, void *arg GCC_UNUSED)
+write_screen(
+#if HAVE_USE_WINDOW
+ SCREEN *sp GCC_UNUSED,
+#endif
+ void *arg GCC_UNUSED)
{
DDATA *data = (DDATA *) arg;
DITTO *ditto = &(data->ditto[data->target]);
if (argc <= 1)
usage();
-
+
if ((data = typeCalloc(DITTO, (size_t) argc)) == 0)
failed("calloc data");
Author: Eric S. Raymond <esr@snark.thyrsus.com> 1993
Thomas E. Dickey (beginning revision 1.27 in 1996).
-$Id: ncurses.c,v 1.338 2009/03/28 21:40:51 tom Exp $
+$Id: ncurses.c,v 1.339 2009/04/04 22:46:11 juergen Exp $
***************************************************************************/
addstr("Shelling out...");
def_prog_mode();
endwin();
+#ifdef __MINGW32__
+ system("cmd.exe");
+#else
system("sh");
+#endif
if (message)
addstr("returned from shellout.\n");
refresh();
wgetch_test(0, stdscr, delay);
forget_boxes();
finish_getch_test();
+ slk_clear();
}
#if USE_WIDEC_SUPPORT
wget_wch_test(0, stdscr, delay);
forget_boxes();
finish_getch_test();
+ slk_clear();
}
#endif
/****************************************************************************
* Author: Thomas E. Dickey 1996-on *
****************************************************************************/
-/* $Id: test.priv.h,v 1.80 2008/12/20 16:37:20 tom Exp $ */
+/* $Id: test.priv.h,v 1.81 2008/12/28 20:20:39 juergen Exp $ */
#ifndef __TEST_PRIV_H
#define __TEST_PRIV_H 1
#define EXIT_FAILURE 1
#endif
+#ifdef __MINGW32__
+#include <nc_mingw.h>
+/* conflicts in test/firstlast.c */
+#undef large
+#undef small
+
+#endif
+
/* Use this to quiet gcc's -Wwrite-strings warnings, but accommodate SVr4
* curses which doesn't have const parameters declared (so far) in the places
* that XSI shows.
#define USING_SCREEN(s,func,data) use_screen(s, (NCURSES_SCREEN_CB) func, data)
#define WANT_USE_SCREEN() extern void _nc_want_use_screen(void)
#else
-#define USING_SCREEN(s,func,data) func(s,data)
+#define USING_SCREEN(s,func,data) func(data)
#define WANT_USE_SCREEN() extern void _nc_want_use_screen(void)
#endif
* scroll operation worked, and the refresh() code only had to do a
* partial repaint.
*
- * $Id: view.c,v 1.69 2008/09/06 22:10:50 tom Exp $
+ * $Id: view.c,v 1.70 2008/11/16 00:19:59 juergen Exp $
*/
#include <test.priv.h>
#if HAVE_TERMIOS_H
# include <termios.h>
#else
+#if !defined(__MINGW32__)
# include <sgtty.h>
#endif
+#endif
#if !defined(sun) || !HAVE_TERMIOS_H
# if HAVE_SYS_IOCTL_H
traces will be dumped. The program stops and waits for one character of
input at the beginning and end of the interval.
- $Id: worm.c,v 1.58 2008/10/04 21:54:09 tom Exp $
+ $Id: worm.c,v 1.59 2008/11/16 00:19:59 juergen Exp $
*/
#include <test.priv.h>
while (!quit_worm(((struct worm *) arg) - worm)) {
while (compare < sequence) {
++compare;
+#if HAVE_USE_WINDOW
use_window(stdscr, draw_worm, arg);
+#else
+ draw_worm(stdscr, arg);
+#endif
}
}
Trace(("...start_worm (done)"));
}
#else
for (n = 0, w = &worm[0]; n < number; n++, w++) {
- if (USING_WINDOW2(stdscr, draw_worm, w))
+ if (
+#if HAVE_USE_WINDOW
+ USING_WINDOW2(stdscr, draw_worm, w)
+#else
+ draw_worm(stdscr, w)
+#endif
+ )
done = TRUE;
}
#endif