aboutsummaryrefslogtreecommitdiff
path: root/ncurses
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2011-04-30 10:55:14 +0000
committerEd Schouten <ed@FreeBSD.org>2011-04-30 10:55:14 +0000
commit0294a182a1629b1d854b84906e73487d6cb75fba (patch)
treee563e21bcc0164ba11452983316bda26eebb1d3c /ncurses
parent22b11c4db16996bf8d4878fab98762c348676df3 (diff)
downloadsrc-0294a182a1629b1d854b84906e73487d6cb75fba.tar.gz
src-0294a182a1629b1d854b84906e73487d6cb75fba.zip
Import a stock copy of ncurses 5.8 into the vendor space.vendor/ncurses/5.8-20110226
It seems both local changes we made to 5.7 have already been fixed upstream properly, so there is no need to preserve the changes. Also, with SVN we import full source trees. Unlike CVS, where we removed unneeded cruft.
Notes
Notes: svn path=/vendor/ncurses/dist/; revision=221243 svn path=/vendor/ncurses/5.8-20110226/; revision=221244; tag=vendor/ncurses/5.8-20110226
Diffstat (limited to 'ncurses')
-rw-r--r--ncurses/Makefile.in54
-rw-r--r--ncurses/README23
-rw-r--r--ncurses/base/MKkeyname.awk21
-rwxr-xr-xncurses/base/MKlib_gen.sh75
-rw-r--r--ncurses/base/MKunctrl.awk26
-rw-r--r--ncurses/base/define_key.c39
-rw-r--r--ncurses/base/key_defined.c20
-rw-r--r--ncurses/base/keybound.c23
-rw-r--r--ncurses/base/keyok.c39
-rw-r--r--ncurses/base/legacy_coding.c25
-rw-r--r--ncurses/base/lib_addch.c80
-rw-r--r--ncurses/base/lib_addstr.c19
-rw-r--r--ncurses/base/lib_beep.c27
-rw-r--r--ncurses/base/lib_bkgd.c16
-rw-r--r--ncurses/base/lib_box.c9
-rw-r--r--ncurses/base/lib_chgat.c8
-rw-r--r--ncurses/base/lib_clear.c6
-rw-r--r--ncurses/base/lib_clearok.c6
-rw-r--r--ncurses/base/lib_clrbot.c6
-rw-r--r--ncurses/base/lib_clreol.c6
-rw-r--r--ncurses/base/lib_color.c544
-rw-r--r--ncurses/base/lib_colorset.c19
-rw-r--r--ncurses/base/lib_delch.c6
-rw-r--r--ncurses/base/lib_delwin.c21
-rw-r--r--ncurses/base/lib_dft_fgbg.c70
-rw-r--r--ncurses/base/lib_driver.c143
-rw-r--r--ncurses/base/lib_echo.c36
-rw-r--r--ncurses/base/lib_endwin.c39
-rw-r--r--ncurses/base/lib_erase.c6
-rw-r--r--ncurses/base/lib_flash.c30
-rw-r--r--ncurses/base/lib_freeall.c62
-rw-r--r--ncurses/base/lib_getch.c181
-rw-r--r--ncurses/base/lib_getstr.c25
-rw-r--r--ncurses/base/lib_hline.c10
-rw-r--r--ncurses/base/lib_immedok.c6
-rw-r--r--ncurses/base/lib_inchstr.c11
-rw-r--r--ncurses/base/lib_initscr.c8
-rw-r--r--ncurses/base/lib_insch.c48
-rw-r--r--ncurses/base/lib_insdel.c6
-rw-r--r--ncurses/base/lib_insnstr.c10
-rw-r--r--ncurses/base/lib_instr.c30
-rw-r--r--ncurses/base/lib_isendwin.c20
-rw-r--r--ncurses/base/lib_leaveok.c6
-rw-r--r--ncurses/base/lib_mouse.c277
-rw-r--r--ncurses/base/lib_move.c6
-rw-r--r--ncurses/base/lib_mvwin.c20
-rw-r--r--ncurses/base/lib_newterm.c234
-rw-r--r--ncurses/base/lib_newwin.c158
-rw-r--r--ncurses/base/lib_nl.c46
-rw-r--r--ncurses/base/lib_overlay.c16
-rw-r--r--ncurses/base/lib_pad.c82
-rw-r--r--ncurses/base/lib_printw.c16
-rw-r--r--ncurses/base/lib_redrawln.c27
-rw-r--r--ncurses/base/lib_refresh.c69
-rw-r--r--ncurses/base/lib_restart.c78
-rw-r--r--ncurses/base/lib_scanw.c6
-rw-r--r--ncurses/base/lib_screen.c126
-rw-r--r--ncurses/base/lib_scroll.c10
-rw-r--r--ncurses/base/lib_scrollok.c6
-rw-r--r--ncurses/base/lib_scrreg.c6
-rw-r--r--ncurses/base/lib_set_term.c472
-rw-r--r--ncurses/base/lib_slk.c242
-rw-r--r--ncurses/base/lib_slkatr_set.c48
-rw-r--r--ncurses/base/lib_slkatrof.c26
-rw-r--r--ncurses/base/lib_slkatron.c26
-rw-r--r--ncurses/base/lib_slkatrset.c20
-rw-r--r--ncurses/base/lib_slkattr.c24
-rw-r--r--ncurses/base/lib_slkclear.c30
-rw-r--r--ncurses/base/lib_slkcolor.c40
-rw-r--r--ncurses/base/lib_slkinit.c39
-rw-r--r--ncurses/base/lib_slklab.c22
-rw-r--r--ncurses/base/lib_slkrefr.c91
-rw-r--r--ncurses/base/lib_slkset.c28
-rw-r--r--ncurses/base/lib_slktouch.c24
-rw-r--r--ncurses/base/lib_touch.c14
-rw-r--r--ncurses/base/lib_ungetch.c14
-rw-r--r--ncurses/base/lib_vline.c10
-rw-r--r--ncurses/base/lib_wattroff.c6
-rw-r--r--ncurses/base/lib_wattron.c8
-rw-r--r--ncurses/base/lib_winch.c12
-rw-r--r--ncurses/base/lib_window.c66
-rw-r--r--ncurses/base/nc_panel.c18
-rw-r--r--ncurses/base/resizeterm.c198
-rw-r--r--ncurses/base/safe_sprintf.c37
-rw-r--r--ncurses/base/tries.c12
-rw-r--r--ncurses/base/use_window.c6
-rw-r--r--ncurses/base/wresize.c33
-rw-r--r--ncurses/build.priv.h108
-rw-r--r--ncurses/curses.priv.h878
-rw-r--r--ncurses/llib-lncurses1026
-rw-r--r--ncurses/llib-lncursest1055
-rw-r--r--ncurses/llib-lncursestw5270
-rw-r--r--ncurses/llib-lncursesw1071
-rw-r--r--ncurses/modules370
-rw-r--r--ncurses/tinfo/MKcaptab.sh136
-rw-r--r--ncurses/tinfo/MKcodes.awk23
-rwxr-xr-xncurses/tinfo/MKfallback.sh18
-rw-r--r--ncurses/tinfo/MKnames.awk26
-rw-r--r--ncurses/tinfo/access.c7
-rw-r--r--ncurses/tinfo/add_tries.c11
-rw-r--r--ncurses/tinfo/alloc_entry.c19
-rw-r--r--ncurses/tinfo/alloc_ttype.c90
-rw-r--r--ncurses/tinfo/captoinfo.c49
-rw-r--r--ncurses/tinfo/comp_expand.c6
-rw-r--r--ncurses/tinfo/comp_hash.c334
-rw-r--r--ncurses/tinfo/comp_parse.c18
-rw-r--r--ncurses/tinfo/comp_scan.c94
-rw-r--r--ncurses/tinfo/db_iterator.c11
-rw-r--r--ncurses/tinfo/entries.c18
-rw-r--r--ncurses/tinfo/free_ttype.c6
-rw-r--r--ncurses/tinfo/hashed_db.c58
-rw-r--r--ncurses/tinfo/home_terminfo.c6
-rw-r--r--ncurses/tinfo/init_keytry.c20
-rw-r--r--ncurses/tinfo/lib_acs.c82
-rw-r--r--ncurses/tinfo/lib_baudrate.c32
-rw-r--r--ncurses/tinfo/lib_cur_term.c112
-rw-r--r--ncurses/tinfo/lib_data.c50
-rw-r--r--ncurses/tinfo/lib_has_cap.c53
-rw-r--r--ncurses/tinfo/lib_kernel.c82
-rw-r--r--ncurses/tinfo/lib_longname.c42
-rw-r--r--ncurses/tinfo/lib_napms.c21
-rw-r--r--ncurses/tinfo/lib_options.c277
-rw-r--r--ncurses/tinfo/lib_print.c39
-rw-r--r--ncurses/tinfo/lib_raw.c202
-rw-r--r--ncurses/tinfo/lib_setup.c401
-rw-r--r--ncurses/tinfo/lib_termcap.c227
-rw-r--r--ncurses/tinfo/lib_termname.c22
-rw-r--r--ncurses/tinfo/lib_ti.c162
-rw-r--r--ncurses/tinfo/lib_tparm.c49
-rw-r--r--ncurses/tinfo/lib_tputs.c168
-rw-r--r--ncurses/tinfo/lib_ttyflags.c207
-rw-r--r--ncurses/tinfo/make_hash.c294
-rw-r--r--ncurses/tinfo/make_keys.c24
-rw-r--r--ncurses/tinfo/name_match.c3
-rw-r--r--ncurses/tinfo/parse_entry.c55
-rw-r--r--ncurses/tinfo/read_entry.c71
-rw-r--r--ncurses/tinfo/read_termcap.c20
-rw-r--r--ncurses/tinfo/setbuf.c35
-rw-r--r--ncurses/tinfo/tinfo_driver.c1337
-rw-r--r--ncurses/tinfo/trim_sgr0.c38
-rw-r--r--ncurses/tinfo/use_screen.c8
-rw-r--r--ncurses/tinfo/write_entry.c82
-rw-r--r--ncurses/trace/lib_trace.c37
-rw-r--r--ncurses/trace/lib_traceatr.c55
-rw-r--r--ncurses/trace/lib_tracebits.c7
-rw-r--r--ncurses/trace/lib_tracechr.c10
-rw-r--r--ncurses/trace/lib_tracedmp.c12
-rw-r--r--ncurses/trace/lib_tracemse.c42
-rw-r--r--ncurses/trace/trace_buf.c11
-rw-r--r--ncurses/trace/trace_tries.c14
-rw-r--r--ncurses/trace/trace_xnames.c7
-rw-r--r--ncurses/trace/varargs.c4
-rw-r--r--ncurses/trace/visbuf.c57
-rwxr-xr-xncurses/tty/MKexpanded.sh61
-rw-r--r--ncurses/tty/hardscroll.c113
-rw-r--r--ncurses/tty/hashmap.c259
-rw-r--r--ncurses/tty/lib_mvcur.c504
-rw-r--r--ncurses/tty/lib_tstp.c45
-rw-r--r--ncurses/tty/lib_twait.c82
-rw-r--r--ncurses/tty/lib_vidattr.c133
-rw-r--r--ncurses/tty/tty_update.c1228
-rw-r--r--ncurses/wcwidth.h309
-rw-r--r--ncurses/widechar/lib_add_wch.c438
-rw-r--r--ncurses/widechar/lib_box_set.c6
-rw-r--r--ncurses/widechar/lib_cchar.c34
-rw-r--r--ncurses/widechar/lib_erasewchar.c8
-rw-r--r--ncurses/widechar/lib_get_wch.c33
-rw-r--r--ncurses/widechar/lib_get_wstr.c7
-rw-r--r--ncurses/widechar/lib_hline_set.c12
-rw-r--r--ncurses/widechar/lib_in_wch.c6
-rw-r--r--ncurses/widechar/lib_in_wchnstr.c6
-rw-r--r--ncurses/widechar/lib_ins_wch.c62
-rw-r--r--ncurses/widechar/lib_inwstr.c8
-rw-r--r--ncurses/widechar/lib_pecho_wchar.c8
-rw-r--r--ncurses/widechar/lib_unget_wch.c28
-rw-r--r--ncurses/widechar/lib_vid_attr.c124
-rw-r--r--ncurses/widechar/lib_vline_set.c12
-rw-r--r--ncurses/widechar/lib_wacs.c31
-rw-r--r--ncurses/widechar/lib_wunctrl.c26
-rw-r--r--ncurses/win32con/gettimeofday.c51
-rw-r--r--ncurses/win32con/wcwidth.c50
-rw-r--r--ncurses/win32con/win_driver.c1241
182 files changed, 20184 insertions, 4534 deletions
diff --git a/ncurses/Makefile.in b/ncurses/Makefile.in
index 558f79f0bbf3..45a26b9d7eaa 100644
--- a/ncurses/Makefile.in
+++ b/ncurses/Makefile.in
@@ -1,6 +1,6 @@
-# $Id: Makefile.in,v 1.113 2008/10/18 14:11:54 tom Exp $
+# $Id: Makefile.in,v 1.130 2010/11/27 21:45:27 tom Exp $
##############################################################################
-# Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. #
+# Copyright (c) 1998-2009,2010 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 "Software"), #
@@ -46,6 +46,7 @@
.SUFFIXES:
SHELL = /bin/sh
+VPATH = @srcdir@
THIS = Makefile
CF_MFLAGS = @cf_cv_makeflags@
@@ -71,6 +72,7 @@ LIBTOOL_COMPILE = @LIB_COMPILE@
LIBTOOL_LINK = @LIB_LINK@
LIBTOOL_INSTALL = @LIB_INSTALL@
LIBTOOL_UNINSTALL = @LIB_UNINSTALL@
+LT_UNDEF = @LT_UNDEF@
INSTALL = @INSTALL@
INSTALL_LIB = @INSTALL@ @INSTALL_LIB@
@@ -78,11 +80,14 @@ INSTALL_PROG = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
AR = @AR@
-AR_OPTS = @AR_OPTS@
+ARFLAGS = @ARFLAGS@
AWK = @AWK@
LD = @LD@
LN_S = @LN_S@
+CTAGS = @CTAGS@
+ETAGS = @ETAGS@
+
CC = @CC@
CPP = @CPP@
CFLAGS = @CFLAGS@
@@ -92,7 +97,7 @@ CPPFLAGS = -DHAVE_CONFIG_H -I../ncurses -I$(srcdir) @CPPFLAGS@
CCFLAGS = $(CPPFLAGS) $(CFLAGS)
-BUILD_CPPFLAGS = -I../include @BUILD_CPPFLAGS@
+BUILD_CPPFLAGS = -I../include -DUSE_BUILD_CC @BUILD_CPPFLAGS@
BUILD_CC = @BUILD_CC@
BUILD_CCFLAGS = -DHAVE_CONFIG_H -I../ncurses -I$(srcdir) -I$(INCDIR) $(BUILD_CPPFLAGS) @BUILD_CFLAGS@
BUILD_LDFLAGS = @BUILD_LDFLAGS@
@@ -140,6 +145,10 @@ FALLBACK_LIST = @FALLBACK_LIST@
USE_BIG_STRINGS = @USE_BIG_STRINGS@
TERMINFO_CAPS = $(top_srcdir)/include/@TERMINFO_CAPS@
+TERMINFO = @TERMINFO@
+TERMINFO_SRC = @TERMINFO_SRC@
+TIC_PATH = @TIC_PATH@
+
AUTO_SRC = \
./codes.c \
./comp_captab.c \
@@ -153,6 +162,18 @@ AUTO_SRC = \
init_keytry.h \
keys.list
+HEADER_DEPS = \
+ $(srcdir)/curses.priv.h \
+ ../include/ncurses_dll.h \
+ ../include/ncurses_cfg.h \
+ ../include/curses.h \
+ $(INCDIR)/nc_panel.h \
+ ../include/term.h \
+ $(INCDIR)/term_entry.h \
+ $(INCDIR)/nc_tparm.h \
+ $(INCDIR)/nc_alloc.h \
+ $(INCDIR)/nc_mingw.h
+
TEST_DEPS = ../lib/@LIB_PREFIX@ncurses@DFT_DEP_SUFFIX@
TEST_ARGS = @LDFLAGS_STATIC@ @TEST_ARGS@ @LDFLAGS_SHARED@
TEST_LDFLAGS = @LD_MODEL@ $(TEST_ARGS) @LIBS@ @LOCAL_LDFLAGS@ @LDFLAGS@
@@ -164,11 +185,12 @@ TEST_PROGS = \
hashmap$x \
lib_mvcur$x
-base = $(srcdir)/base
-serial = $(srcdir)/tty
-tinfo = $(srcdir)/tinfo
-trace = $(srcdir)/trace
-wide = $(srcdir)/widechar
+base = $(srcdir)/base
+serial = $(srcdir)/tty
+tinfo = $(srcdir)/tinfo
+trace = $(srcdir)/trace
+wide = $(srcdir)/widechar
+win32con = $(srcdir)/win32con
################################################################################
all \
@@ -178,12 +200,12 @@ sources: $(AUTO_SRC)
$(DESTDIR)$(bindir) \
$(DESTDIR)$(libdir) :
- sh $(srcdir)/../mkdirs.sh $@
+ mkdir -p $@
../lib : ; mkdir $@
./fallback.c : $(tinfo)/MKfallback.sh
- sh -e $(tinfo)/MKfallback.sh @TERMINFO@ @TERMINFO_SRC@ $(FALLBACK_LIST) >$@
+ sh -e $(tinfo)/MKfallback.sh $(TERMINFO) $(TERMINFO_SRC) $(TIC_PATH) $(FALLBACK_LIST) >$@
./lib_gen.c : $(base)/MKlib_gen.sh ../include/curses.h
sh -e $(base)/MKlib_gen.sh "$(CPP) $(CPPFLAGS)" "$(AWK)" generated <../include/curses.h >$@
@@ -200,11 +222,11 @@ make_keys$(BUILD_EXEEXT) : \
$(BUILD_CC) -o $@ $(BUILD_CCFLAGS) $(tinfo)/make_keys.c $(BUILD_LDFLAGS) $(BUILD_LIBS)
make_hash$(BUILD_EXEEXT) : \
- $(tinfo)/comp_hash.c \
+ $(tinfo)/make_hash.c \
../include/hashsize.h
- $(BUILD_CC) -o $@ $(BUILD_CCFLAGS) -DMAIN_PROGRAM $(tinfo)/comp_hash.c $(BUILD_LDFLAGS) $(BUILD_LIBS)
+ $(BUILD_CC) -o $@ $(BUILD_CCFLAGS) $(tinfo)/make_hash.c $(BUILD_LDFLAGS) $(BUILD_LIBS)
-./expanded.c : $(serial)/MKexpanded.sh
+./expanded.c : $(srcdir)/curses.priv.h $(serial)/MKexpanded.sh
sh -e $(serial)/MKexpanded.sh "$(CPP)" $(CPPFLAGS) > $@
./comp_captab.c: \
@@ -227,10 +249,10 @@ make_hash$(BUILD_EXEEXT) : \
echo | $(AWK) -f $(base)/MKunctrl.awk bigstrings=$(USE_BIG_STRINGS) >$@
tags:
- ctags *.[ch] */*.[ch]
+ $(CTAGS) *.[ch] */*.[ch]
@MAKE_UPPER_TAGS@TAGS:
-@MAKE_UPPER_TAGS@ etags *.[ch] */*.[ch]
+@MAKE_UPPER_TAGS@ $(ETAGS) *.[ch] */*.[ch]
mostlyclean ::
-rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace
diff --git a/ncurses/README b/ncurses/README
index 120aa5b82c1d..cbde3354a6a3 100644
--- a/ncurses/README
+++ b/ncurses/README
@@ -1,5 +1,5 @@
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2000,2006 Free Software Foundation, Inc. --
+-- Copyright (c) 1998-2006,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 --
@@ -25,7 +25,26 @@
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: README,v 1.9 2006/04/22 22:19:37 tom Exp $
+-- $Id: README,v 1.10 2009/06/27 14:44:30 tom Exp $
-------------------------------------------------------------------------------
For discussion of the package internals, see hackguide.html in the doc/html
directory.
+
+-------------------------------------------------------------------------------
+The llib-lXXXX files could be used as lint-library sources (and were, at one
+time). However, they are actually used as a documentation aid to keep track
+of changes to the public/private interfaces in ncurses. Most of the text in
+these files is generated using cproto; some manual cleanup and adjustment of
+types (to reflect #define's in curses.h) is needed. The functions listed in
+the llib-lXXXX files do not correspond to the default configure options; some
+additional ones are added to include "all" of the entrypoints for each of the
+major configurations (normal, wide-character, threaded):
+
+ --disable-macros
+ --disable-root-environ
+ --enable-expanded
+ --enable-getcap
+ --enable-getcap-cache
+ --enable-sp-funcs
+ --enable-termcap
+ --with-develop
diff --git a/ncurses/base/MKkeyname.awk b/ncurses/base/MKkeyname.awk
index b35ba2a98027..bb2599acb558 100644
--- a/ncurses/base/MKkeyname.awk
+++ b/ncurses/base/MKkeyname.awk
@@ -1,6 +1,6 @@
-# $Id: MKkeyname.awk,v 1.40 2008/07/12 18:40:00 tom Exp $
+# $Id: MKkeyname.awk,v 1.45 2010/12/19 01:36:14 tom Exp $
##############################################################################
-# Copyright (c) 1999-2007,2008 Free Software Foundation, Inc. #
+# Copyright (c) 1999-2009,2010 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 "Software"), #
@@ -31,7 +31,6 @@ BEGIN {
print ""
print "#include <curses.priv.h>"
print "#include <tic.h>"
- print "#include <term_entry.h>"
print ""
first = 1;
}
@@ -67,7 +66,8 @@ END {
print "#define SIZEOF_TABLE 256"
print "#define MyTable _nc_globals.keyname_table"
print ""
- print "NCURSES_EXPORT(NCURSES_CONST char *) _nc_keyname (SCREEN *sp, int c)"
+ print "NCURSES_EXPORT(NCURSES_CONST char *)"
+ print "safe_keyname (SCREEN *sp, int c)"
print "{"
print " int i;"
print " char name[20];"
@@ -116,14 +116,14 @@ END {
print " result = MyTable[c];"
print " }"
print "#if NCURSES_EXT_FUNCS && NCURSES_XNAMES"
- print " } else if (result == 0 && cur_term != 0) {"
+ print " } else if (result == 0 && HasTerminal(sp)) {"
print " int j, k;"
print " char * bound;"
- print " TERMTYPE *tp = &(cur_term->type);"
- print " int save_trace = _nc_tracing;"
+ print " TERMTYPE *tp = &(TerminalOf(sp)->type);"
+ print " unsigned save_trace = _nc_tracing;"
print ""
print " _nc_tracing = 0; /* prevent recursion via keybound() */"
- print " for (j = 0; (bound = keybound(c, j)) != 0; ++j) {"
+ print " for (j = 0; (bound = NCURSES_SP_NAME(keybound)(NCURSES_SP_ARGx c, j)) != 0; ++j) {"
print " for(k = STRCOUNT; k < (int) NUM_STRINGS(tp); k++) {"
print " if (tp->Strings[k] != 0 && !strcmp(bound, tp->Strings[k])) {"
print " result = ExtStrname(tp, k, strnames);"
@@ -141,9 +141,10 @@ END {
print " return result;"
print "}"
print ""
- print "NCURSES_EXPORT(NCURSES_CONST char *) keyname (int c)"
+ print "NCURSES_EXPORT(NCURSES_CONST char *)"
+ print "keyname (int c)"
print "{"
- print "\treturn _nc_keyname(SP, c);"
+ print " return safe_keyname (CURRENT_SCREEN, c);"
print "}"
print ""
print "#if NO_LEAKS"
diff --git a/ncurses/base/MKlib_gen.sh b/ncurses/base/MKlib_gen.sh
index a984e8545eff..66ae295c607c 100755
--- a/ncurses/base/MKlib_gen.sh
+++ b/ncurses/base/MKlib_gen.sh
@@ -2,10 +2,10 @@
#
# MKlib_gen.sh -- generate sources from curses.h macro definitions
#
-# ($Id: MKlib_gen.sh,v 1.34 2008/08/30 19:20:50 tom Exp $)
+# ($Id: MKlib_gen.sh,v 1.43 2011/01/22 19:47:29 tom Exp $)
#
##############################################################################
-# Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. #
+# Copyright (c) 1998-2010,2011 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 "Software"), #
@@ -51,7 +51,7 @@
# them.
# 5. cpp: macro-expand the file so the macro calls turn into C calls
# 6. awk: strip the expansion junk off the front and add the new header
-# 7. sed: squeeze spaces, strip off gen_ prefix, create needed #undef
+# 7. sed: squeeze spaces, strip off gen_ prefix.
#
# keep the editing independent of locale:
@@ -82,6 +82,8 @@ if test "$USE" = implemented ; then
cat >$ED1 <<EOF1
/^extern.*implemented/{
h
+ s/NCURSES_SP_NAME(\([^)]*\))/NCURSES_SP_NAME___\1/
+ h
s/^.*implemented:\([^ *]*\).*/P_POUNDCif_USE_\1_SUPPORT/p
g
s/^extern \([^;]*\);.*/\1/p
@@ -151,14 +153,13 @@ cat >$ED3 <<EOF3
s/( /(/g
s/ )/)/g
s/ gen_/ /
- s/^M_/#undef /
s/^[ ]*@[ ]*@[ ]*/ /
:done
EOF3
if test "$USE" = generated ; then
cat >$ED4 <<EOF
- s/^\(.*\) \(.*\) (\(.*\))\$/NCURSES_EXPORT(\1) \2 (\3)/
+ s/^\(.*\) \(.*\) (\(.*\))\$/NCURSES_EXPORT(\1) (\2) (\3)/
EOF
else
cat >$ED4 <<EOF
@@ -169,6 +170,7 @@ cat >$ED4 <<EOF
g
s/^\(.*\) \(.*\) (\(.*\))\$/\1 call_\2 (\3)/
}
+s/\([^_]\)NCURSES_SP_NAME___\([a-zA-Z][a-zA-Z_]*\)/\1NCURSES_SP_NAME(\2)/g
EOF
fi
@@ -198,14 +200,16 @@ $0 !~ /^P_/ {
}
}
second = first + 1;
+ returnCast = "";
if ( $first == "chtype" ) {
- returnType = "Char";
+ returnType = "Chtype";
} else if ( $first == "SCREEN" ) {
returnType = "SP";
} else if ( $first == "WINDOW" ) {
returnType = "Win";
} else if ( $first == "attr_t" || $second == "attrset" || $second == "standout" || $second == "standend" || $second == "wattrset" || $second == "wstandout" || $second == "wstandend" ) {
- returnType = "Attr";
+ returnType = "IntAttr";
+ returnCast = "(attr_t)";
} else if ( $first == "bool" || $first == "NCURSES_BOOL" ) {
returnType = "Bool";
} else if ( $second == "*" ) {
@@ -220,9 +224,6 @@ $0 !~ /^P_/ {
break;
}
}
- if (using == "generated") {
- print "M_" $myfunc
- }
print $0;
print "{";
argcount = 1;
@@ -247,6 +248,9 @@ $0 !~ /^P_/ {
if ($myfunc ~ /ripoffline/) {
dotrace = 0;
argcount = 2;
+ if ($myfunc ~ /NCURSES_SP_NAME/) {
+ argcount = 3;
+ }
}
if ($myfunc ~ /wunctrl/) {
dotrace = 0;
@@ -262,24 +266,26 @@ $0 !~ /^P_/ {
argtype = ""
for (i = myfunc; i <= NF; i++) {
ch = $i;
- if ( ch == "*" )
+ if ( ch == "*" ) {
pointer = 1;
- else if ( ch == "va_list" )
+ } else if ( ch == "va_list" ) {
va_list = 1;
- else if ( ch == "..." )
+ } else if ( ch == "..." ) {
varargs = 1;
- else if ( ch == "char" )
+ } else if ( ch == "char" ) {
argtype = "char";
- else if ( ch == "int" )
+ } else if ( ch == "int" ) {
argtype = "int";
- else if ( ch == "short" )
+ } else if ( ch == "short" ) {
argtype = "short";
- else if ( ch == "chtype" )
+ } else if ( ch == "chtype" ) {
argtype = "chtype";
- else if ( ch == "attr_t" || ch == "NCURSES_ATTR_T" )
+ } else if ( ch == "attr_t" || ch == "NCURSES_ATTR_T" ) {
argtype = "attr";
+ }
if ( ch == "," || ch == ")" ) {
+ argcast = "";
if (va_list) {
call = call "%s"
} else if (varargs) {
@@ -289,8 +295,10 @@ $0 !~ /^P_/ {
call = call "%s"
comma = comma "_nc_visbuf2(" num ","
pointer = 0;
- } else
+ } else {
call = call "%p"
+ comma = comma "(const void *)"
+ }
} else if (argcount != 0) {
if ( argtype == "int" || argtype == "short" ) {
call = call "%d"
@@ -298,6 +306,9 @@ $0 !~ /^P_/ {
} else if ( argtype != "" ) {
call = call "%s"
comma = comma "_trace" argtype "2(" num ","
+ if (argtype == "attr") {
+ argcast = "(chtype)";
+ }
} else {
call = call "%#lx"
comma = comma "(long)"
@@ -311,7 +322,7 @@ $0 !~ /^P_/ {
} else if ( varargs ) {
args = args comma "\"...\""
} else {
- args = args comma "z"
+ args = args comma argcast "z"
}
}
call = call ch
@@ -322,7 +333,7 @@ $0 !~ /^P_/ {
pointer = 0;
argtype = ""
}
- if ( i == 2 || ch == "(" )
+ if ( i == myfunc || ch == "(" )
call = call ch
}
call = call "\")"
@@ -333,12 +344,16 @@ $0 !~ /^P_/ {
if (dotrace)
printf "%s", call
- if (match($0, "^void"))
+ if (match($0, "^void")) {
call = ""
- else if (dotrace)
+ } else if (dotrace) {
call = sprintf("return%s( ", returnType);
- else
+ if (returnCast != "") {
+ call = call returnCast;
+ }
+ } else {
call = "@@return ";
+ }
call = call $myfunc "(";
for (i = 1; i < argcount; i++) {
@@ -353,8 +368,9 @@ $0 !~ /^P_/ {
}
if (!match($0, "^void"))
call = call ") ";
- if (dotrace)
+ if (dotrace) {
call = call ")";
+ }
print call ";"
if (match($0, "^void"))
@@ -381,8 +397,17 @@ BEGIN {
}
print " */"
print "#define NCURSES_ATTR_T int"
+ print "#include <ncurses_cfg.h>"
+ print ""
+ print "#undef NCURSES_NOMACROS /* _this_ file uses macros */"
+ print ""
print "#include <curses.priv.h>"
print ""
+ print "#undef vw_scanw"
+ print "#undef vwscanw"
+ print ""
+ print "#undef vw_printw"
+ print "#undef vwprintw"
}
/^DECLARATIONS/ {start = 1; next;}
{if (start) print \$0;}
diff --git a/ncurses/base/MKunctrl.awk b/ncurses/base/MKunctrl.awk
index 36fbeecb2e76..2140900e8c3b 100644
--- a/ncurses/base/MKunctrl.awk
+++ b/ncurses/base/MKunctrl.awk
@@ -1,6 +1,6 @@
-# $Id: MKunctrl.awk,v 1.23 2008/10/04 21:40:24 tom Exp $
+# $Id: MKunctrl.awk,v 1.26 2009/07/04 22:05:15 Clemens.Ladisch Exp $
##############################################################################
-# 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 "Software"), #
@@ -36,19 +36,12 @@ BEGIN {
print "#include <curses.priv.h>"
print "#include <ctype.h>"
print ""
- print "#if USE_WIDEC_SUPPORT"
- print "#if HAVE_WCTYPE_H"
- print "#include <wctype.h>"
- print "#endif"
- print "#endif"
- print ""
print "#undef unctrl"
print ""
}
END {
- print "NCURSES_EXPORT(NCURSES_CONST char *) _nc_unctrl (SCREEN *sp, chtype ch)"
+ print "NCURSES_EXPORT(NCURSES_CONST char *) safe_unctrl(SCREEN *sp, chtype ch)"
print "{"
-
blob=""
offset=0
if (bigstrings) {
@@ -158,16 +151,6 @@ END {
print "\t\t && (check < 160))"
printf "\t\t\tresult = %s_c1[check - 128];\n", stringname;
print "\t\telse"
- print "#if USE_WIDEC_SUPPORT"
- print "\t\tif ((check >= 160)"
- print "\t\t && (check < 256)"
- print "\t\t && ((sp != 0)"
- print "\t\t && ((sp->_legacy_coding > 0)"
- print "\t\t || (sp->_legacy_coding == 0"
- print "\t\t && (isprint(check) || iswprint(check))))))"
- printf "\t\t\tresult = %s_c1[check - 128];\n", stringname;
- print "\t\telse"
- print "#else"
print "\t\tif ((check >= 160)"
print "\t\t && (check < 256)"
print "\t\t && ((sp != 0)"
@@ -176,7 +159,6 @@ END {
print "\t\t && isprint(check)))))"
printf "\t\t\tresult = %s_c1[check - 128];\n", stringname;
print "\t\telse"
- print "#endif /* USE_WIDEC_SUPPORT */"
print "#endif /* NCURSES_EXT_FUNCS */"
printf "\t\t\tresult = %s_table[check];\n", stringname;
print "\t} else {"
@@ -187,6 +169,6 @@ END {
print ""
print "NCURSES_EXPORT(NCURSES_CONST char *) unctrl (chtype ch)"
print "{"
- print "\treturn _nc_unctrl(SP, ch);"
+ print "\treturn safe_unctrl(CURRENT_SCREEN, ch);"
print "}"
}
diff --git a/ncurses/base/define_key.c b/ncurses/base/define_key.c
index 3d5815f906d6..a49b094279c8 100644
--- a/ncurses/base/define_key.c
+++ b/ncurses/base/define_key.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2006,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,33 +27,40 @@
****************************************************************************/
/****************************************************************************
- * Author: Thomas E. Dickey 1997-on *
+ * Author: Thomas E. Dickey 1997-on *
+ * and: Juergen Pfeifer 2009 *
****************************************************************************/
#include <curses.priv.h>
-MODULE_ID("$Id: define_key.c,v 1.13 2006/12/30 23:23:31 tom Exp $")
+MODULE_ID("$Id: define_key.c,v 1.20 2009/11/28 22:53:17 tom Exp $")
NCURSES_EXPORT(int)
-define_key(const char *str, int keycode)
+NCURSES_SP_NAME(define_key) (NCURSES_SP_DCLx const char *str, int keycode)
{
int code = ERR;
- T((T_CALLED("define_key(%s,%d)"), _nc_visbuf(str), keycode));
- if (SP == 0) {
+ T((T_CALLED("define_key(%p, %s,%d)"), (void *) SP_PARM, _nc_visbuf(str), keycode));
+ if (SP_PARM == 0 || !HasTInfoTerminal(SP_PARM)) {
code = ERR;
} else if (keycode > 0) {
unsigned ukey = (unsigned) keycode;
+#ifdef USE_TERM_DRIVER
+#define CallHasKey(keycode) CallDriver_1(SP_PARM, kyExist, keycode)
+#else
+#define CallHasKey(keycode) NCURSES_SP_NAME(has_key)(NCURSES_SP_ARGx keycode)
+#endif
+
if (str != 0) {
- define_key(str, 0);
- } else if (has_key(keycode)) {
- while (_nc_remove_key(&(SP->_keytry), ukey))
+ NCURSES_SP_NAME(define_key) (NCURSES_SP_ARGx str, 0);
+ } else if (CallHasKey(keycode)) {
+ while (_nc_remove_key(&(SP_PARM->_keytry), ukey))
code = OK;
}
if (str != 0) {
- if (key_defined(str) == 0) {
- if (_nc_add_to_try(&(SP->_keytry), str, ukey) == OK) {
+ if (NCURSES_SP_NAME(key_defined) (NCURSES_SP_ARGx str) == 0) {
+ if (_nc_add_to_try(&(SP_PARM->_keytry), str, ukey) == OK) {
code = OK;
} else {
code = ERR;
@@ -63,8 +70,16 @@ define_key(const char *str, int keycode)
}
}
} else {
- while (_nc_remove_string(&(SP->_keytry), str))
+ while (_nc_remove_string(&(SP_PARM->_keytry), str))
code = OK;
}
returnCode(code);
}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+define_key(const char *str, int keycode)
+{
+ return NCURSES_SP_NAME(define_key) (CURRENT_SCREEN, str, keycode);
+}
+#endif
diff --git a/ncurses/base/key_defined.c b/ncurses/base/key_defined.c
index 759ad824318d..ef987a5484d5 100644
--- a/ncurses/base/key_defined.c
+++ b/ncurses/base/key_defined.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2003,2006 Free Software Foundation, Inc. *
+ * Copyright (c) 2003-2006,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 *
@@ -32,7 +32,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: key_defined.c,v 1.6 2006/12/30 23:22:55 tom Exp $")
+MODULE_ID("$Id: key_defined.c,v 1.9 2009/10/24 22:15:47 tom Exp $")
static int
find_definition(TRIES * tree, const char *str)
@@ -65,14 +65,22 @@ find_definition(TRIES * tree, const char *str)
* Otherwise, return the keycode's value (neither OK/ERR).
*/
NCURSES_EXPORT(int)
-key_defined(const char *str)
+NCURSES_SP_NAME(key_defined) (NCURSES_SP_DCLx const char *str)
{
int code = ERR;
- T((T_CALLED("key_defined(%s)"), _nc_visbuf(str)));
- if (SP != 0 && str != 0) {
- code = find_definition(SP->_keytry, str);
+ T((T_CALLED("key_defined(%p, %s)"), (void *) SP_PARM, _nc_visbuf(str)));
+ if (SP_PARM != 0 && str != 0) {
+ code = find_definition(SP_PARM->_keytry, str);
}
returnCode(code);
}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+key_defined(const char *str)
+{
+ return NCURSES_SP_NAME(key_defined) (CURRENT_SCREEN, str);
+}
+#endif
diff --git a/ncurses/base/keybound.c b/ncurses/base/keybound.c
index 2995714ba936..65e6bfc63620 100644
--- a/ncurses/base/keybound.c
+++ b/ncurses/base/keybound.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1999-2005,2006 Free Software Foundation, Inc. *
+ * Copyright (c) 1999-2006,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,25 +27,34 @@
****************************************************************************/
/****************************************************************************
- * Author: Thomas E. Dickey 1999-on *
+ * Author: Thomas E. Dickey 1999-on *
+ * and: Juergen Pfeifer 2009 *
****************************************************************************/
#include <curses.priv.h>
-MODULE_ID("$Id: keybound.c,v 1.7 2006/06/17 18:19:24 tom Exp $")
+MODULE_ID("$Id: keybound.c,v 1.10 2009/10/24 22:15:47 tom Exp $")
/*
* Returns the count'th string definition which is associated with the
* given keycode. The result is malloc'd, must be freed by the caller.
*/
NCURSES_EXPORT(char *)
-keybound(int code, int count)
+NCURSES_SP_NAME(keybound) (NCURSES_SP_DCLx int code, int count)
{
char *result = 0;
- T((T_CALLED("keybound(%d,%d)"), code, count));
- if (SP != 0 && code >= 0) {
- result = _nc_expand_try(SP->_keytry, (unsigned) code, &count, 0);
+ T((T_CALLED("keybound(%p, %d,%d)"), (void *) SP_PARM, code, count));
+ if (SP_PARM != 0 && code >= 0) {
+ result = _nc_expand_try(SP_PARM->_keytry, (unsigned) code, &count, 0);
}
returnPtr(result);
}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(char *)
+keybound(int code, int count)
+{
+ return NCURSES_SP_NAME(keybound) (CURRENT_SCREEN, code, count);
+}
+#endif
diff --git a/ncurses/base/keyok.c b/ncurses/base/keyok.c
index ad8988cded3b..0eacf4926300 100644
--- a/ncurses/base/keyok.c
+++ b/ncurses/base/keyok.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2000,2006 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2006,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 1997-on *
+ * Author: Thomas E. Dickey 1997-on *
+ * and: Juergen Pfeifer 2009 *
****************************************************************************/
#include <curses.priv.h>
-MODULE_ID("$Id: keyok.c,v 1.7 2006/12/30 16:22:33 tom Exp $")
+MODULE_ID("$Id: keyok.c,v 1.10 2009/10/24 22:15:47 tom Exp $")
/*
* Enable (or disable) ncurses' interpretation of a keycode by adding (or
@@ -45,28 +46,33 @@ MODULE_ID("$Id: keyok.c,v 1.7 2006/12/30 16:22:33 tom Exp $")
*/
NCURSES_EXPORT(int)
-keyok(int c, bool flag)
+NCURSES_SP_NAME(keyok) (NCURSES_SP_DCLx int c, bool flag)
{
int code = ERR;
- int count = 0;
- char *s;
+ T((T_CALLED("keyok(%p, %d,%d)"), (void *) SP_PARM, c, flag));
+#ifdef USE_TERM_DRIVER
+ code = CallDriver_2(sp, kyOk, c, flag);
+#else
T((T_CALLED("keyok(%d,%d)"), c, flag));
if (c >= 0) {
+ int count = 0;
+ char *s;
unsigned ch = (unsigned) c;
+
if (flag) {
- while ((s = _nc_expand_try(SP->_key_ok, ch, &count, 0)) != 0
- && _nc_remove_key(&(SP->_key_ok), ch)) {
- code = _nc_add_to_try(&(SP->_keytry), s, ch);
+ while ((s = _nc_expand_try(SP_PARM->_key_ok, ch, &count, 0)) != 0
+ && _nc_remove_key(&(SP_PARM->_key_ok), ch)) {
+ code = _nc_add_to_try(&(SP_PARM->_keytry), s, ch);
free(s);
count = 0;
if (code != OK)
break;
}
} else {
- while ((s = _nc_expand_try(SP->_keytry, ch, &count, 0)) != 0
- && _nc_remove_key(&(SP->_keytry), ch)) {
- code = _nc_add_to_try(&(SP->_key_ok), s, ch);
+ while ((s = _nc_expand_try(SP_PARM->_keytry, ch, &count, 0)) != 0
+ && _nc_remove_key(&(SP_PARM->_keytry), ch)) {
+ code = _nc_add_to_try(&(SP_PARM->_key_ok), s, ch);
free(s);
count = 0;
if (code != OK)
@@ -74,5 +80,14 @@ keyok(int c, bool flag)
}
}
}
+#endif
returnCode(code);
}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+keyok(int c, bool flag)
+{
+ return NCURSES_SP_NAME(keyok) (CURRENT_SCREEN, c, flag);
+}
+#endif
diff --git a/ncurses/base/legacy_coding.c b/ncurses/base/legacy_coding.c
index 1c2f160a605d..d8c80208c6a9 100644
--- a/ncurses/base/legacy_coding.c
+++ b/ncurses/base/legacy_coding.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2005 Free Software Foundation, Inc. *
+ * Copyright (c) 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 *
@@ -27,22 +27,31 @@
****************************************************************************/
/****************************************************************************
- * Author: Thomas E. Dickey *
+ * Author: Thomas E. Dickey 2005 *
+ * Juergen Pfeifer 2009 *
****************************************************************************/
#include <curses.priv.h>
-MODULE_ID("$Id: legacy_coding.c,v 1.2 2005/12/17 23:38:17 tom Exp $")
+MODULE_ID("$Id: legacy_coding.c,v 1.5 2009/10/24 22:15:00 tom Exp $")
NCURSES_EXPORT(int)
-use_legacy_coding(int level)
+NCURSES_SP_NAME(use_legacy_coding) (NCURSES_SP_DCLx int level)
{
int result = ERR;
- T((T_CALLED("use_legacy_coding(%d)"), level));
- if (level >= 0 && level <= 2 && SP != 0) {
- result = SP->_legacy_coding;
- SP->_legacy_coding = level;
+ T((T_CALLED("use_legacy_coding(%p,%d)"), (void *) SP_PARM, level));
+ if (level >= 0 && level <= 2 && SP_PARM != 0) {
+ result = SP_PARM->_legacy_coding;
+ SP_PARM->_legacy_coding = level;
}
returnCode(result);
}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+use_legacy_coding(int level)
+{
+ return NCURSES_SP_NAME(use_legacy_coding) (CURRENT_SCREEN, level);
+}
+#endif
diff --git a/ncurses/base/lib_addch.c b/ncurses/base/lib_addch.c
index 20a97a01a011..515ebaf0b8fc 100644
--- a/ncurses/base/lib_addch.c
+++ b/ncurses/base/lib_addch.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2006,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2010 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 *
@@ -36,7 +36,7 @@
#include <curses.priv.h>
#include <ctype.h>
-MODULE_ID("$Id: lib_addch.c,v 1.113 2008/08/16 19:20:04 tom Exp $")
+MODULE_ID("$Id: lib_addch.c,v 1.124 2010/04/24 22:41:05 tom Exp $")
static const NCURSES_CH_T blankchar = NewChar(BLANK_TEXT);
@@ -77,12 +77,6 @@ render_char(WINDOW *win, NCURSES_CH_T ch)
if ((pair = GET_WINDOW_PAIR(win)) == 0)
pair = GetPair(win->_nc_bkgd);
}
-#if 0
- if (pair > 255) {
- NCURSES_CH_T fixme = ch;
- SetPair(fixme, pair);
- }
-#endif
AddAttr(ch, (a & COLOR_MASK(AttrOf(ch))));
SetPair(ch, pair);
}
@@ -131,7 +125,7 @@ newline_forces_scroll(WINDOW *win, NCURSES_SIZE_T * ypos)
*ypos = win->_regbottom;
result = TRUE;
} else {
- *ypos += 1;
+ *ypos = (NCURSES_SIZE_T) (*ypos + 1);
}
return result;
}
@@ -176,8 +170,8 @@ fill_cells(WINDOW *win, int count)
if (waddch_literal(win, blank) == ERR)
break;
}
- win->_curx = save_x;
- win->_cury = save_y;
+ win->_curx = (NCURSES_SIZE_T) save_x;
+ win->_cury = (NCURSES_SIZE_T) save_y;
}
#endif
@@ -213,9 +207,9 @@ _nc_build_wch(WINDOW *win, ARG_CH_T ch)
buffer[WINDOW_EXT(win, addch_used)] = (char) CharOf(CHDEREF(ch));
WINDOW_EXT(win, addch_used) += 1;
buffer[WINDOW_EXT(win, addch_used)] = '\0';
- if ((len = mbrtowc(&result,
- buffer,
- WINDOW_EXT(win, addch_used), &state)) > 0) {
+ if ((len = (int) mbrtowc(&result,
+ buffer,
+ WINDOW_EXT(win, addch_used), &state)) > 0) {
attr_t attrs = AttrOf(CHDEREF(ch));
if_EXT_COLORS(int pair = GetPair(CHDEREF(ch)));
SetChar(CHDEREF(ch), result, attrs);
@@ -260,20 +254,37 @@ waddch_literal(WINDOW *win, NCURSES_CH_T ch)
/*
* Build up multibyte characters until we have a wide-character.
*/
+#if NCURSES_SP_FUNCS
+#define DeriveSP() SCREEN *sp = _nc_screen_of(win);
+#else
+#define DeriveSP() /*nothing */
+#endif
if_WIDEC({
+ DeriveSP();
if (WINDOW_EXT(win, addch_used) != 0 || !Charable(ch)) {
int len = _nc_build_wch(win, CHREF(ch));
if (len >= -1) {
- /* handle EILSEQ */
- if (is8bits(CharOf(ch))) {
- const char *s = unctrl((chtype) CharOf(ch));
- if (s[1] != 0) {
- return waddstr(win, s);
+ attr_t attr = AttrOf(ch);
+
+ /* handle EILSEQ (i.e., when len >= -1) */
+ if (len == -1 && is8bits(CharOf(ch))) {
+ int rc = OK;
+ const char *s = NCURSES_SP_NAME(unctrl)
+ (NCURSES_SP_ARGx (chtype) CharOf(ch));
+
+ if (s[1] != '\0') {
+ while (*s != '\0') {
+ rc = waddch(win, UChar(*s) | attr);
+ if (rc != OK)
+ break;
+ ++s;
+ }
+ return rc;
}
}
if (len == -1)
- return waddch(win, ' ');
+ return waddch(win, ' ' | attr);
} else {
return OK;
}
@@ -327,6 +338,7 @@ waddch_literal(WINDOW *win, NCURSES_CH_T ch)
return ERR;
x = win->_curx;
y = win->_cury;
+ line = win->_line + y;
}
/*
* Check for cells which are orphaned by adding this character, set
@@ -384,7 +396,7 @@ waddch_literal(WINDOW *win, NCURSES_CH_T ch)
if (x > win->_maxx) {
return wrap_to_next_line(win);
}
- win->_curx = x;
+ win->_curx = (NCURSES_SIZE_T) x;
return OK;
}
@@ -393,9 +405,12 @@ waddch_nosync(WINDOW *win, const NCURSES_CH_T ch)
/* the workhorse function -- add a character to the given window */
{
NCURSES_SIZE_T x, y;
- chtype t = CharOf(ch);
- const char *s = unctrl(t);
-
+ chtype t = (chtype) CharOf(ch);
+#if USE_WIDEC_SUPPORT || NCURSES_SP_FUNCS || USE_REENTRANT
+ SCREEN *sp = _nc_screen_of(win);
+#endif
+ const char *s = NCURSES_SP_NAME(unctrl) (NCURSES_SP_ARGx t);
+ int tabsize = 8;
/*
* If we are using the alternate character set, forget about locale.
* Otherwise, if unctrl() returns a single-character or the locale
@@ -404,14 +419,14 @@ waddch_nosync(WINDOW *win, const NCURSES_CH_T ch)
if ((AttrOf(ch) & A_ALTCHARSET)
|| (
#if USE_WIDEC_SUPPORT
- (SP != 0 && SP->_legacy_coding) &&
+ (sp != 0 && sp->_legacy_coding) &&
#endif
s[1] == 0
)
|| (
isprint(t)
#if USE_WIDEC_SUPPORT
- || ((SP == 0 || !SP->_legacy_coding) &&
+ || ((sp == 0 || !sp->_legacy_coding) &&
(WINDOW_EXT(win, addch_used)
|| !_nc_is_charable(CharOf(ch))))
#endif
@@ -427,8 +442,12 @@ waddch_nosync(WINDOW *win, const NCURSES_CH_T ch)
switch (t) {
case '\t':
- x += (TABSIZE - (x % TABSIZE));
-
+#if USE_REENTRANT
+ tabsize = *ptrTabsize(sp);
+#else
+ tabsize = TABSIZE;
+#endif
+ x = (NCURSES_SIZE_T) (x + (tabsize - (x % tabsize)));
/*
* Space-fill the tab on the bottom line so that we'll get the
* "correct" cursor position.
@@ -514,7 +533,7 @@ waddch(WINDOW *win, const chtype ch)
NCURSES_CH_T wch;
SetChar2(wch, ch);
- TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("waddch(%p, %s)"), win,
+ TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("waddch(%p, %s)"), (void *) win,
_tracechtype(ch)));
if (win && (waddch_nosync(win, wch) != ERR)) {
@@ -533,7 +552,8 @@ wechochar(WINDOW *win, const chtype ch)
NCURSES_CH_T wch;
SetChar2(wch, ch);
- TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wechochar(%p, %s)"), win,
+ TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wechochar(%p, %s)"),
+ (void *) win,
_tracechtype(ch)));
if (win && (waddch_nosync(win, wch) != ERR)) {
diff --git a/ncurses/base/lib_addstr.c b/ncurses/base/lib_addstr.c
index 4e3a040cf032..d73ce00a4519 100644
--- a/ncurses/base/lib_addstr.c
+++ b/ncurses/base/lib_addstr.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2010 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 *
@@ -44,7 +44,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_addstr.c,v 1.48 2007/10/13 19:56:57 tom Exp $")
+MODULE_ID("$Id: lib_addstr.c,v 1.51 2010/12/19 01:22:58 tom Exp $")
NCURSES_EXPORT(int)
waddnstr(WINDOW *win, const char *astr, int n)
@@ -52,7 +52,7 @@ waddnstr(WINDOW *win, const char *astr, int n)
const char *str = astr;
int code = ERR;
- T((T_CALLED("waddnstr(%p,%s,%d)"), win, _nc_visbufn(astr, n), n));
+ T((T_CALLED("waddnstr(%p,%s,%d)"), (void *) win, _nc_visbufn(astr, n), n));
if (win && (str != 0)) {
TR(TRACE_VIRTPUT | TRACE_ATTRS,
@@ -85,7 +85,7 @@ waddchnstr(WINDOW *win, const chtype *astr, int n)
int i;
struct ldat *line;
- T((T_CALLED("waddchnstr(%p,%p,%d)"), win, astr, n));
+ T((T_CALLED("waddchnstr(%p,%p,%d)"), (void *) win, (const void *) astr, n));
if (!win)
returnCode(ERR);
@@ -107,7 +107,7 @@ waddchnstr(WINDOW *win, const chtype *astr, int n)
for (i = 0; i < n && ChCharOf(astr[i]) != '\0'; ++i) {
SetChar2(line->text[i + x], astr[i]);
}
- CHANGED_RANGE(line, x, x + n - 1);
+ CHANGED_RANGE(line, x, (NCURSES_SIZE_T) (x + n - 1));
_nc_synchook(win);
returnCode(code);
@@ -135,7 +135,10 @@ wadd_wchnstr(WINDOW *win, const cchar_t *astr, int n)
struct ldat *line;
int i, j, start, len, end;
- T((T_CALLED("wadd_wchnstr(%p,%s,%d)"), win, _nc_viscbuf(astr, n), n));
+ T((T_CALLED("wadd_wchnstr(%p,%s,%d)"),
+ (void *) win,
+ _nc_viscbuf(astr, n),
+ n));
if (!win)
returnCode(ERR);
@@ -190,7 +193,7 @@ wadd_wchnstr(WINDOW *win, const cchar_t *astr, int n)
SetWidecExt(line->text[x + j], j);
}
}
- x += len;
+ x = (NCURSES_SIZE_T) (x + len);
end += len - 1;
} else {
break;
@@ -217,7 +220,7 @@ waddnwstr(WINDOW *win, const wchar_t *str, int n)
{
int code = ERR;
- T((T_CALLED("waddnwstr(%p,%s,%d)"), win, _nc_viswbufn(str, n), n));
+ T((T_CALLED("waddnwstr(%p,%s,%d)"), (void *) win, _nc_viswbufn(str, n), n));
if (win && (str != 0)) {
TR(TRACE_VIRTPUT | TRACE_ATTRS,
diff --git a/ncurses/base/lib_beep.c b/ncurses/base/lib_beep.c
index b478f251a1bb..9d7f7fd96f01 100644
--- a/ncurses/base/lib_beep.c
+++ b/ncurses/base/lib_beep.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -30,6 +30,7 @@
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
* and: Thomas E. Dickey 1996-on *
+ * and: Juergen Pfeifer 2009 *
****************************************************************************/
/*
@@ -40,9 +41,12 @@
*/
#include <curses.priv.h>
-#include <term.h> /* beep, flash */
-MODULE_ID("$Id: lib_beep.c,v 1.10 2005/04/09 15:20:04 tom Exp $")
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
+MODULE_ID("$Id: lib_beep.c,v 1.15 2009/10/24 22:02:14 tom Exp $")
/*
* beep()
@@ -53,12 +57,16 @@ MODULE_ID("$Id: lib_beep.c,v 1.10 2005/04/09 15:20:04 tom Exp $")
*/
NCURSES_EXPORT(int)
-beep(void)
+NCURSES_SP_NAME(beep) (NCURSES_SP_DCL0)
{
int res = ERR;
- T((T_CALLED("beep()")));
+ T((T_CALLED("beep(%p)"), (void *) 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;
@@ -71,6 +79,15 @@ beep(void)
res = putp(flash_screen);
_nc_flush();
}
+#endif
returnCode(res);
}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+beep(void)
+{
+ return NCURSES_SP_NAME(beep) (CURRENT_SCREEN);
+}
+#endif
diff --git a/ncurses/base/lib_bkgd.c b/ncurses/base/lib_bkgd.c
index c99e0c5fc3a8..0396ba8f47a8 100644
--- a/ncurses/base/lib_bkgd.c
+++ b/ncurses/base/lib_bkgd.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2006,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2011 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 *
@@ -36,7 +36,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_bkgd.c,v 1.36 2008/03/23 00:09:14 tom Exp $")
+MODULE_ID("$Id: lib_bkgd.c,v 1.43 2011/01/22 19:47:37 tom Exp $")
/*
* Set the window's background information.
@@ -48,7 +48,7 @@ static NCURSES_INLINE void
#endif
wbkgrndset(WINDOW *win, const ARG_CH_T ch)
{
- T((T_CALLED("wbkgdset(%p,%s)"), win, _tracech_t(ch)));
+ T((T_CALLED("wbkgdset(%p,%s)"), (void *) win, _tracech_t(ch)));
if (win) {
attr_t off = AttrOf(win->_nc_bkgd);
@@ -85,12 +85,12 @@ wbkgrndset(WINDOW *win, const ARG_CH_T ch)
cchar_t wch;
int tmp;
- wgetbkgrnd(win, &wch);
+ (void) wgetbkgrnd(win, &wch);
tmp = _nc_to_char((wint_t) CharOf(wch));
win->_bkgd = (((tmp == EOF) ? ' ' : (chtype) tmp)
| (AttrOf(wch) & ALL_BUT_COLOR)
- | COLOR_PAIR(GET_WINDOW_PAIR(win)));
+ | (chtype) ColorPair(GET_WINDOW_PAIR(win)));
}
#endif
}
@@ -120,14 +120,14 @@ wbkgrnd(WINDOW *win, const ARG_CH_T ch)
int x, y;
NCURSES_CH_T new_bkgd = CHDEREF(ch);
- T((T_CALLED("wbkgd(%p,%s)"), win, _tracech_t(ch)));
+ T((T_CALLED("wbkgd(%p,%s)"), (void *) win, _tracech_t(ch)));
if (win) {
NCURSES_CH_T old_bkgrnd;
wgetbkgrnd(win, &old_bkgrnd);
- wbkgrndset(win, CHREF(new_bkgd));
- wattrset(win, AttrOf(win->_nc_bkgd));
+ (void) wbkgrndset(win, CHREF(new_bkgd));
+ (void) wattrset(win, AttrOf(win->_nc_bkgd));
for (y = 0; y <= win->_maxy; y++) {
for (x = 0; x <= win->_maxx; x++) {
diff --git a/ncurses/base/lib_box.c b/ncurses/base/lib_box.c
index d6cfc6cfe09c..6f17c97a5b07 100644
--- a/ncurses/base/lib_box.c
+++ b/ncurses/base/lib_box.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2002,2005 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2010 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 *
@@ -42,7 +42,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_box.c,v 1.22 2005/11/26 15:39:42 tom Exp $")
+MODULE_ID("$Id: lib_box.c,v 1.24 2010/04/24 23:51:57 tom Exp $")
#if USE_WIDEC_SUPPORT
static NCURSES_INLINE chtype
@@ -51,8 +51,9 @@ _my_render(WINDOW *win, chtype ch)
NCURSES_CH_T wch;
SetChar2(wch, ch);
wch = _nc_render(win, wch);
- return CharOf(wch) | AttrOf(wch);
+ return ((attr_t) CharOf(wch)) | AttrOf(wch);
}
+
#define RENDER_WITH_DEFAULT(ch,def) w ## ch = _my_render(win, (ch == 0) ? def : ch)
#else
#define RENDER_WITH_DEFAULT(ch,def) w ## ch = _nc_render(win, (ch == 0) ? def : ch)
@@ -70,7 +71,7 @@ wborder(WINDOW *win,
chtype wls, wrs, wts, wbs, wtl, wtr, wbl, wbr;
T((T_CALLED("wborder(%p,%s,%s,%s,%s,%s,%s,%s,%s)"),
- win,
+ (void *) win,
_tracechtype2(1, ls),
_tracechtype2(2, rs),
_tracechtype2(3, ts),
diff --git a/ncurses/base/lib_chgat.c b/ncurses/base/lib_chgat.c
index 89eefa7e82fe..cdddaeae995c 100644
--- a/ncurses/base/lib_chgat.c
+++ b/ncurses/base/lib_chgat.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2010 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 *
@@ -42,19 +42,19 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_chgat.c,v 1.7 2006/07/15 22:07:11 tom Exp $")
+MODULE_ID("$Id: lib_chgat.c,v 1.9 2010/03/31 23:38:02 tom Exp $")
NCURSES_EXPORT(int)
wchgat(WINDOW *win, int n, attr_t attr, short color, const void *opts GCC_UNUSED)
{
int i;
- T((T_CALLED("wchgat(%p,%d,%s,%d)"), win, n, _traceattr(attr), color));
+ T((T_CALLED("wchgat(%p,%d,%s,%d)"), (void *) win, n, _traceattr(attr), color));
if (win) {
struct ldat *line = &(win->_line[win->_cury]);
- toggle_attr_on(attr, COLOR_PAIR(color));
+ toggle_attr_on(attr, ColorPair(color));
for (i = win->_curx; i <= win->_maxx && (n == -1 || (n-- > 0)); i++) {
SetAttr(line->text[i], attr);
diff --git a/ncurses/base/lib_clear.c b/ncurses/base/lib_clear.c
index e0b4edf9e224..008744ccbabb 100644
--- a/ncurses/base/lib_clear.c
+++ b/ncurses/base/lib_clear.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2000,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 *
@@ -40,14 +40,14 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_clear.c,v 1.7 2000/12/10 02:43:26 tom Exp $")
+MODULE_ID("$Id: lib_clear.c,v 1.8 2009/10/24 22:33:29 tom Exp $")
NCURSES_EXPORT(int)
wclear(WINDOW *win)
{
int code = ERR;
- T((T_CALLED("wclear(%p)"), win));
+ T((T_CALLED("wclear(%p)"), (void *) win));
if ((code = werase(win)) != ERR)
win->_clear = TRUE;
diff --git a/ncurses/base/lib_clearok.c b/ncurses/base/lib_clearok.c
index 9b56bd1ec63a..ffc7d02dc0ff 100644
--- a/ncurses/base/lib_clearok.c
+++ b/ncurses/base/lib_clearok.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2000,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 *
@@ -40,12 +40,12 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_clearok.c,v 1.4 2000/12/10 02:43:26 tom Exp $")
+MODULE_ID("$Id: lib_clearok.c,v 1.5 2009/10/24 22:34:53 tom Exp $")
NCURSES_EXPORT(int)
clearok(WINDOW *win, bool flag)
{
- T((T_CALLED("clearok(%p,%d)"), win, flag));
+ T((T_CALLED("clearok(%p,%d)"), (void *) win, flag));
if (win) {
win->_clear = flag;
diff --git a/ncurses/base/lib_clrbot.c b/ncurses/base/lib_clrbot.c
index df196e815f82..cbf2206d5581 100644
--- a/ncurses/base/lib_clrbot.c
+++ b/ncurses/base/lib_clrbot.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2001,2006 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2006,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 *
@@ -40,14 +40,14 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_clrbot.c,v 1.20 2006/10/14 20:43:31 tom Exp $")
+MODULE_ID("$Id: lib_clrbot.c,v 1.21 2009/10/24 22:33:19 tom Exp $")
NCURSES_EXPORT(int)
wclrtobot(WINDOW *win)
{
int code = ERR;
- T((T_CALLED("wclrtobot(%p)"), win));
+ T((T_CALLED("wclrtobot(%p)"), (void *) win));
if (win) {
NCURSES_SIZE_T y;
diff --git a/ncurses/base/lib_clreol.c b/ncurses/base/lib_clreol.c
index c46ebd93a332..7aff84b35a42 100644
--- a/ncurses/base/lib_clreol.c
+++ b/ncurses/base/lib_clreol.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2001,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 *
@@ -40,14 +40,14 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_clreol.c,v 1.21 2001/12/19 01:06:04 tom Exp $")
+MODULE_ID("$Id: lib_clreol.c,v 1.22 2009/10/24 22:33:06 tom Exp $")
NCURSES_EXPORT(int)
wclrtoeol(WINDOW *win)
{
int code = ERR;
- T((T_CALLED("wclrtoeol(%p)"), win));
+ T((T_CALLED("wclrtoeol(%p)"), (void *) win));
if (win) {
NCURSES_CH_T blank;
diff --git a/ncurses/base/lib_color.c b/ncurses/base/lib_color.c
index 9cae495436fe..a5c181c8b4b1 100644
--- a/ncurses/base/lib_color.c
+++ b/ncurses/base/lib_color.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -30,6 +30,7 @@
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
* and: Thomas E. Dickey 1996-on *
+ * and: Juergen Pfeifer 2009 *
****************************************************************************/
/* lib_color.c
@@ -38,12 +39,33 @@
*/
#include <curses.priv.h>
-
-#include <term.h>
#include <tic.h>
-MODULE_ID("$Id: lib_color.c,v 1.85 2007/04/07 17:07:28 tom Exp $")
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
+MODULE_ID("$Id: lib_color.c,v 1.98 2010/04/24 22:57:53 tom Exp $")
+
+#ifdef USE_TERM_DRIVER
+#define CanChange InfoOf(SP_PARM).canchange
+#define DefaultPalette InfoOf(SP_PARM).defaultPalette
+#define HasColor InfoOf(SP_PARM).hascolor
+#define InitColor InfoOf(SP_PARM).initcolor
+#define MaxColors InfoOf(SP_PARM).maxcolors
+#define MaxPairs InfoOf(SP_PARM).maxpairs
+#define UseHlsPalette (DefaultPalette == _nc_hls_palette)
+#else
+#define CanChange can_change
+#define DefaultPalette (hue_lightness_saturation ? hls_palette : cga_palette)
+#define HasColor has_color
+#define InitColor initialize_color
+#define MaxColors max_colors
+#define MaxPairs max_pairs
+#define UseHlsPalette (hue_lightness_saturation)
+#endif
+#ifndef USE_TERM_DRIVER
/*
* These should be screen structure members. They need to be globals for
* historical reasons. So we assign them in start_color() and also in
@@ -64,6 +86,7 @@ NCURSES_PUBLIC_VAR(COLORS) (void)
NCURSES_EXPORT_VAR(int) COLOR_PAIRS = 0;
NCURSES_EXPORT_VAR(int) COLORS = 0;
#endif
+#endif /* !USE_TERM_DRIVER */
#define DATA(r,g,b) {r,g,b, 0,0,0, 0}
@@ -71,7 +94,7 @@ NCURSES_EXPORT_VAR(int) COLORS = 0;
#define MAX_PALETTE 8
-#define OkColorHi(n) (((n) < COLORS) && ((n) < max_colors))
+#define OkColorHi(n) (((n) < COLORS) && ((n) < maxcolors))
#define InPalette(n) ((n) >= 0 && (n) < MAX_PALETTE)
/*
@@ -106,29 +129,43 @@ static const color_t hls_palette[] =
DATA( 300, 50, 100), /* COLOR_CYAN */
DATA( 0, 50, 100), /* COLOR_WHITE */
};
+
+#ifdef USE_TERM_DRIVER
+NCURSES_EXPORT_VAR(const color_t*) _nc_cga_palette = cga_palette;
+NCURSES_EXPORT_VAR(const color_t*) _nc_hls_palette = hls_palette;
+#endif
+
/* *INDENT-ON* */
+/*
+ * Ensure that we use color pairs only when colors have been started, and also
+ * that the index is within the limits of the table which we allocated.
+ */
+#define ValidPair(pair) \
+ ((SP_PARM != 0) && (pair >= 0) && (pair < SP_PARM->_pair_limit) && SP_PARM->_coloron)
+
#if NCURSES_EXT_FUNCS
/*
* These are called from _nc_do_color(), which in turn is called from
- * vidattr - so we have to assume that SP may be null.
+ * vidattr - so we have to assume that sp may be null.
*/
static int
-default_fg(void)
+default_fg(NCURSES_SP_DCL0)
{
- return (SP != 0) ? SP->_default_fg : COLOR_WHITE;
+ return (SP_PARM != 0) ? SP_PARM->_default_fg : COLOR_WHITE;
}
static int
-default_bg(void)
+default_bg(NCURSES_SP_DCL0)
{
- return SP != 0 ? SP->_default_bg : COLOR_BLACK;
+ return SP_PARM != 0 ? SP_PARM->_default_bg : COLOR_BLACK;
}
#else
-#define default_fg() COLOR_WHITE
-#define default_bg() COLOR_BLACK
+#define default_fg(sp) COLOR_WHITE
+#define default_bg(sp) COLOR_BLACK
#endif
+#ifndef USE_TERM_DRIVER
/*
* SVr4 curses is known to interchange color codes (1,4) and (3,6), possibly
* to maintain compatibility with a pre-ANSI scheme. The same scheme is
@@ -145,52 +182,70 @@ toggled_colors(int c)
}
return c;
}
+#endif
static void
-set_background_color(int bg, int (*outc) (int))
+set_background_color(NCURSES_SP_DCLx int bg, NCURSES_SP_OUTC outc)
{
+#ifdef USE_TERM_DRIVER
+ CallDriver_3(SP_PARM, color, FALSE, bg, outc);
+#else
if (set_a_background) {
TPUTS_TRACE("set_a_background");
- tputs(TPARM_1(set_a_background, bg), 1, outc);
+ NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+ TPARM_1(set_a_background, bg),
+ 1, outc);
} else {
TPUTS_TRACE("set_background");
- tputs(TPARM_1(set_background, toggled_colors(bg)), 1, outc);
+ NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+ TPARM_1(set_background, toggled_colors(bg)),
+ 1, outc);
}
+#endif
}
static void
-set_foreground_color(int fg, int (*outc) (int))
+set_foreground_color(NCURSES_SP_DCLx int fg, NCURSES_SP_OUTC outc)
{
+#ifdef USE_TERM_DRIVER
+ CallDriver_3(SP_PARM, color, TRUE, fg, outc);
+#else
if (set_a_foreground) {
TPUTS_TRACE("set_a_foreground");
- tputs(TPARM_1(set_a_foreground, fg), 1, outc);
+ NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+ TPARM_1(set_a_foreground, fg),
+ 1, outc);
} else {
TPUTS_TRACE("set_foreground");
- tputs(TPARM_1(set_foreground, toggled_colors(fg)), 1, outc);
+ NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+ TPARM_1(set_foreground, toggled_colors(fg)),
+ 1, outc);
}
+#endif
}
static void
-init_color_table(void)
+init_color_table(NCURSES_SP_DCL0)
{
- const color_t *tp;
+ const color_t *tp = DefaultPalette;
int n;
- tp = (hue_lightness_saturation) ? hls_palette : cga_palette;
+ assert(tp != 0);
+
for (n = 0; n < COLORS; n++) {
if (InPalette(n)) {
- SP->_color_table[n] = tp[n];
+ SP_PARM->_color_table[n] = tp[n];
} else {
- SP->_color_table[n] = tp[n % MAX_PALETTE];
- if (hue_lightness_saturation) {
- SP->_color_table[n].green = 100;
+ SP_PARM->_color_table[n] = tp[n % MAX_PALETTE];
+ if (UseHlsPalette) {
+ SP_PARM->_color_table[n].green = 100;
} else {
- if (SP->_color_table[n].red)
- SP->_color_table[n].red = 1000;
- if (SP->_color_table[n].green)
- SP->_color_table[n].green = 1000;
- if (SP->_color_table[n].blue)
- SP->_color_table[n].blue = 1000;
+ if (SP_PARM->_color_table[n].red)
+ SP_PARM->_color_table[n].red = 1000;
+ if (SP_PARM->_color_table[n].green)
+ SP_PARM->_color_table[n].green = 1000;
+ if (SP_PARM->_color_table[n].blue)
+ SP_PARM->_color_table[n].blue = 1000;
}
}
}
@@ -200,16 +255,21 @@ init_color_table(void)
* Reset the color pair, e.g., to whatever color pair 0 is.
*/
static bool
-reset_color_pair(void)
+reset_color_pair(NCURSES_SP_DCL0)
{
+#ifdef USE_TERM_DRIVER
+ return CallDriver(SP_PARM, rescol);
+#else
bool result = FALSE;
+ (void) SP_PARM;
if (orig_pair != 0) {
TPUTS_TRACE("orig_pair");
putp(orig_pair);
result = TRUE;
}
return result;
+#endif
}
/*
@@ -217,65 +277,93 @@ reset_color_pair(void)
* badly-written terminal descriptions than for the relatively rare case where
* someone has changed the color definitions.
*/
-bool
-_nc_reset_colors(void)
+NCURSES_EXPORT(bool)
+NCURSES_SP_NAME(_nc_reset_colors) (NCURSES_SP_DCL0)
{
int result = FALSE;
- T((T_CALLED("_nc_reset_colors()")));
- if (SP->_color_defs > 0)
- SP->_color_defs = -(SP->_color_defs);
-
- if (reset_color_pair())
+ T((T_CALLED("_nc_reset_colors(%p)"), (void *) SP_PARM));
+ if (SP_PARM->_color_defs > 0)
+ SP_PARM->_color_defs = -(SP_PARM->_color_defs);
+ if (reset_color_pair(NCURSES_SP_ARG))
result = TRUE;
+
+#ifdef USE_TERM_DRIVER
+ result = CallDriver(SP_PARM, rescolors);
+#else
if (orig_colors != 0) {
TPUTS_TRACE("orig_colors");
putp(orig_colors);
result = TRUE;
}
+#endif
returnBool(result);
}
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(bool)
+_nc_reset_colors(void)
+{
+ return NCURSES_SP_NAME(_nc_reset_colors) (CURRENT_SCREEN);
+}
+#endif
+
NCURSES_EXPORT(int)
-start_color(void)
+NCURSES_SP_NAME(start_color) (NCURSES_SP_DCL0)
{
int result = ERR;
+ int maxpairs = 0, maxcolors = 0;
- T((T_CALLED("start_color()")));
+ T((T_CALLED("start_color(%p)"), (void *) SP_PARM));
- if (SP == 0) {
+ if (SP_PARM == 0) {
result = ERR;
- } else if (SP->_coloron) {
+ } else if (SP_PARM->_coloron) {
result = OK;
} else {
-
- if (reset_color_pair() != TRUE) {
- set_foreground_color(default_fg(), _nc_outch);
- set_background_color(default_bg(), _nc_outch);
+ maxpairs = MaxPairs;
+ maxcolors = MaxColors;
+ if (reset_color_pair(NCURSES_SP_ARG) != TRUE) {
+ set_foreground_color(NCURSES_SP_ARGx
+ default_fg(NCURSES_SP_ARG),
+ NCURSES_SP_NAME(_nc_outch));
+ set_background_color(NCURSES_SP_ARGx
+ default_bg(NCURSES_SP_ARG),
+ NCURSES_SP_NAME(_nc_outch));
}
- if (max_pairs > 0 && max_colors > 0) {
- SP->_pair_count = max_pairs;
- SP->_color_count = max_colors;
+ if (maxpairs > 0 && maxcolors > 0) {
+ SP_PARM->_pair_limit = maxpairs;
+
+#if NCURSES_EXT_FUNCS
+ /*
+ * If using default colors, allocate extra space in table to
+ * allow for default-color as a component of a color-pair.
+ */
+ SP_PARM->_pair_limit += (1 + (2 * maxcolors));
+#endif
+ SP_PARM->_pair_count = maxpairs;
+ SP_PARM->_color_count = maxcolors;
#if !USE_REENTRANT
- COLOR_PAIRS = max_pairs;
- COLORS = max_colors;
+ COLOR_PAIRS = maxpairs;
+ COLORS = maxcolors;
#endif
- if ((SP->_color_pairs = TYPE_CALLOC(colorpair_t,
- max_pairs)) != 0) {
- if ((SP->_color_table = TYPE_CALLOC(color_t,
- max_colors)) != 0) {
- SP->_color_pairs[0] = PAIR_OF(default_fg(), default_bg());
- init_color_table();
+ SP_PARM->_color_pairs = TYPE_CALLOC(colorpair_t, SP_PARM->_pair_limit);
+ if (SP_PARM->_color_pairs != 0) {
+ SP_PARM->_color_table = TYPE_CALLOC(color_t, maxcolors);
+ if (SP_PARM->_color_table != 0) {
+ SP_PARM->_color_pairs[0] = PAIR_OF(default_fg(NCURSES_SP_ARG),
+ default_bg(NCURSES_SP_ARG));
+ init_color_table(NCURSES_SP_ARG);
T(("started color: COLORS = %d, COLOR_PAIRS = %d",
COLORS, COLOR_PAIRS));
- SP->_coloron = 1;
+ SP_PARM->_coloron = 1;
result = OK;
- } else if (SP->_color_pairs != 0) {
- FreeAndNull(SP->_color_pairs);
+ } else if (SP_PARM->_color_pairs != 0) {
+ FreeAndNull(SP_PARM->_color_pairs);
}
}
} else {
@@ -285,6 +373,14 @@ start_color(void)
returnCode(result);
}
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+start_color(void)
+{
+ return NCURSES_SP_NAME(start_color) (CURRENT_SCREEN);
+}
+#endif
+
/* This function was originally written by Daniel Weaver <danw@znyx.com> */
static void
rgb2hls(short r, short g, short b, short *h, short *l, short *s)
@@ -298,7 +394,7 @@ rgb2hls(short r, short g, short b, short *h, short *l, short *s)
max = b;
/* calculate lightness */
- *l = (min + max) / 20;
+ *l = (short) ((min + max) / 20);
if (min == max) { /* black, white and all shades of gray */
*h = 0;
@@ -308,17 +404,17 @@ rgb2hls(short r, short g, short b, short *h, short *l, short *s)
/* calculate saturation */
if (*l < 50)
- *s = ((max - min) * 100) / (max + min);
+ *s = (short) (((max - min) * 100) / (max + min));
else
- *s = ((max - min) * 100) / (2000 - max - min);
+ *s = (short) (((max - min) * 100) / (2000 - max - min));
/* calculate hue */
if (r == max)
- t = 120 + ((g - b) * 60) / (max - min);
+ t = (short) (120 + ((g - b) * 60) / (max - min));
else if (g == max)
- t = 240 + ((b - r) * 60) / (max - min);
+ t = (short) (240 + ((b - r) * 60) / (max - min));
else
- t = 360 + ((r - g) * 60) / (max - min);
+ t = (short) (360 + ((r - g) * 60) / (max - min));
*h = t % 360;
}
@@ -328,24 +424,75 @@ rgb2hls(short r, short g, short b, short *h, short *l, short *s)
* values.
*/
NCURSES_EXPORT(int)
-init_pair(short pair, short f, short b)
+NCURSES_SP_NAME(init_pair) (NCURSES_SP_DCLx short pair, short f, short b)
{
colorpair_t result;
+ colorpair_t previous;
+ int maxcolors;
- T((T_CALLED("init_pair(%d,%d,%d)"), pair, f, b));
+ T((T_CALLED("init_pair(%p,%d,%d,%d)"), (void *) SP_PARM, pair, f, b));
- if ((pair < 0) || (pair >= COLOR_PAIRS) || SP == 0 || !SP->_coloron)
+ if (!ValidPair(pair))
returnCode(ERR);
+
+ maxcolors = MaxColors;
+
+ previous = SP_PARM->_color_pairs[pair];
#if NCURSES_EXT_FUNCS
- if (SP->_default_color) {
- if (f < 0)
+ if (SP_PARM->_default_color) {
+ bool isDefault = FALSE;
+ bool wasDefault = FALSE;
+ int default_pairs = SP_PARM->_default_pairs;
+
+ /*
+ * Map caller's color number, e.g., -1, 0, 1, .., 7, etc., into
+ * internal unsigned values which we will store in the _color_pairs[]
+ * table.
+ */
+ if (isDefaultColor(f)) {
f = COLOR_DEFAULT;
- if (b < 0)
+ isDefault = TRUE;
+ } else if (!OkColorHi(f)) {
+ returnCode(ERR);
+ }
+
+ if (isDefaultColor(b)) {
b = COLOR_DEFAULT;
- if (!OkColorHi(f) && !isDefaultColor(f))
+ isDefault = TRUE;
+ } else if (!OkColorHi(b)) {
returnCode(ERR);
- if (!OkColorHi(b) && !isDefaultColor(b))
+ }
+
+ /*
+ * Check if the table entry that we are going to init/update used
+ * default colors.
+ */
+ if ((FORE_OF(previous) == COLOR_DEFAULT)
+ || (BACK_OF(previous) == COLOR_DEFAULT))
+ wasDefault = TRUE;
+
+ /*
+ * Keep track of the number of entries in the color pair table which
+ * used a default color.
+ */
+ if (isDefault && !wasDefault) {
+ ++default_pairs;
+ } else if (wasDefault && !isDefault) {
+ --default_pairs;
+ }
+
+ /*
+ * As an extension, ncurses allows the pair number to exceed the
+ * terminal's color_pairs value for pairs using a default color.
+ *
+ * Note that updating a pair which used a default color with one
+ * that does not will decrement the count - and possibly interfere
+ * with sequentially adding new pairs.
+ */
+ if (pair > (SP_PARM->_pair_count + default_pairs)) {
returnCode(ERR);
+ }
+ SP_PARM->_default_pairs = default_pairs;
} else
#endif
{
@@ -361,14 +508,14 @@ init_pair(short pair, short f, short b)
* pair colors with the new ones).
*/
result = PAIR_OF(f, b);
- if (SP->_color_pairs[pair] != 0
- && SP->_color_pairs[pair] != result) {
+ if (previous != 0
+ && previous != result) {
int y, x;
- for (y = 0; y <= curscr->_maxy; y++) {
- struct ldat *ptr = &(curscr->_line[y]);
+ for (y = 0; y <= CurScreen(SP_PARM)->_maxy; y++) {
+ struct ldat *ptr = &(CurScreen(SP_PARM)->_line[y]);
bool changed = FALSE;
- for (x = 0; x <= curscr->_maxx; x++) {
+ for (x = 0; x <= CurScreen(SP_PARM)->_maxx; x++) {
if (GetPair(ptr->text[x]) == pair) {
/* Set the old cell to zero to ensure it will be
updated on the next doupdate() */
@@ -378,15 +525,19 @@ init_pair(short pair, short f, short b)
}
}
if (changed)
- _nc_make_oldhash(y);
+ NCURSES_SP_NAME(_nc_make_oldhash) (NCURSES_SP_ARGx y);
}
}
- SP->_color_pairs[pair] = result;
- if (GET_SCREEN_PAIR(SP) == pair)
- SET_SCREEN_PAIR(SP, (chtype) (~0)); /* force attribute update */
+ SP_PARM->_color_pairs[pair] = result;
+ if (GET_SCREEN_PAIR(SP_PARM) == pair)
+ SET_SCREEN_PAIR(SP_PARM, (chtype) (~0)); /* force attribute update */
+
+#ifdef USE_TERM_DRIVER
+ CallDriver_3(SP_PARM, initpair, pair, f, b);
+#else
if (initialize_pair && InPalette(f) && InPalette(b)) {
- const color_t *tp = hue_lightness_saturation ? hls_palette : cga_palette;
+ const color_t *tp = DefaultPalette;
TR(TRACE_ATTRS,
("initializing pair: pair = %d, fg=(%d,%d,%d), bg=(%d,%d,%d)",
@@ -400,80 +551,148 @@ init_pair(short pair, short f, short b)
tp[f].red, tp[f].green, tp[f].blue,
tp[b].red, tp[b].green, tp[b].blue));
}
+#endif
returnCode(OK);
}
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+init_pair(short pair, short f, short b)
+{
+ return NCURSES_SP_NAME(init_pair) (CURRENT_SCREEN, pair, f, b);
+}
+#endif
+
#define okRGB(n) ((n) >= 0 && (n) <= 1000)
NCURSES_EXPORT(int)
-init_color(short color, short r, short g, short b)
+NCURSES_SP_NAME(init_color) (NCURSES_SP_DCLx
+ short color, short r, short g, short b)
{
int result = ERR;
+ int maxcolors;
+
+ T((T_CALLED("init_color(%p,%d,%d,%d,%d)"),
+ (void *) SP_PARM,
+ color,
+ r, g, b));
- T((T_CALLED("init_color(%d,%d,%d,%d)"), color, r, g, b));
+ if (SP_PARM == 0)
+ returnCode(result);
- if (initialize_color != NULL
- && SP != 0
- && SP->_coloron
+ maxcolors = MaxColors;
+
+ if (InitColor
+ && SP_PARM->_coloron
&& (color >= 0 && OkColorHi(color))
&& (okRGB(r) && okRGB(g) && okRGB(b))) {
- SP->_color_table[color].init = 1;
- SP->_color_table[color].r = r;
- SP->_color_table[color].g = g;
- SP->_color_table[color].b = b;
+ SP_PARM->_color_table[color].init = 1;
+ SP_PARM->_color_table[color].r = r;
+ SP_PARM->_color_table[color].g = g;
+ SP_PARM->_color_table[color].b = b;
- if (hue_lightness_saturation) {
+ if (UseHlsPalette) {
rgb2hls(r, g, b,
- &SP->_color_table[color].red,
- &SP->_color_table[color].green,
- &SP->_color_table[color].blue);
+ &SP_PARM->_color_table[color].red,
+ &SP_PARM->_color_table[color].green,
+ &SP_PARM->_color_table[color].blue);
} else {
- SP->_color_table[color].red = r;
- SP->_color_table[color].green = g;
- SP->_color_table[color].blue = b;
+ SP_PARM->_color_table[color].red = r;
+ SP_PARM->_color_table[color].green = g;
+ SP_PARM->_color_table[color].blue = b;
}
+#ifdef USE_TERM_DRIVER
+ CallDriver_4(SP_PARM, initcolor, color, r, g, b);
+#else
TPUTS_TRACE("initialize_color");
putp(TPARM_4(initialize_color, color, r, g, b));
- SP->_color_defs = max(color + 1, SP->_color_defs);
+#endif
+ SP_PARM->_color_defs = max(color + 1, SP_PARM->_color_defs);
+
result = OK;
}
returnCode(result);
}
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+init_color(short color, short r, short g, short b)
+{
+ return NCURSES_SP_NAME(init_color) (CURRENT_SCREEN, color, r, g, b);
+}
+#endif
+
+NCURSES_EXPORT(bool)
+NCURSES_SP_NAME(can_change_color) (NCURSES_SP_DCL)
+{
+ T((T_CALLED("can_change_color(%p)"), (void *) SP_PARM));
+ returnCode((CanChange != 0) ? TRUE : FALSE);
+}
+
+#if NCURSES_SP_FUNCS
NCURSES_EXPORT(bool)
can_change_color(void)
{
- T((T_CALLED("can_change_color()")));
- returnCode((can_change != 0) ? TRUE : FALSE);
+ return NCURSES_SP_NAME(can_change_color) (CURRENT_SCREEN);
}
+#endif
NCURSES_EXPORT(bool)
-has_colors(void)
+NCURSES_SP_NAME(has_colors) (NCURSES_SP_DCL0)
{
+ int code;
+
+ (void) SP_PARM;
T((T_CALLED("has_colors()")));
- returnCode((VALID_NUMERIC(max_colors) && VALID_NUMERIC(max_pairs)
- && (((set_foreground != NULL)
- && (set_background != NULL))
- || ((set_a_foreground != NULL)
- && (set_a_background != NULL))
- || set_color_pair)) ? TRUE : FALSE);
+#ifdef USE_TERM_DRIVER
+ code = HasColor;
+#else
+ code = ((VALID_NUMERIC(max_colors) && VALID_NUMERIC(max_pairs)
+ && (((set_foreground != NULL)
+ && (set_background != NULL))
+ || ((set_a_foreground != NULL)
+ && (set_a_background != NULL))
+ || set_color_pair)) ? TRUE : FALSE);
+#endif
+ returnCode(code);
}
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(bool)
+has_colors(void)
+{
+ return NCURSES_SP_NAME(has_colors) (CURRENT_SCREEN);
+}
+#endif
+
NCURSES_EXPORT(int)
-color_content(short color, short *r, short *g, short *b)
+NCURSES_SP_NAME(color_content) (NCURSES_SP_DCLx
+ short color, short *r, short *g, short *b)
{
- int result;
+ int result = ERR;
+ int maxcolors;
+
+ T((T_CALLED("color_content(%p,%d,%p,%p,%p)"),
+ (void *) SP_PARM,
+ color,
+ (void *) r,
+ (void *) g,
+ (void *) b));
+
+ if (SP_PARM == 0)
+ returnCode(result);
- T((T_CALLED("color_content(%d,%p,%p,%p)"), color, r, g, b));
- if (color < 0 || !OkColorHi(color) || SP == 0 || !SP->_coloron) {
+ maxcolors = MaxColors;
+
+ if (color < 0 || !OkColorHi(color) || !SP_PARM->_coloron) {
result = ERR;
} else {
- NCURSES_COLOR_T c_r = SP->_color_table[color].red;
- NCURSES_COLOR_T c_g = SP->_color_table[color].green;
- NCURSES_COLOR_T c_b = SP->_color_table[color].blue;
+ NCURSES_COLOR_T c_r = SP_PARM->_color_table[color].red;
+ NCURSES_COLOR_T c_g = SP_PARM->_color_table[color].green;
+ NCURSES_COLOR_T c_b = SP_PARM->_color_table[color].blue;
if (r)
*r = c_r;
@@ -489,18 +708,31 @@ color_content(short color, short *r, short *g, short *b)
returnCode(result);
}
+#if NCURSES_SP_FUNCS
NCURSES_EXPORT(int)
-pair_content(short pair, short *f, short *b)
+color_content(short color, short *r, short *g, short *b)
+{
+ return NCURSES_SP_NAME(color_content) (CURRENT_SCREEN, color, r, g, b);
+}
+#endif
+
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(pair_content) (NCURSES_SP_DCLx
+ short pair, short *f, short *b)
{
int result;
- T((T_CALLED("pair_content(%d,%p,%p)"), pair, f, b));
+ T((T_CALLED("pair_content(%p,%d,%p,%p)"),
+ (void *) SP_PARM,
+ pair,
+ (void *) f,
+ (void *) b));
- if ((pair < 0) || (pair >= COLOR_PAIRS) || SP == 0 || !SP->_coloron) {
+ if (!ValidPair(pair)) {
result = ERR;
} else {
- NCURSES_COLOR_T fg = ((SP->_color_pairs[pair] >> C_SHIFT) & C_MASK);
- NCURSES_COLOR_T bg = (SP->_color_pairs[pair] & C_MASK);
+ NCURSES_COLOR_T fg = FORE_OF(SP_PARM->_color_pairs[pair]);
+ NCURSES_COLOR_T bg = BACK_OF(SP_PARM->_color_pairs[pair]);
#if NCURSES_EXT_FUNCS
if (fg == COLOR_DEFAULT)
@@ -514,33 +746,53 @@ pair_content(short pair, short *f, short *b)
if (b)
*b = bg;
- TR(TRACE_ATTRS, ("...pair_content(%d,%d,%d)", pair, fg, bg));
+ TR(TRACE_ATTRS, ("...pair_content(%p,%d,%d,%d)",
+ (void *) SP_PARM,
+ pair,
+ fg, bg));
result = OK;
}
returnCode(result);
}
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+pair_content(short pair, short *f, short *b)
+{
+ return NCURSES_SP_NAME(pair_content) (CURRENT_SCREEN, pair, f, b);
+}
+#endif
+
NCURSES_EXPORT(void)
-_nc_do_color(short old_pair, short pair, bool reverse, int (*outc) (int))
+NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_DCLx
+ short old_pair,
+ short pair,
+ bool reverse,
+ NCURSES_SP_OUTC outc)
{
+#ifdef USE_TERM_DRIVER
+ CallDriver_4(SP_PARM, docolor, old_pair, pair, reverse, outc);
+#else
NCURSES_COLOR_T fg = COLOR_DEFAULT;
NCURSES_COLOR_T bg = COLOR_DEFAULT;
NCURSES_COLOR_T old_fg, old_bg;
- if (pair < 0 || pair >= COLOR_PAIRS) {
+ if (!ValidPair(pair)) {
return;
} else if (pair != 0) {
if (set_color_pair) {
TPUTS_TRACE("set_color_pair");
- tputs(TPARM_1(set_color_pair, pair), 1, outc);
+ NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+ TPARM_1(set_color_pair, pair),
+ 1, outc);
return;
- } else if (SP != 0) {
+ } else if (SP_PARM != 0) {
pair_content((short) pair, &fg, &bg);
}
}
if (old_pair >= 0
- && SP != 0
+ && SP_PARM != 0
&& pair_content(old_pair, &old_fg, &old_bg) != ERR) {
if ((isDefaultColor(fg) && !isDefaultColor(old_fg))
|| (isDefaultColor(bg) && !isDefaultColor(old_bg))) {
@@ -550,29 +802,29 @@ _nc_do_color(short old_pair, short pair, bool reverse, int (*outc) (int))
* the terminal description, treat it as screen's indicator of ECMA
* SGR 39 and SGR 49, and assume the two sequences are independent.
*/
- if (SP->_has_sgr_39_49
+ if (SP_PARM->_has_sgr_39_49
&& isDefaultColor(old_bg)
&& !isDefaultColor(old_fg)) {
- tputs("\033[39m", 1, outc);
- } else if (SP->_has_sgr_39_49
+ NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx "\033[39m", 1, outc);
+ } else if (SP_PARM->_has_sgr_39_49
&& isDefaultColor(old_fg)
&& !isDefaultColor(old_bg)) {
- tputs("\033[49m", 1, outc);
+ NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx "\033[49m", 1, outc);
} else
#endif
- reset_color_pair();
+ reset_color_pair(NCURSES_SP_ARG);
}
} else {
- reset_color_pair();
+ reset_color_pair(NCURSES_SP_ARG);
if (old_pair < 0)
return;
}
#if NCURSES_EXT_FUNCS
if (isDefaultColor(fg))
- fg = default_fg();
+ fg = (short) default_fg(NCURSES_SP_ARG);
if (isDefaultColor(bg))
- bg = default_bg();
+ bg = (short) default_bg(NCURSES_SP_ARG);
#endif
if (reverse) {
@@ -585,9 +837,23 @@ _nc_do_color(short old_pair, short pair, bool reverse, int (*outc) (int))
fg, bg));
if (!isDefaultColor(fg)) {
- set_foreground_color(fg, outc);
+ set_foreground_color(NCURSES_SP_ARGx fg, outc);
}
if (!isDefaultColor(bg)) {
- set_background_color(bg, outc);
+ set_background_color(NCURSES_SP_ARGx bg, outc);
}
+#endif
}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(void)
+_nc_do_color(short old_pair, short pair, bool reverse, NCURSES_OUTC outc)
+{
+ SetSafeOutcWrapper(outc);
+ NCURSES_SP_NAME(_nc_do_color) (CURRENT_SCREEN,
+ old_pair,
+ pair,
+ reverse,
+ _nc_outc_wrapper);
+}
+#endif
diff --git a/ncurses/base/lib_colorset.c b/ncurses/base/lib_colorset.c
index a973c5350c8f..6210a0e8a8f9 100644
--- a/ncurses/base/lib_colorset.c
+++ b/ncurses/base/lib_colorset.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2003,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 *
@@ -28,7 +28,7 @@
/****************************************************************************
* Author: Juergen Pfeifer, 1998 *
- * and: Thomas E. Dickey, 2005 *
+ * and: Thomas E. Dickey, 2005-on *
****************************************************************************/
/*
@@ -41,20 +41,23 @@
#include <curses.priv.h>
#include <ctype.h>
-MODULE_ID("$Id: lib_colorset.c,v 1.11 2005/01/29 21:40:51 tom Exp $")
+MODULE_ID("$Id: lib_colorset.c,v 1.13 2009/10/24 22:02:14 tom Exp $")
NCURSES_EXPORT(int)
wcolor_set(WINDOW *win, short color_pair_number, void *opts)
{
- T((T_CALLED("wcolor_set(%p,%d)"), win, color_pair_number));
+ int code = ERR;
+
+ T((T_CALLED("wcolor_set(%p,%d)"), (void *) win, color_pair_number));
if (win
&& !opts
+ && (SP != 0)
&& (color_pair_number >= 0)
- && (color_pair_number < COLOR_PAIRS)) {
+ && (color_pair_number < SP->_pair_limit)) {
TR(TRACE_ATTRS, ("... current %ld", (long) GET_WINDOW_PAIR(win)));
SET_WINDOW_PAIR(win, color_pair_number);
if_EXT_COLORS(win->_color = color_pair_number);
- returnCode(OK);
- } else
- returnCode(ERR);
+ code = OK;
+ }
+ returnCode(code);
}
diff --git a/ncurses/base/lib_delch.c b/ncurses/base/lib_delch.c
index 0c30f2d93c1b..64c9da73edf8 100644
--- a/ncurses/base/lib_delch.c
+++ b/ncurses/base/lib_delch.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2001,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 *
@@ -40,14 +40,14 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_delch.c,v 1.12 2001/12/19 01:06:09 tom Exp $")
+MODULE_ID("$Id: lib_delch.c,v 1.13 2009/10/24 22:32:47 tom Exp $")
NCURSES_EXPORT(int)
wdelch(WINDOW *win)
{
int code = ERR;
- T((T_CALLED("wdelch(%p)"), win));
+ T((T_CALLED("wdelch(%p)"), (void *) win));
if (win) {
NCURSES_CH_T blank = win->_nc_bkgd;
diff --git a/ncurses/base/lib_delwin.c b/ncurses/base/lib_delwin.c
index b92c40335958..4bb536ca86ad 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 <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ * and: Thomas E. Dickey 1996-on *
+ * and: Juergen Pfeifer 2008 *
****************************************************************************/
/*
@@ -40,15 +42,18 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_delwin.c,v 1.17 2008/06/07 14:10:56 tom Exp $")
+MODULE_ID("$Id: lib_delwin.c,v 1.20 2009/10/24 22:02:14 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(p)) {
+ for (each_window(SP_PARM, p)) {
if (&(p->win) == win) {
result = FALSE;
} else if ((p->win._flags & _SUBWIN) != 0
@@ -65,18 +70,20 @@ delwin(WINDOW *win)
{
int result = ERR;
- T((T_CALLED("delwin(%p)"), win));
+ T((T_CALLED("delwin(%p)"), (void *) win));
if (_nc_try_global(curses) == 0) {
if (win == 0
|| 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 8953c148b09e..4bb9fc2774a9 100644
--- a/ncurses/base/lib_dft_fgbg.c
+++ b/ncurses/base/lib_dft_fgbg.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2004,2005 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2005,2009 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -27,49 +27,73 @@
****************************************************************************/
/****************************************************************************
- * Author: Thomas E. Dickey *
+ * Author: Thomas E. Dickey 1998-on *
+ * Juergen Pfeifer 2009 *
****************************************************************************/
#include <curses.priv.h>
-#include <term.h>
-MODULE_ID("$Id: lib_dft_fgbg.c,v 1.18 2005/11/26 20:03:38 tom Exp $")
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
+MODULE_ID("$Id: lib_dft_fgbg.c,v 1.25 2009/10/24 22:15:00 tom Exp $")
/*
* Modify the behavior of color-pair 0 so that the library doesn't assume that
* it is white on black. This is an extension to XSI curses.
*/
NCURSES_EXPORT(int)
+NCURSES_SP_NAME(use_default_colors) (NCURSES_SP_DCL0)
+{
+ T((T_CALLED("use_default_colors(%p)"), (void *) SP_PARM));
+ returnCode(NCURSES_SP_NAME(assume_default_colors) (NCURSES_SP_ARGx -1, -1));
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
use_default_colors(void)
{
- T((T_CALLED("use_default_colors()")));
- returnCode(assume_default_colors(-1, -1));
+ return NCURSES_SP_NAME(use_default_colors) (CURRENT_SCREEN);
}
+#endif
/*
* Modify the behavior of color-pair 0 so that the library assumes that it
* is something specific, possibly not white on black.
*/
NCURSES_EXPORT(int)
-assume_default_colors(int fg, int bg)
+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)"), (void *) SP_PARM, fg, bg));
+#ifdef USE_TERM_DRIVER
+ if (sp != 0)
+ code = CallDriver_2(sp, defaultcolors, fg, bg);
+#else
+ if ((orig_pair || orig_colors) && !initialize_pair) {
- if (initialize_pair) /* don't know how to handle this */
- returnCode(ERR);
-
- SP->_default_color = isDefaultColor(fg) || isDefaultColor(bg);
- SP->_has_sgr_39_49 = (tigetflag("AX") == TRUE);
- SP->_default_fg = isDefaultColor(fg) ? COLOR_DEFAULT : (fg & C_MASK);
- SP->_default_bg = isDefaultColor(bg) ? COLOR_DEFAULT : (bg & C_MASK);
- if (SP->_color_pairs != 0) {
- bool save = SP->_default_color;
- SP->_default_color = TRUE;
- init_pair(0, (short) fg, (short) bg);
- SP->_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
+NCURSES_EXPORT(int)
+assume_default_colors(int fg, int bg)
+{
+ return NCURSES_SP_NAME(assume_default_colors) (CURRENT_SCREEN, fg, bg);
}
+#endif
diff --git a/ncurses/base/lib_driver.c b/ncurses/base/lib_driver.c
new file mode 100644
index 000000000000..40487609be4d
--- /dev/null
+++ b/ncurses/base/lib_driver.c
@@ -0,0 +1,143 @@
+/****************************************************************************
+ * Copyright (c) 2008-2009,2010 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 *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Juergen Pfeifer *
+ * *
+ ****************************************************************************/
+
+#include <curses.priv.h>
+
+MODULE_ID("$Id: lib_driver.c,v 1.3 2010/12/20 00:29:17 tom Exp $")
+
+typedef struct DriverEntry {
+ const char *name;
+ TERM_DRIVER *driver;
+} DRIVER_ENTRY;
+
+static DRIVER_ENTRY DriverTable[] =
+{
+#ifdef __MINGW32__
+ {"win", &_nc_WIN_DRIVER},
+#endif
+ {"tinfo", &_nc_TINFO_DRIVER}
+};
+
+NCURSES_EXPORT(int)
+_nc_get_driver(TERMINAL_CONTROL_BLOCK * TCB, const char *name, int *errret)
+{
+ int code = ERR;
+ size_t i;
+ TERM_DRIVER *res = (TERM_DRIVER *) 0;
+ TERM_DRIVER *use = 0;
+
+ T((T_CALLED("_nc_get_driver(%p, %s, %p)"),
+ (void *) TCB, NonNull(name), (void *) errret));
+
+ assert(TCB != 0);
+
+ for (i = 0; i < SIZEOF(DriverTable); i++) {
+ res = DriverTable[i].driver;
+ if (res->CanHandle(TCB, name, errret)) {
+ use = res;
+ break;
+ }
+ }
+ if (use != 0) {
+ TCB->drv = use;
+ code = OK;
+ }
+ returnCode(code);
+}
+
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(has_key) (SCREEN *sp, int keycode)
+{
+ T((T_CALLED("has_key(%p, %d)"), (void *) sp, keycode));
+ returnCode(IsValidTIScreen(sp) ? CallDriver_1(sp, kyExist, keycode) : FALSE);
+}
+
+NCURSES_EXPORT(int)
+has_key(int keycode)
+{
+ return NCURSES_SP_NAME(has_key) (CURRENT_SCREEN, keycode);
+}
+
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(_nc_mcprint) (SCREEN *sp, char *data, int len)
+{
+ int code = ERR;
+
+ if (0 != TerminalOf(sp))
+ code = CallDriver_2(sp, print, data, len);
+ return (code);
+}
+
+NCURSES_EXPORT(int)
+mcprint(char *data, int len)
+{
+ return NCURSES_SP_NAME(_nc_mcprint) (CURRENT_SCREEN, data, len);
+}
+
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(doupdate) (SCREEN *sp)
+{
+ int code = ERR;
+
+ T((T_CALLED("doupdate(%p)"), (void *) sp));
+
+ if (IsValidScreen(sp))
+ code = CallDriver(sp, update);
+
+ returnCode(code);
+}
+
+NCURSES_EXPORT(int)
+doupdate(void)
+{
+ return NCURSES_SP_NAME(doupdate) (CURRENT_SCREEN);
+}
+
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(mvcur) (SCREEN *sp, int yold, int xold, int ynew, int xnew)
+{
+ int code = ERR;
+ TR(TRACE_CALLS | TRACE_MOVE, (T_CALLED("mvcur(%p,%d,%d,%d,%d)"),
+ (void *) sp, yold, xold, ynew, xnew));
+ if (HasTerminal(sp)) {
+ code = CallDriver_4(sp, hwcur, yold, xold, ynew, xnew);
+ }
+ returnCode(code);
+}
+
+NCURSES_EXPORT(int)
+mvcur(int yold, int xold, int ynew, int xnew)
+/* optimized cursor move from (yold, xold) to (ynew, xnew) */
+{
+ return NCURSES_SP_NAME(mvcur) (CURRENT_SCREEN, yold, xold, ynew, xnew);
+}
diff --git a/ncurses/base/lib_echo.c b/ncurses/base/lib_echo.c
index df44713d1a11..9e1d3c265741 100644
--- a/ncurses/base/lib_echo.c
+++ b/ncurses/base/lib_echo.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,2000 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 <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ * and: Thomas E. Dickey 1996-on *
+ * and: Juergen Pfeifer 2009 *
****************************************************************************/
/*
@@ -42,20 +44,40 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_echo.c,v 1.5 2000/12/10 02:43:27 tom Exp $")
+MODULE_ID("$Id: lib_echo.c,v 1.8 2009/10/24 22:02:14 tom Exp $")
NCURSES_EXPORT(int)
+NCURSES_SP_NAME(echo) (NCURSES_SP_DCL0)
+{
+ T((T_CALLED("echo(%p)"), (void *) SP_PARM));
+ if (0 == SP_PARM)
+ returnCode(ERR);
+ SP_PARM->_echo = TRUE;
+ returnCode(OK);
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
echo(void)
{
- T((T_CALLED("echo()")));
- SP->_echo = TRUE;
+ return NCURSES_SP_NAME(echo) (CURRENT_SCREEN);
+}
+#endif
+
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(noecho) (NCURSES_SP_DCL0)
+{
+ T((T_CALLED("noecho(%p)"), (void *) SP_PARM));
+ if (0 == SP_PARM)
+ returnCode(ERR);
+ SP_PARM->_echo = FALSE;
returnCode(OK);
}
+#if NCURSES_SP_FUNCS
NCURSES_EXPORT(int)
noecho(void)
{
- T((T_CALLED("noecho()")));
- SP->_echo = FALSE;
- returnCode(OK);
+ return NCURSES_SP_NAME(noecho) (CURRENT_SCREEN);
}
+#endif
diff --git a/ncurses/base/lib_endwin.c b/ncurses/base/lib_endwin.c
index 66662871962b..4596d0749633 100644
--- a/ncurses/base/lib_endwin.c
+++ b/ncurses/base/lib_endwin.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,2000 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 <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ * and: Thomas E. Dickey 1996-on *
+ * and: Juergen Pfeifer 2009 *
****************************************************************************/
/*
@@ -39,22 +41,39 @@
*/
#include <curses.priv.h>
-#include <term.h>
-MODULE_ID("$Id: lib_endwin.c,v 1.19 2000/12/10 02:43:27 tom Exp $")
+MODULE_ID("$Id: lib_endwin.c,v 1.22 2009/10/24 22:02:14 tom Exp $")
NCURSES_EXPORT(int)
-endwin(void)
+NCURSES_SP_NAME(endwin) (NCURSES_SP_DCL0)
{
- T((T_CALLED("endwin()")));
+ int code = ERR;
+
+ T((T_CALLED("endwin(%p)"), (void *) SP_PARM));
- if (SP) {
- SP->_endwin = TRUE;
- SP->_mouse_wrap(SP);
+ if (SP_PARM) {
+#ifdef USE_TERM_DRIVER
+ TERMINAL_CONTROL_BLOCK *TCB = TCBOf(SP_PARM);
+
+ SP_PARM->_endwin = TRUE;
+ if (TCB && TCB->drv && TCB->drv->scexit)
+ TCB->drv->scexit(SP_PARM);
+#else
+ SP_PARM->_endwin = TRUE;
+ SP_PARM->_mouse_wrap(SP_PARM);
_nc_screen_wrap();
_nc_mvcur_wrap(); /* wrap up cursor addressing */
- returnCode(reset_shell_mode());
+#endif
+ code = NCURSES_SP_NAME(reset_shell_mode) (NCURSES_SP_ARG);
}
- returnCode(ERR);
+ returnCode(code);
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+endwin(void)
+{
+ return NCURSES_SP_NAME(endwin) (CURRENT_SCREEN);
}
+#endif
diff --git a/ncurses/base/lib_erase.c b/ncurses/base/lib_erase.c
index 2566e8b39820..bbf10ef81b92 100644
--- a/ncurses/base/lib_erase.c
+++ b/ncurses/base/lib_erase.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,2000,2001 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 *
@@ -41,7 +41,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_erase.c,v 1.16 2005/10/30 00:36:36 tom Exp $")
+MODULE_ID("$Id: lib_erase.c,v 1.17 2009/10/24 22:32:29 tom Exp $")
NCURSES_EXPORT(int)
werase(WINDOW *win)
@@ -51,7 +51,7 @@ werase(WINDOW *win)
NCURSES_CH_T blank;
NCURSES_CH_T *sp, *end, *start;
- T((T_CALLED("werase(%p)"), win));
+ T((T_CALLED("werase(%p)"), (void *) win));
if (win) {
blank = win->_nc_bkgd;
diff --git a/ncurses/base/lib_flash.c b/ncurses/base/lib_flash.c
index a6b022a8e816..03f11d923b6d 100644
--- a/ncurses/base/lib_flash.c
+++ b/ncurses/base/lib_flash.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2000,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 <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ * and: Thomas E. Dickey 1996-on *
+ * and: Juergen Pfeifer 2009 *
****************************************************************************/
/*
@@ -39,9 +41,12 @@
*/
#include <curses.priv.h>
-#include <term.h> /* beep, flash */
-MODULE_ID("$Id: lib_flash.c,v 1.6 2000/12/10 02:43:27 tom Exp $")
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
+MODULE_ID("$Id: lib_flash.c,v 1.11 2009/10/24 22:02:14 tom Exp $")
/*
* flash()
@@ -52,12 +57,15 @@ MODULE_ID("$Id: lib_flash.c,v 1.6 2000/12/10 02:43:27 tom Exp $")
*/
NCURSES_EXPORT(int)
-flash(void)
+NCURSES_SP_NAME(flash) (NCURSES_SP_DCL0)
{
int res = ERR;
- T((T_CALLED("flash()")));
-
+ T((T_CALLED("flash(%p)"), (void *) 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");
@@ -68,6 +76,14 @@ flash(void)
res = putp(bell);
_nc_flush();
}
-
+#endif
returnCode(res);
}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+flash(void)
+{
+ return NCURSES_SP_NAME(flash) (CURRENT_SCREEN);
+}
+#endif
diff --git a/ncurses/base/lib_freeall.c b/ncurses/base/lib_freeall.c
index 564026582911..5bcc974bc257 100644
--- a/ncurses/base/lib_freeall.c
+++ b/ncurses/base/lib_freeall.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2010 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 *
@@ -31,7 +31,6 @@
****************************************************************************/
#include <curses.priv.h>
-#include <term_entry.h>
#include <tic.h>
#if HAVE_NC_FREEALL
@@ -40,40 +39,40 @@
extern int malloc_errfd; /* FIXME */
#endif
-MODULE_ID("$Id: lib_freeall.c,v 1.54 2008/09/27 13:09:57 tom Exp $")
+MODULE_ID("$Id: lib_freeall.c,v 1.59 2010/01/23 17:57:43 tom Exp $")
/*
* Free all ncurses data. This is used for testing only (there's no practical
* use for it as an extension).
*/
NCURSES_EXPORT(void)
-_nc_freeall(void)
+NCURSES_SP_NAME(_nc_freeall) (NCURSES_SP_DCL0)
{
WINDOWLIST *p, *q;
static va_list empty_va;
T((T_CALLED("_nc_freeall()")));
#if NO_LEAKS
- if (SP != 0) {
- if (SP->_oldnum_list != 0) {
- FreeAndNull(SP->_oldnum_list);
+ if (SP_PARM != 0) {
+ if (SP_PARM->_oldnum_list != 0) {
+ FreeAndNull(SP_PARM->_oldnum_list);
}
- if (SP->_panelHook.destroy != 0) {
- SP->_panelHook.destroy(SP->_panelHook.stdscr_pseudo_panel);
+ if (SP_PARM->_panelHook.destroy != 0) {
+ SP_PARM->_panelHook.destroy(SP_PARM->_panelHook.stdscr_pseudo_panel);
}
}
#endif
- if (SP != 0) {
+ if (SP_PARM != 0) {
_nc_lock_global(curses);
- while (_nc_windows != 0) {
+ while (WindowList(SP_PARM) != 0) {
bool deleted = FALSE;
/* Delete only windows that're not a parent */
- for (each_window(p)) {
+ for (each_window(SP_PARM, p)) {
bool found = FALSE;
- for (each_window(q)) {
+ for (each_window(SP_PARM, q)) {
if ((p != q)
&& (q->win._flags & _SUBWIN)
&& (&(p->win) == q->win._parent)) {
@@ -95,11 +94,9 @@ _nc_freeall(void)
if (!deleted)
break;
}
- delscreen(SP);
+ delscreen(SP_PARM);
_nc_unlock_global(curses);
}
- if (cur_term != 0)
- del_curterm(cur_term);
(void) _nc_printf_string(0, empty_va);
#ifdef TRACE
@@ -121,12 +118,20 @@ _nc_freeall(void)
returnVoid;
}
+#if NCURSES_SP_FUNCS
NCURSES_EXPORT(void)
-_nc_free_and_exit(int code)
+_nc_freeall(void)
+{
+ NCURSES_SP_NAME(_nc_freeall) (CURRENT_SCREEN);
+}
+#endif
+
+NCURSES_EXPORT(void)
+NCURSES_SP_NAME(_nc_free_and_exit) (NCURSES_SP_DCLx int code)
{
- char *last_setbuf = (SP != 0) ? SP->_setbuf : 0;
+ char *last_setbuf = (SP_PARM != 0) ? SP_PARM->_setbuf : 0;
- _nc_freeall();
+ NCURSES_SP_NAME(_nc_freeall) (NCURSES_SP_ARG);
#ifdef TRACE
trace(0); /* close trace file, freeing its setbuf */
{
@@ -146,12 +151,21 @@ _nc_freeall(void)
}
NCURSES_EXPORT(void)
-_nc_free_and_exit(int code)
+NCURSES_SP_NAME(_nc_free_and_exit) (NCURSES_SP_DCLx int code)
{
- if (SP)
- delscreen(SP);
- if (cur_term != 0)
- del_curterm(cur_term);
+ if (SP_PARM) {
+ delscreen(SP_PARM);
+ if (SP_PARM->_term)
+ NCURSES_SP_NAME(del_curterm) (NCURSES_SP_ARGx SP_PARM->_term);
+ }
exit(code);
}
#endif
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(void)
+_nc_free_and_exit(int code)
+{
+ NCURSES_SP_NAME(_nc_free_and_exit) (CURRENT_SCREEN, code);
+}
+#endif
diff --git a/ncurses/base/lib_getch.c b/ncurses/base/lib_getch.c
index e7ba0b210e34..130c502431b3 100644
--- a/ncurses/base/lib_getch.c
+++ b/ncurses/base/lib_getch.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -30,6 +30,7 @@
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
* and: Thomas E. Dickey 1996-on *
+ * and: Juergen Pfeifer 2009 *
****************************************************************************/
/*
@@ -41,40 +42,80 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_getch.c,v 1.99 2008/09/20 19:46:13 tom Exp $")
+MODULE_ID("$Id: lib_getch.c,v 1.121 2010/12/25 23:24:04 tom Exp $")
#include <fifo_defs.h>
#if USE_REENTRANT
-#define GetEscdelay(sp) (sp)->_ESCDELAY
+#define GetEscdelay(sp) *_nc_ptr_Escdelay(sp)
NCURSES_EXPORT(int)
NCURSES_PUBLIC_VAR(ESCDELAY) (void)
{
- return SP ? GetEscdelay(SP) : 1000;
+ return *(_nc_ptr_Escdelay(CURRENT_SCREEN));
+}
+
+NCURSES_EXPORT(int *)
+_nc_ptr_Escdelay(SCREEN *sp)
+{
+ return ptrEscdelay(sp);
}
#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
NCURSES_EXPORT(int)
-set_escdelay(int value)
+NCURSES_SP_NAME(set_escdelay) (NCURSES_SP_DCLx int value)
{
int code = OK;
#if USE_REENTRANT
- if (SP) {
- SP->_ESCDELAY = value;
+ if (SP_PARM) {
+ SET_ESCDELAY(value);
} else {
code = ERR;
}
#else
+ (void) SP_PARM;
ESCDELAY = value;
#endif
return code;
}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+set_escdelay(int value)
+{
+ int code;
+#if USE_REENTRANT
+ code = NCURSES_SP_NAME(set_escdelay) (CURRENT_SCREEN, value);
+#else
+ ESCDELAY = value;
+ code = OK;
+#endif
+ return code;
+}
+#endif
+#endif /* NCURSES_EXT_FUNCS */
+
+#if NCURSES_EXT_FUNCS
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(get_escdelay) (NCURSES_SP_DCL0)
+{
+#if !USE_REENTRANT
+ (void) SP_PARM;
+#endif
+ return GetEscdelay(SP_PARM);
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+get_escdelay(void)
+{
+ return NCURSES_SP_NAME(get_escdelay) (CURRENT_SCREEN);
+}
#endif
+#endif /* NCURSES_EXT_FUNCS */
static int
_nc_use_meta(WINDOW *win)
@@ -83,12 +124,6 @@ _nc_use_meta(WINDOW *win)
return (sp ? sp->_use_meta : 0);
}
-#ifdef NCURSES_WGETCH_EVENTS
-#define TWAIT_MASK 7
-#else
-#define TWAIT_MASK 3
-#endif
-
/*
* Check for mouse activity, returning nonzero if we find any.
*/
@@ -97,19 +132,29 @@ check_mouse_activity(SCREEN *sp, int delay EVENTLIST_2nd(_nc_eventlist * evl))
{
int rc;
+#ifdef USE_TERM_DRIVER
+ rc = TCBOf(sp)->drv->testmouse(TCBOf(sp), delay);
+#else
#if USE_SYSMOUSE
if ((sp->_mouse_type == M_SYSMOUSE)
&& (sp->_sysmouse_head < sp->_sysmouse_tail)) {
- return 2;
- }
+ rc = TW_MOUSE;
+ } else
#endif
- rc = _nc_timed_wait(sp, TWAIT_MASK, delay, (int *) 0 EVENTLIST_2nd(evl));
+ {
+ rc = _nc_timed_wait(sp,
+ TWAIT_MASK,
+ delay,
+ (int *) 0
+ EVENTLIST_2nd(evl));
#if USE_SYSMOUSE
- if ((sp->_mouse_type == M_SYSMOUSE)
- && (sp->_sysmouse_head < sp->_sysmouse_tail)
- && (rc == 0)
- && (errno == EINTR)) {
- rc |= 2;
+ if ((sp->_mouse_type == M_SYSMOUSE)
+ && (sp->_sysmouse_head < sp->_sysmouse_tail)
+ && (rc == 0)
+ && (errno == EINTR)) {
+ rc |= TW_MOUSE;
+ }
+#endif
}
#endif
return rc;
@@ -173,9 +218,9 @@ fifo_push(SCREEN *sp EVENTLIST_2nd(_nc_eventlist * evl))
} else
mask = 0;
- if (mask & 4) {
+ if (mask & TW_EVENT) {
T(("fifo_push: ungetch KEY_EVENT"));
- _nc_ungetch(sp, KEY_EVENT);
+ safe_ungetch(sp, KEY_EVENT);
return KEY_EVENT;
}
#elif USE_GPM_SUPPORT || USE_EMX_MOUSE || USE_SYSMOUSE
@@ -185,7 +230,7 @@ fifo_push(SCREEN *sp EVENTLIST_2nd(_nc_eventlist * evl))
#endif
#if USE_GPM_SUPPORT || USE_EMX_MOUSE
- if ((sp->_mouse_fd >= 0) && (mask & 2)) {
+ if ((sp->_mouse_fd >= 0) && (mask & TW_MOUSE)) {
sp->_mouse_event(sp);
ch = KEY_MOUSE;
n = 1;
@@ -204,10 +249,33 @@ fifo_push(SCREEN *sp EVENTLIST_2nd(_nc_eventlist * evl))
n = 1;
} else
#endif
+#ifdef USE_TERM_DRIVER
+ if ((sp->_mouse_type == M_TERM_DRIVER)
+ && (sp->_drv_mouse_head < sp->_drv_mouse_tail)) {
+ sp->_mouse_event(sp);
+ ch = KEY_MOUSE;
+ n = 1;
+ } else
+#endif
{ /* Can block... */
+#ifdef USE_TERM_DRIVER
+ int buf;
+ n = CallDriver_1(sp, read, &buf);
+ ch = buf;
+#else
unsigned char c2 = 0;
- n = read(sp->_ifd, &c2, 1);
+# if USE_PTHREADS_EINTR
+# if USE_WEAK_SYMBOLS
+ if ((pthread_self) && (pthread_kill) && (pthread_equal))
+# endif
+ _nc_globals.read_thread = pthread_self();
+# endif
+ n = (int) read(sp->_ifd, &c2, 1);
+#if USE_PTHREADS_EINTR
+ _nc_globals.read_thread = 0;
+#endif
ch = c2;
+#endif
}
#ifdef HIDE_EINTR
@@ -220,7 +288,11 @@ fifo_push(SCREEN *sp EVENTLIST_2nd(_nc_eventlist * evl))
* We don't want this difference to show. This piece of code
* tries to make it look like we always have restarting signals.
*/
- if (n <= 0 && errno == EINTR)
+ if (n <= 0 && errno == EINTR
+# if USE_PTHREADS_EINTR
+ && (_nc_globals.have_sigwinch == 0)
+# endif
+ )
goto again;
#endif
@@ -260,12 +332,12 @@ recur_wrefresh(WINDOW *win)
{
#ifdef USE_PTHREADS
SCREEN *sp = _nc_screen_of(win);
- if (_nc_use_pthreads && sp != SP) {
+ if (_nc_use_pthreads && sp != CURRENT_SCREEN) {
SCREEN *save_SP;
/* temporarily switch to the window's screen to check/refresh */
_nc_lock_global(curses);
- save_SP = SP;
+ save_SP = CURRENT_SCREEN;
_nc_set_screen(sp);
recur_wrefresh(win);
_nc_set_screen(save_SP);
@@ -286,12 +358,12 @@ recur_wgetnstr(WINDOW *win, char *buf)
if (sp != 0) {
#ifdef USE_PTHREADS
- if (_nc_use_pthreads && sp != SP) {
+ if (_nc_use_pthreads && sp != CURRENT_SCREEN) {
SCREEN *save_SP;
/* temporarily switch to the window's screen to get cooked input */
_nc_lock_global(curses);
- save_SP = SP;
+ save_SP = CURRENT_SCREEN;
_nc_set_screen(sp);
rc = recur_wgetnstr(win, buf);
_nc_set_screen(save_SP);
@@ -311,17 +383,18 @@ recur_wgetnstr(WINDOW *win, char *buf)
NCURSES_EXPORT(int)
_nc_wgetch(WINDOW *win,
- unsigned long *result,
+ int *result,
int use_meta
EVENTLIST_2nd(_nc_eventlist * evl))
{
SCREEN *sp;
int ch;
+ int rc = 0;
#ifdef NCURSES_WGETCH_EVENTS
long event_delay = -1;
#endif
- T((T_CALLED("_nc_wgetch(%p)"), win));
+ T((T_CALLED("_nc_wgetch(%p)"), (void *) win));
*result = 0;
@@ -352,19 +425,20 @@ _nc_wgetch(WINDOW *win,
!sp->_cbreak &&
!sp->_called_wgetch) {
char buf[MAXCOLUMNS], *bufp;
- int rc;
TR(TRACE_IEVENT, ("filling queue in cooked mode"));
- rc = recur_wgetnstr(win, buf);
-
/* ungetch in reverse order */
#ifdef NCURSES_WGETCH_EVENTS
+ rc = recur_wgetnstr(win, buf);
if (rc != KEY_EVENT)
+ safe_ungetch(sp, '\n');
+#else
+ (void) recur_wgetnstr(win, buf);
+ safe_ungetch(sp, '\n');
#endif
- _nc_ungetch(sp, '\n');
for (bufp = buf + strlen(buf); bufp > buf; bufp--)
- _nc_ungetch(sp, bufp[-1]);
+ safe_ungetch(sp, bufp[-1]);
#ifdef NCURSES_WGETCH_EVENTS
/* Return it first */
@@ -384,7 +458,6 @@ _nc_wgetch(WINDOW *win,
if (win->_notimeout || (win->_delay >= 0) || (sp->_cbreak > 1)) {
if (head == -1) { /* fifo is empty */
int delay;
- int rc;
TR(TRACE_IEVENT, ("timed delay in wgetch()"));
if (sp->_cbreak > 1)
@@ -402,13 +475,13 @@ _nc_wgetch(WINDOW *win,
rc = check_mouse_activity(sp, delay EVENTLIST_2nd(evl));
#ifdef NCURSES_WGETCH_EVENTS
- if (rc & 4) {
+ if (rc & TW_EVENT) {
*result = KEY_EVENT;
returnCode(KEY_CODE_YES);
}
#endif
if (!rc) {
- returnCode(ERR);
+ goto check_sigwinch;
}
}
/* else go on to read data available */
@@ -427,7 +500,6 @@ _nc_wgetch(WINDOW *win,
* increase the wait with mouseinterval().
*/
int runcount = 0;
- int rc;
do {
ch = kgetch(sp EVENTLIST_2nd(evl));
@@ -442,11 +514,11 @@ _nc_wgetch(WINDOW *win,
(ch == KEY_MOUSE
&& (((rc = check_mouse_activity(sp, sp->_maxclick
EVENTLIST_2nd(evl))) != 0
- && !(rc & 4))
+ && !(rc & TW_EVENT))
|| !sp->_mouse_parse(sp, runcount)));
#ifdef NCURSES_WGETCH_EVENTS
- if ((rc & 4) && !ch == KEY_EVENT) {
- _nc_ungetch(sp, ch);
+ if ((rc & TW_EVENT) && !(ch == KEY_EVENT)) {
+ safe_ungetch(sp, ch);
ch = KEY_EVENT;
}
#endif
@@ -454,12 +526,12 @@ _nc_wgetch(WINDOW *win,
#ifdef NCURSES_WGETCH_EVENTS
/* mouse event sequence ended by an event, report event */
if (ch == KEY_EVENT) {
- _nc_ungetch(sp, KEY_MOUSE); /* FIXME This interrupts a gesture... */
+ safe_ungetch(sp, KEY_MOUSE); /* FIXME This interrupts a gesture... */
} else
#endif
{
/* mouse event sequence ended by keystroke, store keystroke */
- _nc_ungetch(sp, ch);
+ safe_ungetch(sp, ch);
ch = KEY_MOUSE;
}
}
@@ -470,6 +542,7 @@ _nc_wgetch(WINDOW *win,
}
if (ch == ERR) {
+ check_sigwinch:
#if USE_SIZECHANGE
if (_nc_handle_sigwinch(sp)) {
_nc_update_screensize(sp);
@@ -508,7 +581,7 @@ _nc_wgetch(WINDOW *win,
* cursor to the left.
*/
if (sp->_echo && !(win->_flags & _ISPAD)) {
- chtype backup = (ch == KEY_BACKSPACE) ? '\b' : ch;
+ chtype backup = (chtype) ((ch == KEY_BACKSPACE) ? '\b' : ch);
if (backup < KEY_MIN)
wechochar(win, backup);
}
@@ -539,7 +612,7 @@ NCURSES_EXPORT(int)
wgetch_events(WINDOW *win, _nc_eventlist * evl)
{
int code;
- unsigned long value;
+ int value;
T((T_CALLED("wgetch_events(%p,%p)"), win, evl));
code = _nc_wgetch(win,
@@ -556,9 +629,9 @@ NCURSES_EXPORT(int)
wgetch(WINDOW *win)
{
int code;
- unsigned long value;
+ int value;
- T((T_CALLED("wgetch(%p)"), win));
+ T((T_CALLED("wgetch(%p)"), (void *) win));
code = _nc_wgetch(win,
&value,
_nc_use_meta(win)
@@ -632,7 +705,7 @@ kgetch(SCREEN *sp EVENTLIST_2nd(_nc_eventlist * evl))
break;
}
TR(TRACE_IEVENT, ("ptr=%p, ch=%d, value=%d",
- ptr, ptr->ch, ptr->value));
+ (void *) ptr, ptr->ch, ptr->value));
if (ptr->value != 0) { /* sequence terminated */
TR(TRACE_IEVENT, ("end of sequence"));
@@ -651,7 +724,7 @@ kgetch(SCREEN *sp EVENTLIST_2nd(_nc_eventlist * evl))
TR(TRACE_IEVENT, ("waiting for rest of sequence"));
rc = check_mouse_activity(sp, timeleft EVENTLIST_2nd(evl));
#ifdef NCURSES_WGETCH_EVENTS
- if (rc & 4) {
+ if (rc & TW_EVENT) {
TR(TRACE_IEVENT, ("interrupted by a user event"));
/* FIXME Should have preserved remainder timeleft for reuse... */
peek = head; /* Restart interpreting later */
diff --git a/ncurses/base/lib_getstr.c b/ncurses/base/lib_getstr.c
index b17df03d2a41..21d8baa05c8b 100644
--- a/ncurses/base/lib_getstr.c
+++ b/ncurses/base/lib_getstr.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2006,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 *
@@ -39,9 +39,8 @@
*/
#include <curses.priv.h>
-#include <term.h>
-MODULE_ID("$Id: lib_getstr.c,v 1.27 2008/08/16 19:20:04 tom Exp $")
+MODULE_ID("$Id: lib_getstr.c,v 1.29 2009/10/24 21:59:02 tom Exp $")
/*
* This wipes out the last character, no matter whether it was a tab, control
@@ -84,24 +83,24 @@ wgetnstr_events(WINDOW *win,
int ch;
int y, x;
- T((T_CALLED("wgetnstr(%p,%p, %d)"), win, str, maxlen));
+ T((T_CALLED("wgetnstr(%p,%p,%d)"), (void *) win, (void *) str, maxlen));
if (!win)
returnCode(ERR);
- _nc_get_tty_mode(&buf);
+ NCURSES_SP_NAME(_nc_get_tty_mode) (NCURSES_SP_ARGx &buf);
oldnl = sp->_nl;
oldecho = sp->_echo;
oldraw = sp->_raw;
oldcbreak = sp->_cbreak;
- nl();
- noecho();
- noraw();
- cbreak();
+ NCURSES_SP_NAME(nl) (NCURSES_SP_ARG);
+ NCURSES_SP_NAME(noecho) (NCURSES_SP_ARG);
+ NCURSES_SP_NAME(noraw) (NCURSES_SP_ARG);
+ NCURSES_SP_NAME(cbreak) (NCURSES_SP_ARG);
- erasec = erasechar();
- killc = killchar();
+ erasec = NCURSES_SP_NAME(erasechar) (NCURSES_SP_ARG);
+ killc = NCURSES_SP_NAME(killchar) (NCURSES_SP_ARG);
oldstr = str;
getyx(win, y, x);
@@ -144,7 +143,7 @@ wgetnstr_events(WINDOW *win,
}
} else if (ch >= KEY_MIN
|| (maxlen >= 0 && str - oldstr >= maxlen)) {
- beep();
+ NCURSES_SP_NAME(beep) (NCURSES_SP_ARG);
} else {
*str++ = (char) ch;
if (oldecho == TRUE) {
@@ -193,7 +192,7 @@ wgetnstr_events(WINDOW *win,
sp->_raw = oldraw;
sp->_cbreak = oldcbreak;
- _nc_set_tty_mode(&buf);
+ NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf);
*str = '\0';
if (ch == ERR)
diff --git a/ncurses/base/lib_hline.c b/ncurses/base/lib_hline.c
index 2ef2cc585e10..1f0380830ddc 100644
--- a/ncurses/base/lib_hline.c
+++ b/ncurses/base/lib_hline.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2001,2006 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2010 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 *
@@ -40,16 +40,16 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_hline.c,v 1.11 2006/03/11 21:52:27 tom Exp $")
+MODULE_ID("$Id: lib_hline.c,v 1.13 2010/12/19 01:48:39 tom Exp $")
NCURSES_EXPORT(int)
whline(WINDOW *win, chtype ch, int n)
{
int code = ERR;
- NCURSES_SIZE_T start;
- NCURSES_SIZE_T end;
+ int start;
+ int end;
- T((T_CALLED("whline(%p,%s,%d)"), win, _tracechtype(ch), n));
+ T((T_CALLED("whline(%p,%s,%d)"), (void *) win, _tracechtype(ch), n));
if (win) {
struct ldat *line = &(win->_line[win->_cury]);
diff --git a/ncurses/base/lib_immedok.c b/ncurses/base/lib_immedok.c
index 87988b66f1a3..d51b60a30857 100644
--- a/ncurses/base/lib_immedok.c
+++ b/ncurses/base/lib_immedok.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2000,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 *
@@ -40,12 +40,12 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_immedok.c,v 1.4 2000/12/10 02:43:27 tom Exp $")
+MODULE_ID("$Id: lib_immedok.c,v 1.5 2009/10/24 22:32:11 tom Exp $")
NCURSES_EXPORT(void)
immedok(WINDOW *win, bool flag)
{
- T((T_CALLED("immedok(%p,%d)"), win, flag));
+ T((T_CALLED("immedok(%p,%d)"), (void *) win, flag));
if (win)
win->_immed = flag;
diff --git a/ncurses/base/lib_inchstr.c b/ncurses/base/lib_inchstr.c
index 6ff01687826e..aebb6d625d5c 100644
--- a/ncurses/base/lib_inchstr.c
+++ b/ncurses/base/lib_inchstr.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2010 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,7 @@
/****************************************************************************
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ * and: Thomas E. Dickey 1996-on *
****************************************************************************/
/*
@@ -40,14 +41,14 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_inchstr.c,v 1.10 2001/06/02 23:37:58 skimo Exp $")
+MODULE_ID("$Id: lib_inchstr.c,v 1.12 2010/12/20 01:37:41 tom Exp $")
NCURSES_EXPORT(int)
-winchnstr(WINDOW *win, chtype * str, int n)
+winchnstr(WINDOW *win, chtype *str, int n)
{
int i = 0;
- T((T_CALLED("winchnstr(%p,%p,%d)"), win, str, n));
+ T((T_CALLED("winchnstr(%p,%p,%d)"), (void *) win, (void *) str, n));
if (!str)
returnCode(0);
@@ -55,7 +56,7 @@ winchnstr(WINDOW *win, chtype * str, int n)
if (win) {
for (; (n < 0 || (i < n)) && (win->_curx + i <= win->_maxx); i++)
str[i] =
- CharOf(win->_line[win->_cury].text[win->_curx + i]) |
+ (chtype) CharOf(win->_line[win->_cury].text[win->_curx + i]) |
AttrOf(win->_line[win->_cury].text[win->_curx + i]);
}
str[i] = (chtype) 0;
diff --git a/ncurses/base/lib_initscr.c b/ncurses/base/lib_initscr.c
index b2fef0c1d085..334682fab71d 100644
--- a/ncurses/base/lib_initscr.c
+++ b/ncurses/base/lib_initscr.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 *
@@ -45,7 +45,7 @@
#include <sys/termio.h> /* needed for ISC */
#endif
-MODULE_ID("$Id: lib_initscr.c,v 1.38 2008/08/16 21:20:48 Werner.Fink Exp $")
+MODULE_ID("$Id: lib_initscr.c,v 1.39 2009/02/14 20:55:49 tom Exp $")
NCURSES_EXPORT(WINDOW *)
initscr(void)
@@ -90,7 +90,11 @@ initscr(void)
}
/* def_shell_mode - done in newterm/_nc_setupscreen */
+#if NCURSES_SP_FUNCS
+ NCURSES_SP_NAME(def_prog_mode) (CURRENT_SCREEN);
+#else
def_prog_mode();
+#endif
}
result = stdscr;
_nc_unlock_global(curses);
diff --git a/ncurses/base/lib_insch.c b/ncurses/base/lib_insch.c
index 9166ea5240e7..e21ec02bc84f 100644
--- a/ncurses/base/lib_insch.c
+++ b/ncurses/base/lib_insch.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2005,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -43,24 +43,31 @@
#include <curses.priv.h>
#include <ctype.h>
-MODULE_ID("$Id: lib_insch.c,v 1.25 2008/02/03 00:14:37 tom Exp $")
+MODULE_ID("$Id: lib_insch.c,v 1.32 2009/10/24 22:04:35 tom Exp $")
/*
* Insert the given character, updating the current location to simplify
* inserting a string.
*/
NCURSES_EXPORT(int)
-_nc_insert_ch(WINDOW *win, chtype ch)
+_nc_insert_ch(SCREEN *sp, WINDOW *win, chtype ch)
{
int code = OK;
NCURSES_CH_T wch;
int count;
NCURSES_CONST char *s;
+ int tabsize = (
+#if USE_REENTRANT
+ sp->_TABSIZE
+#else
+ TABSIZE
+#endif
+ );
switch (ch) {
case '\t':
- for (count = (TABSIZE - (win->_curx % TABSIZE)); count > 0; count--) {
- if ((code = _nc_insert_ch(win, ' ')) != OK)
+ for (count = (tabsize - (win->_curx % tabsize)); count > 0; count--) {
+ if ((code = _nc_insert_ch(sp, win, ' ')) != OK)
break;
}
break;
@@ -76,7 +83,9 @@ _nc_insert_ch(WINDOW *win, chtype ch)
WINDOW_EXT(win, addch_used) == 0 &&
#endif
is8bits(ChCharOf(ch)) &&
- isprint(ChCharOf(ch))) {
+ (isprint(ChCharOf(ch)) ||
+ (ChAttrOf(ch) & A_ALTCHARSET) ||
+ (sp != 0 && sp->_legacy_coding && !iscntrl(ChCharOf(ch))))) {
if (win->_curx <= win->_maxx) {
struct ldat *line = &(win->_line[win->_cury]);
NCURSES_CH_T *end = &(line->text[win->_curx]);
@@ -93,9 +102,9 @@ _nc_insert_ch(WINDOW *win, chtype ch)
win->_curx++;
}
} else if (is8bits(ChCharOf(ch)) && iscntrl(ChCharOf(ch))) {
- s = unctrl(ChCharOf(ch));
+ s = NCURSES_SP_NAME(unctrl) (NCURSES_SP_ARGx ChCharOf(ch));
while (*s != '\0') {
- code = _nc_insert_ch(win, ChAttrOf(ch) | UChar(*s));
+ code = _nc_insert_ch(sp, win, ChAttrOf(ch) | UChar(*s));
if (code != OK)
break;
++s;
@@ -110,16 +119,21 @@ _nc_insert_ch(WINDOW *win, chtype ch)
wch = _nc_render(win, wch);
count = _nc_build_wch(win, &wch);
if (count > 0) {
- code = wins_wch(win, &wch);
+ code = _nc_insert_wch(win, &wch);
} else if (count == -1) {
/* handle EILSEQ */
if (is8bits(ch)) {
- s = unctrl(ChCharOf(ch));
- while (*s != '\0') {
- code = _nc_insert_ch(win, ChAttrOf(ch) | UChar(*s));
- if (code != OK)
- break;
- ++s;
+ s = NCURSES_SP_NAME(unctrl) (NCURSES_SP_ARGx ChCharOf(ch));
+ if (strlen(s) > 1) {
+ while (*s != '\0') {
+ code = _nc_insert_ch(sp, win,
+ ChAttrOf(ch) | UChar(*s));
+ if (code != OK)
+ break;
+ ++s;
+ }
+ } else {
+ code = ERR;
}
} else {
code = ERR;
@@ -139,13 +153,13 @@ winsch(WINDOW *win, chtype c)
NCURSES_SIZE_T ox;
int code = ERR;
- T((T_CALLED("winsch(%p, %s)"), win, _tracechtype(c)));
+ T((T_CALLED("winsch(%p, %s)"), (void *) win, _tracechtype(c)));
if (win != 0) {
oy = win->_cury;
ox = win->_curx;
- code = _nc_insert_ch(win, c);
+ code = _nc_insert_ch(_nc_screen_of(win), win, c);
win->_curx = ox;
win->_cury = oy;
diff --git a/ncurses/base/lib_insdel.c b/ncurses/base/lib_insdel.c
index 342c6541f95f..8f51bbed4844 100644
--- a/ncurses/base/lib_insdel.c
+++ b/ncurses/base/lib_insdel.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2001,2003 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2003,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 *
@@ -42,14 +42,14 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_insdel.c,v 1.12 2003/07/26 22:40:06 tom Exp $")
+MODULE_ID("$Id: lib_insdel.c,v 1.13 2009/10/24 22:34:41 tom Exp $")
NCURSES_EXPORT(int)
winsdelln(WINDOW *win, int n)
{
int code = ERR;
- T((T_CALLED("winsdelln(%p,%d)"), win, n));
+ T((T_CALLED("winsdelln(%p,%d)"), (void *) win, n));
if (win) {
if (n != 0) {
diff --git a/ncurses/base/lib_insnstr.c b/ncurses/base/lib_insnstr.c
index b6ddfde3c52b..ce03e64be002 100644
--- a/ncurses/base/lib_insnstr.c
+++ b/ncurses/base/lib_insnstr.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2004 Free Software Foundation, Inc. *
+ * Copyright (c) 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 *
@@ -40,7 +40,7 @@
#include <curses.priv.h>
#include <ctype.h>
-MODULE_ID("$Id: lib_insnstr.c,v 1.1 2004/02/28 23:44:56 tom Exp $")
+MODULE_ID("$Id: lib_insnstr.c,v 1.3 2009/10/24 22:04:35 tom Exp $")
NCURSES_EXPORT(int)
winsnstr(WINDOW *win, const char *s, int n)
@@ -51,13 +51,15 @@ winsnstr(WINDOW *win, const char *s, int n)
const unsigned char *str = (const unsigned char *) s;
const unsigned char *cp;
- T((T_CALLED("winsnstr(%p,%s,%d)"), win, _nc_visbufn(s, n), n));
+ T((T_CALLED("winsnstr(%p,%s,%d)"), (void *) win, _nc_visbufn(s, n), n));
if (win != 0 && str != 0) {
+ SCREEN *sp = _nc_screen_of(win);
+
oy = win->_cury;
ox = win->_curx;
for (cp = str; *cp && (n <= 0 || (cp - str) < n); cp++) {
- _nc_insert_ch(win, (chtype) UChar(*cp));
+ _nc_insert_ch(sp, win, (chtype) UChar(*cp));
}
win->_curx = ox;
win->_cury = oy;
diff --git a/ncurses/base/lib_instr.c b/ncurses/base/lib_instr.c
index 3fb29490ad06..e6d1a739c94f 100644
--- a/ncurses/base/lib_instr.c
+++ b/ncurses/base/lib_instr.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2005,2007 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-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 *
@@ -41,14 +41,14 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_instr.c,v 1.16 2007/07/21 20:18:10 tom Exp $")
+MODULE_ID("$Id: lib_instr.c,v 1.17 2009/10/24 22:55:45 tom Exp $")
NCURSES_EXPORT(int)
winnstr(WINDOW *win, char *str, int n)
{
int i = 0, row, col;
- T((T_CALLED("winnstr(%p,%p,%d)"), win, str, n));
+ T((T_CALLED("winnstr(%p,%p,%d)"), (void *) win, str, n));
if (!str)
returnCode(0);
@@ -79,18 +79,18 @@ winnstr(WINDOW *win, char *str, int n)
init_mb(state);
n3 = wcstombs(0, wch, 0);
- if (isEILSEQ(n3) || (n3 == 0)) {
- ;
- } else if ((int) (n3 + i) > n) {
- done = TRUE;
- } else if ((tmp = typeCalloc(char, n3 + 10)) == 0) {
- done = TRUE;
- } else {
- init_mb(state);
- wcstombs(tmp, wch, n3);
- for (i3 = 0; i3 < n3; ++i3)
- str[i++] = tmp[i3];
- free(tmp);
+ if (!isEILSEQ(n3) && (n3 != 0)) {
+ if (((int) n3 + i) > n) {
+ done = TRUE;
+ } else if ((tmp = typeCalloc(char, n3 + 10)) == 0) {
+ done = TRUE;
+ } else {
+ init_mb(state);
+ wcstombs(tmp, wch, n3);
+ for (i3 = 0; i3 < n3; ++i3)
+ str[i++] = tmp[i3];
+ free(tmp);
+ }
}
}
free(wch);
diff --git a/ncurses/base/lib_isendwin.c b/ncurses/base/lib_isendwin.c
index b337d97a94c3..923e35bf122f 100644
--- a/ncurses/base/lib_isendwin.c
+++ b/ncurses/base/lib_isendwin.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2000,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 <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ * and: Thomas E. Dickey 1996-on *
+ * and: Juergen Pfeifer 2009 *
****************************************************************************/
/*
@@ -40,12 +42,20 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_isendwin.c,v 1.6 2000/12/10 02:43:27 tom Exp $")
+MODULE_ID("$Id: lib_isendwin.c,v 1.7 2009/02/15 00:36:24 tom Exp $")
NCURSES_EXPORT(bool)
-isendwin(void)
+NCURSES_SP_NAME(isendwin) (NCURSES_SP_DCL0)
{
- if (SP == NULL)
+ if (SP_PARM == NULL)
return FALSE;
- return SP->_endwin;
+ return SP_PARM->_endwin;
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(bool)
+isendwin(void)
+{
+ return NCURSES_SP_NAME(isendwin) (CURRENT_SCREEN);
}
+#endif
diff --git a/ncurses/base/lib_leaveok.c b/ncurses/base/lib_leaveok.c
index 17d095d0f8c8..e6995f85cb4d 100644
--- a/ncurses/base/lib_leaveok.c
+++ b/ncurses/base/lib_leaveok.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2000,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 *
@@ -40,12 +40,12 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_leaveok.c,v 1.5 2000/12/10 02:43:27 tom Exp $")
+MODULE_ID("$Id: lib_leaveok.c,v 1.6 2009/10/24 22:34:23 tom Exp $")
NCURSES_EXPORT(int)
leaveok(WINDOW *win, bool flag)
{
- T((T_CALLED("leaveok(%p,%d)"), win, flag));
+ T((T_CALLED("leaveok(%p,%d)"), (void *) win, flag));
if (win) {
win->_leaveok = flag;
diff --git a/ncurses/base/lib_mouse.c b/ncurses/base/lib_mouse.c
index 95f29aa69111..dac039551165 100644
--- a/ncurses/base/lib_mouse.c
+++ b/ncurses/base/lib_mouse.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -30,6 +30,7 @@
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
* and: Thomas E. Dickey 1996-on *
+ * and: Juergen Pfeifer 2008 *
****************************************************************************/
/*
@@ -79,9 +80,12 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_mouse.c,v 1.102 2008/10/18 21:48:55 tom Exp $")
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
+MODULE_ID("$Id: lib_mouse.c,v 1.121 2011/01/22 19:47:47 tom Exp $")
-#include <term.h>
#include <tic.h>
#if USE_GPM_SUPPORT
@@ -118,12 +122,12 @@ make an error
#define MY_TRACE TRACE_ICALLS|TRACE_IEVENT
-#define MASK_RELEASE(x) NCURSES_MOUSE_MASK(x, 001)
-#define MASK_PRESS(x) NCURSES_MOUSE_MASK(x, 002)
-#define MASK_CLICK(x) NCURSES_MOUSE_MASK(x, 004)
-#define MASK_DOUBLE_CLICK(x) NCURSES_MOUSE_MASK(x, 010)
-#define MASK_TRIPLE_CLICK(x) NCURSES_MOUSE_MASK(x, 020)
-#define MASK_RESERVED_EVENT(x) NCURSES_MOUSE_MASK(x, 040)
+#define MASK_RELEASE(x) (mmask_t) NCURSES_MOUSE_MASK(x, 001)
+#define MASK_PRESS(x) (mmask_t) NCURSES_MOUSE_MASK(x, 002)
+#define MASK_CLICK(x) (mmask_t) NCURSES_MOUSE_MASK(x, 004)
+#define MASK_DOUBLE_CLICK(x) (mmask_t) NCURSES_MOUSE_MASK(x, 010)
+#define MASK_TRIPLE_CLICK(x) (mmask_t) NCURSES_MOUSE_MASK(x, 020)
+#define MASK_RESERVED_EVENT(x) (mmask_t) NCURSES_MOUSE_MASK(x, 040)
#if NCURSES_MOUSE_VERSION == 1
#define BUTTON_CLICKED (BUTTON1_CLICKED | BUTTON2_CLICKED | BUTTON3_CLICKED | BUTTON4_CLICKED)
@@ -150,7 +154,7 @@ make an error
#define LIBGPM_SONAME "libgpm.so"
#endif
-#define GET_DLSYM(name) (my_##name = (TYPE_##name) dlsym(SP->_dlopen_gpm, #name))
+#define GET_DLSYM(name) (my_##name = (TYPE_##name) dlsym(sp->_dlopen_gpm, #name))
#endif /* USE_GPM_SUPPORT */
@@ -164,13 +168,13 @@ static void _nc_mouse_wrap(SCREEN *);
#define LastEV(sp) ((sp)->_mouse_events + EV_MAX - 1)
#undef NEXT
-#define NEXT(ep) ((ep >= LastEV(sp)) \
- ? FirstEV(sp) \
+#define NEXT(ep) ((ep >= LastEV(SP_PARM)) \
+ ? FirstEV(SP_PARM) \
: ep + 1)
#undef PREV
-#define PREV(ep) ((ep <= FirstEV(sp)) \
- ? LastEV(sp) \
+#define PREV(ep) ((ep <= FirstEV(SP_PARM)) \
+ ? LastEV(SP_PARM) \
: ep - 1)
#define IndexEV(sp, ep) (ep - FirstEV(sp))
@@ -185,7 +189,7 @@ _trace_slot(SCREEN *sp, const char *tag)
{
MEVENT *ep;
- _tracef(tag);
+ _tracef("%s", tag);
for (ep = FirstEV(sp); ep <= LastEV(sp); ep++)
_tracef("mouse event queue slot %ld = %s",
@@ -340,10 +344,13 @@ sysmouse_server(SCREEN *sp)
static void
handle_sysmouse(int sig GCC_UNUSED)
{
- sysmouse_server(SP);
+ sysmouse_server(CURRENT_SCREEN);
}
#endif /* USE_SYSMOUSE */
+#ifndef USE_TERM_DRIVER
+#define xterm_kmous "\033[M"
+
static void
init_xterm_mouse(SCREEN *sp)
{
@@ -352,6 +359,7 @@ init_xterm_mouse(SCREEN *sp)
if (!VALID_STRING(sp->_mouse_xtermcap))
sp->_mouse_xtermcap = "\033[?1000%?%p1%{1}%=%th%el%;";
}
+#endif
static void
enable_xterm_mouse(SCREEN *sp, int enable)
@@ -359,7 +367,9 @@ enable_xterm_mouse(SCREEN *sp, int enable)
#if USE_EMX_MOUSE
sp->_emxmouse_activated = enable;
#else
- putp(TPARM_1(sp->_mouse_xtermcap, enable));
+ NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx
+ "xterm-mouse",
+ TPARM_1(sp->_mouse_xtermcap, enable));
#endif
sp->_mouse_active = enable;
}
@@ -398,7 +408,7 @@ allow_gpm_mouse(void)
static void
unload_gpm_library(SCREEN *sp)
{
- if (SP->_dlopen_gpm != 0) {
+ if (sp->_dlopen_gpm != 0) {
T(("unload GPM library"));
sp->_mouse_gpm_loaded = FALSE;
sp->_mouse_fd = -1;
@@ -440,6 +450,8 @@ enable_gpm_mouse(SCREEN *sp, bool enable)
}
#endif
if (sp->_mouse_gpm_loaded) {
+ int code;
+
/* GPM: initialize connection to gpm server */
sp->_mouse_gpm_connect.eventMask = GPM_DOWN | GPM_UP;
sp->_mouse_gpm_connect.defaultMask =
@@ -454,7 +466,16 @@ enable_gpm_mouse(SCREEN *sp, bool enable)
* The former is recognized by wscons (SunOS), and the latter by
* xterm. Those will not show up in ncurses' traces.
*/
- result = (my_Gpm_Open(&sp->_mouse_gpm_connect, 0) >= 0);
+ code = my_Gpm_Open(&sp->_mouse_gpm_connect, 0);
+ result = (code >= 0);
+
+ /*
+ * GPM can return a -2 if it is trying to do something with xterm.
+ * Ignore that, since it conflicts with our use of stdin.
+ */
+ if (code == -2) {
+ my_Gpm_Close();
+ }
} else {
result = FALSE;
}
@@ -478,8 +499,6 @@ enable_gpm_mouse(SCREEN *sp, bool enable)
}
#endif /* USE_GPM_SUPPORT */
-#define xterm_kmous "\033[M"
-
static void
initialize_mousetype(SCREEN *sp)
{
@@ -514,7 +533,7 @@ initialize_mousetype(SCREEN *sp)
/* OS/2 VIO */
#if USE_EMX_MOUSE
if (!sp->_emxmouse_thread
- && strstr(cur_term->type.term_names, "xterm") == 0
+ && strstr(TerminalOf(sp)->type.term_names, "xterm") == 0
&& key_mouse) {
int handles[2];
@@ -621,16 +640,21 @@ initialize_mousetype(SCREEN *sp)
}
#endif /* USE_SYSMOUSE */
+#ifdef USE_TERM_DRIVER
+ CallDriver(sp, initmouse);
+#else
/* we know how to recognize mouse events under "xterm" */
if (key_mouse != 0) {
if (!strcmp(key_mouse, xterm_kmous)
- || strstr(cur_term->type.term_names, "xterm") != 0) {
+ || strstr(TerminalOf(sp)->type.term_names, "xterm") != 0) {
init_xterm_mouse(sp);
}
- } else if (strstr(cur_term->type.term_names, "xterm") != 0) {
+ } else if (strstr(TerminalOf(sp)->type.term_names, "xterm") != 0) {
if (_nc_add_to_try(&(sp->_keytry), xterm_kmous, KEY_MOUSE) == OK)
init_xterm_mouse(sp);
}
+#endif
+
returnVoid;
}
@@ -665,7 +689,7 @@ _nc_mouse_init(SCREEN *sp)
* fifo_push() in lib_getch.c
*/
static bool
-_nc_mouse_event(SCREEN *sp GCC_UNUSED)
+_nc_mouse_event(SCREEN *sp)
{
MEVENT *eventp = sp->_mouse_eventp;
bool result = FALSE;
@@ -694,11 +718,16 @@ _nc_mouse_event(SCREEN *sp GCC_UNUSED)
#if USE_GPM_SUPPORT
case M_GPM:
- {
+ if (sp->_mouse_fd >= 0) {
/* query server for event, return TRUE if we find one */
Gpm_Event ev;
- if (my_Gpm_GetEvent(&ev) == 1) {
+ switch (my_Gpm_GetEvent(&ev)) {
+ case 0:
+ /* Connection closed, drop the mouse. */
+ sp->_mouse_fd = -1;
+ break;
+ case 1:
/* there's only one mouse... */
eventp->id = NORMAL_EVENT;
@@ -729,8 +758,9 @@ _nc_mouse_event(SCREEN *sp GCC_UNUSED)
eventp->z = 0;
/* bump the next-free pointer into the circular list */
- sp->_mouse_eventp = eventp = NEXT(eventp);
+ sp->_mouse_eventp = NEXT(eventp);
result = TRUE;
+ break;
}
}
break;
@@ -759,6 +789,28 @@ _nc_mouse_event(SCREEN *sp GCC_UNUSED)
break;
#endif /* USE_SYSMOUSE */
+#ifdef USE_TERM_DRIVER
+ case M_TERM_DRIVER:
+ while (sp->_drv_mouse_head < sp->_drv_mouse_tail) {
+ *eventp = sp->_drv_mouse_fifo[sp->_drv_mouse_head];
+
+ /*
+ * Point the fifo-head to the next possible location. If there
+ * are none, reset the indices.
+ */
+ sp->_drv_mouse_head += 1;
+ if (sp->_drv_mouse_head == sp->_drv_mouse_tail) {
+ sp->_drv_mouse_tail = 0;
+ sp->_drv_mouse_head = 0;
+ }
+
+ /* bump the next-free pointer into the circular list */
+ sp->_mouse_eventp = eventp = NEXT(eventp);
+ result = TRUE;
+ }
+ break;
+#endif
+
case M_NONE:
break;
}
@@ -814,17 +866,26 @@ _nc_mouse_inline(SCREEN *sp)
* Wheel mice may return buttons 4 and 5 when the wheel is turned.
* We encode those as button presses.
*/
+# if USE_PTHREADS_EINTR
+# if USE_WEAK_SYMBOLS
+ if ((pthread_self) && (pthread_kill) && (pthread_equal))
+# endif
+ _nc_globals.read_thread = pthread_self();
+# endif
for (grabbed = 0; grabbed < 3; grabbed += (size_t) res) {
/* For VIO mouse we add extra bit 64 to disambiguate button-up. */
#if USE_EMX_MOUSE
- res = read(M_FD(sp) >= 0 ? M_FD(sp) : sp->_ifd, &kbuf, 3);
+ res = (int) read(M_FD(sp) >= 0 ? M_FD(sp) : sp->_ifd, &kbuf, 3);
#else
- res = read(sp->_ifd, kbuf + grabbed, 3 - grabbed);
+ res = (int) read(sp->_ifd, kbuf + grabbed, 3 - grabbed);
#endif
if (res == -1)
break;
}
+#if USE_PTHREADS_EINTR
+ _nc_globals.read_thread = 0;
+#endif
kbuf[3] = '\0';
TR(TRACE_IEVENT,
@@ -937,7 +998,7 @@ mouse_activate(SCREEN *sp, bool on)
switch (sp->_mouse_type) {
case M_XTERM:
#if NCURSES_EXT_FUNCS
- keyok(KEY_MOUSE, on);
+ NCURSES_SP_NAME(keyok) (NCURSES_SP_ARGx KEY_MOUSE, on);
#endif
TPUTS_TRACE("xterm mouse initialization");
enable_xterm_mouse(sp, 1);
@@ -956,6 +1017,11 @@ mouse_activate(SCREEN *sp, bool on)
sp->_mouse_active = TRUE;
break;
#endif
+#ifdef USE_TERM_DRIVER
+ case M_TERM_DRIVER:
+ sp->_mouse_active = TRUE;
+ break;
+#endif
case M_NONE:
return;
}
@@ -985,11 +1051,16 @@ mouse_activate(SCREEN *sp, bool on)
sp->_mouse_active = FALSE;
break;
#endif
+#ifdef USE_TERM_DRIVER
+ case M_TERM_DRIVER:
+ sp->_mouse_active = FALSE;
+ break;
+#endif
case M_NONE:
return;
}
}
- _nc_flush();
+ NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG);
}
/**************************************************************************
@@ -1222,6 +1293,11 @@ _nc_mouse_wrap(SCREEN *sp)
mouse_activate(sp, FALSE);
break;
#endif
+#ifdef USE_TERM_DRIVER
+ case M_TERM_DRIVER:
+ mouse_activate(sp, FALSE);
+ break;
+#endif
case M_NONE:
break;
}
@@ -1253,6 +1329,13 @@ _nc_mouse_resume(SCREEN *sp)
mouse_activate(sp, TRUE);
break;
#endif
+
+#ifdef USE_TERM_DRIVER
+ case M_TERM_DRIVER:
+ mouse_activate(sp, TRUE);
+ break;
+#endif
+
case M_NONE:
break;
}
@@ -1264,80 +1347,92 @@ _nc_mouse_resume(SCREEN *sp)
*
**************************************************************************/
-static int
-_nc_getmouse(SCREEN *sp, MEVENT * aevent)
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(getmouse) (NCURSES_SP_DCLx MEVENT * aevent)
{
- T((T_CALLED("getmouse(%p)"), aevent));
+ int result = ERR;
- if ((aevent != 0) && (sp != 0) && (sp->_mouse_type != M_NONE)) {
- MEVENT *eventp = sp->_mouse_eventp;
+ T((T_CALLED("getmouse(%p,%p)"), (void *) SP_PARM, (void *) aevent));
+
+ 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);
- /* copy the event we find there */
- *aevent = *prev;
+ if (prev->id != INVALID_EVENT) {
+ /* copy the event we find there */
+ *aevent = *prev;
- TR(TRACE_IEVENT, ("getmouse: returning event %s from slot %ld",
- _nc_tracemouse(sp, prev),
- (long) IndexEV(sp, prev)));
+ TR(TRACE_IEVENT, ("getmouse: returning event %s from slot %ld",
+ _nc_tracemouse(SP_PARM, prev),
+ (long) IndexEV(SP_PARM, prev)));
- prev->id = INVALID_EVENT; /* so the queue slot becomes free */
- returnCode(OK);
+ prev->id = INVALID_EVENT; /* so the queue slot becomes free */
+ SP_PARM->_mouse_eventp = PREV(prev);
+ result = OK;
+ }
}
- returnCode(ERR);
+ returnCode(result);
}
+#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)"), (void *) SP_PARM, (void *) 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)"),
+ (void *) SP_PARM,
+ (unsigned long) newmask,
+ (void *) 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
@@ -1349,14 +1444,22 @@ mousemask(mmask_t newmask, mmask_t * oldmask)
| BUTTON_DOUBLE_CLICKED
| BUTTON_TRIPLE_CLICKED);
- mouse_activate(SP, (bool) (result != 0));
+ mouse_activate(SP_PARM, (bool) (result != 0));
- SP->_mouse_mask = result;
+ SP_PARM->_mouse_mask = result;
}
}
}
- returnBits(result);
+ returnMMask(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)
@@ -1364,7 +1467,7 @@ wenclose(const WINDOW *win, int y, int x)
{
bool result = FALSE;
- T((T_CALLED("wenclose(%p,%d,%d)"), win, y, x));
+ T((T_CALLED("wenclose(%p,%d,%d)"), (const void *) win, y, x));
if (win != 0) {
y -= win->_yoffset;
@@ -1377,17 +1480,17 @@ wenclose(const WINDOW *win, int y, int x)
}
NCURSES_EXPORT(int)
-mouseinterval(int maxclick)
+NCURSES_SP_NAME(mouseinterval) (NCURSES_SP_DCLx int maxclick)
/* set the maximum mouse interval within which to recognize a click */
{
int oldval;
- T((T_CALLED("mouseinterval(%d)"), maxclick));
+ T((T_CALLED("mouseinterval(%p,%d)"), (void *) 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;
}
@@ -1395,20 +1498,46 @@ mouseinterval(int maxclick)
returnCode(oldval);
}
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+mouseinterval(int maxclick)
+{
+ return NCURSES_SP_NAME(mouseinterval) (CURRENT_SCREEN, maxclick);
+}
+#endif
+
/* This may be used by other routines to ask for the existence of mouse
support */
-NCURSES_EXPORT(int)
-_nc_has_mouse(void)
+NCURSES_EXPORT(bool)
+_nc_has_mouse(SCREEN *sp)
+{
+ return (((0 == sp) || (sp->_mouse_type == M_NONE)) ? FALSE : TRUE);
+}
+
+NCURSES_EXPORT(bool)
+NCURSES_SP_NAME(has_mouse) (NCURSES_SP_DCL0)
{
- return (SP->_mouse_type == M_NONE ? 0 : 1);
+ return _nc_has_mouse(SP_PARM);
}
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(bool)
+has_mouse(void)
+{
+ return _nc_has_mouse(CURRENT_SCREEN);
+}
+#endif
+
NCURSES_EXPORT(bool)
wmouse_trafo(const WINDOW *win, int *pY, int *pX, bool to_screen)
{
bool result = FALSE;
- T((T_CALLED("wmouse_trafo(%p,%p,%p,%d)"), win, pY, pX, to_screen));
+ T((T_CALLED("wmouse_trafo(%p,%p,%p,%d)"),
+ (const void *) win,
+ (void *) pY,
+ (void *) pX,
+ to_screen));
if (win && pY && pX) {
int y = *pY;
diff --git a/ncurses/base/lib_move.c b/ncurses/base/lib_move.c
index 652c44d7b718..488b195d15a3 100644
--- a/ncurses/base/lib_move.c
+++ b/ncurses/base/lib_move.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2000,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 *
@@ -41,12 +41,12 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_move.c,v 1.12 2004/12/04 21:50:07 tom Exp $")
+MODULE_ID("$Id: lib_move.c,v 1.13 2009/10/24 22:34:07 tom Exp $")
NCURSES_EXPORT(int)
wmove(WINDOW *win, int y, int x)
{
- T((T_CALLED("wmove(%p,%d,%d)"), win, y, x));
+ T((T_CALLED("wmove(%p,%d,%d)"), (void *) win, y, x));
if (LEGALYX(win, y, x)) {
win->_curx = (NCURSES_SIZE_T) x;
diff --git a/ncurses/base/lib_mvwin.c b/ncurses/base/lib_mvwin.c
index e4dad4a746f0..18d31c13319b 100644
--- a/ncurses/base/lib_mvwin.c
+++ b/ncurses/base/lib_mvwin.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2001,2006 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2010 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 <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ * and: Thomas E. Dickey 1996-on *
+ * and: Juergen Pfeifer *
****************************************************************************/
/*
@@ -40,12 +42,16 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_mvwin.c,v 1.14 2006/02/25 22:53:46 tom Exp $")
+MODULE_ID("$Id: lib_mvwin.c,v 1.18 2010/12/19 01:22:58 tom Exp $")
NCURSES_EXPORT(int)
mvwin(WINDOW *win, int by, int bx)
{
- T((T_CALLED("mvwin(%p,%d,%d)"), win, by, bx));
+#if NCURSES_SP_FUNCS
+ SCREEN *sp = _nc_screen_of(win);
+#endif
+
+ T((T_CALLED("mvwin(%p,%d,%d)"), (void *) win, by, bx));
if (!win || (win->_flags & _ISPAD))
returnCode(ERR);
@@ -96,8 +102,8 @@ mvwin(WINDOW *win, int by, int bx)
}
#endif
- if (by + win->_maxy > screen_lines - 1
- || bx + win->_maxx > screen_columns - 1
+ if (by + win->_maxy > screen_lines(SP_PARM) - 1
+ || bx + win->_maxx > screen_columns(SP_PARM) - 1
|| by < 0
|| bx < 0)
returnCode(ERR);
@@ -108,7 +114,7 @@ mvwin(WINDOW *win, int by, int bx)
* new location. This ensures that if the caller has refreshed another
* window at the same location, that this one will be displayed.
*/
- win->_begy = by;
- win->_begx = bx;
+ win->_begy = (NCURSES_SIZE_T) by;
+ win->_begx = (NCURSES_SIZE_T) bx;
returnCode(touchwin(win));
}
diff --git a/ncurses/base/lib_newterm.c b/ncurses/base/lib_newterm.c
index 05982b84cee4..e12208b7d02d 100644
--- a/ncurses/base/lib_newterm.c
+++ b/ncurses/base/lib_newterm.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -30,6 +30,7 @@
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
* and: Thomas E. Dickey 1996-on *
+ * and: Juergen Pfeifer 2009 *
****************************************************************************/
/*
@@ -45,10 +46,19 @@
#define _POSIX_SOURCE
#endif
-#include <term.h> /* clear_screen, cup & friends, cur_term */
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
#include <tic.h>
-MODULE_ID("$Id: lib_newterm.c,v 1.73 2008/08/16 21:20:48 Werner.Fink Exp $")
+MODULE_ID("$Id: lib_newterm.c,v 1.86 2010/05/20 23:25:18 tom Exp $")
+
+#ifdef USE_TERM_DRIVER
+#define NumLabels InfoOf(SP_PARM).numlabels
+#else
+#define NumLabels num_labels
+#endif
#ifndef ONLCR /* Allows compilation under the QNX 4.2 OS */
#define ONLCR 0
@@ -63,27 +73,29 @@ MODULE_ID("$Id: lib_newterm.c,v 1.73 2008/08/16 21:20:48 Werner.Fink Exp $")
* is supposed to behave as if it calls newterm, we do it here.
*/
static NCURSES_INLINE int
-_nc_initscr(void)
+_nc_initscr(NCURSES_SP_DCL0)
{
int result = ERR;
+ TERMINAL *term = TerminalOf(SP_PARM);
/* for extended XPG4 conformance requires cbreak() at this point */
/* (SVr4 curses does this anyway) */
- if (cbreak() == OK) {
+ if (NCURSES_SP_NAME(cbreak) (NCURSES_SP_ARG) == OK) {
TTY buf;
- buf = cur_term->Nttyb;
+ buf = term->Nttyb;
#ifdef TERMIOS
- buf.c_lflag &= ~(ECHO | ECHONL);
- buf.c_iflag &= ~(ICRNL | INLCR | IGNCR);
- buf.c_oflag &= ~(ONLCR);
+ buf.c_lflag &= (unsigned) ~(ECHO | ECHONL);
+ buf.c_iflag &= (unsigned) ~(ICRNL | INLCR | IGNCR);
+ buf.c_oflag &= (unsigned) ~(ONLCR);
#elif HAVE_SGTTY_H
buf.sg_flags &= ~(ECHO | CRMOD);
#else
memset(&buf, 0, sizeof(buf));
#endif
- if ((result = _nc_set_tty_mode(&buf)) == OK)
- cur_term->Nttyb = buf;
+ result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf);
+ if (result == OK)
+ term->Nttyb = buf;
}
return result;
}
@@ -95,13 +107,30 @@ _nc_initscr(void)
* initialized.
*/
NCURSES_EXPORT(void)
+NCURSES_SP_NAME(filter) (NCURSES_SP_DCL0)
+{
+ START_TRACE();
+ T((T_CALLED("filter(%p)"), (void *) SP_PARM));
+#if NCURSES_SP_FUNCS
+ if (IsPreScreen(SP_PARM)) {
+ SP_PARM->_filtered = TRUE;
+ }
+#else
+ _nc_prescreen.filter_mode = TRUE;
+#endif
+ returnVoid;
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(void)
filter(void)
{
START_TRACE();
- T((T_CALLED("filter")));
+ T((T_CALLED("filter()")));
_nc_prescreen.filter_mode = TRUE;
returnVoid;
}
+#endif
#if NCURSES_EXT_FUNCS
/*
@@ -109,62 +138,125 @@ filter(void)
* requiring it to also be filtered.
*/
NCURSES_EXPORT(void)
+NCURSES_SP_NAME(nofilter) (NCURSES_SP_DCL0)
+{
+ START_TRACE();
+ T((T_CALLED("nofilter(%p)"), (void *) SP_PARM));
+#if NCURSES_SP_FUNCS
+ if (IsPreScreen(SP_PARM)) {
+ SP_PARM->_filtered = FALSE;
+ }
+#else
+ _nc_prescreen.filter_mode = FALSE;
+#endif
+ returnVoid;
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(void)
nofilter(void)
{
START_TRACE();
- T((T_CALLED("nofilter")));
+ T((T_CALLED("nofilter()")));
_nc_prescreen.filter_mode = FALSE;
returnVoid;
}
#endif
+#endif /* NCURSES_EXT_FUNCS */
NCURSES_EXPORT(SCREEN *)
-newterm(NCURSES_CONST char *name, FILE *ofp, FILE *ifp)
+NCURSES_SP_NAME(newterm) (NCURSES_SP_DCLx
+ NCURSES_CONST char *name,
+ FILE *ofp,
+ FILE *ifp)
{
int value;
int errret;
- SCREEN *current;
SCREEN *result = 0;
+ SCREEN *current;
TERMINAL *its_term;
+ FILE *_ofp = ofp ? ofp : stdout;
+ FILE *_ifp = ifp ? ifp : stdin;
+ int cols;
+ int slk_format;
+ int filter_mode;
+ TERMINAL *new_term = 0;
START_TRACE();
- T((T_CALLED("newterm(\"%s\",%p,%p)"), name, ofp, ifp));
+ T((T_CALLED("newterm(%p, \"%s\", %p,%p)"),
+ (void *) SP_PARM,
+ name,
+ (void *) ofp,
+ (void *) ifp));
+
+#if NCURSES_SP_FUNCS
+ assert(SP_PARM != 0);
+ if (SP_PARM == 0)
+ returnSP(SP_PARM);
+#endif
_nc_init_pthreads();
_nc_lock_global(curses);
- current = SP;
- its_term = (SP ? SP->_term : 0);
+ current = CURRENT_SCREEN;
+ its_term = (current ? current->_term : 0);
+ INIT_TERM_DRIVER();
/* this loads the capability entry, then sets LINES and COLS */
- if (setupterm(name, fileno(ofp), &errret) != ERR) {
- int slk_format = _nc_globals.slk_format;
+ if (
+#if NCURSES_SP_FUNCS
+ SP_PARM->_prescreen &&
+#endif
+ TINFO_SETUP_TERM(&new_term, name,
+ fileno(_ofp), &errret, FALSE) != ERR) {
+
+ _nc_set_screen(0);
+#ifdef USE_TERM_DRIVER
+ assert(new_term != 0);
+#endif
+
+#if NCURSES_SP_FUNCS
+ slk_format = SP_PARM->slk_format;
+ filter_mode = SP_PARM->_filtered;
+#else
+ slk_format = _nc_globals.slk_format;
+ filter_mode = _nc_prescreen.filter_mode;
+#endif
/*
* This actually allocates the screen structure, and saves the original
* terminal settings.
*/
- _nc_set_screen(0);
-
- /* allow user to set maximum escape delay from the environment */
- if ((value = _nc_getenv_num("ESCDELAY")) >= 0) {
- set_escdelay(value);
- }
-
- if (_nc_setupscreen(LINES,
- COLS,
- ofp,
- _nc_prescreen.filter_mode,
- slk_format) == ERR) {
+ if (NCURSES_SP_NAME(_nc_setupscreen) (
+#if NCURSES_SP_FUNCS
+ &SP_PARM,
+#endif
+ *(ptrLines(SP_PARM)),
+ *(ptrCols(SP_PARM)),
+ _ofp,
+ filter_mode,
+ slk_format) == ERR) {
_nc_set_screen(current);
result = 0;
} else {
- assert(SP != 0);
+#ifdef USE_TERM_DRIVER
+ TERMINAL_CONTROL_BLOCK *TCB;
+#elif !NCURSES_SP_FUNCS
+ _nc_set_screen(CURRENT_SCREEN);
+#endif
+ assert(SP_PARM != 0);
+ cols = *(ptrCols(SP_PARM));
+#ifdef USE_TERM_DRIVER
+ _nc_set_screen(SP_PARM);
+ TCB = (TERMINAL_CONTROL_BLOCK *) new_term;
+ TCB->csp = SP_PARM;
+#endif
/*
* In setupterm() we did a set_curterm(), but it was before we set
- * SP. So the "current" screen's terminal pointer was overwritten
- * with a different terminal. Later, in _nc_setupscreen(), we set
- * SP and the terminal pointer in the new screen.
+ * CURRENT_SCREEN. So the "current" screen's terminal pointer was
+ * overwritten with a different terminal. Later, in
+ * _nc_setupscreen(), we set CURRENT_SCREEN and the terminal
+ * pointer in the new screen.
*
* Restore the terminal-pointer for the pre-existing screen, if
* any.
@@ -172,37 +264,53 @@ newterm(NCURSES_CONST char *name, FILE *ofp, FILE *ifp)
if (current)
current->_term = its_term;
+#ifdef USE_TERM_DRIVER
+ SP_PARM->_term = new_term;
+#else
+ new_term = SP_PARM->_term;
+#endif
+
+ /* allow user to set maximum escape delay from the environment */
+ if ((value = _nc_getenv_num("ESCDELAY")) >= 0) {
+ NCURSES_SP_NAME(set_escdelay) (NCURSES_SP_ARGx value);
+ }
+
/* if the terminal type has real soft labels, set those up */
- if (slk_format && num_labels > 0 && SLK_STDFMT(slk_format))
- _nc_slk_initialize(stdscr, COLS);
+ if (slk_format && NumLabels > 0 && SLK_STDFMT(slk_format))
+ _nc_slk_initialize(StdScreen(SP_PARM), cols);
- SP->_ifd = fileno(ifp);
- typeahead(fileno(ifp));
+ SP_PARM->_ifd = fileno(_ifp);
+ NCURSES_SP_NAME(typeahead) (NCURSES_SP_ARGx fileno(_ifp));
#ifdef TERMIOS
- SP->_use_meta = ((cur_term->Ottyb.c_cflag & CSIZE) == CS8 &&
- !(cur_term->Ottyb.c_iflag & ISTRIP));
+ SP_PARM->_use_meta = ((new_term->Ottyb.c_cflag & CSIZE) == CS8 &&
+ !(new_term->Ottyb.c_iflag & ISTRIP));
#else
- SP->_use_meta = FALSE;
+ SP_PARM->_use_meta = FALSE;
#endif
- SP->_endwin = FALSE;
-
+ SP_PARM->_endwin = FALSE;
+#ifndef USE_TERM_DRIVER
/*
* Check whether we can optimize scrolling under dumb terminals in
* case we do not have any of these capabilities, scrolling
* optimization will be useless.
*/
- SP->_scrolling = ((scroll_forward && scroll_reverse) ||
- ((parm_rindex ||
- parm_insert_line ||
- insert_line) &&
- (parm_index ||
- parm_delete_line ||
- delete_line)));
+ SP_PARM->_scrolling = ((scroll_forward && scroll_reverse) ||
+ ((parm_rindex ||
+ parm_insert_line ||
+ insert_line) &&
+ (parm_index ||
+ parm_delete_line ||
+ delete_line)));
+#endif
- baudrate(); /* sets a field in the SP structure */
+ NCURSES_SP_NAME(baudrate) (NCURSES_SP_ARG); /* sets a field in the screen structure */
- SP->_keytry = 0;
+ SP_PARM->_keytry = 0;
+ /* compute movement costs so we can do better move optimization */
+#ifdef USE_TERM_DRIVER
+ TCBOf(SP_PARM)->drv->scinit(SP_PARM);
+#else
/*
* Check for mismatched graphic-rendition capabilities. Most SVr4
* terminfo trees contain entries that have rmul or rmso equated to
@@ -213,23 +321,31 @@ newterm(NCURSES_CONST char *name, FILE *ofp, FILE *ifp)
* shouldn't be looking at this detail.
*/
#define SGR0_TEST(mode) (mode != 0) && (exit_attribute_mode == 0 || strcmp(mode, exit_attribute_mode))
- SP->_use_rmso = SGR0_TEST(exit_standout_mode);
- SP->_use_rmul = SGR0_TEST(exit_underline_mode);
+ SP_PARM->_use_rmso = SGR0_TEST(exit_standout_mode);
+ SP_PARM->_use_rmul = SGR0_TEST(exit_underline_mode);
/* compute movement costs so we can do better move optimization */
_nc_mvcur_init();
/* initialize terminal to a sane state */
_nc_screen_init();
+#endif
/* Initialize the terminal line settings. */
- _nc_initscr();
+ _nc_initscr(NCURSES_SP_ARG);
_nc_signal_handler(TRUE);
-
- result = SP;
+ result = SP_PARM;
}
}
_nc_unlock_global(curses);
returnSP(result);
}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(SCREEN *)
+newterm(NCURSES_CONST char *name, FILE *ofp, FILE *ifp)
+{
+ return NCURSES_SP_NAME(newterm) (CURRENT_SCREEN_PRE, name, ofp, ifp);
+}
+#endif
diff --git a/ncurses/base/lib_newwin.c b/ncurses/base/lib_newwin.c
index 587e83a92009..2b120eac10c7 100644
--- a/ncurses/base/lib_newwin.c
+++ b/ncurses/base/lib_newwin.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -30,6 +30,7 @@
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
* and: Thomas E. Dickey 1996-on *
+ * and: Juergen Pfeifer 2009 *
****************************************************************************/
/*
@@ -42,7 +43,7 @@
#include <curses.priv.h>
#include <stddef.h>
-MODULE_ID("$Id: lib_newwin.c,v 1.52 2008/06/07 13:58:09 tom Exp $")
+MODULE_ID("$Id: lib_newwin.c,v 1.68 2011/01/22 20:34:15 tom Exp $")
#define window_is(name) ((sp)->_##name == win)
@@ -61,6 +62,17 @@ remove_window_from_screen(WINDOW *win)
{
SCREEN *sp;
+#ifdef USE_SP_WINDOWLIST
+ if ((sp = _nc_screen_of(win)) != 0) {
+ if (window_is(curscr)) {
+ remove_window(curscr);
+ } else if (window_is(stdscr)) {
+ remove_window(stdscr);
+ } else if (window_is(newscr)) {
+ remove_window(newscr);
+ }
+ }
+#else
for (each_screen(sp)) {
if (window_is(curscr)) {
remove_window(curscr);
@@ -73,6 +85,7 @@ remove_window_from_screen(WINDOW *win)
break;
}
}
+#endif
}
NCURSES_EXPORT(int)
@@ -81,17 +94,20 @@ _nc_freewin(WINDOW *win)
WINDOWLIST *p, *q;
int i;
int result = ERR;
+#ifdef USE_SP_WINDOWLIST
+ SCREEN *sp = _nc_screen_of(win); /* pretend this is parameter */
+#endif
- T((T_CALLED("_nc_freewin(%p)"), win));
+ T((T_CALLED("_nc_freewin(%p)"), (void *) win));
if (win != 0) {
- if (_nc_try_global(curses) == 0) {
+ if (_nc_nonsp_try_global(curses) == 0) {
q = 0;
- for (each_window(p)) {
+ for (each_window(SP_PARM, p)) {
if (&(p->win) == win) {
remove_window_from_screen(win);
if (q == 0)
- _nc_windows = p->next;
+ WindowList(SP_PARM) = p->next;
else
q->next = p->next;
@@ -103,35 +119,39 @@ _nc_freewin(WINDOW *win)
free(p);
result = OK;
- T(("...deleted win=%p", win));
+ T(("...deleted win=%p", (void *) win));
break;
}
q = p;
}
- _nc_unlock_global(curses);
+ _nc_nonsp_unlock_global(curses);
}
}
returnCode(result);
}
NCURSES_EXPORT(WINDOW *)
-newwin(int num_lines, int num_columns, int begy, int begx)
+NCURSES_SP_NAME(newwin) (NCURSES_SP_DCLx
+ int num_lines, int num_columns, int begy, int begx)
{
WINDOW *win;
NCURSES_CH_T *ptr;
int i;
- T((T_CALLED("newwin(%d,%d,%d,%d)"), num_lines, num_columns, begy, begx));
+ T((T_CALLED("newwin(%p, %d,%d,%d,%d)"), (void *) SP_PARM, num_lines, num_columns,
+ begy, begx));
- if (begy < 0 || begx < 0 || num_lines < 0 || num_columns < 0)
+ if (begy < 0 || begx < 0 || num_lines <= 0 || num_columns <= 0)
returnWin(0);
if (num_lines == 0)
- num_lines = SP->_lines_avail - begy;
+ num_lines = SP_PARM->_lines_avail - begy;
if (num_columns == 0)
- num_columns = screen_columns - begx;
+ num_columns = screen_columns(SP_PARM) - begx;
- if ((win = _nc_makenew(num_lines, num_columns, begy, begx, 0)) == 0)
+ win = NCURSES_SP_NAME(_nc_makenew) (NCURSES_SP_ARGx
+ num_lines, num_columns, begy, begx, 0);
+ if (win == 0)
returnWin(0);
for (i = 0; i < num_lines; i++) {
@@ -149,20 +169,36 @@ newwin(int num_lines, int num_columns, int begy, int begx)
returnWin(win);
}
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(WINDOW *)
+newwin(int num_lines, int num_columns, int begy, int begx)
+{
+ WINDOW *win;
+ _nc_sp_lock_global(curses);
+ win = NCURSES_SP_NAME(newwin) (CURRENT_SCREEN,
+ num_lines, num_columns, begy, begx);
+ _nc_sp_unlock_global(curses);
+ return (win);
+}
+#endif
+
NCURSES_EXPORT(WINDOW *)
derwin(WINDOW *orig, int num_lines, int num_columns, int begy, int begx)
{
WINDOW *win;
int i;
int flags = _SUBWIN;
+#if NCURSES_SP_FUNCS
+ SCREEN *sp = _nc_screen_of(orig);
+#endif
- T((T_CALLED("derwin(%p,%d,%d,%d,%d)"), orig, num_lines, num_columns,
+ T((T_CALLED("derwin(%p,%d,%d,%d,%d)"), (void *) orig, num_lines, num_columns,
begy, begx));
/*
* make sure window fits inside the original one
*/
- if (begy < 0 || begx < 0 || orig == 0 || num_lines < 0 || num_columns < 0)
+ if (begy < 0 || begx < 0 || orig == 0 || num_lines <= 0 || num_columns <= 0)
returnWin(0);
if (begy + num_lines > orig->_maxy + 1
|| begx + num_columns > orig->_maxx + 1)
@@ -177,8 +213,10 @@ derwin(WINDOW *orig, int num_lines, int num_columns, int begy, int begx)
if (orig->_flags & _ISPAD)
flags |= _ISPAD;
- if ((win = _nc_makenew(num_lines, num_columns, orig->_begy + begy,
- orig->_begx + begx, flags)) == 0)
+ win = NCURSES_SP_NAME(_nc_makenew) (NCURSES_SP_ARGx num_lines, num_columns,
+ orig->_begy + begy,
+ orig->_begx + begx, flags);
+ if (win == 0)
returnWin(0);
win->_pary = begy;
@@ -197,7 +235,7 @@ derwin(WINDOW *orig, int num_lines, int num_columns, int begy, int begx)
NCURSES_EXPORT(WINDOW *)
subwin(WINDOW *w, int l, int c, int y, int x)
{
- T((T_CALLED("subwin(%p, %d, %d, %d, %d)"), w, l, c, y, x));
+ T((T_CALLED("subwin(%p, %d, %d, %d, %d)"), (void *) w, l, c, y, x));
T(("parent has begy = %ld, begx = %ld", (long) w->_begy, (long) w->_begx));
returnWin(derwin(w, l, c, y - w->_begy, x - w->_begx));
@@ -206,21 +244,27 @@ subwin(WINDOW *w, int l, int c, int y, int x)
static bool
dimension_limit(int value)
{
- NCURSES_SIZE_T test = value;
+ NCURSES_SIZE_T test = (NCURSES_SIZE_T) value;
return (test == value && value > 0);
}
NCURSES_EXPORT(WINDOW *)
-_nc_makenew(int num_lines, int num_columns, int begy, int begx, int flags)
+NCURSES_SP_NAME(_nc_makenew) (NCURSES_SP_DCLx
+ int num_lines,
+ int num_columns,
+ int begy,
+ int begx,
+ int flags)
{
int i;
WINDOWLIST *wp;
WINDOW *win;
- bool is_pad = (flags & _ISPAD);
+ bool is_padwin = (flags & _ISPAD);
- T((T_CALLED("_nc_makenew(%d,%d,%d,%d)"), num_lines, num_columns, begy, begx));
+ T((T_CALLED("_nc_makenew(%p,%d,%d,%d,%d)"),
+ (void *) SP_PARM, num_lines, num_columns, begy, begx));
- if (SP == 0)
+ if (SP_PARM == 0)
returnWin(0);
if (!dimension_limit(num_lines) || !dimension_limit(num_columns))
@@ -232,26 +276,28 @@ _nc_makenew(int num_lines, int num_columns, int begy, int begx, int flags)
win = &(wp->win);
if ((win->_line = typeCalloc(struct ldat, ((unsigned) num_lines))) == 0) {
- free(win);
+ free(wp);
returnWin(0);
}
- _nc_lock_global(curses);
+ _nc_nonsp_lock_global(curses);
win->_curx = 0;
win->_cury = 0;
- win->_maxy = num_lines - 1;
- win->_maxx = num_columns - 1;
- win->_begy = begy;
- win->_begx = begx;
- win->_yoffset = SP->_topstolen;
+ win->_maxy = (NCURSES_SIZE_T) (num_lines - 1);
+ win->_maxx = (NCURSES_SIZE_T) (num_columns - 1);
+ win->_begy = (NCURSES_SIZE_T) begy;
+ win->_begx = (NCURSES_SIZE_T) begx;
+ win->_yoffset = SP_PARM->_topstolen;
- win->_flags = flags;
+ win->_flags = (short) flags;
WINDOW_ATTRS(win) = A_NORMAL;
SetChar(win->_nc_bkgd, BLANK_TEXT, BLANK_ATTR);
- win->_clear = is_pad ? FALSE : (num_lines == screen_lines
- && num_columns == screen_columns);
+ win->_clear = (is_padwin
+ ? FALSE
+ : (num_lines == screen_lines(SP_PARM)
+ && num_columns == screen_columns(SP_PARM)));
win->_idlok = FALSE;
win->_idcok = TRUE;
win->_scroll = FALSE;
@@ -265,7 +311,7 @@ _nc_makenew(int num_lines, int num_columns, int begy, int begx, int flags)
win->_parent = 0;
win->_regtop = 0;
- win->_regbottom = num_lines - 1;
+ win->_regbottom = (NCURSES_SIZE_T) (num_lines - 1);
win->_pad._pad_y = -1;
win->_pad._pad_x = -1;
@@ -295,28 +341,28 @@ _nc_makenew(int num_lines, int num_columns, int begy, int begx, int flags)
* So that's how we want ncurses to behave.
*/
win->_line[i].firstchar = 0;
- win->_line[i].lastchar = num_columns - 1;
+ win->_line[i].lastchar = (NCURSES_SIZE_T) (num_columns - 1);
if_USE_SCROLL_HINTS(win->_line[i].oldindex = i);
}
- if (!is_pad && (begx + num_columns == screen_columns)) {
+ if (!is_padwin && (begx + num_columns == screen_columns(SP_PARM))) {
win->_flags |= _ENDLINE;
- if (begx == 0 && num_lines == screen_lines && begy == 0)
+ if (begx == 0 && num_lines == screen_lines(SP_PARM) && begy == 0)
win->_flags |= _FULLWIN;
- if (begy + num_lines == screen_lines)
+ if (begy + num_lines == screen_lines(SP_PARM))
win->_flags |= _SCROLLWIN;
}
- wp->next = _nc_windows;
- wp->screen = SP;
- _nc_windows = wp;
+ wp->next = WindowList(SP_PARM);
+ wp->screen = SP_PARM;
+ WindowList(SP_PARM) = wp;
- T((T_CREATE("window %p"), win));
+ T((T_CREATE("window %p"), (void *) win));
- _nc_unlock_global(curses);
+ _nc_nonsp_unlock_global(curses);
returnWin(win);
}
@@ -325,14 +371,22 @@ _nc_makenew(int num_lines, int num_columns, int begy, int begx, int flags)
* internally, and it is useful to allow those to be invoked without switching
* SCREEN's, e.g., for multi-threaded applications.
*/
-NCURSES_EXPORT(SCREEN *)
-_nc_screen_of(WINDOW *win)
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(WINDOW *)
+_nc_curscr_of(SCREEN *sp)
{
- SCREEN *sp = 0;
+ return sp == 0 ? 0 : CurScreen(sp);
+}
- if (win != 0) {
- WINDOWLIST *wp = (WINDOWLIST *) win;
- sp = wp->screen;
- }
- return (sp);
+NCURSES_EXPORT(WINDOW *)
+_nc_newscr_of(SCREEN *sp)
+{
+ return sp == 0 ? 0 : NewScreen(sp);
+}
+
+NCURSES_EXPORT(WINDOW *)
+_nc_stdscr_of(SCREEN *sp)
+{
+ return sp == 0 ? 0 : StdScreen(sp);
}
+#endif
diff --git a/ncurses/base/lib_nl.c b/ncurses/base/lib_nl.c
index 32515da0be81..34254871c985 100644
--- a/ncurses/base/lib_nl.c
+++ b/ncurses/base/lib_nl.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,1999,2000 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 <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ * and: Thomas E. Dickey 1996-on *
+ * and: Juergen Pfeifer 2009 *
****************************************************************************/
/*
@@ -42,38 +44,52 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_nl.c,v 1.8 2000/12/10 02:43:27 tom Exp $")
+MODULE_ID("$Id: lib_nl.c,v 1.12 2009/10/24 22:05:55 tom Exp $")
#ifdef __EMX__
#include <io.h>
#endif
NCURSES_EXPORT(int)
-nl(void)
+NCURSES_SP_NAME(nl) (NCURSES_SP_DCL0)
{
- T((T_CALLED("nl()")));
-
- SP->_nl = TRUE;
-
+ T((T_CALLED("nl(%p)"), (void *) SP_PARM));
+ if (0 == SP_PARM)
+ returnCode(ERR);
+ SP_PARM->_nl = TRUE;
#ifdef __EMX__
_nc_flush();
- _fsetmode(NC_OUTPUT, "t");
+ _fsetmode(NC_OUTPUT(SP_PARM), "t");
#endif
-
returnCode(OK);
}
+#if NCURSES_SP_FUNCS
NCURSES_EXPORT(int)
-nonl(void)
+nl(void)
{
- T((T_CALLED("nonl()")));
-
- SP->_nl = FALSE;
+ return NCURSES_SP_NAME(nl) (CURRENT_SCREEN);
+}
+#endif
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(nonl) (NCURSES_SP_DCL0)
+{
+ T((T_CALLED("nonl(%p)"), (void *) SP_PARM));
+ if (0 == SP_PARM)
+ returnCode(ERR);
+ SP_PARM->_nl = FALSE;
#ifdef __EMX__
_nc_flush();
- _fsetmode(NC_OUTPUT, "b");
+ _fsetmode(NC_OUTPUT(SP_PARM), "b");
#endif
-
returnCode(OK);
}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+nonl(void)
+{
+ return NCURSES_SP_NAME(nonl) (CURRENT_SCREEN);
+}
+#endif
diff --git a/ncurses/base/lib_overlay.c b/ncurses/base/lib_overlay.c
index 669e8e72c07f..bfb817bc3108 100644
--- a/ncurses/base/lib_overlay.c
+++ b/ncurses/base/lib_overlay.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 *
@@ -40,7 +40,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_overlay.c,v 1.27 2008/06/07 23:30:34 tom Exp $")
+MODULE_ID("$Id: lib_overlay.c,v 1.29 2009/10/24 23:21:31 tom Exp $")
static int
overlap(const WINDOW *const src, WINDOW *const dst, int const flag)
@@ -52,7 +52,7 @@ overlap(const WINDOW *const src, WINDOW *const dst, int const flag)
int dminrow, dmincol;
int dmaxrow, dmaxcol;
- T((T_CALLED("overlap(%p,%p,%d)"), src, dst, flag));
+ T((T_CALLED("overlap(%p,%p,%d)"), (const void *) src, (void *) dst, flag));
if (src != 0 && dst != 0) {
_nc_lock_global(curses);
@@ -110,7 +110,7 @@ overlap(const WINDOW *const src, WINDOW *const dst, int const flag)
NCURSES_EXPORT(int)
overlay(const WINDOW *win1, WINDOW *win2)
{
- T((T_CALLED("overlay(%p,%p)"), win1, win2));
+ T((T_CALLED("overlay(%p,%p)"), (const void *) win1, (void *) win2));
returnCode(overlap(win1, win2, TRUE));
}
@@ -127,7 +127,7 @@ overlay(const WINDOW *win1, WINDOW *win2)
NCURSES_EXPORT(int)
overwrite(const WINDOW *win1, WINDOW *win2)
{
- T((T_CALLED("overwrite(%p,%p)"), win1, win2));
+ T((T_CALLED("overwrite(%p,%p)"), (const void *) win1, (void *) win2));
returnCode(overlap(win1, win2, FALSE));
}
@@ -145,7 +145,11 @@ copywin(const WINDOW *src, WINDOW *dst,
attr_t mask;
T((T_CALLED("copywin(%p, %p, %d, %d, %d, %d, %d, %d, %d)"),
- src, dst, sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol, over));
+ (const void *) src,
+ (void *) dst,
+ sminrow, smincol,
+ dminrow, dmincol,
+ dmaxrow, dmaxcol, over));
if (src && dst) {
_nc_lock_global(curses);
diff --git a/ncurses/base/lib_pad.c b/ncurses/base/lib_pad.c
index 6cad9c54b064..b87498b500cd 100644
--- a/ncurses/base/lib_pad.c
+++ b/ncurses/base/lib_pad.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2004,2006 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2010 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 <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ * and: Thomas E. Dickey 1996-on *
+ * and: Juergen Pfeifer 2009 *
****************************************************************************/
/*
@@ -40,21 +42,22 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_pad.c,v 1.41 2006/10/14 20:47:13 tom Exp $")
+MODULE_ID("$Id: lib_pad.c,v 1.46 2010/04/24 23:50:45 tom Exp $")
NCURSES_EXPORT(WINDOW *)
-newpad(int l, int c)
+NCURSES_SP_NAME(newpad) (NCURSES_SP_DCLx int l, int c)
{
WINDOW *win;
NCURSES_CH_T *ptr;
int i;
- T((T_CALLED("newpad(%d, %d)"), l, c));
+ T((T_CALLED("newpad(%p,%d, %d)"), (void *) SP_PARM, l, c));
if (l <= 0 || c <= 0)
returnWin(0);
- if ((win = _nc_makenew(l, c, 0, 0, _ISPAD)) == NULL)
+ win = NCURSES_SP_NAME(_nc_makenew) (NCURSES_SP_ARGx l, c, 0, 0, _ISPAD);
+ if (win == NULL)
returnWin(0);
for (i = 0; i < l; i++) {
@@ -70,6 +73,14 @@ newpad(int l, int c)
returnWin(win);
}
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(WINDOW *)
+newpad(int l, int c)
+{
+ return NCURSES_SP_NAME(newpad) (CURRENT_SCREEN, l, c);
+}
+#endif
+
NCURSES_EXPORT(WINDOW *)
subpad(WINDOW *orig, int l, int c, int begy, int begx)
{
@@ -94,10 +105,14 @@ prefresh(WINDOW *win,
int smaxrow,
int smaxcol)
{
+#if NCURSES_SP_FUNCS
+ SCREEN *sp = _nc_screen_of(win);
+#endif
+
T((T_CALLED("prefresh()")));
if (pnoutrefresh(win, pminrow, pmincol, sminrow, smincol, smaxrow,
smaxcol) != ERR
- && doupdate() != ERR) {
+ && NCURSES_SP_NAME(doupdate) (NCURSES_SP_ARG) != ERR) {
returnCode(OK);
}
returnCode(ERR);
@@ -112,10 +127,11 @@ pnoutrefresh(WINDOW *win,
int smaxrow,
int smaxcol)
{
- NCURSES_SIZE_T i, j;
- NCURSES_SIZE_T m, n;
- NCURSES_SIZE_T pmaxrow;
- NCURSES_SIZE_T pmaxcol;
+ int i, j;
+ int m, n;
+ int pmaxrow;
+ int pmaxcol;
+ SCREEN *sp;
#if USE_SCROLL_HINTS
const int my_len = 2; /* parameterize the threshold for hardscroll */
@@ -124,7 +140,7 @@ pnoutrefresh(WINDOW *win,
#endif
T((T_CALLED("pnoutrefresh(%p, %d, %d, %d, %d, %d, %d)"),
- win, pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol));
+ (void *) win, pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol));
if (win == 0)
returnCode(ERR);
@@ -132,6 +148,8 @@ pnoutrefresh(WINDOW *win,
if (!(win->_flags & _ISPAD))
returnCode(ERR);
+ sp = _nc_screen_of(win);
+
/* negative values are interpreted as zero */
if (pminrow < 0)
pminrow = 0;
@@ -162,8 +180,8 @@ pnoutrefresh(WINDOW *win,
pmaxcol = pmincol + smaxcol - smincol;
}
- if (smaxrow >= screen_lines
- || smaxcol >= screen_columns
+ if (smaxrow >= screen_lines(sp)
+ || smaxcol >= screen_columns(sp)
|| sminrow > smaxrow
|| smincol > smaxcol)
returnCode(ERR);
@@ -194,13 +212,13 @@ pnoutrefresh(WINDOW *win,
* merely change the costs of various update cases.
*/
#if USE_SCROLL_HINTS
- wide = (smincol < my_len && smaxcol > (newscr->_maxx - my_len));
+ wide = (smincol < my_len && smaxcol > (NewScreen(sp)->_maxx - my_len));
#endif
for (i = pminrow, m = sminrow + win->_yoffset;
- i <= pmaxrow && m <= newscr->_maxy;
+ i <= pmaxrow && m <= NewScreen(sp)->_maxy;
i++, m++) {
- register struct ldat *nline = &newscr->_line[m];
+ register struct ldat *nline = &NewScreen(sp)->_line[m];
register struct ldat *oline = &win->_line[i];
for (j = pmincol, n = smincol; j <= pmaxcol; j++, n++) {
NCURSES_CH_T ch = oline->text[j];
@@ -229,9 +247,9 @@ pnoutrefresh(WINDOW *win,
|| nind > smaxrow) {
nind = _NEWINDEX;
} else if (displaced) {
- register struct ldat *pline = &curscr->_line[nind];
+ register struct ldat *pline = &CurScreen(sp)->_line[nind];
for (j = 0; j <= my_len; j++) {
- int k = newscr->_maxx - j;
+ int k = NewScreen(sp)->_maxx - j;
if (pline->text[j] != nline->text[j]
|| pline->text[k] != nline->text[k]) {
nind = _NEWINDEX;
@@ -261,12 +279,12 @@ pnoutrefresh(WINDOW *win,
win->_line[i].oldindex = _NEWINDEX;
#endif
- win->_begx = smincol;
- win->_begy = sminrow;
+ win->_begx = (NCURSES_SIZE_T) smincol;
+ win->_begy = (NCURSES_SIZE_T) sminrow;
if (win->_clear) {
win->_clear = FALSE;
- newscr->_clear = TRUE;
+ NewScreen(sp)->_clear = TRUE;
}
/*
@@ -278,10 +296,12 @@ pnoutrefresh(WINDOW *win,
&& win->_curx >= pmincol
&& win->_cury <= pmaxrow
&& win->_curx <= pmaxcol) {
- newscr->_cury = win->_cury - pminrow + win->_begy + win->_yoffset;
- newscr->_curx = win->_curx - pmincol + win->_begx;
+ NewScreen(sp)->_cury = (NCURSES_SIZE_T) (win->_cury - pminrow
+ + win->_begy + win->_yoffset);
+ NewScreen(sp)->_curx = (NCURSES_SIZE_T) (win->_curx - pmincol
+ + win->_begx);
}
- newscr->_leaveok = win->_leaveok;
+ NewScreen(sp)->_leaveok = win->_leaveok;
win->_flags &= ~_HASMOVED;
/*
@@ -289,12 +309,12 @@ pnoutrefresh(WINDOW *win,
* We will use this on subsequent calls to this function to derive
* values to stuff into 'oldindex[]' -- for scrolling optimization.
*/
- win->_pad._pad_y = pminrow;
- win->_pad._pad_x = pmincol;
- win->_pad._pad_top = sminrow;
- win->_pad._pad_left = smincol;
- win->_pad._pad_bottom = smaxrow;
- win->_pad._pad_right = smaxcol;
+ win->_pad._pad_y = (NCURSES_SIZE_T) pminrow;
+ win->_pad._pad_x = (NCURSES_SIZE_T) pmincol;
+ win->_pad._pad_top = (NCURSES_SIZE_T) sminrow;
+ win->_pad._pad_left = (NCURSES_SIZE_T) smincol;
+ win->_pad._pad_bottom = (NCURSES_SIZE_T) smaxrow;
+ win->_pad._pad_right = (NCURSES_SIZE_T) smaxcol;
returnCode(OK);
}
@@ -302,7 +322,7 @@ pnoutrefresh(WINDOW *win,
NCURSES_EXPORT(int)
pechochar(WINDOW *pad, const chtype ch)
{
- T((T_CALLED("pechochar(%p, %s)"), pad, _tracechtype(ch)));
+ T((T_CALLED("pechochar(%p, %s)"), (void *) pad, _tracechtype(ch)));
if (pad == 0)
returnCode(ERR);
diff --git a/ncurses/base/lib_printw.c b/ncurses/base/lib_printw.c
index 62ae921e650d..963181d9a494 100644
--- a/ncurses/base/lib_printw.c
+++ b/ncurses/base/lib_printw.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2003,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 *
@@ -39,7 +39,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_printw.c,v 1.18 2006/12/17 19:21:39 tom Exp $")
+MODULE_ID("$Id: lib_printw.c,v 1.20 2009/10/24 22:07:03 tom Exp $")
NCURSES_EXPORT(int)
printw(const char *fmt,...)
@@ -70,7 +70,7 @@ wprintw(WINDOW *win, const char *fmt,...)
#ifdef TRACE
va_start(argp, fmt);
T((T_CALLED("wprintw(%p,%s%s)"),
- win, _nc_visbuf(fmt), _nc_varargs(fmt, argp)));
+ (void *) win, _nc_visbuf(fmt), _nc_varargs(fmt, argp)));
va_end(argp);
#endif
@@ -111,7 +111,7 @@ mvwprintw(WINDOW *win, int y, int x, const char *fmt,...)
#ifdef TRACE
va_start(argp, fmt);
T((T_CALLED("mvwprintw(%d,%d,%p,%s%s)"),
- y, x, win, _nc_visbuf(fmt), _nc_varargs(fmt, argp)));
+ y, x, (void *) win, _nc_visbuf(fmt), _nc_varargs(fmt, argp)));
va_end(argp);
#endif
@@ -128,10 +128,14 @@ vwprintw(WINDOW *win, const char *fmt, va_list argp)
{
char *buf;
int code = ERR;
+#if NCURSES_SP_FUNCS
+ SCREEN *sp = _nc_screen_of(win);
+#endif
- T((T_CALLED("vwprintw(%p,%s,va_list)"), win, _nc_visbuf(fmt)));
+ T((T_CALLED("vwprintw(%p,%s,va_list)"), (void *) win, _nc_visbuf(fmt)));
- if ((buf = _nc_printf_string(fmt, argp)) != 0) {
+ buf = NCURSES_SP_NAME(_nc_printf_string) (NCURSES_SP_ARGx fmt, argp);
+ if (buf != 0) {
code = waddstr(win, buf);
}
returnCode(code);
diff --git a/ncurses/base/lib_redrawln.c b/ncurses/base/lib_redrawln.c
index 6b0905f07d67..72905f84d656 100644
--- a/ncurses/base/lib_redrawln.c
+++ b/ncurses/base/lib_redrawln.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2010 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 *
@@ -39,7 +39,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_redrawln.c,v 1.12 2007/10/13 20:08:56 tom Exp $")
+MODULE_ID("$Id: lib_redrawln.c,v 1.17 2010/12/19 00:03:23 tom Exp $")
NCURSES_EXPORT(int)
wredrawln(WINDOW *win, int beg, int num)
@@ -47,37 +47,40 @@ wredrawln(WINDOW *win, int beg, int num)
int i;
int end;
size_t len;
+ SCREEN *sp;
- T((T_CALLED("wredrawln(%p,%d,%d)"), win, beg, num));
+ T((T_CALLED("wredrawln(%p,%d,%d)"), (void *) win, beg, num));
if (win == 0)
returnCode(ERR);
+ sp = _nc_screen_of(win);
+
if (beg < 0)
beg = 0;
if (touchline(win, beg, num) == ERR)
returnCode(ERR);
- if (touchline(curscr, beg + win->_begy, num) == ERR)
+ if (touchline(CurScreen(sp), beg + win->_begy, num) == ERR)
returnCode(ERR);
end = beg + num;
- if (end > curscr->_maxy + 1)
- end = curscr->_maxy + 1;
+ if (end > CurScreen(sp)->_maxy + 1 - win->_begy)
+ end = CurScreen(sp)->_maxy + 1 - win->_begy;
if (end > win->_maxy + 1)
end = win->_maxy + 1;
- len = (win->_maxx + 1);
- if (len > (size_t) (curscr->_maxx + 1))
- len = (size_t) (curscr->_maxx + 1);
- len *= sizeof(curscr->_line[0].text[0]);
+ len = (size_t) (win->_maxx + 1);
+ if (len > (size_t) (CurScreen(sp)->_maxx + 1 - win->_begx))
+ len = (size_t) (CurScreen(sp)->_maxx + 1 - win->_begx);
+ len *= sizeof(CurScreen(sp)->_line[0].text[0]);
for (i = beg; i < end; i++) {
int crow = i + win->_begy;
- memset(curscr->_line[crow].text + win->_begx, 0, len);
- _nc_make_oldhash(crow);
+ memset(CurScreen(sp)->_line[crow].text + win->_begx, 0, len);
+ NCURSES_SP_NAME(_nc_make_oldhash) (NCURSES_SP_ARGx crow);
}
returnCode(OK);
diff --git a/ncurses/base/lib_refresh.c b/ncurses/base/lib_refresh.c
index 2a9cafb7b0ad..8c02086a707d 100644
--- a/ncurses/base/lib_refresh.c
+++ b/ncurses/base/lib_refresh.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -30,6 +30,7 @@
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
* and: Thomas E. Dickey 1996-on *
+ * and: Juergen Pfeifer *
****************************************************************************/
/*
@@ -41,24 +42,27 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_refresh.c,v 1.41 2007/09/29 20:39:34 tom Exp $")
+MODULE_ID("$Id: lib_refresh.c,v 1.44 2010/12/19 01:22:58 tom Exp $")
NCURSES_EXPORT(int)
wrefresh(WINDOW *win)
{
int code;
+#if NCURSES_SP_FUNCS
+ SCREEN *SP_PARM = _nc_screen_of(win);
+#endif
- T((T_CALLED("wrefresh(%p)"), win));
+ T((T_CALLED("wrefresh(%p)"), (void *) win));
if (win == 0) {
code = ERR;
- } else if (win == curscr) {
- curscr->_clear = TRUE;
- code = doupdate();
+ } else if (win == CurScreen(SP_PARM)) {
+ CurScreen(SP_PARM)->_clear = TRUE;
+ code = NCURSES_SP_NAME(doupdate) (NCURSES_SP_ARG);
} else if ((code = wnoutrefresh(win)) == OK) {
if (win->_clear)
- newscr->_clear = TRUE;
- code = doupdate();
+ NewScreen(SP_PARM)->_clear = TRUE;
+ code = NCURSES_SP_NAME(doupdate) (NCURSES_SP_ARG);
/*
* Reset the clearok() flag in case it was set for the special
* case in hardscroll.c (if we don't reset it here, we'll get 2
@@ -73,16 +77,19 @@ wrefresh(WINDOW *win)
NCURSES_EXPORT(int)
wnoutrefresh(WINDOW *win)
{
- NCURSES_SIZE_T limit_x;
- NCURSES_SIZE_T src_row, src_col;
- NCURSES_SIZE_T begx;
- NCURSES_SIZE_T begy;
- NCURSES_SIZE_T dst_row, dst_col;
+ int limit_x;
+ int src_row, src_col;
+ int begx;
+ int begy;
+ int dst_row, dst_col;
#if USE_SCROLL_HINTS
bool wide;
#endif
+#if NCURSES_SP_FUNCS
+ SCREEN *SP_PARM = _nc_screen_of(win);
+#endif
- T((T_CALLED("wnoutrefresh(%p)"), win));
+ T((T_CALLED("wnoutrefresh(%p)"), (void *) win));
#ifdef TRACE
if (USE_TRACEF(TRACE_UPDATE)) {
_tracedump("...win", win);
@@ -101,8 +108,8 @@ wnoutrefresh(WINDOW *win)
begx = win->_begx;
begy = win->_begy;
- newscr->_nc_bkgd = win->_nc_bkgd;
- WINDOW_ATTRS(newscr) = WINDOW_ATTRS(win);
+ NewScreen(SP_PARM)->_nc_bkgd = win->_nc_bkgd;
+ WINDOW_ATTRS(NewScreen(SP_PARM)) = WINDOW_ATTRS(win);
/* merge in change information from all subwindows of this window */
wsyncdown(win);
@@ -122,7 +129,7 @@ wnoutrefresh(WINDOW *win)
* windows). Note that changing this formula will not break any code,
* merely change the costs of various update cases.
*/
- wide = (begx <= 1 && win->_maxx >= (newscr->_maxx - 1));
+ wide = (begx <= 1 && win->_maxx >= (NewScreen(SP_PARM)->_maxx - 1));
#endif
win->_flags &= ~_HASMOVED;
@@ -137,14 +144,14 @@ wnoutrefresh(WINDOW *win)
/* limit(dst_col) */
limit_x = win->_maxx;
/* limit(src_col) */
- if (limit_x > newscr->_maxx - begx)
- limit_x = newscr->_maxx - begx;
+ if (limit_x > NewScreen(SP_PARM)->_maxx - begx)
+ limit_x = NewScreen(SP_PARM)->_maxx - begx;
for (src_row = 0, dst_row = begy + win->_yoffset;
- src_row <= win->_maxy && dst_row <= newscr->_maxy;
+ src_row <= win->_maxy && dst_row <= NewScreen(SP_PARM)->_maxy;
src_row++, dst_row++) {
- register struct ldat *nline = &newscr->_line[dst_row];
- register struct ldat *oline = &win->_line[src_row];
+ struct ldat *nline = &(NewScreen(SP_PARM)->_line[dst_row]);
+ struct ldat *oline = &win->_line[src_row];
if (oline->firstchar != _NOCHANGE) {
int last_src = oline->lastchar;
@@ -156,7 +163,7 @@ wnoutrefresh(WINDOW *win)
dst_col = src_col + begx;
if_WIDEC({
- register int j;
+ int j;
/*
* Ensure that we will copy complete multi-column characters
@@ -197,7 +204,7 @@ wnoutrefresh(WINDOW *win)
: win->_maxx);
int fix_left = dst_col;
int fix_right = last_dst;
- register int j;
+ int j;
/*
* Check for boundary cases where we may overwrite part of a
@@ -225,7 +232,8 @@ wnoutrefresh(WINDOW *win)
* this character. Find the end of the character.
*/
++j;
- while (j <= newscr->_maxx && isWidecExt(nline->text[j])) {
+ while (j <= NewScreen(SP_PARM)->_maxx &&
+ isWidecExt(nline->text[j])) {
fix_right = j++;
}
}
@@ -269,18 +277,19 @@ wnoutrefresh(WINDOW *win)
if (win->_clear) {
win->_clear = FALSE;
- newscr->_clear = TRUE;
+ NewScreen(SP_PARM)->_clear = TRUE;
}
if (!win->_leaveok) {
- newscr->_cury = win->_cury + win->_begy + win->_yoffset;
- newscr->_curx = win->_curx + win->_begx;
+ NewScreen(SP_PARM)->_cury = (NCURSES_SIZE_T) (win->_cury +
+ win->_begy + win->_yoffset);
+ NewScreen(SP_PARM)->_curx = (NCURSES_SIZE_T) (win->_curx + win->_begx);
}
- newscr->_leaveok = win->_leaveok;
+ NewScreen(SP_PARM)->_leaveok = win->_leaveok;
#ifdef TRACE
if (USE_TRACEF(TRACE_UPDATE)) {
- _tracedump("newscr", newscr);
+ _tracedump("newscr", NewScreen(SP_PARM));
_nc_unlock_global(tracef);
}
#endif /* TRACE */
diff --git a/ncurses/base/lib_restart.c b/ncurses/base/lib_restart.c
index da770d4e7c92..b28cfd1f2ffd 100644
--- a/ncurses/base/lib_restart.c
+++ b/ncurses/base/lib_restart.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 *
@@ -30,6 +30,7 @@
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
* and: Thomas E. Dickey 1996-on *
+ * and: Juergen Pfeifer 2008 *
****************************************************************************/
/*
@@ -44,49 +45,62 @@
#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.13 2009/10/24 22:47:43 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;
+#ifdef USE_TERM_DRIVER
+ TERMINAL *new_term;
+#endif
- T((T_CALLED("restartterm(%s,%d,%p)"), termp, filenum, errret));
+ T((T_CALLED("restartterm(%p,%s,%d,%p)"),
+ (void *) SP_PARM,
+ termp,
+ filenum,
+ (void *) errret));
- if (setupterm(termp, filenum, errret) != OK) {
+ if (TINFO_SETUP_TERM(&new_term, termp, filenum, errret, FALSE) != 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();
+#ifdef USE_TERM_DRIVER
+ SP_PARM->_term = new_term;
+#endif
+ 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;
@@ -95,3 +109,11 @@ restartterm(NCURSES_CONST char *termp, int filenum, int *errret)
}
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
diff --git a/ncurses/base/lib_scanw.c b/ncurses/base/lib_scanw.c
index b8a5a227a1a9..a8621e63e172 100644
--- a/ncurses/base/lib_scanw.c
+++ b/ncurses/base/lib_scanw.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2001,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 *
@@ -40,7 +40,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_scanw.c,v 1.11 2001/06/30 23:39:41 tom Exp $")
+MODULE_ID("$Id: lib_scanw.c,v 1.12 2009/10/24 22:35:14 tom Exp $")
NCURSES_EXPORT(int)
vwscanw(WINDOW *win, NCURSES_CONST char *fmt, va_list argp)
@@ -73,7 +73,7 @@ wscanw(WINDOW *win, NCURSES_CONST char *fmt,...)
int code;
va_list ap;
- T(("wscanw(%p,\"%s\",...) called", win, fmt));
+ T(("wscanw(%p,\"%s\",...) called", (void *) win, fmt));
va_start(ap, fmt);
code = vwscanw(win, fmt, ap);
diff --git a/ncurses/base/lib_screen.c b/ncurses/base/lib_screen.c
index 4aa58ea2a19c..27212b790611 100644
--- a/ncurses/base/lib_screen.c
+++ b/ncurses/base/lib_screen.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 *
@@ -30,35 +30,45 @@
* 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 2009 *
****************************************************************************/
#include <curses.priv.h>
-MODULE_ID("$Id: lib_screen.c,v 1.31 2008/08/16 19:05:37 tom Exp $")
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
+MODULE_ID("$Id: lib_screen.c,v 1.38 2009/10/24 22:08:55 tom Exp $")
#define MAX_SIZE 0x3fff /* 16k is big enough for a window or pad */
NCURSES_EXPORT(WINDOW *)
-getwin(FILE *filep)
+NCURSES_SP_NAME(getwin) (NCURSES_SP_DCLx FILE *filep)
{
WINDOW tmp, *nwin;
int n;
- T((T_CALLED("getwin(%p)"), filep));
+ T((T_CALLED("getwin(%p)"), (void *) filep));
clearerr(filep);
- (void) fread(&tmp, sizeof(WINDOW), 1, filep);
- if (ferror(filep)
+ if (fread(&tmp, 1, sizeof(WINDOW), filep) < sizeof(WINDOW)
+ || ferror(filep)
|| tmp._maxy == 0
|| tmp._maxy > MAX_SIZE
|| tmp._maxx == 0
- || tmp._maxx > MAX_SIZE)
+ || tmp._maxx > MAX_SIZE) {
returnWin(0);
+ }
if (tmp._flags & _ISPAD) {
- nwin = newpad(tmp._maxy + 1, tmp._maxx + 1);
+ nwin = NCURSES_SP_NAME(newpad) (NCURSES_SP_ARGx
+ tmp._maxy + 1,
+ tmp._maxx + 1);
} else {
- nwin = newwin(tmp._maxy + 1, tmp._maxx + 1, 0, 0);
+ nwin = NCURSES_SP_NAME(newwin) (NCURSES_SP_ARGx
+ tmp._maxy + 1,
+ tmp._maxx + 1, 0, 0);
}
/*
@@ -67,6 +77,8 @@ getwin(FILE *filep)
* made sense is probably gone.
*/
if (nwin != 0) {
+ size_t linesize = sizeof(NCURSES_CH_T) * (size_t) (tmp._maxx + 1);
+
nwin->_curx = tmp._curx;
nwin->_cury = tmp._cury;
nwin->_maxy = tmp._maxy;
@@ -98,11 +110,8 @@ getwin(FILE *filep)
for (n = 0; n <= nwin->_maxy; n++) {
clearerr(filep);
- (void) fread(nwin->_line[n].text,
- sizeof(NCURSES_CH_T),
- (size_t) (nwin->_maxx + 1),
- filep);
- if (ferror(filep)) {
+ if (fread(nwin->_line[n].text, 1, linesize, filep) < linesize
+ || ferror(filep)) {
delwin(nwin);
returnWin(0);
}
@@ -112,13 +121,21 @@ getwin(FILE *filep)
returnWin(nwin);
}
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(WINDOW *)
+getwin(FILE *filep)
+{
+ return NCURSES_SP_NAME(getwin) (CURRENT_SCREEN, filep);
+}
+#endif
+
NCURSES_EXPORT(int)
putwin(WINDOW *win, FILE *filep)
{
int code = ERR;
int n;
- T((T_CALLED("putwin(%p,%p)"), win, filep));
+ T((T_CALLED("putwin(%p,%p)"), (void *) win, (void *) filep));
if (win != 0) {
size_t len = (size_t) (win->_maxx + 1);
@@ -141,26 +158,34 @@ putwin(WINDOW *win, FILE *filep)
}
NCURSES_EXPORT(int)
-scr_restore(const char *file)
+NCURSES_SP_NAME(scr_restore) (NCURSES_SP_DCLx const char *file)
{
FILE *fp = 0;
- T((T_CALLED("scr_restore(%s)"), _nc_visbuf(file)));
+ T((T_CALLED("scr_restore(%p,%s)"), (void *) SP_PARM, _nc_visbuf(file)));
if (_nc_access(file, R_OK) < 0
|| (fp = fopen(file, "rb")) == 0) {
returnCode(ERR);
} else {
- delwin(newscr);
- SP->_newscr = getwin(fp);
+ delwin(NewScreen(SP_PARM));
+ NewScreen(SP_PARM) = getwin(fp);
#if !USE_REENTRANT
- newscr = SP->_newscr;
+ newscr = NewScreen(SP_PARM);
#endif
(void) fclose(fp);
returnCode(OK);
}
}
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+scr_restore(const char *file)
+{
+ return NCURSES_SP_NAME(scr_restore) (CURRENT_SCREEN, file);
+}
+#endif
+
NCURSES_EXPORT(int)
scr_dump(const char *file)
{
@@ -179,42 +204,63 @@ scr_dump(const char *file)
}
NCURSES_EXPORT(int)
-scr_init(const char *file)
+NCURSES_SP_NAME(scr_init) (NCURSES_SP_DCLx const char *file)
{
FILE *fp = 0;
+ int code = ERR;
- T((T_CALLED("scr_init(%s)"), _nc_visbuf(file)));
-
- if (exit_ca_mode && non_rev_rmcup)
- returnCode(ERR);
+ T((T_CALLED("scr_init(%p,%s)"), (void *) SP_PARM, _nc_visbuf(file)));
- if (_nc_access(file, R_OK) < 0
- || (fp = fopen(file, "rb")) == 0) {
- returnCode(ERR);
- } else {
- delwin(curscr);
- SP->_curscr = getwin(fp);
+ if (SP_PARM != 0 &&
+#ifdef USE_TERM_DRIVER
+ InfoOf(SP_PARM).caninit
+#else
+ !(exit_ca_mode && non_rev_rmcup)
+#endif
+ ) {
+ if (_nc_access(file, R_OK) >= 0
+ && (fp = fopen(file, "rb")) != 0) {
+ delwin(CurScreen(SP_PARM));
+ CurScreen(SP_PARM) = getwin(fp);
#if !USE_REENTRANT
- curscr = SP->_curscr;
+ curscr = CurScreen(SP_PARM);
#endif
- (void) fclose(fp);
- returnCode(OK);
+ (void) fclose(fp);
+ code = OK;
+ }
}
+ returnCode(code);
}
+#if NCURSES_SP_FUNCS
NCURSES_EXPORT(int)
-scr_set(const char *file)
+scr_init(const char *file)
{
- T((T_CALLED("scr_set(%s)"), _nc_visbuf(file)));
+ return NCURSES_SP_NAME(scr_init) (CURRENT_SCREEN, file);
+}
+#endif
+
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(scr_set) (NCURSES_SP_DCLx const char *file)
+{
+ T((T_CALLED("scr_set(%p,%s)"), (void *) SP_PARM, _nc_visbuf(file)));
- if (scr_init(file) == ERR) {
+ if (NCURSES_SP_NAME(scr_init) (NCURSES_SP_ARGx file) == ERR) {
returnCode(ERR);
} else {
- delwin(newscr);
- SP->_newscr = dupwin(curscr);
+ delwin(NewScreen(SP_PARM));
+ NewScreen(SP_PARM) = dupwin(curscr);
#if !USE_REENTRANT
- newscr = SP->_newscr;
+ newscr = NewScreen(SP_PARM);
#endif
returnCode(OK);
}
}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+scr_set(const char *file)
+{
+ return NCURSES_SP_NAME(scr_set) (CURRENT_SCREEN, file);
+}
+#endif
diff --git a/ncurses/base/lib_scroll.c b/ncurses/base/lib_scroll.c
index ac85bd55ea1d..fe4e80804dae 100644
--- a/ncurses/base/lib_scroll.c
+++ b/ncurses/base/lib_scroll.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2004,2006 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2010 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 *
@@ -43,7 +43,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_scroll.c,v 1.26 2006/10/14 20:46:08 tom Exp $")
+MODULE_ID("$Id: lib_scroll.c,v 1.28 2010/12/19 01:48:09 tom Exp $")
NCURSES_EXPORT(void)
_nc_scroll_window(WINDOW *win,
@@ -55,10 +55,10 @@ _nc_scroll_window(WINDOW *win,
int limit;
int line;
int j;
- size_t to_copy = (size_t) (sizeof(NCURSES_CH_T) * (win->_maxx + 1));
+ size_t to_copy = (sizeof(NCURSES_CH_T) * (size_t) (win->_maxx + 1));
TR(TRACE_MOVE, ("_nc_scroll_window(%p, %d, %ld, %ld)",
- win, n, (long) top, (long) bottom));
+ (void *) win, n, (long) top, (long) bottom));
if (top < 0
|| bottom < top
@@ -135,7 +135,7 @@ _nc_scroll_window(WINDOW *win,
NCURSES_EXPORT(int)
wscrl(WINDOW *win, int n)
{
- T((T_CALLED("wscrl(%p,%d)"), win, n));
+ T((T_CALLED("wscrl(%p,%d)"), (void *) win, n));
if (!win || !win->_scroll) {
TR(TRACE_MOVE, ("...scrollok is false"));
diff --git a/ncurses/base/lib_scrollok.c b/ncurses/base/lib_scrollok.c
index f6b30259be73..6a698a368da2 100644
--- a/ncurses/base/lib_scrollok.c
+++ b/ncurses/base/lib_scrollok.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2000,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 *
@@ -40,12 +40,12 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_scrollok.c,v 1.4 2000/12/10 02:43:27 tom Exp $")
+MODULE_ID("$Id: lib_scrollok.c,v 1.5 2009/10/24 22:35:38 tom Exp $")
NCURSES_EXPORT(int)
scrollok(WINDOW *win, bool flag)
{
- T((T_CALLED("scrollok(%p,%d)"), win, flag));
+ T((T_CALLED("scrollok(%p,%d)"), (void *) win, flag));
if (win) {
win->_scroll = flag;
diff --git a/ncurses/base/lib_scrreg.c b/ncurses/base/lib_scrreg.c
index c85d60f1164d..546fbc183a3c 100644
--- a/ncurses/base/lib_scrreg.c
+++ b/ncurses/base/lib_scrreg.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2000,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 *
@@ -40,12 +40,12 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_scrreg.c,v 1.10 2000/12/10 02:43:27 tom Exp $")
+MODULE_ID("$Id: lib_scrreg.c,v 1.11 2009/10/24 22:35:28 tom Exp $")
NCURSES_EXPORT(int)
wsetscrreg(WINDOW *win, int top, int bottom)
{
- T((T_CALLED("wsetscrreg(%p,%d,%d)"), win, top, bottom));
+ T((T_CALLED("wsetscrreg(%p,%d,%d)"), (void *) win, top, bottom));
if (win &&
top >= 0 && top <= win->_maxy &&
diff --git a/ncurses/base/lib_set_term.c b/ncurses/base/lib_set_term.c
index aff432bb9fd1..df0a276aef8a 100644
--- a/ncurses/base/lib_set_term.c
+++ b/ncurses/base/lib_set_term.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -30,6 +30,7 @@
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
* and: Thomas E. Dickey 1996-on *
+ * and: Juergen Pfeifer 2009 *
****************************************************************************/
/*
@@ -40,11 +41,21 @@
*/
#include <curses.priv.h>
-
-#include <term.h> /* cur_term */
#include <tic.h>
-MODULE_ID("$Id: lib_set_term.c,v 1.117 2008/08/04 18:11:12 tom Exp $")
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
+MODULE_ID("$Id: lib_set_term.c,v 1.138 2010/12/20 00:42:20 tom Exp $")
+
+#ifdef USE_TERM_DRIVER
+#define MaxColors InfoOf(sp).maxcolors
+#define NumLabels InfoOf(sp).numlabels
+#else
+#define MaxColors max_colors
+#define NumLabels num_labels
+#endif
NCURSES_EXPORT(SCREEN *)
set_term(SCREEN *screenp)
@@ -52,25 +63,25 @@ set_term(SCREEN *screenp)
SCREEN *oldSP;
SCREEN *newSP;
- T((T_CALLED("set_term(%p)"), screenp));
+ T((T_CALLED("set_term(%p)"), (void *) screenp));
_nc_lock_global(curses);
- oldSP = SP;
+ oldSP = CURRENT_SCREEN;
_nc_set_screen(screenp);
- newSP = SP;
+ newSP = screenp;
if (newSP != 0) {
- set_curterm(newSP->_term);
+ TINFO_SET_CURTERM(newSP, newSP->_term);
#if !USE_REENTRANT
- curscr = newSP->_curscr;
- newscr = newSP->_newscr;
- stdscr = newSP->_stdscr;
+ curscr = CurScreen(newSP);
+ newscr = NewScreen(newSP);
+ stdscr = StdScreen(newSP);
COLORS = newSP->_color_count;
COLOR_PAIRS = newSP->_pair_count;
#endif
} else {
- set_curterm(0);
+ TINFO_SET_CURTERM(oldSP, 0);
#if !USE_REENTRANT
curscr = 0;
newscr = 0;
@@ -82,7 +93,7 @@ set_term(SCREEN *screenp)
_nc_unlock_global(curses);
- T((T_RETURN("%p"), oldSP));
+ T((T_RETURN("%p"), (void *) oldSP));
return (oldSP);
}
@@ -106,7 +117,7 @@ delink_screen(SCREEN *sp)
for (each_screen(temp)) {
if (temp == sp) {
if (last)
- last = sp->_next_screen;
+ last->_next_screen = sp->_next_screen;
else
_nc_screen_chain = sp->_next_screen;
result = TRUE;
@@ -125,14 +136,27 @@ delscreen(SCREEN *sp)
{
int i;
- T((T_CALLED("delscreen(%p)"), sp));
+ T((T_CALLED("delscreen(%p)"), (void *) sp));
_nc_lock_global(curses);
if (delink_screen(sp)) {
+#ifdef USE_SP_RIPOFF
+ ripoff_t *rop;
+ if (safe_ripoff_sp && safe_ripoff_sp != safe_ripoff_stack) {
+ for (rop = safe_ripoff_stack;
+ rop != safe_ripoff_sp && (rop - safe_ripoff_stack) < N_RIPS;
+ rop++) {
+ if (rop->win) {
+ (void) delwin(rop->win);
+ rop->win = 0;
+ }
+ }
+ }
+#endif
- (void) _nc_freewin(sp->_curscr);
- (void) _nc_freewin(sp->_newscr);
- (void) _nc_freewin(sp->_stdscr);
+ (void) _nc_freewin(CurScreen(sp));
+ (void) _nc_freewin(NewScreen(sp));
+ (void) _nc_freewin(StdScreen(sp));
if (sp->_slk != 0) {
if (sp->_slk->ent != 0) {
@@ -176,7 +200,7 @@ delscreen(SCREEN *sp)
free(sp->_setbuf);
}
- del_curterm(sp->_term);
+ NCURSES_SP_NAME(del_curterm) (NCURSES_SP_ARGx sp->_term);
free(sp);
/*
@@ -184,7 +208,7 @@ delscreen(SCREEN *sp)
* application might try to use (except cur_term, which may have
* multiple references in different screens).
*/
- if (sp == SP) {
+ if (sp == CURRENT_SCREEN) {
#if !USE_REENTRANT
curscr = 0;
newscr = 0;
@@ -248,50 +272,98 @@ extract_fgbg(char *src, int *result)
}
#endif
+#define ReturnScreenError() _nc_set_screen(0); \
+ returnCode(ERR)
+
/* OS-independent screen initializations */
NCURSES_EXPORT(int)
-_nc_setupscreen(int slines GCC_UNUSED,
- int scolumns GCC_UNUSED,
- FILE *output,
- bool filtered,
- int slk_format)
+NCURSES_SP_NAME(_nc_setupscreen) (
+#if NCURSES_SP_FUNCS
+ SCREEN **spp,
+#endif
+ int slines,
+ int scolumns,
+ FILE *output,
+ bool filtered,
+ int slk_format)
{
char *env;
int bottom_stolen = 0;
- bool support_cookies = USE_XMC_SUPPORT;
ripoff_t *rop;
+ SCREEN *sp;
+#ifndef USE_TERM_DRIVER
+ bool support_cookies = USE_XMC_SUPPORT;
+#endif
T((T_CALLED("_nc_setupscreen(%d, %d, %p, %d, %d)"),
- slines, scolumns, output, filtered, slk_format));
+ slines, scolumns, (void *) output, filtered, slk_format));
+
+ assert(CURRENT_SCREEN == 0); /* has been reset in newterm() ! */
+
+#if NCURSES_SP_FUNCS
+ assert(spp != 0);
+ sp = *spp;
- assert(SP == 0); /* has been reset in newterm() ! */
+ if (!sp) {
+ sp = _nc_alloc_screen_sp();
+ *spp = sp;
+ }
+ if (!sp
+ || ((sp->_acs_map = typeCalloc(chtype, ACS_LEN)) == 0)
+ || ((sp->_screen_acs_map = typeCalloc(bool, ACS_LEN)) == 0)) {
+ ReturnScreenError();
+ }
+
+ T(("created SP %p", (void *) sp));
+ sp->_next_screen = _nc_screen_chain;
+ _nc_screen_chain = sp;
+
+ if ((sp->_current_attr = typeCalloc(NCURSES_CH_T, 1)) == 0) {
+ ReturnScreenError();
+ }
+#else
if (!_nc_alloc_screen()
|| ((SP->_acs_map = typeCalloc(chtype, ACS_LEN)) == 0)
|| ((SP->_screen_acs_map = typeCalloc(bool, ACS_LEN)) == 0)) {
returnCode(ERR);
}
- T(("created SP %p", SP));
- SP->_next_screen = _nc_screen_chain;
- _nc_screen_chain = SP;
+ T(("created SP %p", (void *) SP));
- if ((SP->_current_attr = typeCalloc(NCURSES_CH_T, 1)) == 0)
+ sp = SP; /* fixup so SET_LINES and SET_COLS works */
+ sp->_next_screen = _nc_screen_chain;
+ _nc_screen_chain = sp;
+
+ if ((sp->_current_attr = typeCalloc(NCURSES_CH_T, 1)) == 0)
returnCode(ERR);
+#endif
/*
* We should always check the screensize, just in case.
*/
- _nc_get_screensize(SP, &slines, &scolumns);
+ _nc_set_screen(sp);
+ sp->_term = cur_term;
+#ifdef USE_TERM_DRIVER
+ TCBOf(sp)->csp = sp;
+ _nc_get_screensize(sp, sp->_term, &slines, &scolumns);
+#else
+ _nc_get_screensize(sp, &slines, &scolumns);
+#endif
SET_LINES(slines);
SET_COLS(scolumns);
- T((T_CREATE("screen %s %dx%d"), termname(), LINES, COLS));
- SP->_filtered = filtered;
+ T((T_CREATE("screen %s %dx%d"),
+ NCURSES_SP_NAME(termname) (NCURSES_SP_ARG), slines, scolumns));
+
+ sp->_filtered = filtered;
/* implement filter mode */
if (filtered) {
slines = 1;
SET_LINES(slines);
+#ifdef USE_TERM_DRIVER
+ CallDriver(sp, setfilter);
+#else
clear_screen = 0;
cursor_down = parm_down_cursor = 0;
cursor_address = 0;
@@ -299,34 +371,25 @@ _nc_setupscreen(int slines GCC_UNUSED,
row_address = 0;
cursor_home = carriage_return;
- T(("filter screensize %dx%d", LINES, COLS));
+#endif
+ T(("filter screensize %dx%d", slines, scolumns));
}
#ifdef __DJGPP__
T(("setting output mode to binary"));
fflush(output);
setmode(output, O_BINARY);
#endif
- _nc_set_buffer(output, TRUE);
- SP->_term = cur_term;
- SP->_lines = slines;
- SP->_lines_avail = slines;
- SP->_columns = scolumns;
- SP->_cursrow = -1;
- SP->_curscol = -1;
- SP->_nl = TRUE;
- SP->_raw = FALSE;
- SP->_cbreak = 0;
- SP->_echo = TRUE;
- SP->_fifohead = -1;
- SP->_endwin = TRUE;
- SP->_ofp = output;
- SP->_cursor = -1; /* cannot know real cursor shape */
-
- SetNoPadding(SP);
+ NCURSES_SP_NAME(_nc_set_buffer) (NCURSES_SP_ARGx output, TRUE);
+ sp->_lines = (NCURSES_SIZE_T) slines;
+ sp->_lines_avail = (NCURSES_SIZE_T) slines;
+ sp->_columns = (NCURSES_SIZE_T) scolumns;
+ sp->_ofp = output;
+ SP_PRE_INIT(sp);
+ SetNoPadding(sp);
#if NCURSES_EXT_FUNCS
- SP->_default_color = FALSE;
- SP->_has_sgr_39_49 = FALSE;
+ sp->_default_color = FALSE;
+ sp->_has_sgr_39_49 = FALSE;
/*
* Set our assumption of the terminal's default foreground and background
@@ -348,11 +411,11 @@ _nc_setupscreen(int slines GCC_UNUSED,
* or black-on-white display under control of the application than not).
*/
#ifdef USE_ASSUMED_COLOR
- SP->_default_fg = COLOR_WHITE;
- SP->_default_bg = COLOR_BLACK;
+ sp->_default_fg = COLOR_WHITE;
+ sp->_default_bg = COLOR_BLACK;
#else
- SP->_default_fg = C_MASK;
- SP->_default_bg = C_MASK;
+ sp->_default_fg = C_MASK;
+ sp->_default_bg = C_MASK;
#endif
/*
@@ -364,14 +427,14 @@ _nc_setupscreen(int slines GCC_UNUSED,
char sep1, sep2;
int count = sscanf(env, "%d%c%d%c", &fg, &sep1, &bg, &sep2);
if (count >= 1) {
- SP->_default_fg = (fg >= 0 && fg < max_colors) ? fg : C_MASK;
+ sp->_default_fg = ((fg >= 0 && fg < MaxColors) ? fg : C_MASK);
if (count >= 3) {
- SP->_default_bg = (bg >= 0 && bg < max_colors) ? bg : C_MASK;
+ sp->_default_bg = ((bg >= 0 && bg < MaxColors) ? bg : C_MASK);
}
TR(TRACE_CHARPUT | TRACE_MOVE,
("from environment assumed fg=%d, bg=%d",
- SP->_default_fg,
- SP->_default_bg));
+ sp->_default_fg,
+ sp->_default_bg));
}
}
#if USE_COLORFGBG
@@ -384,48 +447,51 @@ _nc_setupscreen(int slines GCC_UNUSED,
if (getenv("COLORFGBG") != 0) {
char *p = getenv("COLORFGBG");
TR(TRACE_CHARPUT | TRACE_MOVE, ("decoding COLORFGBG %s", p));
- p = extract_fgbg(p, &(SP->_default_fg));
- p = extract_fgbg(p, &(SP->_default_bg));
+ p = extract_fgbg(p, &(sp->_default_fg));
+ p = extract_fgbg(p, &(sp->_default_bg));
if (*p) /* assume rxvt was compiled with xpm support */
- p = extract_fgbg(p, &(SP->_default_bg));
+ p = extract_fgbg(p, &(sp->_default_bg));
TR(TRACE_CHARPUT | TRACE_MOVE, ("decoded fg=%d, bg=%d",
- SP->_default_fg, SP->_default_bg));
- if (SP->_default_fg >= max_colors) {
+ sp->_default_fg, sp->_default_bg));
+ if (sp->_default_fg >= MaxColors) {
if (set_a_foreground != ABSENT_STRING
&& !strcmp(set_a_foreground, "\033[3%p1%dm")) {
set_a_foreground = "\033[3%?%p1%{8}%>%t9%e%p1%d%;m";
} else {
- SP->_default_fg %= max_colors;
+ sp->_default_fg %= MaxColors;
}
}
- if (SP->_default_bg >= max_colors) {
+ if (sp->_default_bg >= MaxColors) {
if (set_a_background != ABSENT_STRING
&& !strcmp(set_a_background, "\033[4%p1%dm")) {
set_a_background = "\033[4%?%p1%{8}%>%t9%e%p1%d%;m";
} else {
- SP->_default_bg %= max_colors;
+ sp->_default_bg %= MaxColors;
}
}
}
#endif
#endif /* NCURSES_EXT_FUNCS */
- SP->_maxclick = DEFAULT_MAXCLICK;
- SP->_mouse_event = no_mouse_event;
- SP->_mouse_inline = no_mouse_inline;
- SP->_mouse_parse = no_mouse_parse;
- SP->_mouse_resume = no_mouse_resume;
- SP->_mouse_wrap = no_mouse_wrap;
- SP->_mouse_fd = -1;
+ sp->_maxclick = DEFAULT_MAXCLICK;
+ sp->_mouse_event = no_mouse_event;
+ sp->_mouse_inline = no_mouse_inline;
+ sp->_mouse_parse = no_mouse_parse;
+ sp->_mouse_resume = no_mouse_resume;
+ sp->_mouse_wrap = no_mouse_wrap;
+ sp->_mouse_fd = -1;
/*
* If we've no magic cookie support, we suppress attributes that xmc would
* affect, i.e., the attributes that affect the rendition of a space.
*/
- SP->_ok_attributes = termattrs();
- if (has_colors()) {
- SP->_ok_attributes |= A_COLOR;
+ sp->_ok_attributes = NCURSES_SP_NAME(termattrs) (NCURSES_SP_ARG);
+ if (NCURSES_SP_NAME(has_colors) (NCURSES_SP_ARG)) {
+ sp->_ok_attributes |= A_COLOR;
}
+#ifdef USE_TERM_DRIVER
+ _nc_cookie_init(sp);
+#else
#if USE_XMC_SUPPORT
/*
* If we have no magic-cookie support compiled-in, or if it is suppressed
@@ -444,7 +510,7 @@ _nc_setupscreen(int slines GCC_UNUSED,
if (magic_cookie_glitch > 0) { /* tvi, wyse */
- SP->_xmc_triggers = SP->_ok_attributes & (
+ sp->_xmc_triggers = sp->_ok_attributes & (
A_STANDOUT |
A_UNDERLINE |
A_REVERSE |
@@ -461,12 +527,12 @@ _nc_setupscreen(int slines GCC_UNUSED,
* cookies.
*/
if (has_colors()) {
- SP->_xmc_triggers |= A_COLOR;
+ sp->_xmc_triggers |= A_COLOR;
}
#endif
- SP->_xmc_suppress = SP->_xmc_triggers & (chtype) ~(A_BOLD);
+ sp->_xmc_suppress = sp->_xmc_triggers & (chtype) ~(A_BOLD);
- T(("magic cookie attributes %s", _traceattr(SP->_xmc_suppress)));
+ T(("magic cookie attributes %s", _traceattr(sp->_xmc_suppress)));
/*
* Supporting line-drawing may be possible. But make the regular
* video attributes work first.
@@ -506,7 +572,7 @@ _nc_setupscreen(int slines GCC_UNUSED,
/* initialize normal acs before wide, since we use mapping in the latter */
#if !USE_WIDEC_SUPPORT
- if (_nc_unicode_locale() && _nc_locale_breaks_acs(cur_term)) {
+ if (_nc_unicode_locale() && _nc_locale_breaks_acs(sp->_term)) {
acs_chars = NULL;
ena_acs = NULL;
enter_alt_charset_mode = NULL;
@@ -514,134 +580,194 @@ _nc_setupscreen(int slines GCC_UNUSED,
set_attributes = NULL;
}
#endif
- _nc_init_acs();
+#endif
+
+ NCURSES_SP_NAME(_nc_init_acs) (NCURSES_SP_ARG);
#if USE_WIDEC_SUPPORT
_nc_init_wacs();
- SP->_screen_acs_fix = (_nc_unicode_locale()
- && _nc_locale_breaks_acs(cur_term));
+ sp->_screen_acs_fix = (_nc_unicode_locale()
+ && _nc_locale_breaks_acs(sp->_term));
#endif
env = _nc_get_locale();
- SP->_legacy_coding = ((env == 0)
+ sp->_legacy_coding = ((env == 0)
|| !strcmp(env, "C")
|| !strcmp(env, "POSIX"));
- T(("legacy-coding %d", SP->_legacy_coding));
+ T(("legacy-coding %d", sp->_legacy_coding));
- _nc_idcok = TRUE;
- _nc_idlok = FALSE;
+ sp->_nc_sp_idcok = TRUE;
+ sp->_nc_sp_idlok = FALSE;
- SP->oldhash = 0;
- SP->newhash = 0;
+ sp->oldhash = 0;
+ sp->newhash = 0;
T(("creating newscr"));
- if ((SP->_newscr = newwin(slines, scolumns, 0, 0)) == 0)
- returnCode(ERR);
-
+ NewScreen(sp) = NCURSES_SP_NAME(newwin) (NCURSES_SP_ARGx slines, scolumns,
+ 0, 0);
+ if (NewScreen(sp) == 0) {
+ ReturnScreenError();
+ }
T(("creating curscr"));
- if ((SP->_curscr = newwin(slines, scolumns, 0, 0)) == 0)
- returnCode(ERR);
-
+ CurScreen(sp) = NCURSES_SP_NAME(newwin) (NCURSES_SP_ARGx slines, scolumns,
+ 0, 0);
+ if (CurScreen(sp) == 0) {
+ ReturnScreenError();
+ }
#if !USE_REENTRANT
- newscr = SP->_newscr;
- curscr = SP->_curscr;
+ newscr = NewScreen(sp);
+ curscr = CurScreen(sp);
#endif
#if USE_SIZECHANGE
- SP->_resize = resizeterm;
+ sp->_resize = NCURSES_SP_NAME(resizeterm);
#endif
- newscr->_clear = TRUE;
- curscr->_clear = FALSE;
-
- def_shell_mode();
- def_prog_mode();
-
- for (rop = ripoff_stack;
- rop != ripoff_sp && (rop - ripoff_stack) < N_RIPS;
- rop++) {
-
- /* If we must simulate soft labels, grab off the line to be used.
- We assume that we must simulate, if it is none of the standard
- formats (4-4 or 3-2-3) for which there may be some hardware
- support. */
- if (rop->hook == _nc_slk_initialize)
- if (!(num_labels <= 0 || !SLK_STDFMT(slk_format)))
- continue;
- if (rop->hook) {
- int count;
- WINDOW *w;
-
- count = (rop->line < 0) ? -rop->line : rop->line;
- T(("ripping off %i lines at %s", count,
- ((rop->line < 0)
- ? "bottom"
- : "top")));
-
- w = newwin(count, scolumns,
- ((rop->line < 0)
- ? SP->_lines_avail - count
- : 0),
- 0);
- if (w) {
- rop->win = w;
- rop->hook(w, scolumns);
- } else {
- returnCode(ERR);
+ NewScreen(sp)->_clear = TRUE;
+ CurScreen(sp)->_clear = FALSE;
+
+ NCURSES_SP_NAME(def_shell_mode) (NCURSES_SP_ARG);
+ NCURSES_SP_NAME(def_prog_mode) (NCURSES_SP_ARG);
+
+ if (safe_ripoff_sp && safe_ripoff_sp != safe_ripoff_stack) {
+ for (rop = safe_ripoff_stack;
+ rop != safe_ripoff_sp && (rop - safe_ripoff_stack) < N_RIPS;
+ rop++) {
+
+ /* If we must simulate soft labels, grab off the line to be used.
+ We assume that we must simulate, if it is none of the standard
+ formats (4-4 or 3-2-3) for which there may be some hardware
+ support. */
+ if (rop->hook == _nc_slk_initialize) {
+ if (!(NumLabels <= 0 || !SLK_STDFMT(slk_format))) {
+ continue;
+ }
+ }
+ if (rop->hook) {
+ int count;
+ WINDOW *w;
+
+ count = (rop->line < 0) ? -rop->line : rop->line;
+ T(("ripping off %i lines at %s", count,
+ ((rop->line < 0)
+ ? "bottom"
+ : "top")));
+
+ w = NCURSES_SP_NAME(newwin) (NCURSES_SP_ARGx
+ count, scolumns,
+ ((rop->line < 0)
+ ? sp->_lines_avail - count
+ : 0),
+ 0);
+ if (w) {
+ rop->win = w;
+ rop->hook(w, scolumns);
+ } else {
+ ReturnScreenError();
+ }
+ if (rop->line < 0) {
+ bottom_stolen += count;
+ } else {
+ sp->_topstolen = (NCURSES_SIZE_T) (sp->_topstolen + count);
+ }
+ sp->_lines_avail = (NCURSES_SIZE_T) (sp->_lines_avail - count);
}
- if (rop->line < 0)
- bottom_stolen += count;
- else
- SP->_topstolen += count;
- SP->_lines_avail -= count;
}
+ /* reset the stack */
+ safe_ripoff_sp = safe_ripoff_stack;
}
- /* reset the stack */
- ripoff_sp = ripoff_stack;
T(("creating stdscr"));
- assert((SP->_lines_avail + SP->_topstolen + bottom_stolen) == slines);
- if ((SP->_stdscr = newwin(SP->_lines_avail, scolumns, 0, 0)) == 0)
- returnCode(ERR);
-
- SET_LINES(SP->_lines_avail);
+ assert((sp->_lines_avail + sp->_topstolen + bottom_stolen) == slines);
+ if ((StdScreen(sp) = NCURSES_SP_NAME(newwin) (NCURSES_SP_ARGx
+ sp->_lines_avail,
+ scolumns, 0, 0)) == 0) {
+ ReturnScreenError();
+ }
+ SET_LINES(sp->_lines_avail);
#if !USE_REENTRANT
- stdscr = SP->_stdscr;
+ stdscr = StdScreen(sp);
#endif
-
+ sp->_prescreen = FALSE;
returnCode(OK);
}
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+_nc_setupscreen(int slines GCC_UNUSED,
+ int scolumns GCC_UNUSED,
+ FILE *output,
+ bool filtered,
+ int slk_format)
+{
+ SCREEN *sp = 0;
+ int rc = NCURSES_SP_NAME(_nc_setupscreen) (&sp,
+ slines,
+ scolumns,
+ output,
+ filtered,
+ slk_format);
+ if (rc != OK)
+ _nc_set_screen(0);
+ return rc;
+}
+#endif
+
/*
* The internal implementation interprets line as the number of lines to rip
* off from the top or bottom.
*/
NCURSES_EXPORT(int)
-_nc_ripoffline(int line, int (*init) (WINDOW *, int))
+NCURSES_SP_NAME(_nc_ripoffline) (NCURSES_SP_DCLx
+ int line,
+ int (*init) (WINDOW *, int))
{
- T((T_CALLED("_nc_ripoffline(%d, %p)"), line, init));
+ int code = ERR;
- if (line != 0) {
-
- if (ripoff_sp == 0)
- ripoff_sp = ripoff_stack;
- if (ripoff_sp >= ripoff_stack + N_RIPS)
- returnCode(ERR);
+ START_TRACE();
+ T((T_CALLED("ripoffline(%p,%d,%p)"), (void *) SP_PARM, line, init));
- ripoff_sp->line = line;
- ripoff_sp->hook = init;
- ripoff_sp++;
+#if NCURSES_SP_FUNCS
+ if (SP_PARM != 0 && SP_PARM->_prescreen)
+#endif
+ {
+ if (line == 0) {
+ code = OK;
+ } else {
+ if (safe_ripoff_sp == 0)
+ safe_ripoff_sp = safe_ripoff_stack;
+ if (safe_ripoff_sp < safe_ripoff_stack + N_RIPS) {
+ safe_ripoff_sp->line = line;
+ safe_ripoff_sp->hook = init;
+ (safe_ripoff_sp)++;
+ code = OK;
+ }
+ }
}
- returnCode(OK);
+ returnCode(code);
}
+#if NCURSES_SP_FUNCS
NCURSES_EXPORT(int)
-ripoffline(int line, int (*init) (WINDOW *, int))
+_nc_ripoffline(int line, int (*init) (WINDOW *, int))
{
- START_TRACE();
- T((T_CALLED("ripoffline(%d,%p)"), line, init));
+ return NCURSES_SP_NAME(_nc_ripoffline) (CURRENT_SCREEN_PRE, line, init);
+}
+#endif
- if (line == 0)
- returnCode(OK);
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(ripoffline) (NCURSES_SP_DCLx
+ int line,
+ int (*init) (WINDOW *, int))
+{
+ return NCURSES_SP_NAME(_nc_ripoffline) (NCURSES_SP_ARGx
+ (line < 0) ? -1 : 1,
+ init);
+}
- returnCode(_nc_ripoffline((line < 0) ? -1 : 1, init));
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+ripoffline(int line, int (*init) (WINDOW *, int))
+{
+ return NCURSES_SP_NAME(ripoffline) (CURRENT_SCREEN_PRE, line, init);
}
+#endif
diff --git a/ncurses/base/lib_slk.c b/ncurses/base/lib_slk.c
index 662f7e45b116..7a2eecd9e56d 100644
--- a/ncurses/base/lib_slk.c
+++ b/ncurses/base/lib_slk.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2005,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2010 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,135 +41,183 @@
*/
#include <curses.priv.h>
-
#include <ctype.h>
-#include <term.h> /* num_labels, label_*, plab_norm */
-MODULE_ID("$Id: lib_slk.c,v 1.35 2008/09/27 14:07:33 juergen Exp $")
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
+MODULE_ID("$Id: lib_slk.c,v 1.47 2010/12/25 22:58:58 tom Exp $")
+
+#ifdef USE_TERM_DRIVER
+#define NumLabels InfoOf(SP_PARM).numlabels
+#define NoColorVideo InfoOf(SP_PARM).nocolorvideo
+#define LabelWidth InfoOf(SP_PARM).labelwidth
+#define LabelHeight InfoOf(SP_PARM).labelheight
+#else
+#define NumLabels num_labels
+#define NoColorVideo no_color_video
+#define LabelWidth label_width
+#define LabelHeight label_height
+#endif
/*
* Free any memory related to soft labels, return an error.
*/
static int
-slk_failed(void)
+slk_failed(NCURSES_SP_DCL0)
{
- if (SP->_slk) {
- FreeIfNeeded(SP->_slk->ent);
- free(SP->_slk);
- SP->_slk = (SLK *) 0;
+ if ((0 != SP_PARM) && SP_PARM->_slk) {
+ FreeIfNeeded(SP_PARM->_slk->ent);
+ free(SP_PARM->_slk);
+ SP_PARM->_slk = (SLK *) 0;
}
return ERR;
}
-/*
- * Initialize soft labels.
- * Called from newterm()
- */
NCURSES_EXPORT(int)
-_nc_slk_initialize(WINDOW *stwin, int cols)
+_nc_format_slks(NCURSES_SP_DCLx int cols)
{
- int i, x;
- int res = OK;
- unsigned max_length;
-
- T((T_CALLED("_nc_slk_initialize()")));
+ int gap, i, x;
+ int max_length;
- if (SP->_slk) { /* we did this already, so simply return */
- returnCode(OK);
- } else if ((SP->_slk = typeCalloc(SLK, 1)) == 0)
- returnCode(ERR);
+ if (!SP_PARM || !SP_PARM->_slk)
+ return ERR;
- SP->_slk->ent = NULL;
-
- /*
- * If we use colors, vidputs() will suppress video attributes that conflict
- * with colors. In that case, we're still guaranteed that "reverse" would
- * work.
- */
- if ((no_color_video & 1) == 0)
- SetAttr(SP->_slk->attr, A_STANDOUT);
- else
- SetAttr(SP->_slk->attr, A_REVERSE);
-
- SP->_slk->maxlab = ((num_labels > 0)
- ? num_labels
- : MAX_SKEY(_nc_globals.slk_format));
- SP->_slk->maxlen = ((num_labels > 0)
- ? label_width * label_height
- : MAX_SKEY_LEN(_nc_globals.slk_format));
- SP->_slk->labcnt = ((SP->_slk->maxlab < MAX_SKEY(_nc_globals.slk_format))
- ? MAX_SKEY(_nc_globals.slk_format)
- : SP->_slk->maxlab);
-
- if (SP->_slk->maxlen <= 0
- || SP->_slk->labcnt <= 0
- || (SP->_slk->ent = typeCalloc(slk_ent,
- (unsigned) SP->_slk->labcnt)) == NULL)
- returnCode(slk_failed());
-
- max_length = SP->_slk->maxlen;
- for (i = 0; i < SP->_slk->labcnt; i++) {
- size_t used = max_length + 1;
-
- if ((SP->_slk->ent[i].ent_text = (char *) _nc_doalloc(0, used)) == 0)
- returnCode(slk_failed());
- memset(SP->_slk->ent[i].ent_text, 0, used);
-
- if ((SP->_slk->ent[i].form_text = (char *) _nc_doalloc(0, used)) == 0)
- returnCode(slk_failed());
- memset(SP->_slk->ent[i].form_text, 0, used);
-
- memset(SP->_slk->ent[i].form_text, ' ', max_length);
- SP->_slk->ent[i].visible = (char) (i < SP->_slk->maxlab);
- }
- if (_nc_globals.slk_format >= 3) { /* PC style */
- int gap = (cols - 3 * (3 + 4 * max_length)) / 2;
+ max_length = SP_PARM->_slk->maxlen;
+ if (SP_PARM->slk_format >= 3) { /* PC style */
+ gap = (cols - 3 * (3 + 4 * max_length)) / 2;
if (gap < 1)
gap = 1;
- for (i = x = 0; i < SP->_slk->maxlab; i++) {
- SP->_slk->ent[i].ent_x = x;
+ for (i = x = 0; i < SP_PARM->_slk->maxlab; i++) {
+ SP_PARM->_slk->ent[i].ent_x = x;
x += max_length;
x += (i == 3 || i == 7) ? gap : 1;
}
} else {
- if (_nc_globals.slk_format == 2) { /* 4-4 */
- int gap = cols - (SP->_slk->maxlab * max_length) - 6;
+ if (SP_PARM->slk_format == 2) { /* 4-4 */
+ gap = cols - (int) (SP_PARM->_slk->maxlab * max_length) - 6;
if (gap < 1)
gap = 1;
- for (i = x = 0; i < SP->_slk->maxlab; i++) {
- SP->_slk->ent[i].ent_x = x;
+ for (i = x = 0; i < SP_PARM->_slk->maxlab; i++) {
+ SP_PARM->_slk->ent[i].ent_x = x;
x += max_length;
x += (i == 3) ? gap : 1;
}
} else {
- if (_nc_globals.slk_format == 1) { /* 1 -> 3-2-3 */
- int gap = (cols - (SP->_slk->maxlab * max_length) - 5)
- / 2;
+ if (SP_PARM->slk_format == 1) { /* 1 -> 3-2-3 */
+ gap = (cols - (SP_PARM->_slk->maxlab * max_length) - 5)
+ / 2;
if (gap < 1)
gap = 1;
- for (i = x = 0; i < SP->_slk->maxlab; i++) {
- SP->_slk->ent[i].ent_x = x;
+ for (i = x = 0; i < SP_PARM->_slk->maxlab; i++) {
+ SP_PARM->_slk->ent[i].ent_x = x;
x += max_length;
x += (i == 2 || i == 4) ? gap : 1;
}
- } else
- returnCode(slk_failed());
+ } else {
+ return slk_failed(NCURSES_SP_ARG);
+ }
}
}
- SP->_slk->dirty = TRUE;
- if ((SP->_slk->win = stwin) == NULL) {
- returnCode(slk_failed());
+ SP_PARM->_slk->dirty = TRUE;
+
+ return OK;
+}
+
+/*
+ * Initialize soft labels.
+ * Called from newterm()
+ */
+NCURSES_EXPORT(int)
+_nc_slk_initialize(WINDOW *stwin, int cols)
+{
+ int i;
+ int res = OK;
+ int max_length;
+ SCREEN *sp;
+ int numlab;
+
+ T((T_CALLED("_nc_slk_initialize()")));
+
+ assert(stwin);
+
+ sp = _nc_screen_of(stwin);
+ if (0 == sp)
+ returnCode(ERR);
+
+ assert(TerminalOf(SP_PARM));
+
+ numlab = NumLabels;
+
+ if (SP_PARM->_slk) { /* we did this already, so simply return */
+ returnCode(OK);
+ } else if ((SP_PARM->_slk = typeCalloc(SLK, 1)) == 0)
+ returnCode(ERR);
+
+ if (!SP_PARM->slk_format)
+ SP_PARM->slk_format = _nc_globals.slk_format;
+
+ /*
+ * If we use colors, vidputs() will suppress video attributes that conflict
+ * with colors. In that case, we're still guaranteed that "reverse" would
+ * work.
+ */
+ if ((NoColorVideo & 1) == 0)
+ SetAttr(SP_PARM->_slk->attr, A_STANDOUT);
+ else
+ SetAttr(SP_PARM->_slk->attr, A_REVERSE);
+
+ SP_PARM->_slk->maxlab = (short) ((numlab > 0)
+ ? numlab
+ : MAX_SKEY(SP_PARM->slk_format));
+ SP_PARM->_slk->maxlen = (short) ((numlab > 0)
+ ? LabelWidth * LabelHeight
+ : MAX_SKEY_LEN(SP_PARM->slk_format));
+ SP_PARM->_slk->labcnt = (short) ((SP_PARM->_slk->maxlab < MAX_SKEY(SP_PARM->slk_format))
+ ? MAX_SKEY(SP_PARM->slk_format)
+ : SP_PARM->_slk->maxlab);
+
+ if (SP_PARM->_slk->maxlen <= 0
+ || SP_PARM->_slk->labcnt <= 0
+ || (SP_PARM->_slk->ent = typeCalloc(slk_ent,
+ (size_t) SP_PARM->_slk->labcnt))
+ == NULL)
+ returnCode(slk_failed(NCURSES_SP_ARG));
+
+ max_length = SP_PARM->_slk->maxlen;
+ for (i = 0; i < SP_PARM->_slk->labcnt; i++) {
+ size_t used = (size_t) max_length + 1;
+
+ SP_PARM->_slk->ent[i].ent_text = (char *) _nc_doalloc(0, used);
+ if (SP_PARM->_slk->ent[i].ent_text == 0)
+ returnCode(slk_failed(NCURSES_SP_ARG));
+ memset(SP_PARM->_slk->ent[i].ent_text, 0, used);
+
+ SP_PARM->_slk->ent[i].form_text = (char *) _nc_doalloc(0, used);
+ if (SP_PARM->_slk->ent[i].form_text == 0)
+ returnCode(slk_failed(NCURSES_SP_ARG));
+
+ memset(SP_PARM->_slk->ent[i].form_text, ' ', used - 1);
+ SP_PARM->_slk->ent[i].form_text[used] = '\0';
+
+ SP_PARM->_slk->ent[i].visible = (char) (i < SP_PARM->_slk->maxlab);
+ }
+
+ res = _nc_format_slks(NCURSES_SP_ARGx cols);
+
+ if ((SP_PARM->_slk->win = stwin) == NULL) {
+ returnCode(slk_failed(NCURSES_SP_ARG));
}
/* We now reset the format so that the next newterm has again
* per default no SLK keys and may call slk_init again to
* define a new layout. (juergen 03-Mar-1999)
*/
- SP->slk_format = _nc_globals.slk_format;
_nc_globals.slk_format = 0;
returnCode(res);
}
@@ -178,14 +226,24 @@ _nc_slk_initialize(WINDOW *stwin, int cols)
* Restore the soft labels on the screen.
*/
NCURSES_EXPORT(int)
-slk_restore(void)
+NCURSES_SP_NAME(slk_restore) (NCURSES_SP_DCL0)
{
- T((T_CALLED("slk_restore()")));
+ T((T_CALLED("slk_restore(%p)"), (void *) SP_PARM));
- if (SP->_slk == NULL)
- return (ERR);
- SP->_slk->hidden = FALSE;
- SP->_slk->dirty = TRUE;
+ if (0 == SP_PARM)
+ returnCode(ERR);
+ if (SP_PARM->_slk == NULL)
+ returnCode(ERR);
+ SP_PARM->_slk->hidden = FALSE;
+ SP_PARM->_slk->dirty = TRUE;
+
+ returnCode(NCURSES_SP_NAME(slk_refresh) (NCURSES_SP_ARG));
+}
- returnCode(slk_refresh());
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+slk_restore(void)
+{
+ return NCURSES_SP_NAME(slk_restore) (CURRENT_SCREEN);
}
+#endif
diff --git a/ncurses/base/lib_slkatr_set.c b/ncurses/base/lib_slkatr_set.c
index f83616beaf17..bd5f539672a7 100644
--- a/ncurses/base/lib_slkatr_set.c
+++ b/ncurses/base/lib_slkatr_set.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2003,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 *
@@ -28,7 +28,7 @@
/****************************************************************************
* Author: Juergen Pfeifer, 1998 *
- * and: Thomas E. Dickey 2005 *
+ * and: Thomas E. Dickey 2005-on *
****************************************************************************/
/*
@@ -38,22 +38,42 @@
*/
#include <curses.priv.h>
-MODULE_ID("$Id: lib_slkatr_set.c,v 1.10 2005/01/28 21:11:53 tom Exp $")
+MODULE_ID("$Id: lib_slkatr_set.c,v 1.14 2009/10/24 22:47:03 tom Exp $")
NCURSES_EXPORT(int)
-slk_attr_set(const attr_t attr, short color_pair_number, void *opts)
+NCURSES_SP_NAME(slk_attr_set) (NCURSES_SP_DCLx
+ const attr_t attr,
+ short color_pair_number,
+ void *opts)
{
- T((T_CALLED("slk_attr_set(%s,%d)"), _traceattr(attr), color_pair_number));
+ int code = ERR;
+
+ T((T_CALLED("slk_attr_set(%p,%s,%d)"),
+ (void *) SP_PARM,
+ _traceattr(attr),
+ color_pair_number));
- if (SP != 0 && SP->_slk != 0 && !opts &&
- color_pair_number >= 0 && color_pair_number < COLOR_PAIRS) {
- TR(TRACE_ATTRS, ("... current %s", _tracech_t(CHREF(SP->_slk->attr))));
- SetAttr(SP->_slk->attr, attr);
+ if (SP_PARM != 0
+ && SP_PARM->_slk != 0
+ && !opts
+ && color_pair_number >= 0
+ && color_pair_number < SP_PARM->_pair_limit) {
+ TR(TRACE_ATTRS, ("... current %s", _tracech_t(CHREF(SP_PARM->_slk->attr))));
+ SetAttr(SP_PARM->_slk->attr, attr);
if (color_pair_number > 0) {
- SetPair(SP->_slk->attr, color_pair_number);
+ SetPair(SP_PARM->_slk->attr, color_pair_number);
}
- TR(TRACE_ATTRS, ("new attribute is %s", _tracech_t(CHREF(SP->_slk->attr))));
- returnCode(OK);
- } else
- returnCode(ERR);
+ TR(TRACE_ATTRS, ("new attribute is %s", _tracech_t(CHREF(SP_PARM->_slk->attr))));
+ code = OK;
+ }
+ returnCode(code);
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+slk_attr_set(const attr_t attr, short color_pair_number, void *opts)
+{
+ return NCURSES_SP_NAME(slk_attr_set) (CURRENT_SCREEN, attr,
+ color_pair_number, opts);
}
+#endif
diff --git a/ncurses/base/lib_slkatrof.c b/ncurses/base/lib_slkatrof.c
index 14b4c3bfadcc..bb980ab812cf 100644
--- a/ncurses/base/lib_slkatrof.c
+++ b/ncurses/base/lib_slkatrof.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2000,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 *
@@ -38,21 +38,29 @@
*/
#include <curses.priv.h>
-MODULE_ID("$Id: lib_slkatrof.c,v 1.8 2005/01/08 23:01:32 tom Exp $")
+MODULE_ID("$Id: lib_slkatrof.c,v 1.11 2009/10/24 22:12:21 tom Exp $")
NCURSES_EXPORT(int)
-slk_attroff(const chtype attr)
+NCURSES_SP_NAME(slk_attroff) (NCURSES_SP_DCLx const chtype attr)
{
- T((T_CALLED("slk_attroff(%s)"), _traceattr(attr)));
+ T((T_CALLED("slk_attroff(%p,%s)"), (void *) SP_PARM, _traceattr(attr)));
- if (SP != 0 && SP->_slk != 0) {
- TR(TRACE_ATTRS, ("... current %s", _tracech_t(CHREF(SP->_slk->attr))));
- RemAttr(SP->_slk->attr, attr);
+ if (SP_PARM != 0 && SP_PARM->_slk != 0) {
+ TR(TRACE_ATTRS, ("... current %s", _tracech_t(CHREF(SP_PARM->_slk->attr))));
+ RemAttr(SP_PARM->_slk->attr, attr);
if ((attr & A_COLOR) != 0) {
- SetPair(SP->_slk->attr, 0);
+ SetPair(SP_PARM->_slk->attr, 0);
}
- TR(TRACE_ATTRS, ("new attribute is %s", _tracech_t(CHREF(SP->_slk->attr))));
+ TR(TRACE_ATTRS, ("new attribute is %s", _tracech_t(CHREF(SP_PARM->_slk->attr))));
returnCode(OK);
} else
returnCode(ERR);
}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+slk_attroff(const chtype attr)
+{
+ return NCURSES_SP_NAME(slk_attroff) (CURRENT_SCREEN, attr);
+}
+#endif
diff --git a/ncurses/base/lib_slkatron.c b/ncurses/base/lib_slkatron.c
index 90add86dc1c8..bc2fb3308eea 100644
--- a/ncurses/base/lib_slkatron.c
+++ b/ncurses/base/lib_slkatron.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2010 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 *
@@ -38,21 +38,29 @@
*/
#include <curses.priv.h>
-MODULE_ID("$Id: lib_slkatron.c,v 1.8 2005/01/08 23:02:01 tom Exp $")
+MODULE_ID("$Id: lib_slkatron.c,v 1.12 2010/03/31 23:38:02 tom Exp $")
NCURSES_EXPORT(int)
-slk_attron(const chtype attr)
+NCURSES_SP_NAME(slk_attron) (NCURSES_SP_DCLx const chtype attr)
{
- T((T_CALLED("slk_attron(%s)"), _traceattr(attr)));
+ T((T_CALLED("slk_attron(%p,%s)"), (void *) SP_PARM, _traceattr(attr)));
- if (SP != 0 && SP->_slk != 0) {
- TR(TRACE_ATTRS, ("... current %s", _tracech_t(CHREF(SP->_slk->attr))));
- AddAttr(SP->_slk->attr, attr);
+ if (SP_PARM != 0 && SP_PARM->_slk != 0) {
+ TR(TRACE_ATTRS, ("... current %s", _tracech_t(CHREF(SP_PARM->_slk->attr))));
+ AddAttr(SP_PARM->_slk->attr, attr);
if ((attr & A_COLOR) != 0) {
- SetPair(SP->_slk->attr, PAIR_NUMBER(attr));
+ SetPair(SP_PARM->_slk->attr, PairNumber(attr));
}
- TR(TRACE_ATTRS, ("new attribute is %s", _tracech_t(CHREF(SP->_slk->attr))));
+ TR(TRACE_ATTRS, ("new attribute is %s", _tracech_t(CHREF(SP_PARM->_slk->attr))));
returnCode(OK);
} else
returnCode(ERR);
}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+slk_attron(const chtype attr)
+{
+ return NCURSES_SP_NAME(slk_attron) (CURRENT_SCREEN, attr);
+}
+#endif
diff --git a/ncurses/base/lib_slkatrset.c b/ncurses/base/lib_slkatrset.c
index 8da9981b3b3e..544b8d0faab7 100644
--- a/ncurses/base/lib_slkatrset.c
+++ b/ncurses/base/lib_slkatrset.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2000,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 *
@@ -38,16 +38,24 @@
*/
#include <curses.priv.h>
-MODULE_ID("$Id: lib_slkatrset.c,v 1.7 2005/01/08 21:46:47 tom Exp $")
+MODULE_ID("$Id: lib_slkatrset.c,v 1.10 2009/10/24 22:12:21 tom Exp $")
NCURSES_EXPORT(int)
-slk_attrset(const chtype attr)
+NCURSES_SP_NAME(slk_attrset) (NCURSES_SP_DCLx const chtype attr)
{
- T((T_CALLED("slk_attrset(%s)"), _traceattr(attr)));
+ T((T_CALLED("slk_attrset(%p,%s)"), (void *) SP_PARM, _traceattr(attr)));
- if (SP != 0 && SP->_slk != 0) {
- SetAttr(SP->_slk->attr, attr);
+ if (SP_PARM != 0 && SP_PARM->_slk != 0) {
+ SetAttr(SP_PARM->_slk->attr, attr);
returnCode(OK);
} else
returnCode(ERR);
}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+slk_attrset(const chtype attr)
+{
+ return NCURSES_SP_NAME(slk_attrset) (CURRENT_SCREEN, attr);
+}
+#endif
diff --git a/ncurses/base/lib_slkattr.c b/ncurses/base/lib_slkattr.c
index da82ee5b623e..bec11e84c667 100644
--- a/ncurses/base/lib_slkattr.c
+++ b/ncurses/base/lib_slkattr.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2010 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 *
@@ -38,19 +38,27 @@
*/
#include <curses.priv.h>
-MODULE_ID("$Id: lib_slkattr.c,v 1.6 2005/01/08 21:44:28 tom Exp $")
+MODULE_ID("$Id: lib_slkattr.c,v 1.11 2010/12/20 01:41:25 tom Exp $")
NCURSES_EXPORT(attr_t)
-slk_attr(void)
+NCURSES_SP_NAME(slk_attr) (NCURSES_SP_DCL0)
{
- T((T_CALLED("slk_attr()")));
+ T((T_CALLED("slk_attr(%p)"), (void *) SP_PARM));
- if (SP != 0 && SP->_slk != 0) {
- attr_t result = AttrOf(SP->_slk->attr) & ALL_BUT_COLOR;
- int pair = GetPair(SP->_slk->attr);
+ if (SP_PARM != 0 && SP_PARM->_slk != 0) {
+ attr_t result = AttrOf(SP_PARM->_slk->attr) & ALL_BUT_COLOR;
+ int pair = GetPair(SP_PARM->_slk->attr);
- result |= COLOR_PAIR(pair);
+ result |= (attr_t) ColorPair(pair);
returnAttr(result);
} else
returnAttr(0);
}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(attr_t)
+slk_attr(void)
+{
+ return NCURSES_SP_NAME(slk_attr) (CURRENT_SCREEN);
+}
+#endif
diff --git a/ncurses/base/lib_slkclear.c b/ncurses/base/lib_slkclear.c
index 946ceeaf0e0d..264c8c40812c 100644
--- a/ncurses/base/lib_slkclear.c
+++ b/ncurses/base/lib_slkclear.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-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 *
@@ -40,27 +40,35 @@
*/
#include <curses.priv.h>
-MODULE_ID("$Id: lib_slkclear.c,v 1.10 2007/12/29 17:51:47 tom Exp $")
+MODULE_ID("$Id: lib_slkclear.c,v 1.14 2009/11/07 16:27:05 tom Exp $")
NCURSES_EXPORT(int)
-slk_clear(void)
+NCURSES_SP_NAME(slk_clear) (NCURSES_SP_DCL0)
{
int rc = ERR;
- T((T_CALLED("slk_clear()")));
+ T((T_CALLED("slk_clear(%p)"), (void *) SP_PARM));
- if (SP != NULL && SP->_slk != NULL) {
- SP->_slk->hidden = TRUE;
+ if (SP_PARM != 0 && SP_PARM->_slk != 0) {
+ SP_PARM->_slk->hidden = TRUE;
/* For simulated SLK's it looks much more natural to
inherit those attributes from the standard screen */
- SP->_slk->win->_nc_bkgd = stdscr->_nc_bkgd;
- WINDOW_ATTRS(SP->_slk->win) = WINDOW_ATTRS(stdscr);
- if (SP->_slk->win == stdscr) {
+ SP_PARM->_slk->win->_nc_bkgd = StdScreen(SP_PARM)->_nc_bkgd;
+ WINDOW_ATTRS(SP_PARM->_slk->win) = WINDOW_ATTRS(StdScreen(SP_PARM));
+ if (SP_PARM->_slk->win == StdScreen(SP_PARM)) {
rc = OK;
} else {
- werase(SP->_slk->win);
- rc = wrefresh(SP->_slk->win);
+ werase(SP_PARM->_slk->win);
+ rc = wrefresh(SP_PARM->_slk->win);
}
}
returnCode(rc);
}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+slk_clear(void)
+{
+ return NCURSES_SP_NAME(slk_clear) (CURRENT_SCREEN);
+}
+#endif
diff --git a/ncurses/base/lib_slkcolor.c b/ncurses/base/lib_slkcolor.c
index b677b65a529a..c1211bcb884a 100644
--- a/ncurses/base/lib_slkcolor.c
+++ b/ncurses/base/lib_slkcolor.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2003,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 *
@@ -27,8 +27,8 @@
****************************************************************************/
/****************************************************************************
- * Author: Juergen Pfeifer, 1998 *
- * and: Thomas E. Dickey 2005 *
+ * Author: Juergen Pfeifer, 1998,2009 *
+ * and: Thomas E. Dickey 2005-on *
****************************************************************************/
/*
@@ -38,19 +38,31 @@
*/
#include <curses.priv.h>
-MODULE_ID("$Id: lib_slkcolor.c,v 1.12 2005/01/28 21:11:53 tom Exp $")
+MODULE_ID("$Id: lib_slkcolor.c,v 1.16 2009/10/24 22:12:21 tom Exp $")
NCURSES_EXPORT(int)
-slk_color(short color_pair_number)
+NCURSES_SP_NAME(slk_color) (NCURSES_SP_DCLx short color_pair_number)
{
- T((T_CALLED("slk_color(%d)"), color_pair_number));
+ int code = ERR;
+
+ T((T_CALLED("slk_color(%p,%d)"), (void *) SP_PARM, color_pair_number));
+
+ if (SP_PARM != 0
+ && SP_PARM->_slk != 0
+ && color_pair_number >= 0
+ && color_pair_number < SP_PARM->_pair_limit) {
+ TR(TRACE_ATTRS, ("... current is %s", _tracech_t(CHREF(SP_PARM->_slk->attr))));
+ SetPair(SP_PARM->_slk->attr, color_pair_number);
+ TR(TRACE_ATTRS, ("new attribute is %s", _tracech_t(CHREF(SP_PARM->_slk->attr))));
+ code = OK;
+ }
+ returnCode(code);
+}
- if (SP != 0 && SP->_slk != 0 &&
- color_pair_number >= 0 && color_pair_number < COLOR_PAIRS) {
- TR(TRACE_ATTRS, ("... current is %s", _tracech_t(CHREF(SP->_slk->attr))));
- SetPair(SP->_slk->attr, color_pair_number);
- TR(TRACE_ATTRS, ("new attribute is %s", _tracech_t(CHREF(SP->_slk->attr))));
- returnCode(OK);
- } else
- returnCode(ERR);
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+slk_color(short color_pair_number)
+{
+ return NCURSES_SP_NAME(slk_color) (CURRENT_SCREEN, color_pair_number);
}
+#endif
diff --git a/ncurses/base/lib_slkinit.c b/ncurses/base/lib_slkinit.c
index c440109b34e6..9cbdfea98430 100644
--- a/ncurses/base/lib_slkinit.c
+++ b/ncurses/base/lib_slkinit.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 *
@@ -30,6 +30,7 @@
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
* and: Thomas E. Dickey 1996-on *
+ * and: Juergen Pfeifer 2009 *
****************************************************************************/
/*
@@ -39,17 +40,41 @@
*/
#include <curses.priv.h>
-MODULE_ID("$Id: lib_slkinit.c,v 1.7 2008/01/12 20:23:39 tom Exp $")
+MODULE_ID("$Id: lib_slkinit.c,v 1.13 2009/10/31 00:10:46 tom Exp $")
+
+#ifdef USE_SP_RIPOFF
+#define SoftkeyFormat SP_PARM->slk_format
+#else
+#define SoftkeyFormat _nc_globals.slk_format
+#endif
NCURSES_EXPORT(int)
-slk_init(int format)
+NCURSES_SP_NAME(slk_init) (NCURSES_SP_DCLx int format)
{
int code = ERR;
- T((T_CALLED("slk_init(%d)"), format));
- if (format >= 0 && format <= 3 && !_nc_globals.slk_format) {
- _nc_globals.slk_format = 1 + format;
- code = _nc_ripoffline(-SLK_LINES(_nc_globals.slk_format), _nc_slk_initialize);
+ START_TRACE();
+ T((T_CALLED("slk_init(%p,%d)"), (void *) SP_PARM, 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(SoftkeyFormat),
+ _nc_slk_initialize);
}
returnCode(code);
}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+slk_init(int format)
+{
+ return NCURSES_SP_NAME(slk_init) (CURRENT_SCREEN_PRE, format);
+}
+#endif
diff --git a/ncurses/base/lib_slklab.c b/ncurses/base/lib_slklab.c
index 42bb4ac1425d..d0b2a230796a 100644
--- a/ncurses/base/lib_slklab.c
+++ b/ncurses/base/lib_slklab.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2000,2003 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2003,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 <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ * and: Juergen Pfeifer, 1998,2009 *
+ * and: Thomas E. Dickey 1998-on *
****************************************************************************/
/*
@@ -38,14 +40,22 @@
*/
#include <curses.priv.h>
-MODULE_ID("$Id: lib_slklab.c,v 1.7 2003/03/29 22:53:48 tom Exp $")
+MODULE_ID("$Id: lib_slklab.c,v 1.10 2009/10/24 22:12:21 tom Exp $")
NCURSES_EXPORT(char *)
-slk_label(int n)
+NCURSES_SP_NAME(slk_label) (NCURSES_SP_DCLx int n)
{
- T((T_CALLED("slk_label(%d)"), n));
+ T((T_CALLED("slk_label(%p,%d)"), (void *) SP_PARM, n));
- if (SP == NULL || SP->_slk == NULL || n < 1 || n > SP->_slk->labcnt)
+ if (SP_PARM == 0 || SP_PARM->_slk == 0 || n < 1 || n > SP_PARM->_slk->labcnt)
returnPtr(0);
- returnPtr(SP->_slk->ent[n - 1].ent_text);
+ returnPtr(SP_PARM->_slk->ent[n - 1].ent_text);
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(char *)
+slk_label(int n)
+{
+ return NCURSES_SP_NAME(slk_label) (CURRENT_SCREEN, n);
}
+#endif
diff --git a/ncurses/base/lib_slkrefr.c b/ncurses/base/lib_slkrefr.c
index cb1beba0e2a1..b06bf8d7f802 100644
--- a/ncurses/base/lib_slkrefr.c
+++ b/ncurses/base/lib_slkrefr.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2006,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2010 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 *
@@ -38,9 +38,18 @@
* Write SLK window to the (virtual) screen.
*/
#include <curses.priv.h>
-#include <term.h> /* num_labels, label_*, plab_norm */
-MODULE_ID("$Id: lib_slkrefr.c,v 1.17 2008/09/27 14:07:53 juergen Exp $")
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
+MODULE_ID("$Id: lib_slkrefr.c,v 1.26 2010/05/01 19:17:28 tom Exp $")
+
+#ifdef USE_TERM_DRIVER
+#define NumLabels InfoOf(SP_PARM).numlabels
+#else
+#define NumLabels num_labels
+#endif
/*
* Paint the info line for the PC style SLK emulation.
@@ -53,7 +62,7 @@ slk_paint_info(WINDOW *win)
if (win && sp && (sp->slk_format == 4)) {
int i;
- mvwhline(win, 0, 0, 0, getmaxx(win));
+ (void) mvwhline(win, 0, 0, 0, getmaxx(win));
wmove(win, 0, 0);
for (i = 0; i < sp->_slk->maxlab; i++) {
@@ -66,31 +75,47 @@ slk_paint_info(WINDOW *win)
* Write the soft labels to the soft-key window.
*/
static void
-slk_intern_refresh(SLK * slk)
+slk_intern_refresh(SCREEN *sp)
{
int i;
- int fmt = SP->slk_format;
+ int fmt;
+ SLK *slk;
+ int numlab;
+
+ if (sp == 0)
+ return;
+
+ slk = sp->_slk;
+ fmt = sp->slk_format;
+ numlab = NumLabels;
+
+ if (slk->hidden)
+ return;
for (i = 0; i < slk->labcnt; i++) {
if (slk->dirty || slk->ent[i].dirty) {
if (slk->ent[i].visible) {
- if (num_labels > 0 && SLK_STDFMT(fmt)) {
+ if (numlab > 0 && SLK_STDFMT(fmt)) {
+#ifdef USE_TERM_DRIVER
+ CallDriver_2(sp, hwlabel, i + 1, slk->ent[i].form_text);
+#else
if (i < num_labels) {
TPUTS_TRACE("plab_norm");
putp(TPARM_2(plab_norm, i + 1, slk->ent[i].form_text));
}
+#endif
} else {
if (fmt == 4)
slk_paint_info(slk->win);
wmove(slk->win, SLK_LINES(fmt) - 1, slk->ent[i].ent_x);
- if (SP->_slk) {
- wattrset(slk->win, AttrOf(SP->_slk->attr));
+ if (sp->_slk) {
+ (void) wattrset(slk->win, AttrOf(sp->_slk->attr));
}
waddstr(slk->win, slk->ent[i].form_text);
/* if we simulate SLK's, it's looking much more
natural to use the current ATTRIBUTE also
for the label window */
- wattrset(slk->win, WINDOW_ATTRS(stdscr));
+ (void) wattrset(slk->win, WINDOW_ATTRS(StdScreen(sp)));
}
}
slk->ent[i].dirty = FALSE;
@@ -98,7 +123,10 @@ slk_intern_refresh(SLK * slk)
}
slk->dirty = FALSE;
- if (num_labels > 0) {
+ if (numlab > 0) {
+#ifdef USE_TERM_DRIVER
+ CallDriver_1(sp, hwlabelOnOff, slk->hidden ? FALSE : TRUE);
+#else
if (slk->hidden) {
TPUTS_TRACE("label_off");
putp(label_off);
@@ -106,6 +134,7 @@ slk_intern_refresh(SLK * slk)
TPUTS_TRACE("label_on");
putp(label_on);
}
+#endif
}
}
@@ -113,32 +142,48 @@ slk_intern_refresh(SLK * slk)
* Refresh the soft labels.
*/
NCURSES_EXPORT(int)
-slk_noutrefresh(void)
+NCURSES_SP_NAME(slk_noutrefresh) (NCURSES_SP_DCL0)
{
- T((T_CALLED("slk_noutrefresh()")));
+ T((T_CALLED("slk_noutrefresh(%p)"), (void *) SP_PARM));
- if (SP == NULL || SP->_slk == NULL)
+ if (SP_PARM == 0 || SP_PARM->_slk == 0)
returnCode(ERR);
- if (SP->_slk->hidden)
+ if (SP_PARM->_slk->hidden)
returnCode(OK);
- slk_intern_refresh(SP->_slk);
+ slk_intern_refresh(SP_PARM);
- returnCode(wnoutrefresh(SP->_slk->win));
+ returnCode(wnoutrefresh(SP_PARM->_slk->win));
}
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+slk_noutrefresh(void)
+{
+ return NCURSES_SP_NAME(slk_noutrefresh) (CURRENT_SCREEN);
+}
+#endif
+
/*
* Refresh the soft labels.
*/
NCURSES_EXPORT(int)
-slk_refresh(void)
+NCURSES_SP_NAME(slk_refresh) (NCURSES_SP_DCL0)
{
- T((T_CALLED("slk_refresh()")));
+ T((T_CALLED("slk_refresh(%p)"), (void *) SP_PARM));
- if (SP == NULL || SP->_slk == NULL)
+ if (SP_PARM == 0 || SP_PARM->_slk == 0)
returnCode(ERR);
- if (SP->_slk->hidden)
+ if (SP_PARM->_slk->hidden)
returnCode(OK);
- slk_intern_refresh(SP->_slk);
+ slk_intern_refresh(SP_PARM);
+
+ returnCode(wrefresh(SP_PARM->_slk->win));
+}
- returnCode(wrefresh(SP->_slk->win));
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+slk_refresh(void)
+{
+ return NCURSES_SP_NAME(slk_refresh) (CURRENT_SCREEN);
}
+#endif
diff --git a/ncurses/base/lib_slkset.c b/ncurses/base/lib_slkset.c
index e19f88e60ac4..91483f103b23 100644
--- a/ncurses/base/lib_slkset.c
+++ b/ncurses/base/lib_slkset.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2005,2007 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2010 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 *
@@ -44,10 +44,10 @@
#endif
#endif
-MODULE_ID("$Id: lib_slkset.c,v 1.17 2007/10/13 20:08:46 tom Exp $")
+MODULE_ID("$Id: lib_slkset.c,v 1.21 2010/12/25 23:43:58 tom Exp $")
NCURSES_EXPORT(int)
-slk_set(int i, const char *astr, int format)
+NCURSES_SP_NAME(slk_set) (NCURSES_SP_DCLx int i, const char *astr, int format)
{
SLK *slk;
int offset;
@@ -57,20 +57,20 @@ slk_set(int i, const char *astr, int format)
const char *str = astr;
const char *p;
- T((T_CALLED("slk_set(%d, \"%s\", %d)"), i, str, format));
+ T((T_CALLED("slk_set(%p, %d, \"%s\", %d)"), (void *) SP_PARM, i, str, format));
- if (SP == 0
- || (slk = SP->_slk) == 0
+ if (SP_PARM == 0
+ || (slk = SP_PARM->_slk) == 0
|| i < 1
|| i > slk->labcnt
|| format < 0
|| format > 2)
returnCode(ERR);
- if (str == NULL)
+ if (str == 0)
str = "";
--i; /* Adjust numbering of labels */
- limit = MAX_SKEY_LEN(SP->slk_format);
+ limit = MAX_SKEY_LEN(SP_PARM->slk_format);
while (isspace(UChar(*str)))
str++; /* skip over leading spaces */
p = str;
@@ -94,12 +94,12 @@ slk_set(int i, const char *astr, int format)
numcols += wcwidth(wc);
p += need;
}
- numchrs = (p - str);
+ numchrs = (int) (p - str);
#else
while (isprint(UChar(*p)))
p++; /* The first non-print stops */
- numcols = (p - str);
+ numcols = (int) (p - str);
if (numcols > limit)
numcols = limit;
numchrs = numcols;
@@ -147,3 +147,11 @@ slk_set(int i, const char *astr, int format)
slk->ent[i].dirty = TRUE;
returnCode(OK);
}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+slk_set(int i, const char *astr, int format)
+{
+ return NCURSES_SP_NAME(slk_set) (CURRENT_SCREEN, i, astr, format);
+}
+#endif
diff --git a/ncurses/base/lib_slktouch.c b/ncurses/base/lib_slktouch.c
index 5eb5df385b82..ba77fd2375b7 100644
--- a/ncurses/base/lib_slktouch.c
+++ b/ncurses/base/lib_slktouch.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2000,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,8 +27,8 @@
****************************************************************************/
/****************************************************************************
- * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
- * and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ * Author: Juergen Pfeifer 1997,2009 *
+ * and: Thomas E. Dickey 1996-on *
****************************************************************************/
/*
@@ -38,16 +38,24 @@
*/
#include <curses.priv.h>
-MODULE_ID("$Id: lib_slktouch.c,v 1.5 2000/12/10 02:43:27 tom Exp $")
+MODULE_ID("$Id: lib_slktouch.c,v 1.8 2009/10/24 22:12:21 tom Exp $")
NCURSES_EXPORT(int)
-slk_touch(void)
+NCURSES_SP_NAME(slk_touch) (NCURSES_SP_DCL0)
{
- T((T_CALLED("slk_touch()")));
+ T((T_CALLED("slk_touch(%p)"), (void *) SP_PARM));
- if (SP == NULL || SP->_slk == NULL)
+ if (SP_PARM == 0 || SP_PARM->_slk == 0)
returnCode(ERR);
- SP->_slk->dirty = TRUE;
+ SP_PARM->_slk->dirty = TRUE;
returnCode(OK);
}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+slk_touch(void)
+{
+ return NCURSES_SP_NAME(slk_touch) (CURRENT_SCREEN);
+}
+#endif
diff --git a/ncurses/base/lib_touch.c b/ncurses/base/lib_touch.c
index 2ac21f2e0d1f..8023c7058027 100644
--- a/ncurses/base/lib_touch.c
+++ b/ncurses/base/lib_touch.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2010 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 *
@@ -43,12 +43,12 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_touch.c,v 1.9 2000/12/10 02:43:27 tom Exp $")
+MODULE_ID("$Id: lib_touch.c,v 1.11 2010/12/19 01:22:58 tom Exp $")
NCURSES_EXPORT(bool)
is_linetouched(WINDOW *win, int line)
{
- T((T_CALLED("is_linetouched(%p,%d)"), win, line));
+ T((T_CALLED("is_linetouched(%p,%d)"), (void *) win, line));
/* XSI doesn't define any error */
if (!win || (line > win->_maxy) || (line < 0))
@@ -62,7 +62,7 @@ is_wintouched(WINDOW *win)
{
int i;
- T((T_CALLED("is_wintouched(%p)"), win));
+ T((T_CALLED("is_wintouched(%p)"), (void *) win));
if (win)
for (i = 0; i <= win->_maxy; i++)
@@ -76,7 +76,7 @@ wtouchln(WINDOW *win, int y, int n, int changed)
{
int i;
- T((T_CALLED("wtouchln(%p,%d,%d,%d)"), win, y, n, changed));
+ T((T_CALLED("wtouchln(%p,%d,%d,%d)"), (void *) win, y, n, changed));
if (!win || (n < 0) || (y < 0) || (y > win->_maxy))
returnCode(ERR);
@@ -85,7 +85,9 @@ wtouchln(WINDOW *win, int y, int n, int changed)
if (i > win->_maxy)
break;
win->_line[i].firstchar = changed ? 0 : _NOCHANGE;
- win->_line[i].lastchar = changed ? win->_maxx : _NOCHANGE;
+ win->_line[i].lastchar = (NCURSES_SIZE_T) (changed
+ ? win->_maxx
+ : _NOCHANGE);
}
returnCode(OK);
}
diff --git a/ncurses/base/lib_ungetch.c b/ncurses/base/lib_ungetch.c
index 8742f867fa94..63a14cff7594 100644
--- a/ncurses/base/lib_ungetch.c
+++ b/ncurses/base/lib_ungetch.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 *
@@ -30,6 +30,7 @@
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
* and: Thomas E. Dickey 1996-on *
+ * and: Juergen Pfeifer 2009 *
****************************************************************************/
/*
@@ -41,7 +42,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_ungetch.c,v 1.11 2008/05/31 16:44:54 tom Exp $")
+MODULE_ID("$Id: lib_ungetch.c,v 1.14 2009/10/24 22:12:21 tom Exp $")
#include <fifo_defs.h>
@@ -57,10 +58,12 @@ _nc_fifo_dump(SCREEN *sp)
#endif /* TRACE */
NCURSES_EXPORT(int)
-_nc_ungetch(SCREEN *sp, int ch)
+safe_ungetch(SCREEN *sp, int ch)
{
int rc = ERR;
+ T((T_CALLED("ungetch(%p,%s)"), (void *) sp, _nc_tracechar(sp, ch)));
+
if (tail != -1) {
if (head == -1) {
head = 0;
@@ -79,12 +82,11 @@ _nc_ungetch(SCREEN *sp, int ch)
#endif
rc = OK;
}
- return rc;
+ returnCode(rc);
}
NCURSES_EXPORT(int)
ungetch(int ch)
{
- T((T_CALLED("ungetch(%s)"), _nc_tracechar(SP, ch)));
- returnCode(_nc_ungetch(SP, ch));
+ return safe_ungetch(CURRENT_SCREEN, ch);
}
diff --git a/ncurses/base/lib_vline.c b/ncurses/base/lib_vline.c
index 1a2537e7eb6a..2f3148eca77c 100644
--- a/ncurses/base/lib_vline.c
+++ b/ncurses/base/lib_vline.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2001,2006 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2010 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 *
@@ -40,16 +40,16 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_vline.c,v 1.10 2006/03/11 21:52:19 tom Exp $")
+MODULE_ID("$Id: lib_vline.c,v 1.12 2010/12/19 01:22:58 tom Exp $")
NCURSES_EXPORT(int)
wvline(WINDOW *win, chtype ch, int n)
{
int code = ERR;
- NCURSES_SIZE_T row, col;
- NCURSES_SIZE_T end;
+ int row, col;
+ int end;
- T((T_CALLED("wvline(%p,%s,%d)"), win, _tracechtype(ch), n));
+ T((T_CALLED("wvline(%p,%s,%d)"), (void *) win, _tracechtype(ch), n));
if (win) {
NCURSES_CH_T wch;
diff --git a/ncurses/base/lib_wattroff.c b/ncurses/base/lib_wattroff.c
index bf2020e06027..fff0b395f1d8 100644
--- a/ncurses/base/lib_wattroff.c
+++ b/ncurses/base/lib_wattroff.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2006,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 *
@@ -42,12 +42,12 @@
#include <curses.priv.h>
#include <ctype.h>
-MODULE_ID("$Id: lib_wattroff.c,v 1.9 2006/05/27 19:30:33 tom Exp $")
+MODULE_ID("$Id: lib_wattroff.c,v 1.10 2009/10/24 22:36:08 tom Exp $")
NCURSES_EXPORT(int)
wattr_off(WINDOW *win, attr_t at, void *opts GCC_UNUSED)
{
- T((T_CALLED("wattr_off(%p,%s)"), win, _traceattr(at)));
+ T((T_CALLED("wattr_off(%p,%s)"), (void *) win, _traceattr(at)));
if (win) {
T(("... current %s (%d)",
_traceattr(WINDOW_ATTRS(win)),
diff --git a/ncurses/base/lib_wattron.c b/ncurses/base/lib_wattron.c
index 2e17d965e94a..3806285e2a38 100644
--- a/ncurses/base/lib_wattron.c
+++ b/ncurses/base/lib_wattron.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2010 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 *
@@ -42,12 +42,12 @@
#include <curses.priv.h>
#include <ctype.h>
-MODULE_ID("$Id: lib_wattron.c,v 1.9 2006/05/27 19:30:46 tom Exp $")
+MODULE_ID("$Id: lib_wattron.c,v 1.11 2010/03/31 23:38:02 tom Exp $")
NCURSES_EXPORT(int)
wattr_on(WINDOW *win, attr_t at, void *opts GCC_UNUSED)
{
- T((T_CALLED("wattr_on(%p,%s)"), win, _traceattr(at)));
+ T((T_CALLED("wattr_on(%p,%s)"), (void *) win, _traceattr(at)));
if (win != 0) {
T(("... current %s (%d)",
_traceattr(WINDOW_ATTRS(win)),
@@ -55,7 +55,7 @@ wattr_on(WINDOW *win, attr_t at, void *opts GCC_UNUSED)
if_EXT_COLORS({
if (at & A_COLOR)
- win->_color = PAIR_NUMBER(at);
+ win->_color = PairNumber(at);
});
toggle_attr_on(WINDOW_ATTRS(win), at);
returnCode(OK);
diff --git a/ncurses/base/lib_winch.c b/ncurses/base/lib_winch.c
index 18da9c594945..7e75f85bf390 100644
--- a/ncurses/base/lib_winch.c
+++ b/ncurses/base/lib_winch.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2010 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 *
@@ -39,16 +39,16 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_winch.c,v 1.5 2001/06/02 23:42:08 skimo Exp $")
+MODULE_ID("$Id: lib_winch.c,v 1.8 2010/12/19 01:22:58 tom Exp $")
NCURSES_EXPORT(chtype)
winch(WINDOW *win)
{
- T((T_CALLED("winch(%p)"), win));
+ T((T_CALLED("winch(%p)"), (void *) win));
if (win != 0) {
- returnChar(CharOf(win->_line[win->_cury].text[win->_curx]) |
- AttrOf(win->_line[win->_cury].text[win->_curx]));
+ returnChtype((chtype) CharOf(win->_line[win->_cury].text[win->_curx])
+ | AttrOf(win->_line[win->_cury].text[win->_curx]));
} else {
- returnChar(0);
+ returnChtype(0);
}
}
diff --git a/ncurses/base/lib_window.c b/ncurses/base/lib_window.c
index a3236e206a37..4baa36943c44 100644
--- a/ncurses/base/lib_window.c
+++ b/ncurses/base/lib_window.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2010 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 *
@@ -39,7 +39,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_window.c,v 1.25 2008/06/07 14:12:56 tom Exp $")
+MODULE_ID("$Id: lib_window.c,v 1.29 2010/12/19 01:47:22 tom Exp $")
NCURSES_EXPORT(void)
_nc_synchook(WINDOW *win)
@@ -57,32 +57,30 @@ mvderwin(WINDOW *win, int y, int x)
{
WINDOW *orig;
int i;
+ int rc = ERR;
- T((T_CALLED("mvderwin(%p,%d,%d)"), win, y, x));
+ T((T_CALLED("mvderwin(%p,%d,%d)"), (void *) win, y, x));
- if (win && (orig = win->_parent)) {
- if (win->_parx == x && win->_pary == y)
- returnCode(OK);
- if (x < 0 || y < 0)
- returnCode(ERR);
- if ((x + getmaxx(win) > getmaxx(orig)) ||
- (y + getmaxy(win) > getmaxy(orig)))
- returnCode(ERR);
- } else
- returnCode(ERR);
- wsyncup(win);
- win->_parx = x;
- win->_pary = y;
- for (i = 0; i < getmaxy(win); i++)
- win->_line[i].text = &(orig->_line[y++].text[x]);
- returnCode(OK);
+ if (win != 0
+ && (orig = win->_parent) != 0
+ && (x >= 0 && y >= 0)
+ && (x + getmaxx(win) <= getmaxx(orig))
+ && (y + getmaxy(win) <= getmaxy(orig))) {
+ wsyncup(win);
+ win->_parx = x;
+ win->_pary = y;
+ for (i = 0; i < getmaxy(win); i++)
+ win->_line[i].text = &(orig->_line[y++].text[x]);
+ rc = OK;
+ }
+ returnCode(rc);
}
NCURSES_EXPORT(int)
syncok(WINDOW *win, bool bf)
/* enable/disable automatic wsyncup() on each change to window */
{
- T((T_CALLED("syncok(%p,%d)"), win, bf));
+ T((T_CALLED("syncok(%p,%d)"), (void *) win, bf));
if (win) {
win->_sync = bf;
@@ -98,7 +96,7 @@ wsyncup(WINDOW *win)
{
WINDOW *wp;
- T((T_CALLED("wsyncup(%p)"), win));
+ T((T_CALLED("wsyncup(%p)"), (void *) win));
if (win && win->_parent) {
for (wp = win; wp->_parent; wp = wp->_parent) {
int y;
@@ -128,7 +126,7 @@ wsyncdown(WINDOW *win)
/* mark changed every cell in win that is changed in any of its ancestors */
/* Rewritten by J. Pfeifer, 1-Apr-96 (don't even think that...) */
{
- T((T_CALLED("wsyncdown(%p)"), win));
+ T((T_CALLED("wsyncdown(%p)"), (void *) win));
if (win && win->_parent) {
WINDOW *pp = win->_parent;
@@ -167,7 +165,7 @@ wcursyncup(WINDOW *win)
{
WINDOW *wp;
- T((T_CALLED("wcursyncup(%p)"), win));
+ T((T_CALLED("wcursyncup(%p)"), (void *) win));
for (wp = win; wp && wp->_parent; wp = wp->_parent) {
wmove(wp->_parent, wp->_pary + wp->_cury, wp->_parx + wp->_curx);
}
@@ -182,19 +180,23 @@ dupwin(WINDOW *win)
size_t linesize;
int i;
- T((T_CALLED("dupwin(%p)"), win));
+ T((T_CALLED("dupwin(%p)"), (void *) win));
if (win != 0) {
-
+#if NCURSES_SP_FUNCS
+ SCREEN *sp = _nc_screen_of(win);
+#endif
_nc_lock_global(curses);
if (win->_flags & _ISPAD) {
- nwin = newpad(win->_maxy + 1,
- win->_maxx + 1);
+ nwin = NCURSES_SP_NAME(newpad) (NCURSES_SP_ARGx
+ win->_maxy + 1,
+ win->_maxx + 1);
} else {
- nwin = newwin(win->_maxy + 1,
- win->_maxx + 1,
- win->_begy,
- win->_begx);
+ nwin = NCURSES_SP_NAME(newwin) (NCURSES_SP_ARGx
+ win->_maxy + 1,
+ win->_maxx + 1,
+ win->_begy,
+ win->_begx);
}
if (nwin != 0) {
@@ -237,7 +239,7 @@ dupwin(WINDOW *win)
if (win->_flags & _ISPAD)
nwin->_pad = win->_pad;
- linesize = (win->_maxx + 1) * sizeof(NCURSES_CH_T);
+ linesize = (unsigned) (win->_maxx + 1) * sizeof(NCURSES_CH_T);
for (i = 0; i <= nwin->_maxy; i++) {
memcpy(nwin->_line[i].text, win->_line[i].text, linesize);
nwin->_line[i].firstchar = win->_line[i].firstchar;
diff --git a/ncurses/base/nc_panel.c b/ncurses/base/nc_panel.c
index 59bfbbe86ef6..69b10bc0c662 100644
--- a/ncurses/base/nc_panel.c
+++ b/ncurses/base/nc_panel.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2000,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 *
@@ -32,10 +32,22 @@
#include <curses.priv.h>
-MODULE_ID("$Id: nc_panel.c,v 1.4 2000/12/10 02:43:28 tom Exp $")
+MODULE_ID("$Id: nc_panel.c,v 1.5 2009/04/11 21:05:10 tom Exp $")
NCURSES_EXPORT(struct panelhook *)
+NCURSES_SP_NAME(_nc_panelhook) (NCURSES_SP_DCL0)
+{
+ return (SP_PARM
+ ? &(SP_PARM->_panelHook)
+ : (CURRENT_SCREEN
+ ? &(CURRENT_SCREEN->_panelHook)
+ : 0));
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(struct panelhook *)
_nc_panelhook(void)
{
- return (SP ? &(SP->_panelHook) : NULL);
+ return NCURSES_SP_NAME(_nc_panelhook) (CURRENT_SCREEN);
}
+#endif
diff --git a/ncurses/base/resizeterm.c b/ncurses/base/resizeterm.c
index a94cfc3aaaa8..3f1d36e89d7a 100644
--- a/ncurses/base/resizeterm.c
+++ b/ncurses/base/resizeterm.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2011 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 *
@@ -28,6 +28,7 @@
/****************************************************************************
* Author: Thomas E. Dickey *
+ * and: Juergen Pfeifer *
****************************************************************************/
/*
@@ -39,11 +40,12 @@
*/
#include <curses.priv.h>
-#include <term.h>
-MODULE_ID("$Id: resizeterm.c,v 1.34 2008/06/07 13:58:40 tom Exp $")
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
-#define stolen_lines (screen_lines - SP->_lines_avail)
+MODULE_ID("$Id: resizeterm.c,v 1.43 2011/01/10 01:34:49 tom Exp $")
/*
* If we're trying to be reentrant, do not want any local statics.
@@ -64,18 +66,23 @@ static int current_cols;
static void
show_window_sizes(const char *name)
{
+ SCREEN *sp;
WINDOWLIST *wp;
_nc_lock_global(curses);
- _tracef("%s resizing: %2d x %2d (%2d x %2d)", name, LINES, COLS,
- screen_lines, screen_columns);
- for (each_window(wp)) {
- _tracef(" window %p is %2ld x %2ld at %2ld,%2ld",
- &(wp->win),
- (long) wp->win._maxy + 1,
- (long) wp->win._maxx + 1,
- (long) wp->win._begy,
- (long) wp->win._begx);
+ for (each_screen(sp)) {
+ _tracef("%s resizing: %p: %2d x %2d (%2d x %2d)", name, (void *) sp,
+ *(ptrLines(sp)),
+ *(ptrCols(sp)),
+ screen_lines(sp), screen_columns(sp));
+ for (each_window(sp, wp)) {
+ _tracef(" window %p is %2ld x %2ld at %2ld,%2ld",
+ (void *) &(wp->win),
+ (long) wp->win._maxy + 1,
+ (long) wp->win._maxx + 1,
+ (long) wp->win._begy,
+ (long) wp->win._begx);
+ }
}
_nc_unlock_global(curses);
}
@@ -86,15 +93,23 @@ show_window_sizes(const char *name)
* structure's size.
*/
NCURSES_EXPORT(bool)
-is_term_resized(int ToLines, int ToCols)
+NCURSES_SP_NAME(is_term_resized) (NCURSES_SP_DCLx int ToLines, int ToCols)
{
- T((T_CALLED("is_term_resized(%d, %d)"), ToLines, ToCols));
+ T((T_CALLED("is_term_resized(%p, %d, %d)"), (void *) SP_PARM, ToLines, ToCols));
returnCode(ToLines > 0
&& ToCols > 0
- && (ToLines != screen_lines
- || ToCols != screen_columns));
+ && (ToLines != screen_lines(SP_PARM)
+ || ToCols != screen_columns(SP_PARM)));
}
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(bool)
+is_term_resized(int ToLines, int ToCols)
+{
+ return NCURSES_SP_NAME(is_term_resized) (CURRENT_SCREEN, ToLines, ToCols);
+}
+#endif
+
/*
*/
static ripoff_t *
@@ -104,6 +119,9 @@ ripped_window(WINDOW *win)
ripoff_t *rop;
if (win != 0) {
+#ifdef USE_SP_RIPOFF
+ SCREEN *sp = _nc_screen_of(win);
+#endif
for (each_ripoff(rop)) {
if (rop->win == win && rop->line != 0) {
result = rop;
@@ -125,6 +143,9 @@ ripped_bottom(WINDOW *win)
ripoff_t *rop;
if (win != 0) {
+#ifdef USE_SP_RIPOFF
+ SCREEN *sp = _nc_screen_of(win);
+#endif
for (each_ripoff(rop)) {
if (rop->line < 0) {
result -= rop->line;
@@ -146,9 +167,12 @@ child_depth(WINDOW *cmp)
int depth = 0;
if (cmp != 0) {
+#ifdef USE_SP_WINDOWLIST
+ SCREEN *sp = _nc_screen_of(cmp);
+#endif
WINDOWLIST *wp;
- for (each_window(wp)) {
+ for (each_window(sp, wp)) {
WINDOW *tst = &(wp->win);
if (tst->_parent == cmp) {
depth = 1 + child_depth(tst);
@@ -184,13 +208,13 @@ static int
adjust_window(WINDOW *win, int ToLines, int ToCols, int stolen EXTRA_DCLS)
{
int result;
- int bottom = CurLines + SP->_topstolen - stolen;
+ int bottom = CurLines + _nc_screen_of(win)->_topstolen - stolen;
int myLines = win->_maxy + 1;
int myCols = win->_maxx + 1;
ripoff_t *rop = ripped_window(win);
T((T_CALLED("adjust_window(%p,%d,%d)%s depth %d/%d currently %ldx%ld at %ld,%ld"),
- win, ToLines, ToCols,
+ (void *) win, ToLines, ToCols,
(rop != 0) ? " (rip)" : "",
parent_depth(win),
child_depth(win),
@@ -202,13 +226,19 @@ adjust_window(WINDOW *win, int ToLines, int ToCols, int stolen EXTRA_DCLS)
* If it is a ripped-off window at the bottom of the screen, simply
* move it to the same relative position.
*/
- win->_begy = ToLines - ripped_bottom(win) - 0 - win->_yoffset;
+ win->_begy = (NCURSES_SIZE_T) (ToLines - ripped_bottom(win) - 0 - win->_yoffset);
+ if (rop->hook == _nc_slk_initialize)
+ _nc_format_slks(
+#if NCURSES_SP_FUNCS
+ _nc_screen_of(win),
+#endif
+ ToCols);
} else if (win->_begy >= bottom) {
/*
* If it is below the bottom of the new screen, move up by the same
* amount that the screen shrank.
*/
- win->_begy += (ToLines - CurLines);
+ win->_begy = (NCURSES_SIZE_T) (win->_begy + (ToLines - CurLines));
} else {
if (myLines == (CurLines - stolen)
&& ToLines != CurLines) {
@@ -239,19 +269,19 @@ adjust_window(WINDOW *win, int ToLines, int ToCols, int stolen EXTRA_DCLS)
* children, decrease those to fit, then decrease the containing window, etc.
*/
static int
-decrease_size(int ToLines, int ToCols, int stolen EXTRA_DCLS)
+decrease_size(NCURSES_SP_DCLx int ToLines, int ToCols, int stolen EXTRA_DCLS)
{
bool found;
int depth = 0;
WINDOWLIST *wp;
- T((T_CALLED("decrease_size(%d, %d)"), ToLines, ToCols));
+ T((T_CALLED("decrease_size(%p, %d, %d)"), (void *) SP_PARM, ToLines, ToCols));
do {
found = FALSE;
TR(TRACE_UPDATE, ("decreasing size of windows to %dx%d, depth=%d",
ToLines, ToCols, depth));
- for (each_window(wp)) {
+ for (each_window(SP_PARM, wp)) {
WINDOW *win = &(wp->win);
if (!(win->_flags & _ISPAD)) {
@@ -273,19 +303,19 @@ decrease_size(int ToLines, int ToCols, int stolen EXTRA_DCLS)
* parent, increase those to fit, then increase the contained window, etc.
*/
static int
-increase_size(int ToLines, int ToCols, int stolen EXTRA_DCLS)
+increase_size(NCURSES_SP_DCLx int ToLines, int ToCols, int stolen EXTRA_DCLS)
{
bool found;
int depth = 0;
WINDOWLIST *wp;
- T((T_CALLED("increase_size(%d, %d)"), ToLines, ToCols));
+ T((T_CALLED("increase_size(%p, %d, %d)"), (void *) SP_PARM, ToLines, ToCols));
do {
found = FALSE;
TR(TRACE_UPDATE, ("increasing size of windows to %dx%d, depth=%d",
ToLines, ToCols, depth));
- for (each_window(wp)) {
+ for (each_window(SP_PARM, wp)) {
WINDOW *win = &(wp->win);
if (!(win->_flags & _ISPAD)) {
@@ -307,25 +337,26 @@ increase_size(int ToLines, int ToCols, int stolen EXTRA_DCLS)
* such as ungetch().
*/
NCURSES_EXPORT(int)
-resize_term(int ToLines, int ToCols)
+NCURSES_SP_NAME(resize_term) (NCURSES_SP_DCLx int ToLines, int ToCols)
{
int result = OK EXTRA_ARGS;
int was_stolen;
- T((T_CALLED("resize_term(%d,%d) old(%d,%d)"),
- ToLines, ToCols,
- screen_lines, screen_columns));
+ T((T_CALLED("resize_term(%p,%d,%d) old(%d,%d)"),
+ (void *) SP_PARM, ToLines, ToCols,
+ (SP_PARM == 0) ? -1 : screen_lines(SP_PARM),
+ (SP_PARM == 0) ? -1 : screen_columns(SP_PARM)));
- if (SP == 0) {
+ if (SP_PARM == 0) {
returnCode(ERR);
}
- _nc_lock_global(curses);
+ _nc_nonsp_lock_global(curses);
- was_stolen = (screen_lines - SP->_lines_avail);
- if (is_term_resized(ToLines, ToCols)) {
- int myLines = CurLines = screen_lines;
- int myCols = CurCols = screen_columns;
+ was_stolen = (screen_lines(SP_PARM) - SP_PARM->_lines_avail);
+ if (NCURSES_SP_NAME(is_term_resized) (NCURSES_SP_ARGx ToLines, ToCols)) {
+ int myLines = CurLines = screen_lines(SP_PARM);
+ int myCols = CurCols = screen_columns(SP_PARM);
#ifdef TRACE
if (USE_TRACEF(TRACE_UPDATE)) {
@@ -333,33 +364,42 @@ resize_term(int ToLines, int ToCols)
_nc_unlock_global(tracef);
}
#endif
- if (ToLines > screen_lines) {
- increase_size(myLines = ToLines, myCols, was_stolen EXTRA_ARGS);
+ if (ToLines > screen_lines(SP_PARM)) {
+ increase_size(NCURSES_SP_ARGx
+ myLines = ToLines, myCols, was_stolen EXTRA_ARGS);
CurLines = myLines;
CurCols = myCols;
}
- if (ToCols > screen_columns) {
- increase_size(myLines, myCols = ToCols, was_stolen EXTRA_ARGS);
+ if (ToCols > screen_columns(SP_PARM)) {
+ increase_size(NCURSES_SP_ARGx
+ myLines, myCols = ToCols, was_stolen EXTRA_ARGS);
CurLines = myLines;
CurCols = myCols;
}
if (ToLines < myLines ||
ToCols < myCols) {
- decrease_size(ToLines, ToCols, was_stolen EXTRA_ARGS);
+ decrease_size(NCURSES_SP_ARGx ToLines, ToCols, was_stolen EXTRA_ARGS);
}
- screen_lines = lines = ToLines;
- screen_columns = columns = ToCols;
+ screen_lines(SP_PARM) = (NCURSES_SIZE_T) ToLines;
+ screen_columns(SP_PARM) = (NCURSES_SIZE_T) ToCols;
- SP->_lines_avail = lines - was_stolen;
+#ifdef USE_TERM_DRIVER
+ CallDriver_2(SP_PARM, setsize, ToLines, ToCols);
+#else
+ lines = (NCURSES_SIZE_T) ToLines;
+ columns = (NCURSES_SIZE_T) ToCols;
+#endif
- if (SP->oldhash) {
- FreeAndNull(SP->oldhash);
+ SP_PARM->_lines_avail = (NCURSES_SIZE_T) (ToLines - was_stolen);
+
+ if (SP_PARM->oldhash) {
+ FreeAndNull(SP_PARM->oldhash);
}
- if (SP->newhash) {
- FreeAndNull(SP->newhash);
+ if (SP_PARM->newhash) {
+ FreeAndNull(SP_PARM->newhash);
}
#ifdef TRACE
if (USE_TRACEF(TRACE_UPDATE)) {
@@ -378,11 +418,23 @@ resize_term(int ToLines, int ToCols)
SET_LINES(ToLines - was_stolen);
SET_COLS(ToCols);
- _nc_unlock_global(curses);
+ _nc_nonsp_unlock_global(curses);
returnCode(result);
}
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+resize_term(int ToLines, int ToCols)
+{
+ int res = ERR;
+ _nc_sp_lock_global(curses);
+ res = NCURSES_SP_NAME(resize_term) (CURRENT_SCREEN, ToLines, ToCols);
+ _nc_sp_unlock_global(curses);
+ return (res);
+}
+#endif
+
/*
* This function reallocates NCURSES window structures. It is invoked in
* response to a SIGWINCH interrupt. Other user-defined windows may also need
@@ -392,34 +444,35 @@ resize_term(int ToLines, int ToCols)
* invoked directly from the signal handler.
*/
NCURSES_EXPORT(int)
-resizeterm(int ToLines, int ToCols)
+NCURSES_SP_NAME(resizeterm) (NCURSES_SP_DCLx int ToLines, int ToCols)
{
int result = ERR;
- T((T_CALLED("resizeterm(%d,%d) old(%d,%d)"),
- ToLines, ToCols,
- screen_lines, screen_columns));
+ T((T_CALLED("resizeterm(%p, %d,%d) old(%d,%d)"),
+ (void *) SP_PARM, ToLines, ToCols,
+ (SP_PARM == 0) ? -1 : screen_lines(SP_PARM),
+ (SP_PARM == 0) ? -1 : screen_columns(SP_PARM)));
- if (SP != 0) {
+ if (SP_PARM != 0) {
result = OK;
- SP->_sig_winch = FALSE;
+ SP_PARM->_sig_winch = FALSE;
- if (is_term_resized(ToLines, ToCols)) {
+ if (NCURSES_SP_NAME(is_term_resized) (NCURSES_SP_ARGx ToLines, ToCols)) {
#if USE_SIGWINCH
ripoff_t *rop;
- bool slk_visible = (SP != 0
- && SP->_slk != 0
- && !(SP->_slk->hidden));
+ bool slk_visible = (SP_PARM != 0
+ && SP_PARM->_slk != 0
+ && !(SP_PARM->_slk->hidden));
if (slk_visible) {
slk_clear();
}
#endif
- result = resize_term(ToLines, ToCols);
+ result = NCURSES_SP_NAME(resize_term) (NCURSES_SP_ARGx ToLines, ToCols);
#if USE_SIGWINCH
- _nc_ungetch(SP, KEY_RESIZE); /* so application can know this */
- clearok(curscr, TRUE); /* screen contents are unknown */
+ safe_ungetch(SP_PARM, KEY_RESIZE); /* so application can know this */
+ clearok(CurScreen(SP_PARM), TRUE); /* screen contents are unknown */
/* ripped-off lines are a special case: if we did not lengthen
* them, we haven't moved them either. repaint them, too.
@@ -429,7 +482,7 @@ resizeterm(int ToLines, int ToCols)
* not know which are really on top.
*/
for (each_ripoff(rop)) {
- if (rop->win != stdscr
+ if (rop->win != StdScreen(SP_PARM)
&& rop->win != 0
&& rop->line < 0) {
@@ -442,10 +495,9 @@ resizeterm(int ToLines, int ToCols)
/* soft-keys are a special case: we _know_ how to repaint them */
if (slk_visible) {
- slk_restore();
- slk_touch();
-
- slk_refresh();
+ NCURSES_SP_NAME(slk_restore) (NCURSES_SP_ARG);
+ NCURSES_SP_NAME(slk_touch) (NCURSES_SP_ARG);
+ NCURSES_SP_NAME(slk_refresh) (NCURSES_SP_ARG);
}
#endif
}
@@ -453,3 +505,11 @@ resizeterm(int ToLines, int ToCols)
returnCode(result);
}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+resizeterm(int ToLines, int ToCols)
+{
+ return NCURSES_SP_NAME(resizeterm) (CURRENT_SCREEN, ToLines, ToCols);
+}
+#endif
diff --git a/ncurses/base/safe_sprintf.c b/ncurses/base/safe_sprintf.c
index 8fc5d89dd210..e73307bac282 100644
--- a/ncurses/base/safe_sprintf.c
+++ b/ncurses/base/safe_sprintf.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2003,2007 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2010 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 *
@@ -33,7 +33,7 @@
#include <curses.priv.h>
#include <ctype.h>
-MODULE_ID("$Id: safe_sprintf.c,v 1.20 2007/04/21 22:28:06 tom Exp $")
+MODULE_ID("$Id: safe_sprintf.c,v 1.24 2010/06/05 22:22:27 tom Exp $")
#if USE_SAFE_SPRINTF
@@ -111,7 +111,7 @@ _nc_printf_length(const char *fmt, va_list ap)
}
sprintf(fmt_arg, "%d", ival);
fmt_len += strlen(fmt_arg);
- if ((format = realloc(format, fmt_len)) == 0) {
+ if ((format = _nc_doalloc(format, fmt_len)) == 0) {
return -1;
}
strcpy(&format[--f], fmt_arg);
@@ -214,13 +214,20 @@ _nc_printf_length(const char *fmt, va_list ap)
* Wrapper for vsprintf that allocates a buffer big enough to hold the result.
*/
NCURSES_EXPORT(char *)
-_nc_printf_string(const char *fmt, va_list ap)
+NCURSES_SP_NAME(_nc_printf_string) (NCURSES_SP_DCLx
+ const char *fmt,
+ va_list ap)
{
char *result = 0;
if (fmt != 0) {
#if USE_SAFE_SPRINTF
- int len = _nc_printf_length(fmt, ap);
+ va_list ap2;
+ int len;
+
+ begin_va_copy(ap2, ap);
+ len = _nc_printf_length(fmt, ap2);
+ end_va_copy(ap2);
if ((int) my_length < len + 1) {
my_length = 2 * (len + 1);
@@ -237,12 +244,12 @@ _nc_printf_string(const char *fmt, va_list ap)
#define MyCols _nc_globals.safeprint_cols
#define MyRows _nc_globals.safeprint_rows
- if (screen_lines > MyRows || screen_columns > MyCols) {
- if (screen_lines > MyRows)
- MyRows = screen_lines;
- if (screen_columns > MyCols)
- MyCols = screen_columns;
- my_length = (MyRows * (MyCols + 1)) + 1;
+ if (screen_lines(SP_PARM) > MyRows || screen_columns(SP_PARM) > MyCols) {
+ if (screen_lines(SP_PARM) > MyRows)
+ MyRows = screen_lines(SP_PARM);
+ if (screen_columns(SP_PARM) > MyCols)
+ MyCols = screen_columns(SP_PARM);
+ my_length = (size_t) (MyRows * (MyCols + 1)) + 1;
my_buffer = typeRealloc(char, my_length, my_buffer);
}
@@ -262,3 +269,11 @@ _nc_printf_string(const char *fmt, va_list ap)
}
return result;
}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(char *)
+_nc_printf_string(const char *fmt, va_list ap)
+{
+ return NCURSES_SP_NAME(_nc_printf_string) (CURRENT_SCREEN, fmt, ap);
+}
+#endif
diff --git a/ncurses/base/tries.c b/ncurses/base/tries.c
index c4263c7e50eb..ad85d229213d 100644
--- a/ncurses/base/tries.c
+++ b/ncurses/base/tries.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2009,2010 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 *
@@ -39,7 +39,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: tries.c,v 1.27 2008/08/16 19:22:55 tom Exp $")
+MODULE_ID("$Id: tries.c,v 1.30 2010/08/28 21:08:23 tom Exp $")
/*
* Expand a keycode into the string that it corresponds to, returning null if
@@ -72,7 +72,9 @@ _nc_expand_try(TRIES * tree, unsigned code, int *count, size_t len)
*((unsigned char *) (result + len)) = 128;
#ifdef TRACE
if (len == 0 && USE_TRACEF(TRACE_MAXIMUM)) {
- _tracef("expand_key %s %s", _nc_tracechar(SP, code), _nc_visbuf(result));
+ _tracef("expand_key %s %s",
+ _nc_tracechar(CURRENT_SCREEN, (int) code),
+ _nc_visbuf(result));
_nc_unlock_global(tracef);
}
#endif
@@ -87,7 +89,7 @@ _nc_expand_try(TRIES * tree, unsigned code, int *count, size_t len)
NCURSES_EXPORT(int)
_nc_remove_key(TRIES ** tree, unsigned code)
{
- T((T_CALLED("_nc_remove_key(%p,%d)"), tree, code));
+ T((T_CALLED("_nc_remove_key(%p,%d)"), (void *) tree, code));
if (code == 0)
returnCode(FALSE);
@@ -119,7 +121,7 @@ _nc_remove_key(TRIES ** tree, unsigned code)
NCURSES_EXPORT(int)
_nc_remove_string(TRIES ** tree, const char *string)
{
- T((T_CALLED("_nc_remove_string(%p,%s)"), tree, _nc_visbuf(string)));
+ T((T_CALLED("_nc_remove_string(%p,%s)"), (void *) tree, _nc_visbuf(string)));
if (string == 0 || *string == 0)
returnCode(FALSE);
diff --git a/ncurses/base/use_window.c b/ncurses/base/use_window.c
index f6408c37928e..8eb733919848 100644
--- a/ncurses/base/use_window.c
+++ b/ncurses/base/use_window.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2007,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 2007-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 *
@@ -32,14 +32,14 @@
#include <curses.priv.h>
-MODULE_ID("$Id: use_window.c,v 1.8 2008/06/07 14:13:46 tom Exp $")
+MODULE_ID("$Id: use_window.c,v 1.9 2009/10/24 22:40:24 tom Exp $")
NCURSES_EXPORT(int)
use_window(WINDOW *win, NCURSES_WINDOW_CB func, void *data)
{
int code = OK;
- T((T_CALLED("use_window(%p,%p,%p)"), win, func, data));
+ T((T_CALLED("use_window(%p,%p,%p)"), (void *) win, func, data));
_nc_lock_global(curses);
code = func(win, data);
_nc_unlock_global(curses);
diff --git a/ncurses/base/wresize.c b/ncurses/base/wresize.c
index f46085af59fa..9a6ea500727e 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-2009,2010 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 <curses.priv.h>
-MODULE_ID("$Id: wresize.c,v 1.29 2008/06/07 13:59:01 tom Exp $")
+MODULE_ID("$Id: wresize.c,v 1.34 2010/06/05 22:36:26 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(wp)) {
+ for (each_window(SP_PARM, wp)) {
WINDOW *tst = &(wp->win);
if (tst->_parent == cmp) {
@@ -67,9 +71,9 @@ repair_subwindows(WINDOW *cmp)
tst->_parx = cmp->_maxx;
if (tst->_maxy + tst->_pary > cmp->_maxy)
- tst->_maxy = cmp->_maxy - tst->_pary;
+ tst->_maxy = (NCURSES_SIZE_T) (cmp->_maxy - tst->_pary);
if (tst->_maxx + tst->_parx > cmp->_maxx)
- tst->_maxx = cmp->_maxx - tst->_parx;
+ tst->_maxx = (NCURSES_SIZE_T) (cmp->_maxx - tst->_parx);
for (row = 0; row <= tst->_maxy; ++row) {
tst->_line[row].text = &pline[tst->_pary + row].text[tst->_parx];
@@ -93,7 +97,7 @@ wresize(WINDOW *win, int ToLines, int ToCols)
struct ldat *new_lines = 0;
#ifdef TRACE
- T((T_CALLED("wresize(%p,%d,%d)"), win, ToLines, ToCols));
+ T((T_CALLED("wresize(%p,%d,%d)"), (void *) win, ToLines, ToCols));
if (win) {
TR(TRACE_UPDATE, ("...beg (%ld, %ld), max(%ld,%ld), reg(%ld,%ld)",
(long) win->_begy, (long) win->_begx,
@@ -153,7 +157,8 @@ wresize(WINDOW *win, int ToLines, int ToCols)
if (!(win->_flags & _SUBWIN)) {
if (row <= size_y) {
if (ToCols != size_x) {
- if ((s = typeMalloc(NCURSES_CH_T, ToCols + 1)) == 0)
+ s = typeMalloc(NCURSES_CH_T, (unsigned) ToCols + 1);
+ if (s == 0)
returnCode(cleanup_lines(new_lines, row));
for (col = 0; col <= ToCols; ++col) {
s[col] = (col <= size_x
@@ -164,12 +169,14 @@ wresize(WINDOW *win, int ToLines, int ToCols)
s = win->_line[row].text;
}
} else {
- if ((s = typeMalloc(NCURSES_CH_T, ToCols + 1)) == 0)
+ s = typeMalloc(NCURSES_CH_T, (unsigned) ToCols + 1);
+ if (s == 0)
returnCode(cleanup_lines(new_lines, row));
for (col = 0; col <= ToCols; ++col)
s[col] = win->_nc_bkgd;
}
} else {
+ assert(pline != 0);
s = &pline[win->_pary + row].text[win->_parx];
}
@@ -181,11 +188,11 @@ wresize(WINDOW *win, int ToLines, int ToCols)
if ((ToCols != size_x) || (row > size_y)) {
if (end >= begin) { /* growing */
if (new_lines[row].firstchar < begin)
- new_lines[row].firstchar = begin;
+ new_lines[row].firstchar = (NCURSES_SIZE_T) begin;
} else { /* shrinking */
new_lines[row].firstchar = 0;
}
- new_lines[row].lastchar = ToCols;
+ new_lines[row].lastchar = (NCURSES_SIZE_T) ToCols;
}
new_lines[row].text = s;
}
@@ -212,8 +219,8 @@ wresize(WINDOW *win, int ToLines, int ToCols)
* Finally, adjust the parameters showing screen size and cursor
* position:
*/
- win->_maxx = ToCols;
- win->_maxy = ToLines;
+ win->_maxx = (NCURSES_SIZE_T) ToCols;
+ win->_maxy = (NCURSES_SIZE_T) ToLines;
if (win->_regtop > win->_maxy)
win->_regtop = win->_maxy;
diff --git a/ncurses/build.priv.h b/ncurses/build.priv.h
new file mode 100644
index 000000000000..be00d73ea430
--- /dev/null
+++ b/ncurses/build.priv.h
@@ -0,0 +1,108 @@
+/****************************************************************************
+ * Copyright (c) 2010 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 *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Thomas E. Dickey 2010 *
+ ****************************************************************************/
+
+
+/*
+ * $Id: build.priv.h,v 1.6 2010/05/22 20:30:35 tom Exp $
+ *
+ * build.priv.h
+ *
+ * This is a reduced version of curses.priv.h, for build-time utilties.
+ * Because it has fewer dependencies, this simplifies cross-compiling.
+ *
+ */
+
+#ifndef CURSES_PRIV_H
+#define CURSES_PRIV_H 1
+
+#include <ncurses_dll.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <ncurses_cfg.h>
+
+#if USE_RCS_IDS
+#define MODULE_ID(id) static const char Ident[] = id;
+#else
+#define MODULE_ID(id) /*nothing*/
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+
+#include <assert.h>
+#include <stdio.h>
+
+#include <errno.h>
+
+#include <curses.h> /* we'll use -Ipath directive to get the right one! */
+
+/* usually in <unistd.h> */
+#ifndef EXIT_SUCCESS
+#define EXIT_SUCCESS 0
+#endif
+
+#ifndef EXIT_FAILURE
+#define EXIT_FAILURE 1
+#endif
+
+#define FreeAndNull(p) free(p); p = 0
+#define UChar(c) ((unsigned char)(c))
+#define SIZEOF(v) (sizeof(v) / sizeof(v[0]))
+
+#include <nc_alloc.h>
+
+/* declare these, to avoid needing term.h */
+#if BROKEN_LINKER || USE_REENTRANT
+#define NCURSES_ARRAY(name) \
+ NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, name)
+
+NCURSES_ARRAY(boolnames);
+NCURSES_ARRAY(boolfnames);
+NCURSES_ARRAY(numnames);
+NCURSES_ARRAY(numfnames);
+NCURSES_ARRAY(strnames);
+NCURSES_ARRAY(strfnames);
+#endif
+
+#if NO_LEAKS
+NCURSES_EXPORT(void) _nc_names_leaks(void);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* CURSES_PRIV_H */
diff --git a/ncurses/curses.priv.h b/ncurses/curses.priv.h
index 29e131953415..49346c122a70 100644
--- a/ncurses/curses.priv.h
+++ b/ncurses/curses.priv.h
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -30,11 +30,11 @@
* 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.394 2008/10/04 21:37:45 tom Exp $
+ * $Id: curses.priv.h,v 1.475 2011/01/22 21:10:19 tom Exp $
*
* curses.priv.h
*
@@ -45,6 +45,7 @@
#ifndef CURSES_PRIV_H
#define CURSES_PRIV_H 1
+/* *INDENT-OFF* */
#include <ncurses_dll.h>
@@ -60,6 +61,7 @@ extern "C" {
#define MODULE_ID(id) /*nothing*/
#endif
+#include <stddef.h> /* for offsetof */
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
@@ -97,8 +99,6 @@ extern "C" {
extern int errno;
#endif
-#include <nc_panel.h>
-
/* Some systems have a broken 'select()', but workable 'poll()'. Use that */
#if HAVE_WORKING_POLL
#define USE_FUNC_POLL 1
@@ -178,6 +178,20 @@ extern NCURSES_EXPORT(void *) _nc_memmove (void *, const void *, size_t);
#endif
/*
+ * If we have va_copy(), use it for assigning va_list's.
+ */
+#if defined(HAVE___VA_COPY)
+#define begin_va_copy(dst,src) __va_copy(dst, src)
+#define end_va_copy(dst) va_end(dst)
+#elif defined(va_copy) || defined(HAVE_VA_COPY)
+#define begin_va_copy(dst,src) va_copy(dst, src)
+#define end_va_copy(dst) va_end(dst)
+#else
+#define begin_va_copy(dst,src) (dst) = (src)
+#define end_va_copy(dst) /* nothing */
+#endif
+
+/*
* Scroll hints are useless when hashmap is used
*/
#if !USE_SCROLL_HINTS
@@ -195,6 +209,15 @@ extern NCURSES_EXPORT(void *) _nc_memmove (void *, const void *, size_t);
#endif
/*
+ * Options for terminal drivers, etc...
+ */
+#ifdef USE_TERM_DRIVER
+#define USE_SP_RIPOFF 1
+#define USE_SP_TERMTYPE 1
+#define USE_SP_WINDOWLIST 1
+#endif
+
+/*
* Note: ht/cbt expansion flakes out randomly under Linux 1.1.47, but only
* when we're throwing control codes at the screen at high volume. To see
* this, re-enable USE_HARD_TABS and run worm for a while. Other systems
@@ -247,6 +270,7 @@ color_t;
#define _nc_bkgd _bkgrnd
#else
#undef _XOPEN_SOURCE_EXTENDED
+#undef _XPG5
#define _nc_bkgd _bkgd
#define wgetbkgrnd(win, wch) *wch = win->_bkgd
#define wbkgrnd wbkgd
@@ -257,39 +281,127 @@ color_t;
#define NCURSES_OPAQUE 0
#include <curses.h> /* we'll use -Ipath directive to get the right one! */
+
+/*
+ * If curses.h did not expose the SCREEN-functions, then we do not need the
+ * parameter in the corresponding unextended functions.
+ */
+
+#define USE_SP_FUNC_SUPPORT NCURSES_SP_FUNCS
+#define USE_EXT_SP_FUNC_SUPPORT (NCURSES_SP_FUNCS && NCURSES_EXT_FUNCS)
+
+#if NCURSES_SP_FUNCS
+#define SP_PARM sp /* use parameter */
+#define NCURSES_SP_ARG SP_PARM
+#define NCURSES_SP_DCL SCREEN *NCURSES_SP_ARG
+#define NCURSES_SP_DCL0 NCURSES_SP_DCL
+#define NCURSES_SP_ARGx NCURSES_SP_ARG,
+#define NCURSES_SP_DCLx SCREEN *NCURSES_SP_ARGx
+#else
+#define SP_PARM SP /* use global variable */
+#define NCURSES_SP_ARG
+#define NCURSES_SP_DCL
+#define NCURSES_SP_DCL0 void
+#define NCURSES_SP_ARGx
+#define NCURSES_SP_DCLx
+#endif
+
+#include <nc_panel.h>
+
+#define IsPreScreen(sp) (((sp) != 0) && sp->_prescreen)
+#define HasTerminal(sp) (((sp) != 0) && (0 != ((sp)->_term)))
+#define IsValidScreen(sp) (HasTerminal(sp) && !IsPreScreen(sp))
+
+#if BROKEN_LINKER || USE_REENTRANT
+#define CurTerm _nc_prescreen._cur_term
+#else
+#define CurTerm cur_term
+#endif
+
+#if NCURSES_SP_FUNCS
+#define TerminalOf(sp) ((sp) ? ((sp)->_term ? (sp)->_term : CurTerm) : CurTerm)
+#else
+#define TerminalOf(sp) CurTerm
+#endif
+
#include <term.h>
+
+/*
+ * Reduce dependency on cur_term global by using terminfo data from SCREEN's
+ * pointer to this data.
+ */
+#ifdef USE_SP_TERMTYPE
+#undef CUR
+#endif
+
+#define SP_TERMTYPE TerminalOf(sp)->type.
+
#include <term_entry.h>
+
#include <nc_tparm.h>
-#if NCURSES_EXT_COLORS && USE_WIDEC_SUPPORT
+/*
+ * Use these macros internally, to make tracing less verbose. But leave the
+ * option for compiling the tracing into the library.
+ */
+#if 1
+#define ColorPair(n) NCURSES_BITS(n, 0)
+#define PairNumber(a) (NCURSES_CAST(int,(((unsigned long)(a) & A_COLOR) >> NCURSES_ATTR_SHIFT)))
+#else
+#define ColorPair(pair) COLOR_PAIR(pair)
+#define PairNumber(attr) PAIR_NUMBER(attr)
+#endif
+
+#define unColor(n) unColor2(AttrOf(n))
+#define unColor2(a) ((a) & ALL_BUT_COLOR)
+
+/*
+ * Extended-colors stores the color pair in a separate struct-member than the
+ * attributes. But for compatibility, we handle most cases where a program
+ * written for non-extended colors stores the color in the attributes by
+ * checking for a color pair in both places.
+ */
+#if NCURSES_EXT_COLORS
#define if_EXT_COLORS(stmt) stmt
-#define NetPair(value,p) (value).ext_color = (p), \
- AttrOf(value) &= ALL_BUT_COLOR, \
- AttrOf(value) |= (A_COLOR & COLOR_PAIR((p > 255) ? 255 : p))
-#define SetPair(value,p) (value).ext_color = (p)
-#define GetPair(value) (value).ext_color
-#define unColor(n) (AttrOf(n) & ALL_BUT_COLOR)
-#define GET_WINDOW_PAIR(w) (w)->_color
+#define SetPair(value,p) SetPair2((value).ext_color, AttrOf(value), p)
+#define SetPair2(c,a,p) c = (p), \
+ a = (unColor2(a) | (A_COLOR & ColorPair(oldColor(c))))
+#define GetPair(value) GetPair2((value).ext_color, AttrOf(value))
+#define GetPair2(c,a) ((c) ? (c) : PairNumber(a))
+#define oldColor(p) (((p) > 255) ? 255 : (p))
+#define GET_WINDOW_PAIR(w) GetPair2((w)->_color, (w)->_attrs)
#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 */
+
#define if_EXT_COLORS(stmt) /* nothing */
#define SetPair(value,p) RemAttr(value, A_COLOR), \
- SetAttr(value, AttrOf(value) | (A_COLOR & COLOR_PAIR(p)))
-#define GetPair(value) PAIR_NUMBER(AttrOf(value))
-#define unColor(n) (AttrOf(n) & ALL_BUT_COLOR)
-#define GET_WINDOW_PAIR(w) PAIR_NUMBER(WINDOW_ATTRS(w))
+ SetAttr(value, AttrOf(value) | (A_COLOR & (attr_t) ColorPair(p)))
+#define GetPair(value) PairNumber(AttrOf(value))
+#define GET_WINDOW_PAIR(w) PairNumber(WINDOW_ATTRS(w))
#define SET_WINDOW_PAIR(w,p) WINDOW_ATTRS(w) &= ALL_BUT_COLOR, \
- WINDOW_ATTRS(w) |= (A_COLOR & COLOR_PAIR(p))
+ WINDOW_ATTRS(w) |= (A_COLOR & (attr_t) ColorPair(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 */
+
#if NCURSES_NO_PADDING
#define GetNoPadding(sp) ((sp) ? (sp)->_no_padding : _nc_prescreen._no_padding)
#define SetNoPadding(sp) _nc_set_no_padding(sp)
-extern NCURSES_EXPORT(void) _nc_set_no_padding(SCREEN *);
+extern NCURSES_EXPORT(void) _nc_set_no_padding(SCREEN *);
#else
#define GetNoPadding(sp) FALSE
#define SetNoPadding(sp) /*nothing*/
@@ -301,18 +413,37 @@ extern NCURSES_EXPORT(void) _nc_set_no_padding(SCREEN *);
#define GET_SCREEN_PAIR(s) GetPair(SCREEN_ATTRS(s))
#define SET_SCREEN_PAIR(s,p) SetPair(SCREEN_ATTRS(s), p)
+#if USE_REENTRANT || NCURSES_SP_FUNCS
+NCURSES_EXPORT(int *) _nc_ptr_Lines (SCREEN *);
+NCURSES_EXPORT(int *) _nc_ptr_Cols (SCREEN *);
+NCURSES_EXPORT(int *) _nc_ptr_Tabsize (SCREEN *);
+NCURSES_EXPORT(int *) _nc_ptr_Escdelay (SCREEN *);
+#endif
+
#if USE_REENTRANT
-NCURSES_EXPORT(int *) _nc_ptr_Lines (void);
-NCURSES_EXPORT(int *) _nc_ptr_Cols (void);
-#define ptrLines() (SP ? &(SP->_LINES) : &(_nc_prescreen._LINES))
-#define ptrCols() (SP ? &(SP->_COLS) : &(_nc_prescreen._COLS))
-#define SET_LINES(value) *_nc_ptr_Lines() = value
-#define SET_COLS(value) *_nc_ptr_Cols() = value
+
+#define ptrLines(sp) (sp ? &(sp->_LINES) : &(_nc_prescreen._LINES))
+#define ptrCols(sp) (sp ? &(sp->_COLS) : &(_nc_prescreen._COLS))
+#define ptrTabsize(sp) (sp ? &(sp->_TABSIZE) : &(_nc_prescreen._TABSIZE))
+#define ptrEscdelay(sp) (sp ? &(sp->_ESCDELAY) : &(_nc_prescreen._ESCDELAY))
+
+#define SET_LINES(value) *_nc_ptr_Lines(SP_PARM) = value
+#define SET_COLS(value) *_nc_ptr_Cols(SP_PARM) = value
+#define SET_TABSIZE(value) *_nc_ptr_Tabsize(SP_PARM) = value
+#define SET_ESCDELAY(value) *_nc_ptr_Escdelay(SP_PARM) = value
+
#else
-#define ptrLines() &LINES
-#define ptrCols() &COLS
-#define SET_LINES(value) LINES = value
-#define SET_COLS(value) COLS = value
+
+#define ptrLines(sp) &LINES
+#define ptrCols(sp) &COLS
+#define ptrTabsize(sp) &TABSIZE
+#define ptrEscdelay(sp) &ESCDELAY
+
+#define SET_LINES(value) LINES = value
+#define SET_COLS(value) COLS = value
+#define SET_TABSIZE(value) TABSIZE = value
+#define SET_ESCDELAY(value) ESCDELAY = value
+
#endif
#define TR_MUTEX(data) _tracef("%s@%d: me:%08lX COUNT:%2u/%2d/%6d/%2d/%s%9u: " #data, \
@@ -326,6 +457,19 @@ NCURSES_EXPORT(int *) _nc_ptr_Cols (void);
data.__data.__nusers)
#define TR_GLOBAL_MUTEX(name) TR_MUTEX(_nc_globals.mutex_##name)
+#if USE_WEAK_SYMBOLS
+#if defined(__GNUC__)
+# if defined __USE_ISOC99
+# define _cat_pragma(exp) _Pragma(#exp)
+# define _weak_pragma(exp) _cat_pragma(weak name)
+# else
+# define _weak_pragma(exp)
+# endif
+# define _declare(name) __extension__ extern __typeof__(name) name
+# define weak_symbol(name) _weak_pragma(name) _declare(name) __attribute__((weak))
+#endif
+#endif
+
#ifdef USE_PTHREADS
#if USE_REENTRANT
@@ -343,22 +487,10 @@ extern NCURSES_EXPORT(int) _nc_mutex_unlock(pthread_mutex_t *);
#error POSIX threads requires --enable-reentrant option
#endif
-#if USE_WEAK_SYMBOLS
-#if defined(__GNUC__)
-# if defined __USE_ISOC99
-# define _cat_pragma(exp) _Pragma(#exp)
-# define _weak_pragma(exp) _cat_pragma(weak name)
-# else
-# define _weak_pragma(exp)
-# endif
-# define _declare(name) __extension__ extern __typeof__(name) name
-# define weak_symbol(name) _weak_pragma(name) _declare(name) __attribute__((weak))
-#endif
-#endif
-
#ifdef USE_PTHREADS
# if USE_WEAK_SYMBOLS
weak_symbol(pthread_sigmask);
+weak_symbol(pthread_kill);
weak_symbol(pthread_self);
weak_symbol(pthread_equal);
weak_symbol(pthread_mutex_init);
@@ -380,6 +512,19 @@ extern NCURSES_EXPORT(int) _nc_sigprocmask(int, const sigset_t *, sigset_t *);
#else /* !USE_PTHREADS */
+#if USE_PTHREADS_EINTR
+# if USE_WEAK_SYMBOLS
+#include <pthread.h>
+weak_symbol(pthread_sigmask);
+weak_symbol(pthread_kill);
+weak_symbol(pthread_self);
+weak_symbol(pthread_equal);
+extern NCURSES_EXPORT(int) _nc_sigprocmask(int, const sigset_t *, sigset_t *);
+# undef sigprocmask
+# define sigprocmask _nc_sigprocmask
+# endif
+#endif /* USE_PTHREADS_EINTR */
+
#define _nc_init_pthreads() /* nothing */
#define _nc_mutex_init(obj) /* nothing */
@@ -389,6 +534,36 @@ extern NCURSES_EXPORT(int) _nc_sigprocmask(int, const sigset_t *, sigset_t *);
#endif /* USE_PTHREADS */
+/*
+ * When using sp-funcs, locks are targeted to SCREEN-level granularity.
+ * So the locking is done in the non-sp-func (which calls the sp-func) rather
+ * than in the sp-func itself.
+ *
+ * Use the _nc_nonsp_XXX functions in the function using "NCURSES_SP_NAME()".
+ * Use the _nc_sp_XXX functions in the function using "#if NCURSES_SP_FUNCS".
+ */
+#if NCURSES_SP_FUNCS
+
+#define _nc_nonsp_lock_global(name) /* nothing */
+#define _nc_nonsp_try_global(name) 0
+#define _nc_nonsp_unlock_global(name) /* nothing */
+
+#define _nc_sp_lock_global(name) _nc_lock_global(name)
+#define _nc_sp_try_global(name) _nc_try_global(name)
+#define _nc_sp_unlock_global(name) _nc_unlock_global(name)
+
+#else
+
+#define _nc_nonsp_lock_global(name) _nc_lock_global(name)
+#define _nc_nonsp_try_global(name) _nc_try_global(name)
+#define _nc_nonsp_unlock_global(name) _nc_unlock_global(name)
+
+#define _nc_sp_lock_global(name) /* nothing */
+#define _nc_sp_try_global(name) 0
+#define _nc_sp_unlock_global(name) /* nothing */
+
+#endif
+
#if HAVE_GETTIMEOFDAY
# define PRECISE_GETTIME 1
# define TimeType struct timeval
@@ -403,12 +578,14 @@ extern NCURSES_EXPORT(int) _nc_sigprocmask(int, const sigset_t *, sigset_t *);
typedef unsigned colorpair_t; /* type big enough to store PAIR_OF() */
#define C_SHIFT 9 /* we need more bits than there are colors */
#define C_MASK ((1 << C_SHIFT) - 1)
-#define PAIR_OF(fg, bg) ((((fg) & C_MASK) << C_SHIFT) | ((bg) & C_MASK))
+#define PAIR_OF(fg, bg) (colorpair_t) ((((fg) & C_MASK) << C_SHIFT) | ((bg) & C_MASK))
+#define FORE_OF(c) (((c) >> C_SHIFT) & C_MASK)
+#define BACK_OF(c) ((c) & C_MASK)
#define isDefaultColor(c) ((c) >= COLOR_DEFAULT || (c) < 0)
#define COLOR_DEFAULT C_MASK
-#if defined(USE_TERMLIB) && !defined(NEED_NCURSES_CH_T)
+#if defined(USE_BUILD_CC) || (defined(USE_TERMLIB) && !defined(NEED_NCURSES_CH_T))
#undef NCURSES_CH_T /* this is not a termlib feature */
#define NCURSES_CH_T void /* ...but we need a pointer in SCREEN */
@@ -434,6 +611,9 @@ typedef enum {
#if USE_SYSMOUSE
,M_SYSMOUSE /* FreeBSD sysmouse on console */
#endif
+#ifdef USE_TERM_DRIVER
+ ,M_TERM_DRIVER /* Win32 console, etc */
+#endif
} MouseType;
/*
@@ -452,7 +632,7 @@ typedef struct {
struct _SLK;
-#ifndef USE_TERMLIB
+#if !(defined(USE_TERMLIB) || defined(USE_BUILD_CC))
typedef struct
{
@@ -464,13 +644,13 @@ typedef struct
} slk_ent;
typedef struct _SLK {
- char dirty; /* all labels have changed */
- char hidden; /* soft labels are hidden */
- WINDOW *win;
+ bool dirty; /* all labels have changed */
+ bool hidden; /* soft labels are hidden */
+ WINDOW *win;
slk_ent *ent;
- short maxlab; /* number of available labels */
- short labcnt; /* number of allocated labels */
- short maxlen; /* length of labels */
+ short maxlab; /* number of available labels */
+ short labcnt; /* number of allocated labels */
+ short maxlen; /* length of labels */
NCURSES_CH_T attr; /* soft label attribute */
} SLK;
@@ -493,10 +673,10 @@ typedef int (*TYPE_Gpm_Open) (Gpm_Connect *, int);
typedef int (*TYPE_Gpm_Close) (void);
typedef int (*TYPE_Gpm_GetEvent) (Gpm_Event *);
-#define my_gpm_fd SP->_mouse_gpm_fd
-#define my_Gpm_Open SP->_mouse_Gpm_Open
-#define my_Gpm_Close SP->_mouse_Gpm_Close
-#define my_Gpm_GetEvent SP->_mouse_Gpm_GetEvent
+#define my_gpm_fd SP_PARM->_mouse_gpm_fd
+#define my_Gpm_Open SP_PARM->_mouse_Gpm_Open
+#define my_Gpm_Close SP_PARM->_mouse_Gpm_Close
+#define my_Gpm_GetEvent SP_PARM->_mouse_Gpm_GetEvent
#else
/* link statically to GPM */
#define my_gpm_fd &gpm_fd
@@ -563,8 +743,10 @@ typedef struct {
*/
#if MIXEDCASE_FILENAMES
#define LEAF_FMT "%c"
+#define LEAF_LEN 1
#else
#define LEAF_FMT "%02x"
+#define LEAF_LEN 2
#endif
/*
@@ -577,6 +759,13 @@ typedef struct {
#define TRACEMSE_MAX (80 + (5 * 10) + (32 * 15))
#define TRACEMSE_FMT "id %2d at (%2d, %2d, %2d) state %4lx = {" /* } */
+#ifdef USE_TERM_DRIVER
+struct DriverTCB; /* Terminal Control Block forward declaration */
+#define INIT_TERM_DRIVER() _nc_globals.term_driver = _nc_get_driver
+#else
+#define INIT_TERM_DRIVER() /* nothing */
+#endif
+
/*
* Global data which is not specific to a screen.
*/
@@ -609,8 +798,10 @@ typedef struct {
int tgetent_index;
long tgetent_sequence;
+#ifndef USE_SP_WINDOWLIST
WINDOWLIST *_nc_windowlist;
-#define _nc_windows _nc_globals._nc_windowlist
+#define WindowList(sp) _nc_globals._nc_windowlist
+#endif
#if USE_HOME_TERMINFO
char *home_terminfo;
@@ -621,6 +812,10 @@ typedef struct {
int safeprint_rows;
#endif
+#ifdef USE_TERM_DRIVER
+ int (*term_driver)(struct DriverTCB*, const char*, int*);
+#endif
+
#ifdef TRACE
bool init_trace;
char trace_fname[PATH_MAX];
@@ -644,7 +839,9 @@ typedef struct {
char traceatr_color_buf[2][80];
int traceatr_color_sel;
int traceatr_color_last;
-
+#if !defined(USE_PTHREADS) && USE_REENTRANT
+ int nested_tracef;
+#endif
#endif /* TRACE */
#ifdef USE_PTHREADS
@@ -655,6 +852,9 @@ typedef struct {
int use_pthreads;
#define _nc_use_pthreads _nc_globals.use_pthreads
#endif
+#if USE_PTHREADS_EINTR
+ pthread_t read_thread; /* The reading thread */
+#endif
} NCURSES_GLOBALS;
extern NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals;
@@ -669,17 +869,22 @@ 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
bool _no_padding; /* flag to set if padding disabled */
#endif
+ NCURSES_SP_OUTC _outch; /* output handler if not putc */
#if BROKEN_LINKER || USE_REENTRANT
chtype *real_acs_map;
int _LINES;
int _COLS;
+ int _TABSIZE;
+ int _ESCDELAY;
TERMINAL *_cur_term;
#ifdef TRACE
long _outchars;
@@ -688,8 +893,16 @@ typedef struct {
#endif
} NCURSES_PRESCREEN;
-#define ripoff_sp _nc_prescreen.rsp
-#define ripoff_stack _nc_prescreen.rippedoff
+/*
+ * Use screen-specific ripoff data (for softkeys) rather than global.
+ */
+#ifdef USE_SP_RIPOFF
+#define safe_ripoff_sp (sp)->rsp
+#define safe_ripoff_stack (sp)->rippedoff
+#else
+#define safe_ripoff_sp _nc_prescreen.rsp
+#define safe_ripoff_stack _nc_prescreen.rippedoff
+#endif
extern NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen;
@@ -703,6 +916,8 @@ struct screen {
char *_setbuf; /* buffered I/O for output */
bool _filtered; /* filter() was called */
bool _buffered; /* setvbuf uses _setbuf data */
+ bool _prescreen; /* is in prescreen phase */
+ bool _use_env; /* LINES & COLS from environment? */
int _checkfd; /* filedesc for typeahead check */
TERMINAL *_term; /* terminal type information */
TTY _saved_tty; /* savetty/resetty information */
@@ -716,6 +931,10 @@ struct screen {
WINDOW *_newscr; /* virtual screen to be updated to */
WINDOW *_stdscr; /* screen's full-window context */
+#define CurScreen(sp) (sp)->_curscr
+#define NewScreen(sp) (sp)->_newscr
+#define StdScreen(sp) (sp)->_stdscr
+
TRIES *_keytry; /* "Try" for use with keypad mode */
TRIES *_key_ok; /* Disabled keys via keyok(,FALSE) */
bool _tried; /* keypad mode was initialized */
@@ -794,11 +1013,13 @@ struct screen {
int _color_count; /* count of colors in palette */
colorpair_t *_color_pairs; /* screen's color pair list */
int _pair_count; /* count of color pairs */
+ int _pair_limit; /* actual limit of color-pairs */
#if NCURSES_EXT_FUNCS
bool _default_color; /* use default colors */
bool _has_sgr_39_49; /* has ECMA default color support */
int _default_fg; /* assumed default foreground */
int _default_bg; /* assumed default background */
+ int _default_pairs; /* count pairs using default color */
#endif
chtype _ok_attributes; /* valid attributes for terminal */
chtype _xmc_suppress; /* attributes to suppress if xmc */
@@ -820,8 +1041,6 @@ struct screen {
*/
bool _nc_sp_idlok;
bool _nc_sp_idcok;
-#define _nc_idlok SP->_nc_sp_idlok
-#define _nc_idcok SP->_nc_sp_idcok
/*
* These are the data that support the mouse interface.
@@ -871,11 +1090,18 @@ struct screen {
int _sysmouse_new_buttons;
#endif
+#ifdef USE_TERM_DRIVER
+ MEVENT _drv_mouse_fifo[FIFO_SIZE];
+ int _drv_mouse_head;
+ int _drv_mouse_tail;
+ int _drv_mouse_old_buttons;
+ int _drv_mouse_new_buttons;
+#endif
/*
* This supports automatic resizing
*/
#if USE_SIZECHANGE
- int (*_resize)(int,int);
+ int (*_resize)(NCURSES_SP_DCLx int y, int x);
#endif
/*
@@ -895,7 +1121,7 @@ struct screen {
int _oldnum_size;
bool _cleanup; /* cleanup after int/quit signal */
- int (*_outch)(int); /* output handler if not putc */
+ NCURSES_SP_OUTC _outch; /* output handler if not putc */
int _legacy_coding; /* see use_legacy_coding() */
@@ -915,6 +1141,15 @@ struct screen {
char tracechr_buf[40];
char tracemse_buf[TRACEMSE_MAX];
#endif
+#ifdef USE_SP_WINDOWLIST
+ WINDOWLIST* _windowlist;
+#define WindowList(sp) (sp)->_windowlist
+#endif
+ NCURSES_OUTC jump;
+
+ ripoff_t rippedoff[N_RIPS];
+ ripoff_t *rsp;
+
/*
* ncurses/ncursesw are the same up to this point.
*/
@@ -930,10 +1165,10 @@ extern NCURSES_EXPORT_VAR(SCREEN *) _nc_screen_chain;
extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
WINDOWLIST {
- WINDOW win; /* first, so WINDOW_EXT() works */
WINDOWLIST *next;
SCREEN *screen; /* screen containing the window */
-#ifdef _XOPEN_SOURCE_EXTENDED
+ WINDOW win; /* WINDOW_EXT() needs to account for offset */
+#ifdef NCURSES_WIDECHAR
char addch_work[(MB_LEN_MAX * 9) + 1];
unsigned addch_used; /* number of bytes in addch_work[] */
int addch_x; /* x-position for addch_work[] */
@@ -941,7 +1176,21 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
#endif
};
-#define WINDOW_EXT(win,field) (((WINDOWLIST *)(win))->field)
+#define WINDOW_EXT(w,m) (((WINDOWLIST *)((void *)((char *)(w) - offsetof(WINDOWLIST, win))))->m)
+
+#define SP_PRE_INIT(sp) \
+ sp->_cursrow = -1; \
+ sp->_curscol = -1; \
+ sp->_nl = TRUE; \
+ sp->_raw = FALSE; \
+ sp->_cbreak = 0; \
+ sp->_echo = TRUE; \
+ sp->_fifohead = -1; \
+ sp->_endwin = TRUE; \
+ sp->_cursor = -1; \
+ WindowList(sp) = 0; \
+ sp->_outch = NCURSES_SP_NAME(_nc_outch); \
+ sp->jump = 0 \
/* usually in <limits.h> */
#ifndef UCHAR_MAX
@@ -1017,6 +1266,7 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
#define RESET_OUTCHARS() COUNT_OUTCHARS(-_nc_outchars)
#define UChar(c) ((unsigned char)(c))
+#define UShort(c) ((unsigned short)(c))
#define ChCharOf(c) ((c) & (chtype)A_CHARTEXT)
#define ChAttrOf(c) ((c) & (chtype)A_ATTRIBUTES)
@@ -1061,9 +1311,9 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
#define SetChar(ch,c,a) do { \
NCURSES_CH_T *_cp = &ch; \
memset(_cp, 0, sizeof(ch)); \
- _cp->chars[0] = (c); \
+ _cp->chars[0] = (wchar_t) (c); \
_cp->attr = (a); \
- if_EXT_COLORS(SetPair(ch, PAIR_NUMBER(a))); \
+ if_EXT_COLORS(SetPair(ch, PairNumber(a))); \
} while (0)
#define CHREF(wch) (&wch)
#define CHDEREF(wch) (*wch)
@@ -1082,14 +1332,14 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
PUTC_ch = (ch).chars[PUTC_i]; \
if (PUTC_ch == L'\0') \
break; \
- PUTC_n = wcrtomb(PUTC_buf, \
- (ch).chars[PUTC_i], &PUT_st); \
+ PUTC_n = (int) wcrtomb(PUTC_buf, \
+ (ch).chars[PUTC_i], &PUT_st); \
if (PUTC_n <= 0) { \
if (PUTC_ch && is8bits(PUTC_ch) && PUTC_i == 0) \
putc(PUTC_ch,b); \
break; \
} \
- fwrite(PUTC_buf, (unsigned) PUTC_n, 1, b); \
+ IGNORE_RC(fwrite(PUTC_buf, (unsigned) PUTC_n, 1, b)); \
} \
COUNT_OUTCHARS(PUTC_i); \
} } } while (0)
@@ -1105,14 +1355,14 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
* zero. Otherwise we can use those bits to tell if a cell is the
* first or extension part of a wide character.
*/
-#define WidecExt(ch) (AttrOf(ch) & A_CHARTEXT)
+#define WidecExt(ch) (int) (AttrOf(ch) & A_CHARTEXT)
#define isWidecBase(ch) (WidecExt(ch) == 1)
#define isWidecExt(ch) (WidecExt(ch) > 1 && WidecExt(ch) < 32)
#define SetWidecExt(dst, ext) AttrOf(dst) &= ~A_CHARTEXT, \
- AttrOf(dst) |= (ext + 1)
+ AttrOf(dst) |= (attr_t) (ext + 1)
#define if_WIDEC(code) code
-#define Charable(ch) ((SP != 0 && SP->_legacy_coding) \
+#define Charable(ch) ((SP_PARM != 0 && SP_PARM->_legacy_coding) \
|| (AttrOf(ch) & A_ALTCHARSET) \
|| (!isWidecExt(ch) && \
(ch).chars[1] == L'\0' && \
@@ -1162,25 +1412,25 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
#define CHANGED_CELL(line,col) \
if (line->firstchar == _NOCHANGE) \
- line->firstchar = line->lastchar = col; \
+ line->firstchar = line->lastchar = (NCURSES_SIZE_T) col; \
else if ((col) < line->firstchar) \
- line->firstchar = col; \
+ line->firstchar = (NCURSES_SIZE_T) col; \
else if ((col) > line->lastchar) \
- line->lastchar = col
+ line->lastchar = (NCURSES_SIZE_T) col
#define CHANGED_RANGE(line,start,end) \
if (line->firstchar == _NOCHANGE \
|| line->firstchar > (start)) \
- line->firstchar = start; \
+ line->firstchar = (NCURSES_SIZE_T) start; \
if (line->lastchar == _NOCHANGE \
|| line->lastchar < (end)) \
- line->lastchar = end
+ line->lastchar = (NCURSES_SIZE_T) end
#define CHANGED_TO_EOL(line,start,end) \
if (line->firstchar == _NOCHANGE \
|| line->firstchar > (start)) \
- line->firstchar = start; \
- line->lastchar = end
+ line->firstchar = (NCURSES_SIZE_T) start; \
+ line->lastchar = (NCURSES_SIZE_T) end
#define SIZEOF(v) (sizeof(v)/sizeof(v[0]))
@@ -1214,8 +1464,8 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
* Standardize/simplify common loops
*/
#define each_screen(p) p = _nc_screen_chain; p != 0; p = (p)->_next_screen
-#define each_window(p) p = _nc_windows; p != 0; p = (p)->next
-#define each_ripoff(p) p = ripoff_stack; (p - ripoff_stack) < N_RIPS; ++p
+#define each_window(sp,p) p = WindowList(sp); p != 0; p = (p)->next
+#define each_ripoff(p) p = safe_ripoff_stack; (p - safe_ripoff_stack) < N_RIPS; ++p
/*
* Prefixes for call/return points of library function traces. We use these to
@@ -1256,15 +1506,22 @@ extern NCURSES_EXPORT(void) _nc_locked_tracef (const char *, ...) GCC_PRINTFLIKE
#define TR(n, a) if (USE_TRACEF(n)) _nc_locked_tracef a
#define T(a) TR(TRACE_CALLS, a)
-#define TRACE_RETURN(value,type) return _nc_retrace_##type(value)
+#define TRACE_RETURN(value,type) return _nc_retrace_##type(value)
+#define TRACE_RETURN2(value,dst,src) return _nc_retrace_##dst##_##src(value)
+#define TRACE_RETURN_SP(value,type) return _nc_retrace_##type(SP_PARM, value)
+
+#define NonNull(s) ((s) != 0 ? s : "<null>")
#define returnAttr(code) TRACE_RETURN(code,attr_t)
#define returnBits(code) TRACE_RETURN(code,unsigned)
#define returnBool(code) TRACE_RETURN(code,bool)
#define returnCPtr(code) TRACE_RETURN(code,cptr)
#define returnCVoidPtr(code) TRACE_RETURN(code,cvoid_ptr)
-#define returnChar(code) TRACE_RETURN(code,chtype)
+#define returnChar(code) TRACE_RETURN(code,char)
+#define returnChtype(code) TRACE_RETURN(code,chtype)
#define returnCode(code) TRACE_RETURN(code,int)
+#define returnIntAttr(code) TRACE_RETURN2(code,int,attr_t)
+#define returnMMask(code) TRACE_RETURN_SP(code,mmask_t)
#define returnPtr(code) TRACE_RETURN(code,ptr)
#define returnSP(code) TRACE_RETURN(code,sp)
#define returnVoid T((T_RETURN(""))); return
@@ -1282,7 +1539,10 @@ extern NCURSES_EXPORT(char *) _nc_varargs (const char *, va_list);
extern NCURSES_EXPORT(chtype) _nc_retrace_chtype (chtype);
extern NCURSES_EXPORT(const char *) _nc_altcharset_name(attr_t, chtype);
extern NCURSES_EXPORT(const char *) _nc_retrace_cptr (const char *);
+extern NCURSES_EXPORT(char) _nc_retrace_char (char);
extern NCURSES_EXPORT(int) _nc_retrace_int (int);
+extern NCURSES_EXPORT(int) _nc_retrace_int_attr_t (attr_t);
+extern NCURSES_EXPORT(mmask_t) _nc_retrace_mmask_t (SCREEN *, mmask_t);
extern NCURSES_EXPORT(unsigned) _nc_retrace_unsigned (unsigned);
extern NCURSES_EXPORT(void *) _nc_retrace_void_ptr (void *);
extern NCURSES_EXPORT(void) _nc_fifo_dump (SCREEN *);
@@ -1322,8 +1582,11 @@ extern NCURSES_EXPORT(const char *) _nc_viscbuf (const NCURSES_CH_T *, int);
#define returnBool(code) return code
#define returnCPtr(code) return code
#define returnCVoidPtr(code) return code
-#define returnChar(code) return code
+#define returnChar(code) return ((char) code)
+#define returnChtype(code) return code
#define returnCode(code) return code
+#define returnIntAttr(code) return code
+#define returnMMask(code) return code
#define returnPtr(code) return code
#define returnSP(code) return code
#define returnVoid return
@@ -1333,6 +1596,15 @@ extern NCURSES_EXPORT(const char *) _nc_viscbuf (const NCURSES_CH_T *, int);
#endif /* TRACE/!TRACE */
/*
+ * Workaround for defective implementation of gcc attribute warn_unused_result
+ */
+#if defined(__GNUC__) && defined(_FORTIFY_SOURCE)
+#define IGNORE_RC(func) errno = (int) func
+#else
+#define IGNORE_RC(func) (void) func
+#endif /* gcc workarounds */
+
+/*
* Return-codes for tgetent() and friends.
*/
#define TGETENT_YES 1 /* entry is found */
@@ -1348,57 +1620,58 @@ extern NCURSES_EXPORT(void) name (void); \
#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) {\
- (S) = ((S) & ALL_BUT_COLOR) | (at);\
+ if (PairNumber(at) > 0) {\
+ (S) = ((S) & ALL_BUT_COLOR) | (attr_t) (at);\
} else {\
- (S) |= (at);\
+ (S) |= (attr_t) (at);\
}\
TR(TRACE_ATTRS, ("new attribute is %s", _traceattr((S))));}
#define toggle_attr_off(S,at) {\
- if (PAIR_NUMBER(at) > 0) {\
+ if (PairNumber(at) > 0) {\
(S) &= ~(at|A_COLOR);\
} else {\
(S) &= ~(at);\
}\
TR(TRACE_ATTRS, ("new attribute is %s", _traceattr((S))));}
-#define DelCharCost(count) \
+#define DelCharCost(sp,count) \
((parm_dch != 0) \
- ? SP->_dch_cost \
+ ? sp->_dch_cost \
: ((delete_character != 0) \
- ? (SP->_dch1_cost * count) \
+ ? (sp->_dch1_cost * count) \
: INFINITY))
-#define InsCharCost(count) \
+#define InsCharCost(sp,count) \
((parm_ich != 0) \
- ? SP->_ich_cost \
+ ? sp->_ich_cost \
: ((enter_insert_mode && exit_insert_mode) \
- ? SP->_smir_cost + SP->_rmir_cost + (SP->_ip_cost * count) \
+ ? sp->_smir_cost + sp->_rmir_cost + (sp->_ip_cost * count) \
: ((insert_character != 0) \
- ? ((SP->_ich1_cost + SP->_ip_cost) * count) \
+ ? ((sp->_ich1_cost + sp->_ip_cost) * count) \
: INFINITY)))
#if USE_XMC_SUPPORT
-#define UpdateAttrs(c) if (!SameAttrOf(SCREEN_ATTRS(SP), c)) { \
- attr_t chg = AttrOf(SCREEN_ATTRS(SP)); \
- VIDATTR(AttrOf(c), GetPair(c)); \
+#define UpdateAttrs(sp,c) if (!SameAttrOf(SCREEN_ATTRS(sp), c)) { \
+ attr_t chg = AttrOf(SCREEN_ATTRS(sp)); \
+ VIDATTR(sp, AttrOf(c), GetPair(c)); \
if (magic_cookie_glitch > 0 \
- && XMC_CHANGES((chg ^ AttrOf(SCREEN_ATTRS(SP))))) { \
+ && XMC_CHANGES((chg ^ AttrOf(SCREEN_ATTRS(sp))))) { \
T(("%s @%d before glitch %d,%d", \
__FILE__, __LINE__, \
- SP->_cursrow, \
- SP->_curscol)); \
- _nc_do_xmc_glitch(chg); \
+ sp->_cursrow, \
+ sp->_curscol)); \
+ NCURSES_SP_NAME(_nc_do_xmc_glitch)(NCURSES_SP_ARGx chg); \
} \
}
#else
-#define UpdateAttrs(c) if (!SameAttrOf(SCREEN_ATTRS(SP), c)) \
- VIDATTR(AttrOf(c), GetPair(c));
+#define UpdateAttrs(sp,c) if (!SameAttrOf(SCREEN_ATTRS(sp), c)) { \
+ VIDATTR(sp, AttrOf(c), GetPair(c)); \
+ }
#endif
/*
@@ -1408,10 +1681,12 @@ extern NCURSES_EXPORT(void) name (void); \
#define EVENTLIST_0th(param) param
#define EVENTLIST_1st(param) param
#define EVENTLIST_2nd(param) , param
+#define TWAIT_MASK (TW_ANY | TW_EVENT)
#else
#define EVENTLIST_0th(param) void
#define EVENTLIST_1st(param) /* nothing */
#define EVENTLIST_2nd(param) /* nothing */
+#define TWAIT_MASK TW_ANY
#endif
#if NCURSES_EXPANDED && NCURSES_EXT_FUNCS
@@ -1425,16 +1700,28 @@ extern NCURSES_EXPORT(void) _nc_toggle_attr_on (attr_t *, attr_t);
extern NCURSES_EXPORT(void) _nc_toggle_attr_off (attr_t *, attr_t);
#undef DelCharCost
-#define DelCharCost(count) _nc_DelCharCost(count)
-extern NCURSES_EXPORT(int) _nc_DelCharCost (int);
+#define DelCharCost(sp, count) NCURSES_SP_NAME(_nc_DelCharCost)(NCURSES_SP_ARGx count)
#undef InsCharCost
-#define InsCharCost(count) _nc_InsCharCost(count)
-extern NCURSES_EXPORT(int) _nc_InsCharCost (int);
+#define InsCharCost(sp, count) NCURSES_SP_NAME(_nc_InsCharCost)(NCURSES_SP_ARGx count)
+
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_DelCharCost) (NCURSES_SP_DCLx int _c);
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_InsCharCost) (NCURSES_SP_DCLx int _c);
#undef UpdateAttrs
-#define UpdateAttrs(c) _nc_UpdateAttrs(c)
-extern NCURSES_EXPORT(void) _nc_UpdateAttrs (NCURSES_CH_T);
+#define UpdateAttrs(sp,c) NCURSES_SP_NAME(_nc_UpdateAttrs)(NCURSES_SP_ARGx CHREF(c))
+
+#if USE_WIDEC_SUPPORT || defined(NEED_NCURSES_CH_T)
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_UpdateAttrs) (NCURSES_SP_DCLx CARG_CH_T _c);
+#else
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_UpdateAttrs) (NCURSES_SP_DCLx chtype c);
+#endif
+
+#if NCURSES_SP_FUNCS
+extern NCURSES_EXPORT(int) _nc_DelCharCost (int);
+extern NCURSES_EXPORT(int) _nc_InsCharCost (int);
+extern NCURSES_EXPORT(void) _nc_UpdateAttrs (CARG_CH_T);
+#endif /* NCURSES_SP_FUNCS */
#else
@@ -1483,8 +1770,8 @@ extern NCURSES_EXPORT(void) _nc_linedump (void);
#endif
/* lib_acs.c */
-extern NCURSES_EXPORT(void) _nc_init_acs (void); /* corresponds to traditional 'init_acs()' */
-extern NCURSES_EXPORT(int) _nc_msec_cost (const char *const, int); /* used by 'tack' program */
+extern NCURSES_EXPORT(void) _nc_init_acs (void); /* corresponds to traditional 'init_acs()' */
+extern NCURSES_EXPORT(int) _nc_msec_cost (const char *const, int); /* used by 'tack' program */
/* lib_addch.c */
#if USE_WIDEC_SUPPORT
@@ -1492,7 +1779,7 @@ NCURSES_EXPORT(int) _nc_build_wch(WINDOW *win, ARG_CH_T ch);
#endif
/* lib_addstr.c */
-#if USE_WIDEC_SUPPORT && !defined(USE_TERMLIB)
+#if USE_WIDEC_SUPPORT && !(defined(USE_TERMLIB) || defined(USE_BUILD_CC))
extern NCURSES_EXPORT(int) _nc_wchstrlen(const cchar_t *);
#endif
@@ -1500,10 +1787,10 @@ extern NCURSES_EXPORT(int) _nc_wchstrlen(const cchar_t *);
extern NCURSES_EXPORT(bool) _nc_reset_colors(void);
/* lib_getch.c */
-extern NCURSES_EXPORT(int) _nc_wgetch(WINDOW *, unsigned long *, int EVENTLIST_2nd(_nc_eventlist *));
+extern NCURSES_EXPORT(int) _nc_wgetch(WINDOW *, int *, int EVENTLIST_2nd(_nc_eventlist *));
/* lib_insch.c */
-extern NCURSES_EXPORT(int) _nc_insert_ch(WINDOW *, chtype);
+extern NCURSES_EXPORT(int) _nc_insert_ch(SCREEN *, WINDOW *, chtype);
/* lib_mvcur.c */
#define INFINITY 1000000 /* cost: too high to use */
@@ -1519,7 +1806,7 @@ extern NCURSES_EXPORT(void) _nc_screen_resume (void);
extern NCURSES_EXPORT(void) _nc_screen_wrap (void);
/* lib_mouse.c */
-extern NCURSES_EXPORT(int) _nc_has_mouse (void);
+extern NCURSES_EXPORT(bool) _nc_has_mouse (SCREEN *);
/* lib_mvcur.c */
#define INFINITY 1000000 /* cost: too high to use */
@@ -1527,10 +1814,13 @@ extern NCURSES_EXPORT(int) _nc_has_mouse (void);
/* 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_tinfo_cmdch(TERMINAL *, char);
+
+/* lib_set_term.c */
+extern NCURSES_EXPORT(int) _nc_ripoffline(int, int(*)(WINDOW*, int));
/* lib_tstp.c */
#if USE_SIGWINCH
@@ -1539,9 +1829,6 @@ extern NCURSES_EXPORT(int) _nc_handle_sigwinch(SCREEN *);
#define _nc_handle_sigwinch(a) /* nothing */
#endif
-/* lib_ungetch.c */
-extern NCURSES_EXPORT(int) _nc_ungetch (SCREEN *, int);
-
/* lib_wacs.c */
#if USE_WIDEC_SUPPORT
extern NCURSES_EXPORT(void) _nc_init_wacs(void);
@@ -1577,9 +1864,8 @@ extern NCURSES_EXPORT(int) _nc_remove_string (TRIES **, const char *);
/* elsewhere ... */
extern NCURSES_EXPORT(ENTRY *) _nc_delink_entry (ENTRY *, TERMTYPE *);
-extern NCURSES_EXPORT(NCURSES_CONST char *) _nc_keyname (SCREEN *, int);
-extern NCURSES_EXPORT(NCURSES_CONST char *) _nc_unctrl (SCREEN *, chtype);
extern NCURSES_EXPORT(SCREEN *) _nc_screen_of (WINDOW *);
+extern NCURSES_EXPORT(TERMINAL*) _nc_get_cur_term (void);
extern NCURSES_EXPORT(WINDOW *) _nc_makenew (int, int, int, int, int);
extern NCURSES_EXPORT(char *) _nc_trace_buf (int, size_t);
extern NCURSES_EXPORT(char *) _nc_trace_bufcat (int, const char *);
@@ -1592,12 +1878,15 @@ extern NCURSES_EXPORT(int) _nc_getenv_num (const char *);
extern NCURSES_EXPORT(int) _nc_keypad (SCREEN *, bool);
extern NCURSES_EXPORT(int) _nc_ospeed (int);
extern NCURSES_EXPORT(int) _nc_outch (int);
+extern NCURSES_EXPORT(int) _nc_putp(const char *, const char *);
+extern NCURSES_EXPORT(int) _nc_putp_flush(const char *, const char *);
extern NCURSES_EXPORT(int) _nc_read_termcap_entry (const char *const, TERMTYPE *const);
extern NCURSES_EXPORT(int) _nc_setupscreen (int, int, FILE *, bool, int);
+extern NCURSES_EXPORT(int) _nc_setup_tinfo(const char *, TERMTYPE *);
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_do_color (short, short, bool, NCURSES_OUTC);
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);
@@ -1622,13 +1911,17 @@ extern NCURSES_EXPORT(void) _nc_names_leaks(void);
extern NCURSES_EXPORT(void) _nc_tgetent_leaks(void);
#endif
-#ifndef USE_TERMLIB
+#if !(defined(USE_TERMLIB) || defined(USE_BUILD_CC))
extern NCURSES_EXPORT(NCURSES_CH_T) _nc_render (WINDOW *, NCURSES_CH_T);
extern NCURSES_EXPORT(int) _nc_waddch_nosync (WINDOW *, const NCURSES_CH_T);
extern NCURSES_EXPORT(void) _nc_scroll_window (WINDOW *, int const, NCURSES_SIZE_T const, NCURSES_SIZE_T const, NCURSES_CH_T);
#endif
-#if USE_WIDEC_SUPPORT && !defined(USE_TERMLIB)
+#if USE_WIDEC_SUPPORT
+extern NCURSES_EXPORT(int) _nc_insert_wch(WINDOW *, const cchar_t *);
+#endif
+
+#if USE_WIDEC_SUPPORT && !(defined(USE_TERMLIB) || defined(USE_BUILD_CC))
extern NCURSES_EXPORT(size_t) _nc_wcrtomb (char *, wchar_t, mbstate_t *);
#endif
@@ -1650,6 +1943,26 @@ extern NCURSES_EXPORT(int) _nc_eventlist_timeout(_nc_eventlist *);
#endif
/*
+ * Wide-character macros to hide some platform-differences.
+ */
+#if USE_WIDEC_SUPPORT
+#if HAVE_MBTOWC && HAVE_MBLEN
+#define reset_mbytes(state) IGNORE_RC(mblen(NULL, 0)), IGNORE_RC(mbtowc(NULL, NULL, 0))
+#define count_mbytes(buffer,length,state) mblen(buffer,length)
+#define check_mbytes(wch,buffer,length,state) \
+ (int) mbtowc(&wch, buffer, length)
+#define state_unused
+#elif HAVE_MBRTOWC && HAVE_MBRLEN
+#define reset_mbytes(state) init_mb(state)
+#define count_mbytes(buffer,length,state) mbrlen(buffer,length,&state)
+#define check_mbytes(wch,buffer,length,state) \
+ (int) mbrtowc(&wch, buffer, length, &state)
+#else
+make an error
+#endif
+#endif
+
+/*
* Not everyone has vsscanf(), but we'd like to use it for scanw().
*/
#if !HAVE_VSSCANF
@@ -1661,24 +1974,34 @@ extern NCURSES_EXPORT_VAR(int *) _nc_oldnums;
#define USE_SETBUF_0 0
-#define NC_BUFFERED(flag) _nc_set_buffer(SP->_ofp, flag)
+#define NC_BUFFERED(sp,flag) NCURSES_SP_NAME(_nc_set_buffer)(NCURSES_SP_ARGx sp->_ofp, flag)
-#define NC_OUTPUT ((SP != 0) ? SP->_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
* linker to pull in the data-only module with 'SP'.
*/
+#define _nc_alloc_screen_sp() typeCalloc(SCREEN, 1)
+
#if BROKEN_LINKER
#define SP _nc_screen()
extern NCURSES_EXPORT(SCREEN *) _nc_screen (void);
-extern NCURSES_EXPORT(int) _nc_alloc_screen (void);
-extern NCURSES_EXPORT(void) _nc_set_screen (SCREEN *);
+extern NCURSES_EXPORT(int) _nc_alloc_screen (void);
+extern NCURSES_EXPORT(void) _nc_set_screen (SCREEN *);
+#define CURRENT_SCREEN _nc_screen()
#else
/* current screen is private data; avoid possible linking conflicts too */
extern NCURSES_EXPORT_VAR(SCREEN *) SP;
-#define _nc_alloc_screen() ((SP = typeCalloc(SCREEN, 1)) != 0)
-#define _nc_set_screen(sp) SP = sp
+#define CURRENT_SCREEN SP
+#define _nc_alloc_screen() ((SP = _nc_alloc_screen_sp()) != 0)
+#define _nc_set_screen(sp) SP = sp
+#endif
+
+#if NCURSES_SP_FUNCS
+#define CURRENT_SCREEN_PRE (IsPreScreen(CURRENT_SCREEN) ? CURRENT_SCREEN : new_prescr())
+#else
+#define CURRENT_SCREEN_PRE CURRENT_SCREEN
#endif
/*
@@ -1686,10 +2009,11 @@ extern NCURSES_EXPORT_VAR(SCREEN *) SP;
* if the application is running multiple screens under X, it's quite possible
* they could all have type xterm but have different sizes! So...
*/
-#define screen_lines SP->_lines
-#define screen_columns SP->_columns
+#define screen_lines(sp) (sp)->_lines
+#define screen_columns(sp) (sp)->_columns
extern NCURSES_EXPORT(int) _nc_slk_initialize (WINDOW *, int);
+extern NCURSES_EXPORT(int) _nc_format_slks (NCURSES_SP_DCLx int _c);
/*
* Some constants related to SLK's
@@ -1707,16 +2031,282 @@ extern NCURSES_EXPORT(int) _nc_slk_initialize (WINDOW *, int);
#define MAX_SKEY(fmt) (SLK_STDFMT(fmt)? MAX_SKEY_OLD : MAX_SKEY_PC)
#define MAX_SKEY_LEN(fmt) (SLK_STDFMT(fmt)? MAX_SKEY_LEN_OLD : MAX_SKEY_LEN_PC)
-extern NCURSES_EXPORT(int) _nc_ripoffline (int line, int (*init)(WINDOW *,int));
-
/*
* Common error messages
*/
#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
+#define TW_MOUSE 2
+#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
+
+#ifdef USE_TERM_DRIVER
+typedef void* TERM_HANDLE;
+
+typedef struct _termInfo
+{
+ bool caninit;
+
+ bool hascolor;
+ bool initcolor;
+ bool canchange;
+
+ int tabsize;
+
+ int maxcolors;
+ int maxpairs;
+ int nocolorvideo;
+
+ int numbuttons;
+ 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*);
+ int (*testmouse)(struct DriverTCB*,int);
+ 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;
+
+extern NCURSES_EXPORT(int) _nc_get_driver(TERMINAL_CONTROL_BLOCK*, const char*, int*);
+extern NCURSES_EXPORT(void) _nc_get_screensize_ex(SCREEN *, TERMINAL *, int *, int *);
+#endif /* USE_TERM_DRIVER */
+
+/*
+ * Entrypoints which are actually provided in the terminal driver, which would
+ * be an sp-name otherwise.
+ */
+#ifdef USE_TERM_DRIVER
+#define TINFO_HAS_KEY _nc_tinfo_has_key
+#define TINFO_DOUPDATE _nc_tinfo_doupdate
+#define TINFO_MVCUR _nc_tinfo_mvcur
+extern NCURSES_EXPORT(int) TINFO_HAS_KEY(SCREEN*, int);
+extern NCURSES_EXPORT(int) TINFO_DOUPDATE(SCREEN *);
+extern NCURSES_EXPORT(int) TINFO_MVCUR(SCREEN*, int, int, int, int);
+#else
+#define TINFO_HAS_KEY NCURSES_SP_NAME(has_key)
+#define TINFO_DOUPDATE NCURSES_SP_NAME(doupdate)
+#define TINFO_MVCUR NCURSES_SP_NAME(mvcur)
+#endif
+
+/*
+ * Entrypoints using an extra parameter with the terminal driver.
+ */
+#ifdef USE_TERM_DRIVER
+extern NCURSES_EXPORT(void) _nc_get_screensize(SCREEN *, TERMINAL *, int *, int *);
+extern NCURSES_EXPORT(int) _nc_setupterm_ex(TERMINAL **, NCURSES_CONST char *, int , int *, bool);
+#define TINFO_GET_SIZE(sp, tp, lp, cp) \
+ _nc_get_screensize(sp, tp, lp, cp)
+#define TINFO_SET_CURTERM(sp, tp) \
+ NCURSES_SP_NAME(set_curterm)(sp, tp)
+#define TINFO_SETUP_TERM(tpp, name, fd, err, reuse) \
+ _nc_setupterm_ex(tpp, name, fd, err, reuse)
+#else /* !USE_TERM_DRIVER */
+extern NCURSES_EXPORT(void) _nc_get_screensize(SCREEN *, int *, int *);
+#define TINFO_GET_SIZE(sp, tp, lp, cp) \
+ _nc_get_screensize(sp, lp, cp)
+#define TINFO_SET_CURTERM(sp, tp) \
+ set_curterm(tp)
+#define TINFO_SETUP_TERM(tpp, name, fd, err, reuse) \
+ _nc_setupterm(name, fd, err, reuse)
+#endif /* !USE_TERM_DRIVER */
+
+#ifdef USE_TERM_DRIVER
+#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;
+#endif
+
+#ifdef USE_TERM_DRIVER
+#define IsTermInfo(sp) (TCBOf(sp) && ((TCBOf(sp)->drv->isTerminfo)))
+#else
+#define IsTermInfo(sp) TRUE
+#endif
+
+#define HasTInfoTerminal(sp) ((0 != TerminalOf(sp)) && IsTermInfo(sp))
+#define IsValidTIScreen(sp) (HasTInfoTerminal(sp))
+
+/*
+ * 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) _nc_outc_wrapper(SCREEN*,int);
+
+#if USE_REENTRANT
+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
+
+/*
+ * We put the safe versions of various calls here as they are not published
+ * part of the API up to now
+ */
+extern NCURSES_EXPORT(TERMINAL*) NCURSES_SP_NAME(_nc_get_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_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_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_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_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_scr_restore)(SCREEN*, const char*);
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_scrolln)(SCREEN*, int, int, int, int);
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_set_tty_mode)(SCREEN*, TTY*);
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_setupscreen)(SCREEN**, int, int, FILE *, bool, int);
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_tgetent)(SCREEN*,char*,const char *);
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_tigetnum)(SCREEN*,NCURSES_CONST char*);
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_vid_attr)(SCREEN *, attr_t, short, void *);
+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, NCURSES_SP_OUTC);
+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_freeall)(SCREEN*);
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_hash_map)(SCREEN*);
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_init_acs)(SCREEN*);
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_make_oldhash)(SCREEN*, int i);
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_mvcur_init)(SCREEN*);
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_mvcur_resume)(SCREEN*);
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_mvcur_wrap)(SCREEN*);
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_screen_init)(SCREEN*);
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_screen_resume)(SCREEN*);
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_screen_wrap)(SCREEN*);
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_scroll_oldhash)(SCREEN*, int n, int top, int bot);
+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);
+
+#if defined(TRACE) || defined(SCROLLDEBUG) || defined(HASHDEBUG)
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_linedump)(SCREEN*);
+#endif
+
+#if USE_WIDEC_SUPPORT
+extern NCURSES_EXPORT(wchar_t *) NCURSES_SP_NAME(_nc_wunctrl)(SCREEN*, cchar_t *);
+#endif
+
+#endif /* NCURSES_SP_FUNCS */
+
+#if NCURSES_SP_FUNCS
+
+#define safe_keyname NCURSES_SP_NAME(keyname)
+#define safe_unctrl NCURSES_SP_NAME(unctrl)
+#define safe_ungetch NCURSES_SP_NAME(ungetch)
+
+#else
+
+#define safe_keyname _nc_keyname
+#define safe_unctrl _nc_unctrl
+#define safe_ungetch _nc_ungetch
+
+extern NCURSES_EXPORT(NCURSES_CONST char *) _nc_keyname (SCREEN *, int);
+extern NCURSES_EXPORT(int) _nc_ungetch (SCREEN *, int);
+extern NCURSES_EXPORT(NCURSES_CONST char *) _nc_unctrl (SCREEN *, chtype);
+
+#endif
+
#ifdef __cplusplus
}
#endif
+/* *INDENT-ON* */
+
#endif /* CURSES_PRIV_H */
diff --git a/ncurses/llib-lncurses b/ncurses/llib-lncurses
index cc0e3667e681..48f42830272a 100644
--- a/ncurses/llib-lncurses
+++ b/ncurses/llib-lncurses
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2011 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,7 +27,7 @@
****************************************************************************/
/****************************************************************************
- * Author: Thomas E. Dickey 1996-2008 *
+ * Author: Thomas E. Dickey 1996-2010,2011 *
****************************************************************************/
/* LINTLIBRARY */
@@ -38,27 +38,54 @@
#undef _nc_oldnums
int *_nc_oldnums;
+#undef _nc_scroll_optimize_sp
+void _nc_scroll_optimize_sp(
+ SCREEN *sp)
+ { /* void */ }
+
#undef _nc_scroll_optimize
void _nc_scroll_optimize(void)
{ /* void */ }
+#undef _nc_linedump_sp
+void _nc_linedump_sp(
+ SCREEN *sp)
+ { /* void */ }
+
#undef _nc_linedump
void _nc_linedump(void)
{ /* void */ }
/* ./tty/hashmap.c */
-#include <term.h>
+#undef _nc_hash_map_sp
+void _nc_hash_map_sp(
+ SCREEN *sp)
+ { /* void */ }
#undef _nc_hash_map
void _nc_hash_map(void)
{ /* void */ }
+#undef _nc_make_oldhash_sp
+void _nc_make_oldhash_sp(
+ SCREEN *sp,
+ int i)
+ { /* void */ }
+
#undef _nc_make_oldhash
void _nc_make_oldhash(
int i)
{ /* void */ }
+#undef _nc_scroll_oldhash_sp
+void _nc_scroll_oldhash_sp(
+ SCREEN *sp,
+ int n,
+ int top,
+ int bot)
+ { /* void */ }
+
#undef _nc_scroll_oldhash
void _nc_scroll_oldhash(
int n,
@@ -112,6 +139,11 @@ int waddchnstr(
/* ./base/lib_beep.c */
+#undef beep_sp
+int beep_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef beep
int beep(void)
{ return(*(int *)0); }
@@ -194,14 +226,32 @@ int COLOR_PAIRS;
#undef COLORS
int COLORS;
+#undef _nc_reset_colors_sp
+NCURSES_BOOL _nc_reset_colors_sp(
+ SCREEN *sp)
+ { return(*(NCURSES_BOOL *)0); }
+
#undef _nc_reset_colors
NCURSES_BOOL _nc_reset_colors(void)
{ return(*(NCURSES_BOOL *)0); }
+#undef start_color_sp
+int start_color_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef start_color
int start_color(void)
{ return(*(int *)0); }
+#undef init_pair_sp
+int init_pair_sp(
+ SCREEN *sp,
+ short pair,
+ short f,
+ short b)
+ { return(*(int *)0); }
+
#undef init_pair
int init_pair(
short pair,
@@ -209,6 +259,15 @@ int init_pair(
short b)
{ return(*(int *)0); }
+#undef init_color_sp
+int init_color_sp(
+ SCREEN *sp,
+ short color,
+ short r,
+ short g,
+ short b)
+ { return(*(int *)0); }
+
#undef init_color
int init_color(
short color,
@@ -217,14 +276,33 @@ int init_color(
short b)
{ return(*(int *)0); }
+#undef can_change_color_sp
+NCURSES_BOOL can_change_color_sp(
+ SCREEN *sp)
+ { return(*(NCURSES_BOOL *)0); }
+
#undef can_change_color
NCURSES_BOOL can_change_color(void)
{ return(*(NCURSES_BOOL *)0); }
+#undef has_colors_sp
+NCURSES_BOOL has_colors_sp(
+ SCREEN *sp)
+ { return(*(NCURSES_BOOL *)0); }
+
#undef has_colors
NCURSES_BOOL has_colors(void)
{ return(*(NCURSES_BOOL *)0); }
+#undef color_content_sp
+int color_content_sp(
+ SCREEN *sp,
+ short color,
+ short *r,
+ short *g,
+ short *b)
+ { return(*(int *)0); }
+
#undef color_content
int color_content(
short color,
@@ -233,6 +311,14 @@ int color_content(
short *b)
{ return(*(int *)0); }
+#undef pair_content_sp
+int pair_content_sp(
+ SCREEN *sp,
+ short pair,
+ short *f,
+ short *b)
+ { return(*(int *)0); }
+
#undef pair_content
int pair_content(
short pair,
@@ -240,13 +326,21 @@ int pair_content(
short *b)
{ return(*(int *)0); }
+#undef _nc_do_color_sp
+void _nc_do_color_sp(
+ SCREEN *sp,
+ short old_pair,
+ short pair,
+ NCURSES_BOOL reverse,
+ NCURSES_OUTC_sp outc)
+ { /* void */ }
+
#undef _nc_do_color
void _nc_do_color(
short old_pair,
short pair,
NCURSES_BOOL reverse,
- int (*outc)(
- int p1))
+ NCURSES_OUTC outc)
{ /* void */ }
/* ./base/lib_colorset.c */
@@ -274,16 +368,31 @@ int delwin(
/* ./base/lib_echo.c */
+#undef echo_sp
+int echo_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef echo
int echo(void)
{ return(*(int *)0); }
+#undef noecho_sp
+int noecho_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef noecho
int noecho(void)
{ return(*(int *)0); }
/* ./base/lib_endwin.c */
+#undef endwin_sp
+int endwin_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef endwin
int endwin(void)
{ return(*(int *)0); }
@@ -297,6 +406,11 @@ int werase(
/* ./base/lib_flash.c */
+#undef flash_sp
+int flash_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef flash
int flash(void)
{ return(*(int *)0); }
@@ -1107,11 +1221,21 @@ NCURSES_BOOL is_notimeout(
const WINDOW *z)
{ return(*(NCURSES_BOOL *)0); }
+#undef is_pad
+NCURSES_BOOL is_pad(
+ const WINDOW *z)
+ { return(*(NCURSES_BOOL *)0); }
+
#undef is_scrollok
NCURSES_BOOL is_scrollok(
const WINDOW *z)
{ return(*(NCURSES_BOOL *)0); }
+#undef is_subwin
+NCURSES_BOOL is_subwin(
+ const WINDOW *z)
+ { return(*(NCURSES_BOOL *)0); }
+
#undef is_syncok
NCURSES_BOOL is_syncok(
const WINDOW *z)
@@ -1138,15 +1262,30 @@ NCURSES_BOOL mouse_trafo(
#undef ESCDELAY
int ESCDELAY;
+#undef set_escdelay_sp
+int set_escdelay_sp(
+ SCREEN *sp,
+ int value)
+ { return(*(int *)0); }
+
#undef set_escdelay
int set_escdelay(
int value)
{ return(*(int *)0); }
+#undef get_escdelay_sp
+int get_escdelay_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef get_escdelay
+int get_escdelay(void)
+ { return(*(int *)0); }
+
#undef _nc_wgetch
int _nc_wgetch(
WINDOW *win,
- unsigned long *result,
+ int *result,
int use_meta)
{ return(*(int *)0); }
@@ -1200,6 +1339,7 @@ WINDOW *initscr(void)
#undef _nc_insert_ch
int _nc_insert_ch(
+ SCREEN *sp,
WINDOW *win,
chtype ch)
{ return(*(int *)0); }
@@ -1238,6 +1378,11 @@ int winnstr(
/* ./base/lib_isendwin.c */
+#undef isendwin_sp
+NCURSES_BOOL isendwin_sp(
+ SCREEN *sp)
+ { return(*(NCURSES_BOOL *)0); }
+
#undef isendwin
NCURSES_BOOL isendwin(void)
{ return(*(NCURSES_BOOL *)0); }
@@ -1252,16 +1397,35 @@ int leaveok(
/* ./base/lib_mouse.c */
+#undef getmouse_sp
+int getmouse_sp(
+ SCREEN *sp,
+ MEVENT *aevent)
+ { return(*(int *)0); }
+
#undef getmouse
int getmouse(
MEVENT *aevent)
{ return(*(int *)0); }
+#undef ungetmouse_sp
+int ungetmouse_sp(
+ SCREEN *sp,
+ MEVENT *aevent)
+ { return(*(int *)0); }
+
#undef ungetmouse
int ungetmouse(
MEVENT *aevent)
{ return(*(int *)0); }
+#undef mousemask_sp
+mmask_t mousemask_sp(
+ SCREEN *sp,
+ mmask_t newmask,
+ mmask_t *oldmask)
+ { return(*(mmask_t *)0); }
+
#undef mousemask
mmask_t mousemask(
mmask_t newmask,
@@ -1275,14 +1439,30 @@ NCURSES_BOOL wenclose(
int x)
{ return(*(NCURSES_BOOL *)0); }
+#undef mouseinterval_sp
+int mouseinterval_sp(
+ SCREEN *sp,
+ int maxclick)
+ { return(*(int *)0); }
+
#undef mouseinterval
int mouseinterval(
int maxclick)
{ return(*(int *)0); }
#undef _nc_has_mouse
-int _nc_has_mouse(void)
- { return(*(int *)0); }
+NCURSES_BOOL _nc_has_mouse(
+ SCREEN *sp)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef has_mouse_sp
+NCURSES_BOOL has_mouse_sp(
+ SCREEN *sp)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef has_mouse
+NCURSES_BOOL has_mouse(void)
+ { return(*(NCURSES_BOOL *)0); }
#undef wmouse_trafo
NCURSES_BOOL wmouse_trafo(
@@ -1303,24 +1483,55 @@ int wmove(
/* ./tty/lib_mvcur.c */
+#undef _nc_msec_cost_sp
+int _nc_msec_cost_sp(
+ SCREEN *sp,
+ const char *const cap,
+ int affcnt)
+ { return(*(int *)0); }
+
#undef _nc_msec_cost
int _nc_msec_cost(
const char *const cap,
int affcnt)
{ return(*(int *)0); }
+#undef _nc_mvcur_resume_sp
+void _nc_mvcur_resume_sp(
+ SCREEN *sp)
+ { /* void */ }
+
#undef _nc_mvcur_resume
void _nc_mvcur_resume(void)
{ /* void */ }
+#undef _nc_mvcur_init_sp
+void _nc_mvcur_init_sp(
+ SCREEN *sp)
+ { /* void */ }
+
#undef _nc_mvcur_init
void _nc_mvcur_init(void)
{ /* void */ }
+#undef _nc_mvcur_wrap_sp
+void _nc_mvcur_wrap_sp(
+ SCREEN *sp)
+ { /* void */ }
+
#undef _nc_mvcur_wrap
void _nc_mvcur_wrap(void)
{ /* void */ }
+#undef mvcur_sp
+int mvcur_sp(
+ SCREEN *sp,
+ int yold,
+ int xold,
+ int ynew,
+ int xnew)
+ { return(*(int *)0); }
+
#undef mvcur
int mvcur(
int yold,
@@ -1343,14 +1554,32 @@ int mvwin(
/* ./base/lib_newterm.c */
+#undef filter_sp
+void filter_sp(
+ SCREEN *sp)
+ { /* void */ }
+
#undef filter
void filter(void)
{ /* void */ }
+#undef nofilter_sp
+void nofilter_sp(
+ SCREEN *sp)
+ { /* void */ }
+
#undef nofilter
void nofilter(void)
{ /* void */ }
+#undef newterm_sp
+SCREEN *newterm_sp(
+ SCREEN *sp,
+ char *name,
+ FILE *ofp,
+ FILE *ifp)
+ { return(*(SCREEN **)0); }
+
#undef newterm
SCREEN *newterm(
char *name,
@@ -1365,6 +1594,15 @@ int _nc_freewin(
WINDOW *win)
{ return(*(int *)0); }
+#undef newwin_sp
+WINDOW *newwin_sp(
+ SCREEN *sp,
+ int num_lines,
+ int num_columns,
+ int begy,
+ int begx)
+ { return(*(WINDOW **)0); }
+
#undef newwin
WINDOW *newwin(
int num_lines,
@@ -1391,8 +1629,9 @@ WINDOW *subwin(
int x)
{ return(*(WINDOW **)0); }
-#undef _nc_makenew
-WINDOW *_nc_makenew(
+#undef _nc_makenew_sp
+WINDOW *_nc_makenew_sp(
+ SCREEN *sp,
int num_lines,
int num_columns,
int begy,
@@ -1400,17 +1639,37 @@ WINDOW *_nc_makenew(
int flags)
{ return(*(WINDOW **)0); }
-#undef _nc_screen_of
-SCREEN *_nc_screen_of(
- WINDOW *win)
- { return(*(SCREEN **)0); }
+#undef _nc_curscr_of
+WINDOW *_nc_curscr_of(
+ SCREEN *sp)
+ { return(*(WINDOW **)0); }
+
+#undef _nc_newscr_of
+WINDOW *_nc_newscr_of(
+ SCREEN *sp)
+ { return(*(WINDOW **)0); }
+
+#undef _nc_stdscr_of
+WINDOW *_nc_stdscr_of(
+ SCREEN *sp)
+ { return(*(WINDOW **)0); }
/* ./base/lib_nl.c */
+#undef nl_sp
+int nl_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef nl
int nl(void)
{ return(*(int *)0); }
+#undef nonl_sp
+int nonl_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef nonl
int nonl(void)
{ return(*(int *)0); }
@@ -1444,6 +1703,13 @@ int copywin(
/* ./base/lib_pad.c */
+#undef newpad_sp
+WINDOW *newpad_sp(
+ SCREEN *sp,
+ int l,
+ int c)
+ { return(*(WINDOW **)0); }
+
#undef newpad
WINDOW *newpad(
int l,
@@ -1549,6 +1815,14 @@ int wnoutrefresh(
/* ./base/lib_restart.c */
+#undef restartterm_sp
+int restartterm_sp(
+ SCREEN *sp,
+ char *termp,
+ int filenum,
+ int *errret)
+ { return(*(int *)0); }
+
#undef restartterm
int restartterm(
char *termp,
@@ -1597,6 +1871,12 @@ int mvwscanw(
/* ./base/lib_screen.c */
+#undef getwin_sp
+WINDOW *getwin_sp(
+ SCREEN *sp,
+ FILE *filep)
+ { return(*(WINDOW **)0); }
+
#undef getwin
WINDOW *getwin(
FILE *filep)
@@ -1608,6 +1888,12 @@ int putwin(
FILE *filep)
{ return(*(int *)0); }
+#undef scr_restore_sp
+int scr_restore_sp(
+ SCREEN *sp,
+ const char *file)
+ { return(*(int *)0); }
+
#undef scr_restore
int scr_restore(
const char *file)
@@ -1618,11 +1904,23 @@ int scr_dump(
const char *file)
{ return(*(int *)0); }
+#undef scr_init_sp
+int scr_init_sp(
+ SCREEN *sp,
+ const char *file)
+ { return(*(int *)0); }
+
#undef scr_init
int scr_init(
const char *file)
{ return(*(int *)0); }
+#undef scr_set_sp
+int scr_set_sp(
+ SCREEN *sp,
+ const char *file)
+ { return(*(int *)0); }
+
#undef scr_set
int scr_set(
const char *file)
@@ -1674,6 +1972,16 @@ void delscreen(
SCREEN *sp)
{ /* void */ }
+#undef _nc_setupscreen_sp
+int _nc_setupscreen_sp(
+ SCREEN **spp,
+ int slines,
+ int scolumns,
+ FILE *output,
+ NCURSES_BOOL filtered,
+ int slk_format)
+ { return(*(int *)0); }
+
#undef _nc_setupscreen
int _nc_setupscreen(
int slines,
@@ -1683,6 +1991,15 @@ int _nc_setupscreen(
int slk_format)
{ return(*(int *)0); }
+#undef _nc_ripoffline_sp
+int _nc_ripoffline_sp(
+ SCREEN *sp,
+ int line,
+ int (*init)(
+ WINDOW *p1,
+ int p2))
+ { return(*(int *)0); }
+
#undef _nc_ripoffline
int _nc_ripoffline(
int line,
@@ -1691,6 +2008,15 @@ int _nc_ripoffline(
int p2))
{ return(*(int *)0); }
+#undef ripoffline_sp
+int ripoffline_sp(
+ SCREEN *sp,
+ int line,
+ int (*init)(
+ WINDOW *p1,
+ int p2))
+ { return(*(int *)0); }
+
#undef ripoffline
int ripoffline(
int line,
@@ -1701,18 +2027,37 @@ int ripoffline(
/* ./base/lib_slk.c */
+#undef _nc_format_slks
+int _nc_format_slks(
+ SCREEN *sp,
+ int cols)
+ { return(*(int *)0); }
+
#undef _nc_slk_initialize
int _nc_slk_initialize(
WINDOW *stwin,
int cols)
{ return(*(int *)0); }
+#undef slk_restore_sp
+int slk_restore_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef slk_restore
int slk_restore(void)
{ return(*(int *)0); }
/* ./base/lib_slkatr_set.c */
+#undef slk_attr_set_sp
+int slk_attr_set_sp(
+ SCREEN *sp,
+ const attr_t attr,
+ short color_pair_number,
+ void *opts)
+ { return(*(int *)0); }
+
#undef slk_attr_set
int slk_attr_set(
const attr_t attr,
@@ -1722,6 +2067,12 @@ int slk_attr_set(
/* ./base/lib_slkatrof.c */
+#undef slk_attroff_sp
+int slk_attroff_sp(
+ SCREEN *sp,
+ const chtype attr)
+ { return(*(int *)0); }
+
#undef slk_attroff
int slk_attroff(
const chtype attr)
@@ -1729,6 +2080,12 @@ int slk_attroff(
/* ./base/lib_slkatron.c */
+#undef slk_attron_sp
+int slk_attron_sp(
+ SCREEN *sp,
+ const chtype attr)
+ { return(*(int *)0); }
+
#undef slk_attron
int slk_attron(
const chtype attr)
@@ -1736,6 +2093,12 @@ int slk_attron(
/* ./base/lib_slkatrset.c */
+#undef slk_attrset_sp
+int slk_attrset_sp(
+ SCREEN *sp,
+ const chtype attr)
+ { return(*(int *)0); }
+
#undef slk_attrset
int slk_attrset(
const chtype attr)
@@ -1743,18 +2106,34 @@ int slk_attrset(
/* ./base/lib_slkattr.c */
+#undef slk_attr_sp
+attr_t slk_attr_sp(
+ SCREEN *sp)
+ { return(*(attr_t *)0); }
+
#undef slk_attr
attr_t slk_attr(void)
{ return(*(attr_t *)0); }
/* ./base/lib_slkclear.c */
+#undef slk_clear_sp
+int slk_clear_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef slk_clear
int slk_clear(void)
{ return(*(int *)0); }
/* ./base/lib_slkcolor.c */
+#undef slk_color_sp
+int slk_color_sp(
+ SCREEN *sp,
+ short color_pair_number)
+ { return(*(int *)0); }
+
#undef slk_color
int slk_color(
short color_pair_number)
@@ -1762,6 +2141,12 @@ int slk_color(
/* ./base/lib_slkinit.c */
+#undef slk_init_sp
+int slk_init_sp(
+ SCREEN *sp,
+ int format)
+ { return(*(int *)0); }
+
#undef slk_init
int slk_init(
int format)
@@ -1769,6 +2154,12 @@ int slk_init(
/* ./base/lib_slklab.c */
+#undef slk_label_sp
+char *slk_label_sp(
+ SCREEN *sp,
+ int n)
+ { return(*(char **)0); }
+
#undef slk_label
char *slk_label(
int n)
@@ -1776,16 +2167,34 @@ char *slk_label(
/* ./base/lib_slkrefr.c */
+#undef slk_noutrefresh_sp
+int slk_noutrefresh_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef slk_noutrefresh
int slk_noutrefresh(void)
{ return(*(int *)0); }
+#undef slk_refresh_sp
+int slk_refresh_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef slk_refresh
int slk_refresh(void)
{ return(*(int *)0); }
/* ./base/lib_slkset.c */
+#undef slk_set_sp
+int slk_set_sp(
+ SCREEN *sp,
+ int i,
+ const char *astr,
+ int format)
+ { return(*(int *)0); }
+
#undef slk_set
int slk_set(
int i,
@@ -1795,6 +2204,11 @@ int slk_set(
/* ./base/lib_slktouch.c */
+#undef slk_touch_sp
+int slk_touch_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef slk_touch
int slk_touch(void)
{ return(*(int *)0); }
@@ -1836,6 +2250,12 @@ char *_nc_tracemouse(
MEVENT const *ep)
{ return(*(char **)0); }
+#undef _nc_retrace_mmask_t
+mmask_t _nc_retrace_mmask_t(
+ SCREEN *sp,
+ mmask_t code)
+ { return(*(mmask_t *)0); }
+
#undef _tracemouse
char *_tracemouse(
MEVENT const *ep)
@@ -1857,8 +2277,8 @@ void _nc_fifo_dump(
SCREEN *sp)
{ /* void */ }
-#undef _nc_ungetch
-int _nc_ungetch(
+#undef ungetch_sp
+int ungetch_sp(
SCREEN *sp,
int ch)
{ return(*(int *)0); }
@@ -1870,11 +2290,23 @@ int ungetch(
/* ./tty/lib_vidattr.c */
+#undef vidputs_sp
+int vidputs_sp(
+ SCREEN *sp,
+ chtype newmode,
+ NCURSES_OUTC_sp outc)
+ { return(*(int *)0); }
+
#undef vidputs
int vidputs(
chtype newmode,
- int (*outc)(
- int p1))
+ NCURSES_OUTC outc)
+ { return(*(int *)0); }
+
+#undef vidattr_sp
+int vidattr_sp(
+ SCREEN *sp,
+ chtype newmode)
{ return(*(int *)0); }
#undef vidattr
@@ -1882,6 +2314,11 @@ int vidattr(
chtype newmode)
{ return(*(int *)0); }
+#undef termattrs_sp
+chtype termattrs_sp(
+ SCREEN *sp)
+ { return(*(chtype *)0); }
+
#undef termattrs
chtype termattrs(void)
{ return(*(chtype *)0); }
@@ -1962,12 +2399,24 @@ WINDOW *dupwin(
/* ./base/nc_panel.c */
+#undef _nc_panelhook_sp
+struct panelhook *_nc_panelhook_sp(
+ SCREEN *sp)
+ { return(*(struct panelhook **)0); }
+
#undef _nc_panelhook
struct panelhook *_nc_panelhook(void)
{ return(*(struct panelhook **)0); }
/* ./base/safe_sprintf.c */
+#undef _nc_printf_string_sp
+char *_nc_printf_string_sp(
+ SCREEN *sp,
+ const char *fmt,
+ va_list ap)
+ { return(*(char **)0); }
+
#undef _nc_printf_string
char *_nc_printf_string(
const char *fmt,
@@ -1979,10 +2428,24 @@ char *_nc_printf_string(
#include <sys/time.h>
#include <sys/times.h>
+#undef doupdate_sp
+int doupdate_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef doupdate
int doupdate(void)
{ return(*(int *)0); }
+#undef _nc_scrolln_sp
+int _nc_scrolln_sp(
+ SCREEN *sp,
+ int n,
+ int top,
+ int bot,
+ int maxy)
+ { return(*(int *)0); }
+
#undef _nc_scrolln
int _nc_scrolln(
int n,
@@ -1991,18 +2454,39 @@ int _nc_scrolln(
int maxy)
{ return(*(int *)0); }
+#undef _nc_screen_resume_sp
+void _nc_screen_resume_sp(
+ SCREEN *sp)
+ { /* void */ }
+
#undef _nc_screen_resume
void _nc_screen_resume(void)
{ /* void */ }
+#undef _nc_screen_init_sp
+void _nc_screen_init_sp(
+ SCREEN *sp)
+ { /* void */ }
+
#undef _nc_screen_init
void _nc_screen_init(void)
{ /* void */ }
+#undef _nc_screen_wrap_sp
+void _nc_screen_wrap_sp(
+ SCREEN *sp)
+ { /* void */ }
+
#undef _nc_screen_wrap
void _nc_screen_wrap(void)
{ /* void */ }
+#undef _nc_do_xmc_glitch_sp
+void _nc_do_xmc_glitch_sp(
+ SCREEN *sp,
+ attr_t previous)
+ { /* void */ }
+
#undef _nc_do_xmc_glitch
void _nc_do_xmc_glitch(
attr_t previous)
@@ -2034,12 +2518,16 @@ void _nc_vsscanf(void)
/* ./base/lib_freeall.c */
-#include <term_entry.h>
-
#undef _nc_freeall
void _nc_freeall(void)
{ /* void */ }
+#undef _nc_free_and_exit_sp
+void _nc_free_and_exit_sp(
+ SCREEN *sp,
+ int code)
+ { /* void */ }
+
#undef _nc_free_and_exit
void _nc_free_and_exit(
int code)
@@ -2059,6 +2547,24 @@ void _nc_toggle_attr_off(
attr_t at)
{ /* void */ }
+#undef _nc_DelCharCost_sp
+int _nc_DelCharCost_sp(
+ SCREEN *sp,
+ int count)
+ { return(*(int *)0); }
+
+#undef _nc_InsCharCost_sp
+int _nc_InsCharCost_sp(
+ SCREEN *sp,
+ int count)
+ { return(*(int *)0); }
+
+#undef _nc_UpdateAttrs_sp
+void _nc_UpdateAttrs_sp(
+ SCREEN *sp,
+ chtype c)
+ { /* void */ }
+
#undef _nc_DelCharCost
int _nc_DelCharCost(
int count)
@@ -2076,6 +2582,12 @@ void _nc_UpdateAttrs(
/* ./base/legacy_coding.c */
+#undef use_legacy_coding_sp
+int use_legacy_coding_sp(
+ SCREEN *sp,
+ int level)
+ { return(*(int *)0); }
+
#undef use_legacy_coding
int use_legacy_coding(
int level)
@@ -2083,10 +2595,22 @@ int use_legacy_coding(
/* ./base/lib_dft_fgbg.c */
+#undef use_default_colors_sp
+int use_default_colors_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef use_default_colors
int use_default_colors(void)
{ return(*(int *)0); }
+#undef assume_default_colors_sp
+int assume_default_colors_sp(
+ SCREEN *sp,
+ int fg,
+ int bg)
+ { return(*(int *)0); }
+
#undef assume_default_colors
int assume_default_colors(
int fg,
@@ -2095,6 +2619,13 @@ int assume_default_colors(
/* ./tinfo/lib_print.c */
+#undef mcprint_sp
+int mcprint_sp(
+ SCREEN *sp,
+ char *data,
+ int len)
+ { return(*(int *)0); }
+
#undef mcprint
int mcprint(
char *data,
@@ -2103,18 +2634,39 @@ int mcprint(
/* ./base/resizeterm.c */
+#undef is_term_resized_sp
+NCURSES_BOOL is_term_resized_sp(
+ SCREEN *sp,
+ int ToLines,
+ int ToCols)
+ { return(*(NCURSES_BOOL *)0); }
+
#undef is_term_resized
NCURSES_BOOL is_term_resized(
int ToLines,
int ToCols)
{ return(*(NCURSES_BOOL *)0); }
+#undef resize_term_sp
+int resize_term_sp(
+ SCREEN *sp,
+ int ToLines,
+ int ToCols)
+ { return(*(int *)0); }
+
#undef resize_term
int resize_term(
int ToLines,
int ToCols)
{ return(*(int *)0); }
+#undef resizeterm_sp
+int resizeterm_sp(
+ SCREEN *sp,
+ int ToLines,
+ int ToCols)
+ { return(*(int *)0); }
+
#undef resizeterm
int resizeterm(
int ToLines,
@@ -2157,9 +2709,6 @@ int wresize(
/* ./tinfo/access.c */
-#include <sys/stat.h>
-#include <nc_alloc.h>
-
#undef _nc_rootname
char *_nc_rootname(
char *path)
@@ -2232,7 +2781,32 @@ char *const numcodes[] = {0};
#undef strcodes
char *const strcodes[] = {0};
+/* ./comp_captab.c */
+
+#include <hashsize.h>
+
+#undef _nc_get_table
+const struct name_table_entry *_nc_get_table(
+ NCURSES_BOOL termcap)
+ { return(*(const struct name_table_entry **)0); }
+
+#undef _nc_get_hash_table
+const HashValue *_nc_get_hash_table(
+ NCURSES_BOOL termcap)
+ { return(*(const HashValue **)0); }
+
+#undef _nc_get_alias_table
+const struct alias *_nc_get_alias_table(
+ NCURSES_BOOL termcap)
+ { return(*(const struct alias **)0); }
+
+#undef _nc_get_hash_info
+const HashData *_nc_get_hash_info(
+ NCURSES_BOOL termcap)
+ { return(*(const HashData **)0); }
+
/* ./tinfo/comp_error.c */
+
#undef _nc_suppress_warnings
NCURSES_BOOL _nc_suppress_warnings;
#undef _nc_curr_line
@@ -2277,6 +2851,21 @@ void _nc_syserr_abort(
...)
{ /* void */ }
+/* ./tinfo/comp_hash.c */
+
+#undef _nc_find_entry
+struct name_table_entry const *_nc_find_entry(
+ const char *string,
+ const HashValue *hash_table)
+ { return(*(struct name_table_entry const **)0); }
+
+#undef _nc_find_type_entry
+struct name_table_entry const *_nc_find_type_entry(
+ const char *string,
+ int type,
+ NCURSES_BOOL termcap)
+ { return(*(struct name_table_entry const **)0); }
+
/* ./tinfo/db_iterator.c */
#undef _nc_tic_dir
@@ -2397,6 +2986,11 @@ void _nc_init_keytry(
#undef acs_map
chtype acs_map[128];
+#undef _nc_init_acs_sp
+void _nc_init_acs_sp(
+ SCREEN *sp)
+ { /* void */ }
+
#undef _nc_init_acs
void _nc_init_acs(void)
{ /* void */ }
@@ -2420,6 +3014,11 @@ int _nc_ospeed(
int BaudRate)
{ return(*(int *)0); }
+#undef baudrate_sp
+int baudrate_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef baudrate
int baudrate(void)
{ return(*(int *)0); }
@@ -2429,11 +3028,23 @@ int baudrate(void)
#undef cur_term
TERMINAL *cur_term;
+#undef set_curterm_sp
+TERMINAL *set_curterm_sp(
+ SCREEN *sp,
+ TERMINAL *termp)
+ { return(*(TERMINAL **)0); }
+
#undef set_curterm
TERMINAL *set_curterm(
TERMINAL *termp)
{ return(*(TERMINAL **)0); }
+#undef del_curterm_sp
+int del_curterm_sp(
+ SCREEN *sp,
+ TERMINAL *termp)
+ { return(*(int *)0); }
+
#undef del_curterm
int del_curterm(
TERMINAL *termp)
@@ -2456,26 +3067,56 @@ NCURSES_GLOBALS _nc_globals;
#undef _nc_prescreen
NCURSES_PRESCREEN _nc_prescreen;
+#undef _nc_screen_of
+SCREEN *_nc_screen_of(
+ WINDOW *win)
+ { return(*(SCREEN **)0); }
+
/* ./tinfo/lib_has_cap.c */
+#undef has_ic_sp
+NCURSES_BOOL has_ic_sp(
+ SCREEN *sp)
+ { return(*(NCURSES_BOOL *)0); }
+
#undef has_ic
NCURSES_BOOL has_ic(void)
{ return(*(NCURSES_BOOL *)0); }
+#undef has_il_sp
+NCURSES_BOOL has_il_sp(
+ SCREEN *sp)
+ { return(*(NCURSES_BOOL *)0); }
+
#undef has_il
NCURSES_BOOL has_il(void)
{ return(*(NCURSES_BOOL *)0); }
/* ./tinfo/lib_kernel.c */
+#undef erasechar_sp
+char erasechar_sp(
+ SCREEN *sp)
+ { return(*(char *)0); }
+
#undef erasechar
char erasechar(void)
{ return(*(char *)0); }
+#undef killchar_sp
+char killchar_sp(
+ SCREEN *sp)
+ { return(*(char *)0); }
+
#undef killchar
char killchar(void)
{ return(*(char *)0); }
+#undef flushinp_sp
+int flushinp_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef flushinp
int flushinp(void)
{ return(*(int *)0); }
@@ -2484,8 +3125,8 @@ int flushinp(void)
struct kn { short offset; int code; };
-#undef _nc_keyname
-char *_nc_keyname(
+#undef keyname_sp
+char *keyname_sp(
SCREEN *sp,
int c)
{ return(*(char **)0); }
@@ -2505,6 +3146,12 @@ char *longname(void)
#include <time.h>
+#undef napms_sp
+int napms_sp(
+ SCREEN *sp,
+ int ms)
+ { return(*(int *)0); }
+
#undef napms
int napms(
int ms)
@@ -2524,6 +3171,12 @@ void idcok(
NCURSES_BOOL flag)
{ /* void */ }
+#undef halfdelay_sp
+int halfdelay_sp(
+ SCREEN *sp,
+ int t)
+ { return(*(int *)0); }
+
#undef halfdelay
int halfdelay(
int t)
@@ -2559,21 +3212,46 @@ int meta(
NCURSES_BOOL flag)
{ return(*(int *)0); }
+#undef curs_set_sp
+int curs_set_sp(
+ SCREEN *sp,
+ int vis)
+ { return(*(int *)0); }
+
#undef curs_set
int curs_set(
int vis)
{ return(*(int *)0); }
+#undef typeahead_sp
+int typeahead_sp(
+ SCREEN *sp,
+ int fd)
+ { return(*(int *)0); }
+
#undef typeahead
int typeahead(
int fd)
{ return(*(int *)0); }
+#undef has_key_sp
+int has_key_sp(
+ SCREEN *sp,
+ int keycode)
+ { return(*(int *)0); }
+
#undef has_key
int has_key(
int keycode)
{ return(*(int *)0); }
+#undef _nc_putp_flush_sp
+int _nc_putp_flush_sp(
+ SCREEN *sp,
+ const char *name,
+ const char *value)
+ { return(*(int *)0); }
+
#undef _nc_keypad
int _nc_keypad(
SCREEN *sp,
@@ -2582,30 +3260,67 @@ int _nc_keypad(
/* ./tinfo/lib_raw.c */
+#undef raw_sp
+int raw_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef raw
int raw(void)
{ return(*(int *)0); }
+#undef cbreak_sp
+int cbreak_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef cbreak
int cbreak(void)
{ return(*(int *)0); }
+#undef qiflush_sp
+void qiflush_sp(
+ SCREEN *sp)
+ { /* void */ }
+
#undef qiflush
void qiflush(void)
{ /* void */ }
+#undef noraw_sp
+int noraw_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef noraw
int noraw(void)
{ return(*(int *)0); }
+#undef nocbreak_sp
+int nocbreak_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef nocbreak
int nocbreak(void)
{ return(*(int *)0); }
+#undef noqiflush_sp
+void noqiflush_sp(
+ SCREEN *sp)
+ { /* void */ }
+
#undef noqiflush
void noqiflush(void)
{ /* void */ }
+#undef intrflush_sp
+int intrflush_sp(
+ SCREEN *sp,
+ WINDOW *win,
+ NCURSES_BOOL flag)
+ { return(*(int *)0); }
+
#undef intrflush
int intrflush(
WINDOW *win,
@@ -2627,6 +3342,12 @@ int COLS;
#undef TABSIZE
int TABSIZE;
+#undef set_tabsize_sp
+int set_tabsize_sp(
+ SCREEN *sp,
+ int value)
+ { return(*(int *)0); }
+
#undef set_tabsize
int set_tabsize(
int value)
@@ -2637,6 +3358,12 @@ int _nc_handle_sigwinch(
SCREEN *sp)
{ return(*(int *)0); }
+#undef use_env_sp
+void use_env_sp(
+ SCREEN *sp,
+ NCURSES_BOOL f)
+ { /* void */ }
+
#undef use_env
void use_env(
NCURSES_BOOL f)
@@ -2654,6 +3381,18 @@ void _nc_update_screensize(
SCREEN *sp)
{ /* void */ }
+#undef _nc_setup_tinfo
+int _nc_setup_tinfo(
+ const char *const tn,
+ TERMTYPE *const tp)
+ { return(*(int *)0); }
+
+#undef _nc_tinfo_cmdch
+void _nc_tinfo_cmdch(
+ TERMINAL *termp,
+ char proto)
+ { /* void */ }
+
#undef _nc_get_locale
char *_nc_get_locale(void)
{ return(*(char **)0); }
@@ -2675,6 +3414,10 @@ int _nc_setupterm(
NCURSES_BOOL reuse)
{ return(*(int *)0); }
+#undef new_prescr
+SCREEN *new_prescr(void)
+ { return(*(SCREEN **)0); }
+
#undef setupterm
int setupterm(
char *tname,
@@ -2689,8 +3432,9 @@ char *UP;
#undef BC
char *BC;
-#undef tgetent
-int tgetent(
+#undef tgetent_sp
+int tgetent_sp(
+ SCREEN *sp,
char *bufp,
const char *name)
{ return(*(int *)0); }
@@ -2701,16 +3445,41 @@ int tgetent(
#endif
+#undef tgetent
+int tgetent(
+ char *bufp,
+ const char *name)
+ { return(*(int *)0); }
+
+#undef tgetflag_sp
+int tgetflag_sp(
+ SCREEN *sp,
+ char *id)
+ { return(*(int *)0); }
+
#undef tgetflag
int tgetflag(
char *id)
{ return(*(int *)0); }
+#undef tgetnum_sp
+int tgetnum_sp(
+ SCREEN *sp,
+ char *id)
+ { return(*(int *)0); }
+
#undef tgetnum
int tgetnum(
char *id)
{ return(*(int *)0); }
+#undef tgetstr_sp
+char *tgetstr_sp(
+ SCREEN *sp,
+ char *id,
+ char **area)
+ { return(*(char **)0); }
+
#undef tgetstr
char *tgetstr(
char *id,
@@ -2719,6 +3488,11 @@ char *tgetstr(
/* ./tinfo/lib_termname.c */
+#undef termname_sp
+char *termname_sp(
+ SCREEN *sp)
+ { return(*(char **)0); }
+
#undef termname
char *termname(void)
{ return(*(char **)0); }
@@ -2734,16 +3508,34 @@ char *tgoto(
/* ./tinfo/lib_ti.c */
+#undef tigetflag_sp
+int tigetflag_sp(
+ SCREEN *sp,
+ char *str)
+ { return(*(int *)0); }
+
#undef tigetflag
int tigetflag(
char *str)
{ return(*(int *)0); }
+#undef tigetnum_sp
+int tigetnum_sp(
+ SCREEN *sp,
+ char *str)
+ { return(*(int *)0); }
+
#undef tigetnum
int tigetnum(
char *str)
{ return(*(int *)0); }
+#undef tigetstr_sp
+char *tigetstr_sp(
+ SCREEN *sp,
+ char *str)
+ { return(*(char **)0); }
+
#undef tigetstr
char *tigetstr(
char *str)
@@ -2767,6 +3559,12 @@ char *tparm(
...)
{ return(*(char **)0); }
+#undef tiparm
+char *tiparm(
+ const char *string,
+ ...)
+ { return(*(char **)0); }
+
/* ./tinfo/lib_tputs.c */
#undef PC
@@ -2781,25 +3579,75 @@ void _nc_set_no_padding(
SCREEN *sp)
{ /* void */ }
+#undef delay_output_sp
+int delay_output_sp(
+ SCREEN *sp,
+ int ms)
+ { return(*(int *)0); }
+
#undef delay_output
int delay_output(
int ms)
{ return(*(int *)0); }
+#undef _nc_flush_sp
+void _nc_flush_sp(
+ SCREEN *sp)
+ { /* void */ }
+
#undef _nc_flush
void _nc_flush(void)
{ /* void */ }
+#undef _nc_outch_sp
+int _nc_outch_sp(
+ SCREEN *sp,
+ int ch)
+ { return(*(int *)0); }
+
#undef _nc_outch
int _nc_outch(
int ch)
{ return(*(int *)0); }
+#undef putp_sp
+int putp_sp(
+ SCREEN *sp,
+ const char *string)
+ { return(*(int *)0); }
+
+#undef _nc_putp_sp
+int _nc_putp_sp(
+ SCREEN *sp,
+ const char *name,
+ const char *string)
+ { return(*(int *)0); }
+
#undef putp
int putp(
const char *string)
{ return(*(int *)0); }
+#undef _nc_putp
+int _nc_putp(
+ const char *name,
+ const char *string)
+ { return(*(int *)0); }
+
+#undef tputs_sp
+int tputs_sp(
+ SCREEN *sp,
+ const char *string,
+ int affcnt,
+ NCURSES_OUTC_sp outc)
+ { return(*(int *)0); }
+
+#undef _nc_outc_wrapper
+int _nc_outc_wrapper(
+ SCREEN *sp,
+ int c)
+ { return(*(int *)0); }
+
#undef tputs
int tputs(
const char *string,
@@ -2833,6 +3681,11 @@ NCURSES_BOOL _nc_retrace_bool(
NCURSES_BOOL code)
{ return(*(NCURSES_BOOL *)0); }
+#undef _nc_retrace_char
+char _nc_retrace_char(
+ char code)
+ { return(*(char *)0); }
+
#undef _nc_retrace_int
int _nc_retrace_int(
int code)
@@ -2886,6 +3739,11 @@ char *_traceattr(
attr_t newmode)
{ return(*(char **)0); }
+#undef _nc_retrace_int_attr_t
+int _nc_retrace_int_attr_t(
+ attr_t code)
+ { return(*(int *)0); }
+
#undef _nc_retrace_attr_t
attr_t _nc_retrace_attr_t(
attr_t code)
@@ -2944,36 +3802,78 @@ char *_tracechar(
/* ./tinfo/lib_ttyflags.c */
+#undef _nc_get_tty_mode_sp
+int _nc_get_tty_mode_sp(
+ SCREEN *sp,
+ struct termios *buf)
+ { return(*(int *)0); }
+
#undef _nc_get_tty_mode
int _nc_get_tty_mode(
struct termios *buf)
{ return(*(int *)0); }
+#undef _nc_set_tty_mode_sp
+int _nc_set_tty_mode_sp(
+ SCREEN *sp,
+ struct termios *buf)
+ { return(*(int *)0); }
+
#undef _nc_set_tty_mode
int _nc_set_tty_mode(
struct termios *buf)
{ return(*(int *)0); }
+#undef def_shell_mode_sp
+int def_shell_mode_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef def_shell_mode
int def_shell_mode(void)
{ return(*(int *)0); }
+#undef def_prog_mode_sp
+int def_prog_mode_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef def_prog_mode
int def_prog_mode(void)
{ return(*(int *)0); }
+#undef reset_prog_mode_sp
+int reset_prog_mode_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef reset_prog_mode
int reset_prog_mode(void)
{ return(*(int *)0); }
+#undef reset_shell_mode_sp
+int reset_shell_mode_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef reset_shell_mode
int reset_shell_mode(void)
{ return(*(int *)0); }
+#undef savetty_sp
+int savetty_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef savetty
int savetty(void)
{ return(*(int *)0); }
+#undef resetty_sp
+int resetty_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef resetty
int resetty(void)
{ return(*(int *)0); }
@@ -3053,6 +3953,13 @@ int _nc_read_termcap_entry(
/* ./tinfo/setbuf.c */
+#undef _nc_set_buffer_sp
+void _nc_set_buffer_sp(
+ SCREEN *sp,
+ FILE *ofp,
+ NCURSES_BOOL buffered)
+ { /* void */ }
+
#undef _nc_set_buffer
void _nc_set_buffer(
FILE *ofp,
@@ -3144,8 +4051,8 @@ char *_nc_trim_sgr0(
/* ./unctrl.c */
-#undef _nc_unctrl
-char *_nc_unctrl(
+#undef unctrl_sp
+char *unctrl_sp(
SCREEN *sp,
chtype ch)
{ return(*(char **)0); }
@@ -3232,25 +4139,6 @@ char *_nc_infotocap(
int const parameterized)
{ return(*(char **)0); }
-/* ./comp_captab.c */
-
-#include <hashsize.h>
-
-#undef _nc_get_table
-const struct name_table_entry *_nc_get_table(
- NCURSES_BOOL termcap)
- { return(*(const struct name_table_entry **)0); }
-
-#undef _nc_get_hash_table
-const short *_nc_get_hash_table(
- NCURSES_BOOL termcap)
- { return(*(const short **)0); }
-
-#undef _nc_get_alias_table
-const struct alias *_nc_get_alias_table(
- NCURSES_BOOL termcap)
- { return(*(const struct alias **)0); }
-
/* ./tinfo/comp_expand.c */
#undef _nc_tic_expand
@@ -3260,21 +4148,6 @@ char *_nc_tic_expand(
int numbers)
{ return(*(char **)0); }
-/* ./tinfo/comp_hash.c */
-
-#undef _nc_find_entry
-struct name_table_entry const *_nc_find_entry(
- const char *string,
- const short *hash_table)
- { return(*(struct name_table_entry const **)0); }
-
-#undef _nc_find_type_entry
-struct name_table_entry const *_nc_find_type_entry(
- const char *string,
- int type,
- const struct name_table_entry *table)
- { return(*(struct name_table_entry const **)0); }
-
/* ./tinfo/comp_parse.c */
#undef _nc_check_termtype2
@@ -3394,6 +4267,13 @@ int _nc_tic_written(void)
/* ./base/define_key.c */
+#undef define_key_sp
+int define_key_sp(
+ SCREEN *sp,
+ const char *str,
+ int keycode)
+ { return(*(int *)0); }
+
#undef define_key
int define_key(
const char *str,
@@ -3408,6 +4288,12 @@ void _nc_hashed_db(void)
/* ./base/key_defined.c */
+#undef key_defined_sp
+int key_defined_sp(
+ SCREEN *sp,
+ const char *str)
+ { return(*(int *)0); }
+
#undef key_defined
int key_defined(
const char *str)
@@ -3415,6 +4301,13 @@ int key_defined(
/* ./base/keybound.c */
+#undef keybound_sp
+char *keybound_sp(
+ SCREEN *sp,
+ int code,
+ int count)
+ { return(*(char **)0); }
+
#undef keybound
char *keybound(
int code,
@@ -3423,6 +4316,13 @@ char *keybound(
/* ./base/keyok.c */
+#undef keyok_sp
+int keyok_sp(
+ SCREEN *sp,
+ int c,
+ NCURSES_BOOL flag)
+ { return(*(int *)0); }
+
#undef keyok
int keyok(
int c,
diff --git a/ncurses/llib-lncursest b/ncurses/llib-lncursest
index d29ef60d561b..f5739cb1e79d 100644
--- a/ncurses/llib-lncursest
+++ b/ncurses/llib-lncursest
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2008 Free Software Foundation, Inc. *
+ * Copyright (c) 2008-2010,2011 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,7 +27,7 @@
****************************************************************************/
/****************************************************************************
- * Author: Thomas E. Dickey 2008 *
+ * Author: Thomas E. Dickey 2008-on *
****************************************************************************/
/* LINTLIBRARY */
@@ -38,27 +38,54 @@
#undef _nc_oldnums
int *_nc_oldnums;
+#undef _nc_scroll_optimize_sp
+void _nc_scroll_optimize_sp(
+ SCREEN *sp)
+ { /* void */ }
+
#undef _nc_scroll_optimize
void _nc_scroll_optimize(void)
{ /* void */ }
+#undef _nc_linedump_sp
+void _nc_linedump_sp(
+ SCREEN *sp)
+ { /* void */ }
+
#undef _nc_linedump
void _nc_linedump(void)
{ /* void */ }
/* ./tty/hashmap.c */
-#include <term.h>
+#undef _nc_hash_map_sp
+void _nc_hash_map_sp(
+ SCREEN *sp)
+ { /* void */ }
#undef _nc_hash_map
void _nc_hash_map(void)
{ /* void */ }
+#undef _nc_make_oldhash_sp
+void _nc_make_oldhash_sp(
+ SCREEN *sp,
+ int i)
+ { /* void */ }
+
#undef _nc_make_oldhash
void _nc_make_oldhash(
int i)
{ /* void */ }
+#undef _nc_scroll_oldhash_sp
+void _nc_scroll_oldhash_sp(
+ SCREEN *sp,
+ int n,
+ int top,
+ int bot)
+ { /* void */ }
+
#undef _nc_scroll_oldhash
void _nc_scroll_oldhash(
int n,
@@ -112,6 +139,11 @@ int waddchnstr(
/* ./base/lib_beep.c */
+#undef beep_sp
+int beep_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef beep
int beep(void)
{ return(*(int *)0); }
@@ -197,14 +229,32 @@ int _nc_COLOR_PAIRS(void)
int _nc_COLORS(void)
{ return(*(int *)0); }
+#undef _nc_reset_colors_sp
+NCURSES_BOOL _nc_reset_colors_sp(
+ SCREEN *sp)
+ { return(*(NCURSES_BOOL *)0); }
+
#undef _nc_reset_colors
NCURSES_BOOL _nc_reset_colors(void)
{ return(*(NCURSES_BOOL *)0); }
+#undef start_color_sp
+int start_color_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef start_color
int start_color(void)
{ return(*(int *)0); }
+#undef init_pair_sp
+int init_pair_sp(
+ SCREEN *sp,
+ short pair,
+ short f,
+ short b)
+ { return(*(int *)0); }
+
#undef init_pair
int init_pair(
short pair,
@@ -212,6 +262,15 @@ int init_pair(
short b)
{ return(*(int *)0); }
+#undef init_color_sp
+int init_color_sp(
+ SCREEN *sp,
+ short color,
+ short r,
+ short g,
+ short b)
+ { return(*(int *)0); }
+
#undef init_color
int init_color(
short color,
@@ -220,14 +279,33 @@ int init_color(
short b)
{ return(*(int *)0); }
+#undef can_change_color_sp
+NCURSES_BOOL can_change_color_sp(
+ SCREEN *sp)
+ { return(*(NCURSES_BOOL *)0); }
+
#undef can_change_color
NCURSES_BOOL can_change_color(void)
{ return(*(NCURSES_BOOL *)0); }
+#undef has_colors_sp
+NCURSES_BOOL has_colors_sp(
+ SCREEN *sp)
+ { return(*(NCURSES_BOOL *)0); }
+
#undef has_colors
NCURSES_BOOL has_colors(void)
{ return(*(NCURSES_BOOL *)0); }
+#undef color_content_sp
+int color_content_sp(
+ SCREEN *sp,
+ short color,
+ short *r,
+ short *g,
+ short *b)
+ { return(*(int *)0); }
+
#undef color_content
int color_content(
short color,
@@ -236,6 +314,14 @@ int color_content(
short *b)
{ return(*(int *)0); }
+#undef pair_content_sp
+int pair_content_sp(
+ SCREEN *sp,
+ short pair,
+ short *f,
+ short *b)
+ { return(*(int *)0); }
+
#undef pair_content
int pair_content(
short pair,
@@ -243,13 +329,21 @@ int pair_content(
short *b)
{ return(*(int *)0); }
+#undef _nc_do_color_sp
+void _nc_do_color_sp(
+ SCREEN *sp,
+ short old_pair,
+ short pair,
+ NCURSES_BOOL reverse,
+ NCURSES_OUTC_sp outc)
+ { /* void */ }
+
#undef _nc_do_color
void _nc_do_color(
short old_pair,
short pair,
NCURSES_BOOL reverse,
- int (*outc)(
- int p1))
+ NCURSES_OUTC outc)
{ /* void */ }
/* ./base/lib_colorset.c */
@@ -277,16 +371,31 @@ int delwin(
/* ./base/lib_echo.c */
+#undef echo_sp
+int echo_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef echo
int echo(void)
{ return(*(int *)0); }
+#undef noecho_sp
+int noecho_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef noecho
int noecho(void)
{ return(*(int *)0); }
/* ./base/lib_endwin.c */
+#undef endwin_sp
+int endwin_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef endwin
int endwin(void)
{ return(*(int *)0); }
@@ -300,6 +409,11 @@ int werase(
/* ./base/lib_flash.c */
+#undef flash_sp
+int flash_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef flash
int flash(void)
{ return(*(int *)0); }
@@ -1110,11 +1224,21 @@ NCURSES_BOOL is_notimeout(
const WINDOW *z)
{ return(*(NCURSES_BOOL *)0); }
+#undef is_pad
+NCURSES_BOOL is_pad(
+ const WINDOW *z)
+ { return(*(NCURSES_BOOL *)0); }
+
#undef is_scrollok
NCURSES_BOOL is_scrollok(
const WINDOW *z)
{ return(*(NCURSES_BOOL *)0); }
+#undef is_subwin
+NCURSES_BOOL is_subwin(
+ const WINDOW *z)
+ { return(*(NCURSES_BOOL *)0); }
+
#undef is_syncok
NCURSES_BOOL is_syncok(
const WINDOW *z)
@@ -1142,15 +1266,35 @@ NCURSES_BOOL mouse_trafo(
int _nc_ESCDELAY(void)
{ return(*(int *)0); }
+#undef _nc_ptr_Escdelay
+int *_nc_ptr_Escdelay(
+ SCREEN *sp)
+ { return(*(int **)0); }
+
+#undef set_escdelay_sp
+int set_escdelay_sp(
+ SCREEN *sp,
+ int value)
+ { return(*(int *)0); }
+
#undef set_escdelay
int set_escdelay(
int value)
{ return(*(int *)0); }
+#undef get_escdelay_sp
+int get_escdelay_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef get_escdelay
+int get_escdelay(void)
+ { return(*(int *)0); }
+
#undef _nc_wgetch
int _nc_wgetch(
WINDOW *win,
- unsigned long *result,
+ int *result,
int use_meta)
{ return(*(int *)0); }
@@ -1204,6 +1348,7 @@ WINDOW *initscr(void)
#undef _nc_insert_ch
int _nc_insert_ch(
+ SCREEN *sp,
WINDOW *win,
chtype ch)
{ return(*(int *)0); }
@@ -1242,6 +1387,11 @@ int winnstr(
/* ./base/lib_isendwin.c */
+#undef isendwin_sp
+NCURSES_BOOL isendwin_sp(
+ SCREEN *sp)
+ { return(*(NCURSES_BOOL *)0); }
+
#undef isendwin
NCURSES_BOOL isendwin(void)
{ return(*(NCURSES_BOOL *)0); }
@@ -1256,16 +1406,35 @@ int leaveok(
/* ./base/lib_mouse.c */
+#undef getmouse_sp
+int getmouse_sp(
+ SCREEN *sp,
+ MEVENT *aevent)
+ { return(*(int *)0); }
+
#undef getmouse
int getmouse(
MEVENT *aevent)
{ return(*(int *)0); }
+#undef ungetmouse_sp
+int ungetmouse_sp(
+ SCREEN *sp,
+ MEVENT *aevent)
+ { return(*(int *)0); }
+
#undef ungetmouse
int ungetmouse(
MEVENT *aevent)
{ return(*(int *)0); }
+#undef mousemask_sp
+mmask_t mousemask_sp(
+ SCREEN *sp,
+ mmask_t newmask,
+ mmask_t *oldmask)
+ { return(*(mmask_t *)0); }
+
#undef mousemask
mmask_t mousemask(
mmask_t newmask,
@@ -1279,14 +1448,30 @@ NCURSES_BOOL wenclose(
int x)
{ return(*(NCURSES_BOOL *)0); }
+#undef mouseinterval_sp
+int mouseinterval_sp(
+ SCREEN *sp,
+ int maxclick)
+ { return(*(int *)0); }
+
#undef mouseinterval
int mouseinterval(
int maxclick)
{ return(*(int *)0); }
#undef _nc_has_mouse
-int _nc_has_mouse(void)
- { return(*(int *)0); }
+NCURSES_BOOL _nc_has_mouse(
+ SCREEN *sp)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef has_mouse_sp
+NCURSES_BOOL has_mouse_sp(
+ SCREEN *sp)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef has_mouse
+NCURSES_BOOL has_mouse(void)
+ { return(*(NCURSES_BOOL *)0); }
#undef wmouse_trafo
NCURSES_BOOL wmouse_trafo(
@@ -1307,24 +1492,55 @@ int wmove(
/* ./tty/lib_mvcur.c */
+#undef _nc_msec_cost_sp
+int _nc_msec_cost_sp(
+ SCREEN *sp,
+ const char *const cap,
+ int affcnt)
+ { return(*(int *)0); }
+
#undef _nc_msec_cost
int _nc_msec_cost(
const char *const cap,
int affcnt)
{ return(*(int *)0); }
+#undef _nc_mvcur_resume_sp
+void _nc_mvcur_resume_sp(
+ SCREEN *sp)
+ { /* void */ }
+
#undef _nc_mvcur_resume
void _nc_mvcur_resume(void)
{ /* void */ }
+#undef _nc_mvcur_init_sp
+void _nc_mvcur_init_sp(
+ SCREEN *sp)
+ { /* void */ }
+
#undef _nc_mvcur_init
void _nc_mvcur_init(void)
{ /* void */ }
+#undef _nc_mvcur_wrap_sp
+void _nc_mvcur_wrap_sp(
+ SCREEN *sp)
+ { /* void */ }
+
#undef _nc_mvcur_wrap
void _nc_mvcur_wrap(void)
{ /* void */ }
+#undef mvcur_sp
+int mvcur_sp(
+ SCREEN *sp,
+ int yold,
+ int xold,
+ int ynew,
+ int xnew)
+ { return(*(int *)0); }
+
#undef mvcur
int mvcur(
int yold,
@@ -1347,14 +1563,32 @@ int mvwin(
/* ./base/lib_newterm.c */
+#undef filter_sp
+void filter_sp(
+ SCREEN *sp)
+ { /* void */ }
+
#undef filter
void filter(void)
{ /* void */ }
+#undef nofilter_sp
+void nofilter_sp(
+ SCREEN *sp)
+ { /* void */ }
+
#undef nofilter
void nofilter(void)
{ /* void */ }
+#undef newterm_sp
+SCREEN *newterm_sp(
+ SCREEN *sp,
+ char *name,
+ FILE *ofp,
+ FILE *ifp)
+ { return(*(SCREEN **)0); }
+
#undef newterm
SCREEN *newterm(
char *name,
@@ -1369,6 +1603,15 @@ int _nc_freewin(
WINDOW *win)
{ return(*(int *)0); }
+#undef newwin_sp
+WINDOW *newwin_sp(
+ SCREEN *sp,
+ int num_lines,
+ int num_columns,
+ int begy,
+ int begx)
+ { return(*(WINDOW **)0); }
+
#undef newwin
WINDOW *newwin(
int num_lines,
@@ -1395,8 +1638,9 @@ WINDOW *subwin(
int x)
{ return(*(WINDOW **)0); }
-#undef _nc_makenew
-WINDOW *_nc_makenew(
+#undef _nc_makenew_sp
+WINDOW *_nc_makenew_sp(
+ SCREEN *sp,
int num_lines,
int num_columns,
int begy,
@@ -1404,17 +1648,37 @@ WINDOW *_nc_makenew(
int flags)
{ return(*(WINDOW **)0); }
-#undef _nc_screen_of
-SCREEN *_nc_screen_of(
- WINDOW *win)
- { return(*(SCREEN **)0); }
+#undef _nc_curscr_of
+WINDOW *_nc_curscr_of(
+ SCREEN *sp)
+ { return(*(WINDOW **)0); }
+
+#undef _nc_newscr_of
+WINDOW *_nc_newscr_of(
+ SCREEN *sp)
+ { return(*(WINDOW **)0); }
+
+#undef _nc_stdscr_of
+WINDOW *_nc_stdscr_of(
+ SCREEN *sp)
+ { return(*(WINDOW **)0); }
/* ./base/lib_nl.c */
+#undef nl_sp
+int nl_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef nl
int nl(void)
{ return(*(int *)0); }
+#undef nonl_sp
+int nonl_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef nonl
int nonl(void)
{ return(*(int *)0); }
@@ -1448,6 +1712,13 @@ int copywin(
/* ./base/lib_pad.c */
+#undef newpad_sp
+WINDOW *newpad_sp(
+ SCREEN *sp,
+ int l,
+ int c)
+ { return(*(WINDOW **)0); }
+
#undef newpad
WINDOW *newpad(
int l,
@@ -1553,6 +1824,14 @@ int wnoutrefresh(
/* ./base/lib_restart.c */
+#undef restartterm_sp
+int restartterm_sp(
+ SCREEN *sp,
+ char *termp,
+ int filenum,
+ int *errret)
+ { return(*(int *)0); }
+
#undef restartterm
int restartterm(
char *termp,
@@ -1601,6 +1880,12 @@ int mvwscanw(
/* ./base/lib_screen.c */
+#undef getwin_sp
+WINDOW *getwin_sp(
+ SCREEN *sp,
+ FILE *filep)
+ { return(*(WINDOW **)0); }
+
#undef getwin
WINDOW *getwin(
FILE *filep)
@@ -1612,6 +1897,12 @@ int putwin(
FILE *filep)
{ return(*(int *)0); }
+#undef scr_restore_sp
+int scr_restore_sp(
+ SCREEN *sp,
+ const char *file)
+ { return(*(int *)0); }
+
#undef scr_restore
int scr_restore(
const char *file)
@@ -1622,11 +1913,23 @@ int scr_dump(
const char *file)
{ return(*(int *)0); }
+#undef scr_init_sp
+int scr_init_sp(
+ SCREEN *sp,
+ const char *file)
+ { return(*(int *)0); }
+
#undef scr_init
int scr_init(
const char *file)
{ return(*(int *)0); }
+#undef scr_set_sp
+int scr_set_sp(
+ SCREEN *sp,
+ const char *file)
+ { return(*(int *)0); }
+
#undef scr_set
int scr_set(
const char *file)
@@ -1678,6 +1981,16 @@ void delscreen(
SCREEN *sp)
{ /* void */ }
+#undef _nc_setupscreen_sp
+int _nc_setupscreen_sp(
+ SCREEN **spp,
+ int slines,
+ int scolumns,
+ FILE *output,
+ NCURSES_BOOL filtered,
+ int slk_format)
+ { return(*(int *)0); }
+
#undef _nc_setupscreen
int _nc_setupscreen(
int slines,
@@ -1687,6 +2000,15 @@ int _nc_setupscreen(
int slk_format)
{ return(*(int *)0); }
+#undef _nc_ripoffline_sp
+int _nc_ripoffline_sp(
+ SCREEN *sp,
+ int line,
+ int (*init)(
+ WINDOW *p1,
+ int p2))
+ { return(*(int *)0); }
+
#undef _nc_ripoffline
int _nc_ripoffline(
int line,
@@ -1695,6 +2017,15 @@ int _nc_ripoffline(
int p2))
{ return(*(int *)0); }
+#undef ripoffline_sp
+int ripoffline_sp(
+ SCREEN *sp,
+ int line,
+ int (*init)(
+ WINDOW *p1,
+ int p2))
+ { return(*(int *)0); }
+
#undef ripoffline
int ripoffline(
int line,
@@ -1705,18 +2036,37 @@ int ripoffline(
/* ./base/lib_slk.c */
+#undef _nc_format_slks
+int _nc_format_slks(
+ SCREEN *sp,
+ int cols)
+ { return(*(int *)0); }
+
#undef _nc_slk_initialize
int _nc_slk_initialize(
WINDOW *stwin,
int cols)
{ return(*(int *)0); }
+#undef slk_restore_sp
+int slk_restore_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef slk_restore
int slk_restore(void)
{ return(*(int *)0); }
/* ./base/lib_slkatr_set.c */
+#undef slk_attr_set_sp
+int slk_attr_set_sp(
+ SCREEN *sp,
+ const attr_t attr,
+ short color_pair_number,
+ void *opts)
+ { return(*(int *)0); }
+
#undef slk_attr_set
int slk_attr_set(
const attr_t attr,
@@ -1726,6 +2076,12 @@ int slk_attr_set(
/* ./base/lib_slkatrof.c */
+#undef slk_attroff_sp
+int slk_attroff_sp(
+ SCREEN *sp,
+ const chtype attr)
+ { return(*(int *)0); }
+
#undef slk_attroff
int slk_attroff(
const chtype attr)
@@ -1733,6 +2089,12 @@ int slk_attroff(
/* ./base/lib_slkatron.c */
+#undef slk_attron_sp
+int slk_attron_sp(
+ SCREEN *sp,
+ const chtype attr)
+ { return(*(int *)0); }
+
#undef slk_attron
int slk_attron(
const chtype attr)
@@ -1740,6 +2102,12 @@ int slk_attron(
/* ./base/lib_slkatrset.c */
+#undef slk_attrset_sp
+int slk_attrset_sp(
+ SCREEN *sp,
+ const chtype attr)
+ { return(*(int *)0); }
+
#undef slk_attrset
int slk_attrset(
const chtype attr)
@@ -1747,18 +2115,34 @@ int slk_attrset(
/* ./base/lib_slkattr.c */
+#undef slk_attr_sp
+attr_t slk_attr_sp(
+ SCREEN *sp)
+ { return(*(attr_t *)0); }
+
#undef slk_attr
attr_t slk_attr(void)
{ return(*(attr_t *)0); }
/* ./base/lib_slkclear.c */
+#undef slk_clear_sp
+int slk_clear_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef slk_clear
int slk_clear(void)
{ return(*(int *)0); }
/* ./base/lib_slkcolor.c */
+#undef slk_color_sp
+int slk_color_sp(
+ SCREEN *sp,
+ short color_pair_number)
+ { return(*(int *)0); }
+
#undef slk_color
int slk_color(
short color_pair_number)
@@ -1766,6 +2150,12 @@ int slk_color(
/* ./base/lib_slkinit.c */
+#undef slk_init_sp
+int slk_init_sp(
+ SCREEN *sp,
+ int format)
+ { return(*(int *)0); }
+
#undef slk_init
int slk_init(
int format)
@@ -1773,6 +2163,12 @@ int slk_init(
/* ./base/lib_slklab.c */
+#undef slk_label_sp
+char *slk_label_sp(
+ SCREEN *sp,
+ int n)
+ { return(*(char **)0); }
+
#undef slk_label
char *slk_label(
int n)
@@ -1780,16 +2176,34 @@ char *slk_label(
/* ./base/lib_slkrefr.c */
+#undef slk_noutrefresh_sp
+int slk_noutrefresh_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef slk_noutrefresh
int slk_noutrefresh(void)
{ return(*(int *)0); }
+#undef slk_refresh_sp
+int slk_refresh_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef slk_refresh
int slk_refresh(void)
{ return(*(int *)0); }
/* ./base/lib_slkset.c */
+#undef slk_set_sp
+int slk_set_sp(
+ SCREEN *sp,
+ int i,
+ const char *astr,
+ int format)
+ { return(*(int *)0); }
+
#undef slk_set
int slk_set(
int i,
@@ -1799,6 +2213,11 @@ int slk_set(
/* ./base/lib_slktouch.c */
+#undef slk_touch_sp
+int slk_touch_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef slk_touch
int slk_touch(void)
{ return(*(int *)0); }
@@ -1840,6 +2259,12 @@ char *_nc_tracemouse(
MEVENT const *ep)
{ return(*(char **)0); }
+#undef _nc_retrace_mmask_t
+mmask_t _nc_retrace_mmask_t(
+ SCREEN *sp,
+ mmask_t code)
+ { return(*(mmask_t *)0); }
+
#undef _tracemouse
char *_tracemouse(
MEVENT const *ep)
@@ -1861,8 +2286,8 @@ void _nc_fifo_dump(
SCREEN *sp)
{ /* void */ }
-#undef _nc_ungetch
-int _nc_ungetch(
+#undef ungetch_sp
+int ungetch_sp(
SCREEN *sp,
int ch)
{ return(*(int *)0); }
@@ -1874,11 +2299,23 @@ int ungetch(
/* ./tty/lib_vidattr.c */
+#undef vidputs_sp
+int vidputs_sp(
+ SCREEN *sp,
+ chtype newmode,
+ NCURSES_OUTC_sp outc)
+ { return(*(int *)0); }
+
#undef vidputs
int vidputs(
chtype newmode,
- int (*outc)(
- int p1))
+ NCURSES_OUTC outc)
+ { return(*(int *)0); }
+
+#undef vidattr_sp
+int vidattr_sp(
+ SCREEN *sp,
+ chtype newmode)
{ return(*(int *)0); }
#undef vidattr
@@ -1886,6 +2323,11 @@ int vidattr(
chtype newmode)
{ return(*(int *)0); }
+#undef termattrs_sp
+chtype termattrs_sp(
+ SCREEN *sp)
+ { return(*(chtype *)0); }
+
#undef termattrs
chtype termattrs(void)
{ return(*(chtype *)0); }
@@ -1966,12 +2408,24 @@ WINDOW *dupwin(
/* ./base/nc_panel.c */
+#undef _nc_panelhook_sp
+struct panelhook *_nc_panelhook_sp(
+ SCREEN *sp)
+ { return(*(struct panelhook **)0); }
+
#undef _nc_panelhook
struct panelhook *_nc_panelhook(void)
{ return(*(struct panelhook **)0); }
/* ./base/safe_sprintf.c */
+#undef _nc_printf_string_sp
+char *_nc_printf_string_sp(
+ SCREEN *sp,
+ const char *fmt,
+ va_list ap)
+ { return(*(char **)0); }
+
#undef _nc_printf_string
char *_nc_printf_string(
const char *fmt,
@@ -1983,10 +2437,24 @@ char *_nc_printf_string(
#include <sys/time.h>
#include <sys/times.h>
+#undef doupdate_sp
+int doupdate_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef doupdate
int doupdate(void)
{ return(*(int *)0); }
+#undef _nc_scrolln_sp
+int _nc_scrolln_sp(
+ SCREEN *sp,
+ int n,
+ int top,
+ int bot,
+ int maxy)
+ { return(*(int *)0); }
+
#undef _nc_scrolln
int _nc_scrolln(
int n,
@@ -1995,18 +2463,39 @@ int _nc_scrolln(
int maxy)
{ return(*(int *)0); }
+#undef _nc_screen_resume_sp
+void _nc_screen_resume_sp(
+ SCREEN *sp)
+ { /* void */ }
+
#undef _nc_screen_resume
void _nc_screen_resume(void)
{ /* void */ }
+#undef _nc_screen_init_sp
+void _nc_screen_init_sp(
+ SCREEN *sp)
+ { /* void */ }
+
#undef _nc_screen_init
void _nc_screen_init(void)
{ /* void */ }
+#undef _nc_screen_wrap_sp
+void _nc_screen_wrap_sp(
+ SCREEN *sp)
+ { /* void */ }
+
#undef _nc_screen_wrap
void _nc_screen_wrap(void)
{ /* void */ }
+#undef _nc_do_xmc_glitch_sp
+void _nc_do_xmc_glitch_sp(
+ SCREEN *sp,
+ attr_t previous)
+ { /* void */ }
+
#undef _nc_do_xmc_glitch
void _nc_do_xmc_glitch(
attr_t previous)
@@ -2038,12 +2527,16 @@ void _nc_vsscanf(void)
/* ./base/lib_freeall.c */
-#include <term_entry.h>
-
#undef _nc_freeall
void _nc_freeall(void)
{ /* void */ }
+#undef _nc_free_and_exit_sp
+void _nc_free_and_exit_sp(
+ SCREEN *sp,
+ int code)
+ { /* void */ }
+
#undef _nc_free_and_exit
void _nc_free_and_exit(
int code)
@@ -2063,6 +2556,24 @@ void _nc_toggle_attr_off(
attr_t at)
{ /* void */ }
+#undef _nc_DelCharCost_sp
+int _nc_DelCharCost_sp(
+ SCREEN *sp,
+ int count)
+ { return(*(int *)0); }
+
+#undef _nc_InsCharCost_sp
+int _nc_InsCharCost_sp(
+ SCREEN *sp,
+ int count)
+ { return(*(int *)0); }
+
+#undef _nc_UpdateAttrs_sp
+void _nc_UpdateAttrs_sp(
+ SCREEN *sp,
+ chtype c)
+ { /* void */ }
+
#undef _nc_DelCharCost
int _nc_DelCharCost(
int count)
@@ -2080,6 +2591,12 @@ void _nc_UpdateAttrs(
/* ./base/legacy_coding.c */
+#undef use_legacy_coding_sp
+int use_legacy_coding_sp(
+ SCREEN *sp,
+ int level)
+ { return(*(int *)0); }
+
#undef use_legacy_coding
int use_legacy_coding(
int level)
@@ -2087,10 +2604,22 @@ int use_legacy_coding(
/* ./base/lib_dft_fgbg.c */
+#undef use_default_colors_sp
+int use_default_colors_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef use_default_colors
int use_default_colors(void)
{ return(*(int *)0); }
+#undef assume_default_colors_sp
+int assume_default_colors_sp(
+ SCREEN *sp,
+ int fg,
+ int bg)
+ { return(*(int *)0); }
+
#undef assume_default_colors
int assume_default_colors(
int fg,
@@ -2099,6 +2628,13 @@ int assume_default_colors(
/* ./tinfo/lib_print.c */
+#undef mcprint_sp
+int mcprint_sp(
+ SCREEN *sp,
+ char *data,
+ int len)
+ { return(*(int *)0); }
+
#undef mcprint
int mcprint(
char *data,
@@ -2107,18 +2643,39 @@ int mcprint(
/* ./base/resizeterm.c */
+#undef is_term_resized_sp
+NCURSES_BOOL is_term_resized_sp(
+ SCREEN *sp,
+ int ToLines,
+ int ToCols)
+ { return(*(NCURSES_BOOL *)0); }
+
#undef is_term_resized
NCURSES_BOOL is_term_resized(
int ToLines,
int ToCols)
{ return(*(NCURSES_BOOL *)0); }
+#undef resize_term_sp
+int resize_term_sp(
+ SCREEN *sp,
+ int ToLines,
+ int ToCols)
+ { return(*(int *)0); }
+
#undef resize_term
int resize_term(
int ToLines,
int ToCols)
{ return(*(int *)0); }
+#undef resizeterm_sp
+int resizeterm_sp(
+ SCREEN *sp,
+ int ToLines,
+ int ToCols)
+ { return(*(int *)0); }
+
#undef resizeterm
int resizeterm(
int ToLines,
@@ -2161,9 +2718,6 @@ int wresize(
/* ./tinfo/access.c */
-#include <sys/stat.h>
-#include <nc_alloc.h>
-
#undef _nc_rootname
char *_nc_rootname(
char *path)
@@ -2241,6 +2795,30 @@ char *const *_nc_numcodes(void)
char *const *_nc_strcodes(void)
{ return(*(char **)0); }
+/* ./comp_captab.c */
+
+#include <hashsize.h>
+
+#undef _nc_get_table
+const struct name_table_entry *_nc_get_table(
+ NCURSES_BOOL termcap)
+ { return(*(const struct name_table_entry **)0); }
+
+#undef _nc_get_hash_table
+const HashValue *_nc_get_hash_table(
+ NCURSES_BOOL termcap)
+ { return(*(const HashValue **)0); }
+
+#undef _nc_get_alias_table
+const struct alias *_nc_get_alias_table(
+ NCURSES_BOOL termcap)
+ { return(*(const struct alias **)0); }
+
+#undef _nc_get_hash_info
+const HashData *_nc_get_hash_info(
+ NCURSES_BOOL termcap)
+ { return(*(const HashData **)0); }
+
/* ./tinfo/comp_error.c */
#undef _nc_suppress_warnings
@@ -2287,6 +2865,21 @@ void _nc_syserr_abort(
...)
{ /* void */ }
+/* ./tinfo/comp_hash.c */
+
+#undef _nc_find_entry
+struct name_table_entry const *_nc_find_entry(
+ const char *string,
+ const HashValue *hash_table)
+ { return(*(struct name_table_entry const **)0); }
+
+#undef _nc_find_type_entry
+struct name_table_entry const *_nc_find_type_entry(
+ const char *string,
+ int type,
+ NCURSES_BOOL termcap)
+ { return(*(struct name_table_entry const **)0); }
+
/* ./tinfo/db_iterator.c */
#undef _nc_tic_dir
@@ -2408,6 +3001,11 @@ void _nc_init_keytry(
chtype *_nc_acs_map(void)
{ return(*(chtype **)0); }
+#undef _nc_init_acs_sp
+void _nc_init_acs_sp(
+ SCREEN *sp)
+ { /* void */ }
+
#undef _nc_init_acs
void _nc_init_acs(void)
{ /* void */ }
@@ -2431,21 +3029,47 @@ int _nc_ospeed(
int BaudRate)
{ return(*(int *)0); }
+#undef baudrate_sp
+int baudrate_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef baudrate
int baudrate(void)
{ return(*(int *)0); }
/* ./tinfo/lib_cur_term.c */
+#undef _nc_get_cur_term_sp
+TERMINAL *_nc_get_cur_term_sp(
+ SCREEN *sp)
+ { return(*(TERMINAL **)0); }
+
+#undef _nc_get_cur_term
+TERMINAL *_nc_get_cur_term(void)
+ { return(*(TERMINAL **)0); }
+
#undef _nc_cur_term
TERMINAL *_nc_cur_term(void)
{ return(*(TERMINAL **)0); }
+#undef set_curterm_sp
+TERMINAL *set_curterm_sp(
+ SCREEN *sp,
+ TERMINAL *termp)
+ { return(*(TERMINAL **)0); }
+
#undef set_curterm
TERMINAL *set_curterm(
TERMINAL *termp)
{ return(*(TERMINAL **)0); }
+#undef del_curterm_sp
+int del_curterm_sp(
+ SCREEN *sp,
+ TERMINAL *termp)
+ { return(*(int *)0); }
+
#undef del_curterm
int del_curterm(
TERMINAL *termp)
@@ -2474,6 +3098,11 @@ NCURSES_GLOBALS _nc_globals;
#undef _nc_prescreen
NCURSES_PRESCREEN _nc_prescreen;
+#undef _nc_screen_of
+SCREEN *_nc_screen_of(
+ WINDOW *win)
+ { return(*(SCREEN **)0); }
+
#undef _nc_init_pthreads
void _nc_init_pthreads(void)
{ /* void */ }
@@ -2500,24 +3129,49 @@ int _nc_mutex_unlock(
/* ./tinfo/lib_has_cap.c */
+#undef has_ic_sp
+NCURSES_BOOL has_ic_sp(
+ SCREEN *sp)
+ { return(*(NCURSES_BOOL *)0); }
+
#undef has_ic
NCURSES_BOOL has_ic(void)
{ return(*(NCURSES_BOOL *)0); }
+#undef has_il_sp
+NCURSES_BOOL has_il_sp(
+ SCREEN *sp)
+ { return(*(NCURSES_BOOL *)0); }
+
#undef has_il
NCURSES_BOOL has_il(void)
{ return(*(NCURSES_BOOL *)0); }
/* ./tinfo/lib_kernel.c */
+#undef erasechar_sp
+char erasechar_sp(
+ SCREEN *sp)
+ { return(*(char *)0); }
+
#undef erasechar
char erasechar(void)
{ return(*(char *)0); }
+#undef killchar_sp
+char killchar_sp(
+ SCREEN *sp)
+ { return(*(char *)0); }
+
#undef killchar
char killchar(void)
{ return(*(char *)0); }
+#undef flushinp_sp
+int flushinp_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef flushinp
int flushinp(void)
{ return(*(int *)0); }
@@ -2526,8 +3180,8 @@ int flushinp(void)
struct kn { short offset; int code; };
-#undef _nc_keyname
-char *_nc_keyname(
+#undef keyname_sp
+char *keyname_sp(
SCREEN *sp,
int c)
{ return(*(char **)0); }
@@ -2539,12 +3193,23 @@ char *keyname(
/* ./tinfo/lib_longname.c */
+#undef longname_sp
+char *longname_sp(
+ SCREEN *sp)
+ { return(*(char **)0); }
+
#undef longname
char *longname(void)
{ return(*(char **)0); }
/* ./tinfo/lib_napms.c */
+#undef napms_sp
+int napms_sp(
+ SCREEN *sp,
+ int ms)
+ { return(*(int *)0); }
+
#undef napms
int napms(
int ms)
@@ -2564,6 +3229,12 @@ void idcok(
NCURSES_BOOL flag)
{ /* void */ }
+#undef halfdelay_sp
+int halfdelay_sp(
+ SCREEN *sp,
+ int t)
+ { return(*(int *)0); }
+
#undef halfdelay
int halfdelay(
int t)
@@ -2599,21 +3270,46 @@ int meta(
NCURSES_BOOL flag)
{ return(*(int *)0); }
+#undef curs_set_sp
+int curs_set_sp(
+ SCREEN *sp,
+ int vis)
+ { return(*(int *)0); }
+
#undef curs_set
int curs_set(
int vis)
{ return(*(int *)0); }
+#undef typeahead_sp
+int typeahead_sp(
+ SCREEN *sp,
+ int fd)
+ { return(*(int *)0); }
+
#undef typeahead
int typeahead(
int fd)
{ return(*(int *)0); }
+#undef has_key_sp
+int has_key_sp(
+ SCREEN *sp,
+ int keycode)
+ { return(*(int *)0); }
+
#undef has_key
int has_key(
int keycode)
{ return(*(int *)0); }
+#undef _nc_putp_flush_sp
+int _nc_putp_flush_sp(
+ SCREEN *sp,
+ const char *name,
+ const char *value)
+ { return(*(int *)0); }
+
#undef _nc_keypad
int _nc_keypad(
SCREEN *sp,
@@ -2622,30 +3318,67 @@ int _nc_keypad(
/* ./tinfo/lib_raw.c */
+#undef raw_sp
+int raw_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef raw
int raw(void)
{ return(*(int *)0); }
+#undef cbreak_sp
+int cbreak_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef cbreak
int cbreak(void)
{ return(*(int *)0); }
+#undef qiflush_sp
+void qiflush_sp(
+ SCREEN *sp)
+ { /* void */ }
+
#undef qiflush
void qiflush(void)
{ /* void */ }
+#undef noraw_sp
+int noraw_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef noraw
int noraw(void)
{ return(*(int *)0); }
+#undef nocbreak_sp
+int nocbreak_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef nocbreak
int nocbreak(void)
{ return(*(int *)0); }
+#undef noqiflush_sp
+void noqiflush_sp(
+ SCREEN *sp)
+ { /* void */ }
+
#undef noqiflush
void noqiflush(void)
{ /* void */ }
+#undef intrflush_sp
+int intrflush_sp(
+ SCREEN *sp,
+ WINDOW *win,
+ NCURSES_BOOL flag)
+ { return(*(int *)0); }
+
#undef intrflush
int intrflush(
WINDOW *win,
@@ -2663,7 +3396,8 @@ char *_nc_ttytype(void)
{ return(*(char **)0); }
#undef _nc_ptr_Lines
-int *_nc_ptr_Lines(void)
+int *_nc_ptr_Lines(
+ SCREEN *sp)
{ return(*(int **)0); }
#undef _nc_LINES
@@ -2671,17 +3405,29 @@ int _nc_LINES(void)
{ return(*(int *)0); }
#undef _nc_ptr_Cols
-int *_nc_ptr_Cols(void)
+int *_nc_ptr_Cols(
+ SCREEN *sp)
{ return(*(int **)0); }
#undef _nc_COLS
int _nc_COLS(void)
{ return(*(int *)0); }
+#undef _nc_ptr_Tabsize
+int *_nc_ptr_Tabsize(
+ SCREEN *sp)
+ { return(*(int **)0); }
+
#undef _nc_TABSIZE
int _nc_TABSIZE(void)
{ return(*(int *)0); }
+#undef set_tabsize_sp
+int set_tabsize_sp(
+ SCREEN *sp,
+ int value)
+ { return(*(int *)0); }
+
#undef set_tabsize
int set_tabsize(
int value)
@@ -2692,6 +3438,12 @@ int _nc_handle_sigwinch(
SCREEN *sp)
{ return(*(int *)0); }
+#undef use_env_sp
+void use_env_sp(
+ SCREEN *sp,
+ NCURSES_BOOL f)
+ { /* void */ }
+
#undef use_env
void use_env(
NCURSES_BOOL f)
@@ -2709,6 +3461,18 @@ void _nc_update_screensize(
SCREEN *sp)
{ /* void */ }
+#undef _nc_setup_tinfo
+int _nc_setup_tinfo(
+ const char *const tn,
+ TERMTYPE *const tp)
+ { return(*(int *)0); }
+
+#undef _nc_tinfo_cmdch
+void _nc_tinfo_cmdch(
+ TERMINAL *termp,
+ char proto)
+ { /* void */ }
+
#undef _nc_get_locale
char *_nc_get_locale(void)
{ return(*(char **)0); }
@@ -2730,6 +3494,10 @@ int _nc_setupterm(
NCURSES_BOOL reuse)
{ return(*(int *)0); }
+#undef new_prescr
+SCREEN *new_prescr(void)
+ { return(*(SCREEN **)0); }
+
#undef setupterm
int setupterm(
char *tname,
@@ -2744,8 +3512,9 @@ char *UP;
#undef BC
char *BC;
-#undef tgetent
-int tgetent(
+#undef tgetent_sp
+int tgetent_sp(
+ SCREEN *sp,
char *bufp,
const char *name)
{ return(*(int *)0); }
@@ -2756,16 +3525,41 @@ int tgetent(
#endif
+#undef tgetent
+int tgetent(
+ char *bufp,
+ const char *name)
+ { return(*(int *)0); }
+
+#undef tgetflag_sp
+int tgetflag_sp(
+ SCREEN *sp,
+ char *id)
+ { return(*(int *)0); }
+
#undef tgetflag
int tgetflag(
char *id)
{ return(*(int *)0); }
+#undef tgetnum_sp
+int tgetnum_sp(
+ SCREEN *sp,
+ char *id)
+ { return(*(int *)0); }
+
#undef tgetnum
int tgetnum(
char *id)
{ return(*(int *)0); }
+#undef tgetstr_sp
+char *tgetstr_sp(
+ SCREEN *sp,
+ char *id,
+ char **area)
+ { return(*(char **)0); }
+
#undef tgetstr
char *tgetstr(
char *id,
@@ -2774,6 +3568,11 @@ char *tgetstr(
/* ./tinfo/lib_termname.c */
+#undef termname_sp
+char *termname_sp(
+ SCREEN *sp)
+ { return(*(char **)0); }
+
#undef termname
char *termname(void)
{ return(*(char **)0); }
@@ -2789,16 +3588,34 @@ char *tgoto(
/* ./tinfo/lib_ti.c */
+#undef tigetflag_sp
+int tigetflag_sp(
+ SCREEN *sp,
+ char *str)
+ { return(*(int *)0); }
+
#undef tigetflag
int tigetflag(
char *str)
{ return(*(int *)0); }
+#undef tigetnum_sp
+int tigetnum_sp(
+ SCREEN *sp,
+ char *str)
+ { return(*(int *)0); }
+
#undef tigetnum
int tigetnum(
char *str)
{ return(*(int *)0); }
+#undef tigetstr_sp
+char *tigetstr_sp(
+ SCREEN *sp,
+ char *str)
+ { return(*(char **)0); }
+
#undef tigetstr
char *tigetstr(
char *str)
@@ -2822,6 +3639,12 @@ char *tparm(
...)
{ return(*(char **)0); }
+#undef tiparm
+char *tiparm(
+ const char *string,
+ ...)
+ { return(*(char **)0); }
+
/* ./tinfo/lib_tputs.c */
#undef PC
@@ -2836,25 +3659,75 @@ void _nc_set_no_padding(
SCREEN *sp)
{ /* void */ }
+#undef delay_output_sp
+int delay_output_sp(
+ SCREEN *sp,
+ int ms)
+ { return(*(int *)0); }
+
#undef delay_output
int delay_output(
int ms)
{ return(*(int *)0); }
+#undef _nc_flush_sp
+void _nc_flush_sp(
+ SCREEN *sp)
+ { /* void */ }
+
#undef _nc_flush
void _nc_flush(void)
{ /* void */ }
+#undef _nc_outch_sp
+int _nc_outch_sp(
+ SCREEN *sp,
+ int ch)
+ { return(*(int *)0); }
+
#undef _nc_outch
int _nc_outch(
int ch)
{ return(*(int *)0); }
+#undef putp_sp
+int putp_sp(
+ SCREEN *sp,
+ const char *string)
+ { return(*(int *)0); }
+
+#undef _nc_putp_sp
+int _nc_putp_sp(
+ SCREEN *sp,
+ const char *name,
+ const char *string)
+ { return(*(int *)0); }
+
#undef putp
int putp(
const char *string)
{ return(*(int *)0); }
+#undef _nc_putp
+int _nc_putp(
+ const char *name,
+ const char *string)
+ { return(*(int *)0); }
+
+#undef tputs_sp
+int tputs_sp(
+ SCREEN *sp,
+ const char *string,
+ int affcnt,
+ NCURSES_OUTC_sp outc)
+ { return(*(int *)0); }
+
+#undef _nc_outc_wrapper
+int _nc_outc_wrapper(
+ SCREEN *sp,
+ int c)
+ { return(*(int *)0); }
+
#undef tputs
int tputs(
const char *string,
@@ -2902,6 +3775,11 @@ NCURSES_BOOL _nc_retrace_bool(
NCURSES_BOOL code)
{ return(*(NCURSES_BOOL *)0); }
+#undef _nc_retrace_char
+char _nc_retrace_char(
+ char code)
+ { return(*(char *)0); }
+
#undef _nc_retrace_int
int _nc_retrace_int(
int code)
@@ -2966,6 +3844,11 @@ char *_traceattr(
attr_t newmode)
{ return(*(char **)0); }
+#undef _nc_retrace_int_attr_t
+int _nc_retrace_int_attr_t(
+ attr_t code)
+ { return(*(int *)0); }
+
#undef _nc_retrace_attr_t
attr_t _nc_retrace_attr_t(
attr_t code)
@@ -3024,36 +3907,78 @@ char *_tracechar(
/* ./tinfo/lib_ttyflags.c */
+#undef _nc_get_tty_mode_sp
+int _nc_get_tty_mode_sp(
+ SCREEN *sp,
+ struct termios *buf)
+ { return(*(int *)0); }
+
#undef _nc_get_tty_mode
int _nc_get_tty_mode(
struct termios *buf)
{ return(*(int *)0); }
+#undef _nc_set_tty_mode_sp
+int _nc_set_tty_mode_sp(
+ SCREEN *sp,
+ struct termios *buf)
+ { return(*(int *)0); }
+
#undef _nc_set_tty_mode
int _nc_set_tty_mode(
struct termios *buf)
{ return(*(int *)0); }
+#undef def_shell_mode_sp
+int def_shell_mode_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef def_shell_mode
int def_shell_mode(void)
{ return(*(int *)0); }
+#undef def_prog_mode_sp
+int def_prog_mode_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef def_prog_mode
int def_prog_mode(void)
{ return(*(int *)0); }
+#undef reset_prog_mode_sp
+int reset_prog_mode_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef reset_prog_mode
int reset_prog_mode(void)
{ return(*(int *)0); }
+#undef reset_shell_mode_sp
+int reset_shell_mode_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef reset_shell_mode
int reset_shell_mode(void)
{ return(*(int *)0); }
+#undef savetty_sp
+int savetty_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef savetty
int savetty(void)
{ return(*(int *)0); }
+#undef resetty_sp
+int resetty_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
#undef resetty
int resetty(void)
{ return(*(int *)0); }
@@ -3144,6 +4069,13 @@ int _nc_read_termcap_entry(
/* ./tinfo/setbuf.c */
+#undef _nc_set_buffer_sp
+void _nc_set_buffer_sp(
+ SCREEN *sp,
+ FILE *ofp,
+ NCURSES_BOOL buffered)
+ { /* void */ }
+
#undef _nc_set_buffer
void _nc_set_buffer(
FILE *ofp,
@@ -3235,8 +4167,8 @@ char *_nc_trim_sgr0(
/* ./unctrl.c */
-#undef _nc_unctrl
-char *_nc_unctrl(
+#undef unctrl_sp
+char *unctrl_sp(
SCREEN *sp,
chtype ch)
{ return(*(char **)0); }
@@ -3323,25 +4255,6 @@ char *_nc_infotocap(
int const parameterized)
{ return(*(char **)0); }
-/* ./comp_captab.c */
-
-#include <hashsize.h>
-
-#undef _nc_get_table
-const struct name_table_entry *_nc_get_table(
- NCURSES_BOOL termcap)
- { return(*(const struct name_table_entry **)0); }
-
-#undef _nc_get_hash_table
-const short *_nc_get_hash_table(
- NCURSES_BOOL termcap)
- { return(*(const short **)0); }
-
-#undef _nc_get_alias_table
-const struct alias *_nc_get_alias_table(
- NCURSES_BOOL termcap)
- { return(*(const struct alias **)0); }
-
/* ./tinfo/comp_expand.c */
#undef _nc_tic_expand
@@ -3351,21 +4264,6 @@ char *_nc_tic_expand(
int numbers)
{ return(*(char **)0); }
-/* ./tinfo/comp_hash.c */
-
-#undef _nc_find_entry
-struct name_table_entry const *_nc_find_entry(
- const char *string,
- const short *hash_table)
- { return(*(struct name_table_entry const **)0); }
-
-#undef _nc_find_type_entry
-struct name_table_entry const *_nc_find_type_entry(
- const char *string,
- int type,
- const struct name_table_entry *table)
- { return(*(struct name_table_entry const **)0); }
-
/* ./tinfo/comp_parse.c */
#undef _nc_check_termtype2
@@ -3485,6 +4383,13 @@ int _nc_tic_written(void)
/* ./base/define_key.c */
+#undef define_key_sp
+int define_key_sp(
+ SCREEN *sp,
+ const char *str,
+ int keycode)
+ { return(*(int *)0); }
+
#undef define_key
int define_key(
const char *str,
@@ -3499,6 +4404,12 @@ void _nc_hashed_db(void)
/* ./base/key_defined.c */
+#undef key_defined_sp
+int key_defined_sp(
+ SCREEN *sp,
+ const char *str)
+ { return(*(int *)0); }
+
#undef key_defined
int key_defined(
const char *str)
@@ -3506,6 +4417,13 @@ int key_defined(
/* ./base/keybound.c */
+#undef keybound_sp
+char *keybound_sp(
+ SCREEN *sp,
+ int code,
+ int count)
+ { return(*(char **)0); }
+
#undef keybound
char *keybound(
int code,
@@ -3514,6 +4432,13 @@ char *keybound(
/* ./base/keyok.c */
+#undef keyok_sp
+int keyok_sp(
+ SCREEN *sp,
+ int c,
+ NCURSES_BOOL flag)
+ { return(*(int *)0); }
+
#undef keyok
int keyok(
int c,
diff --git a/ncurses/llib-lncursestw b/ncurses/llib-lncursestw
new file mode 100644
index 000000000000..5230bc758aff
--- /dev/null
+++ b/ncurses/llib-lncursestw
@@ -0,0 +1,5270 @@
+/****************************************************************************
+ * Copyright (c) 2009-2010,2011 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 *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Thomas E. Dickey 2009-2010,2011 *
+ ****************************************************************************/
+/* LINTLIBRARY */
+
+/* ./tty/hardscroll.c */
+
+#include <curses.priv.h>
+
+#undef _nc_oldnums
+int *_nc_oldnums;
+
+#undef _nc_scroll_optimize_sp
+void _nc_scroll_optimize_sp(
+ SCREEN *sp)
+ { /* void */ }
+
+#undef _nc_scroll_optimize
+void _nc_scroll_optimize(void)
+ { /* void */ }
+
+#undef _nc_linedump_sp
+void _nc_linedump_sp(
+ SCREEN *sp)
+ { /* void */ }
+
+#undef _nc_linedump
+void _nc_linedump(void)
+ { /* void */ }
+
+/* ./tty/hashmap.c */
+
+#undef _nc_hash_map_sp
+void _nc_hash_map_sp(
+ SCREEN *sp)
+ { /* void */ }
+
+#undef _nc_hash_map
+void _nc_hash_map(void)
+ { /* void */ }
+
+#undef _nc_make_oldhash_sp
+void _nc_make_oldhash_sp(
+ SCREEN *sp,
+ int i)
+ { /* void */ }
+
+#undef _nc_make_oldhash
+void _nc_make_oldhash(
+ int i)
+ { /* void */ }
+
+#undef _nc_scroll_oldhash_sp
+void _nc_scroll_oldhash_sp(
+ SCREEN *sp,
+ int n,
+ int top,
+ int bot)
+ { /* void */ }
+
+#undef _nc_scroll_oldhash
+void _nc_scroll_oldhash(
+ int n,
+ int top,
+ int bot)
+ { /* void */ }
+
+/* ./base/lib_addch.c */
+
+#include <ctype.h>
+
+#undef _nc_render
+cchar_t _nc_render(
+ WINDOW *win,
+ cchar_t ch)
+ { return(*(cchar_t *)0); }
+
+#undef _nc_build_wch
+int _nc_build_wch(
+ WINDOW *win,
+ cchar_t *ch)
+ { return(*(int *)0); }
+
+#undef _nc_waddch_nosync
+int _nc_waddch_nosync(
+ WINDOW *win,
+ const cchar_t c)
+ { return(*(int *)0); }
+
+#undef waddch
+int waddch(
+ WINDOW *win,
+ const chtype ch)
+ { return(*(int *)0); }
+
+#undef wechochar
+int wechochar(
+ WINDOW *win,
+ const chtype ch)
+ { return(*(int *)0); }
+
+/* ./base/lib_addstr.c */
+
+#undef waddnstr
+int waddnstr(
+ WINDOW *win,
+ const char *astr,
+ int n)
+ { return(*(int *)0); }
+
+#undef waddchnstr
+int waddchnstr(
+ WINDOW *win,
+ const chtype *astr,
+ int n)
+ { return(*(int *)0); }
+
+#undef _nc_wchstrlen
+int _nc_wchstrlen(
+ const cchar_t *s)
+ { return(*(int *)0); }
+
+#undef wadd_wchnstr
+int wadd_wchnstr(
+ WINDOW *win,
+ const cchar_t *astr,
+ int n)
+ { return(*(int *)0); }
+
+#undef waddnwstr
+int waddnwstr(
+ WINDOW *win,
+ const wchar_t *str,
+ int n)
+ { return(*(int *)0); }
+
+/* ./base/lib_beep.c */
+
+#undef beep_sp
+int beep_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef beep
+int beep(void)
+ { return(*(int *)0); }
+
+/* ./base/lib_bkgd.c */
+
+#undef wbkgrndset
+void wbkgrndset(
+ WINDOW *win,
+ const cchar_t *ch)
+ { /* void */ }
+
+#undef wbkgdset
+void wbkgdset(
+ WINDOW *win,
+ chtype ch)
+ { /* void */ }
+
+#undef wbkgrnd
+int wbkgrnd(
+ WINDOW *win,
+ const cchar_t *ch)
+ { return(*(int *)0); }
+
+#undef wbkgd
+int wbkgd(
+ WINDOW *win,
+ chtype ch)
+ { return(*(int *)0); }
+
+/* ./base/lib_box.c */
+
+#undef wborder
+int wborder(
+ WINDOW *win,
+ chtype ls,
+ chtype rs,
+ chtype ts,
+ chtype bs,
+ chtype tl,
+ chtype tr,
+ chtype bl,
+ chtype br)
+ { return(*(int *)0); }
+
+/* ./base/lib_chgat.c */
+
+#undef wchgat
+int wchgat(
+ WINDOW *win,
+ int n,
+ attr_t attr,
+ short color,
+ const void *opts)
+ { return(*(int *)0); }
+
+/* ./base/lib_clear.c */
+
+#undef wclear
+int wclear(
+ WINDOW *win)
+ { return(*(int *)0); }
+
+/* ./base/lib_clearok.c */
+
+#undef clearok
+int clearok(
+ WINDOW *win,
+ NCURSES_BOOL flag)
+ { return(*(int *)0); }
+
+/* ./base/lib_clrbot.c */
+
+#undef wclrtobot
+int wclrtobot(
+ WINDOW *win)
+ { return(*(int *)0); }
+
+/* ./base/lib_clreol.c */
+
+#undef wclrtoeol
+int wclrtoeol(
+ WINDOW *win)
+ { return(*(int *)0); }
+
+/* ./base/lib_color.c */
+
+#include <tic.h>
+
+#undef _nc_COLOR_PAIRS
+int _nc_COLOR_PAIRS(void)
+ { return(*(int *)0); }
+
+#undef _nc_COLORS
+int _nc_COLORS(void)
+ { return(*(int *)0); }
+
+#undef _nc_reset_colors_sp
+NCURSES_BOOL _nc_reset_colors_sp(
+ SCREEN *sp)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef _nc_reset_colors
+NCURSES_BOOL _nc_reset_colors(void)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef start_color_sp
+int start_color_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef start_color
+int start_color(void)
+ { return(*(int *)0); }
+
+#undef init_pair_sp
+int init_pair_sp(
+ SCREEN *sp,
+ short pair,
+ short f,
+ short b)
+ { return(*(int *)0); }
+
+#undef init_pair
+int init_pair(
+ short pair,
+ short f,
+ short b)
+ { return(*(int *)0); }
+
+#undef init_color_sp
+int init_color_sp(
+ SCREEN *sp,
+ short color,
+ short r,
+ short g,
+ short b)
+ { return(*(int *)0); }
+
+#undef init_color
+int init_color(
+ short color,
+ short r,
+ short g,
+ short b)
+ { return(*(int *)0); }
+
+#undef can_change_color_sp
+NCURSES_BOOL can_change_color_sp(
+ SCREEN *sp)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef can_change_color
+NCURSES_BOOL can_change_color(void)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef has_colors_sp
+NCURSES_BOOL has_colors_sp(
+ SCREEN *sp)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef has_colors
+NCURSES_BOOL has_colors(void)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef color_content_sp
+int color_content_sp(
+ SCREEN *sp,
+ short color,
+ short *r,
+ short *g,
+ short *b)
+ { return(*(int *)0); }
+
+#undef color_content
+int color_content(
+ short color,
+ short *r,
+ short *g,
+ short *b)
+ { return(*(int *)0); }
+
+#undef pair_content_sp
+int pair_content_sp(
+ SCREEN *sp,
+ short pair,
+ short *f,
+ short *b)
+ { return(*(int *)0); }
+
+#undef pair_content
+int pair_content(
+ short pair,
+ short *f,
+ short *b)
+ { return(*(int *)0); }
+
+#undef _nc_do_color_sp
+void _nc_do_color_sp(
+ SCREEN *sp,
+ short old_pair,
+ short pair,
+ NCURSES_BOOL reverse,
+ NCURSES_OUTC_sp outc)
+ { /* void */ }
+
+#undef _nc_do_color
+void _nc_do_color(
+ short old_pair,
+ short pair,
+ NCURSES_BOOL reverse,
+ NCURSES_OUTC outc)
+ { /* void */ }
+
+/* ./base/lib_colorset.c */
+
+#undef wcolor_set
+int wcolor_set(
+ WINDOW *win,
+ short color_pair_number,
+ void *opts)
+ { return(*(int *)0); }
+
+/* ./base/lib_delch.c */
+
+#undef wdelch
+int wdelch(
+ WINDOW *win)
+ { return(*(int *)0); }
+
+/* ./base/lib_delwin.c */
+
+#undef delwin
+int delwin(
+ WINDOW *win)
+ { return(*(int *)0); }
+
+/* ./base/lib_echo.c */
+
+#undef echo_sp
+int echo_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef echo
+int echo(void)
+ { return(*(int *)0); }
+
+#undef noecho_sp
+int noecho_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef noecho
+int noecho(void)
+ { return(*(int *)0); }
+
+/* ./base/lib_endwin.c */
+
+#undef endwin_sp
+int endwin_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef endwin
+int endwin(void)
+ { return(*(int *)0); }
+
+/* ./base/lib_erase.c */
+
+#undef werase
+int werase(
+ WINDOW *win)
+ { return(*(int *)0); }
+
+/* ./base/lib_flash.c */
+
+#undef flash_sp
+int flash_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef flash
+int flash(void)
+ { return(*(int *)0); }
+
+/* ./lib_gen.c */
+
+#undef addch
+int addch(
+ const chtype z)
+ { return(*(int *)0); }
+
+#undef addchnstr
+int addchnstr(
+ const chtype *a1,
+ int z)
+ { return(*(int *)0); }
+
+#undef addchstr
+int addchstr(
+ const chtype *z)
+ { return(*(int *)0); }
+
+#undef addnstr
+int addnstr(
+ const char *a1,
+ int z)
+ { return(*(int *)0); }
+
+#undef addstr
+int addstr(
+ const char *z)
+ { return(*(int *)0); }
+
+#undef attroff
+int attroff(
+ NCURSES_ATTR_T z)
+ { return(*(int *)0); }
+
+#undef attron
+int attron(
+ NCURSES_ATTR_T z)
+ { return(*(int *)0); }
+
+#undef attrset
+int attrset(
+ NCURSES_ATTR_T z)
+ { return(*(int *)0); }
+
+#undef attr_get
+int attr_get(
+ attr_t *a1,
+ short *a2,
+ void *z)
+ { return(*(int *)0); }
+
+#undef attr_off
+int attr_off(
+ attr_t a1,
+ void *z)
+ { return(*(int *)0); }
+
+#undef attr_on
+int attr_on(
+ attr_t a1,
+ void *z)
+ { return(*(int *)0); }
+
+#undef attr_set
+int attr_set(
+ attr_t a1,
+ short a2,
+ void *z)
+ { return(*(int *)0); }
+
+#undef bkgd
+int bkgd(
+ chtype z)
+ { return(*(int *)0); }
+
+#undef bkgdset
+void bkgdset(
+ chtype z)
+ { /* void */ }
+
+#undef border
+int border(
+ chtype a1,
+ chtype a2,
+ chtype a3,
+ chtype a4,
+ chtype a5,
+ chtype a6,
+ chtype a7,
+ chtype z)
+ { return(*(int *)0); }
+
+#undef box
+int box(
+ WINDOW *a1,
+ chtype a2,
+ chtype z)
+ { return(*(int *)0); }
+
+#undef chgat
+int chgat(
+ int a1,
+ attr_t a2,
+ short a3,
+ const void *z)
+ { return(*(int *)0); }
+
+#undef clear
+int clear(void)
+ { return(*(int *)0); }
+
+#undef clrtobot
+int clrtobot(void)
+ { return(*(int *)0); }
+
+#undef clrtoeol
+int clrtoeol(void)
+ { return(*(int *)0); }
+
+#undef color_set
+int color_set(
+ short a1,
+ void *z)
+ { return(*(int *)0); }
+
+#undef COLOR_PAIR
+int COLOR_PAIR(
+ int z)
+ { return(*(int *)0); }
+
+#undef delch
+int delch(void)
+ { return(*(int *)0); }
+
+#undef deleteln
+int deleteln(void)
+ { return(*(int *)0); }
+
+#undef echochar
+int echochar(
+ const chtype z)
+ { return(*(int *)0); }
+
+#undef erase
+int erase(void)
+ { return(*(int *)0); }
+
+#undef getbkgd
+chtype getbkgd(
+ WINDOW *z)
+ { return(*(chtype *)0); }
+
+#undef getch
+int getch(void)
+ { return(*(int *)0); }
+
+#undef getnstr
+int getnstr(
+ char *a1,
+ int z)
+ { return(*(int *)0); }
+
+#undef getstr
+int getstr(
+ char *z)
+ { return(*(int *)0); }
+
+#undef hline
+int hline(
+ chtype a1,
+ int z)
+ { return(*(int *)0); }
+
+#undef inch
+chtype inch(void)
+ { return(*(chtype *)0); }
+
+#undef inchnstr
+int inchnstr(
+ chtype *a1,
+ int z)
+ { return(*(int *)0); }
+
+#undef inchstr
+int inchstr(
+ chtype *z)
+ { return(*(int *)0); }
+
+#undef innstr
+int innstr(
+ char *a1,
+ int z)
+ { return(*(int *)0); }
+
+#undef insch
+int insch(
+ chtype z)
+ { return(*(int *)0); }
+
+#undef insdelln
+int insdelln(
+ int z)
+ { return(*(int *)0); }
+
+#undef insertln
+int insertln(void)
+ { return(*(int *)0); }
+
+#undef insnstr
+int insnstr(
+ const char *a1,
+ int z)
+ { return(*(int *)0); }
+
+#undef insstr
+int insstr(
+ const char *z)
+ { return(*(int *)0); }
+
+#undef instr
+int instr(
+ char *z)
+ { return(*(int *)0); }
+
+#undef move
+int move(
+ int a1,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvaddch
+int mvaddch(
+ int a1,
+ int a2,
+ const chtype z)
+ { return(*(int *)0); }
+
+#undef mvaddchnstr
+int mvaddchnstr(
+ int a1,
+ int a2,
+ const chtype *a3,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvaddchstr
+int mvaddchstr(
+ int a1,
+ int a2,
+ const chtype *z)
+ { return(*(int *)0); }
+
+#undef mvaddnstr
+int mvaddnstr(
+ int a1,
+ int a2,
+ const char *a3,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvaddstr
+int mvaddstr(
+ int a1,
+ int a2,
+ const char *z)
+ { return(*(int *)0); }
+
+#undef mvchgat
+int mvchgat(
+ int a1,
+ int a2,
+ int a3,
+ attr_t a4,
+ short a5,
+ const void *z)
+ { return(*(int *)0); }
+
+#undef mvdelch
+int mvdelch(
+ int a1,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvgetch
+int mvgetch(
+ int a1,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvgetnstr
+int mvgetnstr(
+ int a1,
+ int a2,
+ char *a3,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvgetstr
+int mvgetstr(
+ int a1,
+ int a2,
+ char *z)
+ { return(*(int *)0); }
+
+#undef mvhline
+int mvhline(
+ int a1,
+ int a2,
+ chtype a3,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvinch
+chtype mvinch(
+ int a1,
+ int z)
+ { return(*(chtype *)0); }
+
+#undef mvinchnstr
+int mvinchnstr(
+ int a1,
+ int a2,
+ chtype *a3,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvinchstr
+int mvinchstr(
+ int a1,
+ int a2,
+ chtype *z)
+ { return(*(int *)0); }
+
+#undef mvinnstr
+int mvinnstr(
+ int a1,
+ int a2,
+ char *a3,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvinsch
+int mvinsch(
+ int a1,
+ int a2,
+ chtype z)
+ { return(*(int *)0); }
+
+#undef mvinsnstr
+int mvinsnstr(
+ int a1,
+ int a2,
+ const char *a3,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvinsstr
+int mvinsstr(
+ int a1,
+ int a2,
+ const char *z)
+ { return(*(int *)0); }
+
+#undef mvinstr
+int mvinstr(
+ int a1,
+ int a2,
+ char *z)
+ { return(*(int *)0); }
+
+#undef mvvline
+int mvvline(
+ int a1,
+ int a2,
+ chtype a3,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvwaddch
+int mvwaddch(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ const chtype z)
+ { return(*(int *)0); }
+
+#undef mvwaddchnstr
+int mvwaddchnstr(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ const chtype *a4,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvwaddchstr
+int mvwaddchstr(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ const chtype *z)
+ { return(*(int *)0); }
+
+#undef mvwaddnstr
+int mvwaddnstr(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ const char *a4,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvwaddstr
+int mvwaddstr(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ const char *z)
+ { return(*(int *)0); }
+
+#undef mvwchgat
+int mvwchgat(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ int a4,
+ attr_t a5,
+ short a6,
+ const void *z)
+ { return(*(int *)0); }
+
+#undef mvwdelch
+int mvwdelch(
+ WINDOW *a1,
+ int a2,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvwgetch
+int mvwgetch(
+ WINDOW *a1,
+ int a2,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvwgetnstr
+int mvwgetnstr(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ char *a4,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvwgetstr
+int mvwgetstr(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ char *z)
+ { return(*(int *)0); }
+
+#undef mvwhline
+int mvwhline(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ chtype a4,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvwinch
+chtype mvwinch(
+ WINDOW *a1,
+ int a2,
+ int z)
+ { return(*(chtype *)0); }
+
+#undef mvwinchnstr
+int mvwinchnstr(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ chtype *a4,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvwinchstr
+int mvwinchstr(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ chtype *z)
+ { return(*(int *)0); }
+
+#undef mvwinnstr
+int mvwinnstr(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ char *a4,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvwinsch
+int mvwinsch(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ chtype z)
+ { return(*(int *)0); }
+
+#undef mvwinsnstr
+int mvwinsnstr(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ const char *a4,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvwinsstr
+int mvwinsstr(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ const char *z)
+ { return(*(int *)0); }
+
+#undef mvwinstr
+int mvwinstr(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ char *z)
+ { return(*(int *)0); }
+
+#undef mvwvline
+int mvwvline(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ chtype a4,
+ int z)
+ { return(*(int *)0); }
+
+#undef PAIR_NUMBER
+int PAIR_NUMBER(
+ int z)
+ { return(*(int *)0); }
+
+#undef redrawwin
+int redrawwin(
+ WINDOW *z)
+ { return(*(int *)0); }
+
+#undef refresh
+int refresh(void)
+ { return(*(int *)0); }
+
+#undef scrl
+int scrl(
+ int z)
+ { return(*(int *)0); }
+
+#undef scroll
+int scroll(
+ WINDOW *z)
+ { return(*(int *)0); }
+
+#undef setscrreg
+int setscrreg(
+ int a1,
+ int z)
+ { return(*(int *)0); }
+
+#undef slk_attr_off
+int slk_attr_off(
+ const attr_t a1,
+ void *z)
+ { return(*(int *)0); }
+
+#undef slk_attr_on
+int slk_attr_on(
+ attr_t a1,
+ void *z)
+ { return(*(int *)0); }
+
+#undef standout
+int standout(void)
+ { return(*(int *)0); }
+
+#undef standend
+int standend(void)
+ { return(*(int *)0); }
+
+#undef timeout
+void timeout(
+ int z)
+ { /* void */ }
+
+#undef touchline
+int touchline(
+ WINDOW *a1,
+ int a2,
+ int z)
+ { return(*(int *)0); }
+
+#undef touchwin
+int touchwin(
+ WINDOW *z)
+ { return(*(int *)0); }
+
+#undef untouchwin
+int untouchwin(
+ WINDOW *z)
+ { return(*(int *)0); }
+
+#undef vline
+int vline(
+ chtype a1,
+ int z)
+ { return(*(int *)0); }
+
+#undef vw_printw
+int vw_printw(
+ WINDOW *a1,
+ const char *a2,
+ va_list z)
+ { return(*(int *)0); }
+
+#undef vw_scanw
+int vw_scanw(
+ WINDOW *a1,
+ char *a2,
+ va_list z)
+ { return(*(int *)0); }
+
+#undef waddchstr
+int waddchstr(
+ WINDOW *a1,
+ const chtype *z)
+ { return(*(int *)0); }
+
+#undef waddstr
+int waddstr(
+ WINDOW *a1,
+ const char *z)
+ { return(*(int *)0); }
+
+#undef wattron
+int wattron(
+ WINDOW *a1,
+ int z)
+ { return(*(int *)0); }
+
+#undef wattroff
+int wattroff(
+ WINDOW *a1,
+ int z)
+ { return(*(int *)0); }
+
+#undef wattrset
+int wattrset(
+ WINDOW *a1,
+ int z)
+ { return(*(int *)0); }
+
+#undef wattr_get
+int wattr_get(
+ WINDOW *a1,
+ attr_t *a2,
+ short *a3,
+ void *z)
+ { return(*(int *)0); }
+
+#undef wattr_set
+int wattr_set(
+ WINDOW *a1,
+ attr_t a2,
+ short a3,
+ void *z)
+ { return(*(int *)0); }
+
+#undef wdeleteln
+int wdeleteln(
+ WINDOW *z)
+ { return(*(int *)0); }
+
+#undef wgetstr
+int wgetstr(
+ WINDOW *a1,
+ char *z)
+ { return(*(int *)0); }
+
+#undef winchstr
+int winchstr(
+ WINDOW *a1,
+ chtype *z)
+ { return(*(int *)0); }
+
+#undef winsertln
+int winsertln(
+ WINDOW *z)
+ { return(*(int *)0); }
+
+#undef winsstr
+int winsstr(
+ WINDOW *a1,
+ const char *z)
+ { return(*(int *)0); }
+
+#undef winstr
+int winstr(
+ WINDOW *a1,
+ char *z)
+ { return(*(int *)0); }
+
+#undef wstandout
+int wstandout(
+ WINDOW *z)
+ { return(*(int *)0); }
+
+#undef wstandend
+int wstandend(
+ WINDOW *z)
+ { return(*(int *)0); }
+
+#undef getattrs
+int getattrs(
+ const WINDOW *z)
+ { return(*(int *)0); }
+
+#undef getcurx
+int getcurx(
+ const WINDOW *z)
+ { return(*(int *)0); }
+
+#undef getcury
+int getcury(
+ const WINDOW *z)
+ { return(*(int *)0); }
+
+#undef getbegx
+int getbegx(
+ const WINDOW *z)
+ { return(*(int *)0); }
+
+#undef getbegy
+int getbegy(
+ const WINDOW *z)
+ { return(*(int *)0); }
+
+#undef getmaxx
+int getmaxx(
+ const WINDOW *z)
+ { return(*(int *)0); }
+
+#undef getmaxy
+int getmaxy(
+ const WINDOW *z)
+ { return(*(int *)0); }
+
+#undef getparx
+int getparx(
+ const WINDOW *z)
+ { return(*(int *)0); }
+
+#undef getpary
+int getpary(
+ const WINDOW *z)
+ { return(*(int *)0); }
+
+#undef wgetparent
+WINDOW *wgetparent(
+ const WINDOW *z)
+ { return(*(WINDOW **)0); }
+
+#undef is_cleared
+NCURSES_BOOL is_cleared(
+ const WINDOW *z)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef is_idcok
+NCURSES_BOOL is_idcok(
+ const WINDOW *z)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef is_idlok
+NCURSES_BOOL is_idlok(
+ const WINDOW *z)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef is_immedok
+NCURSES_BOOL is_immedok(
+ const WINDOW *z)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef is_keypad
+NCURSES_BOOL is_keypad(
+ const WINDOW *z)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef is_leaveok
+NCURSES_BOOL is_leaveok(
+ const WINDOW *z)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef is_nodelay
+NCURSES_BOOL is_nodelay(
+ const WINDOW *z)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef is_notimeout
+NCURSES_BOOL is_notimeout(
+ const WINDOW *z)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef is_pad
+NCURSES_BOOL is_pad(
+ const WINDOW *z)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef is_scrollok
+NCURSES_BOOL is_scrollok(
+ const WINDOW *z)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef is_subwin
+NCURSES_BOOL is_subwin(
+ const WINDOW *z)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef is_syncok
+NCURSES_BOOL is_syncok(
+ const WINDOW *z)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef wgetscrreg
+int wgetscrreg(
+ const WINDOW *a1,
+ int *a2,
+ int *z)
+ { return(*(int *)0); }
+
+#undef add_wch
+int add_wch(
+ const cchar_t *z)
+ { return(*(int *)0); }
+
+#undef add_wchnstr
+int add_wchnstr(
+ const cchar_t *a1,
+ int z)
+ { return(*(int *)0); }
+
+#undef add_wchstr
+int add_wchstr(
+ const cchar_t *z)
+ { return(*(int *)0); }
+
+#undef addnwstr
+int addnwstr(
+ const wchar_t *a1,
+ int z)
+ { return(*(int *)0); }
+
+#undef addwstr
+int addwstr(
+ const wchar_t *z)
+ { return(*(int *)0); }
+
+#undef bkgrnd
+int bkgrnd(
+ const cchar_t *z)
+ { return(*(int *)0); }
+
+#undef bkgrndset
+void bkgrndset(
+ const cchar_t *z)
+ { /* void */ }
+
+#undef border_set
+int border_set(
+ const cchar_t *a1,
+ const cchar_t *a2,
+ const cchar_t *a3,
+ const cchar_t *a4,
+ const cchar_t *a5,
+ const cchar_t *a6,
+ const cchar_t *a7,
+ const cchar_t *z)
+ { return(*(int *)0); }
+
+#undef box_set
+int box_set(
+ WINDOW *a1,
+ const cchar_t *a2,
+ const cchar_t *z)
+ { return(*(int *)0); }
+
+#undef echo_wchar
+int echo_wchar(
+ const cchar_t *z)
+ { return(*(int *)0); }
+
+#undef get_wch
+int get_wch(
+ wint_t *z)
+ { return(*(int *)0); }
+
+#undef get_wstr
+int get_wstr(
+ wint_t *z)
+ { return(*(int *)0); }
+
+#undef getbkgrnd
+int getbkgrnd(
+ cchar_t *z)
+ { return(*(int *)0); }
+
+#undef getn_wstr
+int getn_wstr(
+ wint_t *a1,
+ int z)
+ { return(*(int *)0); }
+
+#undef hline_set
+int hline_set(
+ const cchar_t *a1,
+ int z)
+ { return(*(int *)0); }
+
+#undef in_wch
+int in_wch(
+ cchar_t *z)
+ { return(*(int *)0); }
+
+#undef in_wchnstr
+int in_wchnstr(
+ cchar_t *a1,
+ int z)
+ { return(*(int *)0); }
+
+#undef in_wchstr
+int in_wchstr(
+ cchar_t *z)
+ { return(*(int *)0); }
+
+#undef innwstr
+int innwstr(
+ wchar_t *a1,
+ int z)
+ { return(*(int *)0); }
+
+#undef ins_nwstr
+int ins_nwstr(
+ const wchar_t *a1,
+ int z)
+ { return(*(int *)0); }
+
+#undef ins_wch
+int ins_wch(
+ const cchar_t *z)
+ { return(*(int *)0); }
+
+#undef ins_wstr
+int ins_wstr(
+ const wchar_t *z)
+ { return(*(int *)0); }
+
+#undef inwstr
+int inwstr(
+ wchar_t *z)
+ { return(*(int *)0); }
+
+#undef mvadd_wch
+int mvadd_wch(
+ int a1,
+ int a2,
+ const cchar_t *z)
+ { return(*(int *)0); }
+
+#undef mvadd_wchnstr
+int mvadd_wchnstr(
+ int a1,
+ int a2,
+ const cchar_t *a3,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvadd_wchstr
+int mvadd_wchstr(
+ int a1,
+ int a2,
+ const cchar_t *z)
+ { return(*(int *)0); }
+
+#undef mvaddnwstr
+int mvaddnwstr(
+ int a1,
+ int a2,
+ const wchar_t *a3,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvaddwstr
+int mvaddwstr(
+ int a1,
+ int a2,
+ const wchar_t *z)
+ { return(*(int *)0); }
+
+#undef mvget_wch
+int mvget_wch(
+ int a1,
+ int a2,
+ wint_t *z)
+ { return(*(int *)0); }
+
+#undef mvget_wstr
+int mvget_wstr(
+ int a1,
+ int a2,
+ wint_t *z)
+ { return(*(int *)0); }
+
+#undef mvgetn_wstr
+int mvgetn_wstr(
+ int a1,
+ int a2,
+ wint_t *a3,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvhline_set
+int mvhline_set(
+ int a1,
+ int a2,
+ const cchar_t *a3,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvin_wch
+int mvin_wch(
+ int a1,
+ int a2,
+ cchar_t *z)
+ { return(*(int *)0); }
+
+#undef mvin_wchnstr
+int mvin_wchnstr(
+ int a1,
+ int a2,
+ cchar_t *a3,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvin_wchstr
+int mvin_wchstr(
+ int a1,
+ int a2,
+ cchar_t *z)
+ { return(*(int *)0); }
+
+#undef mvinnwstr
+int mvinnwstr(
+ int a1,
+ int a2,
+ wchar_t *a3,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvins_nwstr
+int mvins_nwstr(
+ int a1,
+ int a2,
+ const wchar_t *a3,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvins_wch
+int mvins_wch(
+ int a1,
+ int a2,
+ const cchar_t *z)
+ { return(*(int *)0); }
+
+#undef mvins_wstr
+int mvins_wstr(
+ int a1,
+ int a2,
+ const wchar_t *z)
+ { return(*(int *)0); }
+
+#undef mvinwstr
+int mvinwstr(
+ int a1,
+ int a2,
+ wchar_t *z)
+ { return(*(int *)0); }
+
+#undef mvvline_set
+int mvvline_set(
+ int a1,
+ int a2,
+ const cchar_t *a3,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvwadd_wch
+int mvwadd_wch(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ const cchar_t *z)
+ { return(*(int *)0); }
+
+#undef mvwadd_wchnstr
+int mvwadd_wchnstr(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ const cchar_t *a4,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvwadd_wchstr
+int mvwadd_wchstr(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ const cchar_t *z)
+ { return(*(int *)0); }
+
+#undef mvwaddnwstr
+int mvwaddnwstr(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ const wchar_t *a4,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvwaddwstr
+int mvwaddwstr(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ const wchar_t *z)
+ { return(*(int *)0); }
+
+#undef mvwget_wch
+int mvwget_wch(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ wint_t *z)
+ { return(*(int *)0); }
+
+#undef mvwget_wstr
+int mvwget_wstr(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ wint_t *z)
+ { return(*(int *)0); }
+
+#undef mvwgetn_wstr
+int mvwgetn_wstr(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ wint_t *a4,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvwhline_set
+int mvwhline_set(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ const cchar_t *a4,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvwin_wch
+int mvwin_wch(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ cchar_t *z)
+ { return(*(int *)0); }
+
+#undef mvwin_wchnstr
+int mvwin_wchnstr(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ cchar_t *a4,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvwin_wchstr
+int mvwin_wchstr(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ cchar_t *z)
+ { return(*(int *)0); }
+
+#undef mvwinnwstr
+int mvwinnwstr(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ wchar_t *a4,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvwins_nwstr
+int mvwins_nwstr(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ const wchar_t *a4,
+ int z)
+ { return(*(int *)0); }
+
+#undef mvwins_wch
+int mvwins_wch(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ const cchar_t *z)
+ { return(*(int *)0); }
+
+#undef mvwins_wstr
+int mvwins_wstr(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ const wchar_t *z)
+ { return(*(int *)0); }
+
+#undef mvwinwstr
+int mvwinwstr(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ wchar_t *z)
+ { return(*(int *)0); }
+
+#undef mvwvline_set
+int mvwvline_set(
+ WINDOW *a1,
+ int a2,
+ int a3,
+ const cchar_t *a4,
+ int z)
+ { return(*(int *)0); }
+
+#undef vline_set
+int vline_set(
+ const cchar_t *a1,
+ int z)
+ { return(*(int *)0); }
+
+#undef wadd_wchstr
+int wadd_wchstr(
+ WINDOW *a1,
+ const cchar_t *z)
+ { return(*(int *)0); }
+
+#undef waddwstr
+int waddwstr(
+ WINDOW *a1,
+ const wchar_t *z)
+ { return(*(int *)0); }
+
+#undef wget_wstr
+int wget_wstr(
+ WINDOW *a1,
+ wint_t *z)
+ { return(*(int *)0); }
+
+#undef wgetbkgrnd
+int wgetbkgrnd(
+ WINDOW *a1,
+ cchar_t *z)
+ { return(*(int *)0); }
+
+#undef win_wchstr
+int win_wchstr(
+ WINDOW *a1,
+ cchar_t *z)
+ { return(*(int *)0); }
+
+#undef wins_wstr
+int wins_wstr(
+ WINDOW *a1,
+ const wchar_t *z)
+ { return(*(int *)0); }
+
+#undef mouse_trafo
+NCURSES_BOOL mouse_trafo(
+ int *a1,
+ int *a2,
+ NCURSES_BOOL z)
+ { return(*(NCURSES_BOOL *)0); }
+
+/* ./base/lib_getch.c */
+
+#include <fifo_defs.h>
+
+#undef _nc_ESCDELAY
+int _nc_ESCDELAY(void)
+ { return(*(int *)0); }
+
+#undef _nc_ptr_Escdelay
+int *_nc_ptr_Escdelay(
+ SCREEN *sp)
+ { return(*(int **)0); }
+
+#undef set_escdelay_sp
+int set_escdelay_sp(
+ SCREEN *sp,
+ int value)
+ { return(*(int *)0); }
+
+#undef set_escdelay
+int set_escdelay(
+ int value)
+ { return(*(int *)0); }
+
+#undef get_escdelay_sp
+int get_escdelay_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef get_escdelay
+int get_escdelay(void)
+ { return(*(int *)0); }
+
+#undef _nc_wgetch
+int _nc_wgetch(
+ WINDOW *win,
+ int *result,
+ int use_meta)
+ { return(*(int *)0); }
+
+#undef wgetch
+int wgetch(
+ WINDOW *win)
+ { return(*(int *)0); }
+
+/* ./base/lib_getstr.c */
+
+#undef wgetnstr
+int wgetnstr(
+ WINDOW *win,
+ char *str,
+ int maxlen)
+ { return(*(int *)0); }
+
+/* ./base/lib_hline.c */
+
+#undef whline
+int whline(
+ WINDOW *win,
+ chtype ch,
+ int n)
+ { return(*(int *)0); }
+
+/* ./base/lib_immedok.c */
+
+#undef immedok
+void immedok(
+ WINDOW *win,
+ NCURSES_BOOL flag)
+ { /* void */ }
+
+/* ./base/lib_inchstr.c */
+
+#undef winchnstr
+int winchnstr(
+ WINDOW *win,
+ chtype *str,
+ int n)
+ { return(*(int *)0); }
+
+/* ./base/lib_initscr.c */
+
+#undef initscr
+WINDOW *initscr(void)
+ { return(*(WINDOW **)0); }
+
+/* ./base/lib_insch.c */
+
+#undef _nc_insert_ch
+int _nc_insert_ch(
+ SCREEN *sp,
+ WINDOW *win,
+ chtype ch)
+ { return(*(int *)0); }
+
+#undef winsch
+int winsch(
+ WINDOW *win,
+ chtype c)
+ { return(*(int *)0); }
+
+/* ./base/lib_insdel.c */
+
+#undef winsdelln
+int winsdelln(
+ WINDOW *win,
+ int n)
+ { return(*(int *)0); }
+
+/* ./base/lib_insnstr.c */
+
+#undef winsnstr
+int winsnstr(
+ WINDOW *win,
+ const char *s,
+ int n)
+ { return(*(int *)0); }
+
+/* ./base/lib_instr.c */
+
+#undef winnstr
+int winnstr(
+ WINDOW *win,
+ char *str,
+ int n)
+ { return(*(int *)0); }
+
+/* ./base/lib_isendwin.c */
+
+#undef isendwin_sp
+NCURSES_BOOL isendwin_sp(
+ SCREEN *sp)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef isendwin
+NCURSES_BOOL isendwin(void)
+ { return(*(NCURSES_BOOL *)0); }
+
+/* ./base/lib_leaveok.c */
+
+#undef leaveok
+int leaveok(
+ WINDOW *win,
+ NCURSES_BOOL flag)
+ { return(*(int *)0); }
+
+/* ./base/lib_mouse.c */
+
+#undef getmouse_sp
+int getmouse_sp(
+ SCREEN *sp,
+ MEVENT *aevent)
+ { return(*(int *)0); }
+
+#undef getmouse
+int getmouse(
+ MEVENT *aevent)
+ { return(*(int *)0); }
+
+#undef ungetmouse_sp
+int ungetmouse_sp(
+ SCREEN *sp,
+ MEVENT *aevent)
+ { return(*(int *)0); }
+
+#undef ungetmouse
+int ungetmouse(
+ MEVENT *aevent)
+ { return(*(int *)0); }
+
+#undef mousemask_sp
+mmask_t mousemask_sp(
+ SCREEN *sp,
+ mmask_t newmask,
+ mmask_t *oldmask)
+ { return(*(mmask_t *)0); }
+
+#undef mousemask
+mmask_t mousemask(
+ mmask_t newmask,
+ mmask_t *oldmask)
+ { return(*(mmask_t *)0); }
+
+#undef wenclose
+NCURSES_BOOL wenclose(
+ const WINDOW *win,
+ int y,
+ int x)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef mouseinterval_sp
+int mouseinterval_sp(
+ SCREEN *sp,
+ int maxclick)
+ { return(*(int *)0); }
+
+#undef mouseinterval
+int mouseinterval(
+ int maxclick)
+ { return(*(int *)0); }
+
+#undef _nc_has_mouse
+NCURSES_BOOL _nc_has_mouse(
+ SCREEN *sp)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef has_mouse_sp
+NCURSES_BOOL has_mouse_sp(
+ SCREEN *sp)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef has_mouse
+NCURSES_BOOL has_mouse(void)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef wmouse_trafo
+NCURSES_BOOL wmouse_trafo(
+ const WINDOW *win,
+ int *pY,
+ int *pX,
+ NCURSES_BOOL to_screen)
+ { return(*(NCURSES_BOOL *)0); }
+
+/* ./base/lib_move.c */
+
+#undef wmove
+int wmove(
+ WINDOW *win,
+ int y,
+ int x)
+ { return(*(int *)0); }
+
+/* ./tty/lib_mvcur.c */
+
+#undef _nc_msec_cost_sp
+int _nc_msec_cost_sp(
+ SCREEN *sp,
+ const char *const cap,
+ int affcnt)
+ { return(*(int *)0); }
+
+#undef _nc_msec_cost
+int _nc_msec_cost(
+ const char *const cap,
+ int affcnt)
+ { return(*(int *)0); }
+
+#undef _nc_mvcur_resume_sp
+void _nc_mvcur_resume_sp(
+ SCREEN *sp)
+ { /* void */ }
+
+#undef _nc_mvcur_resume
+void _nc_mvcur_resume(void)
+ { /* void */ }
+
+#undef _nc_mvcur_init_sp
+void _nc_mvcur_init_sp(
+ SCREEN *sp)
+ { /* void */ }
+
+#undef _nc_mvcur_init
+void _nc_mvcur_init(void)
+ { /* void */ }
+
+#undef _nc_mvcur_wrap_sp
+void _nc_mvcur_wrap_sp(
+ SCREEN *sp)
+ { /* void */ }
+
+#undef _nc_mvcur_wrap
+void _nc_mvcur_wrap(void)
+ { /* void */ }
+
+#undef mvcur_sp
+int mvcur_sp(
+ SCREEN *sp,
+ int yold,
+ int xold,
+ int ynew,
+ int xnew)
+ { return(*(int *)0); }
+
+#undef mvcur
+int mvcur(
+ int yold,
+ int xold,
+ int ynew,
+ int xnew)
+ { return(*(int *)0); }
+
+#undef _nc_optimize_enable
+int _nc_optimize_enable;
+
+/* ./base/lib_mvwin.c */
+
+#undef mvwin
+int mvwin(
+ WINDOW *win,
+ int by,
+ int bx)
+ { return(*(int *)0); }
+
+/* ./base/lib_newterm.c */
+
+#undef filter_sp
+void filter_sp(
+ SCREEN *sp)
+ { /* void */ }
+
+#undef filter
+void filter(void)
+ { /* void */ }
+
+#undef nofilter_sp
+void nofilter_sp(
+ SCREEN *sp)
+ { /* void */ }
+
+#undef nofilter
+void nofilter(void)
+ { /* void */ }
+
+#undef newterm_sp
+SCREEN *newterm_sp(
+ SCREEN *sp,
+ char *name,
+ FILE *ofp,
+ FILE *ifp)
+ { return(*(SCREEN **)0); }
+
+#undef newterm
+SCREEN *newterm(
+ char *name,
+ FILE *ofp,
+ FILE *ifp)
+ { return(*(SCREEN **)0); }
+
+/* ./base/lib_newwin.c */
+
+#undef _nc_freewin
+int _nc_freewin(
+ WINDOW *win)
+ { return(*(int *)0); }
+
+#undef newwin_sp
+WINDOW *newwin_sp(
+ SCREEN *sp,
+ int num_lines,
+ int num_columns,
+ int begy,
+ int begx)
+ { return(*(WINDOW **)0); }
+
+#undef newwin
+WINDOW *newwin(
+ int num_lines,
+ int num_columns,
+ int begy,
+ int begx)
+ { return(*(WINDOW **)0); }
+
+#undef derwin
+WINDOW *derwin(
+ WINDOW *orig,
+ int num_lines,
+ int num_columns,
+ int begy,
+ int begx)
+ { return(*(WINDOW **)0); }
+
+#undef subwin
+WINDOW *subwin(
+ WINDOW *w,
+ int l,
+ int c,
+ int y,
+ int x)
+ { return(*(WINDOW **)0); }
+
+#undef _nc_makenew_sp
+WINDOW *_nc_makenew_sp(
+ SCREEN *sp,
+ int num_lines,
+ int num_columns,
+ int begy,
+ int begx,
+ int flags)
+ { return(*(WINDOW **)0); }
+
+#undef _nc_curscr_of
+WINDOW *_nc_curscr_of(
+ SCREEN *sp)
+ { return(*(WINDOW **)0); }
+
+#undef _nc_newscr_of
+WINDOW *_nc_newscr_of(
+ SCREEN *sp)
+ { return(*(WINDOW **)0); }
+
+#undef _nc_stdscr_of
+WINDOW *_nc_stdscr_of(
+ SCREEN *sp)
+ { return(*(WINDOW **)0); }
+
+/* ./base/lib_nl.c */
+
+#undef nl_sp
+int nl_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef nl
+int nl(void)
+ { return(*(int *)0); }
+
+#undef nonl_sp
+int nonl_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef nonl
+int nonl(void)
+ { return(*(int *)0); }
+
+/* ./base/lib_overlay.c */
+
+#undef overlay
+int overlay(
+ const WINDOW *win1,
+ WINDOW *win2)
+ { return(*(int *)0); }
+
+#undef overwrite
+int overwrite(
+ const WINDOW *win1,
+ WINDOW *win2)
+ { return(*(int *)0); }
+
+#undef copywin
+int copywin(
+ const WINDOW *src,
+ WINDOW *dst,
+ int sminrow,
+ int smincol,
+ int dminrow,
+ int dmincol,
+ int dmaxrow,
+ int dmaxcol,
+ int over)
+ { return(*(int *)0); }
+
+/* ./base/lib_pad.c */
+
+#undef newpad_sp
+WINDOW *newpad_sp(
+ SCREEN *sp,
+ int l,
+ int c)
+ { return(*(WINDOW **)0); }
+
+#undef newpad
+WINDOW *newpad(
+ int l,
+ int c)
+ { return(*(WINDOW **)0); }
+
+#undef subpad
+WINDOW *subpad(
+ WINDOW *orig,
+ int l,
+ int c,
+ int begy,
+ int begx)
+ { return(*(WINDOW **)0); }
+
+#undef prefresh
+int prefresh(
+ WINDOW *win,
+ int pminrow,
+ int pmincol,
+ int sminrow,
+ int smincol,
+ int smaxrow,
+ int smaxcol)
+ { return(*(int *)0); }
+
+#undef pnoutrefresh
+int pnoutrefresh(
+ WINDOW *win,
+ int pminrow,
+ int pmincol,
+ int sminrow,
+ int smincol,
+ int smaxrow,
+ int smaxcol)
+ { return(*(int *)0); }
+
+#undef pechochar
+int pechochar(
+ WINDOW *pad,
+ const chtype ch)
+ { return(*(int *)0); }
+
+/* ./base/lib_printw.c */
+
+#undef printw
+int printw(
+ const char *fmt,
+ ...)
+ { return(*(int *)0); }
+
+#undef wprintw
+int wprintw(
+ WINDOW *win,
+ const char *fmt,
+ ...)
+ { return(*(int *)0); }
+
+#undef mvprintw
+int mvprintw(
+ int y,
+ int x,
+ const char *fmt,
+ ...)
+ { return(*(int *)0); }
+
+#undef mvwprintw
+int mvwprintw(
+ WINDOW *win,
+ int y,
+ int x,
+ const char *fmt,
+ ...)
+ { return(*(int *)0); }
+
+#undef vwprintw
+int vwprintw(
+ WINDOW *win,
+ const char *fmt,
+ va_list argp)
+ { return(*(int *)0); }
+
+/* ./base/lib_redrawln.c */
+
+#undef wredrawln
+int wredrawln(
+ WINDOW *win,
+ int beg,
+ int num)
+ { return(*(int *)0); }
+
+/* ./base/lib_refresh.c */
+
+#undef wrefresh
+int wrefresh(
+ WINDOW *win)
+ { return(*(int *)0); }
+
+#undef wnoutrefresh
+int wnoutrefresh(
+ WINDOW *win)
+ { return(*(int *)0); }
+
+/* ./base/lib_restart.c */
+
+#undef restartterm_sp
+int restartterm_sp(
+ SCREEN *sp,
+ char *termp,
+ int filenum,
+ int *errret)
+ { return(*(int *)0); }
+
+#undef restartterm
+int restartterm(
+ char *termp,
+ int filenum,
+ int *errret)
+ { return(*(int *)0); }
+
+/* ./base/lib_scanw.c */
+
+#undef vwscanw
+int vwscanw(
+ WINDOW *win,
+ char *fmt,
+ va_list argp)
+ { return(*(int *)0); }
+
+#undef scanw
+int scanw(
+ char *fmt,
+ ...)
+ { return(*(int *)0); }
+
+#undef wscanw
+int wscanw(
+ WINDOW *win,
+ char *fmt,
+ ...)
+ { return(*(int *)0); }
+
+#undef mvscanw
+int mvscanw(
+ int y,
+ int x,
+ char *fmt,
+ ...)
+ { return(*(int *)0); }
+
+#undef mvwscanw
+int mvwscanw(
+ WINDOW *win,
+ int y,
+ int x,
+ char *fmt,
+ ...)
+ { return(*(int *)0); }
+
+/* ./base/lib_screen.c */
+
+#undef getwin_sp
+WINDOW *getwin_sp(
+ SCREEN *sp,
+ FILE *filep)
+ { return(*(WINDOW **)0); }
+
+#undef getwin
+WINDOW *getwin(
+ FILE *filep)
+ { return(*(WINDOW **)0); }
+
+#undef putwin
+int putwin(
+ WINDOW *win,
+ FILE *filep)
+ { return(*(int *)0); }
+
+#undef scr_restore_sp
+int scr_restore_sp(
+ SCREEN *sp,
+ const char *file)
+ { return(*(int *)0); }
+
+#undef scr_restore
+int scr_restore(
+ const char *file)
+ { return(*(int *)0); }
+
+#undef scr_dump
+int scr_dump(
+ const char *file)
+ { return(*(int *)0); }
+
+#undef scr_init_sp
+int scr_init_sp(
+ SCREEN *sp,
+ const char *file)
+ { return(*(int *)0); }
+
+#undef scr_init
+int scr_init(
+ const char *file)
+ { return(*(int *)0); }
+
+#undef scr_set_sp
+int scr_set_sp(
+ SCREEN *sp,
+ const char *file)
+ { return(*(int *)0); }
+
+#undef scr_set
+int scr_set(
+ const char *file)
+ { return(*(int *)0); }
+
+/* ./base/lib_scroll.c */
+
+#undef _nc_scroll_window
+void _nc_scroll_window(
+ WINDOW *win,
+ int const n,
+ int const top,
+ int const bottom,
+ cchar_t blank)
+ { /* void */ }
+
+#undef wscrl
+int wscrl(
+ WINDOW *win,
+ int n)
+ { return(*(int *)0); }
+
+/* ./base/lib_scrollok.c */
+
+#undef scrollok
+int scrollok(
+ WINDOW *win,
+ NCURSES_BOOL flag)
+ { return(*(int *)0); }
+
+/* ./base/lib_scrreg.c */
+
+#undef wsetscrreg
+int wsetscrreg(
+ WINDOW *win,
+ int top,
+ int bottom)
+ { return(*(int *)0); }
+
+/* ./base/lib_set_term.c */
+
+#undef set_term
+SCREEN *set_term(
+ SCREEN *screenp)
+ { return(*(SCREEN **)0); }
+
+#undef delscreen
+void delscreen(
+ SCREEN *sp)
+ { /* void */ }
+
+#undef _nc_setupscreen_sp
+int _nc_setupscreen_sp(
+ SCREEN **spp,
+ int slines,
+ int scolumns,
+ FILE *output,
+ NCURSES_BOOL filtered,
+ int slk_format)
+ { return(*(int *)0); }
+
+#undef _nc_setupscreen
+int _nc_setupscreen(
+ int slines,
+ int scolumns,
+ FILE *output,
+ NCURSES_BOOL filtered,
+ int slk_format)
+ { return(*(int *)0); }
+
+#undef _nc_ripoffline_sp
+int _nc_ripoffline_sp(
+ SCREEN *sp,
+ int line,
+ int (*init)(
+ WINDOW *p1,
+ int p2))
+ { return(*(int *)0); }
+
+#undef _nc_ripoffline
+int _nc_ripoffline(
+ int line,
+ int (*init)(
+ WINDOW *p1,
+ int p2))
+ { return(*(int *)0); }
+
+#undef ripoffline_sp
+int ripoffline_sp(
+ SCREEN *sp,
+ int line,
+ int (*init)(
+ WINDOW *p1,
+ int p2))
+ { return(*(int *)0); }
+
+#undef ripoffline
+int ripoffline(
+ int line,
+ int (*init)(
+ WINDOW *p1,
+ int p2))
+ { return(*(int *)0); }
+
+/* ./base/lib_slk.c */
+
+#undef _nc_format_slks
+int _nc_format_slks(
+ SCREEN *sp,
+ int cols)
+ { return(*(int *)0); }
+
+#undef _nc_slk_initialize
+int _nc_slk_initialize(
+ WINDOW *stwin,
+ int cols)
+ { return(*(int *)0); }
+
+#undef slk_restore_sp
+int slk_restore_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef slk_restore
+int slk_restore(void)
+ { return(*(int *)0); }
+
+/* ./base/lib_slkatr_set.c */
+
+#undef slk_attr_set_sp
+int slk_attr_set_sp(
+ SCREEN *sp,
+ const attr_t attr,
+ short color_pair_number,
+ void *opts)
+ { return(*(int *)0); }
+
+#undef slk_attr_set
+int slk_attr_set(
+ const attr_t attr,
+ short color_pair_number,
+ void *opts)
+ { return(*(int *)0); }
+
+/* ./base/lib_slkatrof.c */
+
+#undef slk_attroff_sp
+int slk_attroff_sp(
+ SCREEN *sp,
+ const chtype attr)
+ { return(*(int *)0); }
+
+#undef slk_attroff
+int slk_attroff(
+ const chtype attr)
+ { return(*(int *)0); }
+
+/* ./base/lib_slkatron.c */
+
+#undef slk_attron_sp
+int slk_attron_sp(
+ SCREEN *sp,
+ const chtype attr)
+ { return(*(int *)0); }
+
+#undef slk_attron
+int slk_attron(
+ const chtype attr)
+ { return(*(int *)0); }
+
+/* ./base/lib_slkatrset.c */
+
+#undef slk_attrset_sp
+int slk_attrset_sp(
+ SCREEN *sp,
+ const chtype attr)
+ { return(*(int *)0); }
+
+#undef slk_attrset
+int slk_attrset(
+ const chtype attr)
+ { return(*(int *)0); }
+
+/* ./base/lib_slkattr.c */
+
+#undef slk_attr_sp
+attr_t slk_attr_sp(
+ SCREEN *sp)
+ { return(*(attr_t *)0); }
+
+#undef slk_attr
+attr_t slk_attr(void)
+ { return(*(attr_t *)0); }
+
+/* ./base/lib_slkclear.c */
+
+#undef slk_clear_sp
+int slk_clear_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef slk_clear
+int slk_clear(void)
+ { return(*(int *)0); }
+
+/* ./base/lib_slkcolor.c */
+
+#undef slk_color_sp
+int slk_color_sp(
+ SCREEN *sp,
+ short color_pair_number)
+ { return(*(int *)0); }
+
+#undef slk_color
+int slk_color(
+ short color_pair_number)
+ { return(*(int *)0); }
+
+/* ./base/lib_slkinit.c */
+
+#undef slk_init_sp
+int slk_init_sp(
+ SCREEN *sp,
+ int format)
+ { return(*(int *)0); }
+
+#undef slk_init
+int slk_init(
+ int format)
+ { return(*(int *)0); }
+
+/* ./base/lib_slklab.c */
+
+#undef slk_label_sp
+char *slk_label_sp(
+ SCREEN *sp,
+ int n)
+ { return(*(char **)0); }
+
+#undef slk_label
+char *slk_label(
+ int n)
+ { return(*(char **)0); }
+
+/* ./base/lib_slkrefr.c */
+
+#undef slk_noutrefresh_sp
+int slk_noutrefresh_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef slk_noutrefresh
+int slk_noutrefresh(void)
+ { return(*(int *)0); }
+
+#undef slk_refresh_sp
+int slk_refresh_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef slk_refresh
+int slk_refresh(void)
+ { return(*(int *)0); }
+
+/* ./base/lib_slkset.c */
+
+#include <wctype.h>
+
+#undef slk_set_sp
+int slk_set_sp(
+ SCREEN *sp,
+ int i,
+ const char *astr,
+ int format)
+ { return(*(int *)0); }
+
+#undef slk_set
+int slk_set(
+ int i,
+ const char *astr,
+ int format)
+ { return(*(int *)0); }
+
+/* ./base/lib_slktouch.c */
+
+#undef slk_touch_sp
+int slk_touch_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef slk_touch
+int slk_touch(void)
+ { return(*(int *)0); }
+
+/* ./base/lib_touch.c */
+
+#undef is_linetouched
+NCURSES_BOOL is_linetouched(
+ WINDOW *win,
+ int line)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef is_wintouched
+NCURSES_BOOL is_wintouched(
+ WINDOW *win)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef wtouchln
+int wtouchln(
+ WINDOW *win,
+ int y,
+ int n,
+ int changed)
+ { return(*(int *)0); }
+
+/* ./trace/lib_tracedmp.c */
+
+#undef _tracedump
+void _tracedump(
+ const char *name,
+ WINDOW *win)
+ { /* void */ }
+
+/* ./trace/lib_tracemse.c */
+
+#undef _nc_tracemouse
+char *_nc_tracemouse(
+ SCREEN *sp,
+ MEVENT const *ep)
+ { return(*(char **)0); }
+
+#undef _nc_retrace_mmask_t
+mmask_t _nc_retrace_mmask_t(
+ SCREEN *sp,
+ mmask_t code)
+ { return(*(mmask_t *)0); }
+
+#undef _tracemouse
+char *_tracemouse(
+ MEVENT const *ep)
+ { return(*(char **)0); }
+
+/* ./tty/lib_tstp.c */
+
+#include <SigAction.h>
+
+#undef _nc_signal_handler
+void _nc_signal_handler(
+ NCURSES_BOOL enable)
+ { /* void */ }
+
+/* ./base/lib_ungetch.c */
+
+#undef _nc_fifo_dump
+void _nc_fifo_dump(
+ SCREEN *sp)
+ { /* void */ }
+
+#undef ungetch_sp
+int ungetch_sp(
+ SCREEN *sp,
+ int ch)
+ { return(*(int *)0); }
+
+#undef ungetch
+int ungetch(
+ int ch)
+ { return(*(int *)0); }
+
+/* ./tty/lib_vidattr.c */
+
+#undef vidputs_sp
+int vidputs_sp(
+ SCREEN *sp,
+ chtype newmode,
+ NCURSES_OUTC_sp outc)
+ { return(*(int *)0); }
+
+#undef vidputs
+int vidputs(
+ chtype newmode,
+ NCURSES_OUTC outc)
+ { return(*(int *)0); }
+
+#undef vidattr_sp
+int vidattr_sp(
+ SCREEN *sp,
+ chtype newmode)
+ { return(*(int *)0); }
+
+#undef vidattr
+int vidattr(
+ chtype newmode)
+ { return(*(int *)0); }
+
+#undef termattrs_sp
+chtype termattrs_sp(
+ SCREEN *sp)
+ { return(*(chtype *)0); }
+
+#undef termattrs
+chtype termattrs(void)
+ { return(*(chtype *)0); }
+
+/* ./base/lib_vline.c */
+
+#undef wvline
+int wvline(
+ WINDOW *win,
+ chtype ch,
+ int n)
+ { return(*(int *)0); }
+
+/* ./base/lib_wattroff.c */
+
+#undef wattr_off
+int wattr_off(
+ WINDOW *win,
+ attr_t at,
+ void *opts)
+ { return(*(int *)0); }
+
+/* ./base/lib_wattron.c */
+
+#undef wattr_on
+int wattr_on(
+ WINDOW *win,
+ attr_t at,
+ void *opts)
+ { return(*(int *)0); }
+
+/* ./base/lib_winch.c */
+
+#undef winch
+chtype winch(
+ WINDOW *win)
+ { return(*(chtype *)0); }
+
+/* ./base/lib_window.c */
+
+#undef _nc_synchook
+void _nc_synchook(
+ WINDOW *win)
+ { /* void */ }
+
+#undef mvderwin
+int mvderwin(
+ WINDOW *win,
+ int y,
+ int x)
+ { return(*(int *)0); }
+
+#undef syncok
+int syncok(
+ WINDOW *win,
+ NCURSES_BOOL bf)
+ { return(*(int *)0); }
+
+#undef wsyncup
+void wsyncup(
+ WINDOW *win)
+ { /* void */ }
+
+#undef wsyncdown
+void wsyncdown(
+ WINDOW *win)
+ { /* void */ }
+
+#undef wcursyncup
+void wcursyncup(
+ WINDOW *win)
+ { /* void */ }
+
+#undef dupwin
+WINDOW *dupwin(
+ WINDOW *win)
+ { return(*(WINDOW **)0); }
+
+/* ./base/nc_panel.c */
+
+#undef _nc_panelhook_sp
+struct panelhook *_nc_panelhook_sp(
+ SCREEN *sp)
+ { return(*(struct panelhook **)0); }
+
+#undef _nc_panelhook
+struct panelhook *_nc_panelhook(void)
+ { return(*(struct panelhook **)0); }
+
+/* ./base/safe_sprintf.c */
+
+#undef _nc_printf_string_sp
+char *_nc_printf_string_sp(
+ SCREEN *sp,
+ const char *fmt,
+ va_list ap)
+ { return(*(char **)0); }
+
+#undef _nc_printf_string
+char *_nc_printf_string(
+ const char *fmt,
+ va_list ap)
+ { return(*(char **)0); }
+
+/* ./tty/tty_update.c */
+
+#include <sys/time.h>
+#include <sys/times.h>
+
+#undef doupdate_sp
+int doupdate_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef doupdate
+int doupdate(void)
+ { return(*(int *)0); }
+
+#undef _nc_scrolln_sp
+int _nc_scrolln_sp(
+ SCREEN *sp,
+ int n,
+ int top,
+ int bot,
+ int maxy)
+ { return(*(int *)0); }
+
+#undef _nc_scrolln
+int _nc_scrolln(
+ int n,
+ int top,
+ int bot,
+ int maxy)
+ { return(*(int *)0); }
+
+#undef _nc_screen_resume_sp
+void _nc_screen_resume_sp(
+ SCREEN *sp)
+ { /* void */ }
+
+#undef _nc_screen_resume
+void _nc_screen_resume(void)
+ { /* void */ }
+
+#undef _nc_screen_init_sp
+void _nc_screen_init_sp(
+ SCREEN *sp)
+ { /* void */ }
+
+#undef _nc_screen_init
+void _nc_screen_init(void)
+ { /* void */ }
+
+#undef _nc_screen_wrap_sp
+void _nc_screen_wrap_sp(
+ SCREEN *sp)
+ { /* void */ }
+
+#undef _nc_screen_wrap
+void _nc_screen_wrap(void)
+ { /* void */ }
+
+#undef _nc_do_xmc_glitch_sp
+void _nc_do_xmc_glitch_sp(
+ SCREEN *sp,
+ attr_t previous)
+ { /* void */ }
+
+#undef _nc_do_xmc_glitch
+void _nc_do_xmc_glitch(
+ attr_t previous)
+ { /* void */ }
+
+/* ./trace/varargs.c */
+
+typedef enum {
+ atUnknown = 0, atInteger, atFloat, atPoint, atString
+} ARGTYPE;
+
+#undef _nc_varargs
+char *_nc_varargs(
+ const char *fmt,
+ va_list ap)
+ { return(*(char **)0); }
+
+/* ./base/memmove.c */
+
+#undef _nc_memmove
+void _nc_memmove(void)
+ { /* void */ }
+
+/* ./base/vsscanf.c */
+
+#undef _nc_vsscanf
+void _nc_vsscanf(void)
+ { /* void */ }
+
+/* ./base/lib_freeall.c */
+
+#undef _nc_freeall
+void _nc_freeall(void)
+ { /* void */ }
+
+#undef _nc_free_and_exit_sp
+void _nc_free_and_exit_sp(
+ SCREEN *sp,
+ int code)
+ { /* void */ }
+
+#undef _nc_free_and_exit
+void _nc_free_and_exit(
+ int code)
+ { /* void */ }
+
+/* ./widechar/charable.c */
+
+#undef _nc_is_charable
+NCURSES_BOOL _nc_is_charable(
+ wchar_t ch)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef _nc_to_char
+int _nc_to_char(
+ wint_t ch)
+ { return(*(int *)0); }
+
+#undef _nc_to_widechar
+wint_t _nc_to_widechar(
+ int ch)
+ { return(*(wint_t *)0); }
+
+/* ./widechar/lib_add_wch.c */
+
+#undef wadd_wch
+int wadd_wch(
+ WINDOW *win,
+ const cchar_t *wch)
+ { return(*(int *)0); }
+
+#undef wecho_wchar
+int wecho_wchar(
+ WINDOW *win,
+ const cchar_t *wch)
+ { return(*(int *)0); }
+
+/* ./widechar/lib_box_set.c */
+
+#undef wborder_set
+int wborder_set(
+ WINDOW *win,
+ const cchar_t *ls,
+ const cchar_t *rs,
+ const cchar_t *ts,
+ const cchar_t *bs,
+ const cchar_t *tl,
+ const cchar_t *tr,
+ const cchar_t *bl,
+ const cchar_t *br)
+ { return(*(int *)0); }
+
+/* ./widechar/lib_cchar.c */
+
+#undef setcchar
+int setcchar(
+ cchar_t *wcval,
+ const wchar_t *wch,
+ const attr_t attrs,
+ short color_pair,
+ const void *opts)
+ { return(*(int *)0); }
+
+#undef getcchar
+int getcchar(
+ const cchar_t *wcval,
+ wchar_t *wch,
+ attr_t *attrs,
+ short *color_pair,
+ void *opts)
+ { return(*(int *)0); }
+
+/* ./widechar/lib_erasewchar.c */
+
+#undef erasewchar
+int erasewchar(
+ wchar_t *wch)
+ { return(*(int *)0); }
+
+#undef killwchar
+int killwchar(
+ wchar_t *wch)
+ { return(*(int *)0); }
+
+/* ./widechar/lib_get_wch.c */
+
+#undef wget_wch
+int wget_wch(
+ WINDOW *win,
+ wint_t *result)
+ { return(*(int *)0); }
+
+/* ./widechar/lib_get_wstr.c */
+
+#undef wgetn_wstr
+int wgetn_wstr(
+ WINDOW *win,
+ wint_t *str,
+ int maxlen)
+ { return(*(int *)0); }
+
+/* ./widechar/lib_hline_set.c */
+
+#undef whline_set
+int whline_set(
+ WINDOW *win,
+ const cchar_t *ch,
+ int n)
+ { return(*(int *)0); }
+
+/* ./widechar/lib_in_wch.c */
+
+#undef win_wch
+int win_wch(
+ WINDOW *win,
+ cchar_t *wcval)
+ { return(*(int *)0); }
+
+/* ./widechar/lib_in_wchnstr.c */
+
+#undef win_wchnstr
+int win_wchnstr(
+ WINDOW *win,
+ cchar_t *wchstr,
+ int n)
+ { return(*(int *)0); }
+
+/* ./widechar/lib_ins_wch.c */
+
+#undef _nc_insert_wch
+int _nc_insert_wch(
+ WINDOW *win,
+ const cchar_t *wch)
+ { return(*(int *)0); }
+
+#undef wins_wch
+int wins_wch(
+ WINDOW *win,
+ const cchar_t *wch)
+ { return(*(int *)0); }
+
+#undef wins_nwstr
+int wins_nwstr(
+ WINDOW *win,
+ const wchar_t *wstr,
+ int n)
+ { return(*(int *)0); }
+
+/* ./widechar/lib_inwstr.c */
+
+#undef winnwstr
+int winnwstr(
+ WINDOW *win,
+ wchar_t *wstr,
+ int n)
+ { return(*(int *)0); }
+
+#undef winwstr
+int winwstr(
+ WINDOW *win,
+ wchar_t *wstr)
+ { return(*(int *)0); }
+
+/* ./widechar/lib_key_name.c */
+
+#undef key_name
+char *key_name(
+ wchar_t c)
+ { return(*(char **)0); }
+
+/* ./widechar/lib_pecho_wchar.c */
+
+#undef pecho_wchar
+int pecho_wchar(
+ WINDOW *pad,
+ const cchar_t *wch)
+ { return(*(int *)0); }
+
+/* ./widechar/lib_slk_wset.c */
+
+#undef slk_wset
+int slk_wset(
+ int i,
+ const wchar_t *astr,
+ int format)
+ { return(*(int *)0); }
+
+/* ./widechar/lib_unget_wch.c */
+
+#undef _nc_wcrtomb
+size_t _nc_wcrtomb(
+ char *target,
+ wchar_t source,
+ mbstate_t *state)
+ { return(*(size_t *)0); }
+
+#undef unget_wch_sp
+int unget_wch_sp(
+ SCREEN *sp,
+ const wchar_t wch)
+ { return(*(int *)0); }
+
+#undef unget_wch
+int unget_wch(
+ const wchar_t wch)
+ { return(*(int *)0); }
+
+/* ./widechar/lib_vid_attr.c */
+
+#undef vid_puts_sp
+int vid_puts_sp(
+ SCREEN *sp,
+ attr_t newmode,
+ short pair,
+ void *opts,
+ NCURSES_OUTC_sp outc)
+ { return(*(int *)0); }
+
+#undef vid_puts
+int vid_puts(
+ attr_t newmode,
+ short pair,
+ void *opts,
+ NCURSES_OUTC outc)
+ { return(*(int *)0); }
+
+#undef vid_attr_sp
+int vid_attr_sp(
+ SCREEN *sp,
+ attr_t newmode,
+ short pair,
+ void *opts)
+ { return(*(int *)0); }
+
+#undef vid_attr
+int vid_attr(
+ attr_t newmode,
+ short pair,
+ void *opts)
+ { return(*(int *)0); }
+
+#undef term_attrs_sp
+attr_t term_attrs_sp(
+ SCREEN *sp)
+ { return(*(attr_t *)0); }
+
+#undef term_attrs
+attr_t term_attrs(void)
+ { return(*(attr_t *)0); }
+
+/* ./widechar/lib_vline_set.c */
+
+#undef wvline_set
+int wvline_set(
+ WINDOW *win,
+ const cchar_t *ch,
+ int n)
+ { return(*(int *)0); }
+
+/* ./widechar/lib_wacs.c */
+
+#undef _nc_wacs
+cchar_t *_nc_wacs;
+
+#undef _nc_init_wacs
+void _nc_init_wacs(void)
+ { /* void */ }
+
+/* ./widechar/lib_wunctrl.c */
+
+#undef wunctrl_sp
+wchar_t *wunctrl_sp(
+ SCREEN *sp,
+ cchar_t *wc)
+ { return(*(wchar_t **)0); }
+
+#undef wunctrl
+wchar_t *wunctrl(
+ cchar_t *wc)
+ { return(*(wchar_t **)0); }
+
+/* ./expanded.c */
+
+#undef _nc_toggle_attr_on
+void _nc_toggle_attr_on(
+ attr_t *S,
+ attr_t at)
+ { /* void */ }
+
+#undef _nc_toggle_attr_off
+void _nc_toggle_attr_off(
+ attr_t *S,
+ attr_t at)
+ { /* void */ }
+
+#undef _nc_DelCharCost_sp
+int _nc_DelCharCost_sp(
+ SCREEN *sp,
+ int count)
+ { return(*(int *)0); }
+
+#undef _nc_InsCharCost_sp
+int _nc_InsCharCost_sp(
+ SCREEN *sp,
+ int count)
+ { return(*(int *)0); }
+
+#undef _nc_UpdateAttrs_sp
+void _nc_UpdateAttrs_sp(
+ SCREEN *sp,
+ const cchar_t *c)
+ { /* void */ }
+
+#undef _nc_DelCharCost
+int _nc_DelCharCost(
+ int count)
+ { return(*(int *)0); }
+
+#undef _nc_InsCharCost
+int _nc_InsCharCost(
+ int count)
+ { return(*(int *)0); }
+
+#undef _nc_UpdateAttrs
+void _nc_UpdateAttrs(
+ const cchar_t *c)
+ { /* void */ }
+
+/* ./base/legacy_coding.c */
+
+#undef use_legacy_coding_sp
+int use_legacy_coding_sp(
+ SCREEN *sp,
+ int level)
+ { return(*(int *)0); }
+
+#undef use_legacy_coding
+int use_legacy_coding(
+ int level)
+ { return(*(int *)0); }
+
+/* ./base/lib_dft_fgbg.c */
+
+#undef use_default_colors_sp
+int use_default_colors_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef use_default_colors
+int use_default_colors(void)
+ { return(*(int *)0); }
+
+#undef assume_default_colors_sp
+int assume_default_colors_sp(
+ SCREEN *sp,
+ int fg,
+ int bg)
+ { return(*(int *)0); }
+
+#undef assume_default_colors
+int assume_default_colors(
+ int fg,
+ int bg)
+ { return(*(int *)0); }
+
+/* ./tinfo/lib_print.c */
+
+#undef mcprint_sp
+int mcprint_sp(
+ SCREEN *sp,
+ char *data,
+ int len)
+ { return(*(int *)0); }
+
+#undef mcprint
+int mcprint(
+ char *data,
+ int len)
+ { return(*(int *)0); }
+
+/* ./base/resizeterm.c */
+
+#undef is_term_resized_sp
+NCURSES_BOOL is_term_resized_sp(
+ SCREEN *sp,
+ int ToLines,
+ int ToCols)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef is_term_resized
+NCURSES_BOOL is_term_resized(
+ int ToLines,
+ int ToCols)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef resize_term_sp
+int resize_term_sp(
+ SCREEN *sp,
+ int ToLines,
+ int ToCols)
+ { return(*(int *)0); }
+
+#undef resize_term
+int resize_term(
+ int ToLines,
+ int ToCols)
+ { return(*(int *)0); }
+
+#undef resizeterm_sp
+int resizeterm_sp(
+ SCREEN *sp,
+ int ToLines,
+ int ToCols)
+ { return(*(int *)0); }
+
+#undef resizeterm
+int resizeterm(
+ int ToLines,
+ int ToCols)
+ { return(*(int *)0); }
+
+/* ./trace/trace_xnames.c */
+
+#undef _nc_trace_xnames
+void _nc_trace_xnames(
+ TERMTYPE *tp)
+ { /* void */ }
+
+/* ./tinfo/use_screen.c */
+
+#undef use_screen
+int use_screen(
+ SCREEN *screen,
+ NCURSES_SCREEN_CB func,
+ void *data)
+ { return(*(int *)0); }
+
+/* ./base/use_window.c */
+
+#undef use_window
+int use_window(
+ WINDOW *win,
+ NCURSES_WINDOW_CB func,
+ void *data)
+ { return(*(int *)0); }
+
+/* ./base/wresize.c */
+
+#undef wresize
+int wresize(
+ WINDOW *win,
+ int ToLines,
+ int ToCols)
+ { return(*(int *)0); }
+
+/* ./tinfo/access.c */
+
+#undef _nc_rootname
+char *_nc_rootname(
+ char *path)
+ { return(*(char **)0); }
+
+#undef _nc_is_abs_path
+NCURSES_BOOL _nc_is_abs_path(
+ const char *path)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef _nc_pathlast
+unsigned _nc_pathlast(
+ const char *path)
+ { return(*(unsigned *)0); }
+
+#undef _nc_basename
+char *_nc_basename(
+ char *path)
+ { return(*(char **)0); }
+
+#undef _nc_access
+int _nc_access(
+ const char *path,
+ int mode)
+ { return(*(int *)0); }
+
+#undef _nc_is_dir_path
+NCURSES_BOOL _nc_is_dir_path(
+ const char *path)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef _nc_is_file_path
+NCURSES_BOOL _nc_is_file_path(
+ const char *path)
+ { return(*(NCURSES_BOOL *)0); }
+
+#undef _nc_env_access
+int _nc_env_access(void)
+ { return(*(int *)0); }
+
+/* ./tinfo/add_tries.c */
+
+#undef _nc_add_to_try
+int _nc_add_to_try(
+ TRIES **tree,
+ const char *str,
+ unsigned code)
+ { return(*(int *)0); }
+
+/* ./tinfo/alloc_ttype.c */
+
+#undef _nc_align_termtype
+void _nc_align_termtype(
+ TERMTYPE *to,
+ TERMTYPE *from)
+ { /* void */ }
+
+#undef _nc_copy_termtype
+void _nc_copy_termtype(
+ TERMTYPE *dst,
+ TERMTYPE *src)
+ { /* void */ }
+
+/* ./codes.c */
+
+#undef _nc_boolcodes
+char *const *_nc_boolcodes(void)
+ { return(*(char **)0); }
+
+#undef _nc_numcodes
+char *const *_nc_numcodes(void)
+ { return(*(char **)0); }
+
+#undef _nc_strcodes
+char *const *_nc_strcodes(void)
+ { return(*(char **)0); }
+
+/* ./comp_captab.c */
+
+#include <hashsize.h>
+
+#undef _nc_get_table
+const struct name_table_entry *_nc_get_table(
+ NCURSES_BOOL termcap)
+ { return(*(const struct name_table_entry **)0); }
+
+#undef _nc_get_hash_table
+const HashValue *_nc_get_hash_table(
+ NCURSES_BOOL termcap)
+ { return(*(const HashValue **)0); }
+
+#undef _nc_get_alias_table
+const struct alias *_nc_get_alias_table(
+ NCURSES_BOOL termcap)
+ { return(*(const struct alias **)0); }
+
+#undef _nc_get_hash_info
+const HashData *_nc_get_hash_info(
+ NCURSES_BOOL termcap)
+ { return(*(const HashData **)0); }
+
+/* ./tinfo/comp_error.c */
+
+#undef _nc_suppress_warnings
+NCURSES_BOOL _nc_suppress_warnings;
+#undef _nc_curr_line
+int _nc_curr_line;
+#undef _nc_curr_col
+int _nc_curr_col;
+
+#undef _nc_get_source
+const char *_nc_get_source(void)
+ { return(*(const char **)0); }
+
+#undef _nc_set_source
+void _nc_set_source(
+ const char *const name)
+ { /* void */ }
+
+#undef _nc_set_type
+void _nc_set_type(
+ const char *const name)
+ { /* void */ }
+
+#undef _nc_get_type
+void _nc_get_type(
+ char *name)
+ { /* void */ }
+
+#undef _nc_warning
+void _nc_warning(
+ const char *const fmt,
+ ...)
+ { /* void */ }
+
+#undef _nc_err_abort
+void _nc_err_abort(
+ const char *const fmt,
+ ...)
+ { /* void */ }
+
+#undef _nc_syserr_abort
+void _nc_syserr_abort(
+ const char *const fmt,
+ ...)
+ { /* void */ }
+
+/* ./tinfo/comp_hash.c */
+
+#undef _nc_find_entry
+struct name_table_entry const *_nc_find_entry(
+ const char *string,
+ const HashValue *hash_table)
+ { return(*(struct name_table_entry const **)0); }
+
+#undef _nc_find_type_entry
+struct name_table_entry const *_nc_find_type_entry(
+ const char *string,
+ int type,
+ NCURSES_BOOL termcap)
+ { return(*(struct name_table_entry const **)0); }
+
+/* ./tinfo/db_iterator.c */
+
+#undef _nc_tic_dir
+const char *_nc_tic_dir(
+ const char *path)
+ { return(*(const char **)0); }
+
+#undef _nc_keep_tic_dir
+void _nc_keep_tic_dir(
+ const char *path)
+ { /* void */ }
+
+#undef _nc_last_db
+void _nc_last_db(void)
+ { /* void */ }
+
+#undef _nc_next_db
+const char *_nc_next_db(
+ DBDIRS *state,
+ int *offset)
+ { return(*(const char **)0); }
+
+#undef _nc_first_db
+void _nc_first_db(
+ DBDIRS *state,
+ int *offset)
+ { /* void */ }
+
+/* ./tinfo/doalloc.c */
+
+#undef _nc_doalloc
+void *_nc_doalloc(
+ void *oldp,
+ size_t amount)
+ { return(*(void **)0); }
+
+/* ./tinfo/entries.c */
+
+#undef _nc_head
+ENTRY *_nc_head;
+#undef _nc_tail
+ENTRY *_nc_tail;
+
+#undef _nc_free_entry
+void _nc_free_entry(
+ ENTRY *headp,
+ TERMTYPE *tterm)
+ { /* void */ }
+
+#undef _nc_free_entries
+void _nc_free_entries(
+ ENTRY *headp)
+ { /* void */ }
+
+#undef _nc_delink_entry
+ENTRY *_nc_delink_entry(
+ ENTRY *headp,
+ TERMTYPE *tterm)
+ { return(*(ENTRY **)0); }
+
+#undef _nc_leaks_tinfo
+void _nc_leaks_tinfo(void)
+ { /* void */ }
+
+/* ./fallback.c */
+
+#undef _nc_fallback
+const TERMTYPE *_nc_fallback(
+ const char *name)
+ { return(*(const TERMTYPE **)0); }
+
+/* ./tinfo/free_ttype.c */
+
+#undef _nc_free_termtype
+void _nc_free_termtype(
+ TERMTYPE *ptr)
+ { /* void */ }
+
+#undef _nc_user_definable
+NCURSES_BOOL _nc_user_definable;
+
+#undef use_extended_names
+int use_extended_names(
+ NCURSES_BOOL flag)
+ { return(*(int *)0); }
+
+/* ./tinfo/getenv_num.c */
+
+#undef _nc_getenv_num
+int _nc_getenv_num(
+ const char *name)
+ { return(*(int *)0); }
+
+/* ./tinfo/home_terminfo.c */
+
+#undef _nc_home_terminfo
+char *_nc_home_terminfo(void)
+ { return(*(char **)0); }
+
+/* ./tinfo/init_keytry.c */
+
+#if 0
+
+#include <init_keytry.h>
+
+#undef _nc_tinfo_fkeys
+const struct tinfo_fkeys _nc_tinfo_fkeys[] = {0};
+
+#endif
+
+#undef _nc_init_keytry
+void _nc_init_keytry(
+ SCREEN *sp)
+ { /* void */ }
+
+/* ./tinfo/lib_acs.c */
+
+#undef _nc_acs_map
+chtype *_nc_acs_map(void)
+ { return(*(chtype **)0); }
+
+#undef _nc_init_acs_sp
+void _nc_init_acs_sp(
+ SCREEN *sp)
+ { /* void */ }
+
+#undef _nc_init_acs
+void _nc_init_acs(void)
+ { /* void */ }
+
+/* ./tinfo/lib_baudrate.c */
+
+#include <termcap.h>
+
+struct speed {
+ int s;
+ int sp;
+};
+
+#undef _nc_baudrate
+int _nc_baudrate(
+ int OSpeed)
+ { return(*(int *)0); }
+
+#undef _nc_ospeed
+int _nc_ospeed(
+ int BaudRate)
+ { return(*(int *)0); }
+
+#undef baudrate_sp
+int baudrate_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef baudrate
+int baudrate(void)
+ { return(*(int *)0); }
+
+/* ./tinfo/lib_cur_term.c */
+
+#undef _nc_get_cur_term_sp
+TERMINAL *_nc_get_cur_term_sp(
+ SCREEN *sp)
+ { return(*(TERMINAL **)0); }
+
+#undef _nc_get_cur_term
+TERMINAL *_nc_get_cur_term(void)
+ { return(*(TERMINAL **)0); }
+
+#undef _nc_cur_term
+TERMINAL *_nc_cur_term(void)
+ { return(*(TERMINAL **)0); }
+
+#undef set_curterm_sp
+TERMINAL *set_curterm_sp(
+ SCREEN *sp,
+ TERMINAL *termp)
+ { return(*(TERMINAL **)0); }
+
+#undef set_curterm
+TERMINAL *set_curterm(
+ TERMINAL *termp)
+ { return(*(TERMINAL **)0); }
+
+#undef del_curterm_sp
+int del_curterm_sp(
+ SCREEN *sp,
+ TERMINAL *termp)
+ { return(*(int *)0); }
+
+#undef del_curterm
+int del_curterm(
+ TERMINAL *termp)
+ { return(*(int *)0); }
+
+/* ./tinfo/lib_data.c */
+
+#undef _nc_stdscr
+WINDOW *_nc_stdscr(void)
+ { return(*(WINDOW **)0); }