aboutsummaryrefslogtreecommitdiff
path: root/ncurses
diff options
context:
space:
mode:
Diffstat (limited to 'ncurses')
-rw-r--r--ncurses/Makefile.in50
-rw-r--r--ncurses/README.IZ6
-rwxr-xr-xncurses/base/MKlib_gen.sh23
-rw-r--r--ncurses/base/MKunctrl.awk7
-rw-r--r--ncurses/base/key_defined.c7
-rw-r--r--ncurses/base/keyok.c6
-rw-r--r--ncurses/base/lib_addch.c35
-rw-r--r--ncurses/base/lib_addstr.c32
-rw-r--r--ncurses/base/lib_bkgd.c4
-rw-r--r--ncurses/base/lib_clreol.c8
-rw-r--r--ncurses/base/lib_color.c82
-rw-r--r--ncurses/base/lib_delwin.c38
-rw-r--r--ncurses/base/lib_dft_fgbg.c8
-rw-r--r--ncurses/base/lib_echo.c8
-rw-r--r--ncurses/base/lib_endwin.c28
-rw-r--r--ncurses/base/lib_erase.c6
-rw-r--r--ncurses/base/lib_freeall.c11
-rw-r--r--ncurses/base/lib_getch.c63
-rw-r--r--ncurses/base/lib_getstr.c35
-rw-r--r--ncurses/base/lib_insnstr.c9
-rw-r--r--ncurses/base/lib_instr.c8
-rw-r--r--ncurses/base/lib_mouse.c153
-rw-r--r--ncurses/base/lib_mvwin.c8
-rw-r--r--ncurses/base/lib_newterm.c7
-rw-r--r--ncurses/base/lib_newwin.c8
-rw-r--r--ncurses/base/lib_nl.c8
-rw-r--r--ncurses/base/lib_overlay.c16
-rw-r--r--ncurses/base/lib_pad.c12
-rw-r--r--ncurses/base/lib_refresh.c24
-rw-r--r--ncurses/base/lib_restart.c17
-rw-r--r--ncurses/base/lib_screen.c61
-rw-r--r--ncurses/base/lib_set_term.c51
-rw-r--r--ncurses/base/lib_slk.c8
-rw-r--r--ncurses/base/lib_slkinit.c7
-rw-r--r--ncurses/base/lib_slkrefr.c6
-rw-r--r--ncurses/base/lib_wattron.c8
-rw-r--r--ncurses/base/lib_window.c10
-rw-r--r--ncurses/base/new_pair.c6
-rw-r--r--ncurses/base/resizeterm.c14
-rw-r--r--ncurses/base/safe_sprintf.c36
-rw-r--r--ncurses/base/tries.c7
-rw-r--r--ncurses/base/vsscanf.c11
-rw-r--r--ncurses/base/wresize.c10
-rw-r--r--ncurses/curses.priv.h507
-rw-r--r--ncurses/llib-lncurses1420
-rw-r--r--ncurses/llib-lncursest1422
-rw-r--r--ncurses/llib-lncursestw1888
-rw-r--r--ncurses/llib-lncursesw1886
-rw-r--r--ncurses/llib-ltic54
-rw-r--r--ncurses/llib-ltict54
-rw-r--r--ncurses/llib-ltictw52
-rw-r--r--ncurses/llib-lticw52
-rw-r--r--ncurses/llib-ltinfo372
-rw-r--r--ncurses/llib-ltinfot374
-rw-r--r--ncurses/llib-ltinfotw370
-rw-r--r--ncurses/llib-ltinfow368
-rw-r--r--ncurses/new_pair.h13
-rw-r--r--ncurses/report_offsets.c59
-rw-r--r--ncurses/term.priv.h364
-rwxr-xr-xncurses/tinfo/MKcaptab.sh5
-rwxr-xr-xncurses/tinfo/MKfallback.sh7
-rwxr-xr-xncurses/tinfo/MKkeys_list.sh10
-rw-r--r--ncurses/tinfo/access.c125
-rw-r--r--ncurses/tinfo/add_tries.c7
-rw-r--r--ncurses/tinfo/alloc_entry.c202
-rw-r--r--ncurses/tinfo/alloc_ttype.c122
-rw-r--r--ncurses/tinfo/captoinfo.c16
-rw-r--r--ncurses/tinfo/comp_error.c23
-rw-r--r--ncurses/tinfo/comp_expand.c16
-rw-r--r--ncurses/tinfo/comp_hash.c21
-rw-r--r--ncurses/tinfo/comp_parse.c140
-rw-r--r--ncurses/tinfo/comp_scan.c82
-rw-r--r--ncurses/tinfo/db_iterator.c24
-rw-r--r--ncurses/tinfo/doalloc.c11
-rw-r--r--ncurses/tinfo/entries.c28
-rw-r--r--ncurses/tinfo/free_ttype.c18
-rw-r--r--ncurses/tinfo/init_keytry.c8
-rw-r--r--ncurses/tinfo/lib_cur_term.c17
-rw-r--r--ncurses/tinfo/lib_data.c28
-rw-r--r--ncurses/tinfo/lib_kernel.c48
-rw-r--r--ncurses/tinfo/lib_longname.c7
-rw-r--r--ncurses/tinfo/lib_napms.c7
-rw-r--r--ncurses/tinfo/lib_options.c6
-rw-r--r--ncurses/tinfo/lib_print.c9
-rw-r--r--ncurses/tinfo/lib_raw.c60
-rw-r--r--ncurses/tinfo/lib_setup.c278
-rw-r--r--ncurses/tinfo/lib_termcap.c6
-rw-r--r--ncurses/tinfo/lib_tgoto.c16
-rw-r--r--ncurses/tinfo/lib_tparm.c679
-rw-r--r--ncurses/tinfo/lib_tputs.c52
-rw-r--r--ncurses/tinfo/lib_win32con.c1238
-rw-r--r--ncurses/tinfo/lib_win32util.c28
-rw-r--r--ncurses/tinfo/make_hash.c6
-rw-r--r--ncurses/tinfo/make_keys.c12
-rw-r--r--ncurses/tinfo/obsolete.c99
-rw-r--r--ncurses/tinfo/parse_entry.c78
-rw-r--r--ncurses/tinfo/read_entry.c110
-rw-r--r--ncurses/tinfo/read_termcap.c36
-rw-r--r--ncurses/tinfo/strings.c6
-rw-r--r--ncurses/tinfo/tinfo_driver.c19
-rw-r--r--ncurses/tinfo/trim_sgr0.c14
-rw-r--r--ncurses/tinfo/write_entry.c118
-rw-r--r--ncurses/trace/lib_trace.c99
-rw-r--r--ncurses/trace/lib_traceatr.c26
-rw-r--r--ncurses/trace/lib_tracechr.c16
-rw-r--r--ncurses/trace/lib_tracedmp.c8
-rw-r--r--ncurses/trace/trace_buf.c10
-rw-r--r--ncurses/trace/varargs.c12
-rw-r--r--ncurses/trace/visbuf.c12
-rwxr-xr-xncurses/tty/MKexpanded.sh9
-rw-r--r--ncurses/tty/hardscroll.c43
-rw-r--r--ncurses/tty/hashmap.c11
-rw-r--r--ncurses/tty/lib_mvcur.c59
-rw-r--r--ncurses/tty/lib_tstp.c24
-rw-r--r--ncurses/tty/lib_twait.c25
-rw-r--r--ncurses/tty/lib_vidattr.c6
-rw-r--r--ncurses/tty/tty_update.c41
-rw-r--r--ncurses/wcwidth.h18
-rw-r--r--ncurses/widechar/lib_add_wch.c18
-rw-r--r--ncurses/widechar/lib_cchar.c14
-rw-r--r--ncurses/widechar/lib_erasewchar.c34
-rw-r--r--ncurses/widechar/lib_get_wch.c6
-rw-r--r--ncurses/widechar/lib_get_wstr.c53
-rw-r--r--ncurses/widechar/lib_ins_wch.c13
-rw-r--r--ncurses/widechar/lib_key_name.c19
-rw-r--r--ncurses/widechar/lib_pecho_wchar.c6
-rw-r--r--ncurses/widechar/lib_unget_wch.c6
-rw-r--r--ncurses/widechar/lib_vid_attr.c6
-rw-r--r--ncurses/win32con/gettimeofday.c6
-rw-r--r--ncurses/win32con/win32_driver.c12
-rw-r--r--ncurses/win32con/win_driver.c97
131 files changed, 8647 insertions, 6121 deletions
diff --git a/ncurses/Makefile.in b/ncurses/Makefile.in
index 8f2254d3a0d4..ae198df675a4 100644
--- a/ncurses/Makefile.in
+++ b/ncurses/Makefile.in
@@ -1,6 +1,6 @@
-# $Id: Makefile.in,v 1.178 2021/01/23 20:34:00 tom Exp $
+# $Id: Makefile.in,v 1.184 2024/01/19 12:00:00 tom Exp $
##############################################################################
-# Copyright 2018-2020,2021 Thomas E. Dickey #
+# Copyright 2018-2022,2024 Thomas E. Dickey #
# Copyright 1998-2017,2018 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
@@ -193,10 +193,11 @@ HEADER_DEPS = @INTERNALS_HDR@ \
$(INCDIR)/nc_win32.h \
$(INCDIR)/term_entry.h \
$(srcdir)/curses.priv.h \
- $(srcdir)/new_pair.h
+ $(srcdir)/new_pair.h \
+ $(srcdir)/term.priv.h
TEST_DEPS = ../lib/@LIB_PREFIX@ncurses@DFT_DEP_SUFFIX@
-TEST_ARGS = @LDFLAGS_STATIC@ @TEST_ARGS@ @LDFLAGS_SHARED@
+TEST_ARGS = @LDFLAGS_STATIC@ @TEST_ARGS@ @LDFLAGS_SHARED@
TEST_LDFLAGS = @LD_MODEL@ $(TEST_ARGS) @LIBS@ @LOCAL_LDFLAGS@ @LDFLAGS@
TEST_PROGS = \
@@ -217,9 +218,20 @@ wide = $(srcdir)/widechar
win32con = $(srcdir)/win32con
################################################################################
+
+@MAKE_PHONY@.PHONY : all
+@MAKE_PHONY@.PHONY : check
+@MAKE_PHONY@.PHONY : clean
+@MAKE_PHONY@.PHONY : distclean
+@MAKE_PHONY@.PHONY : libs
+@MAKE_PHONY@.PHONY : mostlyclean
+@MAKE_PHONY@.PHONY : realclean
+@MAKE_PHONY@.PHONY : sources
+@MAKE_PHONY@.PHONY : test_progs
+
all libs :: $(AUTO_SRC) ../lib $(LIBRARIES)
-@CHECK_BUILD@all libs :: report_offsets$(BUILD_EXEEXT)
+@CHECK_BUILD@all libs :: report_offsets$(BUILD_EXEEXT)
sources: $(AUTO_SRC)
@@ -233,13 +245,13 @@ $(DESTDIR)$(libdir) :
$(SHELL) -e $(tinfo)/MKfallback.sh $(TERMINFO) $(TERMINFO_SRC) "$(TIC_PATH)" "$(INFOCMP_PATH)" $(FALLBACK_LIST) >$@
./lib_gen.c : $(base)/MKlib_gen.sh ../include/curses.h
- $(SHELL) -e $(base)/MKlib_gen.sh "$(CPP) $(CPPFLAGS)" "$(AWK)" generated <../include/curses.h >$@
+ FGREP="@FGREP@" $(SHELL) -e $(base)/MKlib_gen.sh "$(CPP) $(CPPFLAGS)" "$(AWK)" generated <../include/curses.h >$@
-init_keytry.h: make_keys$(BUILD_EXEEXT) keys.list
+init_keytry.h : make_keys$(BUILD_EXEEXT) keys.list
./make_keys$(BUILD_EXEEXT) keys.list > $@
keys.list : $(tinfo)/MKkeys_list.sh
- AWK=$(AWK) $(SHELL) $(tinfo)/MKkeys_list.sh $(CAPLIST) | LC_ALL=C sort >$@
+ AWK=$(AWK) USE_SIGWINCH=@cf_cv_enable_sigwinch@ $(SHELL) $(tinfo)/MKkeys_list.sh $(CAPLIST) | LC_ALL=C sort >$@
make_keys$(BUILD_EXEEXT) : \
build.priv.h \
@@ -276,7 +288,7 @@ report_offsets$(BUILD_EXEEXT) : \
$(SHELL) -e $(tinfo)/MKuserdefs.sh $(AWK) $(USE_BIG_STRINGS) $(CAPLIST) > $@
./lib_keyname.c: keys.list $(base)/MKkeyname.awk
- $(AWK) -f $(base)/MKkeyname.awk bigstrings=$(USE_BIG_STRINGS) keys.list > $@
+ $(AWK) -f $(base)/MKkeyname.awk use_sigwinch=@cf_cv_enable_sigwinch@ bigstrings=$(USE_BIG_STRINGS) keys.list > $@
./codes.c: $(tinfo)/MKcodes.awk
$(AWK) -f $(tinfo)/MKcodes.awk bigstrings=$(USE_BIG_STRINGS) $(CAPLIST) >$@
@@ -317,10 +329,11 @@ realclean :: distclean
( cd ../include && $(MAKE) $(TOP_MFLAGS) )
# These rules build test-programs for the modules that have test-drivers
+@MAKE_PHONY@.PHONY : test_progs
test_progs : $(TEST_PROGS)
./link_test.c : $(base)/MKlib_gen.sh ../include/curses.h
- $(SHELL) -e $(base)/MKlib_gen.sh "$(CPP) $(CPPFLAGS)" "$(AWK)" implemented <../include/curses.h >$@
+ FGREP="@FGREP@" $(SHELL) -e $(base)/MKlib_gen.sh "$(CPP) $(CPPFLAGS)" "$(AWK)" implemented <../include/curses.h >$@
captoinfo$x : $(tinfo)/captoinfo.c $(TEST_DEPS)
@ECHO_LD@ $(LIBTOOL_LINK) -o $@ $(CFLAGS_DEFAULT) -DMAIN $(tinfo)/captoinfo.c $(TEST_LDFLAGS)
@@ -347,6 +360,23 @@ report_hashing$x : \
$(srcdir)/report_hashing.c $(TEST_DEPS)
@ECHO_LD@ $(CC) -o $@ $(CFLAGS_DEFAULT) report_hashing.c $(TEST_LDFLAGS)
+# Verify that each header-file can be compiled without including another.
+@MAKE_PHONY@.PHONY : check_headers
+check_headers:
+ @$(SHELL) -c "for header in *.h;\
+ do \
+ echo \"** testing \$${header}\" ; \
+ echo \"#include <\$${header}>\" >headers.c; \
+ echo \"int main(void) { return 0; }\" >>headers.c; \
+ $(CC) -c $(CFLAGS) $(CPPFLAGS) headers.c; \
+ done"
+ -@rm -f headers.*
+
+@MAKE_PHONY@.PHONY : check_objects
+check_objects: test_progs
+
+check :: check_headers check_objects
+
###############################################################################
# The remainder of this file is automatically generated during configuration
###############################################################################
diff --git a/ncurses/README.IZ b/ncurses/README.IZ
index 25058a98ac89..a9e52ea5baff 100644
--- a/ncurses/README.IZ
+++ b/ncurses/README.IZ
@@ -1,5 +1,5 @@
-------------------------------------------------------------------------------
--- Copyright 2020 Thomas E. Dickey --
+-- Copyright 2020,2021 Thomas E. Dickey --
-- Copyright 2002,2006 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
@@ -26,7 +26,7 @@
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: README.IZ,v 1.4 2020/02/02 23:34:34 tom Exp $
+-- $Id: README.IZ,v 1.5 2021/06/17 21:20:30 tom Exp $
---------------------------------------------------------------------
Here is the patch. I did no testing whatsoever with event watching
@@ -35,7 +35,7 @@ this, probably lynx ;-), but the code looks working "the normal way".
I had no way to test that the poll() branch compiles/works...
-Here is the API:
+Here is the API:
*) two new functions wgetch_events() wgetstrn_event() are introduced,
which allow an event-watch specification given as the last argument;
diff --git a/ncurses/base/MKlib_gen.sh b/ncurses/base/MKlib_gen.sh
index 3829eff8eecb..f0ac0452e8ef 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.68 2020/08/23 00:02:29 tom Exp $)
+# ($Id: MKlib_gen.sh,v 1.73 2022/10/01 13:14:20 tom Exp $)
#
##############################################################################
-# Copyright 2018,2020 Thomas E. Dickey #
+# Copyright 2018-2021,2022 Thomas E. Dickey #
# Copyright 1998-2016,2017 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
@@ -69,12 +69,21 @@ USE="$3"
# A patch discussed here:
# https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02185.html
+#
# introduces spurious #line markers into the preprocessor output. The result
# appears in gcc 5.0 and (with modification) in 5.1, making it necessary to
# determine if we are using gcc, and if so, what version because the proposed
# solution uses a nonstandard option.
+#
+# As illustrated in
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60723
+#
+# gcc developers chose to ignore the problems with this, and summarized those
+# as "intriguing problems" in
+# https://gcc.gnu.org/gcc-5/porting_to.html
+
PRG=`echo "$1" | "$AWK" '{ sub(/^[ ]*/,""); sub(/[ ].*$/, ""); print; }' || exit 0`
-FSF=`("$PRG" --version 2>/dev/null || exit 0) | fgrep "Free Software Foundation" | head -n 1`
+FSF=`("$PRG" --version 2>/dev/null || exit 0) | ${FGREP-grep -F} "Free Software Foundation" | head -n 1`
ALL=`"$PRG" -dumpversion 2>/dev/null || exit 0`
ONE=`echo "$ALL" | sed -e 's/[^0-9].*$//'`
if test -n "$FSF" && test -n "$ALL" && test -n "$ONE" ; then
@@ -92,7 +101,8 @@ ED4=sed4_${PID}.sed
AW1=awk1_${PID}.awk
AW2=awk2_${PID}.awk
TMP=gen__${PID}.c
-trap "rm -f $ED1 $ED2 $ED3 $ED4 $AW1 $AW2 $TMP" 0 1 2 3 15
+trap "rm -f $ED1 $ED2 $ED3 $ED4 $AW1 $AW2 $TMP; exit 1" 1 2 3 15
+trap "rm -f $ED1 $ED2 $ED3 $ED4 $AW1 $AW2 $TMP" 0
ALL=$USE
if test "$USE" = implemented ; then
@@ -461,8 +471,9 @@ END {
if ( value !~ /P_POUNDC/ ) {
gsub(/[ \t]+/," ",value);
sub(/^[0-9a-zA-Z_]+ /,"",value);
- sub(/^\* /,"",value);
- gsub(/[0-9a-zA-Z_]+ \* /,"",value);
+ sub(/^[*][ \t]*/,"",value);
+ gsub("struct[ \t]*[0-9a-zA-Z_]+[ \t]*[*]","",value);
+ gsub(/[0-9a-zA-Z_]+[ \t]*[*][ \t]*/,"",value);
gsub(/ (const) /," ",value);
gsub(/ (int|short|attr_t|chtype|wchar_t|NCURSES_BOOL|NCURSES_OUTC|NCURSES_OUTC_sp|va_list) /," ",value);
gsub(/ void /,"",value);
diff --git a/ncurses/base/MKunctrl.awk b/ncurses/base/MKunctrl.awk
index 9a2a6db63876..e5362bd60d15 100644
--- a/ncurses/base/MKunctrl.awk
+++ b/ncurses/base/MKunctrl.awk
@@ -1,6 +1,6 @@
-# $Id: MKunctrl.awk,v 1.29 2020/02/02 23:34:34 tom Exp $
+# $Id: MKunctrl.awk,v 1.30 2024/02/03 21:09:14 tom Exp $
##############################################################################
-# Copyright 2020 Thomas E. Dickey #
+# Copyright 2020,2024 Thomas E. Dickey #
# Copyright 1998-2012,2017 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
@@ -144,7 +144,7 @@ END {
print "\tint check = (int) ChCharOf(ch);"
print "\tconst char *result;"
print ""
- print "(void) sp;"
+ print "\t(void) sp;"
print "\tif (check >= 0 && check < (int)SIZEOF(unctrl_table)) {"
print "#if NCURSES_EXT_FUNCS"
print "\t\tif ((sp != 0)"
@@ -155,6 +155,7 @@ END {
print "\t\telse"
print "\t\tif ((check >= 160)"
print "\t\t && (check < 256)"
+ print "\t\t && !_nc_unicode_locale()"
print "\t\t && ((sp != 0)"
print "\t\t && ((sp->_legacy_coding > 0)"
print "\t\t || (sp->_legacy_coding == 0"
diff --git a/ncurses/base/key_defined.c b/ncurses/base/key_defined.c
index 25d5a674e1b8..147e5fe2db93 100644
--- a/ncurses/base/key_defined.c
+++ b/ncurses/base/key_defined.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2023 Thomas E. Dickey *
* Copyright 2003-2006,2009 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -32,8 +32,9 @@
****************************************************************************/
#include <curses.priv.h>
+#include <tic.h>
-MODULE_ID("$Id: key_defined.c,v 1.10 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: key_defined.c,v 1.11 2023/06/24 15:36:32 tom Exp $")
static int
find_definition(TRIES * tree, const char *str)
@@ -41,7 +42,7 @@ find_definition(TRIES * tree, const char *str)
TRIES *ptr;
int result = OK;
- if (str != 0 && *str != '\0') {
+ if (VALID_STRING(str) && *str != '\0') {
for (ptr = tree; ptr != 0; ptr = ptr->sibling) {
if (UChar(*str) == UChar(ptr->ch)) {
if (str[1] == '\0' && ptr->child != 0) {
diff --git a/ncurses/base/keyok.c b/ncurses/base/keyok.c
index 8e0b9629db20..945228aa8035 100644
--- a/ncurses/base/keyok.c
+++ b/ncurses/base/keyok.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2019-2020,2021 Thomas E. Dickey *
* Copyright 1998-2012,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -34,13 +34,13 @@
#include <curses.priv.h>
-MODULE_ID("$Id: keyok.c,v 1.16 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: keyok.c,v 1.17 2021/06/17 21:26:02 tom Exp $")
/*
* Enable (or disable) ncurses' interpretation of a keycode by adding (or
* removing) the corresponding 'tries' entry.
*
- * Do this by storing a second tree of tries, which records the disabled keys.
+ * Do this by storing a second tree of tries, which records the disabled keys.
* The simplest way to copy is to make a function that returns the string (with
* nulls set to 0200), then use that to reinsert the string into the
* corresponding tree.
diff --git a/ncurses/base/lib_addch.c b/ncurses/base/lib_addch.c
index 378c2881faac..a14bfd3b0e05 100644
--- a/ncurses/base/lib_addch.c
+++ b/ncurses/base/lib_addch.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2019-2020,2021 Thomas E. Dickey *
+ * Copyright 2019-2021,2022 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -37,7 +37,7 @@
#include <curses.priv.h>
#include <ctype.h>
-MODULE_ID("$Id: lib_addch.c,v 1.137 2021/02/20 22:24:34 tom Exp $")
+MODULE_ID("$Id: lib_addch.c,v 1.141 2022/06/12 15:16:41 tom Exp $")
static const NCURSES_CH_T blankchar = NewChar(BLANK_TEXT);
@@ -140,7 +140,7 @@ newline_forces_scroll(WINDOW *win, NCURSES_SIZE_T *ypos)
* wrapped the cursor. We don't do anything with this flag except set it when
* wrapping, and clear it whenever we move the cursor. If we try to wrap at
* the lower-right corner of a window, we cannot move the cursor (since that
- * wouldn't be legal). So we return an error (which is what SVr4 does).
+ * wouldn't be legal). So we return an error (which is what SVr4 does).
* Unlike SVr4, we can successfully add a character to the lower-right corner
* (Solaris 2.6 does this also, however).
*/
@@ -321,20 +321,29 @@ waddch_literal(WINDOW *win, NCURSES_CH_T ch)
int len = _nc_wacs_width(CharOf(ch));
int i;
int j;
- wchar_t *chars;
if (len == 0) { /* non-spacing */
if ((x > 0 && y >= 0)
|| (win->_maxx >= 0 && win->_cury >= 1)) {
- if (x > 0 && y >= 0)
- chars = (win->_line[y].text[x - 1].chars);
- else
- chars = (win->_line[y - 1].text[win->_maxx].chars);
+ NCURSES_CH_T *dst;
+ wchar_t *chars;
+ if (x > 0 && y >= 0) {
+ for (j = x - 1; j >= 0; --j) {
+ if (!isWidecExt(win->_line[y].text[j])) {
+ win->_curx = (NCURSES_SIZE_T) j;
+ break;
+ }
+ }
+ dst = &(win->_line[y].text[j]);
+ } else {
+ dst = &(win->_line[y - 1].text[win->_maxx]);
+ }
+ chars = dst->chars;
for (i = 0; i < CCHARW_MAX; ++i) {
if (chars[i] == 0) {
TR(TRACE_VIRTPUT,
- ("added non-spacing %d: %x",
- x, (int) CharOf(ch)));
+ ("adding non-spacing %s (level %d)",
+ _tracech_t(CHREF(ch)), i));
chars[i] = CharOf(ch);
break;
}
@@ -410,9 +419,9 @@ waddch_literal(WINDOW *win, NCURSES_CH_T ch)
testwrapping:
);
- TR(TRACE_VIRTPUT, ("cell (%ld, %ld..%d) = %s",
- (long) win->_cury, (long) win->_curx, x - 1,
- _tracech_t(CHREF(ch))));
+ TR(TRACE_VIRTPUT, ("cell (%d, %d..%d) = %s",
+ win->_cury, win->_curx, x - 1,
+ _tracech_t(CHREF(line->text[win->_curx]))));
if (x > win->_maxx) {
return wrap_to_next_line(win);
diff --git a/ncurses/base/lib_addstr.c b/ncurses/base/lib_addstr.c
index a1e8829dd7f5..a3753af0d53e 100644
--- a/ncurses/base/lib_addstr.c
+++ b/ncurses/base/lib_addstr.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2019-2022,2023 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -45,7 +45,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_addstr.c,v 1.57 2020/12/05 20:06:19 tom Exp $")
+MODULE_ID("$Id: lib_addstr.c,v 1.62 2023/11/21 21:47:23 tom Exp $")
NCURSES_EXPORT(int)
waddnstr(WINDOW *win, const char *astr, int n)
@@ -55,15 +55,18 @@ waddnstr(WINDOW *win, const char *astr, int n)
T((T_CALLED("waddnstr(%p,%s,%d)"), (void *) win, _nc_visbufn(astr, n), n));
- if (win && (str != 0)) {
+ if (win && (str != 0) && (n != 0)) {
+ bool explicit = (n > 0);
+
TR(TRACE_VIRTPUT | TRACE_ATTRS,
("... current %s", _traceattr(WINDOW_ATTRS(win))));
code = OK;
- if (n < 0)
- n = INT_MAX;
- TR(TRACE_VIRTPUT, ("str is not null, length = %d", n));
- while ((*str != '\0') && (n-- > 0)) {
+ TR(TRACE_VIRTPUT, ("str is not null, length = %d",
+ (explicit ? n : (int) strlen(str))));
+ if (!explicit)
+ n = INT_MAX;
+ while ((n-- > 0) && (*str != '\0')) {
NCURSES_CH_T ch;
TR(TRACE_VIRTPUT, ("*str = %#o", UChar(*str)));
SetChar(ch, UChar(*str++), A_NORMAL);
@@ -143,7 +146,7 @@ wadd_wchnstr(WINDOW *win, const cchar_t *astr, int n)
_nc_viscbuf(astr, n),
n));
- if (!win)
+ if (!win || !astr)
returnCode(ERR);
y = win->_cury;
@@ -227,15 +230,18 @@ waddnwstr(WINDOW *win, const wchar_t *str, int n)
T((T_CALLED("waddnwstr(%p,%s,%d)"), (void *) win, _nc_viswbufn(str, n), n));
- if (win && (str != 0)) {
+ if (win && (str != 0) && (n != 0)) {
+ bool explicit = (n > 0);
+
TR(TRACE_VIRTPUT | TRACE_ATTRS,
("... current %s", _traceattr(WINDOW_ATTRS(win))));
code = OK;
- if (n < 0)
- n = INT_MAX;
- TR(TRACE_VIRTPUT, ("str is not null, length = %d", n));
- while ((*str != L('\0')) && (n-- > 0)) {
+ TR(TRACE_VIRTPUT, ("str is not null, length = %d",
+ (explicit ? n : (int) wcslen(str))));
+ if (!explicit)
+ n = INT_MAX;
+ while ((n-- > 0) && (*str != L('\0'))) {
NCURSES_CH_T ch;
TR(TRACE_VIRTPUT, ("*str[0] = %#lx", (unsigned long) *str));
SetChar(ch, *str++, A_NORMAL);
diff --git a/ncurses/base/lib_bkgd.c b/ncurses/base/lib_bkgd.c
index 23effc7cd141..4f99080835e8 100644
--- a/ncurses/base/lib_bkgd.c
+++ b/ncurses/base/lib_bkgd.c
@@ -37,7 +37,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_bkgd.c,v 1.62 2021/02/13 20:06:54 tom Exp $")
+MODULE_ID("$Id: lib_bkgd.c,v 1.63 2021/05/08 14:58:12 tom Exp $")
static const NCURSES_CH_T blank = NewChar(BLANK_TEXT);
@@ -64,7 +64,7 @@ wbkgrndset(WINDOW *win, const ARG_CH_T ch)
{
int pair;
- if ((pair = GetPair(win->_nc_bkgd)) != 0)
+ if (GetPair(win->_nc_bkgd) != 0)
SET_WINDOW_PAIR(win, 0);
if ((pair = GetPair(CHDEREF(ch))) != 0)
SET_WINDOW_PAIR(win, pair);
diff --git a/ncurses/base/lib_clreol.c b/ncurses/base/lib_clreol.c
index d6cb9b261283..0b6b0ff8f7de 100644
--- a/ncurses/base/lib_clreol.c
+++ b/ncurses/base/lib_clreol.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2001,2009 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -41,7 +41,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_clreol.c,v 1.23 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_clreol.c,v 1.24 2021/10/23 19:06:01 tom Exp $")
NCURSES_EXPORT(int)
wclrtoeol(WINDOW *win)
@@ -61,7 +61,7 @@ wclrtoeol(WINDOW *win)
* If we have just wrapped the cursor, the clear applies to the
* new line, unless we are at the lower right corner.
*/
- if ((win->_flags & _WRAPPED) != 0
+ if (IS_WRAPPED(win) != 0
&& y < win->_maxy) {
win->_flags &= ~_WRAPPED;
}
@@ -70,7 +70,7 @@ wclrtoeol(WINDOW *win)
* There's no point in clearing if we're not on a legal
* position, either.
*/
- if ((win->_flags & _WRAPPED) != 0
+ if (IS_WRAPPED(win)
|| y > win->_maxy
|| x > win->_maxx)
returnCode(ERR);
diff --git a/ncurses/base/lib_color.c b/ncurses/base/lib_color.c
index 907e9743fcda..f001b22413fe 100644
--- a/ncurses/base/lib_color.c
+++ b/ncurses/base/lib_color.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2020,2021 Thomas E. Dickey *
+ * Copyright 2018-2022,2023 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -49,7 +49,7 @@
#define CUR SP_TERMTYPE
#endif
-MODULE_ID("$Id: lib_color.c,v 1.146 2021/02/14 00:17:09 tom Exp $")
+MODULE_ID("$Id: lib_color.c,v 1.150 2023/09/16 16:39:15 tom Exp $")
#ifdef USE_TERM_DRIVER
#define CanChange InfoOf(SP_PARM).canchange
@@ -94,8 +94,6 @@ NCURSES_EXPORT_VAR(int) COLORS = 0;
#define DATA(r,g,b) {r,g,b, 0,0,0, 0}
-#define TYPE_CALLOC(type,elts) typeCalloc(type, (unsigned)(elts))
-
#define MAX_PALETTE 8
#define OkColorHi(n) (((n) < COLORS) && ((n) < maxcolors))
@@ -266,7 +264,7 @@ init_direct_colors(NCURSES_SP_DCL0)
;
}
- if ((n = tigetflag(name)) > 0) {
+ if (tigetflag(name) > 0) {
n = (width + 2) / 3;
result->bits.red = UChar(n);
result->bits.green = UChar(n);
@@ -412,7 +410,7 @@ NCURSES_SP_NAME(start_color) (NCURSES_SP_DCL0)
if (init_direct_colors(NCURSES_SP_ARG)) {
result = OK;
} else {
- SP_PARM->_color_table = TYPE_CALLOC(color_t, maxcolors);
+ TYPE_CALLOC(color_t, maxcolors, SP_PARM->_color_table);
if (SP_PARM->_color_table != 0) {
MakeColorPair(SP_PARM->_color_pairs[0],
default_fg(NCURSES_SP_ARG),
@@ -529,7 +527,7 @@ _nc_reserve_pairs(SCREEN *sp, int want)
have = sp->_pair_limit;
if (sp->_color_pairs == 0) {
- sp->_color_pairs = TYPE_CALLOC(colorpair_t, have);
+ TYPE_CALLOC(colorpair_t, have, sp->_color_pairs);
} else if (have > sp->_pair_alloc) {
#if NCURSES_EXT_COLORS
colorpair_t *next;
@@ -747,7 +745,7 @@ _nc_init_color(SCREEN *sp, int color, int r, int g, int b)
NCURSES_PUTP2("initialize_color",
TIPARM_4(initialize_color, color, r, g, b));
#endif
- sp->_color_defs = max(color + 1, sp->_color_defs);
+ sp->_color_defs = Max(color + 1, sp->_color_defs);
result = OK;
}
@@ -831,7 +829,6 @@ static int
_nc_color_content(SCREEN *sp, int color, int *r, int *g, int *b)
{
int result = ERR;
- int maxcolors;
T((T_CALLED("color_content(%p,%d,%p,%p,%p)"),
(void *) sp,
@@ -840,52 +837,57 @@ _nc_color_content(SCREEN *sp, int color, int *r, int *g, int *b)
(void *) g,
(void *) b));
- if (sp == 0)
- returnCode(result);
-
- maxcolors = MaxColors;
+ if (sp != 0) {
+ int maxcolors = MaxColors;
- if (color < 0 || !OkColorHi(color) || !sp->_coloron) {
- result = ERR;
- } else {
- int c_r, c_g, c_b;
+ if (color >= 0 && OkColorHi(color) && sp->_coloron) {
+ int c_r, c_g, c_b;
- if (sp->_direct_color.value) {
- rgb_bits_t *work = &(sp->_direct_color);
+ if (sp->_direct_color.value) {
+ rgb_bits_t *work = &(sp->_direct_color);
#define max_direct_color(name) ((1 << work->bits.name) - 1)
#define value_direct_color(max) (1000 * ((color >> bitoff) & max)) / max
- int max_r = max_direct_color(red);
- int max_g = max_direct_color(green);
- int max_b = max_direct_color(blue);
+ int max_r = max_direct_color(red);
+ int max_g = max_direct_color(green);
+ int max_b = max_direct_color(blue);
- int bitoff = 0;
+ int bitoff = 0;
- c_b = value_direct_color(max_b);
- bitoff += work->bits.blue;
+ c_b = value_direct_color(max_b);
+ bitoff += work->bits.blue;
- c_g = value_direct_color(max_g);
- bitoff += work->bits.green;
+ c_g = value_direct_color(max_g);
+ bitoff += work->bits.green;
- c_r = value_direct_color(max_r);
+ c_r = value_direct_color(max_r);
- } else {
- c_r = sp->_color_table[color].red;
- c_g = sp->_color_table[color].green;
- c_b = sp->_color_table[color].blue;
- }
+ } else {
+ c_r = sp->_color_table[color].red;
+ c_g = sp->_color_table[color].green;
+ c_b = sp->_color_table[color].blue;
+ }
+ if (r)
+ *r = c_r;
+ if (g)
+ *g = c_g;
+ if (b)
+ *b = c_b;
+
+ TR(TRACE_ATTRS, ("...color_content(%d,%d,%d,%d)",
+ color, c_r, c_g, c_b));
+ result = OK;
+ }
+ }
+ if (result != OK) {
if (r)
- *r = c_r;
+ *r = 0;
if (g)
- *g = c_g;
+ *g = 0;
if (b)
- *b = c_b;
-
- TR(TRACE_ATTRS, ("...color_content(%d,%d,%d,%d)",
- color, c_r, c_g, c_b));
- result = OK;
+ *b = 0;
}
returnCode(result);
}
diff --git a/ncurses/base/lib_delwin.c b/ncurses/base/lib_delwin.c
index 2f0621cf856c..c96e417a9a48 100644
--- a/ncurses/base/lib_delwin.c
+++ b/ncurses/base/lib_delwin.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020-2021,2023 Thomas E. Dickey *
* Copyright 1998-2008,2009 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -43,24 +43,29 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_delwin.c,v 1.21 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_delwin.c,v 1.25 2023/10/21 11:12:44 tom Exp $")
static bool
cannot_delete(WINDOW *win)
{
- WINDOWLIST *p;
bool result = TRUE;
-#ifdef USE_SP_WINDOWLIST
- SCREEN *sp = _nc_screen_of(win);
+
+ if (IS_PAD(win)) {
+ result = FALSE;
+ } else {
+ WINDOWLIST *p;
+#if NCURSES_SP_FUNCS && defined(USE_SP_WINDOWLIST)
+ SCREEN *sp = _nc_screen_of(win);
#endif
- for (each_window(SP_PARM, p)) {
- if (&(p->win) == win) {
- result = FALSE;
- } else if ((p->win._flags & _SUBWIN) != 0
- && p->win._parent == win) {
- result = TRUE;
- break;
+ for (each_window(SP_PARM, p)) {
+ if (&(p->win) == win) {
+ result = FALSE;
+ } else if (IS_SUBWIN(&(p->win))
+ && p->win._parent == win) {
+ result = TRUE;
+ break;
+ }
}
}
return result;
@@ -77,15 +82,18 @@ delwin(WINDOW *win)
if (win == 0
|| cannot_delete(win)) {
result = ERR;
+ } else if (IS_PAD(win)) {
+ win->_parent = NULL;
+ result = _nc_freewin(win);
} else {
#if NCURSES_SP_FUNCS
SCREEN *sp = _nc_screen_of(win);
#endif
- if (win->_flags & _SUBWIN)
+ if (IS_SUBWIN(win)) {
touchwin(win->_parent);
- else if (CurScreen(SP_PARM) != 0)
+ } else if (CurScreen(SP_PARM) != 0) {
touchwin(CurScreen(SP_PARM));
-
+ }
result = _nc_freewin(win);
}
_nc_unlock_global(curses);
diff --git a/ncurses/base/lib_dft_fgbg.c b/ncurses/base/lib_dft_fgbg.c
index 95dc0c224035..4dd43bb1bbd0 100644
--- a/ncurses/base/lib_dft_fgbg.c
+++ b/ncurses/base/lib_dft_fgbg.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2014,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -38,7 +38,7 @@
#define CUR SP_TERMTYPE
#endif
-MODULE_ID("$Id: lib_dft_fgbg.c,v 1.30 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_dft_fgbg.c,v 1.31 2021/04/03 22:27:18 tom Exp $")
/*
* Modify the behavior of color-pair 0 so that the library doesn't assume that
@@ -83,7 +83,9 @@ NCURSES_SP_NAME(assume_default_colors) (NCURSES_SP_DCLx int fg, int bg)
bool save = SP_PARM->_default_color;
SP_PARM->_assumed_color = TRUE;
SP_PARM->_default_color = TRUE;
- init_pair(0, (short) fg, (short) bg);
+ NCURSES_SP_NAME(init_pair) (NCURSES_SP_ARGx 0,
+ (short)fg,
+ (short)bg);
SP_PARM->_default_color = save;
}
code = OK;
diff --git a/ncurses/base/lib_echo.c b/ncurses/base/lib_echo.c
index d8f57f292d60..de7832f4afc1 100644
--- a/ncurses/base/lib_echo.c
+++ b/ncurses/base/lib_echo.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2023 Thomas E. Dickey *
* Copyright 1998-2000,2009 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -45,7 +45,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_echo.c,v 1.9 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_echo.c,v 1.10 2023/04/29 18:57:12 tom Exp $")
NCURSES_EXPORT(int)
NCURSES_SP_NAME(echo) (NCURSES_SP_DCL0)
@@ -53,7 +53,7 @@ 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;
+ IsEcho(SP_PARM) = TRUE;
returnCode(OK);
}
@@ -71,7 +71,7 @@ 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;
+ IsEcho(SP_PARM) = FALSE;
returnCode(OK);
}
diff --git a/ncurses/base/lib_endwin.c b/ncurses/base/lib_endwin.c
index b8a9e4e66a4d..85d2bdbaac05 100644
--- a/ncurses/base/lib_endwin.c
+++ b/ncurses/base/lib_endwin.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2023 Thomas E. Dickey *
* Copyright 1998-2014,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -43,7 +43,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_endwin.c,v 1.25 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_endwin.c,v 1.28 2023/11/11 21:27:32 tom Exp $")
NCURSES_EXPORT(int)
NCURSES_SP_NAME(endwin) (NCURSES_SP_DCL0)
@@ -52,20 +52,24 @@ NCURSES_SP_NAME(endwin) (NCURSES_SP_DCL0)
T((T_CALLED("endwin(%p)"), (void *) SP_PARM));
- if (SP_PARM) {
+ if (SP_PARM != NULL) {
+ if (SP_PARM->_endwin != ewSuspend) {
#ifdef USE_TERM_DRIVER
- TERMINAL_CONTROL_BLOCK *TCB = TCBOf(SP_PARM);
+ TERMINAL_CONTROL_BLOCK *TCB = TCBOf(SP_PARM);
- SP_PARM->_endwin = ewSuspend;
- if (TCB && TCB->drv && TCB->drv->td_scexit)
- TCB->drv->td_scexit(SP_PARM);
+ SP_PARM->_endwin = ewSuspend;
+ if (TCB && TCB->drv && TCB->drv->td_scexit)
+ TCB->drv->td_scexit(SP_PARM);
#else
- SP_PARM->_endwin = ewSuspend;
- SP_PARM->_mouse_wrap(SP_PARM);
- _nc_screen_wrap();
- _nc_mvcur_wrap(); /* wrap up cursor addressing */
+ SP_PARM->_endwin = ewSuspend;
+ SP_PARM->_mouse_wrap(SP_PARM);
+ _nc_screen_wrap();
+ _nc_mvcur_wrap(); /* wrap up cursor addressing */
#endif
- code = NCURSES_SP_NAME(reset_shell_mode) (NCURSES_SP_ARG);
+ code = OK;
+ }
+ if (NCURSES_SP_NAME(reset_shell_mode) (NCURSES_SP_ARG) == ERR)
+ code = ERR;
}
returnCode(code);
diff --git a/ncurses/base/lib_erase.c b/ncurses/base/lib_erase.c
index e190ebd549ac..aa9437a19ef1 100644
--- a/ncurses/base/lib_erase.c
+++ b/ncurses/base/lib_erase.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2022 Thomas E. Dickey *
* Copyright 1998-2009,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -42,18 +42,18 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_erase.c,v 1.19 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_erase.c,v 1.20 2022/09/03 21:40:27 tom Exp $")
NCURSES_EXPORT(int)
werase(WINDOW *win)
{
int code = ERR;
- NCURSES_CH_T blank;
NCURSES_CH_T *start;
T((T_CALLED("werase(%p)"), (void *) win));
if (win) {
+ NCURSES_CH_T blank;
NCURSES_CH_T *sp;
int y;
diff --git a/ncurses/base/lib_freeall.c b/ncurses/base/lib_freeall.c
index 9133d08a7328..75bbe77e3409 100644
--- a/ncurses/base/lib_freeall.c
+++ b/ncurses/base/lib_freeall.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2020,2021 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -40,7 +40,7 @@
extern int malloc_errfd; /* FIXME */
#endif
-MODULE_ID("$Id: lib_freeall.c,v 1.72 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_freeall.c,v 1.76 2021/11/06 21:52:49 tom Exp $")
/*
* Free all ncurses data. This is used for testing only (there's no practical
@@ -78,6 +78,9 @@ NCURSES_SP_NAME(_nc_freeall) (NCURSES_SP_DCL0)
WINDOW *p_win = &(p->win);
bool found = FALSE;
+ if (IS_PAD(p_win))
+ continue;
+
#ifndef USE_SP_WINDOWLIST
if (p->screen != SP_PARM)
continue;
@@ -92,7 +95,7 @@ NCURSES_SP_NAME(_nc_freeall) (NCURSES_SP_DCL0)
#endif
if ((p != q)
- && (q_win->_flags & _SUBWIN)
+ && IS_SUBWIN(q_win)
&& (p_win == q_win->_parent)) {
found = TRUE;
break;
@@ -171,8 +174,6 @@ NCURSES_SP_NAME(_nc_free_and_exit) (NCURSES_SP_DCLx int code)
{
if (SP_PARM) {
delscreen(SP_PARM);
- if (SP_PARM->_term)
- NCURSES_SP_NAME(del_curterm) (NCURSES_SP_ARGx SP_PARM->_term);
}
exit(code);
}
diff --git a/ncurses/base/lib_getch.c b/ncurses/base/lib_getch.c
index 38537591afc0..8e4767918bdd 100644
--- a/ncurses/base/lib_getch.c
+++ b/ncurses/base/lib_getch.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2022,2023 Thomas E. Dickey *
* Copyright 1998-2015,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -44,7 +44,7 @@
#define NEED_KEY_EVENT
#include <curses.priv.h>
-MODULE_ID("$Id: lib_getch.c,v 1.141 2020/09/05 22:50:47 tom Exp $")
+MODULE_ID("$Id: lib_getch.c,v 1.146 2023/04/29 18:57:12 tom Exp $")
#include <fifo_defs.h>
@@ -298,8 +298,8 @@ fifo_push(SCREEN *sp EVENTLIST_2nd(_nc_eventlist * evl))
} else
#endif
#if USE_KLIBC_KBD
- if (NC_ISATTY(sp->_ifd) && sp->_cbreak) {
- ch = _read_kbd(0, 1, !sp->_raw);
+ if (NC_ISATTY(sp->_ifd) && IsCbreak(sp)) {
+ ch = _read_kbd(0, 1, !IsRaw(sp));
n = (ch == -1) ? -1 : 1;
sp->_extended_key = (ch == 0);
} else
@@ -308,20 +308,15 @@ fifo_push(SCREEN *sp EVENTLIST_2nd(_nc_eventlist * evl))
#if defined(USE_TERM_DRIVER)
int buf;
# if defined(EXP_WIN32_DRIVER)
- if (NC_ISATTY(sp->_ifd) && IsTermInfoOnConsole(sp) && sp->_cbreak) {
-# if USE_PTHREADS_EINTR
- if ((pthread_self) && (pthread_kill) && (pthread_equal))
- _nc_globals.read_thread = pthread_self();
-# endif
+ if (NC_ISATTY(sp->_ifd) && IsTermInfoOnConsole(sp) && IsCbreak(sp)) {
+ _nc_set_read_thread(TRUE);
n = _nc_console_read(sp,
_nc_console_handle(sp->_ifd),
&buf);
-# if USE_PTHREADS_EINTR
- _nc_globals.read_thread = 0;
-# endif
+ _nc_set_read_thread(FALSE);
} else
# elif defined(_NC_WINDOWS)
- if (NC_ISATTY(sp->_ifd) && IsTermInfoOnConsole(sp) && sp->_cbreak)
+ if (NC_ISATTY(sp->_ifd) && IsTermInfoOnConsole(sp) && IsCbreak(sp))
n = _nc_mingw_console_read(sp,
_nc_get_handle(sp->_ifd),
&buf);
@@ -334,12 +329,8 @@ fifo_push(SCREEN *sp EVENTLIST_2nd(_nc_eventlist * evl))
int buf;
#endif
unsigned char c2 = 0;
-#if USE_PTHREADS_EINTR
-#if USE_WEAK_SYMBOLS
- if ((pthread_self) && (pthread_kill) && (pthread_equal))
-#endif
- _nc_globals.read_thread = pthread_self();
-#endif
+
+ _nc_set_read_thread(TRUE);
#if defined(EXP_WIN32_DRIVER)
n = _nc_console_read(sp,
_nc_console_handle(sp->_ifd),
@@ -348,9 +339,7 @@ fifo_push(SCREEN *sp EVENTLIST_2nd(_nc_eventlist * evl))
#else
n = (int) read(sp->_ifd, &c2, (size_t) 1);
#endif
-#if USE_PTHREADS_EINTR
- _nc_globals.read_thread = 0;
-#endif
+ _nc_set_read_thread(FALSE);
ch = c2;
#endif /* USE_TERM_DRIVER */
}
@@ -391,7 +380,17 @@ recur_wrefresh(WINDOW *win)
{
#ifdef USE_PTHREADS
SCREEN *sp = _nc_screen_of(win);
- if (_nc_use_pthreads && sp != CURRENT_SCREEN) {
+ bool same_sp;
+
+ if (_nc_use_pthreads) {
+ _nc_lock_global(curses);
+ same_sp = (sp == CURRENT_SCREEN);
+ _nc_unlock_global(curses);
+ } else {
+ same_sp = (sp == CURRENT_SCREEN);
+ }
+
+ if (_nc_use_pthreads && !same_sp) {
SCREEN *save_SP;
/* temporarily switch to the window's screen to check/refresh */
@@ -404,7 +403,7 @@ recur_wrefresh(WINDOW *win)
} else
#endif
if ((is_wintouched(win) || (win->_flags & _HASMOVED))
- && !(win->_flags & _ISPAD)) {
+ && !IS_PAD(win)) {
wrefresh(win);
}
}
@@ -480,8 +479,8 @@ _nc_wgetch(WINDOW *win,
*/
if (head == -1 &&
!sp->_notty &&
- !sp->_raw &&
- !sp->_cbreak &&
+ !IsRaw(sp) &&
+ !IsCbreak(sp) &&
!sp->_called_wgetch) {
char buf[MAXCOLUMNS], *bufp;
@@ -514,13 +513,13 @@ _nc_wgetch(WINDOW *win,
recur_wrefresh(win);
- if (win->_notimeout || (win->_delay >= 0) || (sp->_cbreak > 1)) {
+ if (win->_notimeout || (win->_delay >= 0) || (IsCbreak(sp) > 1)) {
if (head == -1) { /* fifo is empty */
int delay;
TR(TRACE_IEVENT, ("timed delay in wgetch()"));
- if (sp->_cbreak > 1)
- delay = (sp->_cbreak - 1) * 100;
+ if (IsCbreak(sp) > 1)
+ delay = (IsCbreak(sp) - 1) * 100;
else
delay = win->_delay;
@@ -551,7 +550,7 @@ _nc_wgetch(WINDOW *win,
* This is tricky. We only want to get special-key
* events one at a time. But we want to accumulate
* mouse events until either (a) the mouse logic tells
- * us it's picked up a complete gesture, or (b)
+ * us it has picked up a complete gesture, or (b)
* there's a detectable time lapse after one.
*
* Note: if the mouse code starts failing to compose
@@ -639,7 +638,7 @@ _nc_wgetch(WINDOW *win,
* However, we provide the same visual result as Solaris, moving the
* cursor to the left.
*/
- if (sp->_echo && !(win->_flags & _ISPAD)) {
+ if (IsEcho(sp) && !IS_PAD(win)) {
chtype backup = (chtype) ((ch == KEY_BACKSPACE) ? '\b' : ch);
if (backup < KEY_MIN)
wechochar(win, backup);
@@ -648,7 +647,7 @@ _nc_wgetch(WINDOW *win,
/*
* Simulate ICRNL mode
*/
- if ((ch == '\r') && sp->_nl)
+ if ((ch == '\r') && IsNl(sp))
ch = '\n';
/* Strip 8th-bit if so desired. We do this only for characters that
diff --git a/ncurses/base/lib_getstr.c b/ncurses/base/lib_getstr.c
index 7871fb357a62..cac21fc85bd9 100644
--- a/ncurses/base/lib_getstr.c
+++ b/ncurses/base/lib_getstr.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 2018-2021,2023 Thomas E. Dickey *
* Copyright 1998-2011,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -42,7 +42,7 @@
#define NEED_KEY_EVENT
#include <curses.priv.h>
-MODULE_ID("$Id: lib_getstr.c,v 1.35 2020/07/18 20:02:24 tom Exp $")
+MODULE_ID("$Id: lib_getstr.c,v 1.39 2023/04/29 19:00:17 tom Exp $")
/*
* This wipes out the last character, no matter whether it was a tab, control
@@ -78,7 +78,7 @@ wgetnstr_events(WINDOW *win,
{
SCREEN *sp = _nc_screen_of(win);
TTY buf;
- bool oldnl, oldecho, oldraw, oldcbreak;
+ TTY_FLAGS save_flags;
char erasec;
char killc;
char *oldstr;
@@ -94,14 +94,11 @@ wgetnstr_events(WINDOW *win,
NCURSES_SP_NAME(_nc_get_tty_mode) (NCURSES_SP_ARGx &buf);
- oldnl = sp->_nl;
- oldecho = sp->_echo;
- oldraw = sp->_raw;
- oldcbreak = sp->_cbreak;
+ save_flags = sp->_tty_flags;
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);
+ if (!save_flags._raw)
+ NCURSES_SP_NAME(cbreak) (NCURSES_SP_ARG);
erasec = NCURSES_SP_NAME(erasechar) (NCURSES_SP_ARG);
killc = NCURSES_SP_NAME(killchar) (NCURSES_SP_ARG);
@@ -115,7 +112,7 @@ wgetnstr_events(WINDOW *win,
while ((ch = wgetch_events(win, evl)) != ERR) {
/*
* Some terminals (the Wyse-50 is the most common) generate
- * a \n from the down-arrow key. With this logic, it's the
+ * a \n from the down-arrow key. With this logic, it is the
* user's choice whether to set kcud=\n for wgetch();
* terminating *getstr() with \n should work either way.
*/
@@ -123,7 +120,7 @@ wgetnstr_events(WINDOW *win,
|| ch == '\r'
|| ch == KEY_DOWN
|| ch == KEY_ENTER) {
- if (oldecho == TRUE
+ if (save_flags._echo == TRUE
&& win->_cury == win->_maxy
&& win->_scroll)
wechochar(win, (chtype) '\n');
@@ -139,18 +136,18 @@ wgetnstr_events(WINDOW *win,
#endif
if (ch == erasec || ch == KEY_LEFT || ch == KEY_BACKSPACE) {
if (str > oldstr) {
- str = WipeOut(win, y, x, oldstr, str, oldecho);
+ str = WipeOut(win, y, x, oldstr, str, save_flags._echo);
}
} else if (ch == killc) {
while (str > oldstr) {
- str = WipeOut(win, y, x, oldstr, str, oldecho);
+ str = WipeOut(win, y, x, oldstr, str, save_flags._echo);
}
} else if (ch >= KEY_MIN
|| (str - oldstr >= maxlen)) {
NCURSES_SP_NAME(beep) (NCURSES_SP_ARG);
} else {
*str++ = (char) ch;
- if (oldecho == TRUE) {
+ if (save_flags._echo == TRUE) {
int oldy = win->_cury;
if (waddch(win, (chtype) ch) == ERR) {
/*
@@ -160,9 +157,9 @@ wgetnstr_events(WINDOW *win,
*/
win->_flags &= ~_WRAPPED;
waddch(win, (chtype) ' ');
- str = WipeOut(win, y, x, oldstr, str, oldecho);
+ str = WipeOut(win, y, x, oldstr, str, save_flags._echo);
continue;
- } else if (win->_flags & _WRAPPED) {
+ } else if (IS_WRAPPED(win)) {
/*
* If the last waddch forced a wrap &
* scroll, adjust our reference point
@@ -191,11 +188,7 @@ wgetnstr_events(WINDOW *win,
/* Restore with a single I/O call, to fix minor asymmetry between
* raw/noraw, etc.
*/
- sp->_nl = oldnl;
- sp->_echo = oldecho;
- sp->_raw = oldraw;
- sp->_cbreak = oldcbreak;
-
+ sp->_tty_flags = save_flags;
NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf);
*str = '\0';
diff --git a/ncurses/base/lib_insnstr.c b/ncurses/base/lib_insnstr.c
index ff1ae573a576..caec48e8eb70 100644
--- a/ncurses/base/lib_insnstr.c
+++ b/ncurses/base/lib_insnstr.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 2018-2022,2023 Thomas E. Dickey *
* Copyright 2004-2009,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -41,7 +41,7 @@
#include <curses.priv.h>
#include <ctype.h>
-MODULE_ID("$Id: lib_insnstr.c,v 1.7 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_insnstr.c,v 1.10 2023/11/21 21:58:03 tom Exp $")
NCURSES_EXPORT(int)
winsnstr(WINDOW *win, const char *s, int n)
@@ -51,7 +51,7 @@ winsnstr(WINDOW *win, const char *s, int n)
T((T_CALLED("winsnstr(%p,%s,%d)"), (void *) win, _nc_visbufn(s, n), n));
- if (win != 0 && str != 0) {
+ if (win != 0 && str != 0 && n != 0) {
SCREEN *sp = _nc_screen_of(win);
#if USE_WIDEC_SUPPORT
/*
@@ -70,6 +70,7 @@ winsnstr(WINDOW *win, const char *s, int n)
init_mb(state);
n3 = mbstowcs(buffer, s, nn);
if (n3 != (size_t) (-1)) {
+ buffer[n3] = '\0';
code = wins_nwstr(win, buffer, (int) n3);
}
free(buffer);
@@ -82,7 +83,7 @@ winsnstr(WINDOW *win, const char *s, int n)
NCURSES_SIZE_T ox = win->_curx;
const unsigned char *cp;
- for (cp = str; (n <= 0 || (cp - str) < n) && *cp; cp++) {
+ for (cp = str; (n < 0 || (cp - str) < n) && *cp; cp++) {
_nc_insert_ch(sp, win, (chtype) UChar(*cp));
}
win->_curx = ox;
diff --git a/ncurses/base/lib_instr.c b/ncurses/base/lib_instr.c
index 2aa0fc32e9f3..221ebd290400 100644
--- a/ncurses/base/lib_instr.c
+++ b/ncurses/base/lib_instr.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020-2021,2023 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -42,7 +42,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_instr.c,v 1.24 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_instr.c,v 1.26 2023/06/03 12:37:04 tom Exp $")
NCURSES_EXPORT(int)
winnstr(WINDOW *win, char *str, int n)
@@ -66,7 +66,6 @@ winnstr(WINDOW *win, char *str, int n)
cchar_t *cell = &(text[col]);
attr_t attrs;
NCURSES_PAIRS_T pair;
- mbstate_t state;
char *tmp;
if (!isWidecExt(*cell)) {
@@ -79,11 +78,12 @@ winnstr(WINDOW *win, char *str, int n)
bool done = FALSE;
if (getcchar(cell, wch, &attrs, &pair, 0) == OK) {
+ mbstate_t state;
size_t n3;
init_mb(state);
n3 = wcstombs(0, wch, (size_t) 0);
- if (!isEILSEQ(n3) && (n3 != 0)) {
+ if (!isEILSEQ(n3) && (n3 != 0) && (n3 <= MB_LEN_MAX)) {
size_t need = n3 + 10 + (size_t) i;
int have = (int) n3 + i;
diff --git a/ncurses/base/lib_mouse.c b/ncurses/base/lib_mouse.c
index 6caef327a3c0..a03d8b8e1ab0 100644
--- a/ncurses/base/lib_mouse.c
+++ b/ncurses/base/lib_mouse.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2020,2021 Thomas E. Dickey *
+ * Copyright 2018-2023,2024 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -85,7 +85,7 @@
#define CUR SP_TERMTYPE
#endif
-MODULE_ID("$Id: lib_mouse.c,v 1.192 2021/02/14 00:17:09 tom Exp $")
+MODULE_ID("$Id: lib_mouse.c,v 1.200 2024/02/17 21:13:01 tom Exp $")
#include <tic.h>
@@ -380,7 +380,7 @@ handle_sysmouse(int sig GCC_UNUSED)
}
#endif /* USE_SYSMOUSE */
-#ifndef USE_TERM_DRIVER
+#if !defined(USE_TERM_DRIVER) || defined(EXP_WIN32_DRIVER)
#define xterm_kmous "\033[M"
static void
@@ -419,13 +419,22 @@ init_xterm_mouse(SCREEN *sp)
} else {
int code = tigetnum("XM");
switch (code) {
+#ifdef EXP_XTERM_1005
+ case 1005:
+ /* see "xterm+sm+1005" */
+ sp->_mouse_xtermcap = "\033[?1005;1000%?%p1%{1}%=%th%el%;";
+ sp->_mouse_format = MF_XTERM_1005;
+ break;
+#endif
case 1006:
+ /* see "xterm+sm+1006" */
+ sp->_mouse_xtermcap = "\033[?1006;1000%?%p1%{1}%=%th%el%;";
+ sp->_mouse_format = MF_SGR1006;
break;
default:
- code = 1000;
+ sp->_mouse_xtermcap = "\033[?1000%?%p1%{1}%=%th%el%;";
break;
}
- sp->_mouse_xtermcap = "\033[?1000%?%p1%{1}%=%th%el%;";
}
}
#endif
@@ -433,6 +442,9 @@ init_xterm_mouse(SCREEN *sp)
static void
enable_xterm_mouse(SCREEN *sp, int enable)
{
+ TPUTS_TRACE(enable
+ ? "xterm mouse initialization"
+ : "xterm mouse deinitialization");
#if USE_EMX_MOUSE
sp->_emxmouse_activated = enable;
#else
@@ -441,6 +453,18 @@ enable_xterm_mouse(SCREEN *sp, int enable)
sp->_mouse_active = enable;
}
+#if defined(USE_TERM_DRIVER)
+static void
+enable_win32_mouse(SCREEN *sp, int enable)
+{
+#if defined(EXP_WIN32_DRIVER)
+ enable_xterm_mouse(sp, enable);
+#else
+ sp->_mouse_active = enable;
+#endif
+}
+#endif
+
#if USE_GPM_SUPPORT
static bool
allow_gpm_mouse(SCREEN *sp GCC_UNUSED)
@@ -732,7 +756,8 @@ initialize_mousetype(SCREEN *sp)
#ifdef USE_TERM_DRIVER
CallDriver(sp, td_initmouse);
-#else
+#endif
+#if !defined(USE_TERM_DRIVER) || defined(EXP_WIN32_DRIVER)
/* we know how to recognize mouse events under "xterm" */
if (NonEmpty(key_mouse)) {
init_xterm_mouse(sp);
@@ -751,13 +776,15 @@ _nc_mouse_init(SCREEN *sp)
{
bool result = FALSE;
+ T((T_CALLED("_nc_mouse_init(%p)"), (void *) sp));
+
if (sp != 0) {
if (!sp->_mouse_initialized) {
int i;
sp->_mouse_initialized = TRUE;
- TR(MY_TRACE, ("_nc_mouse_init() called"));
+ TR(MY_TRACE, ("set _mouse_initialized"));
sp->_mouse_eventp = FirstEV(sp);
for (i = 0; i < EV_MAX; i++)
@@ -765,11 +792,11 @@ _nc_mouse_init(SCREEN *sp)
initialize_mousetype(sp);
- T(("_nc_mouse_init() set mousetype to %d", sp->_mouse_type));
+ T(("set _mouse_type to %d", sp->_mouse_type));
}
result = sp->_mouse_initialized;
}
- return result;
+ returnCode(result);
}
/*
@@ -960,6 +987,17 @@ handle_wheel(SCREEN *sp, MEVENT * eventp, int button, int wheel)
PRESS_POSITION(3);
break;
default:
+ /*
+ * case 3 is sent when the mouse buttons are released.
+ *
+ * If the terminal uses xterm mode 1003, a continuous series of
+ * button-release events is sent as the mouse moves around the screen,
+ * or as the wheel mouse is rotated.
+ *
+ * Return false in this case, so that when running in X10 mode, we will
+ * recalculate bstate.
+ */
+ eventp->bstate = REPORT_MOUSE_POSITION;
result = FALSE;
break;
}
@@ -1065,12 +1103,7 @@ decode_xterm_X10(SCREEN *sp, MEVENT * eventp)
int res;
bool result;
-# if USE_PTHREADS_EINTR
-# if USE_WEAK_SYMBOLS
- if ((pthread_self) && (pthread_kill) && (pthread_equal))
-# endif
- _nc_globals.read_thread = pthread_self();
-# endif
+ _nc_set_read_thread(TRUE);
for (grabbed = 0; grabbed < MAX_KBUF; grabbed += (size_t) res) {
/* For VIO mouse we add extra bit 64 to disambiguate button-up. */
@@ -1084,9 +1117,7 @@ decode_xterm_X10(SCREEN *sp, MEVENT * eventp)
if (res == -1)
break;
}
-#if USE_PTHREADS_EINTR
- _nc_globals.read_thread = 0;
-#endif
+ _nc_set_read_thread(FALSE);
kbuf[MAX_KBUF] = '\0';
TR(TRACE_IEVENT,
@@ -1120,12 +1151,7 @@ decode_xterm_1005(SCREEN *sp, MEVENT * eventp)
coords[0] = 0;
coords[1] = 0;
-# if USE_PTHREADS_EINTR
-# if USE_WEAK_SYMBOLS
- if ((pthread_self) && (pthread_kill) && (pthread_equal))
-# endif
- _nc_globals.read_thread = pthread_self();
-# endif
+ _nc_set_read_thread(TRUE);
for (grabbed = 0; grabbed < limit;) {
int res;
@@ -1158,9 +1184,7 @@ decode_xterm_1005(SCREEN *sp, MEVENT * eventp)
break;
}
}
-#if USE_PTHREADS_EINTR
- _nc_globals.read_thread = 0;
-#endif
+ _nc_set_read_thread(FALSE);
TR(TRACE_IEVENT,
("_nc_mouse_inline sees the following xterm data: %s",
@@ -1204,12 +1228,7 @@ read_SGR(SCREEN *sp, SGR_DATA * result)
int marker = 1;
memset(result, 0, sizeof(*result));
-# if USE_PTHREADS_EINTR
-# if USE_WEAK_SYMBOLS
- if ((pthread_self) && (pthread_kill) && (pthread_equal))
-# endif
- _nc_globals.read_thread = pthread_self();
-# endif
+ _nc_set_read_thread(TRUE);
do {
int res;
@@ -1274,9 +1293,7 @@ read_SGR(SCREEN *sp, SGR_DATA * result)
}
++grabbed;
} while (!isFinal(ch));
-#if USE_PTHREADS_EINTR
- _nc_globals.read_thread = 0;
-#endif
+ _nc_set_read_thread(FALSE);
kbuf[++grabbed] = 0;
TR(TRACE_IEVENT,
@@ -1389,11 +1406,14 @@ _nc_mouse_inline(SCREEN *sp)
static void
mouse_activate(SCREEN *sp, int on)
{
+ T((T_CALLED("mouse_activate(%p,%s)"),
+ (void *) SP_PARM, on ? "on" : "off"));
+
if (!on && !sp->_mouse_initialized)
- return;
+ returnVoid;
if (!_nc_mouse_init(sp))
- return;
+ returnVoid;
if (on) {
sp->_mouse_bstate = 0;
@@ -1402,7 +1422,6 @@ mouse_activate(SCREEN *sp, int on)
#if NCURSES_EXT_FUNCS
NCURSES_SP_NAME(keyok) (NCURSES_SP_ARGx KEY_MOUSE, on);
#endif
- TPUTS_TRACE("xterm mouse initialization");
enable_xterm_mouse(sp, 1);
break;
#if USE_GPM_SUPPORT
@@ -1421,25 +1440,28 @@ mouse_activate(SCREEN *sp, int on)
#endif
#ifdef USE_TERM_DRIVER
case M_TERM_DRIVER:
- sp->_mouse_active = TRUE;
+ enable_win32_mouse(sp, TRUE);
break;
#endif
case M_NONE:
- return;
+ returnVoid;
+ default:
+ T(("unexpected mouse mode"));
+ break;
}
/* Make runtime binding to cut down on object size of applications that
* do not use the mouse (e.g., 'clear').
*/
- sp->_mouse_event = _nc_mouse_event;
+ /* *INDENT-EQLS* */
+ sp->_mouse_event = _nc_mouse_event;
sp->_mouse_inline = _nc_mouse_inline;
- sp->_mouse_parse = _nc_mouse_parse;
+ sp->_mouse_parse = _nc_mouse_parse;
sp->_mouse_resume = _nc_mouse_resume;
- sp->_mouse_wrap = _nc_mouse_wrap;
+ sp->_mouse_wrap = _nc_mouse_wrap;
} else {
switch (sp->_mouse_type) {
case M_XTERM:
- TPUTS_TRACE("xterm mouse deinitialization");
enable_xterm_mouse(sp, 0);
break;
#if USE_GPM_SUPPORT
@@ -1455,14 +1477,18 @@ mouse_activate(SCREEN *sp, int on)
#endif
#ifdef USE_TERM_DRIVER
case M_TERM_DRIVER:
- sp->_mouse_active = FALSE;
+ enable_win32_mouse(sp, FALSE);
break;
#endif
case M_NONE:
- return;
+ returnVoid;
+ default:
+ T(("unexpected mouse mode"));
+ break;
}
}
NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG);
+ returnVoid;
}
/**************************************************************************
@@ -1560,7 +1586,7 @@ _nc_mouse_parse(SCREEN *sp, int runcount)
if (changed) {
merge = FALSE;
for (b = 1; b <= MAX_BUTTONS; ++b) {
- if ((sp->_mouse_mask & MASK_CLICK(b))
+ if ((sp->_mouse_mask2 & MASK_CLICK(b))
&& (ep->bstate & MASK_PRESS(b))) {
next->bstate &= ~MASK_RELEASE(b);
next->bstate |= MASK_CLICK(b);
@@ -1641,7 +1667,7 @@ _nc_mouse_parse(SCREEN *sp, int runcount)
&& (next->bstate & BUTTON_CLICKED)) {
merge = FALSE;
for (b = 1; b <= MAX_BUTTONS; ++b) {
- if ((sp->_mouse_mask & MASK_DOUBLE_CLICK(b))
+ if ((sp->_mouse_mask2 & MASK_DOUBLE_CLICK(b))
&& (ep->bstate & MASK_CLICK(b))
&& (next->bstate & MASK_CLICK(b))) {
next->bstate &= ~MASK_CLICK(b);
@@ -1659,7 +1685,7 @@ _nc_mouse_parse(SCREEN *sp, int runcount)
&& (next->bstate & BUTTON_CLICKED)) {
merge = FALSE;
for (b = 1; b <= MAX_BUTTONS; ++b) {
- if ((sp->_mouse_mask & MASK_TRIPLE_CLICK(b))
+ if ((sp->_mouse_mask2 & MASK_TRIPLE_CLICK(b))
&& (ep->bstate & MASK_DOUBLE_CLICK(b))
&& (next->bstate & MASK_CLICK(b))) {
next->bstate &= ~MASK_CLICK(b);
@@ -1719,7 +1745,8 @@ _nc_mouse_parse(SCREEN *sp, int runcount)
#endif /* TRACE */
/* after all this, do we have a valid event? */
- return ValidEvent(PREV(first_invalid));
+ ep = PREV(first_invalid);
+ return ValidEvent(ep) && ((ep->bstate & sp->_mouse_mask) != 0);
}
static void
@@ -1963,10 +1990,24 @@ wenclose(const WINDOW *win, int y, int x)
if (win != 0) {
y -= win->_yoffset;
- result = ((win->_begy <= y &&
- win->_begx <= x &&
- (win->_begx + win->_maxx) >= x &&
- (win->_begy + win->_maxy) >= y) ? TRUE : FALSE);
+ if (IS_PAD(win)) {
+ if (win->_pad._pad_y >= 0 &&
+ win->_pad._pad_x >= 0 &&
+ win->_pad._pad_top >= 0 &&
+ win->_pad._pad_left >= 0 &&
+ win->_pad._pad_right >= 0 &&
+ win->_pad._pad_bottom >= 0) {
+ result = ((win->_pad._pad_top <= y &&
+ win->_pad._pad_left <= x &&
+ win->_pad._pad_right >= x &&
+ win->_pad._pad_bottom >= y) ? TRUE : FALSE);
+ }
+ } else {
+ result = ((win->_begy <= y &&
+ win->_begx <= x &&
+ (win->_begx + win->_maxx) >= x &&
+ (win->_begy + win->_maxy) >= y) ? TRUE : FALSE);
+ }
}
returnBool(result);
}
@@ -2035,6 +2076,7 @@ wmouse_trafo(const WINDOW *win, int *pY, int *pX, bool to_screen)
int y = *pY;
int x = *pX;
+ T(("transform input %d,%d", y, x));
if (to_screen) {
y += win->_begy + win->_yoffset;
x += win->_begx;
@@ -2050,6 +2092,7 @@ wmouse_trafo(const WINDOW *win, int *pY, int *pX, bool to_screen)
if (result) {
*pX = x;
*pY = y;
+ T(("output transform %d,%d", y, x));
}
}
returnBool(result);
diff --git a/ncurses/base/lib_mvwin.c b/ncurses/base/lib_mvwin.c
index 58bdb199f274..fca014efeb9a 100644
--- a/ncurses/base/lib_mvwin.c
+++ b/ncurses/base/lib_mvwin.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2009,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -43,7 +43,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_mvwin.c,v 1.19 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_mvwin.c,v 1.20 2021/10/23 18:57:41 tom Exp $")
NCURSES_EXPORT(int)
mvwin(WINDOW *win, int by, int bx)
@@ -54,7 +54,7 @@ mvwin(WINDOW *win, int by, int bx)
T((T_CALLED("mvwin(%p,%d,%d)"), (void *) win, by, bx));
- if (!win || (win->_flags & _ISPAD))
+ if (!win || IS_PAD(win))
returnCode(ERR);
/*
@@ -63,7 +63,7 @@ mvwin(WINDOW *win, int by, int bx)
*/
#if 0
/* Copying subwindows is allowed, but it is expensive... */
- if (win->_flags & _SUBWIN) {
+ if (IS_SUBWIN(win)) {
int err = ERR;
WINDOW *parent = win->_parent;
if (parent) { /* Now comes the complicated and costly part, you should really
diff --git a/ncurses/base/lib_newterm.c b/ncurses/base/lib_newterm.c
index bba97ba1fae8..15d05a31b583 100644
--- a/ncurses/base/lib_newterm.c
+++ b/ncurses/base/lib_newterm.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 2018-2020,2022 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -49,7 +49,7 @@
#include <tic.h>
-MODULE_ID("$Id: lib_newterm.c,v 1.103 2020/09/05 21:34:04 tom Exp $")
+MODULE_ID("$Id: lib_newterm.c,v 1.104 2022/07/09 18:58:58 tom Exp $")
#ifdef USE_TERM_DRIVER
#define NumLabels InfoOf(SP_PARM).numlabels
@@ -362,11 +362,14 @@ NCURSES_EXPORT(SCREEN *)
newterm(const char *name, FILE *ofp, FILE *ifp)
{
SCREEN *rc;
+
+ _nc_init_pthreads();
_nc_lock_global(prescreen);
START_TRACE();
rc = NCURSES_SP_NAME(newterm) (CURRENT_SCREEN_PRE, name, ofp, ifp);
_nc_forget_prescr();
_nc_unlock_global(prescreen);
+
return rc;
}
#endif
diff --git a/ncurses/base/lib_newwin.c b/ncurses/base/lib_newwin.c
index 580d033b7d44..a6723197c093 100644
--- a/ncurses/base/lib_newwin.c
+++ b/ncurses/base/lib_newwin.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -44,7 +44,7 @@
#include <curses.priv.h>
#include <stddef.h>
-MODULE_ID("$Id: lib_newwin.c,v 1.75 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_newwin.c,v 1.76 2021/10/23 18:53:38 tom Exp $")
#define window_is(name) ((sp)->_##name == win)
@@ -114,7 +114,7 @@ _nc_freewin(WINDOW *win)
else
q->next = p->next;
- if (!(win->_flags & _SUBWIN)) {
+ if (!IS_SUBWIN(win)) {
int i;
for (i = 0; i <= win->_maxy; i++)
@@ -219,7 +219,7 @@ derwin(WINDOW *orig, int num_lines, int num_columns, int begy, int begx)
if (num_columns == 0)
num_columns = orig->_maxx + 1 - begx;
- if (orig->_flags & _ISPAD)
+ if (IS_PAD(orig))
flags |= _ISPAD;
win = NCURSES_SP_NAME(_nc_makenew) (NCURSES_SP_ARGx num_lines, num_columns,
diff --git a/ncurses/base/lib_nl.c b/ncurses/base/lib_nl.c
index df07349fc83c..417b257d0399 100644
--- a/ncurses/base/lib_nl.c
+++ b/ncurses/base/lib_nl.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2023 Thomas E. Dickey *
* Copyright 1998-2000,2009 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -45,7 +45,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_nl.c,v 1.13 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_nl.c,v 1.14 2023/04/29 18:51:49 tom Exp $")
#ifdef __EMX__
#include <io.h>
@@ -57,7 +57,7 @@ NCURSES_SP_NAME(nl) (NCURSES_SP_DCL0)
T((T_CALLED("nl(%p)"), (void *) SP_PARM));
if (0 == SP_PARM)
returnCode(ERR);
- SP_PARM->_nl = TRUE;
+ IsNl(SP_PARM) = TRUE;
#ifdef __EMX__
_nc_flush();
_fsetmode(NC_OUTPUT(SP_PARM), "t");
@@ -79,7 +79,7 @@ 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;
+ IsNl(SP_PARM) = FALSE;
#ifdef __EMX__
_nc_flush();
_fsetmode(NC_OUTPUT(SP_PARM), "b");
diff --git a/ncurses/base/lib_overlay.c b/ncurses/base/lib_overlay.c
index 6d451d046a85..6d21c7617047 100644
--- a/ncurses/base/lib_overlay.c
+++ b/ncurses/base/lib_overlay.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2023 Thomas E. Dickey *
* Copyright 1998-2013,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -41,7 +41,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_overlay.c,v 1.33 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_overlay.c,v 1.34 2023/09/16 16:39:07 tom Exp $")
static int
overlap(const WINDOW *const src, WINDOW *const dst, int const flag)
@@ -78,12 +78,12 @@ overlap(const WINDOW *const src, WINDOW *const dst, int const flag)
dy2 = dy1 + dst->_maxy;
if (dx2 >= sx1 && dx1 <= sx2 && dy2 >= sy1 && dy1 <= sy2) {
- int sminrow = max(sy1, dy1) - sy1;
- int smincol = max(sx1, dx1) - sx1;
- int dminrow = max(sy1, dy1) - dy1;
- int dmincol = max(sx1, dx1) - dx1;
- int dmaxrow = min(sy2, dy2) - dy1;
- int dmaxcol = min(sx2, dx2) - dx1;
+ int sminrow = Max(sy1, dy1) - sy1;
+ int smincol = Max(sx1, dx1) - sx1;
+ int dminrow = Max(sy1, dy1) - dy1;
+ int dmincol = Max(sx1, dx1) - dx1;
+ int dmaxrow = Min(sy2, dy2) - dy1;
+ int dmaxcol = Min(sx2, dx2) - dx1;
rc = copywin(src, dst,
sminrow, smincol,
diff --git a/ncurses/base/lib_pad.c b/ncurses/base/lib_pad.c
index 73978fbb8ad2..d4bd7f111bef 100644
--- a/ncurses/base/lib_pad.c
+++ b/ncurses/base/lib_pad.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2010,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -43,7 +43,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_pad.c,v 1.48 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_pad.c,v 1.50 2021/10/23 22:57:27 tom Exp $")
NCURSES_EXPORT(WINDOW *)
NCURSES_SP_NAME(newpad) (NCURSES_SP_DCLx int l, int c)
@@ -90,7 +90,7 @@ subpad(WINDOW *orig, int l, int c, int begy, int begx)
T((T_CALLED("subpad(%d, %d)"), l, c));
if (orig) {
- if (!(orig->_flags & _ISPAD)
+ if (!IS_PAD(orig)
|| ((win = derwin(orig, l, c, begy, begx)) == NULL))
returnWin(0);
}
@@ -146,7 +146,7 @@ pnoutrefresh(WINDOW *win,
if (win == 0)
returnCode(ERR);
- if (!(win->_flags & _ISPAD))
+ if (!IS_PAD(win))
returnCode(ERR);
sp = _nc_screen_of(win);
@@ -296,7 +296,7 @@ pnoutrefresh(WINDOW *win,
/*
* Use the pad's current position, if it will be visible.
- * If not, don't do anything; it's not an error.
+ * If not, don't do anything; it is not an error.
*/
if (win->_leaveok == FALSE
&& win->_cury >= pminrow
@@ -334,7 +334,7 @@ pechochar(WINDOW *pad, const chtype ch)
if (pad == 0)
returnCode(ERR);
- if (!(pad->_flags & _ISPAD))
+ if (!IS_PAD(pad))
returnCode(wechochar(pad, ch));
waddch(pad, ch);
diff --git a/ncurses/base/lib_refresh.c b/ncurses/base/lib_refresh.c
index d8444289c152..bcaa4624b8a9 100644
--- a/ncurses/base/lib_refresh.c
+++ b/ncurses/base/lib_refresh.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020-2021,2023 Thomas E. Dickey *
* Copyright 1998-2010,2011 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -43,7 +43,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_refresh.c,v 1.46 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_refresh.c,v 1.48 2023/05/27 20:13:10 tom Exp $")
NCURSES_EXPORT(int)
wrefresh(WINDOW *win)
@@ -92,13 +92,21 @@ wnoutrefresh(WINDOW *win)
T((T_CALLED("wnoutrefresh(%p)"), (void *) win));
- /*
- * This function will break badly if we try to refresh a pad.
- */
- if ((win == 0)
- || (win->_flags & _ISPAD))
+ if (win == NULL)
returnCode(ERR);
+ /*
+ * Handle pads as a special case.
+ */
+ if (IS_PAD(win)) {
+ returnCode(pnoutrefresh(win,
+ win->_pad._pad_y,
+ win->_pad._pad_x,
+ win->_pad._pad_top,
+ win->_pad._pad_left,
+ win->_pad._pad_bottom,
+ win->_pad._pad_right));
+ }
#ifdef TRACE
if (USE_TRACEF(TRACE_UPDATE)) {
_tracedump("...win", win);
@@ -200,7 +208,6 @@ wnoutrefresh(WINDOW *win)
});
if_WIDEC({
- static cchar_t blank = BLANK;
int last_dst = begx + ((last_src < win->_maxx)
? last_src
: win->_maxx);
@@ -246,6 +253,7 @@ wnoutrefresh(WINDOW *win)
*/
if (fix_left < dst_col || fix_right > last_dst) {
for (j = fix_left; j <= fix_right; ++j) {
+ static cchar_t blank = BLANK;
nline->text[j] = blank;
CHANGED_CELL(nline, j);
}
diff --git a/ncurses/base/lib_restart.c b/ncurses/base/lib_restart.c
index 81eb368843b8..0c61cb7ea667 100644
--- a/ncurses/base/lib_restart.c
+++ b/ncurses/base/lib_restart.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2023 Thomas E. Dickey *
* Copyright 1998-2012,2015 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -42,7 +42,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_restart.c,v 1.17 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_restart.c,v 1.18 2023/04/29 19:01:25 tom Exp $")
NCURSES_EXPORT(int)
NCURSES_SP_NAME(restartterm) (NCURSES_SP_DCLx
@@ -65,31 +65,28 @@ NCURSES_SP_NAME(restartterm) (NCURSES_SP_DCLx
if (TINFO_SETUP_TERM(&new_term, termp, filenum, errret, FALSE) != OK) {
result = ERR;
} 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;
+ TTY_FLAGS save_flags = SP_PARM->_tty_flags;
#ifdef USE_TERM_DRIVER
SP_PARM->_term = new_term;
#endif
- if (saveecho) {
+ if (save_flags._echo) {
NCURSES_SP_NAME(echo) (NCURSES_SP_ARG);
} else {
NCURSES_SP_NAME(noecho) (NCURSES_SP_ARG);
}
- if (savecbreak) {
+ if (save_flags._cbreak) {
NCURSES_SP_NAME(cbreak) (NCURSES_SP_ARG);
NCURSES_SP_NAME(noraw) (NCURSES_SP_ARG);
- } else if (saveraw) {
+ } else if (save_flags._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) {
+ if (save_flags._nl) {
NCURSES_SP_NAME(nl) (NCURSES_SP_ARG);
} else {
NCURSES_SP_NAME(nonl) (NCURSES_SP_ARG);
diff --git a/ncurses/base/lib_screen.c b/ncurses/base/lib_screen.c
index 6afba6611c61..e2647b54e2eb 100644
--- a/ncurses/base/lib_screen.c
+++ b/ncurses/base/lib_screen.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2019-2021,2023 Thomas E. Dickey *
* Copyright 1998-2017,2018 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -42,7 +42,7 @@
#define CUR SP_TERMTYPE
#endif
-MODULE_ID("$Id: lib_screen.c,v 1.100 2020/05/25 22:48:41 tom Exp $")
+MODULE_ID("$Id: lib_screen.c,v 1.105 2023/04/28 20:58:54 tom Exp $")
#define MAX_SIZE 0x3fff /* 16k is big enough for a window or pad */
@@ -90,7 +90,6 @@ typedef struct {
typedef struct {
const char name[17];
PARAM_TYPE type;
- size_t size;
size_t offset;
} SCR_PARAMS;
@@ -120,8 +119,7 @@ static const SCR_ATTRS scr_attrs[] =
};
#undef DATA
-#define sizeof2(type,name) sizeof(((type *)0)->name)
-#define DATA(name, type) { { #name }, type, sizeof2(WINDOW, name), offsetof(WINDOW, name) }
+#define DATA(name, type) { { #name }, type, offsetof(WINDOW, name) }
static const SCR_PARAMS scr_params[] =
{
@@ -200,7 +198,7 @@ read_txt(FILE *fp)
if (ch == '\n') {
result[--used] = '\0';
- T(("READ:%s", result));
+ TR(TRACE_IEVENT, ("READ:%s", result));
} else if (used == 0) {
free(result);
result = 0;
@@ -214,7 +212,7 @@ decode_attr(char *source, attr_t *target, int *color)
{
bool found = FALSE;
- T(("decode_attr '%s'", source));
+ TR(TRACE_IEVENT, ("decode_attr '%s'", source));
while (*source) {
if (source[0] == MARKER && source[1] == L_CURL) {
@@ -272,7 +270,7 @@ decode_char(char *source, int *target)
int base = 16;
const char digits[] = "0123456789abcdef";
- T(("decode_char '%s'", source));
+ TR(TRACE_IEVENT, ("decode_char '%s'", source));
*target = ' ';
switch (*source) {
case MARKER:
@@ -329,7 +327,7 @@ decode_chtype(char *source, chtype fillin, chtype *target)
int color = PAIR_NUMBER((int) attr);
int value;
- T(("decode_chtype '%s'", source));
+ TR(TRACE_IEVENT, ("decode_chtype '%s'", source));
source = decode_attr(source, &attr, &color);
source = decode_char(source, &value);
*target = (ChCharOf(value) | attr | (chtype) COLOR_PAIR(color));
@@ -347,7 +345,7 @@ decode_cchar(char *source, cchar_t *fillin, cchar_t *target)
int append = 0;
int value = 0;
- T(("decode_cchar '%s'", source));
+ TR(TRACE_IEVENT, ("decode_cchar '%s'", source));
*target = blank;
#if NCURSES_EXT_COLORS
color = fillin->ext_color;
@@ -542,7 +540,7 @@ NCURSES_SP_NAME(getwin) (NCURSES_SP_DCLx FILE *filep)
returnWin(0);
}
- if (tmp._flags & _ISPAD) {
+ if (IS_PAD(&tmp)) {
nwin = NCURSES_SP_NAME(newpad) (NCURSES_SP_ARGx
tmp._maxy + 1,
tmp._maxx + 1);
@@ -587,7 +585,7 @@ NCURSES_SP_NAME(getwin) (NCURSES_SP_DCLx FILE *filep)
nwin->_regtop = tmp._regtop;
nwin->_regbottom = tmp._regbottom;
- if (tmp._flags & _ISPAD)
+ if (IS_PAD(&tmp))
nwin->_pad = tmp._pad;
if (old_format) {
@@ -824,7 +822,7 @@ putwin(WINDOW *win, FILE *filep)
attr_t attr;
*buffer = '\0';
- if (!strncmp(name, "_pad.", (size_t) 5) && !(win->_flags & _ISPAD)) {
+ if (!strncmp(name, "_pad.", (size_t) 5) && !IS_PAD(win)) {
continue;
}
switch (scr_params[y].type) {
@@ -940,6 +938,31 @@ putwin(WINDOW *win, FILE *filep)
returnCode(code);
}
+/*
+ * Replace a window covering the whole screen, i.e., newscr or curscr.
+ */
+static WINDOW *
+replace_window(WINDOW *target, FILE *source)
+{
+ WINDOW *result = getwin(source);
+#if NCURSES_EXT_FUNCS
+ if (result != NULL) {
+ if (getmaxx(result) != getmaxx(target)
+ || getmaxy(result) != getmaxy(target)) {
+ int code = wresize(result,
+ 1 + getmaxy(target),
+ 1 + getmaxx(target));
+ if (code != OK) {
+ delwin(result);
+ result = NULL;
+ }
+ }
+ }
+#endif
+ delwin(target);
+ return result;
+}
+
NCURSES_EXPORT(int)
NCURSES_SP_NAME(scr_restore) (NCURSES_SP_DCLx const char *file)
{
@@ -949,9 +972,8 @@ NCURSES_SP_NAME(scr_restore) (NCURSES_SP_DCLx const char *file)
T((T_CALLED("scr_restore(%p,%s)"), (void *) SP_PARM, _nc_visbuf(file)));
if (_nc_access(file, R_OK) >= 0
- && (fp = fopen(file, BIN_R)) != 0) {
- delwin(NewScreen(SP_PARM));
- NewScreen(SP_PARM) = getwin(fp);
+ && (fp = safe_fopen(file, BIN_R)) != 0) {
+ NewScreen(SP_PARM) = replace_window(NewScreen(SP_PARM), fp);
#if !USE_REENTRANT
newscr = NewScreen(SP_PARM);
#endif
@@ -980,7 +1002,7 @@ scr_dump(const char *file)
T((T_CALLED("scr_dump(%s)"), _nc_visbuf(file)));
if (_nc_access(file, W_OK) < 0
- || (fp = fopen(file, BIN_W)) == 0) {
+ || (fp = safe_fopen(file, BIN_W)) == 0) {
result = ERR;
} else {
(void) putwin(newscr, fp);
@@ -1007,9 +1029,8 @@ NCURSES_SP_NAME(scr_init) (NCURSES_SP_DCLx const char *file)
FILE *fp = 0;
if (_nc_access(file, R_OK) >= 0
- && (fp = fopen(file, BIN_R)) != 0) {
- delwin(CurScreen(SP_PARM));
- CurScreen(SP_PARM) = getwin(fp);
+ && (fp = safe_fopen(file, BIN_R)) != 0) {
+ CurScreen(SP_PARM) = replace_window(CurScreen(SP_PARM), fp);
#if !USE_REENTRANT
curscr = CurScreen(SP_PARM);
#endif
diff --git a/ncurses/base/lib_set_term.c b/ncurses/base/lib_set_term.c
index 8573fbe7d522..78de859208b6 100644
--- a/ncurses/base/lib_set_term.c
+++ b/ncurses/base/lib_set_term.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 2018-2021,2022 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -41,8 +41,11 @@
**
*/
+#define NEW_PAIR_INTERNAL 1
+
#include <curses.priv.h>
#include <tic.h>
+#include <new_pair.h>
#if USE_GPM_SUPPORT
#ifdef HAVE_LIBDL
@@ -54,7 +57,7 @@
#undef CUR
#define CUR SP_TERMTYPE
-MODULE_ID("$Id: lib_set_term.c,v 1.175 2020/10/10 19:09:03 juergen Exp $")
+MODULE_ID("$Id: lib_set_term.c,v 1.184 2022/12/10 21:34:12 tom Exp $")
#ifdef USE_TERM_DRIVER
#define MaxColors InfoOf(sp).maxcolors
@@ -146,9 +149,12 @@ delscreen(SCREEN *sp)
_nc_lock_global(curses);
if (delink_screen(sp)) {
+ WINDOWLIST *wl;
+ bool is_current = (sp == CURRENT_SCREEN);
+
#ifdef USE_SP_RIPOFF
- ripoff_t *rop;
if (safe_ripoff_sp && safe_ripoff_sp != safe_ripoff_stack) {
+ ripoff_t *rop;
for (rop = safe_ripoff_stack;
rop != safe_ripoff_sp && (rop - safe_ripoff_stack) < N_RIPS;
rop++) {
@@ -160,9 +166,13 @@ delscreen(SCREEN *sp)
}
#endif
- (void) _nc_freewin(CurScreen(sp));
- (void) _nc_freewin(NewScreen(sp));
- (void) _nc_freewin(StdScreen(sp));
+ /* delete all of the windows in this screen */
+ rescan:
+ for (each_window(sp, wl)) {
+ if (_nc_freewin(&(wl->win)) == OK) {
+ goto rescan;
+ }
+ }
if (sp->_slk != 0) {
@@ -187,6 +197,7 @@ delscreen(SCREEN *sp)
FreeIfNeeded(sp->_current_attr);
+ _nc_free_ordered_pairs(sp);
FreeIfNeeded(sp->_color_table);
FreeIfNeeded(sp->_color_pairs);
@@ -219,7 +230,7 @@ delscreen(SCREEN *sp)
* application might try to use (except cur_term, which may have
* multiple references in different screens).
*/
- if (sp == CURRENT_SCREEN) {
+ if (is_current) {
#if !USE_REENTRANT
curscr = 0;
newscr = 0;
@@ -234,6 +245,8 @@ delscreen(SCREEN *sp)
_nc_wacs = 0;
}
#endif
+ } else {
+ set_term(CURRENT_SCREEN);
}
}
_nc_unlock_global(curses);
@@ -329,9 +342,14 @@ NCURSES_SP_NAME(_nc_setupscreen) (
T(("_nc_alloc_screen_sp %p", (void *) sp));
*spp = sp;
}
- if (!sp
- || ((sp->_acs_map = typeCalloc(chtype, ACS_LEN)) == 0)
- || ((sp->_screen_acs_map = typeCalloc(bool, ACS_LEN)) == 0)) {
+ if (sp == NULL) {
+ ReturnScreenError();
+ }
+ if ((sp->_acs_map = typeCalloc(chtype, ACS_LEN)) == NULL) {
+ ReturnScreenError();
+ }
+ if ((sp->_screen_acs_map = typeCalloc(bool, ACS_LEN)) == NULL) {
+ free(sp->_acs_map);
ReturnScreenError();
}
@@ -412,7 +430,6 @@ NCURSES_SP_NAME(_nc_setupscreen) (
fflush(output);
_setmode(fileno(output), _O_BINARY);
#endif
- 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;
@@ -495,7 +512,7 @@ NCURSES_SP_NAME(_nc_setupscreen) (
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));
+ 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 >= MaxColors) {
@@ -692,6 +709,9 @@ NCURSES_SP_NAME(_nc_setupscreen) (
formats (4-4 or 3-2-3) for which there may be some hardware
support. */
if (rop->hook == _nc_slk_initialize) {
+ if (!TerminalOf(sp)) {
+ continue;
+ }
if (!(NumLabels <= 0 || !SLK_STDFMT(slk_format))) {
continue;
}
@@ -731,6 +751,7 @@ NCURSES_SP_NAME(_nc_setupscreen) (
}
T(("creating stdscr"));
+ (void) bottom_stolen;
assert((sp->_lines_avail + sp->_topstolen + bottom_stolen) == slines);
if ((StdScreen(sp) = NCURSES_SP_NAME(newwin) (NCURSES_SP_ARGx
sp->_lines_avail,
@@ -812,10 +833,13 @@ NCURSES_EXPORT(int)
_nc_ripoffline(int line, int (*init) (WINDOW *, int))
{
int rc;
+
+ _nc_init_pthreads();
_nc_lock_global(prescreen);
START_TRACE();
rc = NCURSES_SP_NAME(_nc_ripoffline) (CURRENT_SCREEN_PRE, line, init);
_nc_unlock_global(prescreen);
+
return rc;
}
#endif
@@ -836,10 +860,13 @@ NCURSES_EXPORT(int)
ripoffline(int line, int (*init) (WINDOW *, int))
{
int rc;
+
+ _nc_init_pthreads();
_nc_lock_global(prescreen);
START_TRACE();
rc = NCURSES_SP_NAME(ripoffline) (CURRENT_SCREEN_PRE, line, init);
_nc_unlock_global(prescreen);
+
return rc;
}
#endif
diff --git a/ncurses/base/lib_slk.c b/ncurses/base/lib_slk.c
index f4b3ce6dbf0a..47e57e0bc5bd 100644
--- a/ncurses/base/lib_slk.c
+++ b/ncurses/base/lib_slk.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2022 Thomas E. Dickey *
* Copyright 1998-2010,2011 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -48,7 +48,7 @@
#define CUR SP_TERMTYPE
#endif
-MODULE_ID("$Id: lib_slk.c,v 1.49 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_slk.c,v 1.50 2022/08/20 18:29:22 tom Exp $")
#ifdef USE_TERM_DRIVER
#define NumLabels InfoOf(SP_PARM).numlabels
@@ -187,8 +187,10 @@ _nc_slk_initialize(WINDOW *stwin, int cols)
|| SP_PARM->_slk->labcnt <= 0
|| (SP_PARM->_slk->ent = typeCalloc(slk_ent,
(size_t) SP_PARM->_slk->labcnt))
- == NULL)
+ == NULL) {
+ free(SP_PARM->_slk->ent);
returnCode(slk_failed(NCURSES_SP_ARG));
+ }
max_length = (size_t) SP_PARM->_slk->maxlen;
for (i = 0; i < SP_PARM->_slk->labcnt; i++) {
diff --git a/ncurses/base/lib_slkinit.c b/ncurses/base/lib_slkinit.c
index e1602abc9f18..318077fc96c1 100644
--- a/ncurses/base/lib_slkinit.c
+++ b/ncurses/base/lib_slkinit.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2022 Thomas E. Dickey *
* Copyright 1998-2009,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -41,7 +41,7 @@
*/
#include <curses.priv.h>
-MODULE_ID("$Id: lib_slkinit.c,v 1.15 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_slkinit.c,v 1.16 2022/07/09 18:58:58 tom Exp $")
#ifdef USE_SP_RIPOFF
#define SoftkeyFormat SP_PARM->slk_format
@@ -77,10 +77,13 @@ NCURSES_EXPORT(int)
slk_init(int format)
{
int rc;
+
+ _nc_init_pthreads();
_nc_lock_global(prescreen);
START_TRACE();
rc = NCURSES_SP_NAME(slk_init) (CURRENT_SCREEN_PRE, format);
_nc_unlock_global(prescreen);
+
return rc;
}
#endif
diff --git a/ncurses/base/lib_slkrefr.c b/ncurses/base/lib_slkrefr.c
index c6bf9d2e06f6..7a40624b1276 100644
--- a/ncurses/base/lib_slkrefr.c
+++ b/ncurses/base/lib_slkrefr.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2013,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -44,7 +44,7 @@
#define CUR SP_TERMTYPE
#endif
-MODULE_ID("$Id: lib_slkrefr.c,v 1.31 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_slkrefr.c,v 1.32 2021/09/04 10:54:35 tom Exp $")
#ifdef USE_TERM_DRIVER
#define NumLabels InfoOf(SP_PARM).numlabels
@@ -113,7 +113,7 @@ slk_intern_refresh(SCREEN *sp)
wmove(slk->win, SLK_LINES(fmt) - 1, slk->ent[i].ent_x);
(void) wattrset(slk->win, (int) AttrOf(slk->attr));
waddstr(slk->win, slk->ent[i].form_text);
- /* if we simulate SLK's, it's looking much more
+ /* if we simulate SLK's, it is looking much more
natural to use the current ATTRIBUTE also
for the label window */
(void) wattrset(slk->win, (int) WINDOW_ATTRS(StdScreen(sp)));
diff --git a/ncurses/base/lib_wattron.c b/ncurses/base/lib_wattron.c
index c589f10473cb..906021d3b4cf 100644
--- a/ncurses/base/lib_wattron.c
+++ b/ncurses/base/lib_wattron.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2022 Thomas E. Dickey *
* Copyright 1998-2009,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -43,7 +43,7 @@
#include <curses.priv.h>
#include <ctype.h>
-MODULE_ID("$Id: lib_wattron.c,v 1.12 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_wattron.c,v 1.13 2022/04/15 22:34:38 tom Exp $")
NCURSES_EXPORT(int)
wattr_on(WINDOW *win, attr_t at, void *opts GCC_UNUSED)
@@ -55,8 +55,10 @@ wattr_on(WINDOW *win, attr_t at, void *opts GCC_UNUSED)
GET_WINDOW_PAIR(win)));
if_EXT_COLORS({
- if (at & A_COLOR)
+ if (at & A_COLOR) {
win->_color = PairNumber(at);
+ set_extended_pair(opts, win->_color);
+ }
});
toggle_attr_on(WINDOW_ATTRS(win), at);
returnCode(OK);
diff --git a/ncurses/base/lib_window.c b/ncurses/base/lib_window.c
index 7222bfe5c656..5323fbf0348e 100644
--- a/ncurses/base/lib_window.c
+++ b/ncurses/base/lib_window.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2010,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -40,7 +40,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_window.c,v 1.31 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_window.c,v 1.32 2021/10/23 23:06:24 tom Exp $")
NCURSES_EXPORT(void)
_nc_synchook(WINDOW *win)
@@ -130,7 +130,7 @@ wsyncdown(WINDOW *win)
{
T((T_CALLED("wsyncdown(%p)"), (void *) win));
- if (win && win->_parent) {
+ if (win != NULL && win->_parent != NULL) {
WINDOW *pp = win->_parent;
int y;
@@ -187,7 +187,7 @@ dupwin(WINDOW *win)
SCREEN *sp = _nc_screen_of(win);
#endif
_nc_lock_global(curses);
- if (win->_flags & _ISPAD) {
+ if (IS_PAD(win)) {
nwin = NCURSES_SP_NAME(newpad) (NCURSES_SP_ARGx
win->_maxy + 1,
win->_maxx + 1);
@@ -238,7 +238,7 @@ dupwin(WINDOW *win)
nwin->_regtop = win->_regtop;
nwin->_regbottom = win->_regbottom;
- if (win->_flags & _ISPAD)
+ if (IS_PAD(win))
nwin->_pad = win->_pad;
linesize = (unsigned) (win->_maxx + 1) * sizeof(NCURSES_CH_T);
diff --git a/ncurses/base/new_pair.c b/ncurses/base/new_pair.c
index c04f4acbb95d..70866c636812 100644
--- a/ncurses/base/new_pair.c
+++ b/ncurses/base/new_pair.c
@@ -61,7 +61,7 @@
#endif
-MODULE_ID("$Id: new_pair.c,v 1.21 2021/02/14 00:17:09 tom Exp $")
+MODULE_ID("$Id: new_pair.c,v 1.23 2021/08/16 22:11:26 tom Exp $")
#if NCURSES_EXT_COLORS
@@ -106,7 +106,7 @@ dumpit(SCREEN *sp, int pair, const char *tag)
size_t have = sizeof(bigbuf);
_nc_STRCPY(p, tag, have);
- for (n = 0; n < sp->_pair_limit; ++n) {
+ for (n = 0; n < sp->_pair_alloc; ++n) {
if (list[n].mode != cpFREE) {
p += strlen(p);
if ((size_t) (p - bigbuf) + 50 > have)
@@ -297,7 +297,7 @@ NCURSES_SP_NAME(alloc_pair) (NCURSES_SP_DCLx int fg, int bg)
found = TRUE;
}
}
- if (!found) {
+ if (!found && SP_PARM->_color_pairs != NULL) {
for (pair = 1; pair <= hint; pair++) {
if (SP_PARM->_color_pairs[pair].mode == cpFREE) {
T(("found gap %d", pair));
diff --git a/ncurses/base/resizeterm.c b/ncurses/base/resizeterm.c
index 9b04287cb56f..1a2ddb365a58 100644
--- a/ncurses/base/resizeterm.c
+++ b/ncurses/base/resizeterm.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020-2021,2024 Thomas E. Dickey *
* Copyright 1998-2015,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -46,7 +46,7 @@
#define CUR SP_TERMTYPE
#endif
-MODULE_ID("$Id: resizeterm.c,v 1.50 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: resizeterm.c,v 1.53 2024/04/20 21:54:14 tom Exp $")
/*
* If we're trying to be reentrant, do not want any local statics.
@@ -210,7 +210,7 @@ parent_depth(WINDOW *cmp)
}
/*
- * FIXME: must adjust position so it's within the parent!
+ * FIXME: must adjust position so it is within the parent!
*/
static int
adjust_window(WINDOW *win, int ToLines, int ToCols, int stolen EXTRA_DCLS)
@@ -293,7 +293,7 @@ decrease_size(NCURSES_SP_DCLx int ToLines, int ToCols, int stolen EXTRA_DCLS)
for (each_window(SP_PARM, wp)) {
WINDOW *win = &(wp->win);
- if (!(win->_flags & _ISPAD)) {
+ if (!IS_PAD(win)) {
if (child_depth(win) == depth) {
found = TRUE;
if (adjust_window(win, ToLines, ToCols,
@@ -328,7 +328,7 @@ increase_size(NCURSES_SP_DCLx int ToLines, int ToCols, int stolen EXTRA_DCLS)
for (each_window(SP_PARM, wp)) {
WINDOW *win = &(wp->win);
- if (!(win->_flags & _ISPAD)) {
+ if (!IS_PAD(win)) {
if (parent_depth(win) == depth) {
found = TRUE;
if (adjust_window(win, ToLines, ToCols,
@@ -409,8 +409,8 @@ NCURSES_SP_NAME(resize_term) (NCURSES_SP_DCLx int ToLines, int ToCols)
#ifdef USE_TERM_DRIVER
CallDriver_2(SP_PARM, td_setsize, ToLines, ToCols);
#else
- lines = (NCURSES_SIZE_T) ToLines;
- columns = (NCURSES_SIZE_T) ToCols;
+ lines = (NCURSES_INT2) ToLines;
+ columns = (NCURSES_INT2) ToCols;
#endif
SP_PARM->_lines_avail = (NCURSES_SIZE_T) (ToLines - was_stolen);
diff --git a/ncurses/base/safe_sprintf.c b/ncurses/base/safe_sprintf.c
index 1868c009660c..8816e58c2ca8 100644
--- a/ncurses/base/safe_sprintf.c
+++ b/ncurses/base/safe_sprintf.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 2018-2021,2023 Thomas E. Dickey *
* Copyright 1998-2012,2013 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -34,7 +34,7 @@
#include <curses.priv.h>
#include <ctype.h>
-MODULE_ID("$Id: safe_sprintf.c,v 1.33 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: safe_sprintf.c,v 1.37 2023/09/30 10:42:42 tom Exp $")
#if USE_SAFE_SPRINTF
@@ -223,9 +223,9 @@ NCURSES_SP_NAME(_nc_printf_string) (NCURSES_SP_DCLx
const char *fmt,
va_list ap)
{
- char *result = 0;
+ char *result = NULL;
- if (SP_PARM != 0 && fmt != 0) {
+ if (SP_PARM != NULL && fmt != NULL) {
#if USE_SAFE_SPRINTF
va_list ap2;
int len;
@@ -238,7 +238,7 @@ NCURSES_SP_NAME(_nc_printf_string) (NCURSES_SP_DCLx
my_length = (size_t) (2 * (len + 1));
my_buffer = typeRealloc(char, my_length, my_buffer);
}
- if (my_buffer != 0) {
+ if (my_buffer != NULL) {
*my_buffer = '\0';
if (len >= 0) {
vsprintf(my_buffer, fmt, ap);
@@ -255,21 +255,37 @@ NCURSES_SP_NAME(_nc_printf_string) (NCURSES_SP_DCLx
if (screen_columns(SP_PARM) > MyCols)
MyCols = screen_columns(SP_PARM);
my_length = (size_t) (MyRows * (MyCols + 1)) + 1;
+ if (my_length < 80)
+ my_length = 80;
my_buffer = typeRealloc(char, my_length, my_buffer);
}
- if (my_buffer != 0) {
+ if (my_buffer != NULL) {
# if HAVE_VSNPRINTF
- vsnprintf(my_buffer, my_length, fmt, ap); /* SUSv2, 1997 */
+ /* SUSv2, 1997 */
+ int used;
+
+ do {
+ va_list ap2;
+
+ begin_va_copy(ap2, ap);
+ used = vsnprintf(my_buffer, my_length, fmt, ap2);
+ end_va_copy(ap2);
+ if (used < (int) my_length)
+ break;
+ my_length = (size_t) ((3 * used) / 2);
+ my_buffer = typeRealloc(char, my_length, my_buffer);
+ } while (my_buffer != NULL);
# else
- vsprintf(my_buffer, fmt, ap); /* ISO/ANSI C, 1989 */
+ /* ISO/ANSI C, 1989 */
+ vsprintf(my_buffer, fmt, ap);
# endif
result = my_buffer;
}
#endif
- } else if (my_buffer != 0) { /* see _nc_freeall() */
+ } else if (my_buffer != NULL) { /* see _nc_freeall() */
free(my_buffer);
- my_buffer = 0;
+ my_buffer = NULL;
my_length = 0;
}
return result;
diff --git a/ncurses/base/tries.c b/ncurses/base/tries.c
index 0f309c213c45..0f8c0516e88f 100644
--- a/ncurses/base/tries.c
+++ b/ncurses/base/tries.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2023 Thomas E. Dickey *
* Copyright 1998-2009,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -39,8 +39,9 @@
*/
#include <curses.priv.h>
+#include <tic.h>
-MODULE_ID("$Id: tries.c,v 1.31 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: tries.c,v 1.32 2023/06/24 15:36:23 tom Exp $")
/*
* Expand a keycode into the string that it corresponds to, returning null if
@@ -124,7 +125,7 @@ _nc_remove_string(TRIES ** tree, const char *string)
{
T((T_CALLED("_nc_remove_string(%p,%s)"), (void *) tree, _nc_visbuf(string)));
- if (string == 0 || *string == 0)
+ if (!VALID_STRING(string) || *string == 0)
returnCode(FALSE);
while (*tree != 0) {
diff --git a/ncurses/base/vsscanf.c b/ncurses/base/vsscanf.c
index ef524250c36f..40ee8bb1d876 100644
--- a/ncurses/base/vsscanf.c
+++ b/ncurses/base/vsscanf.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2023 Thomas E. Dickey *
* Copyright 1998-2004,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -39,15 +39,12 @@
#if !HAVE_VSSCANF
-MODULE_ID("$Id: vsscanf.c,v 1.21 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: vsscanf.c,v 1.22 2023/09/23 18:48:57 tom Exp $")
#if !(HAVE_VFSCANF || HAVE__DOSCAN)
#include <ctype.h>
-#define L_SQUARE '['
-#define R_SQUARE ']'
-
typedef enum {
cUnknown
,cError /* anything that isn't ANSI */
@@ -243,7 +240,7 @@ vsscanf(const char *str, const char *format, va_list ap)
case sPercent:
if (format[n] == '%') {
state = sUnknown;
- } else if (format[n] == L_SQUARE) {
+ } else if (format[n] == L_BLOCK) {
state = sLeft;
} else {
state = sNormal;
@@ -258,7 +255,7 @@ vsscanf(const char *str, const char *format, va_list ap)
}
break;
case sRange:
- if (format[n] == R_SQUARE) {
+ if (format[n] == R_BLOCK) {
state = sFinal;
chunk = cRange;
}
diff --git a/ncurses/base/wresize.c b/ncurses/base/wresize.c
index 30718b8878fd..6d5589e2794e 100644
--- a/ncurses/base/wresize.c
+++ b/ncurses/base/wresize.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2019-2021,2023 Thomas E. Dickey *
* Copyright 1998-2010,2011 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -34,7 +34,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: wresize.c,v 1.41 2020/04/18 21:01:00 tom Exp $")
+MODULE_ID("$Id: wresize.c,v 1.43 2023/10/21 11:13:03 tom Exp $")
static int
cleanup_lines(struct ldat *data, int length)
@@ -55,7 +55,7 @@ repair_subwindows(WINDOW *cmp)
WINDOWLIST *wp;
struct ldat *pline = cmp->_line;
int row;
-#ifdef USE_SP_WINDOWLIST
+#if NCURSES_SP_FUNCS && defined(USE_SP_WINDOWLIST)
SCREEN *sp = _nc_screen_of(cmp);
#endif
@@ -135,7 +135,7 @@ wresize(WINDOW *win, int ToLines, int ToCols)
&& ToCols == size_x)
returnCode(OK);
- if ((win->_flags & _SUBWIN)) {
+ if (IS_SUBWIN(win)) {
/*
* Check if the new limits will fit into the parent window's size. If
* not, do not resize. We could adjust the location of the subwindow,
@@ -169,7 +169,7 @@ wresize(WINDOW *win, int ToLines, int ToCols)
int end = ToCols;
NCURSES_CH_T *s;
- if (!(win->_flags & _SUBWIN)) {
+ if (!IS_SUBWIN(win)) {
if (row <= size_y) {
if (ToCols != size_x) {
s = typeMalloc(NCURSES_CH_T, (unsigned) ToCols + 1);
diff --git a/ncurses/curses.priv.h b/ncurses/curses.priv.h
index a992bc9193f7..68cda17e71a3 100644
--- a/ncurses/curses.priv.h
+++ b/ncurses/curses.priv.h
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2023,2024 Thomas E. Dickey *
* Copyright 1998-2017,2018 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -35,7 +35,7 @@
****************************************************************************/
/*
- * $Id: curses.priv.h,v 1.639 2020/11/14 23:37:54 tom Exp $
+ * $Id: curses.priv.h,v 1.687 2024/04/23 22:28:25 tom Exp $
*
* curses.priv.h
*
@@ -72,12 +72,6 @@ extern "C" {
#include <unistd.h>
#endif
-#if HAVE_LIMITS_H
-# include <limits.h>
-#elif HAVE_SYS_PARAM_H
-# include <sys/param.h>
-#endif
-
#include <assert.h>
#include <stdio.h>
@@ -89,16 +83,6 @@ extern "C" {
# endif
#endif
-#ifndef PATH_MAX
-# if defined(_POSIX_PATH_MAX)
-# define PATH_MAX _POSIX_PATH_MAX
-# elif defined(MAXPATHLEN)
-# define PATH_MAX MAXPATHLEN
-# else
-# define PATH_MAX 255 /* the Posix minimum path-size */
-# endif
-#endif
-
#if DECL_ERRNO
extern int errno;
#endif
@@ -141,6 +125,20 @@ extern int errno;
# endif
#endif
+#if (defined(__USE_MINGW_ANSI_STDIO) && __USE_MINGW_ANSI_STDIO != 0) && (defined(__GNUC__) && (__GNUC__ < 12))
+# undef PRIxPTR /* gcc bug fixed in 12.x */
+# define PRIxPTR "lX"
+# define CASTxPTR(n) (unsigned long)(intptr_t)(void*)(n)
+#else
+# define CASTxPTR(n) (intptr_t)(n)
+#endif
+
+#ifndef PRIxPTR
+# define PRIxPTR "lx"
+# undef CASTxPTR
+# define CASTxPTR(n) (long)(void*)(n)
+#endif
+
/* include signal.h before curses.h to work-around defect in glibc 2.1.3 */
#include <signal.h>
@@ -207,14 +205,21 @@ extern int errno;
#endif
/*
- * If desired, one can configure this, disabling environment variables that
- * point to custom terminfo/termcap locations.
+ * When the standard handles have been redirected (such as inside a text editor
+ * or the less utility), keystrokes must be read from the console rather than
+ * the redirected handle. The standard output handle suffers from a similar
+ * problem. Both handles are not closed once opened. The console shall be
+ * considered reachable throughout the process.
*/
-#ifdef USE_ROOT_ENVIRON
-#define use_terminfo_vars() 1
-#else
-#define use_terminfo_vars() _nc_env_access()
-extern NCURSES_EXPORT(int) _nc_env_access (void);
+#if defined(_NC_WINDOWS)
+#define GetDirectHandle(fileName, shareMode) \
+ CreateFile(TEXT(fileName), \
+ GENERIC_READ | GENERIC_WRITE, \
+ shareMode, \
+ 0, \
+ OPEN_EXISTING, \
+ 0, \
+ 0)
#endif
/*
@@ -292,7 +297,6 @@ extern NCURSES_EXPORT(void *) _nc_memmove (void *, const void *, size_t);
#define NO_TERMINAL "unknown"
#define USE_SP_RIPOFF 1
#define USE_SP_TERMTYPE 1
-#define USE_SP_WINDOWLIST 1
#else
#define NO_TERMINAL 0
#endif
@@ -304,6 +308,12 @@ extern NCURSES_EXPORT(void *) _nc_memmove (void *, const void *, size_t);
NonEmpty(term_env))
/*
+ * Originally a terminal-driver option, the window-list is per-screen to allow
+ * freeing memory used for windows when a screen is deleted.
+ */
+#define USE_SP_WINDOWLIST 1
+
+/*
* 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
@@ -325,6 +335,11 @@ typedef TRIES {
*/
#define StringOf(ch) {ch, 0}
+#define CSI_CHR 0x9b
+#define ESC_CHR 0x1b
+
+#define L_BLOCK '['
+#define R_BLOCK ']'
#define L_BRACE '{'
#define R_BRACE '}'
#define S_QUOTE '\''
@@ -407,7 +422,7 @@ typedef union {
#include <nc_panel.h>
-#include <term.h>
+#include <term.priv.h>
#include <nc_termios.h>
#define IsPreScreen(sp) (((sp) != 0) && sp->_prescreen)
@@ -554,10 +569,10 @@ extern NCURSES_EXPORT(void) _nc_set_no_padding(SCREEN *);
#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 *);
+extern NCURSES_EXPORT(int *) _nc_ptr_Lines (SCREEN *);
+extern NCURSES_EXPORT(int *) _nc_ptr_Cols (SCREEN *);
+extern NCURSES_EXPORT(int *) _nc_ptr_Tabsize (SCREEN *);
+extern NCURSES_EXPORT(int *) _nc_ptr_Escdelay (SCREEN *);
#endif
#if USE_REENTRANT
@@ -586,6 +601,10 @@ NCURSES_EXPORT(int *) _nc_ptr_Escdelay (SCREEN *);
#endif
+#define IS_SUBWIN(w) ((w)->_flags & _SUBWIN)
+#define IS_PAD(w) ((w)->_flags & _ISPAD)
+#define IS_WRAPPED(w) ((w)->_flags & _WRAPPED)
+
#define HasHardTabs() (NonEmpty(clear_all_tabs) && NonEmpty(set_tab))
#define TR_MUTEX(data) _tracef("%s@%d: me:%08lX COUNT:%2u/%2d/%6d/%2d/%s%9u: " #data, \
@@ -679,9 +698,14 @@ extern NCURSES_EXPORT(int) _nc_sigprocmask(int, const sigset_t *, sigset_t *);
#define _nc_lock_global(name) /* nothing */
#define _nc_try_global(name) 0
#define _nc_unlock_global(name) /* nothing */
-
#endif /* USE_PTHREADS */
+#if USE_PTHREADS_EINTR
+extern NCURSES_EXPORT(void) _nc_set_read_thread(bool);
+#else
+#define _nc_set_read_thread(enable) /* nothing */
+#endif
+
/*
* 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
@@ -712,9 +736,18 @@ extern NCURSES_EXPORT(int) _nc_sigprocmask(int, const sigset_t *, sigset_t *);
#endif
-#if HAVE_GETTIMEOFDAY
+#if HAVE_CLOCK_GETTIME
# define PRECISE_GETTIME 1
+# define GetClockTime(t) clock_gettime(CLOCK_REALTIME, t)
+# define TimeType struct timespec
+# define TimeScale 1000000000L /* 1e9 */
+# define sub_secs tv_nsec
+#elif HAVE_GETTIMEOFDAY
+# define PRECISE_GETTIME 1
+# define GetClockTime(t) gettimeofday(t, 0)
# define TimeType struct timeval
+# define TimeScale 1000000L /* 1e6 */
+# define sub_secs tv_usec
#else
# define PRECISE_GETTIME 0
# define TimeType time_t
@@ -810,12 +843,6 @@ typedef struct _SLK {
#endif /* USE_TERMLIB */
-typedef struct {
- WINDOW *win; /* the window used in the hook */
- int line; /* lines to take, < 0 => from bottom*/
- int (*hook)(WINDOW *, int); /* callback for user */
-} ripoff_t;
-
#if USE_GPM_SUPPORT
#undef buttons /* term.h defines this, and gpm uses it! */
#include <gpm.h>
@@ -843,15 +870,11 @@ typedef int (*TYPE_Gpm_GetEvent) (Gpm_Event *);
#endif /* HAVE_LIBDL */
#endif /* USE_GPM_SUPPORT */
-typedef struct {
- long sequence;
- bool last_used;
- char *fix_sgr0; /* this holds the filtered sgr0 string */
- char *last_bufp; /* help with fix_sgr0 leak */
- TERMINAL *last_term;
-} TGETENT_CACHE;
-
-#define TGETENT_MAX 4
+/*
+ * Limit delay-times to 30 seconds, which is consistent with signed 16-bit
+ * numbers in legacy terminfo.
+ */
+#define MAX_DELAY_MSECS 30000
/*
* When converting from terminfo to termcap, check for cases where we can trim
@@ -864,46 +887,6 @@ typedef struct {
#define isoctal(c) ((c) >= '0' && (c) <= '7')
/*
- * State of tparm().
- */
-#define STACKSIZE 20
-
-typedef struct {
- union {
- int num;
- char *str;
- } data;
- bool num_type;
-} STACK_FRAME;
-
-#define NUM_VARS 26
-
-typedef struct {
- const char *tparam_base;
-
- STACK_FRAME stack[STACKSIZE];
- int stack_ptr;
-
- char *out_buff;
- size_t out_size;
- size_t out_used;
-
- char *fmt_buff;
- size_t fmt_size;
-
- int dynamic_var[NUM_VARS];
- int static_vars[NUM_VARS];
-#ifdef TRACE
- const char *tname;
-#endif
-} TPARM_STATE;
-
-typedef struct {
- char *text;
- size_t size;
-} TRACEBUF;
-
-/*
* The filesystem database normally uses a single-letter for the lower level
* of directories. Use a hexadecimal code for filesystems which do not
* preserve mixed-case names.
@@ -923,6 +906,7 @@ typedef struct {
* string is less than 80 columns, but this buffer size is an absolute
* limit.
*/
+#define TRACECHR_BUF 40
#define TRACEMSE_MAX (80 + (5 * 10) + (32 * 15))
#define TRACEMSE_FMT "id %2d at (%2d, %2d, %2d) state %4lx = {" /* } */
@@ -933,132 +917,8 @@ struct DriverTCB; /* Terminal Control Block forward declaration */
#define INIT_TERM_DRIVER() /* nothing */
#endif
-typedef struct {
- const char *name;
- char *value;
-} ITERATOR_VARS;
-
-/*
- * Global data which is not specific to a screen.
- */
-typedef struct {
- SIG_ATOMIC_T have_sigtstp;
- SIG_ATOMIC_T have_sigwinch;
- SIG_ATOMIC_T cleanup_nested;
-
- bool init_signals;
- bool init_screen;
-
- char *comp_sourcename;
- char *comp_termtype;
-
- bool have_tic_directory;
- bool keep_tic_directory;
- const char *tic_directory;
-
- char *dbi_list;
- int dbi_size;
-
- char *first_name;
- char **keyname_table;
- int init_keyname;
-
- int slk_format;
-
- int getstr_limit; /* getstr_limit based on POSIX LINE_MAX */
-
- char *safeprint_buf;
- size_t safeprint_used;
-
- TGETENT_CACHE tgetent_cache[TGETENT_MAX];
- int tgetent_index;
- long tgetent_sequence;
-
- char *dbd_blob; /* string-heap for dbd_list[] */
- char **dbd_list; /* distinct places to look for data */
- int dbd_size; /* length of dbd_list[] */
- time_t dbd_time; /* cache last updated */
- ITERATOR_VARS dbd_vars[dbdLAST];
-
-#if HAVE_TSEARCH
- void *cached_tparm;
- int count_tparm;
-#endif /* HAVE_TSEARCH */
-
-#ifdef USE_TERM_DRIVER
- int (*term_driver)(struct DriverTCB*, const char*, int*);
-#endif
-
-#ifndef USE_SP_WINDOWLIST
- WINDOWLIST *_nc_windowlist;
-#define WindowList(sp) _nc_globals._nc_windowlist
-#endif
-
-#if USE_HOME_TERMINFO
- char *home_terminfo;
-#endif
-
-#if !USE_SAFE_SPRINTF
- int safeprint_cols;
- int safeprint_rows;
-#endif
-
-#ifdef USE_PTHREADS
- pthread_mutex_t mutex_curses;
- pthread_mutex_t mutex_prescreen;
- pthread_mutex_t mutex_screen;
- pthread_mutex_t mutex_update;
- pthread_mutex_t mutex_tst_tracef;
- pthread_mutex_t mutex_tracef;
- int nested_tracef;
- int use_pthreads;
-#define _nc_use_pthreads _nc_globals.use_pthreads
-#if USE_PTHREADS_EINTR
- pthread_t read_thread; /* The reading thread */
-#endif
-#endif
-#if USE_WIDEC_SUPPORT
- char key_name[MB_LEN_MAX + 1];
-#endif
-
-#ifdef TRACE
- bool trace_opened;
- char trace_fname[PATH_MAX];
- int trace_level;
- FILE *trace_fp;
- int trace_fd;
-
- char *tracearg_buf;
- size_t tracearg_used;
-
- TRACEBUF *tracebuf_ptr;
- size_t tracebuf_used;
-
- char tracechr_buf[40];
-
- char *tracedmp_buf;
- size_t tracedmp_used;
-
- unsigned char *tracetry_buf;
- size_t tracetry_used;
-
- 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 */
-
-#if NO_LEAKS
- bool leak_checking;
-#endif
-} NCURSES_GLOBALS;
-
extern NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals;
-#define N_RIPS 5
-
/* The limit reserves one byte for a terminating NUL */
#define my_getstr_limit (_nc_globals.getstr_limit - 1)
#define _nc_getstr_limit(n) \
@@ -1068,54 +928,6 @@ extern NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals;
? my_getstr_limit \
: (n)))
-#ifdef USE_PTHREADS
-typedef struct _prescreen_list {
- struct _prescreen_list *next;
- pthread_t id;
- struct screen *sp;
-} PRESCREEN_LIST;
-#endif
-
-/*
- * Global data which can be swept up into a SCREEN when one is created.
- * It may be modified before the next SCREEN is created.
- */
-typedef struct {
-#ifdef USE_PTHREADS
- PRESCREEN_LIST *allocated;
-#else
- struct screen * allocated;
-#endif
- bool use_env;
- bool filter_mode;
- attr_t previous_attr;
- TPARM_STATE tparm_state;
- TTY *saved_tty; /* savetty/resetty information */
- bool use_tioctl;
- NCURSES_SP_OUTC _outch; /* output handler if not putc */
-#ifndef USE_SP_RIPOFF
- ripoff_t rippedoff[N_RIPS];
- ripoff_t *rsp;
-#endif
-#if NCURSES_NO_PADDING
- bool _no_padding; /* flag to set if padding disabled */
-#endif
-#if BROKEN_LINKER || USE_REENTRANT
- chtype *real_acs_map;
- int _LINES;
- int _COLS;
- int _TABSIZE;
- int _ESCDELAY;
- TERMINAL *_cur_term;
-#endif
-#ifdef TRACE
-#if BROKEN_LINKER || USE_REENTRANT
- long _outchars;
- const char *_tputs_trace;
-#endif
-#endif
-} NCURSES_PRESCREEN;
-
/*
* Use screen-specific ripoff data (for softkeys) rather than global.
*/
@@ -1130,16 +942,29 @@ typedef struct {
extern NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen;
typedef enum {
- ewInitial = 0,
+ ewUnknown = 0,
+ ewInitial,
ewRunning,
ewSuspend
} ENDWIN;
+typedef struct {
+ int _nl; /* True if NL -> CR/NL is on */
+ int _raw; /* True if in raw mode */
+ int _cbreak; /* 1 if in cbreak mode */
+ /* > 1 if in halfdelay mode */
+ int _echo; /* True if echo on */
+} TTY_FLAGS;
+
+#define IsNl(sp) (sp)->_tty_flags._nl
+#define IsRaw(sp) (sp)->_tty_flags._raw
+#define IsCbreak(sp) (sp)->_tty_flags._cbreak
+#define IsEcho(sp) (sp)->_tty_flags._echo
+
/*
* The SCREEN structure.
*/
-
-struct screen {
+typedef struct screen {
int _ifd; /* input file descriptor for screen */
int _ofd; /* output file descriptor for screen */
FILE *_ofp; /* output file ptr for screen */
@@ -1186,11 +1011,7 @@ struct screen {
int _cursrow; /* physical cursor row */
int _curscol; /* physical cursor column */
bool _notty; /* true if we cannot switch non-tty */
- int _nl; /* True if NL -> CR/NL is on */
- int _raw; /* True if in raw mode */
- int _cbreak; /* 1 if in cbreak mode */
- /* > 1 if in halfdelay mode */
- int _echo; /* True if echo on */
+ TTY_FLAGS _tty_flags;
int _use_meta; /* use the meta key? */
struct _SLK *_slk; /* ptr to soft key struct / NULL */
int slk_format; /* selected format for this screen */
@@ -1416,14 +1237,15 @@ struct screen {
#endif
#ifdef TRACE
- char tracechr_buf[40];
+ char tracechr_buf[TRACECHR_BUF];
char tracemse_buf[TRACEMSE_MAX];
#if USE_REENTRANT
long _outchars;
const char *_tputs_trace;
#endif
#endif
-};
+#undef SCREEN
+} SCREEN;
extern NCURSES_EXPORT_VAR(SCREEN *) _nc_screen_chain;
extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
@@ -1449,18 +1271,18 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
#endif
#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 = ewSuspend; \
- sp->_cursor = -1; \
+ sp->_cursrow = -1; \
+ sp->_curscol = -1; \
+ IsNl(sp) = TRUE; \
+ IsRaw(sp) = FALSE; \
+ IsCbreak(sp) = 0; \
+ IsEcho(sp) = TRUE; \
+ sp->_fifohead = -1; \
+ sp->_endwin = ewSuspend; \
+ sp->_cursor = -1; \
SP_INIT_WINDOWLIST(sp); \
- sp->_outch = NCURSES_OUTC_FUNC; \
- sp->jump = 0 \
+ sp->_outch = NCURSES_OUTC_FUNC; \
+ sp->jump = 0 \
/* usually in <limits.h> */
#ifndef UCHAR_MAX
@@ -1473,12 +1295,12 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
/* Checks for isprint() should be done on 8-bit characters (non-wide) */
#define is8bits(c) ((unsigned)(c) <= UCHAR_MAX)
-#ifndef min
-#define min(a,b) ((a) > (b) ? (b) : (a))
+#ifndef Min
+#define Min(a,b) ((a) > (b) ? (b) : (a))
#endif
-#ifndef max
-#define max(a,b) ((a) < (b) ? (b) : (a))
+#ifndef Max
+#define Max(a,b) ((a) < (b) ? (b) : (a))
#endif
/* usually in <unistd.h> */
@@ -1542,14 +1364,11 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
#define TR_PUTC(c) TR(TRACE_CHARPUT, ("PUTC %#x", UChar(c)))
-#ifndef MB_LEN_MAX
-#define MB_LEN_MAX 8 /* should be >= MB_CUR_MAX, but that may be a function */
-#endif
-
#if USE_WIDEC_SUPPORT /* { */
+/* true if the status/errno indicate an illegal multibyte sequence */
#define isEILSEQ(status) (((size_t)status == (size_t)-1) && (errno == EILSEQ))
-#define init_mb(state) memset(&state, 0, sizeof(state))
+#define init_mb(state) memset(&(state), 0, sizeof(state))
#if NCURSES_EXT_COLORS
#define NulColor , 0
@@ -1557,7 +1376,20 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
#define NulColor /* nothing */
#endif
-#define NulChar 0,0,0,0 /* FIXME: see CCHARW_MAX */
+#if CCHARW_MAX > 6
+#define NulChar 0,0,0,0,0
+#elif CCHARW_MAX > 5
+#define NulChar 0,0,0,0 /* ncurses7 */
+#elif CCHARW_MAX > 4
+#define NulChar 0,0,0 /* ncurses6 */
+#elif CCHARW_MAX > 3
+#define NulChar 0,0
+#elif CCHARW_MAX > 2
+#define NulChar 0
+#else
+#define NulChar /* nothing */
+#endif
+
#define CharOf(c) ((c).chars[0])
#define AttrOf(c) ((c).attr)
@@ -1568,29 +1400,25 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
#define NewChar2(c,a) { a, { c, NulChar } NulColor }
#define NewChar(ch) NewChar2(ChCharOf(ch), ChAttrOf(ch))
-#if CCHARW_MAX == 5
+#if CCHARW_MAX > 1
#define CharEq(a,b) (((a).attr == (b).attr) \
- && (a).chars[0] == (b).chars[0] \
- && (a).chars[1] == (b).chars[1] \
- && (a).chars[2] == (b).chars[2] \
- && (a).chars[3] == (b).chars[3] \
- && (a).chars[4] == (b).chars[4] \
+ && !memcmp((a).chars, \
+ (b).chars, \
+ CCHARW_MAX * sizeof((b).chars[0])) \
if_EXT_COLORS(&& (a).ext_color == (b).ext_color))
-#elif CCHARW_MAX > 0
-#error Inconsistent values for CCHARW_MAX
#else
#define CharEq(a,b) (!memcmp(&(a), &(b), sizeof(a)))
#endif
#define SetChar(ch,c,a) do { \
- NCURSES_CH_T *_cp = &ch; \
+ NCURSES_CH_T *_cp = &(ch); \
memset(_cp, 0, sizeof(ch)); \
_cp->chars[0] = (wchar_t) (c); \
_cp->attr = (a); \
if_EXT_COLORS(SetPair(ch, PairNumber(a))); \
} while (0)
-#define CHREF(wch) (&wch)
-#define CHDEREF(wch) (*wch)
+#define CHREF(wch) (&(wch))
+#define CHDEREF(wch) (*(wch))
#define ARG_CH_T NCURSES_CH_T *
#define CARG_CH_T const NCURSES_CH_T *
#define PUTC_DATA char PUTC_buf[MB_LEN_MAX]; int PUTC_i, PUTC_n; \
@@ -1678,7 +1506,7 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
#define isWidecExt(ch) (0)
#define if_WIDEC(code) /* nothing */
-#define Charable(ch) ((ch) >= ' ' && (ch) <= '~')
+#define Charable(ch) (CharOf(ch) >= ' ' && CharOf(ch) <= '~')
#define L(ch) ch
#endif /* } */
@@ -1720,6 +1548,9 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
#define SIZEOF(v) (sizeof(v)/sizeof(v[0]))
+#include <nc_alloc.h>
+#include <nc_access.h>
+
#define FreeIfNeeded(p) if ((p) != 0) free(p)
/* FreeAndNull() is not a comma-separated expression because some compilers
@@ -1727,7 +1558,18 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
*/
#define FreeAndNull(p) do { free(p); p = 0; } while (0)
-#include <nc_alloc.h>
+#ifdef EXP_OOM_TESTING
+extern NCURSES_EXPORT(void *) _nc_oom_malloc(size_t size);
+extern NCURSES_EXPORT(void *) _nc_oom_calloc(size_t nmemb, size_t size);
+extern NCURSES_EXPORT(void *) _nc_oom_realloc(void *ptr, size_t size);
+extern NCURSES_EXPORT(void) _nc_oom_free(void *ptr);
+extern NCURSES_EXPORT(char *) _nc_oom_strdup(const char *ptr);
+#define malloc(size) _nc_oom_malloc(size)
+#define calloc(nmemb, size) _nc_oom_calloc(nmemb, size)
+#define realloc(ptr, size) _nc_oom_realloc(ptr, size)
+#define free(ptr) _nc_oom_free(ptr)
+#define strdup(ptr) _nc_oom_strdup(ptr)
+#endif
/*
* Use these for tic/infocmp malloc failures. Generally the ncurses library
@@ -1740,6 +1582,13 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
_nc_err_abort(MSG_NO_MEMORY); \
} while (0)
+#define TYPE_CALLOC(type, size, name) \
+ do { \
+ name = typeCalloc(type, size); \
+ if (name == 0) \
+ _nc_err_abort(MSG_NO_MEMORY); \
+ } while (0)
+
#define TYPE_REALLOC(type, size, name) \
do { \
name = typeRealloc(type, size, name); \
@@ -1848,11 +1697,13 @@ typedef void VoidFunc(void);
#define returnMMask(code) TRACE_RETURN_SP(code,mmask_t)
#define returnPtr(code) TRACE_RETURN1(code,ptr)
#define returnSP(code) TRACE_RETURN1(code,sp)
-#define returnVoid T((T_RETURN(""))); return
+#define returnVoid { T((T_RETURN(""))); return; }
#define returnVoidPtr(code) TRACE_RETURN1(code,void_ptr)
#define returnWin(code) TRACE_RETURN1(code,win)
#define returnDB(rc) do { TR(TRACE_DATABASE,(T_RETURN("code %d"), (rc))); return (rc); } while (0)
+#define returnPtrDB(rc) do { TR(TRACE_DATABASE,(T_RETURN("%p"), (rc))); return (rc); } while (0)
+#define returnVoidDB do { TR(TRACE_DATABASE,(T_RETURN(""))); return; } while (0)
extern NCURSES_EXPORT(NCURSES_BOOL) _nc_retrace_bool (int);
extern NCURSES_EXPORT(NCURSES_CONST void *) _nc_retrace_cvoid_ptr (NCURSES_CONST void *);
@@ -1927,6 +1778,8 @@ extern NCURSES_EXPORT(const char *) _nc_viscbuf (const NCURSES_CH_T *, int);
#define returnWin(code) return code
#define returnDB(code) return code
+#define returnPtrDB(rc) return rc
+#define returnVoidDB return
#endif /* TRACE/!TRACE */
@@ -2132,11 +1985,11 @@ extern NCURSES_EXPORT(void) _nc_linedump (void);
/* 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(int) _nc_msec_cost (const char *const, int);
/* lib_addch.c */
#if USE_WIDEC_SUPPORT
-NCURSES_EXPORT(int) _nc_build_wch(WINDOW *win, ARG_CH_T ch);
+extern NCURSES_EXPORT(int) _nc_build_wch(WINDOW *win, ARG_CH_T ch);
#endif
/* lib_addstr.c */
@@ -2249,7 +2102,7 @@ typedef struct {
/* strings.c */
extern NCURSES_EXPORT(string_desc *) _nc_str_init (string_desc *, char *, size_t);
extern NCURSES_EXPORT(string_desc *) _nc_str_null (string_desc *, size_t);
-extern NCURSES_EXPORT(string_desc *) _nc_str_copy (string_desc *, string_desc *);
+extern NCURSES_EXPORT(string_desc *) _nc_str_copy (string_desc *, const string_desc *);
extern NCURSES_EXPORT(bool) _nc_safe_strcat (string_desc *, const char *);
extern NCURSES_EXPORT(bool) _nc_safe_strcpy (string_desc *, const char *);
@@ -2290,6 +2143,7 @@ extern NCURSES_EXPORT(int) _nc_read_termcap_entry (const char *const, TERMTYPE2
extern NCURSES_EXPORT(int) _nc_setup_tinfo(const char *, TERMTYPE2 *);
extern NCURSES_EXPORT(int) _nc_setupscreen (int, int, FILE *, int, int);
extern NCURSES_EXPORT(int) _nc_timed_wait (SCREEN *, int, int, int * EVENTLIST_2nd(_nc_eventlist *));
+extern NCURSES_EXPORT(int) _nc_trans_string (char *, const char *);
extern NCURSES_EXPORT(void) _nc_init_termtype (TERMTYPE2 *const);
extern NCURSES_EXPORT(void) _nc_do_color (int, int, int, NCURSES_OUTC);
extern NCURSES_EXPORT(void) _nc_flush (void);
@@ -2299,6 +2153,7 @@ extern NCURSES_EXPORT(void) _nc_hash_map (void);
extern NCURSES_EXPORT(void) _nc_init_keytry (SCREEN *);
extern NCURSES_EXPORT(void) _nc_keep_tic_dir (const char *);
extern NCURSES_EXPORT(void) _nc_make_oldhash (int i);
+extern NCURSES_EXPORT(void) _nc_reset_input (FILE *, char *);
extern NCURSES_EXPORT(void) _nc_scroll_oldhash (int n, int top, int bot);
extern NCURSES_EXPORT(void) _nc_scroll_optimize (void);
extern NCURSES_EXPORT(void) _nc_set_buffer (FILE *, int);
@@ -2313,6 +2168,8 @@ extern NCURSES_EXPORT(const TERMTYPE2 *) _nc_fallback2 (const char *);
#define _nc_fallback2(tp) _nc_fallback(tp)
#endif
+extern NCURSES_EXPORT(void) _nc_copy_termtype(TERMTYPE *, const TERMTYPE *);
+
#if NCURSES_EXT_NUMBERS
extern NCURSES_EXPORT(void) _nc_copy_termtype2 (TERMTYPE2 *, const TERMTYPE2 *);
extern NCURSES_EXPORT(void) _nc_export_termtype2(TERMTYPE *, const TERMTYPE2 *);
@@ -2335,7 +2192,7 @@ extern NCURSES_EXPORT(void) _nc_comp_userdefs_leaks(void);
extern NCURSES_EXPORT(void) _nc_db_iterator_leaks(void);
extern NCURSES_EXPORT(void) _nc_keyname_leaks(void);
extern NCURSES_EXPORT(void) _nc_names_leaks(void);
-extern NCURSES_EXPORT(void) _nc_tgetent_leak(TERMINAL *);
+extern NCURSES_EXPORT(void) _nc_tgetent_leak(const TERMINAL *);
extern NCURSES_EXPORT(void) _nc_tgetent_leaks(void);
#endif
@@ -2391,17 +2248,23 @@ extern int __MINGW_NOTHROW _nc_mblen(const char *, size_t);
#endif /* _NC_WINDOWS && !_NC_MSC */
+#if defined(_NC_WINDOWS) || defined(_NC_MINGW)
+/* see wcwidth.c */
+extern NCURSES_EXPORT(int) mk_wcwidth(wchar_t);
+#define wcwidth(ucs) _nc_wcwidth(ucs)
+#endif
+
#if HAVE_MBTOWC && HAVE_MBLEN
#define reset_mbytes(state) IGNORE_RC(mblen(NULL, (size_t) 0)), IGNORE_RC(mbtowc(NULL, NULL, (size_t) 0))
#define count_mbytes(buffer,length,state) mblen(buffer,length)
#define check_mbytes(wch,buffer,length,state) \
- (int) mbtowc(&wch, buffer, length)
+ (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 count_mbytes(buffer,length,state) mbrlen(buffer,length,&(state))
#define check_mbytes(wch,buffer,length,state) \
- (int) mbrtowc(&wch, buffer, length, &state)
+ (int) mbrtowc(&(wch), buffer, length, &(state))
#else
make an error
#endif
@@ -2450,7 +2313,7 @@ extern NCURSES_EXPORT_VAR(SCREEN *) SP;
/*
* We don't want to use the lines or columns capabilities internally, because
- * if the application is running multiple screens under X, it's quite possible
+ * if the application is running multiple screens under X, it is quite possible
* they could all have type xterm but have different sizes! So...
*/
#define screen_lines(sp) (sp)->_lines
@@ -2668,13 +2531,21 @@ extern NCURSES_EXPORT_VAR(TERM_DRIVER) _nc_TINFO_DRIVER;
#define NC_ISATTY(fd) isatty(fd)
#endif
+/*
+ * Perhaps not "real" but possibly not "fake".
+ */
+#define IsRealTty(fd,value) \
+ (NC_ISATTY(fd) \
+ && (value = ttyname(fd)) != NULL \
+ && strncmp(value, "/dev/pts/", 9))
+
#ifdef USE_TERM_DRIVER
# define IsTermInfo(sp) ((TCBOf(sp) != 0) && ((TCBOf(sp)->drv->isTerminfo)))
# define HasTInfoTerminal(sp) ((0 != TerminalOf(sp)) && IsTermInfo(sp))
# if defined(EXP_WIN32_DRIVER)
-# define IsTermInfoOnConsole(sp) (IsTermInfo(sp)&&_nc_console_test(TerminalOf(sp)->Filedes))
+# define IsTermInfoOnConsole(sp) (IsTermInfo(sp) && _nc_console_test(TerminalOf(sp)->Filedes))
# elif defined(USE_WIN32CON_DRIVER)
-# define IsTermInfoOnConsole(sp) (IsTermInfo(sp)&&_nc_mingw_isconsole(TerminalOf(sp)->Filedes))
+# define IsTermInfoOnConsole(sp) (IsTermInfo(sp) && _nc_mingw_isconsole(TerminalOf(sp)->Filedes))
# else
# define IsTermInfoOnConsole(sp) FALSE
# endif
@@ -2733,7 +2604,7 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_tgetent)(SCREEN*,char*,const
extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_do_color)(SCREEN*, int, int, int, 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 GCC_NORETURN NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_free_and_exit)(SCREEN*, int);
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*);
@@ -2779,8 +2650,8 @@ extern NCURSES_EXPORT(NCURSES_CONST char *) _nc_unctrl (SCREEN *, chtype);
#endif
#ifdef EXP_XTERM_1005
-NCURSES_EXPORT(int) _nc_conv_to_utf8(unsigned char *, unsigned, unsigned);
-NCURSES_EXPORT(int) _nc_conv_to_utf32(unsigned *, const char *, unsigned);
+extern NCURSES_EXPORT(int) _nc_conv_to_utf8(unsigned char *, unsigned, unsigned);
+extern NCURSES_EXPORT(int) _nc_conv_to_utf32(unsigned *, const char *, unsigned);
#endif
#ifdef __cplusplus
diff --git a/ncurses/llib-lncurses b/ncurses/llib-lncurses
index 3033100792bf..5069c22221a1 100644
--- a/ncurses/llib-lncurses
+++ b/ncurses/llib-lncurses
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2019-2022,2023 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -70,7 +70,7 @@ void _nc_hash_map(void)
#undef _nc_make_oldhash_sp
void _nc_make_oldhash_sp(
- SCREEN *sp,
+ SCREEN *sp,
int i)
{ /* void */ }
@@ -81,16 +81,16 @@ void _nc_make_oldhash(
#undef _nc_scroll_oldhash_sp
void _nc_scroll_oldhash_sp(
- SCREEN *sp,
- int n,
- int top,
+ SCREEN *sp,
+ int n,
+ int top,
int bot)
{ /* void */ }
#undef _nc_scroll_oldhash
void _nc_scroll_oldhash(
- int n,
- int top,
+ int n,
+ int top,
int bot)
{ /* void */ }
@@ -98,25 +98,25 @@ void _nc_scroll_oldhash(
#undef _nc_render
chtype _nc_render(
- WINDOW *win,
+ WINDOW *win,
chtype ch)
{ return(*(chtype *)0); }
#undef _nc_waddch_nosync
int _nc_waddch_nosync(
- WINDOW *win,
+ WINDOW *win,
const chtype c)
{ return(*(int *)0); }
#undef waddch
int waddch(
- WINDOW *win,
+ WINDOW *win,
const chtype ch)
{ return(*(int *)0); }
#undef wechochar
int wechochar(
- WINDOW *win,
+ WINDOW *win,
const chtype ch)
{ return(*(int *)0); }
@@ -124,15 +124,15 @@ int wechochar(
#undef waddnstr
int waddnstr(
- WINDOW *win,
- const char *astr,
+ WINDOW *win,
+ const char *astr,
int n)
{ return(*(int *)0); }
#undef waddchnstr
int waddchnstr(
- WINDOW *win,
- const chtype *astr,
+ WINDOW *win,
+ const chtype *astr,
int n)
{ return(*(int *)0); }
@@ -151,13 +151,13 @@ int beep(void)
#undef wbkgdset
void wbkgdset(
- WINDOW *win,
+ WINDOW *win,
chtype ch)
{ /* void */ }
#undef wbkgd
int wbkgd(
- WINDOW *win,
+ WINDOW *win,
chtype ch)
{ return(*(int *)0); }
@@ -165,14 +165,14 @@ int wbkgd(
#undef wborder
int wborder(
- WINDOW *win,
- chtype ls,
- chtype rs,
- chtype ts,
- chtype bs,
- chtype tl,
- chtype tr,
- chtype bl,
+ WINDOW *win,
+ chtype ls,
+ chtype rs,
+ chtype ts,
+ chtype bs,
+ chtype tl,
+ chtype tr,
+ chtype bl,
chtype br)
{ return(*(int *)0); }
@@ -180,10 +180,10 @@ int wborder(
#undef wchgat
int wchgat(
- WINDOW *win,
- int n,
- attr_t attr,
- short pair_arg,
+ WINDOW *win,
+ int n,
+ attr_t attr,
+ short pair_arg,
const void *opts)
{ return(*(int *)0); }
@@ -198,7 +198,7 @@ int wclear(
#undef clearok
int clearok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
@@ -243,62 +243,62 @@ int start_color(void)
#undef _nc_change_pair
void _nc_change_pair(
- SCREEN *sp,
+ SCREEN *sp,
int pair)
{ /* void */ }
#undef _nc_reserve_pairs
void _nc_reserve_pairs(
- SCREEN *sp,
+ SCREEN *sp,
int want)
{ /* void */ }
#undef _nc_init_pair
int _nc_init_pair(
- SCREEN *sp,
- int pair,
- int f,
+ SCREEN *sp,
+ int pair,
+ int f,
int b)
{ return(*(int *)0); }
#undef init_pair_sp
int init_pair_sp(
- SCREEN *sp,
- short pair,
- short f,
+ SCREEN *sp,
+ short pair,
+ short f,
short b)
{ return(*(int *)0); }
#undef init_pair
int init_pair(
- short pair,
- short f,
+ short pair,
+ short f,
short b)
{ return(*(int *)0); }
#undef _nc_init_color
int _nc_init_color(
- SCREEN *sp,
- int color,
- int r,
- int g,
+ SCREEN *sp,
+ int color,
+ int r,
+ int g,
int b)
{ return(*(int *)0); }
#undef init_color_sp
int init_color_sp(
- SCREEN *sp,
- short color,
- short r,
- short g,
+ 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 color,
+ short r,
+ short g,
short b)
{ return(*(int *)0); }
@@ -322,58 +322,58 @@ NCURSES_BOOL has_colors(void)
#undef color_content_sp
int color_content_sp(
- SCREEN *sp,
- short color,
- short *r,
- short *g,
+ 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 color,
+ short *r,
+ short *g,
short *b)
{ return(*(int *)0); }
#undef _nc_pair_content
int _nc_pair_content(
- SCREEN *sp,
- int pair,
- int *f,
+ SCREEN *sp,
+ int pair,
+ int *f,
int *b)
{ return(*(int *)0); }
#undef pair_content_sp
int pair_content_sp(
- SCREEN *sp,
- short pair,
- short *f,
+ SCREEN *sp,
+ short pair,
+ short *f,
short *b)
{ return(*(int *)0); }
#undef pair_content
int pair_content(
- short pair,
- short *f,
+ short pair,
+ short *f,
short *b)
{ return(*(int *)0); }
#undef _nc_do_color_sp
void _nc_do_color_sp(
- SCREEN *sp,
- int old_pair,
- int pair,
- int reverse,
+ SCREEN *sp,
+ int old_pair,
+ int pair,
+ int reverse,
NCURSES_OUTC_sp outc)
{ /* void */ }
#undef _nc_do_color
void _nc_do_color(
- int old_pair,
- int pair,
- int reverse,
+ int old_pair,
+ int pair,
+ int reverse,
NCURSES_OUTC outc)
{ /* void */ }
@@ -381,8 +381,8 @@ void _nc_do_color(
#undef wcolor_set
int wcolor_set(
- WINDOW *win,
- short pair_arg,
+ WINDOW *win,
+ short pair_arg,
void *opts)
{ return(*(int *)0); }
@@ -458,7 +458,7 @@ int addch(
#undef addchnstr
int addchnstr(
- const chtype *a1,
+ const chtype *a1,
int z)
{ return(*(int *)0); }
@@ -469,7 +469,7 @@ int addchstr(
#undef addnstr
int addnstr(
- const char *a1,
+ const char *a1,
int z)
{ return(*(int *)0); }
@@ -480,42 +480,42 @@ int addstr(
#undef attroff
int attroff(
- int z)
+ NCURSES_ATTR_T z)
{ return(*(int *)0); }
#undef attron
int attron(
- int z)
+ NCURSES_ATTR_T z)
{ return(*(int *)0); }
#undef attrset
int attrset(
- int z)
+ NCURSES_ATTR_T z)
{ return(*(int *)0); }
#undef attr_get
int attr_get(
- attr_t *a1,
- short *a2,
+ attr_t *a1,
+ short *a2,
void *z)
{ return(*(int *)0); }
#undef attr_off
int attr_off(
- attr_t a1,
+ attr_t a1,
void *z)
{ return(*(int *)0); }
#undef attr_on
int attr_on(
- attr_t a1,
+ attr_t a1,
void *z)
{ return(*(int *)0); }
#undef attr_set
int attr_set(
- attr_t a1,
- short a2,
+ attr_t a1,
+ short a2,
void *z)
{ return(*(int *)0); }
@@ -531,28 +531,28 @@ void bkgdset(
#undef border
int border(
- chtype a1,
- chtype a2,
- chtype a3,
- chtype a4,
- chtype a5,
- chtype a6,
- chtype a7,
+ 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,
+ WINDOW *a1,
+ chtype a2,
chtype z)
{ return(*(int *)0); }
#undef chgat
int chgat(
- int a1,
- attr_t a2,
- short a3,
+ int a1,
+ attr_t a2,
+ short a3,
const void *z)
{ return(*(int *)0); }
@@ -570,7 +570,7 @@ int clrtoeol(void)
#undef color_set
int color_set(
- short a1,
+ short a1,
void *z)
{ return(*(int *)0); }
@@ -607,7 +607,7 @@ int getch(void)
#undef getnstr
int getnstr(
- char *a1,
+ char *a1,
int z)
{ return(*(int *)0); }
@@ -618,7 +618,7 @@ int getstr(
#undef hline
int hline(
- chtype a1,
+ chtype a1,
int z)
{ return(*(int *)0); }
@@ -628,7 +628,7 @@ chtype inch(void)
#undef inchnstr
int inchnstr(
- chtype *a1,
+ chtype *a1,
int z)
{ return(*(int *)0); }
@@ -639,7 +639,7 @@ int inchstr(
#undef innstr
int innstr(
- char *a1,
+ char *a1,
int z)
{ return(*(int *)0); }
@@ -659,7 +659,7 @@ int insertln(void)
#undef insnstr
int insnstr(
- const char *a1,
+ const char *a1,
int z)
{ return(*(int *)0); }
@@ -675,323 +675,323 @@ int instr(
#undef move
int move(
- int a1,
+ int a1,
int z)
{ return(*(int *)0); }
#undef mvaddch
int mvaddch(
- int a1,
- int a2,
+ int a1,
+ int a2,
const chtype z)
{ return(*(int *)0); }
#undef mvaddchnstr
int mvaddchnstr(
- int a1,
- int a2,
- const chtype *a3,
+ int a1,
+ int a2,
+ const chtype *a3,
int z)
{ return(*(int *)0); }
#undef mvaddchstr
int mvaddchstr(
- int a1,
- int a2,
+ int a1,
+ int a2,
const chtype *z)
{ return(*(int *)0); }
#undef mvaddnstr
int mvaddnstr(
- int a1,
- int a2,
- const char *a3,
+ int a1,
+ int a2,
+ const char *a3,
int z)
{ return(*(int *)0); }
#undef mvaddstr
int mvaddstr(
- int a1,
- int a2,
+ 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,
+ int a1,
+ int a2,
+ int a3,
+ attr_t a4,
+ short a5,
const void *z)
{ return(*(int *)0); }
#undef mvdelch
int mvdelch(
- int a1,
+ int a1,
int z)
{ return(*(int *)0); }
#undef mvgetch
int mvgetch(
- int a1,
+ int a1,
int z)
{ return(*(int *)0); }
#undef mvgetnstr
int mvgetnstr(
- int a1,
- int a2,
- char *a3,
+ int a1,
+ int a2,
+ char *a3,
int z)
{ return(*(int *)0); }
#undef mvgetstr
int mvgetstr(
- int a1,
- int a2,
+ int a1,
+ int a2,
char *z)
{ return(*(int *)0); }
#undef mvhline
int mvhline(
- int a1,
- int a2,
- chtype a3,
+ int a1,
+ int a2,
+ chtype a3,
int z)
{ return(*(int *)0); }
#undef mvinch
chtype mvinch(
- int a1,
+ int a1,
int z)
{ return(*(chtype *)0); }
#undef mvinchnstr
int mvinchnstr(
- int a1,
- int a2,
- chtype *a3,
+ int a1,
+ int a2,
+ chtype *a3,
int z)
{ return(*(int *)0); }
#undef mvinchstr
int mvinchstr(
- int a1,
- int a2,
+ int a1,
+ int a2,
chtype *z)
{ return(*(int *)0); }
#undef mvinnstr
int mvinnstr(
- int a1,
- int a2,
- char *a3,
+ int a1,
+ int a2,
+ char *a3,
int z)
{ return(*(int *)0); }
#undef mvinsch
int mvinsch(
- int a1,
- int a2,
+ int a1,
+ int a2,
chtype z)
{ return(*(int *)0); }
#undef mvinsnstr
int mvinsnstr(
- int a1,
- int a2,
- const char *a3,
+ int a1,
+ int a2,
+ const char *a3,
int z)
{ return(*(int *)0); }
#undef mvinsstr
int mvinsstr(
- int a1,
- int a2,
+ int a1,
+ int a2,
const char *z)
{ return(*(int *)0); }
#undef mvinstr
int mvinstr(
- int a1,
- int a2,
+ int a1,
+ int a2,
char *z)
{ return(*(int *)0); }
#undef mvvline
int mvvline(
- int a1,
- int a2,
- chtype a3,
+ int a1,
+ int a2,
+ chtype a3,
int z)
{ return(*(int *)0); }
#undef mvwaddch
int mvwaddch(
- WINDOW *a1,
- int a2,
- int a3,
+ 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,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ const chtype *a4,
int z)
{ return(*(int *)0); }
#undef mvwaddchstr
int mvwaddchstr(
- WINDOW *a1,
- int a2,
- int a3,
+ 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,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ const char *a4,
int z)
{ return(*(int *)0); }
#undef mvwaddstr
int mvwaddstr(
- WINDOW *a1,
- int a2,
- int a3,
+ 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,
+ 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,
+ WINDOW *a1,
+ int a2,
int z)
{ return(*(int *)0); }
#undef mvwgetch
int mvwgetch(
- WINDOW *a1,
- int a2,
+ WINDOW *a1,
+ int a2,
int z)
{ return(*(int *)0); }
#undef mvwgetnstr
int mvwgetnstr(
- WINDOW *a1,
- int a2,
- int a3,
- char *a4,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ char *a4,
int z)
{ return(*(int *)0); }
#undef mvwgetstr
int mvwgetstr(
- WINDOW *a1,
- int a2,
- int a3,
+ WINDOW *a1,
+ int a2,
+ int a3,
char *z)
{ return(*(int *)0); }
#undef mvwhline
int mvwhline(
- WINDOW *a1,
- int a2,
- int a3,
- chtype a4,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ chtype a4,
int z)
{ return(*(int *)0); }
#undef mvwinch
chtype mvwinch(
- WINDOW *a1,
- int a2,
+ WINDOW *a1,
+ int a2,
int z)
{ return(*(chtype *)0); }
#undef mvwinchnstr
int mvwinchnstr(
- WINDOW *a1,
- int a2,
- int a3,
- chtype *a4,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ chtype *a4,
int z)
{ return(*(int *)0); }
#undef mvwinchstr
int mvwinchstr(
- WINDOW *a1,
- int a2,
- int a3,
+ WINDOW *a1,
+ int a2,
+ int a3,
chtype *z)
{ return(*(int *)0); }
#undef mvwinnstr
int mvwinnstr(
- WINDOW *a1,
- int a2,
- int a3,
- char *a4,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ char *a4,
int z)
{ return(*(int *)0); }
#undef mvwinsch
int mvwinsch(
- WINDOW *a1,
- int a2,
- int a3,
+ WINDOW *a1,
+ int a2,
+ int a3,
chtype z)
{ return(*(int *)0); }
#undef mvwinsnstr
int mvwinsnstr(
- WINDOW *a1,
- int a2,
- int a3,
- const char *a4,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ const char *a4,
int z)
{ return(*(int *)0); }
#undef mvwinsstr
int mvwinsstr(
- WINDOW *a1,
- int a2,
- int a3,
+ WINDOW *a1,
+ int a2,
+ int a3,
const char *z)
{ return(*(int *)0); }
#undef mvwinstr
int mvwinstr(
- WINDOW *a1,
- int a2,
- int a3,
+ WINDOW *a1,
+ int a2,
+ int a3,
char *z)
{ return(*(int *)0); }
#undef mvwvline
int mvwvline(
- WINDOW *a1,
- int a2,
- int a3,
- chtype a4,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ chtype a4,
int z)
{ return(*(int *)0); }
@@ -1021,7 +1021,7 @@ int scroll(
#undef setscrreg
int setscrreg(
- int a1,
+ int a1,
int z)
{ return(*(int *)0); }
@@ -1040,8 +1040,8 @@ void timeout(
#undef touchline
int touchline(
- WINDOW *a1,
- int a2,
+ WINDOW *a1,
+ int a2,
int z)
{ return(*(int *)0); }
@@ -1057,53 +1057,53 @@ int untouchwin(
#undef vline
int vline(
- chtype a1,
+ chtype a1,
int z)
{ return(*(int *)0); }
#undef waddchstr
int waddchstr(
- WINDOW *a1,
+ WINDOW *a1,
const chtype *z)
{ return(*(int *)0); }
#undef waddstr
int waddstr(
- WINDOW *a1,
+ WINDOW *a1,
const char *z)
{ return(*(int *)0); }
#undef wattron
int wattron(
- WINDOW *a1,
+ WINDOW *a1,
int z)
{ return(*(int *)0); }
#undef wattroff
int wattroff(
- WINDOW *a1,
+ WINDOW *a1,
int z)
{ return(*(int *)0); }
#undef wattrset
int wattrset(
- WINDOW *a1,
+ WINDOW *a1,
int z)
{ return(*(int *)0); }
#undef wattr_get
int wattr_get(
- WINDOW *a1,
- attr_t *a2,
- short *a3,
+ 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,
+ WINDOW *a1,
+ attr_t a2,
+ short a3,
void *z)
{ return(*(int *)0); }
@@ -1114,13 +1114,13 @@ int wdeleteln(
#undef wgetstr
int wgetstr(
- WINDOW *a1,
+ WINDOW *a1,
char *z)
{ return(*(int *)0); }
#undef winchstr
int winchstr(
- WINDOW *a1,
+ WINDOW *a1,
chtype *z)
{ return(*(int *)0); }
@@ -1131,13 +1131,13 @@ int winsertln(
#undef winsstr
int winsstr(
- WINDOW *a1,
+ WINDOW *a1,
const char *z)
{ return(*(int *)0); }
#undef winstr
int winstr(
- WINDOW *a1,
+ WINDOW *a1,
char *z)
{ return(*(int *)0); }
@@ -1268,15 +1268,15 @@ int wgetdelay(
#undef wgetscrreg
int wgetscrreg(
- const WINDOW *a1,
- int *a2,
+ const WINDOW *a1,
+ int *a2,
int *z)
{ return(*(int *)0); }
#undef mouse_trafo
NCURSES_BOOL mouse_trafo(
- int *a1,
- int *a2,
+ int *a1,
+ int *a2,
NCURSES_BOOL z)
{ return(*(NCURSES_BOOL *)0); }
@@ -1287,7 +1287,7 @@ int ESCDELAY;
#undef set_escdelay_sp
int set_escdelay_sp(
- SCREEN *sp,
+ SCREEN *sp,
int value)
{ return(*(int *)0); }
@@ -1307,8 +1307,8 @@ int get_escdelay(void)
#undef _nc_wgetch
int _nc_wgetch(
- WINDOW *win,
- int *result,
+ WINDOW *win,
+ int *result,
int use_meta)
{ return(*(int *)0); }
@@ -1321,8 +1321,8 @@ int wgetch(
#undef wgetnstr
int wgetnstr(
- WINDOW *win,
- char *str,
+ WINDOW *win,
+ char *str,
int maxlen)
{ return(*(int *)0); }
@@ -1330,8 +1330,8 @@ int wgetnstr(
#undef whline
int whline(
- WINDOW *win,
- chtype ch,
+ WINDOW *win,
+ chtype ch,
int n)
{ return(*(int *)0); }
@@ -1339,7 +1339,7 @@ int whline(
#undef immedok
void immedok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ /* void */ }
@@ -1347,8 +1347,8 @@ void immedok(
#undef winchnstr
int winchnstr(
- WINDOW *win,
- chtype *str,
+ WINDOW *win,
+ chtype *str,
int n)
{ return(*(int *)0); }
@@ -1362,14 +1362,14 @@ WINDOW *initscr(void)
#undef _nc_insert_ch
int _nc_insert_ch(
- SCREEN *sp,
- WINDOW *win,
+ SCREEN *sp,
+ WINDOW *win,
chtype ch)
{ return(*(int *)0); }
#undef winsch
int winsch(
- WINDOW *win,
+ WINDOW *win,
chtype c)
{ return(*(int *)0); }
@@ -1377,7 +1377,7 @@ int winsch(
#undef winsdelln
int winsdelln(
- WINDOW *win,
+ WINDOW *win,
int n)
{ return(*(int *)0); }
@@ -1385,8 +1385,8 @@ int winsdelln(
#undef winsnstr
int winsnstr(
- WINDOW *win,
- const char *s,
+ WINDOW *win,
+ const char *s,
int n)
{ return(*(int *)0); }
@@ -1394,8 +1394,8 @@ int winsnstr(
#undef winnstr
int winnstr(
- WINDOW *win,
- char *str,
+ WINDOW *win,
+ char *str,
int n)
{ return(*(int *)0); }
@@ -1414,7 +1414,7 @@ NCURSES_BOOL isendwin(void)
#undef leaveok
int leaveok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
@@ -1422,7 +1422,7 @@ int leaveok(
#undef getmouse_sp
int getmouse_sp(
- SCREEN *sp,
+ SCREEN *sp,
MEVENT *aevent)
{ return(*(int *)0); }
@@ -1433,7 +1433,7 @@ int getmouse(
#undef ungetmouse_sp
int ungetmouse_sp(
- SCREEN *sp,
+ SCREEN *sp,
MEVENT *aevent)
{ return(*(int *)0); }
@@ -1444,27 +1444,27 @@ int ungetmouse(
#undef mousemask_sp
mmask_t mousemask_sp(
- SCREEN *sp,
- mmask_t newmask,
+ SCREEN *sp,
+ mmask_t newmask,
mmask_t *oldmask)
{ return(*(mmask_t *)0); }
#undef mousemask
mmask_t mousemask(
- mmask_t newmask,
+ mmask_t newmask,
mmask_t *oldmask)
{ return(*(mmask_t *)0); }
#undef wenclose
NCURSES_BOOL wenclose(
- const WINDOW *win,
- int y,
+ const WINDOW *win,
+ int y,
int x)
{ return(*(NCURSES_BOOL *)0); }
#undef mouseinterval_sp
int mouseinterval_sp(
- SCREEN *sp,
+ SCREEN *sp,
int maxclick)
{ return(*(int *)0); }
@@ -1489,9 +1489,9 @@ NCURSES_BOOL has_mouse(void)
#undef wmouse_trafo
NCURSES_BOOL wmouse_trafo(
- const WINDOW *win,
- int *pY,
- int *pX,
+ const WINDOW *win,
+ int *pY,
+ int *pX,
NCURSES_BOOL to_screen)
{ return(*(NCURSES_BOOL *)0); }
@@ -1499,8 +1499,8 @@ NCURSES_BOOL wmouse_trafo(
#undef wmove
int wmove(
- WINDOW *win,
- int y,
+ WINDOW *win,
+ int y,
int x)
{ return(*(int *)0); }
@@ -1508,14 +1508,14 @@ int wmove(
#undef _nc_msec_cost_sp
int _nc_msec_cost_sp(
- SCREEN *sp,
- const char *const cap,
+ SCREEN *sp,
+ const char *const cap,
int affcnt)
{ return(*(int *)0); }
#undef _nc_msec_cost
int _nc_msec_cost(
- const char *const cap,
+ const char *const cap,
int affcnt)
{ return(*(int *)0); }
@@ -1548,35 +1548,35 @@ void _nc_mvcur_wrap(void)
#undef _nc_mvcur_sp
int _nc_mvcur_sp(
- SCREEN *sp,
- int yold,
- int xold,
- int ynew,
+ SCREEN *sp,
+ int yold,
+ int xold,
+ int ynew,
int xnew)
{ return(*(int *)0); }
#undef _nc_mvcur
int _nc_mvcur(
- int yold,
- int xold,
- int ynew,
+ int yold,
+ int xold,
+ int ynew,
int xnew)
{ return(*(int *)0); }
#undef mvcur_sp
int mvcur_sp(
- SCREEN *sp,
- int yold,
- int xold,
- int ynew,
+ SCREEN *sp,
+ int yold,
+ int xold,
+ int ynew,
int xnew)
{ return(*(int *)0); }
#undef mvcur
int mvcur(
- int yold,
- int xold,
- int ynew,
+ int yold,
+ int xold,
+ int ynew,
int xnew)
{ return(*(int *)0); }
@@ -1587,8 +1587,8 @@ int _nc_optimize_enable;
#undef mvwin
int mvwin(
- WINDOW *win,
- int by,
+ WINDOW *win,
+ int by,
int bx)
{ return(*(int *)0); }
@@ -1614,16 +1614,16 @@ void nofilter(void)
#undef newterm_sp
SCREEN *newterm_sp(
- SCREEN *sp,
- const char *name,
- FILE *ofp,
+ SCREEN *sp,
+ const char *name,
+ FILE *ofp,
FILE *ifp)
{ return(*(SCREEN **)0); }
#undef newterm
SCREEN *newterm(
- const char *name,
- FILE *ofp,
+ const char *name,
+ FILE *ofp,
FILE *ifp)
{ return(*(SCREEN **)0); }
@@ -1636,46 +1636,46 @@ int _nc_freewin(
#undef newwin_sp
WINDOW *newwin_sp(
- SCREEN *sp,
- int num_lines,
- int num_columns,
- int begy,
+ 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 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,
+ 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,
+ 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,
+ SCREEN *sp,
+ int num_lines,
+ int num_columns,
+ int begy,
+ int begx,
int flags)
{ return(*(WINDOW **)0); }
@@ -1718,26 +1718,26 @@ int nonl(void)
#undef overlay
int overlay(
- const WINDOW *win1,
+ const WINDOW *win1,
WINDOW *win2)
{ return(*(int *)0); }
#undef overwrite
int overwrite(
- const WINDOW *win1,
+ 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,
+ const WINDOW *src,
+ WINDOW *dst,
+ int sminrow,
+ int smincol,
+ int dminrow,
+ int dmincol,
+ int dmaxrow,
+ int dmaxcol,
int over)
{ return(*(int *)0); }
@@ -1745,51 +1745,51 @@ int copywin(
#undef newpad_sp
WINDOW *newpad_sp(
- SCREEN *sp,
- int l,
+ SCREEN *sp,
+ int l,
int c)
{ return(*(WINDOW **)0); }
#undef newpad
WINDOW *newpad(
- int l,
+ int l,
int c)
{ return(*(WINDOW **)0); }
#undef subpad
WINDOW *subpad(
- WINDOW *orig,
- int l,
- int c,
- int begy,
+ 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,
+ 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,
+ WINDOW *win,
+ int pminrow,
+ int pmincol,
+ int sminrow,
+ int smincol,
+ int smaxrow,
int smaxcol)
{ return(*(int *)0); }
#undef pechochar
int pechochar(
- WINDOW *pad,
+ WINDOW *pad,
const chtype ch)
{ return(*(int *)0); }
@@ -1797,45 +1797,45 @@ int pechochar(
#undef printw
int printw(
- const char *fmt,
+ const char *fmt,
...)
{ return(*(int *)0); }
#undef wprintw
int wprintw(
- WINDOW *win,
- const char *fmt,
+ WINDOW *win,
+ const char *fmt,
...)
{ return(*(int *)0); }
#undef mvprintw
int mvprintw(
- int y,
- int x,
- const char *fmt,
+ int y,
+ int x,
+ const char *fmt,
...)
{ return(*(int *)0); }
#undef mvwprintw
int mvwprintw(
- WINDOW *win,
- int y,
- int x,
- const char *fmt,
+ WINDOW *win,
+ int y,
+ int x,
+ const char *fmt,
...)
{ return(*(int *)0); }
#undef vwprintw
int vwprintw(
- WINDOW *win,
- const char *fmt,
+ WINDOW *win,
+ const char *fmt,
va_list argp)
{ return(*(int *)0); }
#undef vw_printw
int vw_printw(
- WINDOW *win,
- const char *fmt,
+ WINDOW *win,
+ const char *fmt,
va_list argp)
{ return(*(int *)0); }
@@ -1843,8 +1843,8 @@ int vw_printw(
#undef wredrawln
int wredrawln(
- WINDOW *win,
- int beg,
+ WINDOW *win,
+ int beg,
int num)
{ return(*(int *)0); }
@@ -1864,16 +1864,16 @@ int wnoutrefresh(
#undef restartterm_sp
int restartterm_sp(
- SCREEN *sp,
- const char *termp,
- int filenum,
+ SCREEN *sp,
+ const char *termp,
+ int filenum,
int *errret)
{ return(*(int *)0); }
#undef restartterm
int restartterm(
- const char *termp,
- int filenum,
+ const char *termp,
+ int filenum,
int *errret)
{ return(*(int *)0); }
@@ -1881,45 +1881,45 @@ int restartterm(
#undef vwscanw
int vwscanw(
- WINDOW *win,
- const char *fmt,
+ WINDOW *win,
+ const char *fmt,
va_list argp)
{ return(*(int *)0); }
#undef vw_scanw
int vw_scanw(
- WINDOW *win,
- const char *fmt,
+ WINDOW *win,
+ const char *fmt,
va_list argp)
{ return(*(int *)0); }
#undef scanw
int scanw(
- const char *fmt,
+ const char *fmt,
...)
{ return(*(int *)0); }
#undef wscanw
int wscanw(
- WINDOW *win,
- const char *fmt,
+ WINDOW *win,
+ const char *fmt,
...)
{ return(*(int *)0); }
#undef mvscanw
int mvscanw(
- int y,
- int x,
- const char *fmt,
+ int y,
+ int x,
+ const char *fmt,
...)
{ return(*(int *)0); }
#undef mvwscanw
int mvwscanw(
- WINDOW *win,
- int y,
- int x,
- const char *fmt,
+ WINDOW *win,
+ int y,
+ int x,
+ const char *fmt,
...)
{ return(*(int *)0); }
@@ -1927,7 +1927,7 @@ int mvwscanw(
#undef getwin_sp
WINDOW *getwin_sp(
- SCREEN *sp,
+ SCREEN *sp,
FILE *filep)
{ return(*(WINDOW **)0); }
@@ -1938,13 +1938,13 @@ WINDOW *getwin(
#undef putwin
int putwin(
- WINDOW *win,
+ WINDOW *win,
FILE *filep)
{ return(*(int *)0); }
#undef scr_restore_sp
int scr_restore_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *file)
{ return(*(int *)0); }
@@ -1960,7 +1960,7 @@ int scr_dump(
#undef scr_init_sp
int scr_init_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *file)
{ return(*(int *)0); }
@@ -1971,7 +1971,7 @@ int scr_init(
#undef scr_set_sp
int scr_set_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *file)
{ return(*(int *)0); }
@@ -1984,16 +1984,16 @@ int scr_set(
#undef _nc_scroll_window
void _nc_scroll_window(
- WINDOW *win,
- int const n,
- int const top,
- int const bottom,
+ WINDOW *win,
+ int const n,
+ int const top,
+ int const bottom,
chtype blank)
{ /* void */ }
#undef wscrl
int wscrl(
- WINDOW *win,
+ WINDOW *win,
int n)
{ return(*(int *)0); }
@@ -2001,7 +2001,7 @@ int wscrl(
#undef scrollok
int scrollok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
@@ -2009,8 +2009,8 @@ int scrollok(
#undef wsetscrreg
int wsetscrreg(
- WINDOW *win,
- int top,
+ WINDOW *win,
+ int top,
int bottom)
{ return(*(int *)0); }
@@ -2028,54 +2028,54 @@ void delscreen(
#undef _nc_setupscreen_sp
int _nc_setupscreen_sp(
- SCREEN **spp,
- int slines,
- int scolumns,
- FILE *output,
- int filtered,
+ SCREEN **spp,
+ int slines,
+ int scolumns,
+ FILE *output,
+ int filtered,
int slk_format)
{ return(*(int *)0); }
#undef _nc_setupscreen
int _nc_setupscreen(
- int slines,
- int scolumns,
- FILE *output,
- int filtered,
+ int slines,
+ int scolumns,
+ FILE *output,
+ int filtered,
int slk_format)
{ return(*(int *)0); }
#undef _nc_ripoffline_sp
int _nc_ripoffline_sp(
- SCREEN *sp,
- int line,
+ SCREEN *sp,
+ int line,
int (*init)(
- WINDOW *p1,
+ WINDOW *p1,
int p2))
{ return(*(int *)0); }
#undef _nc_ripoffline
int _nc_ripoffline(
- int line,
+ int line,
int (*init)(
- WINDOW *p1,
+ WINDOW *p1,
int p2))
{ return(*(int *)0); }
#undef ripoffline_sp
int ripoffline_sp(
- SCREEN *sp,
- int line,
+ SCREEN *sp,
+ int line,
int (*init)(
- WINDOW *p1,
+ WINDOW *p1,
int p2))
{ return(*(int *)0); }
#undef ripoffline
int ripoffline(
- int line,
+ int line,
int (*init)(
- WINDOW *p1,
+ WINDOW *p1,
int p2))
{ return(*(int *)0); }
@@ -2083,13 +2083,13 @@ int ripoffline(
#undef _nc_format_slks
int _nc_format_slks(
- SCREEN *sp,
+ SCREEN *sp,
int cols)
{ return(*(int *)0); }
#undef _nc_slk_initialize
int _nc_slk_initialize(
- WINDOW *stwin,
+ WINDOW *stwin,
int cols)
{ return(*(int *)0); }
@@ -2106,16 +2106,16 @@ int slk_restore(void)
#undef slk_attr_set_sp
int slk_attr_set_sp(
- SCREEN *sp,
- const attr_t attr,
- short pair_arg,
+ SCREEN *sp,
+ const attr_t attr,
+ short pair_arg,
void *opts)
{ return(*(int *)0); }
#undef slk_attr_set
int slk_attr_set(
- const attr_t attr,
- short pair_arg,
+ const attr_t attr,
+ short pair_arg,
void *opts)
{ return(*(int *)0); }
@@ -2123,7 +2123,7 @@ int slk_attr_set(
#undef slk_attroff_sp
int slk_attroff_sp(
- SCREEN *sp,
+ SCREEN *sp,
const chtype attr)
{ return(*(int *)0); }
@@ -2136,7 +2136,7 @@ int slk_attroff(
#undef slk_attron_sp
int slk_attron_sp(
- SCREEN *sp,
+ SCREEN *sp,
const chtype attr)
{ return(*(int *)0); }
@@ -2149,7 +2149,7 @@ int slk_attron(
#undef slk_attrset_sp
int slk_attrset_sp(
- SCREEN *sp,
+ SCREEN *sp,
const chtype attr)
{ return(*(int *)0); }
@@ -2184,7 +2184,7 @@ int slk_clear(void)
#undef slk_color_sp
int slk_color_sp(
- SCREEN *sp,
+ SCREEN *sp,
short pair_arg)
{ return(*(int *)0); }
@@ -2197,7 +2197,7 @@ int slk_color(
#undef slk_init_sp
int slk_init_sp(
- SCREEN *sp,
+ SCREEN *sp,
int format)
{ return(*(int *)0); }
@@ -2210,7 +2210,7 @@ int slk_init(
#undef slk_label_sp
char *slk_label_sp(
- SCREEN *sp,
+ SCREEN *sp,
int n)
{ return(*(char **)0); }
@@ -2243,16 +2243,16 @@ int slk_refresh(void)
#undef slk_set_sp
int slk_set_sp(
- SCREEN *sp,
- int i,
- const char *astr,
+ SCREEN *sp,
+ int i,
+ const char *astr,
int format)
{ return(*(int *)0); }
#undef slk_set
int slk_set(
- int i,
- const char *astr,
+ int i,
+ const char *astr,
int format)
{ return(*(int *)0); }
@@ -2271,7 +2271,7 @@ int slk_touch(void)
#undef is_linetouched
NCURSES_BOOL is_linetouched(
- WINDOW *win,
+ WINDOW *win,
int line)
{ return(*(NCURSES_BOOL *)0); }
@@ -2282,9 +2282,9 @@ NCURSES_BOOL is_wintouched(
#undef wtouchln
int wtouchln(
- WINDOW *win,
- int y,
- int n,
+ WINDOW *win,
+ int y,
+ int n,
int changed)
{ return(*(int *)0); }
@@ -2292,7 +2292,7 @@ int wtouchln(
#undef _tracedump
void _tracedump(
- const char *name,
+ const char *name,
WINDOW *win)
{ /* void */ }
@@ -2300,19 +2300,19 @@ void _tracedump(
#undef _nc_trace_mmask_t
char *_nc_trace_mmask_t(
- SCREEN *sp,
+ SCREEN *sp,
mmask_t code)
{ return(*(char **)0); }
#undef _nc_tracemouse
char *_nc_tracemouse(
- SCREEN *sp,
+ SCREEN *sp,
MEVENT const *ep)
{ return(*(char **)0); }
#undef _nc_retrace_mmask_t
mmask_t _nc_retrace_mmask_t(
- SCREEN *sp,
+ SCREEN *sp,
mmask_t code)
{ return(*(mmask_t *)0); }
@@ -2337,7 +2337,7 @@ void _nc_fifo_dump(
#undef ungetch_sp
int ungetch_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ch)
{ return(*(int *)0); }
@@ -2350,20 +2350,20 @@ int ungetch(
#undef vidputs_sp
int vidputs_sp(
- SCREEN *sp,
- chtype newmode,
+ SCREEN *sp,
+ chtype newmode,
NCURSES_OUTC_sp outc)
{ return(*(int *)0); }
#undef vidputs
int vidputs(
- chtype newmode,
+ chtype newmode,
NCURSES_OUTC outc)
{ return(*(int *)0); }
#undef vidattr_sp
int vidattr_sp(
- SCREEN *sp,
+ SCREEN *sp,
chtype newmode)
{ return(*(int *)0); }
@@ -2385,8 +2385,8 @@ chtype termattrs(void)
#undef wvline
int wvline(
- WINDOW *win,
- chtype ch,
+ WINDOW *win,
+ chtype ch,
int n)
{ return(*(int *)0); }
@@ -2394,8 +2394,8 @@ int wvline(
#undef wattr_off
int wattr_off(
- WINDOW *win,
- attr_t at,
+ WINDOW *win,
+ attr_t at,
void *opts)
{ return(*(int *)0); }
@@ -2403,8 +2403,8 @@ int wattr_off(
#undef wattr_on
int wattr_on(
- WINDOW *win,
- attr_t at,
+ WINDOW *win,
+ attr_t at,
void *opts)
{ return(*(int *)0); }
@@ -2424,14 +2424,14 @@ void _nc_synchook(
#undef mvderwin
int mvderwin(
- WINDOW *win,
- int y,
+ WINDOW *win,
+ int y,
int x)
{ return(*(int *)0); }
#undef syncok
int syncok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL bf)
{ return(*(int *)0); }
@@ -2470,14 +2470,14 @@ struct panelhook *_nc_panelhook(void)
#undef _nc_printf_string_sp
char *_nc_printf_string_sp(
- SCREEN *sp,
- const char *fmt,
+ SCREEN *sp,
+ const char *fmt,
va_list ap)
{ return(*(char **)0); }
#undef _nc_printf_string
char *_nc_printf_string(
- const char *fmt,
+ const char *fmt,
va_list ap)
{ return(*(char **)0); }
@@ -2494,18 +2494,18 @@ int doupdate(void)
#undef _nc_scrolln_sp
int _nc_scrolln_sp(
- SCREEN *sp,
- int n,
- int top,
- int bot,
+ 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 n,
+ int top,
+ int bot,
int maxy)
{ return(*(int *)0); }
@@ -2538,7 +2538,7 @@ void _nc_screen_wrap(void)
#undef _nc_do_xmc_glitch_sp
void _nc_do_xmc_glitch_sp(
- SCREEN *sp,
+ SCREEN *sp,
attr_t previous)
{ /* void */ }
@@ -2551,7 +2551,7 @@ void _nc_do_xmc_glitch(
#undef _nc_varargs
char *_nc_varargs(
- const char *fmt,
+ const char *fmt,
va_list ap)
{ return(*(char **)0); }
@@ -2569,7 +2569,7 @@ void _nc_freeall(void)
#undef _nc_free_and_exit_sp
void _nc_free_and_exit_sp(
- SCREEN *sp,
+ SCREEN *sp,
int code)
{ /* void */ }
@@ -2587,31 +2587,31 @@ void exit_curses(
#undef _nc_toggle_attr_on
void _nc_toggle_attr_on(
- attr_t *S,
+ attr_t *S,
attr_t at)
{ /* void */ }
#undef _nc_toggle_attr_off
void _nc_toggle_attr_off(
- attr_t *S,
+ attr_t *S,
attr_t at)
{ /* void */ }
#undef _nc_DelCharCost_sp
int _nc_DelCharCost_sp(
- SCREEN *sp,
+ SCREEN *sp,
int count)
{ return(*(int *)0); }
#undef _nc_InsCharCost_sp
int _nc_InsCharCost_sp(
- SCREEN *sp,
+ SCREEN *sp,
int count)
{ return(*(int *)0); }
#undef _nc_UpdateAttrs_sp
void _nc_UpdateAttrs_sp(
- SCREEN *sp,
+ SCREEN *sp,
chtype c)
{ /* void */ }
@@ -2634,7 +2634,7 @@ void _nc_UpdateAttrs(
#undef use_legacy_coding_sp
int use_legacy_coding_sp(
- SCREEN *sp,
+ SCREEN *sp,
int level)
{ return(*(int *)0); }
@@ -2656,14 +2656,14 @@ int use_default_colors(void)
#undef assume_default_colors_sp
int assume_default_colors_sp(
- SCREEN *sp,
- int fg,
+ SCREEN *sp,
+ int fg,
int bg)
{ return(*(int *)0); }
#undef assume_default_colors
int assume_default_colors(
- int fg,
+ int fg,
int bg)
{ return(*(int *)0); }
@@ -2671,14 +2671,14 @@ int assume_default_colors(
#undef mcprint_sp
int mcprint_sp(
- SCREEN *sp,
- char *data,
+ SCREEN *sp,
+ char *data,
int len)
{ return(*(int *)0); }
#undef mcprint
int mcprint(
- char *data,
+ char *data,
int len)
{ return(*(int *)0); }
@@ -2692,40 +2692,40 @@ void _nc_new_pair(void)
#undef is_term_resized_sp
NCURSES_BOOL is_term_resized_sp(
- SCREEN *sp,
- int ToLines,
+ SCREEN *sp,
+ int ToLines,
int ToCols)
{ return(*(NCURSES_BOOL *)0); }
#undef is_term_resized
NCURSES_BOOL is_term_resized(
- int ToLines,
+ int ToLines,
int ToCols)
{ return(*(NCURSES_BOOL *)0); }
#undef resize_term_sp
int resize_term_sp(
- SCREEN *sp,
- int ToLines,
+ SCREEN *sp,
+ int ToLines,
int ToCols)
{ return(*(int *)0); }
#undef resize_term
int resize_term(
- int ToLines,
+ int ToLines,
int ToCols)
{ return(*(int *)0); }
#undef resizeterm_sp
int resizeterm_sp(
- SCREEN *sp,
- int ToLines,
+ SCREEN *sp,
+ int ToLines,
int ToCols)
{ return(*(int *)0); }
#undef resizeterm
int resizeterm(
- int ToLines,
+ int ToLines,
int ToCols)
{ return(*(int *)0); }
@@ -2740,8 +2740,8 @@ void _nc_trace_xnames(
#undef use_screen
int use_screen(
- SCREEN *screen,
- NCURSES_SCREEN_CB func,
+ SCREEN *screen,
+ NCURSES_SCREEN_CB func,
void *data)
{ return(*(int *)0); }
@@ -2749,8 +2749,8 @@ int use_screen(
#undef use_window
int use_window(
- WINDOW *win,
- NCURSES_WINDOW_CB func,
+ WINDOW *win,
+ NCURSES_WINDOW_CB func,
void *data)
{ return(*(int *)0); }
@@ -2758,8 +2758,8 @@ int use_window(
#undef wresize
int wresize(
- WINDOW *win,
- int ToLines,
+ WINDOW *win,
+ int ToLines,
int ToCols)
{ return(*(int *)0); }
@@ -2787,7 +2787,7 @@ char *_nc_basename(
#undef _nc_access
int _nc_access(
- const char *path,
+ const char *path,
int mode)
{ return(*(int *)0); }
@@ -2805,12 +2805,25 @@ NCURSES_BOOL _nc_is_file_path(
int _nc_env_access(void)
{ return(*(int *)0); }
+#undef _nc_safe_fopen
+FILE *_nc_safe_fopen(
+ const char *path,
+ const char *mode)
+ { return(*(FILE **)0); }
+
+#undef _nc_safe_open3
+int _nc_safe_open3(
+ const char *path,
+ int flags,
+ mode_t mode)
+ { return(*(int *)0); }
+
/* ./tinfo/add_tries.c */
#undef _nc_add_to_try
int _nc_add_to_try(
- TRIES **tree,
- const char *str,
+ TRIES **tree,
+ const char *str,
unsigned code)
{ return(*(int *)0); }
@@ -2818,13 +2831,13 @@ int _nc_add_to_try(
#undef _nc_align_termtype
void _nc_align_termtype(
- TERMTYPE2 *to,
- TERMTYPE2 *from)
+ TERMTYPE *to,
+ TERMTYPE *from)
{ /* void */ }
#undef _nc_copy_termtype
void _nc_copy_termtype(
- TERMTYPE *dst,
+ TERMTYPE *dst,
const TERMTYPE *src)
{ /* void */ }
@@ -2889,19 +2902,19 @@ void _nc_get_type(
#undef _nc_warning
void _nc_warning(
- const char *const fmt,
+ const char *const fmt,
...)
{ /* void */ }
#undef _nc_err_abort
void _nc_err_abort(
- const char *const fmt,
+ const char *const fmt,
...)
{ /* void */ }
#undef _nc_syserr_abort
void _nc_syserr_abort(
- const char *const fmt,
+ const char *const fmt,
...)
{ /* void */ }
@@ -2909,14 +2922,14 @@ void _nc_syserr_abort(
#undef _nc_find_entry
struct name_table_entry const *_nc_find_entry(
- const char *string,
+ 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,
+ const char *string,
+ int type,
NCURSES_BOOL termcap)
{ return(*(struct name_table_entry const **)0); }
@@ -2953,13 +2966,13 @@ void _nc_last_db(void)
#undef _nc_next_db
const char *_nc_next_db(
- DBDIRS *state,
+ DBDIRS *state,
int *offset)
{ return(*(const char **)0); }
#undef _nc_first_db
void _nc_first_db(
- DBDIRS *state,
+ DBDIRS *state,
int *offset)
{ /* void */ }
@@ -2967,7 +2980,7 @@ void _nc_first_db(
#undef _nc_doalloc
void *_nc_doalloc(
- void *oldp,
+ void *oldp,
size_t amount)
{ return(*(void **)0); }
@@ -2980,8 +2993,8 @@ ENTRY *_nc_tail;
#undef _nc_free_entry
void _nc_free_entry(
- ENTRY *headp,
- TERMTYPE2 *tterm)
+ ENTRY *headp,
+ TERMTYPE *tterm)
{ /* void */ }
#undef _nc_free_entries
@@ -3001,9 +3014,9 @@ void exit_terminfo(
/* ./fallback.c */
#undef _nc_fallback
-const TERMTYPE2 *_nc_fallback(
+const TERMTYPE *_nc_fallback(
const char *name)
- { return(*(const TERMTYPE2 **)0); }
+ { return(*(const TERMTYPE **)0); }
/* ./tinfo/free_ttype.c */
@@ -3012,6 +3025,11 @@ void _nc_free_termtype(
TERMTYPE *ptr)
{ /* void */ }
+#undef _nc_free_termtype1
+void _nc_free_termtype1(
+ TERMTYPE *ptr)
+ { /* void */ }
+
#undef _nc_user_definable
NCURSES_BOOL _nc_user_definable;
@@ -3029,7 +3047,7 @@ int _nc_getenv_num(
#undef _nc_setenv_num
void _nc_setenv_num(
- const char *name,
+ const char *name,
int value)
{ /* void */ }
@@ -3063,8 +3081,8 @@ void _nc_init_acs(void)
/* ./tinfo/lib_baudrate.c */
struct speed {
- int given_speed;
- int actual_speed;
+ int given_speed;
+ int actual_speed;
};
#undef _nc_baudrate
@@ -3093,7 +3111,7 @@ TERMINAL *cur_term;
#undef set_curterm_sp
TERMINAL *set_curterm_sp(
- SCREEN *sp,
+ SCREEN *sp,
TERMINAL *termp)
{ return(*(TERMINAL **)0); }
@@ -3104,7 +3122,7 @@ TERMINAL *set_curterm(
#undef del_curterm_sp
int del_curterm_sp(
- SCREEN *sp,
+ SCREEN *sp,
TERMINAL *termp)
{ return(*(int *)0); }
@@ -3190,7 +3208,7 @@ struct kn { short offset; int code; };
#undef keyname_sp
const char *keyname_sp(
- SCREEN *sp,
+ SCREEN *sp,
int c)
{ return(*(const char **)0); }
@@ -3214,7 +3232,7 @@ char *longname(void)
#undef napms_sp
int napms_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ms)
{ return(*(int *)0); }
@@ -3227,19 +3245,19 @@ int napms(
#undef idlok
int idlok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef idcok
void idcok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ /* void */ }
#undef halfdelay_sp
int halfdelay_sp(
- SCREEN *sp,
+ SCREEN *sp,
int t)
{ return(*(int *)0); }
@@ -3250,37 +3268,37 @@ int halfdelay(
#undef nodelay
int nodelay(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef notimeout
int notimeout(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL f)
{ return(*(int *)0); }
#undef wtimeout
void wtimeout(
- WINDOW *win,
+ WINDOW *win,
int delay)
{ /* void */ }
#undef keypad
int keypad(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef meta
int meta(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef curs_set_sp
int curs_set_sp(
- SCREEN *sp,
+ SCREEN *sp,
int vis)
{ return(*(int *)0); }
@@ -3291,7 +3309,7 @@ int curs_set(
#undef typeahead_sp
int typeahead_sp(
- SCREEN *sp,
+ SCREEN *sp,
int fd)
{ return(*(int *)0); }
@@ -3302,7 +3320,7 @@ int typeahead(
#undef has_key_sp
int has_key_sp(
- SCREEN *sp,
+ SCREEN *sp,
int keycode)
{ return(*(int *)0); }
@@ -3313,14 +3331,14 @@ int has_key(
#undef _nc_putp_flush_sp
int _nc_putp_flush_sp(
- SCREEN *sp,
- const char *name,
+ SCREEN *sp,
+ const char *name,
const char *value)
{ return(*(int *)0); }
#undef _nc_keypad
int _nc_keypad(
- SCREEN *sp,
+ SCREEN *sp,
int flag)
{ return(*(int *)0); }
@@ -3382,17 +3400,53 @@ void noqiflush(void)
#undef intrflush_sp
int intrflush_sp(
- SCREEN *sp,
- WINDOW *win,
+ SCREEN *sp,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef intrflush
int intrflush(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
+#undef is_nl_sp
+int is_nl_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_raw_sp
+int is_raw_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_cbreak_sp
+int is_cbreak_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_echo_sp
+int is_echo_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_nl
+int is_nl(void)
+ { return(*(int *)0); }
+
+#undef is_raw
+int is_raw(void)
+ { return(*(int *)0); }
+
+#undef is_cbreak
+int is_cbreak(void)
+ { return(*(int *)0); }
+
+#undef is_echo
+int is_echo(void)
+ { return(*(int *)0); }
+
/* ./tinfo/lib_setup.c */
#undef ttytype
@@ -3406,7 +3460,7 @@ int TABSIZE;
#undef set_tabsize_sp
int set_tabsize_sp(
- SCREEN *sp,
+ SCREEN *sp,
int value)
{ return(*(int *)0); }
@@ -3422,13 +3476,13 @@ int _nc_handle_sigwinch(
#undef use_env_sp
void use_env_sp(
- SCREEN *sp,
+ SCREEN *sp,
NCURSES_BOOL f)
{ /* void */ }
#undef use_tioctl_sp
void use_tioctl_sp(
- SCREEN *sp,
+ SCREEN *sp,
NCURSES_BOOL f)
{ /* void */ }
@@ -3444,8 +3498,8 @@ void use_tioctl(
#undef _nc_get_screensize
void _nc_get_screensize(
- SCREEN *sp,
- int *linep,
+ SCREEN *sp,
+ int *linep,
int *colp)
{ /* void */ }
@@ -3456,13 +3510,13 @@ void _nc_update_screensize(
#undef _nc_setup_tinfo
int _nc_setup_tinfo(
- const char *const tn,
- TERMTYPE2 *const tp)
+ const char *const tn,
+ TERMTYPE *const tp)
{ return(*(int *)0); }
#undef _nc_tinfo_cmdch
void _nc_tinfo_cmdch(
- TERMINAL *termp,
+ TERMINAL *termp,
int proto)
{ /* void */ }
@@ -3481,9 +3535,9 @@ int _nc_locale_breaks_acs(
#undef _nc_setupterm
int _nc_setupterm(
- const char *tname,
- int Filedes,
- int *errret,
+ const char *tname,
+ int Filedes,
+ int *errret,
int reuse)
{ return(*(int *)0); }
@@ -3493,8 +3547,8 @@ SCREEN *new_prescr(void)
#undef setupterm
int setupterm(
- const char *tname,
- int Filedes,
+ const char *tname,
+ int Filedes,
int *errret)
{ return(*(int *)0); }
@@ -3507,20 +3561,20 @@ char *BC;
#undef tgetent_sp
int tgetent_sp(
- SCREEN *sp,
- char *bufp,
+ SCREEN *sp,
+ char *bufp,
const char *name)
{ return(*(int *)0); }
#undef tgetent
int tgetent(
- char *bufp,
+ char *bufp,
const char *name)
{ return(*(int *)0); }
#undef tgetflag_sp
int tgetflag_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *id)
{ return(*(int *)0); }
@@ -3531,7 +3585,7 @@ int tgetflag(
#undef tgetnum_sp
int tgetnum_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *id)
{ return(*(int *)0); }
@@ -3542,14 +3596,14 @@ int tgetnum(
#undef tgetstr_sp
char *tgetstr_sp(
- SCREEN *sp,
- const char *id,
+ SCREEN *sp,
+ const char *id,
char **area)
{ return(*(char **)0); }
#undef tgetstr
char *tgetstr(
- const char *id,
+ const char *id,
char **area)
{ return(*(char **)0); }
@@ -3568,8 +3622,8 @@ char *termname(void)
#undef tgoto
char *tgoto(
- const char *string,
- int x,
+ const char *string,
+ int x,
int y)
{ return(*(char **)0); }
@@ -3577,7 +3631,7 @@ char *tgoto(
#undef tigetflag_sp
int tigetflag_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(int *)0); }
@@ -3588,7 +3642,7 @@ int tigetflag(
#undef tigetnum_sp
int tigetnum_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(int *)0); }
@@ -3599,7 +3653,7 @@ int tigetnum(
#undef tigetstr_sp
char *tigetstr_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(char **)0); }
@@ -3613,32 +3667,58 @@ char *tigetstr(
#undef _nc_tparm_err
int _nc_tparm_err;
+#undef _nc_free_tparm
+void _nc_free_tparm(
+ TERMINAL *termp)
+ { /* void */ }
+
#undef _nc_tparm_analyze
int _nc_tparm_analyze(
- const char *string,
- char *p_is_s[9],
+ TERMINAL *term,
+ const char *string,
+ char **p_is_s,
int *_nc_popcount)
{ return(*(int *)0); }
#undef tparm
char *tparm(
- const char *string,
+ const char *string,
...)
{ return(*(char **)0); }
#undef tiparm
char *tiparm(
- const char *string,
+ const char *string,
...)
{ return(*(char **)0); }
+#undef tiparm_s
+char *tiparm_s(
+ int num_expected,
+ int tparm_type,
+ const char *string,
+ ...)
+ { return(*(char **)0); }
+
+#undef tiscan_s
+int tiscan_s(
+ int *num_expected,
+ int *tparm_type,
+ const char *string)
+ { return(*(int *)0); }
+
#undef _nc_tiparm
char *_nc_tiparm(
- int expected,
- const char *string,
+ int expected,
+ const char *string,
...)
{ return(*(char **)0); }
+#undef _nc_reset_tparm
+void _nc_reset_tparm(
+ TERMINAL *term)
+ { /* void */ }
+
/* ./tinfo/lib_tputs.c */
#undef PC
@@ -3655,7 +3735,7 @@ void _nc_set_no_padding(
#undef delay_output_sp
int delay_output_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ms)
{ return(*(int *)0); }
@@ -3675,7 +3755,7 @@ void _nc_flush(void)
#undef _nc_outch_sp
int _nc_outch_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ch)
{ return(*(int *)0); }
@@ -3686,7 +3766,7 @@ int _nc_outch(
#undef _nc_putchar_sp
int _nc_putchar_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ch)
{ return(*(int *)0); }
@@ -3697,7 +3777,7 @@ int _nc_putchar(
#undef putp_sp
int putp_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *string)
{ return(*(int *)0); }
@@ -3708,35 +3788,35 @@ int putp(
#undef _nc_putp_sp
int _nc_putp_sp(
- SCREEN *sp,
- const char *name,
+ SCREEN *sp,
+ const char *name,
const char *string)
{ return(*(int *)0); }
#undef _nc_putp
int _nc_putp(
- const char *name,
+ const char *name,
const char *string)
{ return(*(int *)0); }
#undef tputs_sp
int tputs_sp(
- SCREEN *sp,
- const char *string,
- int affcnt,
+ SCREEN *sp,
+ const char *string,
+ int affcnt,
NCURSES_OUTC_sp outc)
{ return(*(int *)0); }
#undef _nc_outc_wrapper
int _nc_outc_wrapper(
- SCREEN *sp,
+ SCREEN *sp,
int c)
{ return(*(int *)0); }
#undef tputs
int tputs(
- const char *string,
- int affcnt,
+ const char *string,
+ int affcnt,
int (*outc)(
int p1))
{ return(*(int *)0); }
@@ -3762,7 +3842,7 @@ void trace(
#undef _tracef
void _tracef(
- const char *fmt,
+ const char *fmt,
...)
{ /* void */ }
@@ -3818,8 +3898,8 @@ WINDOW *_nc_retrace_win(
#undef _nc_fmt_funcptr
char *_nc_fmt_funcptr(
- char *target,
- const char *source,
+ char *target,
+ const char *source,
size_t size)
{ return(*(char **)0); }
@@ -3827,7 +3907,7 @@ char *_nc_fmt_funcptr(
#undef _traceattr2
char *_traceattr2(
- int bufnum,
+ int bufnum,
chtype newmode)
{ return(*(char **)0); }
@@ -3848,13 +3928,13 @@ attr_t _nc_retrace_attr_t(
#undef _nc_altcharset_name
const char *_nc_altcharset_name(
- attr_t attr,
+ attr_t attr,
chtype ch)
{ return(*(const char **)0); }
#undef _tracechtype2
char *_tracechtype2(
- int bufnum,
+ int bufnum,
chtype ch)
{ return(*(char **)0); }
@@ -3872,7 +3952,7 @@ chtype _nc_retrace_chtype(
#undef _nc_trace_ttymode
char *_nc_trace_ttymode(
- struct termios *tty)
+ const struct termios *tty)
{ return(*(char **)0); }
#undef _nc_tracebits
@@ -3883,7 +3963,7 @@ char *_nc_tracebits(void)
#undef _nc_tracechar
char *_nc_tracechar(
- SCREEN *sp,
+ SCREEN *sp,
int ch)
{ return(*(char **)0); }
@@ -3896,7 +3976,7 @@ char *_tracechar(
#undef _nc_get_tty_mode_sp
int _nc_get_tty_mode_sp(
- SCREEN *sp,
+ SCREEN *sp,
struct termios *buf)
{ return(*(int *)0); }
@@ -3907,7 +3987,7 @@ int _nc_get_tty_mode(
#undef _nc_set_tty_mode_sp
int _nc_set_tty_mode_sp(
- SCREEN *sp,
+ SCREEN *sp,
struct termios *buf)
{ return(*(int *)0); }
@@ -3974,9 +4054,9 @@ int resetty(void)
#undef _nc_timed_wait
int _nc_timed_wait(
- SCREEN *sp,
- int mode,
- int milliseconds,
+ SCREEN *sp,
+ int mode,
+ int milliseconds,
int *timeleft)
{ return(*(int *)0); }
@@ -3989,8 +4069,8 @@ char *_nc_first_name(
#undef _nc_name_match
int _nc_name_match(
- const char *const namelst,
- const char *const name,
+ const char *const namelst,
+ const char *const name,
const char *const delim)
{ return(*(int *)0); }
@@ -4013,14 +4093,14 @@ const char *const strfnames[] = {0};
#undef _nc_set_buffer_sp
void _nc_set_buffer_sp(
- SCREEN *sp,
- FILE *ofp,
+ SCREEN *sp,
+ FILE *ofp,
int buffered)
{ /* void */ }
#undef _nc_set_buffer
void _nc_set_buffer(
- FILE *ofp,
+ FILE *ofp,
int buffered)
{ /* void */ }
@@ -4028,67 +4108,67 @@ void _nc_set_buffer(
#undef _nc_init_termtype
void _nc_init_termtype(
- TERMTYPE2 *const tp)
+ TERMTYPE *const tp)
{ /* void */ }
#undef _nc_read_termtype
int _nc_read_termtype(
- TERMTYPE2 *ptr,
- char *buffer,
+ TERMTYPE *ptr,
+ char *buffer,
int limit)
{ return(*(int *)0); }
#undef _nc_read_file_entry
int _nc_read_file_entry(
- const char *const filename,
- TERMTYPE2 *ptr)
+ const char *const filename,
+ TERMTYPE *ptr)
{ return(*(int *)0); }
#undef _nc_read_entry
int _nc_read_entry(
- const char *const name,
- char *const filename,
- TERMTYPE2 *const tp)
+ const char *const name,
+ char *const filename,
+ TERMTYPE *const tp)
{ return(*(int *)0); }
/* ./tinfo/read_termcap.c */
#undef _nc_read_termcap_entry
int _nc_read_termcap_entry(
- const char *const tn,
- TERMTYPE2 *const tp)
+ const char *const tn,
+ TERMTYPE *const tp)
{ return(*(int *)0); }
/* ./tinfo/strings.c */
#undef _nc_str_init
string_desc *_nc_str_init(
- string_desc *dst,
- char *src,
+ string_desc *dst,
+ char *src,
size_t len)
{ return(*(string_desc **)0); }
#undef _nc_str_null
string_desc *_nc_str_null(
- string_desc *dst,
+ string_desc *dst,
size_t len)
{ return(*(string_desc **)0); }
#undef _nc_str_copy
string_desc *_nc_str_copy(
- string_desc *dst,
- string_desc *src)
+ string_desc *dst,
+ const string_desc *const src)
{ return(*(string_desc **)0); }
#undef _nc_safe_strcat
NCURSES_BOOL _nc_safe_strcat(
- string_desc *dst,
+ string_desc *dst,
const char *src)
{ return(*(NCURSES_BOOL *)0); }
#undef _nc_safe_strcpy
NCURSES_BOOL _nc_safe_strcpy(
- string_desc *dst,
+ string_desc *dst,
const char *src)
{ return(*(NCURSES_BOOL *)0); }
@@ -4096,13 +4176,13 @@ NCURSES_BOOL _nc_safe_strcpy(
#undef _nc_trace_buf
char *_nc_trace_buf(
- int bufnum,
+ int bufnum,
size_t want)
{ return(*(char **)0); }
#undef _nc_trace_bufcat
char *_nc_trace_bufcat(
- int bufnum,
+ int bufnum,
const char *value)
{ return(*(char **)0); }
@@ -4117,21 +4197,21 @@ void _nc_trace_tries(
#undef _nc_expand_try
char *_nc_expand_try(
- TRIES *tree,
- unsigned code,
- int *count,
+ TRIES *tree,
+ unsigned code,
+ int *count,
size_t len)
{ return(*(char **)0); }
#undef _nc_remove_key
int _nc_remove_key(
- TRIES **tree,
+ TRIES **tree,
unsigned code)
{ return(*(int *)0); }
#undef _nc_remove_string
int _nc_remove_string(
- TRIES **tree,
+ TRIES **tree,
const char *string)
{ return(*(int *)0); }
@@ -4139,14 +4219,14 @@ int _nc_remove_string(
#undef _nc_trim_sgr0
char *_nc_trim_sgr0(
- TERMTYPE2 *tp)
+ TERMTYPE *tp)
{ return(*(char **)0); }
/* ./unctrl.c */
#undef unctrl_sp
const char *unctrl_sp(
- SCREEN *sp,
+ SCREEN *sp,
chtype ch)
{ return(*(const char **)0); }
@@ -4159,7 +4239,7 @@ const char *unctrl(
#undef _nc_visbuf2
const char *_nc_visbuf2(
- int bufnum,
+ int bufnum,
const char *buf)
{ return(*(const char **)0); }
@@ -4170,20 +4250,20 @@ const char *_nc_visbuf(
#undef _nc_visbufn
const char *_nc_visbufn(
- const char *buf,
+ const char *buf,
int len)
{ return(*(const char **)0); }
#undef _nc_viscbuf2
const char *_nc_viscbuf2(
- int bufnum,
- const chtype *buf,
+ int bufnum,
+ const chtype *buf,
int len)
{ return(*(const char **)0); }
#undef _nc_viscbuf
const char *_nc_viscbuf(
- const chtype *buf,
+ const chtype *buf,
int len)
{ return(*(const char **)0); }
@@ -4201,18 +4281,18 @@ ENTRY *_nc_copy_entry(
#undef _nc_save_str
char *_nc_save_str(
- const char *const string)
+ const char *string)
{ return(*(char **)0); }
#undef _nc_wrap_entry
void _nc_wrap_entry(
- ENTRY *const ep,
+ ENTRY *const ep,
NCURSES_BOOL copy_strings)
{ /* void */ }
#undef _nc_merge_entry
void _nc_merge_entry(
- ENTRY *const target,
+ ENTRY *const target,
ENTRY *const source)
{ /* void */ }
@@ -4220,15 +4300,15 @@ void _nc_merge_entry(
#undef _nc_captoinfo
char *_nc_captoinfo(
- const char *cap,
- const char *s,
+ const char *cap,
+ const char *s,
int const parameterized)
{ return(*(char **)0); }
#undef _nc_infotocap
char *_nc_infotocap(
- const char *cap,
- const char *str,
+ const char *cap,
+ const char *str,
int const parameterized)
{ return(*(char **)0); }
@@ -4236,8 +4316,8 @@ char *_nc_infotocap(
#undef _nc_tic_expand
char *_nc_tic_expand(
- const char *srcp,
- NCURSES_BOOL tic_format,
+ const char *srcp,
+ NCURSES_BOOL tic_format,
int numbers)
{ return(*(char **)0); }
@@ -4245,28 +4325,28 @@ char *_nc_tic_expand(
#undef _nc_check_termtype2
void (*_nc_check_termtype2)(
- TERMTYPE2 *p1,
+ TERMTYPE *p1,
NCURSES_BOOL p2);
#undef _nc_entry_match
NCURSES_BOOL _nc_entry_match(
- char *n1,
+ char *n1,
char *n2)
{ return(*(NCURSES_BOOL *)0); }
#undef _nc_read_entry_source
void _nc_read_entry_source(
- FILE *fp,
- char *buf,
- int literal,
- NCURSES_BOOL silent,
+ FILE *fp,
+ char *buf,
+ int literal,
+ NCURSES_BOOL silent,
NCURSES_BOOL (*hook)(
ENTRY *p1))
{ /* void */ }
#undef _nc_resolve_uses2
int _nc_resolve_uses2(
- NCURSES_BOOL fullresolve,
+ NCURSES_BOOL fullresolve,
NCURSES_BOOL literal)
{ return(*(int *)0); }
@@ -4291,7 +4371,7 @@ NCURSES_BOOL _nc_disable_period;
#undef _nc_reset_input
void _nc_reset_input(
- FILE *fp,
+ FILE *fp,
char *buf)
{ /* void */ }
@@ -4302,8 +4382,8 @@ int _nc_get_token(
#undef _nc_trans_string
int _nc_trans_string(
- char *ptr,
- char *last)
+ char *ptr,
+ const char *const last)
{ return(*(int *)0); }
#undef _nc_push_token
@@ -4320,14 +4400,14 @@ void _nc_panic_mode(
#undef _nc_parse_entry
int _nc_parse_entry(
- ENTRY *entryp,
- int literal,
+ ENTRY *entryp,
+ int literal,
NCURSES_BOOL silent)
{ return(*(int *)0); }
#undef _nc_capcmp
int _nc_capcmp(
- const char *s,
+ const char *s,
const char *t)
{ return(*(int *)0); }
@@ -4340,14 +4420,14 @@ void _nc_set_writedir(
#undef _nc_write_entry
void _nc_write_entry(
- TERMTYPE2 *const tp)
+ TERMTYPE *const tp)
{ /* void */ }
#undef _nc_write_object
int _nc_write_object(
- TERMTYPE2 *tp,
- char *buffer,
- unsigned *offset,
+ TERMTYPE *tp,
+ char *buffer,
+ unsigned *offset,
unsigned limit)
{ return(*(int *)0); }
@@ -4359,14 +4439,14 @@ int _nc_tic_written(void)
#undef define_key_sp
int define_key_sp(
- SCREEN *sp,
- const char *str,
+ SCREEN *sp,
+ const char *str,
int keycode)
{ return(*(int *)0); }
#undef define_key
int define_key(
- const char *str,
+ const char *str,
int keycode)
{ return(*(int *)0); }
@@ -4380,7 +4460,7 @@ void _nc_hashed_db(void)
#undef key_defined_sp
int key_defined_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(int *)0); }
@@ -4393,14 +4473,14 @@ int key_defined(
#undef keybound_sp
char *keybound_sp(
- SCREEN *sp,
- int code,
+ SCREEN *sp,
+ int code,
int count)
{ return(*(char **)0); }
#undef keybound
char *keybound(
- int code,
+ int code,
int count)
{ return(*(char **)0); }
@@ -4408,14 +4488,14 @@ char *keybound(
#undef keyok_sp
int keyok_sp(
- SCREEN *sp,
- int c,
+ SCREEN *sp,
+ int c,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef keyok
int keyok(
- int c,
+ int c,
NCURSES_BOOL flag)
{ return(*(int *)0); }
diff --git a/ncurses/llib-lncursest b/ncurses/llib-lncursest
index 36a94b57297e..7c8bac9c4076 100644
--- a/ncurses/llib-lncursest
+++ b/ncurses/llib-lncursest
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2019-2022,2023 Thomas E. Dickey *
* Copyright 2008-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -70,7 +70,7 @@ void _nc_hash_map(void)
#undef _nc_make_oldhash_sp
void _nc_make_oldhash_sp(
- SCREEN *sp,
+ SCREEN *sp,
int i)
{ /* void */ }
@@ -81,16 +81,16 @@ void _nc_make_oldhash(
#undef _nc_scroll_oldhash_sp
void _nc_scroll_oldhash_sp(
- SCREEN *sp,
- int n,
- int top,
+ SCREEN *sp,
+ int n,
+ int top,
int bot)
{ /* void */ }
#undef _nc_scroll_oldhash
void _nc_scroll_oldhash(
- int n,
- int top,
+ int n,
+ int top,
int bot)
{ /* void */ }
@@ -98,25 +98,25 @@ void _nc_scroll_oldhash(
#undef _nc_render
chtype _nc_render(
- WINDOW *win,
+ WINDOW *win,
chtype ch)
{ return(*(chtype *)0); }
#undef _nc_waddch_nosync
int _nc_waddch_nosync(
- WINDOW *win,
+ WINDOW *win,
const chtype c)
{ return(*(int *)0); }
#undef waddch
int waddch(
- WINDOW *win,
+ WINDOW *win,
const chtype ch)
{ return(*(int *)0); }
#undef wechochar
int wechochar(
- WINDOW *win,
+ WINDOW *win,
const chtype ch)
{ return(*(int *)0); }
@@ -124,15 +124,15 @@ int wechochar(
#undef waddnstr
int waddnstr(
- WINDOW *win,
- const char *astr,
+ WINDOW *win,
+ const char *astr,
int n)
{ return(*(int *)0); }
#undef waddchnstr
int waddchnstr(
- WINDOW *win,
- const chtype *astr,
+ WINDOW *win,
+ const chtype *astr,
int n)
{ return(*(int *)0); }
@@ -151,13 +151,13 @@ int beep(void)
#undef wbkgdset
void wbkgdset(
- WINDOW *win,
+ WINDOW *win,
chtype ch)
{ /* void */ }
#undef wbkgd
int wbkgd(
- WINDOW *win,
+ WINDOW *win,
chtype ch)
{ return(*(int *)0); }
@@ -165,14 +165,14 @@ int wbkgd(
#undef wborder
int wborder(
- WINDOW *win,
- chtype ls,
- chtype rs,
- chtype ts,
- chtype bs,
- chtype tl,
- chtype tr,
- chtype bl,
+ WINDOW *win,
+ chtype ls,
+ chtype rs,
+ chtype ts,
+ chtype bs,
+ chtype tl,
+ chtype tr,
+ chtype bl,
chtype br)
{ return(*(int *)0); }
@@ -180,10 +180,10 @@ int wborder(
#undef wchgat
int wchgat(
- WINDOW *win,
- int n,
- attr_t attr,
- short pair_arg,
+ WINDOW *win,
+ int n,
+ attr_t attr,
+ short pair_arg,
const void *opts)
{ return(*(int *)0); }
@@ -198,7 +198,7 @@ int wclear(
#undef clearok
int clearok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
@@ -246,62 +246,62 @@ int start_color(void)
#undef _nc_change_pair
void _nc_change_pair(
- SCREEN *sp,
+ SCREEN *sp,
int pair)
{ /* void */ }
#undef _nc_reserve_pairs
void _nc_reserve_pairs(
- SCREEN *sp,
+ SCREEN *sp,
int want)
{ /* void */ }
#undef _nc_init_pair
int _nc_init_pair(
- SCREEN *sp,
- int pair,
- int f,
+ SCREEN *sp,
+ int pair,
+ int f,
int b)
{ return(*(int *)0); }
#undef init_pair_sp
int init_pair_sp(
- SCREEN *sp,
- short pair,
- short f,
+ SCREEN *sp,
+ short pair,
+ short f,
short b)
{ return(*(int *)0); }
#undef init_pair
int init_pair(
- short pair,
- short f,
+ short pair,
+ short f,
short b)
{ return(*(int *)0); }
#undef _nc_init_color
int _nc_init_color(
- SCREEN *sp,
- int color,
- int r,
- int g,
+ SCREEN *sp,
+ int color,
+ int r,
+ int g,
int b)
{ return(*(int *)0); }
#undef init_color_sp
int init_color_sp(
- SCREEN *sp,
- short color,
- short r,
- short g,
+ 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 color,
+ short r,
+ short g,
short b)
{ return(*(int *)0); }
@@ -325,58 +325,58 @@ NCURSES_BOOL has_colors(void)
#undef color_content_sp
int color_content_sp(
- SCREEN *sp,
- short color,
- short *r,
- short *g,
+ 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 color,
+ short *r,
+ short *g,
short *b)
{ return(*(int *)0); }
#undef _nc_pair_content
int _nc_pair_content(
- SCREEN *sp,
- int pair,
- int *f,
+ SCREEN *sp,
+ int pair,
+ int *f,
int *b)
{ return(*(int *)0); }
#undef pair_content_sp
int pair_content_sp(
- SCREEN *sp,
- short pair,
- short *f,
+ SCREEN *sp,
+ short pair,
+ short *f,
short *b)
{ return(*(int *)0); }
#undef pair_content
int pair_content(
- short pair,
- short *f,
+ short pair,
+ short *f,
short *b)
{ return(*(int *)0); }
#undef _nc_do_color_sp
void _nc_do_color_sp(
- SCREEN *sp,
- int old_pair,
- int pair,
- int reverse,
+ SCREEN *sp,
+ int old_pair,
+ int pair,
+ int reverse,
NCURSES_OUTC_sp outc)
{ /* void */ }
#undef _nc_do_color
void _nc_do_color(
- int old_pair,
- int pair,
- int reverse,
+ int old_pair,
+ int pair,
+ int reverse,
NCURSES_OUTC outc)
{ /* void */ }
@@ -384,8 +384,8 @@ void _nc_do_color(
#undef wcolor_set
int wcolor_set(
- WINDOW *win,
- short pair_arg,
+ WINDOW *win,
+ short pair_arg,
void *opts)
{ return(*(int *)0); }
@@ -461,7 +461,7 @@ int addch(
#undef addchnstr
int addchnstr(
- const chtype *a1,
+ const chtype *a1,
int z)
{ return(*(int *)0); }
@@ -472,7 +472,7 @@ int addchstr(
#undef addnstr
int addnstr(
- const char *a1,
+ const char *a1,
int z)
{ return(*(int *)0); }
@@ -483,42 +483,42 @@ int addstr(
#undef attroff
int attroff(
- int z)
+ NCURSES_ATTR_T z)
{ return(*(int *)0); }
#undef attron
int attron(
- int z)
+ NCURSES_ATTR_T z)
{ return(*(int *)0); }
#undef attrset
int attrset(
- int z)
+ NCURSES_ATTR_T z)
{ return(*(int *)0); }
#undef attr_get
int attr_get(
- attr_t *a1,
- short *a2,
+ attr_t *a1,
+ short *a2,
void *z)
{ return(*(int *)0); }
#undef attr_off
int attr_off(
- attr_t a1,
+ attr_t a1,
void *z)
{ return(*(int *)0); }
#undef attr_on
int attr_on(
- attr_t a1,
+ attr_t a1,
void *z)
{ return(*(int *)0); }
#undef attr_set
int attr_set(
- attr_t a1,
- short a2,
+ attr_t a1,
+ short a2,
void *z)
{ return(*(int *)0); }
@@ -534,28 +534,28 @@ void bkgdset(
#undef border
int border(
- chtype a1,
- chtype a2,
- chtype a3,
- chtype a4,
- chtype a5,
- chtype a6,
- chtype a7,
+ 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,
+ WINDOW *a1,
+ chtype a2,
chtype z)
{ return(*(int *)0); }
#undef chgat
int chgat(
- int a1,
- attr_t a2,
- short a3,
+ int a1,
+ attr_t a2,
+ short a3,
const void *z)
{ return(*(int *)0); }
@@ -573,7 +573,7 @@ int clrtoeol(void)
#undef color_set
int color_set(
- short a1,
+ short a1,
void *z)
{ return(*(int *)0); }
@@ -610,7 +610,7 @@ int getch(void)
#undef getnstr
int getnstr(
- char *a1,
+ char *a1,
int z)
{ return(*(int *)0); }
@@ -621,7 +621,7 @@ int getstr(
#undef hline
int hline(
- chtype a1,
+ chtype a1,
int z)
{ return(*(int *)0); }
@@ -631,7 +631,7 @@ chtype inch(void)
#undef inchnstr
int inchnstr(
- chtype *a1,
+ chtype *a1,
int z)
{ return(*(int *)0); }
@@ -642,7 +642,7 @@ int inchstr(
#undef innstr
int innstr(
- char *a1,
+ char *a1,
int z)
{ return(*(int *)0); }
@@ -662,7 +662,7 @@ int insertln(void)
#undef insnstr
int insnstr(
- const char *a1,
+ const char *a1,
int z)
{ return(*(int *)0); }
@@ -678,323 +678,323 @@ int instr(
#undef move
int move(
- int a1,
+ int a1,
int z)
{ return(*(int *)0); }
#undef mvaddch
int mvaddch(
- int a1,
- int a2,
+ int a1,
+ int a2,
const chtype z)
{ return(*(int *)0); }
#undef mvaddchnstr
int mvaddchnstr(
- int a1,
- int a2,
- const chtype *a3,
+ int a1,
+ int a2,
+ const chtype *a3,
int z)
{ return(*(int *)0); }
#undef mvaddchstr
int mvaddchstr(
- int a1,
- int a2,
+ int a1,
+ int a2,
const chtype *z)
{ return(*(int *)0); }
#undef mvaddnstr
int mvaddnstr(
- int a1,
- int a2,
- const char *a3,
+ int a1,
+ int a2,
+ const char *a3,
int z)
{ return(*(int *)0); }
#undef mvaddstr
int mvaddstr(
- int a1,
- int a2,
+ 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,
+ int a1,
+ int a2,
+ int a3,
+ attr_t a4,
+ short a5,
const void *z)
{ return(*(int *)0); }
#undef mvdelch
int mvdelch(
- int a1,
+ int a1,
int z)
{ return(*(int *)0); }
#undef mvgetch
int mvgetch(
- int a1,
+ int a1,
int z)
{ return(*(int *)0); }
#undef mvgetnstr
int mvgetnstr(
- int a1,
- int a2,
- char *a3,
+ int a1,
+ int a2,
+ char *a3,
int z)
{ return(*(int *)0); }
#undef mvgetstr
int mvgetstr(
- int a1,
- int a2,
+ int a1,
+ int a2,
char *z)
{ return(*(int *)0); }
#undef mvhline
int mvhline(
- int a1,
- int a2,
- chtype a3,
+ int a1,
+ int a2,
+ chtype a3,
int z)
{ return(*(int *)0); }
#undef mvinch
chtype mvinch(
- int a1,
+ int a1,
int z)
{ return(*(chtype *)0); }
#undef mvinchnstr
int mvinchnstr(
- int a1,
- int a2,
- chtype *a3,
+ int a1,
+ int a2,
+ chtype *a3,
int z)
{ return(*(int *)0); }
#undef mvinchstr
int mvinchstr(
- int a1,
- int a2,
+ int a1,
+ int a2,
chtype *z)
{ return(*(int *)0); }
#undef mvinnstr
int mvinnstr(
- int a1,
- int a2,
- char *a3,
+ int a1,
+ int a2,
+ char *a3,
int z)
{ return(*(int *)0); }
#undef mvinsch
int mvinsch(
- int a1,
- int a2,
+ int a1,
+ int a2,
chtype z)
{ return(*(int *)0); }
#undef mvinsnstr
int mvinsnstr(
- int a1,
- int a2,
- const char *a3,
+ int a1,
+ int a2,
+ const char *a3,
int z)
{ return(*(int *)0); }
#undef mvinsstr
int mvinsstr(
- int a1,
- int a2,
+ int a1,
+ int a2,
const char *z)
{ return(*(int *)0); }
#undef mvinstr
int mvinstr(
- int a1,
- int a2,
+ int a1,
+ int a2,
char *z)
{ return(*(int *)0); }
#undef mvvline
int mvvline(
- int a1,
- int a2,
- chtype a3,
+ int a1,
+ int a2,
+ chtype a3,
int z)
{ return(*(int *)0); }
#undef mvwaddch
int mvwaddch(
- WINDOW *a1,
- int a2,
- int a3,
+ 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,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ const chtype *a4,
int z)
{ return(*(int *)0); }
#undef mvwaddchstr
int mvwaddchstr(
- WINDOW *a1,
- int a2,
- int a3,
+ 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,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ const char *a4,
int z)
{ return(*(int *)0); }
#undef mvwaddstr
int mvwaddstr(
- WINDOW *a1,
- int a2,
- int a3,
+ 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,
+ 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,
+ WINDOW *a1,
+ int a2,
int z)
{ return(*(int *)0); }
#undef mvwgetch
int mvwgetch(
- WINDOW *a1,
- int a2,
+ WINDOW *a1,
+ int a2,
int z)
{ return(*(int *)0); }
#undef mvwgetnstr
int mvwgetnstr(
- WINDOW *a1,
- int a2,
- int a3,
- char *a4,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ char *a4,
int z)
{ return(*(int *)0); }
#undef mvwgetstr
int mvwgetstr(
- WINDOW *a1,
- int a2,
- int a3,
+ WINDOW *a1,
+ int a2,
+ int a3,
char *z)
{ return(*(int *)0); }
#undef mvwhline
int mvwhline(
- WINDOW *a1,
- int a2,
- int a3,
- chtype a4,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ chtype a4,
int z)
{ return(*(int *)0); }
#undef mvwinch
chtype mvwinch(
- WINDOW *a1,
- int a2,
+ WINDOW *a1,
+ int a2,
int z)
{ return(*(chtype *)0); }
#undef mvwinchnstr
int mvwinchnstr(
- WINDOW *a1,
- int a2,
- int a3,
- chtype *a4,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ chtype *a4,
int z)
{ return(*(int *)0); }
#undef mvwinchstr
int mvwinchstr(
- WINDOW *a1,
- int a2,
- int a3,
+ WINDOW *a1,
+ int a2,
+ int a3,
chtype *z)
{ return(*(int *)0); }
#undef mvwinnstr
int mvwinnstr(
- WINDOW *a1,
- int a2,
- int a3,
- char *a4,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ char *a4,
int z)
{ return(*(int *)0); }
#undef mvwinsch
int mvwinsch(
- WINDOW *a1,
- int a2,
- int a3,
+ WINDOW *a1,
+ int a2,
+ int a3,
chtype z)
{ return(*(int *)0); }
#undef mvwinsnstr
int mvwinsnstr(
- WINDOW *a1,
- int a2,
- int a3,
- const char *a4,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ const char *a4,
int z)
{ return(*(int *)0); }
#undef mvwinsstr
int mvwinsstr(
- WINDOW *a1,
- int a2,
- int a3,
+ WINDOW *a1,
+ int a2,
+ int a3,
const char *z)
{ return(*(int *)0); }
#undef mvwinstr
int mvwinstr(
- WINDOW *a1,
- int a2,
- int a3,
+ WINDOW *a1,
+ int a2,
+ int a3,
char *z)
{ return(*(int *)0); }
#undef mvwvline
int mvwvline(
- WINDOW *a1,
- int a2,
- int a3,
- chtype a4,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ chtype a4,
int z)
{ return(*(int *)0); }
@@ -1024,7 +1024,7 @@ int scroll(
#undef setscrreg
int setscrreg(
- int a1,
+ int a1,
int z)
{ return(*(int *)0); }
@@ -1043,8 +1043,8 @@ void timeout(
#undef touchline
int touchline(
- WINDOW *a1,
- int a2,
+ WINDOW *a1,
+ int a2,
int z)
{ return(*(int *)0); }
@@ -1060,53 +1060,53 @@ int untouchwin(
#undef vline
int vline(
- chtype a1,
+ chtype a1,
int z)
{ return(*(int *)0); }
#undef waddchstr
int waddchstr(
- WINDOW *a1,
+ WINDOW *a1,
const chtype *z)
{ return(*(int *)0); }
#undef waddstr
int waddstr(
- WINDOW *a1,
+ WINDOW *a1,
const char *z)
{ return(*(int *)0); }
#undef wattron
int wattron(
- WINDOW *a1,
+ WINDOW *a1,
int z)
{ return(*(int *)0); }
#undef wattroff
int wattroff(
- WINDOW *a1,
+ WINDOW *a1,
int z)
{ return(*(int *)0); }
#undef wattrset
int wattrset(
- WINDOW *a1,
+ WINDOW *a1,
int z)
{ return(*(int *)0); }
#undef wattr_get
int wattr_get(
- WINDOW *a1,
- attr_t *a2,
- short *a3,
+ 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,
+ WINDOW *a1,
+ attr_t a2,
+ short a3,
void *z)
{ return(*(int *)0); }
@@ -1117,13 +1117,13 @@ int wdeleteln(
#undef wgetstr
int wgetstr(
- WINDOW *a1,
+ WINDOW *a1,
char *z)
{ return(*(int *)0); }
#undef winchstr
int winchstr(
- WINDOW *a1,
+ WINDOW *a1,
chtype *z)
{ return(*(int *)0); }
@@ -1134,13 +1134,13 @@ int winsertln(
#undef winsstr
int winsstr(
- WINDOW *a1,
+ WINDOW *a1,
const char *z)
{ return(*(int *)0); }
#undef winstr
int winstr(
- WINDOW *a1,
+ WINDOW *a1,
char *z)
{ return(*(int *)0); }
@@ -1271,15 +1271,15 @@ int wgetdelay(
#undef wgetscrreg
int wgetscrreg(
- const WINDOW *a1,
- int *a2,
+ const WINDOW *a1,
+ int *a2,
int *z)
{ return(*(int *)0); }
#undef mouse_trafo
NCURSES_BOOL mouse_trafo(
- int *a1,
- int *a2,
+ int *a1,
+ int *a2,
NCURSES_BOOL z)
{ return(*(NCURSES_BOOL *)0); }
@@ -1296,7 +1296,7 @@ int *_nc_ptr_Escdelay(
#undef set_escdelay_sp
int set_escdelay_sp(
- SCREEN *sp,
+ SCREEN *sp,
int value)
{ return(*(int *)0); }
@@ -1316,8 +1316,8 @@ int get_escdelay(void)
#undef _nc_wgetch
int _nc_wgetch(
- WINDOW *win,
- int *result,
+ WINDOW *win,
+ int *result,
int use_meta)
{ return(*(int *)0); }
@@ -1330,8 +1330,8 @@ int wgetch(
#undef wgetnstr
int wgetnstr(
- WINDOW *win,
- char *str,
+ WINDOW *win,
+ char *str,
int maxlen)
{ return(*(int *)0); }
@@ -1339,8 +1339,8 @@ int wgetnstr(
#undef whline
int whline(
- WINDOW *win,
- chtype ch,
+ WINDOW *win,
+ chtype ch,
int n)
{ return(*(int *)0); }
@@ -1348,7 +1348,7 @@ int whline(
#undef immedok
void immedok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ /* void */ }
@@ -1356,8 +1356,8 @@ void immedok(
#undef winchnstr
int winchnstr(
- WINDOW *win,
- chtype *str,
+ WINDOW *win,
+ chtype *str,
int n)
{ return(*(int *)0); }
@@ -1371,14 +1371,14 @@ WINDOW *initscr(void)
#undef _nc_insert_ch
int _nc_insert_ch(
- SCREEN *sp,
- WINDOW *win,
+ SCREEN *sp,
+ WINDOW *win,
chtype ch)
{ return(*(int *)0); }
#undef winsch
int winsch(
- WINDOW *win,
+ WINDOW *win,
chtype c)
{ return(*(int *)0); }
@@ -1386,7 +1386,7 @@ int winsch(
#undef winsdelln
int winsdelln(
- WINDOW *win,
+ WINDOW *win,
int n)
{ return(*(int *)0); }
@@ -1394,8 +1394,8 @@ int winsdelln(
#undef winsnstr
int winsnstr(
- WINDOW *win,
- const char *s,
+ WINDOW *win,
+ const char *s,
int n)
{ return(*(int *)0); }
@@ -1403,8 +1403,8 @@ int winsnstr(
#undef winnstr
int winnstr(
- WINDOW *win,
- char *str,
+ WINDOW *win,
+ char *str,
int n)
{ return(*(int *)0); }
@@ -1423,7 +1423,7 @@ NCURSES_BOOL isendwin(void)
#undef leaveok
int leaveok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
@@ -1431,7 +1431,7 @@ int leaveok(
#undef getmouse_sp
int getmouse_sp(
- SCREEN *sp,
+ SCREEN *sp,
MEVENT *aevent)
{ return(*(int *)0); }
@@ -1442,7 +1442,7 @@ int getmouse(
#undef ungetmouse_sp
int ungetmouse_sp(
- SCREEN *sp,
+ SCREEN *sp,
MEVENT *aevent)
{ return(*(int *)0); }
@@ -1453,27 +1453,27 @@ int ungetmouse(
#undef mousemask_sp
mmask_t mousemask_sp(
- SCREEN *sp,
- mmask_t newmask,
+ SCREEN *sp,
+ mmask_t newmask,
mmask_t *oldmask)
{ return(*(mmask_t *)0); }
#undef mousemask
mmask_t mousemask(
- mmask_t newmask,
+ mmask_t newmask,
mmask_t *oldmask)
{ return(*(mmask_t *)0); }
#undef wenclose
NCURSES_BOOL wenclose(
- const WINDOW *win,
- int y,
+ const WINDOW *win,
+ int y,
int x)
{ return(*(NCURSES_BOOL *)0); }
#undef mouseinterval_sp
int mouseinterval_sp(
- SCREEN *sp,
+ SCREEN *sp,
int maxclick)
{ return(*(int *)0); }
@@ -1498,9 +1498,9 @@ NCURSES_BOOL has_mouse(void)
#undef wmouse_trafo
NCURSES_BOOL wmouse_trafo(
- const WINDOW *win,
- int *pY,
- int *pX,
+ const WINDOW *win,
+ int *pY,
+ int *pX,
NCURSES_BOOL to_screen)
{ return(*(NCURSES_BOOL *)0); }
@@ -1508,8 +1508,8 @@ NCURSES_BOOL wmouse_trafo(
#undef wmove
int wmove(
- WINDOW *win,
- int y,
+ WINDOW *win,
+ int y,
int x)
{ return(*(int *)0); }
@@ -1517,14 +1517,14 @@ int wmove(
#undef _nc_msec_cost_sp
int _nc_msec_cost_sp(
- SCREEN *sp,
- const char *const cap,
+ SCREEN *sp,
+ const char *const cap,
int affcnt)
{ return(*(int *)0); }
#undef _nc_msec_cost
int _nc_msec_cost(
- const char *const cap,
+ const char *const cap,
int affcnt)
{ return(*(int *)0); }
@@ -1557,35 +1557,35 @@ void _nc_mvcur_wrap(void)
#undef _nc_mvcur_sp
int _nc_mvcur_sp(
- SCREEN *sp,
- int yold,
- int xold,
- int ynew,
+ SCREEN *sp,
+ int yold,
+ int xold,
+ int ynew,
int xnew)
{ return(*(int *)0); }
#undef _nc_mvcur
int _nc_mvcur(
- int yold,
- int xold,
- int ynew,
+ int yold,
+ int xold,
+ int ynew,
int xnew)
{ return(*(int *)0); }
#undef mvcur_sp
int mvcur_sp(
- SCREEN *sp,
- int yold,
- int xold,
- int ynew,
+ SCREEN *sp,
+ int yold,
+ int xold,
+ int ynew,
int xnew)
{ return(*(int *)0); }
#undef mvcur
int mvcur(
- int yold,
- int xold,
- int ynew,
+ int yold,
+ int xold,
+ int ynew,
int xnew)
{ return(*(int *)0); }
@@ -1596,8 +1596,8 @@ int _nc_optimize_enable;
#undef mvwin
int mvwin(
- WINDOW *win,
- int by,
+ WINDOW *win,
+ int by,
int bx)
{ return(*(int *)0); }
@@ -1623,16 +1623,16 @@ void nofilter(void)
#undef newterm_sp
SCREEN *newterm_sp(
- SCREEN *sp,
- const char *name,
- FILE *ofp,
+ SCREEN *sp,
+ const char *name,
+ FILE *ofp,
FILE *ifp)
{ return(*(SCREEN **)0); }
#undef newterm
SCREEN *newterm(
- const char *name,
- FILE *ofp,
+ const char *name,
+ FILE *ofp,
FILE *ifp)
{ return(*(SCREEN **)0); }
@@ -1645,46 +1645,46 @@ int _nc_freewin(
#undef newwin_sp
WINDOW *newwin_sp(
- SCREEN *sp,
- int num_lines,
- int num_columns,
- int begy,
+ 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 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,
+ 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,
+ 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,
+ SCREEN *sp,
+ int num_lines,
+ int num_columns,
+ int begy,
+ int begx,
int flags)
{ return(*(WINDOW **)0); }
@@ -1727,26 +1727,26 @@ int nonl(void)
#undef overlay
int overlay(
- const WINDOW *win1,
+ const WINDOW *win1,
WINDOW *win2)
{ return(*(int *)0); }
#undef overwrite
int overwrite(
- const WINDOW *win1,
+ 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,
+ const WINDOW *src,
+ WINDOW *dst,
+ int sminrow,
+ int smincol,
+ int dminrow,
+ int dmincol,
+ int dmaxrow,
+ int dmaxcol,
int over)
{ return(*(int *)0); }
@@ -1754,51 +1754,51 @@ int copywin(
#undef newpad_sp
WINDOW *newpad_sp(
- SCREEN *sp,
- int l,
+ SCREEN *sp,
+ int l,
int c)
{ return(*(WINDOW **)0); }
#undef newpad
WINDOW *newpad(
- int l,
+ int l,
int c)
{ return(*(WINDOW **)0); }
#undef subpad
WINDOW *subpad(
- WINDOW *orig,
- int l,
- int c,
- int begy,
+ 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,
+ 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,
+ WINDOW *win,
+ int pminrow,
+ int pmincol,
+ int sminrow,
+ int smincol,
+ int smaxrow,
int smaxcol)
{ return(*(int *)0); }
#undef pechochar
int pechochar(
- WINDOW *pad,
+ WINDOW *pad,
const chtype ch)
{ return(*(int *)0); }
@@ -1806,45 +1806,45 @@ int pechochar(
#undef printw
int printw(
- const char *fmt,
+ const char *fmt,
...)
{ return(*(int *)0); }
#undef wprintw
int wprintw(
- WINDOW *win,
- const char *fmt,
+ WINDOW *win,
+ const char *fmt,
...)
{ return(*(int *)0); }
#undef mvprintw
int mvprintw(
- int y,
- int x,
- const char *fmt,
+ int y,
+ int x,
+ const char *fmt,
...)
{ return(*(int *)0); }
#undef mvwprintw
int mvwprintw(
- WINDOW *win,
- int y,
- int x,
- const char *fmt,
+ WINDOW *win,
+ int y,
+ int x,
+ const char *fmt,
...)
{ return(*(int *)0); }
#undef vwprintw
int vwprintw(
- WINDOW *win,
- const char *fmt,
+ WINDOW *win,
+ const char *fmt,
va_list argp)
{ return(*(int *)0); }
#undef vw_printw
int vw_printw(
- WINDOW *win,
- const char *fmt,
+ WINDOW *win,
+ const char *fmt,
va_list argp)
{ return(*(int *)0); }
@@ -1852,8 +1852,8 @@ int vw_printw(
#undef wredrawln
int wredrawln(
- WINDOW *win,
- int beg,
+ WINDOW *win,
+ int beg,
int num)
{ return(*(int *)0); }
@@ -1873,16 +1873,16 @@ int wnoutrefresh(
#undef restartterm_sp
int restartterm_sp(
- SCREEN *sp,
- const char *termp,
- int filenum,
+ SCREEN *sp,
+ const char *termp,
+ int filenum,
int *errret)
{ return(*(int *)0); }
#undef restartterm
int restartterm(
- const char *termp,
- int filenum,
+ const char *termp,
+ int filenum,
int *errret)
{ return(*(int *)0); }
@@ -1890,45 +1890,45 @@ int restartterm(
#undef vwscanw
int vwscanw(
- WINDOW *win,
- const char *fmt,
+ WINDOW *win,
+ const char *fmt,
va_list argp)
{ return(*(int *)0); }
#undef vw_scanw
int vw_scanw(
- WINDOW *win,
- const char *fmt,
+ WINDOW *win,
+ const char *fmt,
va_list argp)
{ return(*(int *)0); }
#undef scanw
int scanw(
- const char *fmt,
+ const char *fmt,
...)
{ return(*(int *)0); }
#undef wscanw
int wscanw(
- WINDOW *win,
- const char *fmt,
+ WINDOW *win,
+ const char *fmt,
...)
{ return(*(int *)0); }
#undef mvscanw
int mvscanw(
- int y,
- int x,
- const char *fmt,
+ int y,
+ int x,
+ const char *fmt,
...)
{ return(*(int *)0); }
#undef mvwscanw
int mvwscanw(
- WINDOW *win,
- int y,
- int x,
- const char *fmt,
+ WINDOW *win,
+ int y,
+ int x,
+ const char *fmt,
...)
{ return(*(int *)0); }
@@ -1936,7 +1936,7 @@ int mvwscanw(
#undef getwin_sp
WINDOW *getwin_sp(
- SCREEN *sp,
+ SCREEN *sp,
FILE *filep)
{ return(*(WINDOW **)0); }
@@ -1947,13 +1947,13 @@ WINDOW *getwin(
#undef putwin
int putwin(
- WINDOW *win,
+ WINDOW *win,
FILE *filep)
{ return(*(int *)0); }
#undef scr_restore_sp
int scr_restore_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *file)
{ return(*(int *)0); }
@@ -1969,7 +1969,7 @@ int scr_dump(
#undef scr_init_sp
int scr_init_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *file)
{ return(*(int *)0); }
@@ -1980,7 +1980,7 @@ int scr_init(
#undef scr_set_sp
int scr_set_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *file)
{ return(*(int *)0); }
@@ -1993,16 +1993,16 @@ int scr_set(
#undef _nc_scroll_window
void _nc_scroll_window(
- WINDOW *win,
- int const n,
- int const top,
- int const bottom,
+ WINDOW *win,
+ int const n,
+ int const top,
+ int const bottom,
chtype blank)
{ /* void */ }
#undef wscrl
int wscrl(
- WINDOW *win,
+ WINDOW *win,
int n)
{ return(*(int *)0); }
@@ -2010,7 +2010,7 @@ int wscrl(
#undef scrollok
int scrollok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
@@ -2018,8 +2018,8 @@ int scrollok(
#undef wsetscrreg
int wsetscrreg(
- WINDOW *win,
- int top,
+ WINDOW *win,
+ int top,
int bottom)
{ return(*(int *)0); }
@@ -2037,54 +2037,54 @@ void delscreen(
#undef _nc_setupscreen_sp
int _nc_setupscreen_sp(
- SCREEN **spp,
- int slines,
- int scolumns,
- FILE *output,
- int filtered,
+ SCREEN **spp,
+ int slines,
+ int scolumns,
+ FILE *output,
+ int filtered,
int slk_format)
{ return(*(int *)0); }
#undef _nc_setupscreen
int _nc_setupscreen(
- int slines,
- int scolumns,
- FILE *output,
- int filtered,
+ int slines,
+ int scolumns,
+ FILE *output,
+ int filtered,
int slk_format)
{ return(*(int *)0); }
#undef _nc_ripoffline_sp
int _nc_ripoffline_sp(
- SCREEN *sp,
- int line,
+ SCREEN *sp,
+ int line,
int (*init)(
- WINDOW *p1,
+ WINDOW *p1,
int p2))
{ return(*(int *)0); }
#undef _nc_ripoffline
int _nc_ripoffline(
- int line,
+ int line,
int (*init)(
- WINDOW *p1,
+ WINDOW *p1,
int p2))
{ return(*(int *)0); }
#undef ripoffline_sp
int ripoffline_sp(
- SCREEN *sp,
- int line,
+ SCREEN *sp,
+ int line,
int (*init)(
- WINDOW *p1,
+ WINDOW *p1,
int p2))
{ return(*(int *)0); }
#undef ripoffline
int ripoffline(
- int line,
+ int line,
int (*init)(
- WINDOW *p1,
+ WINDOW *p1,
int p2))
{ return(*(int *)0); }
@@ -2092,13 +2092,13 @@ int ripoffline(
#undef _nc_format_slks
int _nc_format_slks(
- SCREEN *sp,
+ SCREEN *sp,
int cols)
{ return(*(int *)0); }
#undef _nc_slk_initialize
int _nc_slk_initialize(
- WINDOW *stwin,
+ WINDOW *stwin,
int cols)
{ return(*(int *)0); }
@@ -2115,16 +2115,16 @@ int slk_restore(void)
#undef slk_attr_set_sp
int slk_attr_set_sp(
- SCREEN *sp,
- const attr_t attr,
- short pair_arg,
+ SCREEN *sp,
+ const attr_t attr,
+ short pair_arg,
void *opts)
{ return(*(int *)0); }
#undef slk_attr_set
int slk_attr_set(
- const attr_t attr,
- short pair_arg,
+ const attr_t attr,
+ short pair_arg,
void *opts)
{ return(*(int *)0); }
@@ -2132,7 +2132,7 @@ int slk_attr_set(
#undef slk_attroff_sp
int slk_attroff_sp(
- SCREEN *sp,
+ SCREEN *sp,
const chtype attr)
{ return(*(int *)0); }
@@ -2145,7 +2145,7 @@ int slk_attroff(
#undef slk_attron_sp
int slk_attron_sp(
- SCREEN *sp,
+ SCREEN *sp,
const chtype attr)
{ return(*(int *)0); }
@@ -2158,7 +2158,7 @@ int slk_attron(
#undef slk_attrset_sp
int slk_attrset_sp(
- SCREEN *sp,
+ SCREEN *sp,
const chtype attr)
{ return(*(int *)0); }
@@ -2193,7 +2193,7 @@ int slk_clear(void)
#undef slk_color_sp
int slk_color_sp(
- SCREEN *sp,
+ SCREEN *sp,
short pair_arg)
{ return(*(int *)0); }
@@ -2206,7 +2206,7 @@ int slk_color(
#undef slk_init_sp
int slk_init_sp(
- SCREEN *sp,
+ SCREEN *sp,
int format)
{ return(*(int *)0); }
@@ -2219,7 +2219,7 @@ int slk_init(
#undef slk_label_sp
char *slk_label_sp(
- SCREEN *sp,
+ SCREEN *sp,
int n)
{ return(*(char **)0); }
@@ -2252,16 +2252,16 @@ int slk_refresh(void)
#undef slk_set_sp
int slk_set_sp(
- SCREEN *sp,
- int i,
- const char *astr,
+ SCREEN *sp,
+ int i,
+ const char *astr,
int format)
{ return(*(int *)0); }
#undef slk_set
int slk_set(
- int i,
- const char *astr,
+ int i,
+ const char *astr,
int format)
{ return(*(int *)0); }
@@ -2280,7 +2280,7 @@ int slk_touch(void)
#undef is_linetouched
NCURSES_BOOL is_linetouched(
- WINDOW *win,
+ WINDOW *win,
int line)
{ return(*(NCURSES_BOOL *)0); }
@@ -2291,9 +2291,9 @@ NCURSES_BOOL is_wintouched(
#undef wtouchln
int wtouchln(
- WINDOW *win,
- int y,
- int n,
+ WINDOW *win,
+ int y,
+ int n,
int changed)
{ return(*(int *)0); }
@@ -2301,7 +2301,7 @@ int wtouchln(
#undef _tracedump
void _tracedump(
- const char *name,
+ const char *name,
WINDOW *win)
{ /* void */ }
@@ -2309,19 +2309,19 @@ void _tracedump(
#undef _nc_trace_mmask_t
char *_nc_trace_mmask_t(
- SCREEN *sp,
+ SCREEN *sp,
mmask_t code)
{ return(*(char **)0); }
#undef _nc_tracemouse
char *_nc_tracemouse(
- SCREEN *sp,
+ SCREEN *sp,
MEVENT const *ep)
{ return(*(char **)0); }
#undef _nc_retrace_mmask_t
mmask_t _nc_retrace_mmask_t(
- SCREEN *sp,
+ SCREEN *sp,
mmask_t code)
{ return(*(mmask_t *)0); }
@@ -2346,7 +2346,7 @@ void _nc_fifo_dump(
#undef ungetch_sp
int ungetch_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ch)
{ return(*(int *)0); }
@@ -2359,20 +2359,20 @@ int ungetch(
#undef vidputs_sp
int vidputs_sp(
- SCREEN *sp,
- chtype newmode,
+ SCREEN *sp,
+ chtype newmode,
NCURSES_OUTC_sp outc)
{ return(*(int *)0); }
#undef vidputs
int vidputs(
- chtype newmode,
+ chtype newmode,
NCURSES_OUTC outc)
{ return(*(int *)0); }
#undef vidattr_sp
int vidattr_sp(
- SCREEN *sp,
+ SCREEN *sp,
chtype newmode)
{ return(*(int *)0); }
@@ -2394,8 +2394,8 @@ chtype termattrs(void)
#undef wvline
int wvline(
- WINDOW *win,
- chtype ch,
+ WINDOW *win,
+ chtype ch,
int n)
{ return(*(int *)0); }
@@ -2403,8 +2403,8 @@ int wvline(
#undef wattr_off
int wattr_off(
- WINDOW *win,
- attr_t at,
+ WINDOW *win,
+ attr_t at,
void *opts)
{ return(*(int *)0); }
@@ -2412,8 +2412,8 @@ int wattr_off(
#undef wattr_on
int wattr_on(
- WINDOW *win,
- attr_t at,
+ WINDOW *win,
+ attr_t at,
void *opts)
{ return(*(int *)0); }
@@ -2433,14 +2433,14 @@ void _nc_synchook(
#undef mvderwin
int mvderwin(
- WINDOW *win,
- int y,
+ WINDOW *win,
+ int y,
int x)
{ return(*(int *)0); }
#undef syncok
int syncok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL bf)
{ return(*(int *)0); }
@@ -2479,14 +2479,14 @@ struct panelhook *_nc_panelhook(void)
#undef _nc_printf_string_sp
char *_nc_printf_string_sp(
- SCREEN *sp,
- const char *fmt,
+ SCREEN *sp,
+ const char *fmt,
va_list ap)
{ return(*(char **)0); }
#undef _nc_printf_string
char *_nc_printf_string(
- const char *fmt,
+ const char *fmt,
va_list ap)
{ return(*(char **)0); }
@@ -2503,18 +2503,18 @@ int doupdate(void)
#undef _nc_scrolln_sp
int _nc_scrolln_sp(
- SCREEN *sp,
- int n,
- int top,
- int bot,
+ 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 n,
+ int top,
+ int bot,
int maxy)
{ return(*(int *)0); }
@@ -2547,7 +2547,7 @@ void _nc_screen_wrap(void)
#undef _nc_do_xmc_glitch_sp
void _nc_do_xmc_glitch_sp(
- SCREEN *sp,
+ SCREEN *sp,
attr_t previous)
{ /* void */ }
@@ -2560,7 +2560,7 @@ void _nc_do_xmc_glitch(
#undef _nc_varargs
char *_nc_varargs(
- const char *fmt,
+ const char *fmt,
va_list ap)
{ return(*(char **)0); }
@@ -2578,7 +2578,7 @@ void _nc_freeall(void)
#undef _nc_free_and_exit_sp
void _nc_free_and_exit_sp(
- SCREEN *sp,
+ SCREEN *sp,
int code)
{ /* void */ }
@@ -2596,31 +2596,31 @@ void exit_curses(
#undef _nc_toggle_attr_on
void _nc_toggle_attr_on(
- attr_t *S,
+ attr_t *S,
attr_t at)
{ /* void */ }
#undef _nc_toggle_attr_off
void _nc_toggle_attr_off(
- attr_t *S,
+ attr_t *S,
attr_t at)
{ /* void */ }
#undef _nc_DelCharCost_sp
int _nc_DelCharCost_sp(
- SCREEN *sp,
+ SCREEN *sp,
int count)
{ return(*(int *)0); }
#undef _nc_InsCharCost_sp
int _nc_InsCharCost_sp(
- SCREEN *sp,
+ SCREEN *sp,
int count)
{ return(*(int *)0); }
#undef _nc_UpdateAttrs_sp
void _nc_UpdateAttrs_sp(
- SCREEN *sp,
+ SCREEN *sp,
chtype c)
{ /* void */ }
@@ -2643,7 +2643,7 @@ void _nc_UpdateAttrs(
#undef use_legacy_coding_sp
int use_legacy_coding_sp(
- SCREEN *sp,
+ SCREEN *sp,
int level)
{ return(*(int *)0); }
@@ -2665,14 +2665,14 @@ int use_default_colors(void)
#undef assume_default_colors_sp
int assume_default_colors_sp(
- SCREEN *sp,
- int fg,
+ SCREEN *sp,
+ int fg,
int bg)
{ return(*(int *)0); }
#undef assume_default_colors
int assume_default_colors(
- int fg,
+ int fg,
int bg)
{ return(*(int *)0); }
@@ -2680,14 +2680,14 @@ int assume_default_colors(
#undef mcprint_sp
int mcprint_sp(
- SCREEN *sp,
- char *data,
+ SCREEN *sp,
+ char *data,
int len)
{ return(*(int *)0); }
#undef mcprint
int mcprint(
- char *data,
+ char *data,
int len)
{ return(*(int *)0); }
@@ -2701,40 +2701,40 @@ void _nc_new_pair(void)
#undef is_term_resized_sp
NCURSES_BOOL is_term_resized_sp(
- SCREEN *sp,
- int ToLines,
+ SCREEN *sp,
+ int ToLines,
int ToCols)
{ return(*(NCURSES_BOOL *)0); }
#undef is_term_resized
NCURSES_BOOL is_term_resized(
- int ToLines,
+ int ToLines,
int ToCols)
{ return(*(NCURSES_BOOL *)0); }
#undef resize_term_sp
int resize_term_sp(
- SCREEN *sp,
- int ToLines,
+ SCREEN *sp,
+ int ToLines,
int ToCols)
{ return(*(int *)0); }
#undef resize_term
int resize_term(
- int ToLines,
+ int ToLines,
int ToCols)
{ return(*(int *)0); }
#undef resizeterm_sp
int resizeterm_sp(
- SCREEN *sp,
- int ToLines,
+ SCREEN *sp,
+ int ToLines,
int ToCols)
{ return(*(int *)0); }
#undef resizeterm
int resizeterm(
- int ToLines,
+ int ToLines,
int ToCols)
{ return(*(int *)0); }
@@ -2749,8 +2749,8 @@ void _nc_trace_xnames(
#undef use_screen
int use_screen(
- SCREEN *screen,
- NCURSES_SCREEN_CB func,
+ SCREEN *screen,
+ NCURSES_SCREEN_CB func,
void *data)
{ return(*(int *)0); }
@@ -2758,8 +2758,8 @@ int use_screen(
#undef use_window
int use_window(
- WINDOW *win,
- NCURSES_WINDOW_CB func,
+ WINDOW *win,
+ NCURSES_WINDOW_CB func,
void *data)
{ return(*(int *)0); }
@@ -2767,8 +2767,8 @@ int use_window(
#undef wresize
int wresize(
- WINDOW *win,
- int ToLines,
+ WINDOW *win,
+ int ToLines,
int ToCols)
{ return(*(int *)0); }
@@ -2796,7 +2796,7 @@ char *_nc_basename(
#undef _nc_access
int _nc_access(
- const char *path,
+ const char *path,
int mode)
{ return(*(int *)0); }
@@ -2814,12 +2814,25 @@ NCURSES_BOOL _nc_is_file_path(
int _nc_env_access(void)
{ return(*(int *)0); }
+#undef _nc_safe_fopen
+FILE *_nc_safe_fopen(
+ const char *path,
+ const char *mode)
+ { return(*(FILE **)0); }
+
+#undef _nc_safe_open3
+int _nc_safe_open3(
+ const char *path,
+ int flags,
+ mode_t mode)
+ { return(*(int *)0); }
+
/* ./tinfo/add_tries.c */
#undef _nc_add_to_try
int _nc_add_to_try(
- TRIES **tree,
- const char *str,
+ TRIES **tree,
+ const char *str,
unsigned code)
{ return(*(int *)0); }
@@ -2827,13 +2840,13 @@ int _nc_add_to_try(
#undef _nc_align_termtype
void _nc_align_termtype(
- TERMTYPE2 *to,
- TERMTYPE2 *from)
+ TERMTYPE *to,
+ TERMTYPE *from)
{ /* void */ }
#undef _nc_copy_termtype
void _nc_copy_termtype(
- TERMTYPE *dst,
+ TERMTYPE *dst,
const TERMTYPE *src)
{ /* void */ }
@@ -2903,19 +2916,19 @@ void _nc_get_type(
#undef _nc_warning
void _nc_warning(
- const char *const fmt,
+ const char *const fmt,
...)
{ /* void */ }
#undef _nc_err_abort
void _nc_err_abort(
- const char *const fmt,
+ const char *const fmt,
...)
{ /* void */ }
#undef _nc_syserr_abort
void _nc_syserr_abort(
- const char *const fmt,
+ const char *const fmt,
...)
{ /* void */ }
@@ -2923,14 +2936,14 @@ void _nc_syserr_abort(
#undef _nc_find_entry
struct name_table_entry const *_nc_find_entry(
- const char *string,
+ 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,
+ const char *string,
+ int type,
NCURSES_BOOL termcap)
{ return(*(struct name_table_entry const **)0); }
@@ -2967,13 +2980,13 @@ void _nc_last_db(void)
#undef _nc_next_db
const char *_nc_next_db(
- DBDIRS *state,
+ DBDIRS *state,
int *offset)
{ return(*(const char **)0); }
#undef _nc_first_db
void _nc_first_db(
- DBDIRS *state,
+ DBDIRS *state,
int *offset)
{ /* void */ }
@@ -2981,7 +2994,7 @@ void _nc_first_db(
#undef _nc_doalloc
void *_nc_doalloc(
- void *oldp,
+ void *oldp,
size_t amount)
{ return(*(void **)0); }
@@ -2994,8 +3007,8 @@ ENTRY *_nc_tail;
#undef _nc_free_entry
void _nc_free_entry(
- ENTRY *headp,
- TERMTYPE2 *tterm)
+ ENTRY *headp,
+ TERMTYPE *tterm)
{ /* void */ }
#undef _nc_free_entries
@@ -3015,9 +3028,9 @@ void exit_terminfo(
/* ./fallback.c */
#undef _nc_fallback
-const TERMTYPE2 *_nc_fallback(
+const TERMTYPE *_nc_fallback(
const char *name)
- { return(*(const TERMTYPE2 **)0); }
+ { return(*(const TERMTYPE **)0); }
/* ./tinfo/free_ttype.c */
@@ -3026,6 +3039,11 @@ void _nc_free_termtype(
TERMTYPE *ptr)
{ /* void */ }
+#undef _nc_free_termtype1
+void _nc_free_termtype1(
+ TERMTYPE *ptr)
+ { /* void */ }
+
#undef _nc_user_definable
NCURSES_BOOL _nc_user_definable;
@@ -3043,7 +3061,7 @@ int _nc_getenv_num(
#undef _nc_setenv_num
void _nc_setenv_num(
- const char *name,
+ const char *name,
int value)
{ /* void */ }
@@ -3078,8 +3096,8 @@ void _nc_init_acs(void)
/* ./tinfo/lib_baudrate.c */
struct speed {
- int given_speed;
- int actual_speed;
+ int given_speed;
+ int actual_speed;
};
#undef _nc_baudrate
@@ -3118,7 +3136,7 @@ TERMINAL *_nc_cur_term(void)
#undef set_curterm_sp
TERMINAL *set_curterm_sp(
- SCREEN *sp,
+ SCREEN *sp,
TERMINAL *termp)
{ return(*(TERMINAL **)0); }
@@ -3129,7 +3147,7 @@ TERMINAL *set_curterm(
#undef del_curterm_sp
int del_curterm_sp(
- SCREEN *sp,
+ SCREEN *sp,
TERMINAL *termp)
{ return(*(int *)0); }
@@ -3245,7 +3263,7 @@ struct kn { short offset; int code; };
#undef keyname_sp
const char *keyname_sp(
- SCREEN *sp,
+ SCREEN *sp,
int c)
{ return(*(const char **)0); }
@@ -3269,7 +3287,7 @@ char *longname(void)
#undef napms_sp
int napms_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ms)
{ return(*(int *)0); }
@@ -3282,19 +3300,19 @@ int napms(
#undef idlok
int idlok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef idcok
void idcok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ /* void */ }
#undef halfdelay_sp
int halfdelay_sp(
- SCREEN *sp,
+ SCREEN *sp,
int t)
{ return(*(int *)0); }
@@ -3305,37 +3323,37 @@ int halfdelay(
#undef nodelay
int nodelay(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef notimeout
int notimeout(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL f)
{ return(*(int *)0); }
#undef wtimeout
void wtimeout(
- WINDOW *win,
+ WINDOW *win,
int delay)
{ /* void */ }
#undef keypad
int keypad(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef meta
int meta(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef curs_set_sp
int curs_set_sp(
- SCREEN *sp,
+ SCREEN *sp,
int vis)
{ return(*(int *)0); }
@@ -3346,7 +3364,7 @@ int curs_set(
#undef typeahead_sp
int typeahead_sp(
- SCREEN *sp,
+ SCREEN *sp,
int fd)
{ return(*(int *)0); }
@@ -3357,7 +3375,7 @@ int typeahead(
#undef has_key_sp
int has_key_sp(
- SCREEN *sp,
+ SCREEN *sp,
int keycode)
{ return(*(int *)0); }
@@ -3368,14 +3386,14 @@ int has_key(
#undef _nc_putp_flush_sp
int _nc_putp_flush_sp(
- SCREEN *sp,
- const char *name,
+ SCREEN *sp,
+ const char *name,
const char *value)
{ return(*(int *)0); }
#undef _nc_keypad
int _nc_keypad(
- SCREEN *sp,
+ SCREEN *sp,
int flag)
{ return(*(int *)0); }
@@ -3437,17 +3455,53 @@ void noqiflush(void)
#undef intrflush_sp
int intrflush_sp(
- SCREEN *sp,
- WINDOW *win,
+ SCREEN *sp,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef intrflush
int intrflush(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
+#undef is_nl_sp
+int is_nl_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_raw_sp
+int is_raw_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_cbreak_sp
+int is_cbreak_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_echo_sp
+int is_echo_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_nl
+int is_nl(void)
+ { return(*(int *)0); }
+
+#undef is_raw
+int is_raw(void)
+ { return(*(int *)0); }
+
+#undef is_cbreak
+int is_cbreak(void)
+ { return(*(int *)0); }
+
+#undef is_echo
+int is_echo(void)
+ { return(*(int *)0); }
+
/* ./tinfo/lib_setup.c */
#undef _nc_ttytype
@@ -3483,7 +3537,7 @@ int _nc_TABSIZE(void)
#undef set_tabsize_sp
int set_tabsize_sp(
- SCREEN *sp,
+ SCREEN *sp,
int value)
{ return(*(int *)0); }
@@ -3499,13 +3553,13 @@ int _nc_handle_sigwinch(
#undef use_env_sp
void use_env_sp(
- SCREEN *sp,
+ SCREEN *sp,
NCURSES_BOOL f)
{ /* void */ }
#undef use_tioctl_sp
void use_tioctl_sp(
- SCREEN *sp,
+ SCREEN *sp,
NCURSES_BOOL f)
{ /* void */ }
@@ -3521,8 +3575,8 @@ void use_tioctl(
#undef _nc_get_screensize
void _nc_get_screensize(
- SCREEN *sp,
- int *linep,
+ SCREEN *sp,
+ int *linep,
int *colp)
{ /* void */ }
@@ -3533,13 +3587,13 @@ void _nc_update_screensize(
#undef _nc_setup_tinfo
int _nc_setup_tinfo(
- const char *const tn,
- TERMTYPE2 *const tp)
+ const char *const tn,
+ TERMTYPE *const tp)
{ return(*(int *)0); }
#undef _nc_tinfo_cmdch
void _nc_tinfo_cmdch(
- TERMINAL *termp,
+ TERMINAL *termp,
int proto)
{ /* void */ }
@@ -3558,9 +3612,9 @@ int _nc_locale_breaks_acs(
#undef _nc_setupterm
int _nc_setupterm(
- const char *tname,
- int Filedes,
- int *errret,
+ const char *tname,
+ int Filedes,
+ int *errret,
int reuse)
{ return(*(int *)0); }
@@ -3578,8 +3632,8 @@ SCREEN *new_prescr(void)
#undef setupterm
int setupterm(
- const char *tname,
- int Filedes,
+ const char *tname,
+ int Filedes,
int *errret)
{ return(*(int *)0); }
@@ -3592,20 +3646,20 @@ char *BC;
#undef tgetent_sp
int tgetent_sp(
- SCREEN *sp,
- char *bufp,
+ SCREEN *sp,
+ char *bufp,
const char *name)
{ return(*(int *)0); }
#undef tgetent
int tgetent(
- char *bufp,
+ char *bufp,
const char *name)
{ return(*(int *)0); }
#undef tgetflag_sp
int tgetflag_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *id)
{ return(*(int *)0); }
@@ -3616,7 +3670,7 @@ int tgetflag(
#undef tgetnum_sp
int tgetnum_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *id)
{ return(*(int *)0); }
@@ -3627,14 +3681,14 @@ int tgetnum(
#undef tgetstr_sp
char *tgetstr_sp(
- SCREEN *sp,
- const char *id,
+ SCREEN *sp,
+ const char *id,
char **area)
{ return(*(char **)0); }
#undef tgetstr
char *tgetstr(
- const char *id,
+ const char *id,
char **area)
{ return(*(char **)0); }
@@ -3653,8 +3707,8 @@ char *termname(void)
#undef tgoto
char *tgoto(
- const char *string,
- int x,
+ const char *string,
+ int x,
int y)
{ return(*(char **)0); }
@@ -3662,7 +3716,7 @@ char *tgoto(
#undef tigetflag_sp
int tigetflag_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(int *)0); }
@@ -3673,7 +3727,7 @@ int tigetflag(
#undef tigetnum_sp
int tigetnum_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(int *)0); }
@@ -3684,7 +3738,7 @@ int tigetnum(
#undef tigetstr_sp
char *tigetstr_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(char **)0); }
@@ -3698,32 +3752,58 @@ char *tigetstr(
#undef _nc_tparm_err
int _nc_tparm_err;
+#undef _nc_free_tparm
+void _nc_free_tparm(
+ TERMINAL *termp)
+ { /* void */ }
+
#undef _nc_tparm_analyze
int _nc_tparm_analyze(
- const char *string,
- char *p_is_s[9],
+ TERMINAL *term,
+ const char *string,
+ char **p_is_s,
int *_nc_popcount)
{ return(*(int *)0); }
#undef tparm
char *tparm(
- const char *string,
+ const char *string,
...)
{ return(*(char **)0); }
#undef tiparm
char *tiparm(
- const char *string,
+ const char *string,
...)
{ return(*(char **)0); }
+#undef tiparm_s
+char *tiparm_s(
+ int num_expected,
+ int tparm_type,
+ const char *string,
+ ...)
+ { return(*(char **)0); }
+
+#undef tiscan_s
+int tiscan_s(
+ int *num_expected,
+ int *tparm_type,
+ const char *string)
+ { return(*(int *)0); }
+
#undef _nc_tiparm
char *_nc_tiparm(
- int expected,
- const char *string,
+ int expected,
+ const char *string,
...)
{ return(*(char **)0); }
+#undef _nc_reset_tparm
+void _nc_reset_tparm(
+ TERMINAL *term)
+ { /* void */ }
+
/* ./tinfo/lib_tputs.c */
#undef PC
@@ -3740,7 +3820,7 @@ void _nc_set_no_padding(
#undef delay_output_sp
int delay_output_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ms)
{ return(*(int *)0); }
@@ -3760,7 +3840,7 @@ void _nc_flush(void)
#undef _nc_outch_sp
int _nc_outch_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ch)
{ return(*(int *)0); }
@@ -3771,7 +3851,7 @@ int _nc_outch(
#undef _nc_putchar_sp
int _nc_putchar_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ch)
{ return(*(int *)0); }
@@ -3782,7 +3862,7 @@ int _nc_putchar(
#undef putp_sp
int putp_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *string)
{ return(*(int *)0); }
@@ -3793,35 +3873,35 @@ int putp(
#undef _nc_putp_sp
int _nc_putp_sp(
- SCREEN *sp,
- const char *name,
+ SCREEN *sp,
+ const char *name,
const char *string)
{ return(*(int *)0); }
#undef _nc_putp
int _nc_putp(
- const char *name,
+ const char *name,
const char *string)
{ return(*(int *)0); }
#undef tputs_sp
int tputs_sp(
- SCREEN *sp,
- const char *string,
- int affcnt,
+ SCREEN *sp,
+ const char *string,
+ int affcnt,
NCURSES_OUTC_sp outc)
{ return(*(int *)0); }
#undef _nc_outc_wrapper
int _nc_outc_wrapper(
- SCREEN *sp,
+ SCREEN *sp,
int c)
{ return(*(int *)0); }
#undef tputs
int tputs(
- const char *string,
- int affcnt,
+ const char *string,
+ int affcnt,
int (*outc)(
int p1))
{ return(*(int *)0); }
@@ -3861,7 +3941,7 @@ void trace(
#undef _tracef
void _tracef(
- const char *fmt,
+ const char *fmt,
...)
{ /* void */ }
@@ -3917,8 +3997,8 @@ WINDOW *_nc_retrace_win(
#undef _nc_fmt_funcptr
char *_nc_fmt_funcptr(
- char *target,
- const char *source,
+ char *target,
+ const char *source,
size_t size)
{ return(*(char **)0); }
@@ -3929,7 +4009,7 @@ int _nc_use_tracef(
#undef _nc_locked_tracef
void _nc_locked_tracef(
- const char *fmt,
+ const char *fmt,
...)
{ /* void */ }
@@ -3937,7 +4017,7 @@ void _nc_locked_tracef(
#undef _traceattr2
char *_traceattr2(
- int bufnum,
+ int bufnum,
chtype newmode)
{ return(*(char **)0); }
@@ -3958,13 +4038,13 @@ attr_t _nc_retrace_attr_t(
#undef _nc_altcharset_name
const char *_nc_altcharset_name(
- attr_t attr,
+ attr_t attr,
chtype ch)
{ return(*(const char **)0); }
#undef _tracechtype2
char *_tracechtype2(
- int bufnum,
+ int bufnum,
chtype ch)
{ return(*(char **)0); }
@@ -3982,7 +4062,7 @@ chtype _nc_retrace_chtype(
#undef _nc_trace_ttymode
char *_nc_trace_ttymode(
- struct termios *tty)
+ const struct termios *tty)
{ return(*(char **)0); }
#undef _nc_tracebits
@@ -3993,7 +4073,7 @@ char *_nc_tracebits(void)
#undef _nc_tracechar
char *_nc_tracechar(
- SCREEN *sp,
+ SCREEN *sp,
int ch)
{ return(*(char **)0); }
@@ -4006,7 +4086,7 @@ char *_tracechar(
#undef _nc_get_tty_mode_sp
int _nc_get_tty_mode_sp(
- SCREEN *sp,
+ SCREEN *sp,
struct termios *buf)
{ return(*(int *)0); }
@@ -4017,7 +4097,7 @@ int _nc_get_tty_mode(
#undef _nc_set_tty_mode_sp
int _nc_set_tty_mode_sp(
- SCREEN *sp,
+ SCREEN *sp,
struct termios *buf)
{ return(*(int *)0); }
@@ -4084,9 +4164,9 @@ int resetty(void)
#undef _nc_timed_wait
int _nc_timed_wait(
- SCREEN *sp,
- int mode,
- int milliseconds,
+ SCREEN *sp,
+ int mode,
+ int milliseconds,
int *timeleft)
{ return(*(int *)0); }
@@ -4099,8 +4179,8 @@ char *_nc_first_name(
#undef _nc_name_match
int _nc_name_match(
- const char *const namelst,
- const char *const name,
+ const char *const namelst,
+ const char *const name,
const char *const delim)
{ return(*(int *)0); }
@@ -4134,14 +4214,14 @@ const char *const *_nc_strfnames(void)
#undef _nc_set_buffer_sp
void _nc_set_buffer_sp(
- SCREEN *sp,
- FILE *ofp,
+ SCREEN *sp,
+ FILE *ofp,
int buffered)
{ /* void */ }
#undef _nc_set_buffer
void _nc_set_buffer(
- FILE *ofp,
+ FILE *ofp,
int buffered)
{ /* void */ }
@@ -4149,67 +4229,67 @@ void _nc_set_buffer(
#undef _nc_init_termtype
void _nc_init_termtype(
- TERMTYPE2 *const tp)
+ TERMTYPE *const tp)
{ /* void */ }
#undef _nc_read_termtype
int _nc_read_termtype(
- TERMTYPE2 *ptr,
- char *buffer,
+ TERMTYPE *ptr,
+ char *buffer,
int limit)
{ return(*(int *)0); }
#undef _nc_read_file_entry
int _nc_read_file_entry(
- const char *const filename,
- TERMTYPE2 *ptr)
+ const char *const filename,
+ TERMTYPE *ptr)
{ return(*(int *)0); }
#undef _nc_read_entry
int _nc_read_entry(
- const char *const name,
- char *const filename,
- TERMTYPE2 *const tp)
+ const char *const name,
+ char *const filename,
+ TERMTYPE *const tp)
{ return(*(int *)0); }
/* ./tinfo/read_termcap.c */
#undef _nc_read_termcap_entry
int _nc_read_termcap_entry(
- const char *const tn,
- TERMTYPE2 *const tp)
+ const char *const tn,
+ TERMTYPE *const tp)
{ return(*(int *)0); }
/* ./tinfo/strings.c */
#undef _nc_str_init
string_desc *_nc_str_init(
- string_desc *dst,
- char *src,
+ string_desc *dst,
+ char *src,
size_t len)
{ return(*(string_desc **)0); }
#undef _nc_str_null
string_desc *_nc_str_null(
- string_desc *dst,
+ string_desc *dst,
size_t len)
{ return(*(string_desc **)0); }
#undef _nc_str_copy
string_desc *_nc_str_copy(
- string_desc *dst,
- string_desc *src)
+ string_desc *dst,
+ const string_desc *const src)
{ return(*(string_desc **)0); }
#undef _nc_safe_strcat
NCURSES_BOOL _nc_safe_strcat(
- string_desc *dst,
+ string_desc *dst,
const char *src)
{ return(*(NCURSES_BOOL *)0); }
#undef _nc_safe_strcpy
NCURSES_BOOL _nc_safe_strcpy(
- string_desc *dst,
+ string_desc *dst,
const char *src)
{ return(*(NCURSES_BOOL *)0); }
@@ -4217,13 +4297,13 @@ NCURSES_BOOL _nc_safe_strcpy(
#undef _nc_trace_buf
char *_nc_trace_buf(
- int bufnum,
+ int bufnum,
size_t want)
{ return(*(char **)0); }
#undef _nc_trace_bufcat
char *_nc_trace_bufcat(
- int bufnum,
+ int bufnum,
const char *value)
{ return(*(char **)0); }
@@ -4238,21 +4318,21 @@ void _nc_trace_tries(
#undef _nc_expand_try
char *_nc_expand_try(
- TRIES *tree,
- unsigned code,
- int *count,
+ TRIES *tree,
+ unsigned code,
+ int *count,
size_t len)
{ return(*(char **)0); }
#undef _nc_remove_key
int _nc_remove_key(
- TRIES **tree,
+ TRIES **tree,
unsigned code)
{ return(*(int *)0); }
#undef _nc_remove_string
int _nc_remove_string(
- TRIES **tree,
+ TRIES **tree,
const char *string)
{ return(*(int *)0); }
@@ -4260,14 +4340,14 @@ int _nc_remove_string(
#undef _nc_trim_sgr0
char *_nc_trim_sgr0(
- TERMTYPE2 *tp)
+ TERMTYPE *tp)
{ return(*(char **)0); }
/* ./unctrl.c */
#undef unctrl_sp
const char *unctrl_sp(
- SCREEN *sp,
+ SCREEN *sp,
chtype ch)
{ return(*(const char **)0); }
@@ -4280,7 +4360,7 @@ const char *unctrl(
#undef _nc_visbuf2
const char *_nc_visbuf2(
- int bufnum,
+ int bufnum,
const char *buf)
{ return(*(const char **)0); }
@@ -4291,20 +4371,20 @@ const char *_nc_visbuf(
#undef _nc_visbufn
const char *_nc_visbufn(
- const char *buf,
+ const char *buf,
int len)
{ return(*(const char **)0); }
#undef _nc_viscbuf2
const char *_nc_viscbuf2(
- int bufnum,
- const chtype *buf,
+ int bufnum,
+ const chtype *buf,
int len)
{ return(*(const char **)0); }
#undef _nc_viscbuf
const char *_nc_viscbuf(
- const chtype *buf,
+ const chtype *buf,
int len)
{ return(*(const char **)0); }
@@ -4322,18 +4402,18 @@ ENTRY *_nc_copy_entry(
#undef _nc_save_str
char *_nc_save_str(
- const char *const string)
+ const char *string)
{ return(*(char **)0); }
#undef _nc_wrap_entry
void _nc_wrap_entry(
- ENTRY *const ep,
+ ENTRY *const ep,
NCURSES_BOOL copy_strings)
{ /* void */ }
#undef _nc_merge_entry
void _nc_merge_entry(
- ENTRY *const target,
+ ENTRY *const target,
ENTRY *const source)
{ /* void */ }
@@ -4341,15 +4421,15 @@ void _nc_merge_entry(
#undef _nc_captoinfo
char *_nc_captoinfo(
- const char *cap,
- const char *s,
+ const char *cap,
+ const char *s,
int const parameterized)
{ return(*(char **)0); }
#undef _nc_infotocap
char *_nc_infotocap(
- const char *cap,
- const char *str,
+ const char *cap,
+ const char *str,
int const parameterized)
{ return(*(char **)0); }
@@ -4357,8 +4437,8 @@ char *_nc_infotocap(
#undef _nc_tic_expand
char *_nc_tic_expand(
- const char *srcp,
- NCURSES_BOOL tic_format,
+ const char *srcp,
+ NCURSES_BOOL tic_format,
int numbers)
{ return(*(char **)0); }
@@ -4366,28 +4446,28 @@ char *_nc_tic_expand(
#undef _nc_check_termtype2
void (*_nc_check_termtype2)(
- TERMTYPE2 *p1,
+ TERMTYPE *p1,
NCURSES_BOOL p2);
#undef _nc_entry_match
NCURSES_BOOL _nc_entry_match(
- char *n1,
+ char *n1,
char *n2)
{ return(*(NCURSES_BOOL *)0); }
#undef _nc_read_entry_source
void _nc_read_entry_source(
- FILE *fp,
- char *buf,
- int literal,
- NCURSES_BOOL silent,
+ FILE *fp,
+ char *buf,
+ int literal,
+ NCURSES_BOOL silent,
NCURSES_BOOL (*hook)(
ENTRY *p1))
{ /* void */ }
#undef _nc_resolve_uses2
int _nc_resolve_uses2(
- NCURSES_BOOL fullresolve,
+ NCURSES_BOOL fullresolve,
NCURSES_BOOL literal)
{ return(*(int *)0); }
@@ -4412,7 +4492,7 @@ NCURSES_BOOL _nc_disable_period;
#undef _nc_reset_input
void _nc_reset_input(
- FILE *fp,
+ FILE *fp,
char *buf)
{ /* void */ }
@@ -4423,8 +4503,8 @@ int _nc_get_token(
#undef _nc_trans_string
int _nc_trans_string(
- char *ptr,
- char *last)
+ char *ptr,
+ const char *const last)
{ return(*(int *)0); }
#undef _nc_push_token
@@ -4441,14 +4521,14 @@ void _nc_panic_mode(
#undef _nc_parse_entry
int _nc_parse_entry(
- ENTRY *entryp,
- int literal,
+ ENTRY *entryp,
+ int literal,
NCURSES_BOOL silent)
{ return(*(int *)0); }
#undef _nc_capcmp
int _nc_capcmp(
- const char *s,
+ const char *s,
const char *t)
{ return(*(int *)0); }
@@ -4461,14 +4541,14 @@ void _nc_set_writedir(
#undef _nc_write_entry
void _nc_write_entry(
- TERMTYPE2 *const tp)
+ TERMTYPE *const tp)
{ /* void */ }
#undef _nc_write_object
int _nc_write_object(
- TERMTYPE2 *tp,
- char *buffer,
- unsigned *offset,
+ TERMTYPE *tp,
+ char *buffer,
+ unsigned *offset,
unsigned limit)
{ return(*(int *)0); }
@@ -4480,14 +4560,14 @@ int _nc_tic_written(void)
#undef define_key_sp
int define_key_sp(
- SCREEN *sp,
- const char *str,
+ SCREEN *sp,
+ const char *str,
int keycode)
{ return(*(int *)0); }
#undef define_key
int define_key(
- const char *str,
+ const char *str,
int keycode)
{ return(*(int *)0); }
@@ -4501,7 +4581,7 @@ void _nc_hashed_db(void)
#undef key_defined_sp
int key_defined_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(int *)0); }
@@ -4514,14 +4594,14 @@ int key_defined(
#undef keybound_sp
char *keybound_sp(
- SCREEN *sp,
- int code,
+ SCREEN *sp,
+ int code,
int count)
{ return(*(char **)0); }
#undef keybound
char *keybound(
- int code,
+ int code,
int count)
{ return(*(char **)0); }
@@ -4529,14 +4609,14 @@ char *keybound(
#undef keyok_sp
int keyok_sp(
- SCREEN *sp,
- int c,
+ SCREEN *sp,
+ int c,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef keyok
int keyok(
- int c,
+ int c,
NCURSES_BOOL flag)
{ return(*(int *)0); }
diff --git a/ncurses/llib-lncursestw b/ncurses/llib-lncursestw
index 3c1aab97bc65..3aa57eee919a 100644
--- a/ncurses/llib-lncursestw
+++ b/ncurses/llib-lncursestw
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2022,2023 Thomas E. Dickey *
* Copyright 2009-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -70,7 +70,7 @@ void _nc_hash_map(void)
#undef _nc_make_oldhash_sp
void _nc_make_oldhash_sp(
- SCREEN *sp,
+ SCREEN *sp,
int i)
{ /* void */ }
@@ -81,16 +81,16 @@ void _nc_make_oldhash(
#undef _nc_scroll_oldhash_sp
void _nc_scroll_oldhash_sp(
- SCREEN *sp,
- int n,
- int top,
+ SCREEN *sp,
+ int n,
+ int top,
int bot)
{ /* void */ }
#undef _nc_scroll_oldhash
void _nc_scroll_oldhash(
- int n,
- int top,
+ int n,
+ int top,
int bot)
{ /* void */ }
@@ -98,31 +98,31 @@ void _nc_scroll_oldhash(
#undef _nc_render
cchar_t _nc_render(
- WINDOW *win,
+ WINDOW *win,
cchar_t ch)
{ return(*(cchar_t *)0); }
#undef _nc_build_wch
int _nc_build_wch(
- WINDOW *win,
+ WINDOW *win,
cchar_t *ch)
{ return(*(int *)0); }
#undef _nc_waddch_nosync
int _nc_waddch_nosync(
- WINDOW *win,
+ WINDOW *win,
const cchar_t c)
{ return(*(int *)0); }
#undef waddch
int waddch(
- WINDOW *win,
+ WINDOW *win,
const chtype ch)
{ return(*(int *)0); }
#undef wechochar
int wechochar(
- WINDOW *win,
+ WINDOW *win,
const chtype ch)
{ return(*(int *)0); }
@@ -130,15 +130,15 @@ int wechochar(
#undef waddnstr
int waddnstr(
- WINDOW *win,
- const char *astr,
+ WINDOW *win,
+ const char *astr,
int n)
{ return(*(int *)0); }
#undef waddchnstr
int waddchnstr(
- WINDOW *win,
- const chtype *astr,
+ WINDOW *win,
+ const chtype *astr,
int n)
{ return(*(int *)0); }
@@ -149,15 +149,15 @@ int _nc_wchstrlen(
#undef wadd_wchnstr
int wadd_wchnstr(
- WINDOW *win,
- const cchar_t *astr,
+ WINDOW *win,
+ const cchar_t *astr,
int n)
{ return(*(int *)0); }
#undef waddnwstr
int waddnwstr(
- WINDOW *win,
- const wchar_t *str,
+ WINDOW *win,
+ const wchar_t *str,
int n)
{ return(*(int *)0); }
@@ -176,25 +176,25 @@ int beep(void)
#undef wbkgrndset
void wbkgrndset(
- WINDOW *win,
+ WINDOW *win,
const cchar_t *ch)
{ /* void */ }
#undef wbkgdset
void wbkgdset(
- WINDOW *win,
+ WINDOW *win,
chtype ch)
{ /* void */ }
#undef wbkgrnd
int wbkgrnd(
- WINDOW *win,
+ WINDOW *win,
const cchar_t *ch)
{ return(*(int *)0); }
#undef wbkgd
int wbkgd(
- WINDOW *win,
+ WINDOW *win,
chtype ch)
{ return(*(int *)0); }
@@ -202,14 +202,14 @@ int wbkgd(
#undef wborder
int wborder(
- WINDOW *win,
- chtype ls,
- chtype rs,
- chtype ts,
- chtype bs,
- chtype tl,
- chtype tr,
- chtype bl,
+ WINDOW *win,
+ chtype ls,
+ chtype rs,
+ chtype ts,
+ chtype bs,
+ chtype tl,
+ chtype tr,
+ chtype bl,
chtype br)
{ return(*(int *)0); }
@@ -217,10 +217,10 @@ int wborder(
#undef wchgat
int wchgat(
- WINDOW *win,
- int n,
- attr_t attr,
- short pair_arg,
+ WINDOW *win,
+ int n,
+ attr_t attr,
+ short pair_arg,
const void *opts)
{ return(*(int *)0); }
@@ -235,7 +235,7 @@ int wclear(
#undef clearok
int clearok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
@@ -283,62 +283,62 @@ int start_color(void)
#undef _nc_change_pair
void _nc_change_pair(
- SCREEN *sp,
+ SCREEN *sp,
int pair)
{ /* void */ }
#undef _nc_reserve_pairs
void _nc_reserve_pairs(
- SCREEN *sp,
+ SCREEN *sp,
int want)
{ /* void */ }
#undef _nc_init_pair
int _nc_init_pair(
- SCREEN *sp,
- int pair,
- int f,
+ SCREEN *sp,
+ int pair,
+ int f,
int b)
{ return(*(int *)0); }
#undef init_pair_sp
int init_pair_sp(
- SCREEN *sp,
- short pair,
- short f,
+ SCREEN *sp,
+ short pair,
+ short f,
short b)
{ return(*(int *)0); }
#undef init_pair
int init_pair(
- short pair,
- short f,
+ short pair,
+ short f,
short b)
{ return(*(int *)0); }
#undef _nc_init_color
int _nc_init_color(
- SCREEN *sp,
- int color,
- int r,
- int g,
+ SCREEN *sp,
+ int color,
+ int r,
+ int g,
int b)
{ return(*(int *)0); }
#undef init_color_sp
int init_color_sp(
- SCREEN *sp,
- short color,
- short r,
- short g,
+ 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 color,
+ short r,
+ short g,
short b)
{ return(*(int *)0); }
@@ -362,92 +362,92 @@ NCURSES_BOOL has_colors(void)
#undef color_content_sp
int color_content_sp(
- SCREEN *sp,
- short color,
- short *r,
- short *g,
+ 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 color,
+ short *r,
+ short *g,
short *b)
{ return(*(int *)0); }
#undef _nc_pair_content
int _nc_pair_content(
- SCREEN *sp,
- int pair,
- int *f,
+ SCREEN *sp,
+ int pair,
+ int *f,
int *b)
{ return(*(int *)0); }
#undef pair_content_sp
int pair_content_sp(
- SCREEN *sp,
- short pair,
- short *f,
+ SCREEN *sp,
+ short pair,
+ short *f,
short *b)
{ return(*(int *)0); }
#undef pair_content
int pair_content(
- short pair,
- short *f,
+ short pair,
+ short *f,
short *b)
{ return(*(int *)0); }
#undef _nc_do_color_sp
void _nc_do_color_sp(
- SCREEN *sp,
- int old_pair,
- int pair,
- int reverse,
+ SCREEN *sp,
+ int old_pair,
+ int pair,
+ int reverse,
NCURSES_OUTC_sp outc)
{ /* void */ }
#undef _nc_do_color
void _nc_do_color(
- int old_pair,
- int pair,
- int reverse,
+ int old_pair,
+ int pair,
+ int reverse,
NCURSES_OUTC outc)
{ /* void */ }
#undef init_extended_pair_sp
int init_extended_pair_sp(
- SCREEN *sp,
- int pair,
- int f,
+ SCREEN *sp,
+ int pair,
+ int f,
int b)
{ return(*(int *)0); }
#undef init_extended_color_sp
int init_extended_color_sp(
- SCREEN *sp,
- int color,
- int r,
- int g,
+ SCREEN *sp,
+ int color,
+ int r,
+ int g,
int b)
{ return(*(int *)0); }
#undef extended_color_content_sp
int extended_color_content_sp(
- SCREEN *sp,
- int color,
- int *r,
- int *g,
+ SCREEN *sp,
+ int color,
+ int *r,
+ int *g,
int *b)
{ return(*(int *)0); }
#undef extended_pair_content_sp
int extended_pair_content_sp(
- SCREEN *sp,
- int pair,
- int *f,
+ SCREEN *sp,
+ int pair,
+ int *f,
int *b)
{ return(*(int *)0); }
@@ -458,31 +458,31 @@ void reset_color_pairs_sp(
#undef init_extended_pair
int init_extended_pair(
- int pair,
- int f,
+ int pair,
+ int f,
int b)
{ return(*(int *)0); }
#undef init_extended_color
int init_extended_color(
- int color,
- int r,
- int g,
+ int color,
+ int r,
+ int g,
int b)
{ return(*(int *)0); }
#undef extended_color_content
int extended_color_content(
- int color,
- int *r,
- int *g,
+ int color,
+ int *r,
+ int *g,
int *b)
{ return(*(int *)0); }
#undef extended_pair_content
int extended_pair_content(
- int pair,
- int *f,
+ int pair,
+ int *f,
int *b)
{ return(*(int *)0); }
@@ -494,8 +494,8 @@ void reset_color_pairs(void)
#undef wcolor_set
int wcolor_set(
- WINDOW *win,
- short pair_arg,
+ WINDOW *win,
+ short pair_arg,
void *opts)
{ return(*(int *)0); }
@@ -571,7 +571,7 @@ int addch(
#undef addchnstr
int addchnstr(
- const chtype *a1,
+ const chtype *a1,
int z)
{ return(*(int *)0); }
@@ -582,7 +582,7 @@ int addchstr(
#undef addnstr
int addnstr(
- const char *a1,
+ const char *a1,
int z)
{ return(*(int *)0); }
@@ -593,42 +593,42 @@ int addstr(
#undef attroff
int attroff(
- int z)
+ NCURSES_ATTR_T z)
{ return(*(int *)0); }
#undef attron
int attron(
- int z)
+ NCURSES_ATTR_T z)
{ return(*(int *)0); }
#undef attrset
int attrset(
- int z)
+ NCURSES_ATTR_T z)
{ return(*(int *)0); }
#undef attr_get
int attr_get(
- attr_t *a1,
- short *a2,
+ attr_t *a1,
+ short *a2,
void *z)
{ return(*(int *)0); }
#undef attr_off
int attr_off(
- attr_t a1,
+ attr_t a1,
void *z)
{ return(*(int *)0); }
#undef attr_on
int attr_on(
- attr_t a1,
+ attr_t a1,
void *z)
{ return(*(int *)0); }
#undef attr_set
int attr_set(
- attr_t a1,
- short a2,
+ attr_t a1,
+ short a2,
void *z)
{ return(*(int *)0); }
@@ -644,28 +644,28 @@ void bkgdset(
#undef border
int border(
- chtype a1,
- chtype a2,
- chtype a3,
- chtype a4,
- chtype a5,
- chtype a6,
- chtype a7,
+ 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,
+ WINDOW *a1,
+ chtype a2,
chtype z)
{ return(*(int *)0); }
#undef chgat
int chgat(
- int a1,
- attr_t a2,
- short a3,
+ int a1,
+ attr_t a2,
+ short a3,
const void *z)
{ return(*(int *)0); }
@@ -683,7 +683,7 @@ int clrtoeol(void)
#undef color_set
int color_set(
- short a1,
+ short a1,
void *z)
{ return(*(int *)0); }
@@ -720,7 +720,7 @@ int getch(void)
#undef getnstr
int getnstr(
- char *a1,
+ char *a1,
int z)
{ return(*(int *)0); }
@@ -731,7 +731,7 @@ int getstr(
#undef hline
int hline(
- chtype a1,
+ chtype a1,
int z)
{ return(*(int *)0); }
@@ -741,7 +741,7 @@ chtype inch(void)
#undef inchnstr
int inchnstr(
- chtype *a1,
+ chtype *a1,
int z)
{ return(*(int *)0); }
@@ -752,7 +752,7 @@ int inchstr(
#undef innstr
int innstr(
- char *a1,
+ char *a1,
int z)
{ return(*(int *)0); }
@@ -772,7 +772,7 @@ int insertln(void)
#undef insnstr
int insnstr(
- const char *a1,
+ const char *a1,
int z)
{ return(*(int *)0); }
@@ -788,323 +788,323 @@ int instr(
#undef move
int move(
- int a1,
+ int a1,
int z)
{ return(*(int *)0); }
#undef mvaddch
int mvaddch(
- int a1,
- int a2,
+ int a1,
+ int a2,
const chtype z)
{ return(*(int *)0); }
#undef mvaddchnstr
int mvaddchnstr(
- int a1,
- int a2,
- const chtype *a3,
+ int a1,
+ int a2,
+ const chtype *a3,
int z)
{ return(*(int *)0); }
#undef mvaddchstr
int mvaddchstr(
- int a1,
- int a2,
+ int a1,
+ int a2,
const chtype *z)
{ return(*(int *)0); }
#undef mvaddnstr
int mvaddnstr(
- int a1,
- int a2,
- const char *a3,
+ int a1,
+ int a2,
+ const char *a3,
int z)
{ return(*(int *)0); }
#undef mvaddstr
int mvaddstr(
- int a1,
- int a2,
+ 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,
+ int a1,
+ int a2,
+ int a3,
+ attr_t a4,
+ short a5,
const void *z)
{ return(*(int *)0); }
#undef mvdelch
int mvdelch(
- int a1,
+ int a1,
int z)
{ return(*(int *)0); }
#undef mvgetch
int mvgetch(
- int a1,
+ int a1,
int z)
{ return(*(int *)0); }
#undef mvgetnstr
int mvgetnstr(
- int a1,
- int a2,
- char *a3,
+ int a1,
+ int a2,
+ char *a3,
int z)
{ return(*(int *)0); }
#undef mvgetstr
int mvgetstr(
- int a1,
- int a2,
+ int a1,
+ int a2,
char *z)
{ return(*(int *)0); }
#undef mvhline
int mvhline(
- int a1,
- int a2,
- chtype a3,
+ int a1,
+ int a2,
+ chtype a3,
int z)
{ return(*(int *)0); }
#undef mvinch
chtype mvinch(
- int a1,
+ int a1,
int z)
{ return(*(chtype *)0); }
#undef mvinchnstr
int mvinchnstr(
- int a1,
- int a2,
- chtype *a3,
+ int a1,
+ int a2,
+ chtype *a3,
int z)
{ return(*(int *)0); }
#undef mvinchstr
int mvinchstr(
- int a1,
- int a2,
+ int a1,
+ int a2,
chtype *z)
{ return(*(int *)0); }
#undef mvinnstr
int mvinnstr(
- int a1,
- int a2,
- char *a3,
+ int a1,
+ int a2,
+ char *a3,
int z)
{ return(*(int *)0); }
#undef mvinsch
int mvinsch(
- int a1,
- int a2,
+ int a1,
+ int a2,
chtype z)
{ return(*(int *)0); }
#undef mvinsnstr
int mvinsnstr(
- int a1,
- int a2,
- const char *a3,
+ int a1,
+ int a2,
+ const char *a3,
int z)
{ return(*(int *)0); }
#undef mvinsstr
int mvinsstr(
- int a1,
- int a2,
+ int a1,
+ int a2,
const char *z)
{ return(*(int *)0); }
#undef mvinstr
int mvinstr(
- int a1,
- int a2,
+ int a1,
+ int a2,
char *z)
{ return(*(int *)0); }
#undef mvvline
int mvvline(
- int a1,
- int a2,
- chtype a3,
+ int a1,
+ int a2,
+ chtype a3,
int z)
{ return(*(int *)0); }
#undef mvwaddch
int mvwaddch(
- WINDOW *a1,
- int a2,
- int a3,
+ 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,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ const chtype *a4,
int z)
{ return(*(int *)0); }
#undef mvwaddchstr
int mvwaddchstr(
- WINDOW *a1,
- int a2,
- int a3,
+ 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,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ const char *a4,
int z)
{ return(*(int *)0); }
#undef mvwaddstr
int mvwaddstr(
- WINDOW *a1,
- int a2,
- int a3,
+ 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,
+ 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,
+ WINDOW *a1,
+ int a2,
int z)
{ return(*(int *)0); }
#undef mvwgetch
int mvwgetch(
- WINDOW *a1,
- int a2,
+ WINDOW *a1,
+ int a2,
int z)
{ return(*(int *)0); }
#undef mvwgetnstr
int mvwgetnstr(
- WINDOW *a1,
- int a2,
- int a3,
- char *a4,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ char *a4,
int z)
{ return(*(int *)0); }
#undef mvwgetstr
int mvwgetstr(
- WINDOW *a1,
- int a2,
- int a3,
+ WINDOW *a1,
+ int a2,
+ int a3,
char *z)
{ return(*(int *)0); }
#undef mvwhline
int mvwhline(
- WINDOW *a1,
- int a2,
- int a3,
- chtype a4,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ chtype a4,
int z)
{ return(*(int *)0); }
#undef mvwinch
chtype mvwinch(
- WINDOW *a1,
- int a2,
+ WINDOW *a1,
+ int a2,
int z)
{ return(*(chtype *)0); }
#undef mvwinchnstr
int mvwinchnstr(
- WINDOW *a1,
- int a2,
- int a3,
- chtype *a4,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ chtype *a4,
int z)
{ return(*(int *)0); }
#undef mvwinchstr
int mvwinchstr(
- WINDOW *a1,
- int a2,
- int a3,
+ WINDOW *a1,
+ int a2,
+ int a3,
chtype *z)
{ return(*(int *)0); }
#undef mvwinnstr
int mvwinnstr(
- WINDOW *a1,
- int a2,
- int a3,
- char *a4,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ char *a4,
int z)
{ return(*(int *)0); }
#undef mvwinsch
int mvwinsch(
- WINDOW *a1,
- int a2,
- int a3,
+ WINDOW *a1,
+ int a2,
+ int a3,
chtype z)
{ return(*(int *)0); }
#undef mvwinsnstr
int mvwinsnstr(
- WINDOW *a1,
- int a2,
- int a3,
- const char *a4,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ const char *a4,
int z)
{ return(*(int *)0); }
#undef mvwinsstr
int mvwinsstr(
- WINDOW *a1,
- int a2,
- int a3,
+ WINDOW *a1,
+ int a2,
+ int a3,
const char *z)
{ return(*(int *)0); }
#undef mvwinstr
int mvwinstr(
- WINDOW *a1,
- int a2,
- int a3,
+ WINDOW *a1,
+ int a2,
+ int a3,
char *z)
{ return(*(int *)0); }
#undef mvwvline
int mvwvline(
- WINDOW *a1,
- int a2,
- int a3,
- chtype a4,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ chtype a4,
int z)
{ return(*(int *)0); }
@@ -1134,19 +1134,19 @@ int scroll(
#undef setscrreg
int setscrreg(
- int a1,
+ int a1,
int z)
{ return(*(int *)0); }
#undef slk_attr_off
int slk_attr_off(
- const attr_t a1,
+ const attr_t a1,
void *z)
{ return(*(int *)0); }
#undef slk_attr_on
int slk_attr_on(
- attr_t a1,
+ attr_t a1,
void *z)
{ return(*(int *)0); }
@@ -1165,8 +1165,8 @@ void timeout(
#undef touchline
int touchline(
- WINDOW *a1,
- int a2,
+ WINDOW *a1,
+ int a2,
int z)
{ return(*(int *)0); }
@@ -1182,53 +1182,53 @@ int untouchwin(
#undef vline
int vline(
- chtype a1,
+ chtype a1,
int z)
{ return(*(int *)0); }
#undef waddchstr
int waddchstr(
- WINDOW *a1,
+ WINDOW *a1,
const chtype *z)
{ return(*(int *)0); }
#undef waddstr
int waddstr(
- WINDOW *a1,
+ WINDOW *a1,
const char *z)
{ return(*(int *)0); }
#undef wattron
int wattron(
- WINDOW *a1,
+ WINDOW *a1,
int z)
{ return(*(int *)0); }
#undef wattroff
int wattroff(
- WINDOW *a1,
+ WINDOW *a1,
int z)
{ return(*(int *)0); }
#undef wattrset
int wattrset(
- WINDOW *a1,
+ WINDOW *a1,
int z)
{ return(*(int *)0); }
#undef wattr_get
int wattr_get(
- WINDOW *a1,
- attr_t *a2,
- short *a3,
+ 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,
+ WINDOW *a1,
+ attr_t a2,
+ short a3,
void *z)
{ return(*(int *)0); }
@@ -1239,13 +1239,13 @@ int wdeleteln(
#undef wgetstr
int wgetstr(
- WINDOW *a1,
+ WINDOW *a1,
char *z)
{ return(*(int *)0); }
#undef winchstr
int winchstr(
- WINDOW *a1,
+ WINDOW *a1,
chtype *z)
{ return(*(int *)0); }
@@ -1256,13 +1256,13 @@ int winsertln(
#undef winsstr
int winsstr(
- WINDOW *a1,
+ WINDOW *a1,
const char *z)
{ return(*(int *)0); }
#undef winstr
int winstr(
- WINDOW *a1,
+ WINDOW *a1,
char *z)
{ return(*(int *)0); }
@@ -1393,8 +1393,8 @@ int wgetdelay(
#undef wgetscrreg
int wgetscrreg(
- const WINDOW *a1,
- int *a2,
+ const WINDOW *a1,
+ int *a2,
int *z)
{ return(*(int *)0); }
@@ -1405,7 +1405,7 @@ int add_wch(
#undef add_wchnstr
int add_wchnstr(
- const cchar_t *a1,
+ const cchar_t *a1,
int z)
{ return(*(int *)0); }
@@ -1416,7 +1416,7 @@ int add_wchstr(
#undef addnwstr
int addnwstr(
- const wchar_t *a1,
+ const wchar_t *a1,
int z)
{ return(*(int *)0); }
@@ -1437,20 +1437,20 @@ void bkgrndset(
#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 *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,
+ WINDOW *a1,
+ const cchar_t *a2,
const cchar_t *z)
{ return(*(int *)0); }
@@ -1476,13 +1476,13 @@ int getbkgrnd(
#undef getn_wstr
int getn_wstr(
- wint_t *a1,
+ wint_t *a1,
int z)
{ return(*(int *)0); }
#undef hline_set
int hline_set(
- const cchar_t *a1,
+ const cchar_t *a1,
int z)
{ return(*(int *)0); }
@@ -1493,7 +1493,7 @@ int in_wch(
#undef in_wchnstr
int in_wchnstr(
- cchar_t *a1,
+ cchar_t *a1,
int z)
{ return(*(int *)0); }
@@ -1504,13 +1504,13 @@ int in_wchstr(
#undef innwstr
int innwstr(
- wchar_t *a1,
+ wchar_t *a1,
int z)
{ return(*(int *)0); }
#undef ins_nwstr
int ins_nwstr(
- const wchar_t *a1,
+ const wchar_t *a1,
int z)
{ return(*(int *)0); }
@@ -1531,336 +1531,336 @@ int inwstr(
#undef mvadd_wch
int mvadd_wch(
- int a1,
- int a2,
+ 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 a1,
+ int a2,
+ const cchar_t *a3,
int z)
{ return(*(int *)0); }
#undef mvadd_wchstr
int mvadd_wchstr(
- int a1,
- int a2,
+ int a1,
+ int a2,
const cchar_t *z)
{ return(*(int *)0); }
#undef mvaddnwstr
int mvaddnwstr(
- int a1,
- int a2,
- const wchar_t *a3,
+ int a1,
+ int a2,
+ const wchar_t *a3,
int z)
{ return(*(int *)0); }
#undef mvaddwstr
int mvaddwstr(
- int a1,
- int a2,
+ int a1,
+ int a2,
const wchar_t *z)
{ return(*(int *)0); }
#undef mvget_wch
int mvget_wch(
- int a1,
- int a2,
+ int a1,
+ int a2,
wint_t *z)
{ return(*(int *)0); }
#undef mvget_wstr
int mvget_wstr(
- int a1,
- int a2,
+ int a1,
+ int a2,
wint_t *z)
{ return(*(int *)0); }
#undef mvgetn_wstr
int mvgetn_wstr(
- int a1,
- int a2,
- wint_t *a3,
+ 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 a1,
+ int a2,
+ const cchar_t *a3,
int z)
{ return(*(int *)0); }
#undef mvin_wch
int mvin_wch(
- int a1,
- int a2,
+ int a1,
+ int a2,
cchar_t *z)
{ return(*(int *)0); }
#undef mvin_wchnstr
int mvin_wchnstr(
- int a1,
- int a2,
- cchar_t *a3,
+ int a1,
+ int a2,
+ cchar_t *a3,
int z)
{ return(*(int *)0); }
#undef mvin_wchstr
int mvin_wchstr(
- int a1,
- int a2,
+ int a1,
+ int a2,
cchar_t *z)
{ return(*(int *)0); }
#undef mvinnwstr
int mvinnwstr(
- int a1,
- int a2,
- wchar_t *a3,
+ 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 a1,
+ int a2,
+ const wchar_t *a3,
int z)
{ return(*(int *)0); }
#undef mvins_wch
int mvins_wch(
- int a1,
- int a2,
+ int a1,
+ int a2,
const cchar_t *z)
{ return(*(int *)0); }
#undef mvins_wstr
int mvins_wstr(
- int a1,
- int a2,
+ int a1,
+ int a2,
const wchar_t *z)
{ return(*(int *)0); }
#undef mvinwstr
int mvinwstr(
- int a1,
- int a2,
+ 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 a1,
+ int a2,
+ const cchar_t *a3,
int z)
{ return(*(int *)0); }
#undef mvwadd_wch
int mvwadd_wch(
- WINDOW *a1,
- int a2,
- int a3,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ WINDOW *a1,
+ int a2,
+ int a3,
wint_t *z)
{ return(*(int *)0); }
#undef mvwget_wstr
int mvwget_wstr(
- WINDOW *a1,
- int a2,
- int a3,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ WINDOW *a1,
+ int a2,
+ int a3,
const wchar_t *z)
{ return(*(int *)0); }
#undef mvwinwstr
int mvwinwstr(
- WINDOW *a1,
- int a2,
- int a3,
+ 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,
+ 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,
+ const cchar_t *a1,
int z)
{ return(*(int *)0); }
#undef wadd_wchstr
int wadd_wchstr(
- WINDOW *a1,
+ WINDOW *a1,
const cchar_t *z)
{ return(*(int *)0); }
#undef waddwstr
int waddwstr(
- WINDOW *a1,
+ WINDOW *a1,
const wchar_t *z)
{ return(*(int *)0); }
#undef wget_wstr
int wget_wstr(
- WINDOW *a1,
+ WINDOW *a1,
wint_t *z)
{ return(*(int *)0); }
#undef wgetbkgrnd
int wgetbkgrnd(
- WINDOW *a1,
+ WINDOW *a1,
cchar_t *z)
{ return(*(int *)0); }
#undef win_wchstr
int win_wchstr(
- WINDOW *a1,
+ WINDOW *a1,
cchar_t *z)
{ return(*(int *)0); }
#undef wins_wstr
int wins_wstr(
- WINDOW *a1,
+ WINDOW *a1,
const wchar_t *z)
{ return(*(int *)0); }
#undef mouse_trafo
NCURSES_BOOL mouse_trafo(
- int *a1,
- int *a2,
+ int *a1,
+ int *a2,
NCURSES_BOOL z)
{ return(*(NCURSES_BOOL *)0); }
@@ -1877,7 +1877,7 @@ int *_nc_ptr_Escdelay(
#undef set_escdelay_sp
int set_escdelay_sp(
- SCREEN *sp,
+ SCREEN *sp,
int value)
{ return(*(int *)0); }
@@ -1897,8 +1897,8 @@ int get_escdelay(void)
#undef _nc_wgetch
int _nc_wgetch(
- WINDOW *win,
- int *result,
+ WINDOW *win,
+ int *result,
int use_meta)
{ return(*(int *)0); }
@@ -1911,8 +1911,8 @@ int wgetch(
#undef wgetnstr
int wgetnstr(
- WINDOW *win,
- char *str,
+ WINDOW *win,
+ char *str,
int maxlen)
{ return(*(int *)0); }
@@ -1920,8 +1920,8 @@ int wgetnstr(
#undef whline
int whline(
- WINDOW *win,
- chtype ch,
+ WINDOW *win,
+ chtype ch,
int n)
{ return(*(int *)0); }
@@ -1929,7 +1929,7 @@ int whline(
#undef immedok
void immedok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ /* void */ }
@@ -1937,8 +1937,8 @@ void immedok(
#undef winchnstr
int winchnstr(
- WINDOW *win,
- chtype *str,
+ WINDOW *win,
+ chtype *str,
int n)
{ return(*(int *)0); }
@@ -1952,14 +1952,14 @@ WINDOW *initscr(void)
#undef _nc_insert_ch
int _nc_insert_ch(
- SCREEN *sp,
- WINDOW *win,
+ SCREEN *sp,
+ WINDOW *win,
chtype ch)
{ return(*(int *)0); }
#undef winsch
int winsch(
- WINDOW *win,
+ WINDOW *win,
chtype c)
{ return(*(int *)0); }
@@ -1967,7 +1967,7 @@ int winsch(
#undef winsdelln
int winsdelln(
- WINDOW *win,
+ WINDOW *win,
int n)
{ return(*(int *)0); }
@@ -1975,8 +1975,8 @@ int winsdelln(
#undef winsnstr
int winsnstr(
- WINDOW *win,
- const char *s,
+ WINDOW *win,
+ const char *s,
int n)
{ return(*(int *)0); }
@@ -1984,8 +1984,8 @@ int winsnstr(
#undef winnstr
int winnstr(
- WINDOW *win,
- char *str,
+ WINDOW *win,
+ char *str,
int n)
{ return(*(int *)0); }
@@ -2004,7 +2004,7 @@ NCURSES_BOOL isendwin(void)
#undef leaveok
int leaveok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
@@ -2012,7 +2012,7 @@ int leaveok(
#undef getmouse_sp
int getmouse_sp(
- SCREEN *sp,
+ SCREEN *sp,
MEVENT *aevent)
{ return(*(int *)0); }
@@ -2023,7 +2023,7 @@ int getmouse(
#undef ungetmouse_sp
int ungetmouse_sp(
- SCREEN *sp,
+ SCREEN *sp,
MEVENT *aevent)
{ return(*(int *)0); }
@@ -2034,27 +2034,27 @@ int ungetmouse(
#undef mousemask_sp
mmask_t mousemask_sp(
- SCREEN *sp,
- mmask_t newmask,
+ SCREEN *sp,
+ mmask_t newmask,
mmask_t *oldmask)
{ return(*(mmask_t *)0); }
#undef mousemask
mmask_t mousemask(
- mmask_t newmask,
+ mmask_t newmask,
mmask_t *oldmask)
{ return(*(mmask_t *)0); }
#undef wenclose
NCURSES_BOOL wenclose(
- const WINDOW *win,
- int y,
+ const WINDOW *win,
+ int y,
int x)
{ return(*(NCURSES_BOOL *)0); }
#undef mouseinterval_sp
int mouseinterval_sp(
- SCREEN *sp,
+ SCREEN *sp,
int maxclick)
{ return(*(int *)0); }
@@ -2079,9 +2079,9 @@ NCURSES_BOOL has_mouse(void)
#undef wmouse_trafo
NCURSES_BOOL wmouse_trafo(
- const WINDOW *win,
- int *pY,
- int *pX,
+ const WINDOW *win,
+ int *pY,
+ int *pX,
NCURSES_BOOL to_screen)
{ return(*(NCURSES_BOOL *)0); }
@@ -2089,8 +2089,8 @@ NCURSES_BOOL wmouse_trafo(
#undef wmove
int wmove(
- WINDOW *win,
- int y,
+ WINDOW *win,
+ int y,
int x)
{ return(*(int *)0); }
@@ -2098,14 +2098,14 @@ int wmove(
#undef _nc_msec_cost_sp
int _nc_msec_cost_sp(
- SCREEN *sp,
- const char *const cap,
+ SCREEN *sp,
+ const char *const cap,
int affcnt)
{ return(*(int *)0); }
#undef _nc_msec_cost
int _nc_msec_cost(
- const char *const cap,
+ const char *const cap,
int affcnt)
{ return(*(int *)0); }
@@ -2138,35 +2138,35 @@ void _nc_mvcur_wrap(void)
#undef _nc_mvcur_sp
int _nc_mvcur_sp(
- SCREEN *sp,
- int yold,
- int xold,
- int ynew,
+ SCREEN *sp,
+ int yold,
+ int xold,
+ int ynew,
int xnew)
{ return(*(int *)0); }
#undef _nc_mvcur
int _nc_mvcur(
- int yold,
- int xold,
- int ynew,
+ int yold,
+ int xold,
+ int ynew,
int xnew)
{ return(*(int *)0); }
#undef mvcur_sp
int mvcur_sp(
- SCREEN *sp,
- int yold,
- int xold,
- int ynew,
+ SCREEN *sp,
+ int yold,
+ int xold,
+ int ynew,
int xnew)
{ return(*(int *)0); }
#undef mvcur
int mvcur(
- int yold,
- int xold,
- int ynew,
+ int yold,
+ int xold,
+ int ynew,
int xnew)
{ return(*(int *)0); }
@@ -2177,8 +2177,8 @@ int _nc_optimize_enable;
#undef mvwin
int mvwin(
- WINDOW *win,
- int by,
+ WINDOW *win,
+ int by,
int bx)
{ return(*(int *)0); }
@@ -2204,16 +2204,16 @@ void nofilter(void)
#undef newterm_sp
SCREEN *newterm_sp(
- SCREEN *sp,
- const char *name,
- FILE *ofp,
+ SCREEN *sp,
+ const char *name,
+ FILE *ofp,
FILE *ifp)
{ return(*(SCREEN **)0); }
#undef newterm
SCREEN *newterm(
- const char *name,
- FILE *ofp,
+ const char *name,
+ FILE *ofp,
FILE *ifp)
{ return(*(SCREEN **)0); }
@@ -2226,46 +2226,46 @@ int _nc_freewin(
#undef newwin_sp
WINDOW *newwin_sp(
- SCREEN *sp,
- int num_lines,
- int num_columns,
- int begy,
+ 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 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,
+ 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,
+ 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,
+ SCREEN *sp,
+ int num_lines,
+ int num_columns,
+ int begy,
+ int begx,
int flags)
{ return(*(WINDOW **)0); }
@@ -2308,26 +2308,26 @@ int nonl(void)
#undef overlay
int overlay(
- const WINDOW *win1,
+ const WINDOW *win1,
WINDOW *win2)
{ return(*(int *)0); }
#undef overwrite
int overwrite(
- const WINDOW *win1,
+ 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,
+ const WINDOW *src,
+ WINDOW *dst,
+ int sminrow,
+ int smincol,
+ int dminrow,
+ int dmincol,
+ int dmaxrow,
+ int dmaxcol,
int over)
{ return(*(int *)0); }
@@ -2335,51 +2335,51 @@ int copywin(
#undef newpad_sp
WINDOW *newpad_sp(
- SCREEN *sp,
- int l,
+ SCREEN *sp,
+ int l,
int c)
{ return(*(WINDOW **)0); }
#undef newpad
WINDOW *newpad(
- int l,
+ int l,
int c)
{ return(*(WINDOW **)0); }
#undef subpad
WINDOW *subpad(
- WINDOW *orig,
- int l,
- int c,
- int begy,
+ 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,
+ 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,
+ WINDOW *win,
+ int pminrow,
+ int pmincol,
+ int sminrow,
+ int smincol,
+ int smaxrow,
int smaxcol)
{ return(*(int *)0); }
#undef pechochar
int pechochar(
- WINDOW *pad,
+ WINDOW *pad,
const chtype ch)
{ return(*(int *)0); }
@@ -2387,45 +2387,45 @@ int pechochar(
#undef printw
int printw(
- const char *fmt,
+ const char *fmt,
...)
{ return(*(int *)0); }
#undef wprintw
int wprintw(
- WINDOW *win,
- const char *fmt,
+ WINDOW *win,
+ const char *fmt,
...)
{ return(*(int *)0); }
#undef mvprintw
int mvprintw(
- int y,
- int x,
- const char *fmt,
+ int y,
+ int x,
+ const char *fmt,
...)
{ return(*(int *)0); }
#undef mvwprintw
int mvwprintw(
- WINDOW *win,
- int y,
- int x,
- const char *fmt,
+ WINDOW *win,
+ int y,
+ int x,
+ const char *fmt,
...)
{ return(*(int *)0); }
#undef vwprintw
int vwprintw(
- WINDOW *win,
- const char *fmt,
+ WINDOW *win,
+ const char *fmt,
va_list argp)
{ return(*(int *)0); }
#undef vw_printw
int vw_printw(
- WINDOW *win,
- const char *fmt,
+ WINDOW *win,
+ const char *fmt,
va_list argp)
{ return(*(int *)0); }
@@ -2433,8 +2433,8 @@ int vw_printw(
#undef wredrawln
int wredrawln(
- WINDOW *win,
- int beg,
+ WINDOW *win,
+ int beg,
int num)
{ return(*(int *)0); }
@@ -2454,16 +2454,16 @@ int wnoutrefresh(
#undef restartterm_sp
int restartterm_sp(
- SCREEN *sp,
- const char *termp,
- int filenum,
+ SCREEN *sp,
+ const char *termp,
+ int filenum,
int *errret)
{ return(*(int *)0); }
#undef restartterm
int restartterm(
- const char *termp,
- int filenum,
+ const char *termp,
+ int filenum,
int *errret)
{ return(*(int *)0); }
@@ -2471,45 +2471,45 @@ int restartterm(
#undef vwscanw
int vwscanw(
- WINDOW *win,
- const char *fmt,
+ WINDOW *win,
+ const char *fmt,
va_list argp)
{ return(*(int *)0); }
#undef vw_scanw
int vw_scanw(
- WINDOW *win,
- const char *fmt,
+ WINDOW *win,
+ const char *fmt,
va_list argp)
{ return(*(int *)0); }
#undef scanw
int scanw(
- const char *fmt,
+ const char *fmt,
...)
{ return(*(int *)0); }
#undef wscanw
int wscanw(
- WINDOW *win,
- const char *fmt,
+ WINDOW *win,
+ const char *fmt,
...)
{ return(*(int *)0); }
#undef mvscanw
int mvscanw(
- int y,
- int x,
- const char *fmt,
+ int y,
+ int x,
+ const char *fmt,
...)
{ return(*(int *)0); }
#undef mvwscanw
int mvwscanw(
- WINDOW *win,
- int y,
- int x,
- const char *fmt,
+ WINDOW *win,
+ int y,
+ int x,
+ const char *fmt,
...)
{ return(*(int *)0); }
@@ -2517,7 +2517,7 @@ int mvwscanw(
#undef getwin_sp
WINDOW *getwin_sp(
- SCREEN *sp,
+ SCREEN *sp,
FILE *filep)
{ return(*(WINDOW **)0); }
@@ -2528,13 +2528,13 @@ WINDOW *getwin(
#undef putwin
int putwin(
- WINDOW *win,
+ WINDOW *win,
FILE *filep)
{ return(*(int *)0); }
#undef scr_restore_sp
int scr_restore_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *file)
{ return(*(int *)0); }
@@ -2550,7 +2550,7 @@ int scr_dump(
#undef scr_init_sp
int scr_init_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *file)
{ return(*(int *)0); }
@@ -2561,7 +2561,7 @@ int scr_init(
#undef scr_set_sp
int scr_set_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *file)
{ return(*(int *)0); }
@@ -2574,16 +2574,16 @@ int scr_set(
#undef _nc_scroll_window
void _nc_scroll_window(
- WINDOW *win,
- int const n,
- int const top,
- int const bottom,
+ WINDOW *win,
+ int const n,
+ int const top,
+ int const bottom,
cchar_t blank)
{ /* void */ }
#undef wscrl
int wscrl(
- WINDOW *win,
+ WINDOW *win,
int n)
{ return(*(int *)0); }
@@ -2591,7 +2591,7 @@ int wscrl(
#undef scrollok
int scrollok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
@@ -2599,8 +2599,8 @@ int scrollok(
#undef wsetscrreg
int wsetscrreg(
- WINDOW *win,
- int top,
+ WINDOW *win,
+ int top,
int bottom)
{ return(*(int *)0); }
@@ -2618,54 +2618,54 @@ void delscreen(
#undef _nc_setupscreen_sp
int _nc_setupscreen_sp(
- SCREEN **spp,
- int slines,
- int scolumns,
- FILE *output,
- int filtered,
+ SCREEN **spp,
+ int slines,
+ int scolumns,
+ FILE *output,
+ int filtered,
int slk_format)
{ return(*(int *)0); }
#undef _nc_setupscreen
int _nc_setupscreen(
- int slines,
- int scolumns,
- FILE *output,
- int filtered,
+ int slines,
+ int scolumns,
+ FILE *output,
+ int filtered,
int slk_format)
{ return(*(int *)0); }
#undef _nc_ripoffline_sp
int _nc_ripoffline_sp(
- SCREEN *sp,
- int line,
+ SCREEN *sp,
+ int line,
int (*init)(
- WINDOW *p1,
+ WINDOW *p1,
int p2))
{ return(*(int *)0); }
#undef _nc_ripoffline
int _nc_ripoffline(
- int line,
+ int line,
int (*init)(
- WINDOW *p1,
+ WINDOW *p1,
int p2))
{ return(*(int *)0); }
#undef ripoffline_sp
int ripoffline_sp(
- SCREEN *sp,
- int line,
+ SCREEN *sp,
+ int line,
int (*init)(
- WINDOW *p1,
+ WINDOW *p1,
int p2))
{ return(*(int *)0); }
#undef ripoffline
int ripoffline(
- int line,
+ int line,
int (*init)(
- WINDOW *p1,
+ WINDOW *p1,
int p2))
{ return(*(int *)0); }
@@ -2673,13 +2673,13 @@ int ripoffline(
#undef _nc_format_slks
int _nc_format_slks(
- SCREEN *sp,
+ SCREEN *sp,
int cols)
{ return(*(int *)0); }
#undef _nc_slk_initialize
int _nc_slk_initialize(
- WINDOW *stwin,
+ WINDOW *stwin,
int cols)
{ return(*(int *)0); }
@@ -2696,16 +2696,16 @@ int slk_restore(void)
#undef slk_attr_set_sp
int slk_attr_set_sp(
- SCREEN *sp,
- const attr_t attr,
- short pair_arg,
+ SCREEN *sp,
+ const attr_t attr,
+ short pair_arg,
void *opts)
{ return(*(int *)0); }
#undef slk_attr_set
int slk_attr_set(
- const attr_t attr,
- short pair_arg,
+ const attr_t attr,
+ short pair_arg,
void *opts)
{ return(*(int *)0); }
@@ -2713,7 +2713,7 @@ int slk_attr_set(
#undef slk_attroff_sp
int slk_attroff_sp(
- SCREEN *sp,
+ SCREEN *sp,
const chtype attr)
{ return(*(int *)0); }
@@ -2726,7 +2726,7 @@ int slk_attroff(
#undef slk_attron_sp
int slk_attron_sp(
- SCREEN *sp,
+ SCREEN *sp,
const chtype attr)
{ return(*(int *)0); }
@@ -2739,7 +2739,7 @@ int slk_attron(
#undef slk_attrset_sp
int slk_attrset_sp(
- SCREEN *sp,
+ SCREEN *sp,
const chtype attr)
{ return(*(int *)0); }
@@ -2774,7 +2774,7 @@ int slk_clear(void)
#undef slk_color_sp
int slk_color_sp(
- SCREEN *sp,
+ SCREEN *sp,
short pair_arg)
{ return(*(int *)0); }
@@ -2785,7 +2785,7 @@ int slk_color(
#undef extended_slk_color_sp
int extended_slk_color_sp(
- SCREEN *sp,
+ SCREEN *sp,
int pair_arg)
{ return(*(int *)0); }
@@ -2798,7 +2798,7 @@ int extended_slk_color(
#undef slk_init_sp
int slk_init_sp(
- SCREEN *sp,
+ SCREEN *sp,
int format)
{ return(*(int *)0); }
@@ -2811,7 +2811,7 @@ int slk_init(
#undef slk_label_sp
char *slk_label_sp(
- SCREEN *sp,
+ SCREEN *sp,
int n)
{ return(*(char **)0); }
@@ -2844,16 +2844,16 @@ int slk_refresh(void)
#undef slk_set_sp
int slk_set_sp(
- SCREEN *sp,
- int i,
- const char *astr,
+ SCREEN *sp,
+ int i,
+ const char *astr,
int format)
{ return(*(int *)0); }
#undef slk_set
int slk_set(
- int i,
- const char *astr,
+ int i,
+ const char *astr,
int format)
{ return(*(int *)0); }
@@ -2872,7 +2872,7 @@ int slk_touch(void)
#undef is_linetouched
NCURSES_BOOL is_linetouched(
- WINDOW *win,
+ WINDOW *win,
int line)
{ return(*(NCURSES_BOOL *)0); }
@@ -2883,9 +2883,9 @@ NCURSES_BOOL is_wintouched(
#undef wtouchln
int wtouchln(
- WINDOW *win,
- int y,
- int n,
+ WINDOW *win,
+ int y,
+ int n,
int changed)
{ return(*(int *)0); }
@@ -2893,7 +2893,7 @@ int wtouchln(
#undef _tracedump
void _tracedump(
- const char *name,
+ const char *name,
WINDOW *win)
{ /* void */ }
@@ -2901,19 +2901,19 @@ void _tracedump(
#undef _nc_trace_mmask_t
char *_nc_trace_mmask_t(
- SCREEN *sp,
+ SCREEN *sp,
mmask_t code)
{ return(*(char **)0); }
#undef _nc_tracemouse
char *_nc_tracemouse(
- SCREEN *sp,
+ SCREEN *sp,
MEVENT const *ep)
{ return(*(char **)0); }
#undef _nc_retrace_mmask_t
mmask_t _nc_retrace_mmask_t(
- SCREEN *sp,
+ SCREEN *sp,
mmask_t code)
{ return(*(mmask_t *)0); }
@@ -2938,7 +2938,7 @@ void _nc_fifo_dump(
#undef ungetch_sp
int ungetch_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ch)
{ return(*(int *)0); }
@@ -2951,20 +2951,20 @@ int ungetch(
#undef vidputs_sp
int vidputs_sp(
- SCREEN *sp,
- chtype newmode,
+ SCREEN *sp,
+ chtype newmode,
NCURSES_OUTC_sp outc)
{ return(*(int *)0); }
#undef vidputs
int vidputs(
- chtype newmode,
+ chtype newmode,
NCURSES_OUTC outc)
{ return(*(int *)0); }
#undef vidattr_sp
int vidattr_sp(
- SCREEN *sp,
+ SCREEN *sp,
chtype newmode)
{ return(*(int *)0); }
@@ -2986,8 +2986,8 @@ chtype termattrs(void)
#undef wvline
int wvline(
- WINDOW *win,
- chtype ch,
+ WINDOW *win,
+ chtype ch,
int n)
{ return(*(int *)0); }
@@ -2995,8 +2995,8 @@ int wvline(
#undef wattr_off
int wattr_off(
- WINDOW *win,
- attr_t at,
+ WINDOW *win,
+ attr_t at,
void *opts)
{ return(*(int *)0); }
@@ -3004,8 +3004,8 @@ int wattr_off(
#undef wattr_on
int wattr_on(
- WINDOW *win,
- attr_t at,
+ WINDOW *win,
+ attr_t at,
void *opts)
{ return(*(int *)0); }
@@ -3025,14 +3025,14 @@ void _nc_synchook(
#undef mvderwin
int mvderwin(
- WINDOW *win,
- int y,
+ WINDOW *win,
+ int y,
int x)
{ return(*(int *)0); }
#undef syncok
int syncok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL bf)
{ return(*(int *)0); }
@@ -3071,14 +3071,14 @@ struct panelhook *_nc_panelhook(void)
#undef _nc_printf_string_sp
char *_nc_printf_string_sp(
- SCREEN *sp,
- const char *fmt,
+ SCREEN *sp,
+ const char *fmt,
va_list ap)
{ return(*(char **)0); }
#undef _nc_printf_string
char *_nc_printf_string(
- const char *fmt,
+ const char *fmt,
va_list ap)
{ return(*(char **)0); }
@@ -3095,18 +3095,18 @@ int doupdate(void)
#undef _nc_scrolln_sp
int _nc_scrolln_sp(
- SCREEN *sp,
- int n,
- int top,
- int bot,
+ 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 n,
+ int top,
+ int bot,
int maxy)
{ return(*(int *)0); }
@@ -3139,7 +3139,7 @@ void _nc_screen_wrap(void)
#undef _nc_do_xmc_glitch_sp
void _nc_do_xmc_glitch_sp(
- SCREEN *sp,
+ SCREEN *sp,
attr_t previous)
{ /* void */ }
@@ -3152,7 +3152,7 @@ void _nc_do_xmc_glitch(
#undef _nc_varargs
char *_nc_varargs(
- const char *fmt,
+ const char *fmt,
va_list ap)
{ return(*(char **)0); }
@@ -3170,7 +3170,7 @@ void _nc_freeall(void)
#undef _nc_free_and_exit_sp
void _nc_free_and_exit_sp(
- SCREEN *sp,
+ SCREEN *sp,
int code)
{ /* void */ }
@@ -3205,13 +3205,13 @@ wint_t _nc_to_widechar(
#undef wadd_wch
int wadd_wch(
- WINDOW *win,
+ WINDOW *win,
const cchar_t *wch)
{ return(*(int *)0); }
#undef wecho_wchar
int wecho_wchar(
- WINDOW *win,
+ WINDOW *win,
const cchar_t *wch)
{ return(*(int *)0); }
@@ -3219,14 +3219,14 @@ int wecho_wchar(
#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,
+ 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); }
@@ -3234,29 +3234,41 @@ int wborder_set(
#undef setcchar
int setcchar(
- cchar_t *wcval,
- const wchar_t *wch,
- const attr_t attrs,
- short pair_arg,
+ cchar_t *wcval,
+ const wchar_t *wch,
+ const attr_t attrs,
+ short pair_arg,
const void *opts)
{ return(*(int *)0); }
#undef getcchar
int getcchar(
- const cchar_t *wcval,
- wchar_t *wch,
- attr_t *attrs,
- short *pair_arg,
+ const cchar_t *wcval,
+ wchar_t *wch,
+ attr_t *attrs,
+ short *pair_arg,
void *opts)
{ return(*(int *)0); }
/* ./widechar/lib_erasewchar.c */
+#undef erasewchar_sp
+int erasewchar_sp(
+ SCREEN *sp,
+ wchar_t *wch)
+ { return(*(int *)0); }
+
#undef erasewchar
int erasewchar(
wchar_t *wch)
{ return(*(int *)0); }
+#undef killwchar_sp
+int killwchar_sp(
+ SCREEN *sp,
+ wchar_t *wch)
+ { return(*(int *)0); }
+
#undef killwchar
int killwchar(
wchar_t *wch)
@@ -3266,7 +3278,7 @@ int killwchar(
#undef wget_wch
int wget_wch(
- WINDOW *win,
+ WINDOW *win,
wint_t *result)
{ return(*(int *)0); }
@@ -3274,8 +3286,8 @@ int wget_wch(
#undef wgetn_wstr
int wgetn_wstr(
- WINDOW *win,
- wint_t *str,
+ WINDOW *win,
+ wint_t *str,
int maxlen)
{ return(*(int *)0); }
@@ -3283,8 +3295,8 @@ int wgetn_wstr(
#undef whline_set
int whline_set(
- WINDOW *win,
- const cchar_t *ch,
+ WINDOW *win,
+ const cchar_t *ch,
int n)
{ return(*(int *)0); }
@@ -3292,7 +3304,7 @@ int whline_set(
#undef win_wch
int win_wch(
- WINDOW *win,
+ WINDOW *win,
cchar_t *wcval)
{ return(*(int *)0); }
@@ -3300,8 +3312,8 @@ int win_wch(
#undef win_wchnstr
int win_wchnstr(
- WINDOW *win,
- cchar_t *wchstr,
+ WINDOW *win,
+ cchar_t *wchstr,
int n)
{ return(*(int *)0); }
@@ -3309,20 +3321,20 @@ int win_wchnstr(
#undef _nc_insert_wch
int _nc_insert_wch(
- WINDOW *win,
+ WINDOW *win,
const cchar_t *wch)
{ return(*(int *)0); }
#undef wins_wch
int wins_wch(
- WINDOW *win,
+ WINDOW *win,
const cchar_t *wch)
{ return(*(int *)0); }
#undef wins_nwstr
int wins_nwstr(
- WINDOW *win,
- const wchar_t *wstr,
+ WINDOW *win,
+ const wchar_t *wstr,
int n)
{ return(*(int *)0); }
@@ -3330,14 +3342,14 @@ int wins_nwstr(
#undef winnwstr
int winnwstr(
- WINDOW *win,
- wchar_t *wstr,
+ WINDOW *win,
+ wchar_t *wstr,
int n)
{ return(*(int *)0); }
#undef winwstr
int winwstr(
- WINDOW *win,
+ WINDOW *win,
wchar_t *wstr)
{ return(*(int *)0); }
@@ -3352,7 +3364,7 @@ const char *key_name(
#undef pecho_wchar
int pecho_wchar(
- WINDOW *pad,
+ WINDOW *pad,
const cchar_t *wch)
{ return(*(int *)0); }
@@ -3360,8 +3372,8 @@ int pecho_wchar(
#undef slk_wset
int slk_wset(
- int i,
- const wchar_t *astr,
+ int i,
+ const wchar_t *astr,
int format)
{ return(*(int *)0); }
@@ -3369,14 +3381,14 @@ int slk_wset(
#undef _nc_wcrtomb
size_t _nc_wcrtomb(
- char *target,
- wchar_t source,
+ char *target,
+ wchar_t source,
mbstate_t *state)
{ return(*(size_t *)0); }
#undef unget_wch_sp
int unget_wch_sp(
- SCREEN *sp,
+ SCREEN *sp,
const wchar_t wch)
{ return(*(int *)0); }
@@ -3389,33 +3401,33 @@ int unget_wch(
#undef vid_puts_sp
int vid_puts_sp(
- SCREEN *sp,
- attr_t newmode,
- short pair_arg,
- void *opts,
+ SCREEN *sp,
+ attr_t newmode,
+ short pair_arg,
+ void *opts,
NCURSES_OUTC_sp outc)
{ return(*(int *)0); }
#undef vid_puts
int vid_puts(
- attr_t newmode,
- short pair_arg,
- void *opts,
+ attr_t newmode,
+ short pair_arg,
+ void *opts,
NCURSES_OUTC outc)
{ return(*(int *)0); }
#undef vid_attr_sp
int vid_attr_sp(
- SCREEN *sp,
- attr_t newmode,
- short pair_arg,
+ SCREEN *sp,
+ attr_t newmode,
+ short pair_arg,
void *opts)
{ return(*(int *)0); }
#undef vid_attr
int vid_attr(
- attr_t newmode,
- short pair_arg,
+ attr_t newmode,
+ short pair_arg,
void *opts)
{ return(*(int *)0); }
@@ -3432,8 +3444,8 @@ attr_t term_attrs(void)
#undef wvline_set
int wvline_set(
- WINDOW *win,
- const cchar_t *ch,
+ WINDOW *win,
+ const cchar_t *ch,
int n)
{ return(*(int *)0); }
@@ -3450,7 +3462,7 @@ void _nc_init_wacs(void)
#undef wunctrl_sp
wchar_t *wunctrl_sp(
- SCREEN *sp,
+ SCREEN *sp,
cchar_t *wc)
{ return(*(wchar_t **)0); }
@@ -3463,31 +3475,31 @@ wchar_t *wunctrl(
#undef _nc_toggle_attr_on
void _nc_toggle_attr_on(
- attr_t *S,
+ attr_t *S,
attr_t at)
{ /* void */ }
#undef _nc_toggle_attr_off
void _nc_toggle_attr_off(
- attr_t *S,
+ attr_t *S,
attr_t at)
{ /* void */ }
#undef _nc_DelCharCost_sp
int _nc_DelCharCost_sp(
- SCREEN *sp,
+ SCREEN *sp,
int count)
{ return(*(int *)0); }
#undef _nc_InsCharCost_sp
int _nc_InsCharCost_sp(
- SCREEN *sp,
+ SCREEN *sp,
int count)
{ return(*(int *)0); }
#undef _nc_UpdateAttrs_sp
void _nc_UpdateAttrs_sp(
- SCREEN *sp,
+ SCREEN *sp,
const cchar_t *c)
{ /* void */ }
@@ -3510,7 +3522,7 @@ void _nc_UpdateAttrs(
#undef use_legacy_coding_sp
int use_legacy_coding_sp(
- SCREEN *sp,
+ SCREEN *sp,
int level)
{ return(*(int *)0); }
@@ -3532,14 +3544,14 @@ int use_default_colors(void)
#undef assume_default_colors_sp
int assume_default_colors_sp(
- SCREEN *sp,
- int fg,
+ SCREEN *sp,
+ int fg,
int bg)
{ return(*(int *)0); }
#undef assume_default_colors
int assume_default_colors(
- int fg,
+ int fg,
int bg)
{ return(*(int *)0); }
@@ -3547,14 +3559,14 @@ int assume_default_colors(
#undef mcprint_sp
int mcprint_sp(
- SCREEN *sp,
- char *data,
+ SCREEN *sp,
+ char *data,
int len)
{ return(*(int *)0); }
#undef mcprint
int mcprint(
- char *data,
+ char *data,
int len)
{ return(*(int *)0); }
@@ -3567,55 +3579,55 @@ void _nc_free_ordered_pairs(
#undef _nc_reset_color_pair
void _nc_reset_color_pair(
- SCREEN *sp,
- int pair,
+ SCREEN *sp,
+ int pair,
colorpair_t *next)
{ /* void */ }
#undef _nc_set_color_pair
void _nc_set_color_pair(
- SCREEN *sp,
- int pair,
+ SCREEN *sp,
+ int pair,
int mode)
{ /* void */ }
#undef _nc_copy_pairs
void _nc_copy_pairs(
- SCREEN *sp,
- colorpair_t *target,
- colorpair_t *source,
+ SCREEN *sp,
+ colorpair_t *target,
+ colorpair_t *source,
int length)
{ /* void */ }
#undef alloc_pair_sp
int alloc_pair_sp(
- SCREEN *sp,
- int fg,
+ SCREEN *sp,
+ int fg,
int bg)
{ return(*(int *)0); }
#undef find_pair_sp
int find_pair_sp(
- SCREEN *sp,
- int fg,
+ SCREEN *sp,
+ int fg,
int bg)
{ return(*(int *)0); }
#undef free_pair_sp
int free_pair_sp(
- SCREEN *sp,
+ SCREEN *sp,
int pair)
{ return(*(int *)0); }
#undef alloc_pair
int alloc_pair(
- int f,
+ int f,
int b)
{ return(*(int *)0); }
#undef find_pair
int find_pair(
- int f,
+ int f,
int b)
{ return(*(int *)0); }
@@ -3628,40 +3640,40 @@ int free_pair(
#undef is_term_resized_sp
NCURSES_BOOL is_term_resized_sp(
- SCREEN *sp,
- int ToLines,
+ SCREEN *sp,
+ int ToLines,
int ToCols)
{ return(*(NCURSES_BOOL *)0); }
#undef is_term_resized
NCURSES_BOOL is_term_resized(
- int ToLines,
+ int ToLines,
int ToCols)
{ return(*(NCURSES_BOOL *)0); }
#undef resize_term_sp
int resize_term_sp(
- SCREEN *sp,
- int ToLines,
+ SCREEN *sp,
+ int ToLines,
int ToCols)
{ return(*(int *)0); }
#undef resize_term
int resize_term(
- int ToLines,
+ int ToLines,
int ToCols)
{ return(*(int *)0); }
#undef resizeterm_sp
int resizeterm_sp(
- SCREEN *sp,
- int ToLines,
+ SCREEN *sp,
+ int ToLines,
int ToCols)
{ return(*(int *)0); }
#undef resizeterm
int resizeterm(
- int ToLines,
+ int ToLines,
int ToCols)
{ return(*(int *)0); }
@@ -3676,8 +3688,8 @@ void _nc_trace_xnames(
#undef use_screen
int use_screen(
- SCREEN *screen,
- NCURSES_SCREEN_CB func,
+ SCREEN *screen,
+ NCURSES_SCREEN_CB func,
void *data)
{ return(*(int *)0); }
@@ -3685,8 +3697,8 @@ int use_screen(
#undef use_window
int use_window(
- WINDOW *win,
- NCURSES_WINDOW_CB func,
+ WINDOW *win,
+ NCURSES_WINDOW_CB func,
void *data)
{ return(*(int *)0); }
@@ -3694,8 +3706,8 @@ int use_window(
#undef wresize
int wresize(
- WINDOW *win,
- int ToLines,
+ WINDOW *win,
+ int ToLines,
int ToCols)
{ return(*(int *)0); }
@@ -3723,7 +3735,7 @@ char *_nc_basename(
#undef _nc_access
int _nc_access(
- const char *path,
+ const char *path,
int mode)
{ return(*(int *)0); }
@@ -3741,12 +3753,25 @@ NCURSES_BOOL _nc_is_file_path(
int _nc_env_access(void)
{ return(*(int *)0); }
+#undef _nc_safe_fopen
+FILE *_nc_safe_fopen(
+ const char *path,
+ const char *mode)
+ { return(*(FILE **)0); }
+
+#undef _nc_safe_open3
+int _nc_safe_open3(
+ const char *path,
+ int flags,
+ mode_t mode)
+ { return(*(int *)0); }
+
/* ./tinfo/add_tries.c */
#undef _nc_add_to_try
int _nc_add_to_try(
- TRIES **tree,
- const char *str,
+ TRIES **tree,
+ const char *str,
unsigned code)
{ return(*(int *)0); }
@@ -3754,25 +3779,25 @@ int _nc_add_to_try(
#undef _nc_align_termtype
void _nc_align_termtype(
- TERMTYPE2 *to,
+ TERMTYPE2 *to,
TERMTYPE2 *from)
{ /* void */ }
#undef _nc_copy_termtype
void _nc_copy_termtype(
- TERMTYPE *dst,
+ TERMTYPE *dst,
const TERMTYPE *src)
{ /* void */ }
#undef _nc_copy_termtype2
void _nc_copy_termtype2(
- TERMTYPE2 *dst,
+ TERMTYPE2 *dst,
const TERMTYPE2 *src)
{ /* void */ }
#undef _nc_export_termtype2
void _nc_export_termtype2(
- TERMTYPE *dst,
+ TERMTYPE *dst,
const TERMTYPE2 *src)
{ /* void */ }
@@ -3842,19 +3867,19 @@ void _nc_get_type(
#undef _nc_warning
void _nc_warning(
- const char *const fmt,
+ const char *const fmt,
...)
{ /* void */ }
#undef _nc_err_abort
void _nc_err_abort(
- const char *const fmt,
+ const char *const fmt,
...)
{ /* void */ }
#undef _nc_syserr_abort
void _nc_syserr_abort(
- const char *const fmt,
+ const char *const fmt,
...)
{ /* void */ }
@@ -3862,14 +3887,14 @@ void _nc_syserr_abort(
#undef _nc_find_entry
struct name_table_entry const *_nc_find_entry(
- const char *string,
+ 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,
+ const char *string,
+ int type,
NCURSES_BOOL termcap)
{ return(*(struct name_table_entry const **)0); }
@@ -3906,13 +3931,13 @@ void _nc_last_db(void)
#undef _nc_next_db
const char *_nc_next_db(
- DBDIRS *state,
+ DBDIRS *state,
int *offset)
{ return(*(const char **)0); }
#undef _nc_first_db
void _nc_first_db(
- DBDIRS *state,
+ DBDIRS *state,
int *offset)
{ /* void */ }
@@ -3920,7 +3945,7 @@ void _nc_first_db(
#undef _nc_doalloc
void *_nc_doalloc(
- void *oldp,
+ void *oldp,
size_t amount)
{ return(*(void **)0); }
@@ -3933,7 +3958,7 @@ ENTRY *_nc_tail;
#undef _nc_free_entry
void _nc_free_entry(
- ENTRY *headp,
+ ENTRY *headp,
TERMTYPE2 *tterm)
{ /* void */ }
@@ -3970,6 +3995,11 @@ void _nc_free_termtype(
TERMTYPE *ptr)
{ /* void */ }
+#undef _nc_free_termtype1
+void _nc_free_termtype1(
+ TERMTYPE *ptr)
+ { /* void */ }
+
#undef _nc_free_termtype2
void _nc_free_termtype2(
TERMTYPE2 *ptr)
@@ -3992,7 +4022,7 @@ int _nc_getenv_num(
#undef _nc_setenv_num
void _nc_setenv_num(
- const char *name,
+ const char *name,
int value)
{ /* void */ }
@@ -4027,8 +4057,8 @@ void _nc_init_acs(void)
/* ./tinfo/lib_baudrate.c */
struct speed {
- int given_speed;
- int actual_speed;
+ int given_speed;
+ int actual_speed;
};
#undef _nc_baudrate
@@ -4067,7 +4097,7 @@ TERMINAL *_nc_cur_term(void)
#undef set_curterm_sp
TERMINAL *set_curterm_sp(
- SCREEN *sp,
+ SCREEN *sp,
TERMINAL *termp)
{ return(*(TERMINAL **)0); }
@@ -4078,7 +4108,7 @@ TERMINAL *set_curterm(
#undef del_curterm_sp
int del_curterm_sp(
- SCREEN *sp,
+ SCREEN *sp,
TERMINAL *termp)
{ return(*(int *)0); }
@@ -4194,7 +4224,7 @@ struct kn { short offset; int code; };
#undef keyname_sp
const char *keyname_sp(
- SCREEN *sp,
+ SCREEN *sp,
int c)
{ return(*(const char **)0); }
@@ -4218,7 +4248,7 @@ char *longname(void)
#undef napms_sp
int napms_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ms)
{ return(*(int *)0); }
@@ -4231,19 +4261,19 @@ int napms(
#undef idlok
int idlok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef idcok
void idcok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ /* void */ }
#undef halfdelay_sp
int halfdelay_sp(
- SCREEN *sp,
+ SCREEN *sp,
int t)
{ return(*(int *)0); }
@@ -4254,37 +4284,37 @@ int halfdelay(
#undef nodelay
int nodelay(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef notimeout
int notimeout(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL f)
{ return(*(int *)0); }
#undef wtimeout
void wtimeout(
- WINDOW *win,
+ WINDOW *win,
int delay)
{ /* void */ }
#undef keypad
int keypad(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef meta
int meta(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef curs_set_sp
int curs_set_sp(
- SCREEN *sp,
+ SCREEN *sp,
int vis)
{ return(*(int *)0); }
@@ -4295,7 +4325,7 @@ int curs_set(
#undef typeahead_sp
int typeahead_sp(
- SCREEN *sp,
+ SCREEN *sp,
int fd)
{ return(*(int *)0); }
@@ -4306,7 +4336,7 @@ int typeahead(
#undef has_key_sp
int has_key_sp(
- SCREEN *sp,
+ SCREEN *sp,
int keycode)
{ return(*(int *)0); }
@@ -4317,14 +4347,14 @@ int has_key(
#undef _nc_putp_flush_sp
int _nc_putp_flush_sp(
- SCREEN *sp,
- const char *name,
+ SCREEN *sp,
+ const char *name,
const char *value)
{ return(*(int *)0); }
#undef _nc_keypad
int _nc_keypad(
- SCREEN *sp,
+ SCREEN *sp,
int flag)
{ return(*(int *)0); }
@@ -4386,17 +4416,53 @@ void noqiflush(void)
#undef intrflush_sp
int intrflush_sp(
- SCREEN *sp,
- WINDOW *win,
+ SCREEN *sp,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef intrflush
int intrflush(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
+#undef is_nl_sp
+int is_nl_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_raw_sp
+int is_raw_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_cbreak_sp
+int is_cbreak_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_echo_sp
+int is_echo_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_nl
+int is_nl(void)
+ { return(*(int *)0); }
+
+#undef is_raw
+int is_raw(void)
+ { return(*(int *)0); }
+
+#undef is_cbreak
+int is_cbreak(void)
+ { return(*(int *)0); }
+
+#undef is_echo
+int is_echo(void)
+ { return(*(int *)0); }
+
/* ./tinfo/lib_setup.c */
#undef _nc_ttytype
@@ -4432,7 +4498,7 @@ int _nc_TABSIZE(void)
#undef set_tabsize_sp
int set_tabsize_sp(
- SCREEN *sp,
+ SCREEN *sp,
int value)
{ return(*(int *)0); }
@@ -4448,13 +4514,13 @@ int _nc_handle_sigwinch(
#undef use_env_sp
void use_env_sp(
- SCREEN *sp,
+ SCREEN *sp,
NCURSES_BOOL f)
{ /* void */ }
#undef use_tioctl_sp
void use_tioctl_sp(
- SCREEN *sp,
+ SCREEN *sp,
NCURSES_BOOL f)
{ /* void */ }
@@ -4470,8 +4536,8 @@ void use_tioctl(
#undef _nc_get_screensize
void _nc_get_screensize(
- SCREEN *sp,
- int *linep,
+ SCREEN *sp,
+ int *linep,
int *colp)
{ /* void */ }
@@ -4482,13 +4548,13 @@ void _nc_update_screensize(
#undef _nc_setup_tinfo
int _nc_setup_tinfo(
- const char *const tn,
+ const char *const tn,
TERMTYPE2 *const tp)
{ return(*(int *)0); }
#undef _nc_tinfo_cmdch
void _nc_tinfo_cmdch(
- TERMINAL *termp,
+ TERMINAL *termp,
int proto)
{ /* void */ }
@@ -4507,9 +4573,9 @@ int _nc_locale_breaks_acs(
#undef _nc_setupterm
int _nc_setupterm(
- const char *tname,
- int Filedes,
- int *errret,
+ const char *tname,
+ int Filedes,
+ int *errret,
int reuse)
{ return(*(int *)0); }
@@ -4527,8 +4593,8 @@ SCREEN *new_prescr(void)
#undef setupterm
int setupterm(
- const char *tname,
- int Filedes,
+ const char *tname,
+ int Filedes,
int *errret)
{ return(*(int *)0); }
@@ -4541,20 +4607,20 @@ char *BC;
#undef tgetent_sp
int tgetent_sp(
- SCREEN *sp,
- char *bufp,
+ SCREEN *sp,
+ char *bufp,
const char *name)
{ return(*(int *)0); }
#undef tgetent
int tgetent(
- char *bufp,
+ char *bufp,
const char *name)
{ return(*(int *)0); }
#undef tgetflag_sp
int tgetflag_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *id)
{ return(*(int *)0); }
@@ -4565,7 +4631,7 @@ int tgetflag(
#undef tgetnum_sp
int tgetnum_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *id)
{ return(*(int *)0); }
@@ -4576,14 +4642,14 @@ int tgetnum(
#undef tgetstr_sp
char *tgetstr_sp(
- SCREEN *sp,
- const char *id,
+ SCREEN *sp,
+ const char *id,
char **area)
{ return(*(char **)0); }
#undef tgetstr
char *tgetstr(
- const char *id,
+ const char *id,
char **area)
{ return(*(char **)0); }
@@ -4602,8 +4668,8 @@ char *termname(void)
#undef tgoto
char *tgoto(
- const char *string,
- int x,
+ const char *string,
+ int x,
int y)
{ return(*(char **)0); }
@@ -4611,7 +4677,7 @@ char *tgoto(
#undef tigetflag_sp
int tigetflag_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(int *)0); }
@@ -4622,7 +4688,7 @@ int tigetflag(
#undef tigetnum_sp
int tigetnum_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(int *)0); }
@@ -4633,7 +4699,7 @@ int tigetnum(
#undef tigetstr_sp
char *tigetstr_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(char **)0); }
@@ -4647,32 +4713,58 @@ char *tigetstr(
#undef _nc_tparm_err
int _nc_tparm_err;
+#undef _nc_free_tparm
+void _nc_free_tparm(
+ TERMINAL *termp)
+ { /* void */ }
+
#undef _nc_tparm_analyze
int _nc_tparm_analyze(
- const char *string,
- char *p_is_s[9],
+ TERMINAL *term,
+ const char *string,
+ char **p_is_s,
int *_nc_popcount)
{ return(*(int *)0); }
#undef tparm
char *tparm(
- const char *string,
+ const char *string,
...)
{ return(*(char **)0); }
#undef tiparm
char *tiparm(
- const char *string,
+ const char *string,
+ ...)
+ { return(*(char **)0); }
+
+#undef tiparm_s
+char *tiparm_s(
+ int num_expected,
+ int tparm_type,
+ const char *string,
...)
{ return(*(char **)0); }
+#undef tiscan_s
+int tiscan_s(
+ int *num_expected,
+ int *tparm_type,
+ const char *string)
+ { return(*(int *)0); }
+
#undef _nc_tiparm
char *_nc_tiparm(
- int expected,
- const char *string,
+ int expected,
+ const char *string,
...)
{ return(*(char **)0); }
+#undef _nc_reset_tparm
+void _nc_reset_tparm(
+ TERMINAL *term)
+ { /* void */ }
+
/* ./tinfo/lib_tputs.c */
#undef PC
@@ -4689,7 +4781,7 @@ void _nc_set_no_padding(
#undef delay_output_sp
int delay_output_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ms)
{ return(*(int *)0); }
@@ -4709,7 +4801,7 @@ void _nc_flush(void)
#undef _nc_outch_sp
int _nc_outch_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ch)
{ return(*(int *)0); }
@@ -4720,7 +4812,7 @@ int _nc_outch(
#undef _nc_putchar_sp
int _nc_putchar_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ch)
{ return(*(int *)0); }
@@ -4731,7 +4823,7 @@ int _nc_putchar(
#undef putp_sp
int putp_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *string)
{ return(*(int *)0); }
@@ -4742,35 +4834,35 @@ int putp(
#undef _nc_putp_sp
int _nc_putp_sp(
- SCREEN *sp,
- const char *name,
+ SCREEN *sp,
+ const char *name,
const char *string)
{ return(*(int *)0); }
#undef _nc_putp
int _nc_putp(
- const char *name,
+ const char *name,
const char *string)
{ return(*(int *)0); }
#undef tputs_sp
int tputs_sp(
- SCREEN *sp,
- const char *string,
- int affcnt,
+ SCREEN *sp,
+ const char *string,
+ int affcnt,
NCURSES_OUTC_sp outc)
{ return(*(int *)0); }
#undef _nc_outc_wrapper
int _nc_outc_wrapper(
- SCREEN *sp,
+ SCREEN *sp,
int c)
{ return(*(int *)0); }
#undef tputs
int tputs(
- const char *string,
- int affcnt,
+ const char *string,
+ int affcnt,
int (*outc)(
int p1))
{ return(*(int *)0); }
@@ -4810,7 +4902,7 @@ void trace(
#undef _tracef
void _tracef(
- const char *fmt,
+ const char *fmt,
...)
{ /* void */ }
@@ -4866,8 +4958,8 @@ WINDOW *_nc_retrace_win(
#undef _nc_fmt_funcptr
char *_nc_fmt_funcptr(
- char *target,
- const char *source,
+ char *target,
+ const char *source,
size_t size)
{ return(*(char **)0); }
@@ -4878,7 +4970,7 @@ int _nc_use_tracef(
#undef _nc_locked_tracef
void _nc_locked_tracef(
- const char *fmt,
+ const char *fmt,
...)
{ /* void */ }
@@ -4886,7 +4978,7 @@ void _nc_locked_tracef(
#undef _traceattr2
char *_traceattr2(
- int bufnum,
+ int bufnum,
chtype newmode)
{ return(*(char **)0); }
@@ -4907,13 +4999,13 @@ attr_t _nc_retrace_attr_t(
#undef _nc_altcharset_name
const char *_nc_altcharset_name(
- attr_t attr,
+ attr_t attr,
chtype ch)
{ return(*(const char **)0); }
#undef _tracechtype2
char *_tracechtype2(
- int bufnum,
+ int bufnum,
chtype ch)
{ return(*(char **)0); }
@@ -4929,7 +5021,7 @@ chtype _nc_retrace_chtype(
#undef _tracecchar_t2
char *_tracecchar_t2(
- int bufnum,
+ int bufnum,
const cchar_t *ch)
{ return(*(char **)0); }
@@ -4942,7 +5034,7 @@ char *_tracecchar_t(
#undef _nc_trace_ttymode
char *_nc_trace_ttymode(
- struct termios *tty)
+ const struct termios *tty)
{ return(*(char **)0); }
#undef _nc_tracebits
@@ -4953,7 +5045,7 @@ char *_nc_tracebits(void)
#undef _nc_tracechar
char *_nc_tracechar(
- SCREEN *sp,
+ SCREEN *sp,
int ch)
{ return(*(char **)0); }
@@ -4966,7 +5058,7 @@ char *_tracechar(
#undef _nc_get_tty_mode_sp
int _nc_get_tty_mode_sp(
- SCREEN *sp,
+ SCREEN *sp,
struct termios *buf)
{ return(*(int *)0); }
@@ -4977,7 +5069,7 @@ int _nc_get_tty_mode(
#undef _nc_set_tty_mode_sp
int _nc_set_tty_mode_sp(
- SCREEN *sp,
+ SCREEN *sp,
struct termios *buf)
{ return(*(int *)0); }
@@ -5044,9 +5136,9 @@ int resetty(void)
#undef _nc_timed_wait
int _nc_timed_wait(
- SCREEN *sp,
- int mode,
- int milliseconds,
+ SCREEN *sp,
+ int mode,
+ int milliseconds,
int *timeleft)
{ return(*(int *)0); }
@@ -5059,8 +5151,8 @@ char *_nc_first_name(
#undef _nc_name_match
int _nc_name_match(
- const char *const namelst,
- const char *const name,
+ const char *const namelst,
+ const char *const name,
const char *const delim)
{ return(*(int *)0); }
@@ -5094,14 +5186,14 @@ const char *const *_nc_strfnames(void)
#undef _nc_set_buffer_sp
void _nc_set_buffer_sp(
- SCREEN *sp,
- FILE *ofp,
+ SCREEN *sp,
+ FILE *ofp,
int buffered)
{ /* void */ }
#undef _nc_set_buffer
void _nc_set_buffer(
- FILE *ofp,
+ FILE *ofp,
int buffered)
{ /* void */ }
@@ -5114,28 +5206,28 @@ void _nc_init_termtype(
#undef _nc_read_termtype
int _nc_read_termtype(
- TERMTYPE2 *ptr,
- char *buffer,
+ TERMTYPE2 *ptr,
+ char *buffer,
int limit)
{ return(*(int *)0); }
#undef _nc_read_file_entry
int _nc_read_file_entry(
- const char *const filename,
+ const char *const filename,
TERMTYPE2 *ptr)
{ return(*(int *)0); }
#undef _nc_read_entry2
int _nc_read_entry2(
- const char *const name,
- char *const filename,
+ const char *const name,
+ char *const filename,
TERMTYPE2 *const tp)
{ return(*(int *)0); }
#undef _nc_read_entry
int _nc_read_entry(
- const char *const name,
- char *const filename,
+ const char *const name,
+ char *const filename,
TERMTYPE *const tp)
{ return(*(int *)0); }
@@ -5143,7 +5235,7 @@ int _nc_read_entry(
#undef _nc_read_termcap_entry
int _nc_read_termcap_entry(
- const char *const tn,
+ const char *const tn,
TERMTYPE2 *const tp)
{ return(*(int *)0); }
@@ -5151,32 +5243,32 @@ int _nc_read_termcap_entry(
#undef _nc_str_init
string_desc *_nc_str_init(
- string_desc *dst,
- char *src,
+ string_desc *dst,
+ char *src,
size_t len)
{ return(*(string_desc **)0); }
#undef _nc_str_null
string_desc *_nc_str_null(
- string_desc *dst,
+ string_desc *dst,
size_t len)
{ return(*(string_desc **)0); }
#undef _nc_str_copy
string_desc *_nc_str_copy(
- string_desc *dst,
- string_desc *src)
+ string_desc *dst,
+ const string_desc *const src)
{ return(*(string_desc **)0); }
#undef _nc_safe_strcat
NCURSES_BOOL _nc_safe_strcat(
- string_desc *dst,
+ string_desc *dst,
const char *src)
{ return(*(NCURSES_BOOL *)0); }
#undef _nc_safe_strcpy
NCURSES_BOOL _nc_safe_strcpy(
- string_desc *dst,
+ string_desc *dst,
const char *src)
{ return(*(NCURSES_BOOL *)0); }
@@ -5184,13 +5276,13 @@ NCURSES_BOOL _nc_safe_strcpy(
#undef _nc_trace_buf
char *_nc_trace_buf(
- int bufnum,
+ int bufnum,
size_t want)
{ return(*(char **)0); }
#undef _nc_trace_bufcat
char *_nc_trace_bufcat(
- int bufnum,
+ int bufnum,
const char *value)
{ return(*(char **)0); }
@@ -5205,21 +5297,21 @@ void _nc_trace_tries(
#undef _nc_expand_try
char *_nc_expand_try(
- TRIES *tree,
- unsigned code,
- int *count,
+ TRIES *tree,
+ unsigned code,
+ int *count,
size_t len)
{ return(*(char **)0); }
#undef _nc_remove_key
int _nc_remove_key(
- TRIES **tree,
+ TRIES **tree,
unsigned code)
{ return(*(int *)0); }
#undef _nc_remove_string
int _nc_remove_string(
- TRIES **tree,
+ TRIES **tree,
const char *string)
{ return(*(int *)0); }
@@ -5234,7 +5326,7 @@ char *_nc_trim_sgr0(
#undef unctrl_sp
const char *unctrl_sp(
- SCREEN *sp,
+ SCREEN *sp,
chtype ch)
{ return(*(const char **)0); }
@@ -5247,7 +5339,7 @@ const char *unctrl(
#undef _nc_visbuf2
const char *_nc_visbuf2(
- int bufnum,
+ int bufnum,
const char *buf)
{ return(*(const char **)0); }
@@ -5258,13 +5350,13 @@ const char *_nc_visbuf(
#undef _nc_visbufn
const char *_nc_visbufn(
- const char *buf,
+ const char *buf,
int len)
{ return(*(const char **)0); }
#undef _nc_viswbuf2
const char *_nc_viswbuf2(
- int bufnum,
+ int bufnum,
const wchar_t *buf)
{ return(*(const char **)0); }
@@ -5275,7 +5367,7 @@ const char *_nc_viswbuf(
#undef _nc_viswbufn
const char *_nc_viswbufn(
- const wchar_t *buf,
+ const wchar_t *buf,
int len)
{ return(*(const char **)0); }
@@ -5286,14 +5378,14 @@ const char *_nc_viswibuf(
#undef _nc_viscbuf2
const char *_nc_viscbuf2(
- int bufnum,
- const cchar_t *buf,
+ int bufnum,
+ const cchar_t *buf,
int len)
{ return(*(const char **)0); }
#undef _nc_viscbuf
const char *_nc_viscbuf(
- const cchar_t *buf,
+ const cchar_t *buf,
int len)
{ return(*(const char **)0); }
@@ -5311,18 +5403,18 @@ ENTRY *_nc_copy_entry(
#undef _nc_save_str
char *_nc_save_str(
- const char *const string)
+ const char *string)
{ return(*(char **)0); }
#undef _nc_wrap_entry
void _nc_wrap_entry(
- ENTRY *const ep,
+ ENTRY *const ep,
NCURSES_BOOL copy_strings)
{ /* void */ }
#undef _nc_merge_entry
void _nc_merge_entry(
- ENTRY *const target,
+ ENTRY *const target,
ENTRY *const source)
{ /* void */ }
@@ -5330,15 +5422,15 @@ void _nc_merge_entry(
#undef _nc_captoinfo
char *_nc_captoinfo(
- const char *cap,
- const char *s,
+ const char *cap,
+ const char *s,
int const parameterized)
{ return(*(char **)0); }
#undef _nc_infotocap
char *_nc_infotocap(
- const char *cap,
- const char *str,
+ const char *cap,
+ const char *str,
int const parameterized)
{ return(*(char **)0); }
@@ -5346,8 +5438,8 @@ char *_nc_infotocap(
#undef _nc_tic_expand
char *_nc_tic_expand(
- const char *srcp,
- NCURSES_BOOL tic_format,
+ const char *srcp,
+ NCURSES_BOOL tic_format,
int numbers)
{ return(*(char **)0); }
@@ -5355,28 +5447,28 @@ char *_nc_tic_expand(
#undef _nc_check_termtype2
void (*_nc_check_termtype2)(
- TERMTYPE2 *p1,
+ TERMTYPE2 *p1,
NCURSES_BOOL p2);
#undef _nc_entry_match
NCURSES_BOOL _nc_entry_match(
- char *n1,
+ char *n1,
char *n2)
{ return(*(NCURSES_BOOL *)0); }
#undef _nc_read_entry_source
void _nc_read_entry_source(
- FILE *fp,
- char *buf,
- int literal,
- NCURSES_BOOL silent,
+ FILE *fp,
+ char *buf,
+ int literal,
+ NCURSES_BOOL silent,
NCURSES_BOOL (*hook)(
ENTRY *p1))
{ /* void */ }
#undef _nc_resolve_uses2
int _nc_resolve_uses2(
- NCURSES_BOOL fullresolve,
+ NCURSES_BOOL fullresolve,
NCURSES_BOOL literal)
{ return(*(int *)0); }
@@ -5401,7 +5493,7 @@ NCURSES_BOOL _nc_disable_period;
#undef _nc_reset_input
void _nc_reset_input(
- FILE *fp,
+ FILE *fp,
char *buf)
{ /* void */ }
@@ -5412,8 +5504,8 @@ int _nc_get_token(
#undef _nc_trans_string
int _nc_trans_string(
- char *ptr,
- char *last)
+ char *ptr,
+ const char *const last)
{ return(*(int *)0); }
#undef _nc_push_token
@@ -5430,14 +5522,14 @@ void _nc_panic_mode(
#undef _nc_parse_entry
int _nc_parse_entry(
- ENTRY *entryp,
- int literal,
+ ENTRY *entryp,
+ int literal,
NCURSES_BOOL silent)
{ return(*(int *)0); }
#undef _nc_capcmp
int _nc_capcmp(
- const char *s,
+ const char *s,
const char *t)
{ return(*(int *)0); }
@@ -5455,9 +5547,9 @@ void _nc_write_entry(
#undef _nc_write_object
int _nc_write_object(
- TERMTYPE2 *tp,
- char *buffer,
- unsigned *offset,
+ TERMTYPE2 *tp,
+ char *buffer,
+ unsigned *offset,
unsigned limit)
{ return(*(int *)0); }
@@ -5469,14 +5561,14 @@ int _nc_tic_written(void)
#undef define_key_sp
int define_key_sp(
- SCREEN *sp,
- const char *str,
+ SCREEN *sp,
+ const char *str,
int keycode)
{ return(*(int *)0); }
#undef define_key
int define_key(
- const char *str,
+ const char *str,
int keycode)
{ return(*(int *)0); }
@@ -5490,7 +5582,7 @@ void _nc_hashed_db(void)
#undef key_defined_sp
int key_defined_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(int *)0); }
@@ -5503,14 +5595,14 @@ int key_defined(
#undef keybound_sp
char *keybound_sp(
- SCREEN *sp,
- int code,
+ SCREEN *sp,
+ int code,
int count)
{ return(*(char **)0); }
#undef keybound
char *keybound(
- int code,
+ int code,
int count)
{ return(*(char **)0); }
@@ -5518,14 +5610,14 @@ char *keybound(
#undef keyok_sp
int keyok_sp(
- SCREEN *sp,
- int c,
+ SCREEN *sp,
+ int c,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef keyok
int keyok(
- int c,
+ int c,
NCURSES_BOOL flag)
{ return(*(int *)0); }
diff --git a/ncurses/llib-lncursesw b/ncurses/llib-lncursesw
index 794d4929254a..dbf535db4b3f 100644
--- a/ncurses/llib-lncursesw
+++ b/ncurses/llib-lncursesw
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2022,2023 Thomas E. Dickey *
* Copyright 2001-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -70,7 +70,7 @@ void _nc_hash_map(void)
#undef _nc_make_oldhash_sp
void _nc_make_oldhash_sp(
- SCREEN *sp,
+ SCREEN *sp,
int i)
{ /* void */ }
@@ -81,16 +81,16 @@ void _nc_make_oldhash(
#undef _nc_scroll_oldhash_sp
void _nc_scroll_oldhash_sp(
- SCREEN *sp,
- int n,
- int top,
+ SCREEN *sp,
+ int n,
+ int top,
int bot)
{ /* void */ }
#undef _nc_scroll_oldhash
void _nc_scroll_oldhash(
- int n,
- int top,
+ int n,
+ int top,
int bot)
{ /* void */ }
@@ -98,31 +98,31 @@ void _nc_scroll_oldhash(
#undef _nc_render
cchar_t _nc_render(
- WINDOW *win,
+ WINDOW *win,
cchar_t ch)
{ return(*(cchar_t *)0); }
#undef _nc_build_wch
int _nc_build_wch(
- WINDOW *win,
+ WINDOW *win,
cchar_t *ch)
{ return(*(int *)0); }
#undef _nc_waddch_nosync
int _nc_waddch_nosync(
- WINDOW *win,
+ WINDOW *win,
const cchar_t c)
{ return(*(int *)0); }
#undef waddch
int waddch(
- WINDOW *win,
+ WINDOW *win,
const chtype ch)
{ return(*(int *)0); }
#undef wechochar
int wechochar(
- WINDOW *win,
+ WINDOW *win,
const chtype ch)
{ return(*(int *)0); }
@@ -130,15 +130,15 @@ int wechochar(
#undef waddnstr
int waddnstr(
- WINDOW *win,
- const char *astr,
+ WINDOW *win,
+ const char *astr,
int n)
{ return(*(int *)0); }
#undef waddchnstr
int waddchnstr(
- WINDOW *win,
- const chtype *astr,
+ WINDOW *win,
+ const chtype *astr,
int n)
{ return(*(int *)0); }
@@ -149,15 +149,15 @@ int _nc_wchstrlen(
#undef wadd_wchnstr
int wadd_wchnstr(
- WINDOW *win,
- const cchar_t *astr,
+ WINDOW *win,
+ const cchar_t *astr,
int n)
{ return(*(int *)0); }
#undef waddnwstr
int waddnwstr(
- WINDOW *win,
- const wchar_t *str,
+ WINDOW *win,
+ const wchar_t *str,
int n)
{ return(*(int *)0); }
@@ -176,25 +176,25 @@ int beep(void)
#undef wbkgrndset
void wbkgrndset(
- WINDOW *win,
+ WINDOW *win,
const cchar_t *ch)
{ /* void */ }
#undef wbkgdset
void wbkgdset(
- WINDOW *win,
+ WINDOW *win,
chtype ch)
{ /* void */ }
#undef wbkgrnd
int wbkgrnd(
- WINDOW *win,
+ WINDOW *win,
const cchar_t *ch)
{ return(*(int *)0); }
#undef wbkgd
int wbkgd(
- WINDOW *win,
+ WINDOW *win,
chtype ch)
{ return(*(int *)0); }
@@ -202,14 +202,14 @@ int wbkgd(
#undef wborder
int wborder(
- WINDOW *win,
- chtype ls,
- chtype rs,
- chtype ts,
- chtype bs,
- chtype tl,
- chtype tr,
- chtype bl,
+ WINDOW *win,
+ chtype ls,
+ chtype rs,
+ chtype ts,
+ chtype bs,
+ chtype tl,
+ chtype tr,
+ chtype bl,
chtype br)
{ return(*(int *)0); }
@@ -217,10 +217,10 @@ int wborder(
#undef wchgat
int wchgat(
- WINDOW *win,
- int n,
- attr_t attr,
- short pair_arg,
+ WINDOW *win,
+ int n,
+ attr_t attr,
+ short pair_arg,
const void *opts)
{ return(*(int *)0); }
@@ -235,7 +235,7 @@ int wclear(
#undef clearok
int clearok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
@@ -280,62 +280,62 @@ int start_color(void)
#undef _nc_change_pair
void _nc_change_pair(
- SCREEN *sp,
+ SCREEN *sp,
int pair)
{ /* void */ }
#undef _nc_reserve_pairs
void _nc_reserve_pairs(
- SCREEN *sp,
+ SCREEN *sp,
int want)
{ /* void */ }
#undef _nc_init_pair
int _nc_init_pair(
- SCREEN *sp,
- int pair,
- int f,
+ SCREEN *sp,
+ int pair,
+ int f,
int b)
{ return(*(int *)0); }
#undef init_pair_sp
int init_pair_sp(
- SCREEN *sp,
- short pair,
- short f,
+ SCREEN *sp,
+ short pair,
+ short f,
short b)
{ return(*(int *)0); }
#undef init_pair
int init_pair(
- short pair,
- short f,
+ short pair,
+ short f,
short b)
{ return(*(int *)0); }
#undef _nc_init_color
int _nc_init_color(
- SCREEN *sp,
- int color,
- int r,
- int g,
+ SCREEN *sp,
+ int color,
+ int r,
+ int g,
int b)
{ return(*(int *)0); }
#undef init_color_sp
int init_color_sp(
- SCREEN *sp,
- short color,
- short r,
- short g,
+ 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 color,
+ short r,
+ short g,
short b)
{ return(*(int *)0); }
@@ -359,92 +359,92 @@ NCURSES_BOOL has_colors(void)
#undef color_content_sp
int color_content_sp(
- SCREEN *sp,
- short color,
- short *r,
- short *g,
+ 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 color,
+ short *r,
+ short *g,
short *b)
{ return(*(int *)0); }
#undef _nc_pair_content
int _nc_pair_content(
- SCREEN *sp,
- int pair,
- int *f,
+ SCREEN *sp,
+ int pair,
+ int *f,
int *b)
{ return(*(int *)0); }
#undef pair_content_sp
int pair_content_sp(
- SCREEN *sp,
- short pair,
- short *f,
+ SCREEN *sp,
+ short pair,
+ short *f,
short *b)
{ return(*(int *)0); }
#undef pair_content
int pair_content(
- short pair,
- short *f,
+ short pair,
+ short *f,
short *b)
{ return(*(int *)0); }
#undef _nc_do_color_sp
void _nc_do_color_sp(
- SCREEN *sp,
- int old_pair,
- int pair,
- int reverse,
+ SCREEN *sp,
+ int old_pair,
+ int pair,
+ int reverse,
NCURSES_OUTC_sp outc)
{ /* void */ }
#undef _nc_do_color
void _nc_do_color(
- int old_pair,
- int pair,
- int reverse,
+ int old_pair,
+ int pair,
+ int reverse,
NCURSES_OUTC outc)
{ /* void */ }
#undef init_extended_pair_sp
int init_extended_pair_sp(
- SCREEN *sp,
- int pair,
- int f,
+ SCREEN *sp,
+ int pair,
+ int f,
int b)
{ return(*(int *)0); }
#undef init_extended_color_sp
int init_extended_color_sp(
- SCREEN *sp,
- int color,
- int r,
- int g,
+ SCREEN *sp,
+ int color,
+ int r,
+ int g,
int b)
{ return(*(int *)0); }
#undef extended_color_content_sp
int extended_color_content_sp(
- SCREEN *sp,
- int color,
- int *r,
- int *g,
+ SCREEN *sp,
+ int color,
+ int *r,
+ int *g,
int *b)
{ return(*(int *)0); }
#undef extended_pair_content_sp
int extended_pair_content_sp(
- SCREEN *sp,
- int pair,
- int *f,
+ SCREEN *sp,
+ int pair,
+ int *f,
int *b)
{ return(*(int *)0); }
@@ -455,31 +455,31 @@ void reset_color_pairs_sp(
#undef init_extended_pair
int init_extended_pair(
- int pair,
- int f,
+ int pair,
+ int f,
int b)
{ return(*(int *)0); }
#undef init_extended_color
int init_extended_color(
- int color,
- int r,
- int g,
+ int color,
+ int r,
+ int g,
int b)
{ return(*(int *)0); }
#undef extended_color_content
int extended_color_content(
- int color,
- int *r,
- int *g,
+ int color,
+ int *r,
+ int *g,
int *b)
{ return(*(int *)0); }
#undef extended_pair_content
int extended_pair_content(
- int pair,
- int *f,
+ int pair,
+ int *f,
int *b)
{ return(*(int *)0); }
@@ -491,8 +491,8 @@ void reset_color_pairs(void)
#undef wcolor_set
int wcolor_set(
- WINDOW *win,
- short pair_arg,
+ WINDOW *win,
+ short pair_arg,
void *opts)
{ return(*(int *)0); }
@@ -568,7 +568,7 @@ int addch(
#undef addchnstr
int addchnstr(
- const chtype *a1,
+ const chtype *a1,
int z)
{ return(*(int *)0); }
@@ -579,7 +579,7 @@ int addchstr(
#undef addnstr
int addnstr(
- const char *a1,
+ const char *a1,
int z)
{ return(*(int *)0); }
@@ -590,42 +590,42 @@ int addstr(
#undef attroff
int attroff(
- int z)
+ NCURSES_ATTR_T z)
{ return(*(int *)0); }
#undef attron
int attron(
- int z)
+ NCURSES_ATTR_T z)
{ return(*(int *)0); }
#undef attrset
int attrset(
- int z)
+ NCURSES_ATTR_T z)
{ return(*(int *)0); }
#undef attr_get
int attr_get(
- attr_t *a1,
- short *a2,
+ attr_t *a1,
+ short *a2,
void *z)
{ return(*(int *)0); }
#undef attr_off
int attr_off(
- attr_t a1,
+ attr_t a1,
void *z)
{ return(*(int *)0); }
#undef attr_on
int attr_on(
- attr_t a1,
+ attr_t a1,
void *z)
{ return(*(int *)0); }
#undef attr_set
int attr_set(
- attr_t a1,
- short a2,
+ attr_t a1,
+ short a2,
void *z)
{ return(*(int *)0); }
@@ -641,28 +641,28 @@ void bkgdset(
#undef border
int border(
- chtype a1,
- chtype a2,
- chtype a3,
- chtype a4,
- chtype a5,
- chtype a6,
- chtype a7,
+ 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,
+ WINDOW *a1,
+ chtype a2,
chtype z)
{ return(*(int *)0); }
#undef chgat
int chgat(
- int a1,
- attr_t a2,
- short a3,
+ int a1,
+ attr_t a2,
+ short a3,
const void *z)
{ return(*(int *)0); }
@@ -680,7 +680,7 @@ int clrtoeol(void)
#undef color_set
int color_set(
- short a1,
+ short a1,
void *z)
{ return(*(int *)0); }
@@ -717,7 +717,7 @@ int getch(void)
#undef getnstr
int getnstr(
- char *a1,
+ char *a1,
int z)
{ return(*(int *)0); }
@@ -728,7 +728,7 @@ int getstr(
#undef hline
int hline(
- chtype a1,
+ chtype a1,
int z)
{ return(*(int *)0); }
@@ -738,7 +738,7 @@ chtype inch(void)
#undef inchnstr
int inchnstr(
- chtype *a1,
+ chtype *a1,
int z)
{ return(*(int *)0); }
@@ -749,7 +749,7 @@ int inchstr(
#undef innstr
int innstr(
- char *a1,
+ char *a1,
int z)
{ return(*(int *)0); }
@@ -769,7 +769,7 @@ int insertln(void)
#undef insnstr
int insnstr(
- const char *a1,
+ const char *a1,
int z)
{ return(*(int *)0); }
@@ -785,323 +785,323 @@ int instr(
#undef move
int move(
- int a1,
+ int a1,
int z)
{ return(*(int *)0); }
#undef mvaddch
int mvaddch(
- int a1,
- int a2,
+ int a1,
+ int a2,
const chtype z)
{ return(*(int *)0); }
#undef mvaddchnstr
int mvaddchnstr(
- int a1,
- int a2,
- const chtype *a3,
+ int a1,
+ int a2,
+ const chtype *a3,
int z)
{ return(*(int *)0); }
#undef mvaddchstr
int mvaddchstr(
- int a1,
- int a2,
+ int a1,
+ int a2,
const chtype *z)
{ return(*(int *)0); }
#undef mvaddnstr
int mvaddnstr(
- int a1,
- int a2,
- const char *a3,
+ int a1,
+ int a2,
+ const char *a3,
int z)
{ return(*(int *)0); }
#undef mvaddstr
int mvaddstr(
- int a1,
- int a2,
+ 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,
+ int a1,
+ int a2,
+ int a3,
+ attr_t a4,
+ short a5,
const void *z)
{ return(*(int *)0); }
#undef mvdelch
int mvdelch(
- int a1,
+ int a1,
int z)
{ return(*(int *)0); }
#undef mvgetch
int mvgetch(
- int a1,
+ int a1,
int z)
{ return(*(int *)0); }
#undef mvgetnstr
int mvgetnstr(
- int a1,
- int a2,
- char *a3,
+ int a1,
+ int a2,
+ char *a3,
int z)
{ return(*(int *)0); }
#undef mvgetstr
int mvgetstr(
- int a1,
- int a2,
+ int a1,
+ int a2,
char *z)
{ return(*(int *)0); }
#undef mvhline
int mvhline(
- int a1,
- int a2,
- chtype a3,
+ int a1,
+ int a2,
+ chtype a3,
int z)
{ return(*(int *)0); }
#undef mvinch
chtype mvinch(
- int a1,
+ int a1,
int z)
{ return(*(chtype *)0); }
#undef mvinchnstr
int mvinchnstr(
- int a1,
- int a2,
- chtype *a3,
+ int a1,
+ int a2,
+ chtype *a3,
int z)
{ return(*(int *)0); }
#undef mvinchstr
int mvinchstr(
- int a1,
- int a2,
+ int a1,
+ int a2,
chtype *z)
{ return(*(int *)0); }
#undef mvinnstr
int mvinnstr(
- int a1,
- int a2,
- char *a3,
+ int a1,
+ int a2,
+ char *a3,
int z)
{ return(*(int *)0); }
#undef mvinsch
int mvinsch(
- int a1,
- int a2,
+ int a1,
+ int a2,
chtype z)
{ return(*(int *)0); }
#undef mvinsnstr
int mvinsnstr(
- int a1,
- int a2,
- const char *a3,
+ int a1,
+ int a2,
+ const char *a3,
int z)
{ return(*(int *)0); }
#undef mvinsstr
int mvinsstr(
- int a1,
- int a2,
+ int a1,
+ int a2,
const char *z)
{ return(*(int *)0); }
#undef mvinstr
int mvinstr(
- int a1,
- int a2,
+ int a1,
+ int a2,
char *z)
{ return(*(int *)0); }
#undef mvvline
int mvvline(
- int a1,
- int a2,
- chtype a3,
+ int a1,
+ int a2,
+ chtype a3,
int z)
{ return(*(int *)0); }
#undef mvwaddch
int mvwaddch(
- WINDOW *a1,
- int a2,
- int a3,
+ 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,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ const chtype *a4,
int z)
{ return(*(int *)0); }
#undef mvwaddchstr
int mvwaddchstr(
- WINDOW *a1,
- int a2,
- int a3,
+ 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,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ const char *a4,
int z)
{ return(*(int *)0); }
#undef mvwaddstr
int mvwaddstr(
- WINDOW *a1,
- int a2,
- int a3,
+ 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,
+ 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,
+ WINDOW *a1,
+ int a2,
int z)
{ return(*(int *)0); }
#undef mvwgetch
int mvwgetch(
- WINDOW *a1,
- int a2,
+ WINDOW *a1,
+ int a2,
int z)
{ return(*(int *)0); }
#undef mvwgetnstr
int mvwgetnstr(
- WINDOW *a1,
- int a2,
- int a3,
- char *a4,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ char *a4,
int z)
{ return(*(int *)0); }
#undef mvwgetstr
int mvwgetstr(
- WINDOW *a1,
- int a2,
- int a3,
+ WINDOW *a1,
+ int a2,
+ int a3,
char *z)
{ return(*(int *)0); }
#undef mvwhline
int mvwhline(
- WINDOW *a1,
- int a2,
- int a3,
- chtype a4,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ chtype a4,
int z)
{ return(*(int *)0); }
#undef mvwinch
chtype mvwinch(
- WINDOW *a1,
- int a2,
+ WINDOW *a1,
+ int a2,
int z)
{ return(*(chtype *)0); }
#undef mvwinchnstr
int mvwinchnstr(
- WINDOW *a1,
- int a2,
- int a3,
- chtype *a4,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ chtype *a4,
int z)
{ return(*(int *)0); }
#undef mvwinchstr
int mvwinchstr(
- WINDOW *a1,
- int a2,
- int a3,
+ WINDOW *a1,
+ int a2,
+ int a3,
chtype *z)
{ return(*(int *)0); }
#undef mvwinnstr
int mvwinnstr(
- WINDOW *a1,
- int a2,
- int a3,
- char *a4,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ char *a4,
int z)
{ return(*(int *)0); }
#undef mvwinsch
int mvwinsch(
- WINDOW *a1,
- int a2,
- int a3,
+ WINDOW *a1,
+ int a2,
+ int a3,
chtype z)
{ return(*(int *)0); }
#undef mvwinsnstr
int mvwinsnstr(
- WINDOW *a1,
- int a2,
- int a3,
- const char *a4,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ const char *a4,
int z)
{ return(*(int *)0); }
#undef mvwinsstr
int mvwinsstr(
- WINDOW *a1,
- int a2,
- int a3,
+ WINDOW *a1,
+ int a2,
+ int a3,
const char *z)
{ return(*(int *)0); }
#undef mvwinstr
int mvwinstr(
- WINDOW *a1,
- int a2,
- int a3,
+ WINDOW *a1,
+ int a2,
+ int a3,
char *z)
{ return(*(int *)0); }
#undef mvwvline
int mvwvline(
- WINDOW *a1,
- int a2,
- int a3,
- chtype a4,
+ WINDOW *a1,
+ int a2,
+ int a3,
+ chtype a4,
int z)
{ return(*(int *)0); }
@@ -1131,19 +1131,19 @@ int scroll(
#undef setscrreg
int setscrreg(
- int a1,
+ int a1,
int z)
{ return(*(int *)0); }
#undef slk_attr_off
int slk_attr_off(
- const attr_t a1,
+ const attr_t a1,
void *z)
{ return(*(int *)0); }
#undef slk_attr_on
int slk_attr_on(
- attr_t a1,
+ attr_t a1,
void *z)
{ return(*(int *)0); }
@@ -1162,8 +1162,8 @@ void timeout(
#undef touchline
int touchline(
- WINDOW *a1,
- int a2,
+ WINDOW *a1,
+ int a2,
int z)
{ return(*(int *)0); }
@@ -1179,53 +1179,53 @@ int untouchwin(
#undef vline
int vline(
- chtype a1,
+ chtype a1,
int z)
{ return(*(int *)0); }
#undef waddchstr
int waddchstr(
- WINDOW *a1,
+ WINDOW *a1,
const chtype *z)
{ return(*(int *)0); }
#undef waddstr
int waddstr(
- WINDOW *a1,
+ WINDOW *a1,
const char *z)
{ return(*(int *)0); }
#undef wattron
int wattron(
- WINDOW *a1,
+ WINDOW *a1,
int z)
{ return(*(int *)0); }
#undef wattroff
int wattroff(
- WINDOW *a1,
+ WINDOW *a1,
int z)
{ return(*(int *)0); }
#undef wattrset
int wattrset(
- WINDOW *a1,
+ WINDOW *a1,
int z)
{ return(*(int *)0); }
#undef wattr_get
int wattr_get(
- WINDOW *a1,
- attr_t *a2,
- short *a3,
+ 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,
+ WINDOW *a1,
+ attr_t a2,
+ short a3,
void *z)
{ return(*(int *)0); }
@@ -1236,13 +1236,13 @@ int wdeleteln(
#undef wgetstr
int wgetstr(
- WINDOW *a1,
+ WINDOW *a1,
char *z)
{ return(*(int *)0); }
#undef winchstr
int winchstr(
- WINDOW *a1,
+ WINDOW *a1,
chtype *z)
{ return(*(int *)0); }
@@ -1253,13 +1253,13 @@ int winsertln(
#undef winsstr
int winsstr(
- WINDOW *a1,
+ WINDOW *a1,
const char *z)
{ return(*(int *)0); }
#undef winstr
int winstr(
- WINDOW *a1,
+ WINDOW *a1,
char *z)
{ return(*(int *)0); }
@@ -1390,8 +1390,8 @@ int wgetdelay(
#undef wgetscrreg
int wgetscrreg(
- const WINDOW *a1,
- int *a2,
+ const WINDOW *a1,
+ int *a2,
int *z)
{ return(*(int *)0); }
@@ -1402,7 +1402,7 @@ int add_wch(
#undef add_wchnstr
int add_wchnstr(
- const cchar_t *a1,
+ const cchar_t *a1,
int z)
{ return(*(int *)0); }
@@ -1413,7 +1413,7 @@ int add_wchstr(
#undef addnwstr
int addnwstr(
- const wchar_t *a1,
+ const wchar_t *a1,
int z)
{ return(*(int *)0); }
@@ -1434,20 +1434,20 @@ void bkgrndset(
#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 *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,
+ WINDOW *a1,
+ const cchar_t *a2,
const cchar_t *z)
{ return(*(int *)0); }
@@ -1473,13 +1473,13 @@ int getbkgrnd(
#undef getn_wstr
int getn_wstr(
- wint_t *a1,
+ wint_t *a1,
int z)
{ return(*(int *)0); }
#undef hline_set
int hline_set(
- const cchar_t *a1,
+ const cchar_t *a1,
int z)
{ return(*(int *)0); }
@@ -1490,7 +1490,7 @@ int in_wch(
#undef in_wchnstr
int in_wchnstr(
- cchar_t *a1,
+ cchar_t *a1,
int z)
{ return(*(int *)0); }
@@ -1501,13 +1501,13 @@ int in_wchstr(
#undef innwstr
int innwstr(
- wchar_t *a1,
+ wchar_t *a1,
int z)
{ return(*(int *)0); }
#undef ins_nwstr
int ins_nwstr(
- const wchar_t *a1,
+ const wchar_t *a1,
int z)
{ return(*(int *)0); }
@@ -1528,336 +1528,336 @@ int inwstr(
#undef mvadd_wch
int mvadd_wch(
- int a1,
- int a2,
+ 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 a1,
+ int a2,
+ const cchar_t *a3,
int z)
{ return(*(int *)0); }
#undef mvadd_wchstr
int mvadd_wchstr(
- int a1,
- int a2,
+ int a1,
+ int a2,
const cchar_t *z)
{ return(*(int *)0); }
#undef mvaddnwstr
int mvaddnwstr(
- int a1,
- int a2,
- const wchar_t *a3,
+ int a1,
+ int a2,
+ const wchar_t *a3,
int z)
{ return(*(int *)0); }
#undef mvaddwstr
int mvaddwstr(
- int a1,
- int a2,
+ int a1,
+ int a2,
const wchar_t *z)
{ return(*(int *)0); }
#undef mvget_wch
int mvget_wch(
- int a1,
- int a2,
+ int a1,
+ int a2,
wint_t *z)
{ return(*(int *)0); }
#undef mvget_wstr
int mvget_wstr(
- int a1,
- int a2,
+ int a1,
+ int a2,
wint_t *z)
{ return(*(int *)0); }
#undef mvgetn_wstr
int mvgetn_wstr(
- int a1,
- int a2,
- wint_t *a3,
+ 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 a1,
+ int a2,
+ const cchar_t *a3,
int z)
{ return(*(int *)0); }
#undef mvin_wch
int mvin_wch(
- int a1,
- int a2,
+ int a1,
+ int a2,
cchar_t *z)
{ return(*(int *)0); }
#undef mvin_wchnstr
int mvin_wchnstr(
- int a1,
- int a2,
- cchar_t *a3,
+ int a1,
+ int a2,
+ cchar_t *a3,
int z)
{ return(*(int *)0); }
#undef mvin_wchstr
int mvin_wchstr(
- int a1,
- int a2,
+ int a1,
+ int a2,
cchar_t *z)
{ return(*(int *)0); }
#undef mvinnwstr
int mvinnwstr(
- int a1,
- int a2,
- wchar_t *a3,
+ 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 a1,
+ int a2,
+ const wchar_t *a3,
int z)
{ return(*(int *)0); }
#undef mvins_wch
int mvins_wch(
- int a1,
- int a2,
+ int a1,
+ int a2,
const cchar_t *z)
{ return(*(int *)0); }
#undef mvins_wstr
int mvins_wstr(
- int a1,
- int a2,
+ int a1,
+ int a2,
const wchar_t *z)
{ return(*(int *)0); }
#undef mvinwstr
int mvinwstr(
- int a1,
- int a2,
+ 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 a1,
+ int a2,
+ const cchar_t *a3,
int z)
{ return(*(int *)0); }
#undef mvwadd_wch
int mvwadd_wch(
- WINDOW *a1,
- int a2,
- int a3,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ WINDOW *a1,
+ int a2,
+ int a3,
wint_t *z)
{ return(*(int *)0); }
#undef mvwget_wstr
int mvwget_wstr(
- WINDOW *a1,
- int a2,
- int a3,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ 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,
+ WINDOW *a1,
+ int a2,
+ int a3,
const wchar_t *z)
{ return(*(int *)0); }
#undef mvwinwstr
int mvwinwstr(
- WINDOW *a1,
- int a2,
- int a3,
+ 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,
+ 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,
+ const cchar_t *a1,
int z)
{ return(*(int *)0); }
#undef wadd_wchstr
int wadd_wchstr(
- WINDOW *a1,
+ WINDOW *a1,
const cchar_t *z)
{ return(*(int *)0); }
#undef waddwstr
int waddwstr(
- WINDOW *a1,
+ WINDOW *a1,
const wchar_t *z)
{ return(*(int *)0); }
#undef wget_wstr
int wget_wstr(
- WINDOW *a1,
+ WINDOW *a1,
wint_t *z)
{ return(*(int *)0); }
#undef wgetbkgrnd
int wgetbkgrnd(
- WINDOW *a1,
+ WINDOW *a1,
cchar_t *z)
{ return(*(int *)0); }
#undef win_wchstr
int win_wchstr(
- WINDOW *a1,
+ WINDOW *a1,
cchar_t *z)
{ return(*(int *)0); }
#undef wins_wstr
int wins_wstr(
- WINDOW *a1,
+ WINDOW *a1,
const wchar_t *z)
{ return(*(int *)0); }
#undef mouse_trafo
NCURSES_BOOL mouse_trafo(
- int *a1,
- int *a2,
+ int *a1,
+ int *a2,
NCURSES_BOOL z)
{ return(*(NCURSES_BOOL *)0); }
@@ -1868,7 +1868,7 @@ int ESCDELAY;
#undef set_escdelay_sp
int set_escdelay_sp(
- SCREEN *sp,
+ SCREEN *sp,
int value)
{ return(*(int *)0); }
@@ -1888,8 +1888,8 @@ int get_escdelay(void)
#undef _nc_wgetch
int _nc_wgetch(
- WINDOW *win,
- int *result,
+ WINDOW *win,
+ int *result,
int use_meta)
{ return(*(int *)0); }
@@ -1902,8 +1902,8 @@ int wgetch(
#undef wgetnstr
int wgetnstr(
- WINDOW *win,
- char *str,
+ WINDOW *win,
+ char *str,
int maxlen)
{ return(*(int *)0); }
@@ -1911,8 +1911,8 @@ int wgetnstr(
#undef whline
int whline(
- WINDOW *win,
- chtype ch,
+ WINDOW *win,
+ chtype ch,
int n)
{ return(*(int *)0); }
@@ -1920,7 +1920,7 @@ int whline(
#undef immedok
void immedok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ /* void */ }
@@ -1928,8 +1928,8 @@ void immedok(
#undef winchnstr
int winchnstr(
- WINDOW *win,
- chtype *str,
+ WINDOW *win,
+ chtype *str,
int n)
{ return(*(int *)0); }
@@ -1943,14 +1943,14 @@ WINDOW *initscr(void)
#undef _nc_insert_ch
int _nc_insert_ch(
- SCREEN *sp,
- WINDOW *win,
+ SCREEN *sp,
+ WINDOW *win,
chtype ch)
{ return(*(int *)0); }
#undef winsch
int winsch(
- WINDOW *win,
+ WINDOW *win,
chtype c)
{ return(*(int *)0); }
@@ -1958,7 +1958,7 @@ int winsch(
#undef winsdelln
int winsdelln(
- WINDOW *win,
+ WINDOW *win,
int n)
{ return(*(int *)0); }
@@ -1966,8 +1966,8 @@ int winsdelln(
#undef winsnstr
int winsnstr(
- WINDOW *win,
- const char *s,
+ WINDOW *win,
+ const char *s,
int n)
{ return(*(int *)0); }
@@ -1975,8 +1975,8 @@ int winsnstr(
#undef winnstr
int winnstr(
- WINDOW *win,
- char *str,
+ WINDOW *win,
+ char *str,
int n)
{ return(*(int *)0); }
@@ -1995,7 +1995,7 @@ NCURSES_BOOL isendwin(void)
#undef leaveok
int leaveok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
@@ -2003,7 +2003,7 @@ int leaveok(
#undef getmouse_sp
int getmouse_sp(
- SCREEN *sp,
+ SCREEN *sp,
MEVENT *aevent)
{ return(*(int *)0); }
@@ -2014,7 +2014,7 @@ int getmouse(
#undef ungetmouse_sp
int ungetmouse_sp(
- SCREEN *sp,
+ SCREEN *sp,
MEVENT *aevent)
{ return(*(int *)0); }
@@ -2025,27 +2025,27 @@ int ungetmouse(
#undef mousemask_sp
mmask_t mousemask_sp(
- SCREEN *sp,
- mmask_t newmask,
+ SCREEN *sp,
+ mmask_t newmask,
mmask_t *oldmask)
{ return(*(mmask_t *)0); }
#undef mousemask
mmask_t mousemask(
- mmask_t newmask,
+ mmask_t newmask,
mmask_t *oldmask)
{ return(*(mmask_t *)0); }
#undef wenclose
NCURSES_BOOL wenclose(
- const WINDOW *win,
- int y,
+ const WINDOW *win,
+ int y,
int x)
{ return(*(NCURSES_BOOL *)0); }
#undef mouseinterval_sp
int mouseinterval_sp(
- SCREEN *sp,
+ SCREEN *sp,
int maxclick)
{ return(*(int *)0); }
@@ -2070,9 +2070,9 @@ NCURSES_BOOL has_mouse(void)
#undef wmouse_trafo
NCURSES_BOOL wmouse_trafo(
- const WINDOW *win,
- int *pY,
- int *pX,
+ const WINDOW *win,
+ int *pY,
+ int *pX,
NCURSES_BOOL to_screen)
{ return(*(NCURSES_BOOL *)0); }
@@ -2080,8 +2080,8 @@ NCURSES_BOOL wmouse_trafo(
#undef wmove
int wmove(
- WINDOW *win,
- int y,
+ WINDOW *win,
+ int y,
int x)
{ return(*(int *)0); }
@@ -2089,14 +2089,14 @@ int wmove(
#undef _nc_msec_cost_sp
int _nc_msec_cost_sp(
- SCREEN *sp,
- const char *const cap,
+ SCREEN *sp,
+ const char *const cap,
int affcnt)
{ return(*(int *)0); }
#undef _nc_msec_cost
int _nc_msec_cost(
- const char *const cap,
+ const char *const cap,
int affcnt)
{ return(*(int *)0); }
@@ -2129,35 +2129,35 @@ void _nc_mvcur_wrap(void)
#undef _nc_mvcur_sp
int _nc_mvcur_sp(
- SCREEN *sp,
- int yold,
- int xold,
- int ynew,
+ SCREEN *sp,
+ int yold,
+ int xold,
+ int ynew,
int xnew)
{ return(*(int *)0); }
#undef _nc_mvcur
int _nc_mvcur(
- int yold,
- int xold,
- int ynew,
+ int yold,
+ int xold,
+ int ynew,
int xnew)
{ return(*(int *)0); }
#undef mvcur_sp
int mvcur_sp(
- SCREEN *sp,
- int yold,
- int xold,
- int ynew,
+ SCREEN *sp,
+ int yold,
+ int xold,
+ int ynew,
int xnew)
{ return(*(int *)0); }
#undef mvcur
int mvcur(
- int yold,
- int xold,
- int ynew,
+ int yold,
+ int xold,
+ int ynew,
int xnew)
{ return(*(int *)0); }
@@ -2168,8 +2168,8 @@ int _nc_optimize_enable;
#undef mvwin
int mvwin(
- WINDOW *win,
- int by,
+ WINDOW *win,
+ int by,
int bx)
{ return(*(int *)0); }
@@ -2195,16 +2195,16 @@ void nofilter(void)
#undef newterm_sp
SCREEN *newterm_sp(
- SCREEN *sp,
- const char *name,
- FILE *ofp,
+ SCREEN *sp,
+ const char *name,
+ FILE *ofp,
FILE *ifp)
{ return(*(SCREEN **)0); }
#undef newterm
SCREEN *newterm(
- const char *name,
- FILE *ofp,
+ const char *name,
+ FILE *ofp,
FILE *ifp)
{ return(*(SCREEN **)0); }
@@ -2217,46 +2217,46 @@ int _nc_freewin(
#undef newwin_sp
WINDOW *newwin_sp(
- SCREEN *sp,
- int num_lines,
- int num_columns,
- int begy,
+ 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 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,
+ 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,
+ 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,
+ SCREEN *sp,
+ int num_lines,
+ int num_columns,
+ int begy,
+ int begx,
int flags)
{ return(*(WINDOW **)0); }
@@ -2299,26 +2299,26 @@ int nonl(void)
#undef overlay
int overlay(
- const WINDOW *win1,
+ const WINDOW *win1,
WINDOW *win2)
{ return(*(int *)0); }
#undef overwrite
int overwrite(
- const WINDOW *win1,
+ 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,
+ const WINDOW *src,
+ WINDOW *dst,
+ int sminrow,
+ int smincol,
+ int dminrow,
+ int dmincol,
+ int dmaxrow,
+ int dmaxcol,
int over)
{ return(*(int *)0); }
@@ -2326,51 +2326,51 @@ int copywin(
#undef newpad_sp
WINDOW *newpad_sp(
- SCREEN *sp,
- int l,
+ SCREEN *sp,
+ int l,
int c)
{ return(*(WINDOW **)0); }
#undef newpad
WINDOW *newpad(
- int l,
+ int l,
int c)
{ return(*(WINDOW **)0); }
#undef subpad
WINDOW *subpad(
- WINDOW *orig,
- int l,
- int c,
- int begy,
+ 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,
+ 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,
+ WINDOW *win,
+ int pminrow,
+ int pmincol,
+ int sminrow,
+ int smincol,
+ int smaxrow,
int smaxcol)
{ return(*(int *)0); }
#undef pechochar
int pechochar(
- WINDOW *pad,
+ WINDOW *pad,
const chtype ch)
{ return(*(int *)0); }
@@ -2378,45 +2378,45 @@ int pechochar(
#undef printw
int printw(
- const char *fmt,
+ const char *fmt,
...)
{ return(*(int *)0); }
#undef wprintw
int wprintw(
- WINDOW *win,
- const char *fmt,
+ WINDOW *win,
+ const char *fmt,
...)
{ return(*(int *)0); }
#undef mvprintw
int mvprintw(
- int y,
- int x,
- const char *fmt,
+ int y,
+ int x,
+ const char *fmt,
...)
{ return(*(int *)0); }
#undef mvwprintw
int mvwprintw(
- WINDOW *win,
- int y,
- int x,
- const char *fmt,
+ WINDOW *win,
+ int y,
+ int x,
+ const char *fmt,
...)
{ return(*(int *)0); }
#undef vwprintw
int vwprintw(
- WINDOW *win,
- const char *fmt,
+ WINDOW *win,
+ const char *fmt,
va_list argp)
{ return(*(int *)0); }
#undef vw_printw
int vw_printw(
- WINDOW *win,
- const char *fmt,
+ WINDOW *win,
+ const char *fmt,
va_list argp)
{ return(*(int *)0); }
@@ -2424,8 +2424,8 @@ int vw_printw(
#undef wredrawln
int wredrawln(
- WINDOW *win,
- int beg,
+ WINDOW *win,
+ int beg,
int num)
{ return(*(int *)0); }
@@ -2445,16 +2445,16 @@ int wnoutrefresh(
#undef restartterm_sp
int restartterm_sp(
- SCREEN *sp,
- const char *termp,
- int filenum,
+ SCREEN *sp,
+ const char *termp,
+ int filenum,
int *errret)
{ return(*(int *)0); }
#undef restartterm
int restartterm(
- const char *termp,
- int filenum,
+ const char *termp,
+ int filenum,
int *errret)
{ return(*(int *)0); }
@@ -2462,45 +2462,45 @@ int restartterm(
#undef vwscanw
int vwscanw(
- WINDOW *win,
- const char *fmt,
+ WINDOW *win,
+ const char *fmt,
va_list argp)
{ return(*(int *)0); }
#undef vw_scanw
int vw_scanw(
- WINDOW *win,
- const char *fmt,
+ WINDOW *win,
+ const char *fmt,
va_list argp)
{ return(*(int *)0); }
#undef scanw
int scanw(
- const char *fmt,
+ const char *fmt,
...)
{ return(*(int *)0); }
#undef wscanw
int wscanw(
- WINDOW *win,
- const char *fmt,
+ WINDOW *win,
+ const char *fmt,
...)
{ return(*(int *)0); }
#undef mvscanw
int mvscanw(
- int y,
- int x,
- const char *fmt,
+ int y,
+ int x,
+ const char *fmt,
...)
{ return(*(int *)0); }
#undef mvwscanw
int mvwscanw(
- WINDOW *win,
- int y,
- int x,
- const char *fmt,
+ WINDOW *win,
+ int y,
+ int x,
+ const char *fmt,
...)
{ return(*(int *)0); }
@@ -2508,7 +2508,7 @@ int mvwscanw(
#undef getwin_sp
WINDOW *getwin_sp(
- SCREEN *sp,
+ SCREEN *sp,
FILE *filep)
{ return(*(WINDOW **)0); }
@@ -2519,13 +2519,13 @@ WINDOW *getwin(
#undef putwin
int putwin(
- WINDOW *win,
+ WINDOW *win,
FILE *filep)
{ return(*(int *)0); }
#undef scr_restore_sp
int scr_restore_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *file)
{ return(*(int *)0); }
@@ -2541,7 +2541,7 @@ int scr_dump(
#undef scr_init_sp
int scr_init_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *file)
{ return(*(int *)0); }
@@ -2552,7 +2552,7 @@ int scr_init(
#undef scr_set_sp
int scr_set_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *file)
{ return(*(int *)0); }
@@ -2565,16 +2565,16 @@ int scr_set(
#undef _nc_scroll_window
void _nc_scroll_window(
- WINDOW *win,
- int const n,
- int const top,
- int const bottom,
+ WINDOW *win,
+ int const n,
+ int const top,
+ int const bottom,
cchar_t blank)
{ /* void */ }
#undef wscrl
int wscrl(
- WINDOW *win,
+ WINDOW *win,
int n)
{ return(*(int *)0); }
@@ -2582,7 +2582,7 @@ int wscrl(
#undef scrollok
int scrollok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
@@ -2590,8 +2590,8 @@ int scrollok(
#undef wsetscrreg
int wsetscrreg(
- WINDOW *win,
- int top,
+ WINDOW *win,
+ int top,
int bottom)
{ return(*(int *)0); }
@@ -2609,54 +2609,54 @@ void delscreen(
#undef _nc_setupscreen_sp
int _nc_setupscreen_sp(
- SCREEN **spp,
- int slines,
- int scolumns,
- FILE *output,
- int filtered,
+ SCREEN **spp,
+ int slines,
+ int scolumns,
+ FILE *output,
+ int filtered,
int slk_format)
{ return(*(int *)0); }
#undef _nc_setupscreen
int _nc_setupscreen(
- int slines,
- int scolumns,
- FILE *output,
- int filtered,
+ int slines,
+ int scolumns,
+ FILE *output,
+ int filtered,
int slk_format)
{ return(*(int *)0); }
#undef _nc_ripoffline_sp
int _nc_ripoffline_sp(
- SCREEN *sp,
- int line,
+ SCREEN *sp,
+ int line,
int (*init)(
- WINDOW *p1,
+ WINDOW *p1,
int p2))
{ return(*(int *)0); }
#undef _nc_ripoffline
int _nc_ripoffline(
- int line,
+ int line,
int (*init)(
- WINDOW *p1,
+ WINDOW *p1,
int p2))
{ return(*(int *)0); }
#undef ripoffline_sp
int ripoffline_sp(
- SCREEN *sp,
- int line,
+ SCREEN *sp,
+ int line,
int (*init)(
- WINDOW *p1,
+ WINDOW *p1,
int p2))
{ return(*(int *)0); }
#undef ripoffline
int ripoffline(
- int line,
+ int line,
int (*init)(
- WINDOW *p1,
+ WINDOW *p1,
int p2))
{ return(*(int *)0); }
@@ -2664,13 +2664,13 @@ int ripoffline(
#undef _nc_format_slks
int _nc_format_slks(
- SCREEN *sp,
+ SCREEN *sp,
int cols)
{ return(*(int *)0); }
#undef _nc_slk_initialize
int _nc_slk_initialize(
- WINDOW *stwin,
+ WINDOW *stwin,
int cols)
{ return(*(int *)0); }
@@ -2687,16 +2687,16 @@ int slk_restore(void)
#undef slk_attr_set_sp
int slk_attr_set_sp(
- SCREEN *sp,
- const attr_t attr,
- short pair_arg,
+ SCREEN *sp,
+ const attr_t attr,
+ short pair_arg,
void *opts)
{ return(*(int *)0); }
#undef slk_attr_set
int slk_attr_set(
- const attr_t attr,
- short pair_arg,
+ const attr_t attr,
+ short pair_arg,
void *opts)
{ return(*(int *)0); }
@@ -2704,7 +2704,7 @@ int slk_attr_set(
#undef slk_attroff_sp
int slk_attroff_sp(
- SCREEN *sp,
+ SCREEN *sp,
const chtype attr)
{ return(*(int *)0); }
@@ -2717,7 +2717,7 @@ int slk_attroff(
#undef slk_attron_sp
int slk_attron_sp(
- SCREEN *sp,
+ SCREEN *sp,
const chtype attr)
{ return(*(int *)0); }
@@ -2730,7 +2730,7 @@ int slk_attron(
#undef slk_attrset_sp
int slk_attrset_sp(
- SCREEN *sp,
+ SCREEN *sp,
const chtype attr)
{ return(*(int *)0); }
@@ -2765,7 +2765,7 @@ int slk_clear(void)
#undef slk_color_sp
int slk_color_sp(
- SCREEN *sp,
+ SCREEN *sp,
short pair_arg)
{ return(*(int *)0); }
@@ -2776,7 +2776,7 @@ int slk_color(
#undef extended_slk_color_sp
int extended_slk_color_sp(
- SCREEN *sp,
+ SCREEN *sp,
int pair_arg)
{ return(*(int *)0); }
@@ -2789,7 +2789,7 @@ int extended_slk_color(
#undef slk_init_sp
int slk_init_sp(
- SCREEN *sp,
+ SCREEN *sp,
int format)
{ return(*(int *)0); }
@@ -2802,7 +2802,7 @@ int slk_init(
#undef slk_label_sp
char *slk_label_sp(
- SCREEN *sp,
+ SCREEN *sp,
int n)
{ return(*(char **)0); }
@@ -2835,16 +2835,16 @@ int slk_refresh(void)
#undef slk_set_sp
int slk_set_sp(
- SCREEN *sp,
- int i,
- const char *astr,
+ SCREEN *sp,
+ int i,
+ const char *astr,
int format)
{ return(*(int *)0); }
#undef slk_set
int slk_set(
- int i,
- const char *astr,
+ int i,
+ const char *astr,
int format)
{ return(*(int *)0); }
@@ -2863,7 +2863,7 @@ int slk_touch(void)
#undef is_linetouched
NCURSES_BOOL is_linetouched(
- WINDOW *win,
+ WINDOW *win,
int line)
{ return(*(NCURSES_BOOL *)0); }
@@ -2874,9 +2874,9 @@ NCURSES_BOOL is_wintouched(
#undef wtouchln
int wtouchln(
- WINDOW *win,
- int y,
- int n,
+ WINDOW *win,
+ int y,
+ int n,
int changed)
{ return(*(int *)0); }
@@ -2884,7 +2884,7 @@ int wtouchln(
#undef _tracedump
void _tracedump(
- const char *name,
+ const char *name,
WINDOW *win)
{ /* void */ }
@@ -2892,19 +2892,19 @@ void _tracedump(
#undef _nc_trace_mmask_t
char *_nc_trace_mmask_t(
- SCREEN *sp,
+ SCREEN *sp,
mmask_t code)
{ return(*(char **)0); }
#undef _nc_tracemouse
char *_nc_tracemouse(
- SCREEN *sp,
+ SCREEN *sp,
MEVENT const *ep)
{ return(*(char **)0); }
#undef _nc_retrace_mmask_t
mmask_t _nc_retrace_mmask_t(
- SCREEN *sp,
+ SCREEN *sp,
mmask_t code)
{ return(*(mmask_t *)0); }
@@ -2929,7 +2929,7 @@ void _nc_fifo_dump(
#undef ungetch_sp
int ungetch_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ch)
{ return(*(int *)0); }
@@ -2942,20 +2942,20 @@ int ungetch(
#undef vidputs_sp
int vidputs_sp(
- SCREEN *sp,
- chtype newmode,
+ SCREEN *sp,
+ chtype newmode,
NCURSES_OUTC_sp outc)
{ return(*(int *)0); }
#undef vidputs
int vidputs(
- chtype newmode,
+ chtype newmode,
NCURSES_OUTC outc)
{ return(*(int *)0); }
#undef vidattr_sp
int vidattr_sp(
- SCREEN *sp,
+ SCREEN *sp,
chtype newmode)
{ return(*(int *)0); }
@@ -2977,8 +2977,8 @@ chtype termattrs(void)
#undef wvline
int wvline(
- WINDOW *win,
- chtype ch,
+ WINDOW *win,
+ chtype ch,
int n)
{ return(*(int *)0); }
@@ -2986,8 +2986,8 @@ int wvline(
#undef wattr_off
int wattr_off(
- WINDOW *win,
- attr_t at,
+ WINDOW *win,
+ attr_t at,
void *opts)
{ return(*(int *)0); }
@@ -2995,8 +2995,8 @@ int wattr_off(
#undef wattr_on
int wattr_on(
- WINDOW *win,
- attr_t at,
+ WINDOW *win,
+ attr_t at,
void *opts)
{ return(*(int *)0); }
@@ -3016,14 +3016,14 @@ void _nc_synchook(
#undef mvderwin
int mvderwin(
- WINDOW *win,
- int y,
+ WINDOW *win,
+ int y,
int x)
{ return(*(int *)0); }
#undef syncok
int syncok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL bf)
{ return(*(int *)0); }
@@ -3062,14 +3062,14 @@ struct panelhook *_nc_panelhook(void)
#undef _nc_printf_string_sp
char *_nc_printf_string_sp(
- SCREEN *sp,
- const char *fmt,
+ SCREEN *sp,
+ const char *fmt,
va_list ap)
{ return(*(char **)0); }
#undef _nc_printf_string
char *_nc_printf_string(
- const char *fmt,
+ const char *fmt,
va_list ap)
{ return(*(char **)0); }
@@ -3086,18 +3086,18 @@ int doupdate(void)
#undef _nc_scrolln_sp
int _nc_scrolln_sp(
- SCREEN *sp,
- int n,
- int top,
- int bot,
+ 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 n,
+ int top,
+ int bot,
int maxy)
{ return(*(int *)0); }
@@ -3130,7 +3130,7 @@ void _nc_screen_wrap(void)
#undef _nc_do_xmc_glitch_sp
void _nc_do_xmc_glitch_sp(
- SCREEN *sp,
+ SCREEN *sp,
attr_t previous)
{ /* void */ }
@@ -3143,7 +3143,7 @@ void _nc_do_xmc_glitch(
#undef _nc_varargs
char *_nc_varargs(
- const char *fmt,
+ const char *fmt,
va_list ap)
{ return(*(char **)0); }
@@ -3161,7 +3161,7 @@ void _nc_freeall(void)
#undef _nc_free_and_exit_sp
void _nc_free_and_exit_sp(
- SCREEN *sp,
+ SCREEN *sp,
int code)
{ /* void */ }
@@ -3196,13 +3196,13 @@ wint_t _nc_to_widechar(
#undef wadd_wch
int wadd_wch(
- WINDOW *win,
+ WINDOW *win,
const cchar_t *wch)
{ return(*(int *)0); }
#undef wecho_wchar
int wecho_wchar(
- WINDOW *win,
+ WINDOW *win,
const cchar_t *wch)
{ return(*(int *)0); }
@@ -3210,14 +3210,14 @@ int wecho_wchar(
#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,
+ 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); }
@@ -3225,29 +3225,41 @@ int wborder_set(
#undef setcchar
int setcchar(
- cchar_t *wcval,
- const wchar_t *wch,
- const attr_t attrs,
- short pair_arg,
+ cchar_t *wcval,
+ const wchar_t *wch,
+ const attr_t attrs,
+ short pair_arg,
const void *opts)
{ return(*(int *)0); }
#undef getcchar
int getcchar(
- const cchar_t *wcval,
- wchar_t *wch,
- attr_t *attrs,
- short *pair_arg,
+ const cchar_t *wcval,
+ wchar_t *wch,
+ attr_t *attrs,
+ short *pair_arg,
void *opts)
{ return(*(int *)0); }
/* ./widechar/lib_erasewchar.c */
+#undef erasewchar_sp
+int erasewchar_sp(
+ SCREEN *sp,
+ wchar_t *wch)
+ { return(*(int *)0); }
+
#undef erasewchar
int erasewchar(
wchar_t *wch)
{ return(*(int *)0); }
+#undef killwchar_sp
+int killwchar_sp(
+ SCREEN *sp,
+ wchar_t *wch)
+ { return(*(int *)0); }
+
#undef killwchar
int killwchar(
wchar_t *wch)
@@ -3257,7 +3269,7 @@ int killwchar(
#undef wget_wch
int wget_wch(
- WINDOW *win,
+ WINDOW *win,
wint_t *result)
{ return(*(int *)0); }
@@ -3265,8 +3277,8 @@ int wget_wch(
#undef wgetn_wstr
int wgetn_wstr(
- WINDOW *win,
- wint_t *str,
+ WINDOW *win,
+ wint_t *str,
int maxlen)
{ return(*(int *)0); }
@@ -3274,8 +3286,8 @@ int wgetn_wstr(
#undef whline_set
int whline_set(
- WINDOW *win,
- const cchar_t *ch,
+ WINDOW *win,
+ const cchar_t *ch,
int n)
{ return(*(int *)0); }
@@ -3283,7 +3295,7 @@ int whline_set(
#undef win_wch
int win_wch(
- WINDOW *win,
+ WINDOW *win,
cchar_t *wcval)
{ return(*(int *)0); }
@@ -3291,8 +3303,8 @@ int win_wch(
#undef win_wchnstr
int win_wchnstr(
- WINDOW *win,
- cchar_t *wchstr,
+ WINDOW *win,
+ cchar_t *wchstr,
int n)
{ return(*(int *)0); }
@@ -3300,20 +3312,20 @@ int win_wchnstr(
#undef _nc_insert_wch
int _nc_insert_wch(
- WINDOW *win,
+ WINDOW *win,
const cchar_t *wch)
{ return(*(int *)0); }
#undef wins_wch
int wins_wch(
- WINDOW *win,
+ WINDOW *win,
const cchar_t *wch)
{ return(*(int *)0); }
#undef wins_nwstr
int wins_nwstr(
- WINDOW *win,
- const wchar_t *wstr,
+ WINDOW *win,
+ const wchar_t *wstr,
int n)
{ return(*(int *)0); }
@@ -3321,14 +3333,14 @@ int wins_nwstr(
#undef winnwstr
int winnwstr(
- WINDOW *win,
- wchar_t *wstr,
+ WINDOW *win,
+ wchar_t *wstr,
int n)
{ return(*(int *)0); }
#undef winwstr
int winwstr(
- WINDOW *win,
+ WINDOW *win,
wchar_t *wstr)
{ return(*(int *)0); }
@@ -3343,7 +3355,7 @@ const char *key_name(
#undef pecho_wchar
int pecho_wchar(
- WINDOW *pad,
+ WINDOW *pad,
const cchar_t *wch)
{ return(*(int *)0); }
@@ -3351,8 +3363,8 @@ int pecho_wchar(
#undef slk_wset
int slk_wset(
- int i,
- const wchar_t *astr,
+ int i,
+ const wchar_t *astr,
int format)
{ return(*(int *)0); }
@@ -3360,14 +3372,14 @@ int slk_wset(
#undef _nc_wcrtomb
size_t _nc_wcrtomb(
- char *target,
- wchar_t source,
+ char *target,
+ wchar_t source,
mbstate_t *state)
{ return(*(size_t *)0); }
#undef unget_wch_sp
int unget_wch_sp(
- SCREEN *sp,
+ SCREEN *sp,
const wchar_t wch)
{ return(*(int *)0); }
@@ -3380,33 +3392,33 @@ int unget_wch(
#undef vid_puts_sp
int vid_puts_sp(
- SCREEN *sp,
- attr_t newmode,
- short pair_arg,
- void *opts,
+ SCREEN *sp,
+ attr_t newmode,
+ short pair_arg,
+ void *opts,
NCURSES_OUTC_sp outc)
{ return(*(int *)0); }
#undef vid_puts
int vid_puts(
- attr_t newmode,
- short pair_arg,
- void *opts,
+ attr_t newmode,
+ short pair_arg,
+ void *opts,
NCURSES_OUTC outc)
{ return(*(int *)0); }
#undef vid_attr_sp
int vid_attr_sp(
- SCREEN *sp,
- attr_t newmode,
- short pair_arg,
+ SCREEN *sp,
+ attr_t newmode,
+ short pair_arg,
void *opts)
{ return(*(int *)0); }
#undef vid_attr
int vid_attr(
- attr_t newmode,
- short pair_arg,
+ attr_t newmode,
+ short pair_arg,
void *opts)
{ return(*(int *)0); }
@@ -3423,8 +3435,8 @@ attr_t term_attrs(void)
#undef wvline_set
int wvline_set(
- WINDOW *win,
- const cchar_t *ch,
+ WINDOW *win,
+ const cchar_t *ch,
int n)
{ return(*(int *)0); }
@@ -3441,7 +3453,7 @@ void _nc_init_wacs(void)
#undef wunctrl_sp
wchar_t *wunctrl_sp(
- SCREEN *sp,
+ SCREEN *sp,
cchar_t *wc)
{ return(*(wchar_t **)0); }
@@ -3454,31 +3466,31 @@ wchar_t *wunctrl(
#undef _nc_toggle_attr_on
void _nc_toggle_attr_on(
- attr_t *S,
+ attr_t *S,
attr_t at)
{ /* void */ }
#undef _nc_toggle_attr_off
void _nc_toggle_attr_off(
- attr_t *S,
+ attr_t *S,
attr_t at)
{ /* void */ }
#undef _nc_DelCharCost_sp
int _nc_DelCharCost_sp(
- SCREEN *sp,
+ SCREEN *sp,
int count)
{ return(*(int *)0); }
#undef _nc_InsCharCost_sp
int _nc_InsCharCost_sp(
- SCREEN *sp,
+ SCREEN *sp,
int count)
{ return(*(int *)0); }
#undef _nc_UpdateAttrs_sp
void _nc_UpdateAttrs_sp(
- SCREEN *sp,
+ SCREEN *sp,
const cchar_t *c)
{ /* void */ }
@@ -3501,7 +3513,7 @@ void _nc_UpdateAttrs(
#undef use_legacy_coding_sp
int use_legacy_coding_sp(
- SCREEN *sp,
+ SCREEN *sp,
int level)
{ return(*(int *)0); }
@@ -3523,14 +3535,14 @@ int use_default_colors(void)
#undef assume_default_colors_sp
int assume_default_colors_sp(
- SCREEN *sp,
- int fg,
+ SCREEN *sp,
+ int fg,
int bg)
{ return(*(int *)0); }
#undef assume_default_colors
int assume_default_colors(
- int fg,
+ int fg,
int bg)
{ return(*(int *)0); }
@@ -3538,14 +3550,14 @@ int assume_default_colors(
#undef mcprint_sp
int mcprint_sp(
- SCREEN *sp,
- char *data,
+ SCREEN *sp,
+ char *data,
int len)
{ return(*(int *)0); }
#undef mcprint
int mcprint(
- char *data,
+ char *data,
int len)
{ return(*(int *)0); }
@@ -3558,55 +3570,55 @@ void _nc_free_ordered_pairs(
#undef _nc_reset_color_pair
void _nc_reset_color_pair(
- SCREEN *sp,
- int pair,
+ SCREEN *sp,
+ int pair,
colorpair_t *next)
{ /* void */ }
#undef _nc_set_color_pair
void _nc_set_color_pair(
- SCREEN *sp,
- int pair,
+ SCREEN *sp,
+ int pair,
int mode)
{ /* void */ }
#undef _nc_copy_pairs
void _nc_copy_pairs(
- SCREEN *sp,
- colorpair_t *target,
- colorpair_t *source,
+ SCREEN *sp,
+ colorpair_t *target,
+ colorpair_t *source,
int length)
{ /* void */ }
#undef alloc_pair_sp
int alloc_pair_sp(
- SCREEN *sp,
- int fg,
+ SCREEN *sp,
+ int fg,
int bg)
{ return(*(int *)0); }
#undef find_pair_sp
int find_pair_sp(
- SCREEN *sp,
- int fg,
+ SCREEN *sp,
+ int fg,
int bg)
{ return(*(int *)0); }
#undef free_pair_sp
int free_pair_sp(
- SCREEN *sp,
+ SCREEN *sp,
int pair)
{ return(*(int *)0); }
#undef alloc_pair
int alloc_pair(
- int f,
+ int f,
int b)
{ return(*(int *)0); }
#undef find_pair
int find_pair(
- int f,
+ int f,
int b)
{ return(*(int *)0); }
@@ -3619,40 +3631,40 @@ int free_pair(
#undef is_term_resized_sp
NCURSES_BOOL is_term_resized_sp(
- SCREEN *sp,
- int ToLines,
+ SCREEN *sp,
+ int ToLines,
int ToCols)
{ return(*(NCURSES_BOOL *)0); }
#undef is_term_resized
NCURSES_BOOL is_term_resized(
- int ToLines,
+ int ToLines,
int ToCols)
{ return(*(NCURSES_BOOL *)0); }
#undef resize_term_sp
int resize_term_sp(
- SCREEN *sp,
- int ToLines,
+ SCREEN *sp,
+ int ToLines,
int ToCols)
{ return(*(int *)0); }
#undef resize_term
int resize_term(
- int ToLines,
+ int ToLines,
int ToCols)
{ return(*(int *)0); }
#undef resizeterm_sp
int resizeterm_sp(
- SCREEN *sp,
- int ToLines,
+ SCREEN *sp,
+ int ToLines,
int ToCols)
{ return(*(int *)0); }
#undef resizeterm
int resizeterm(
- int ToLines,
+ int ToLines,
int ToCols)
{ return(*(int *)0); }
@@ -3667,8 +3679,8 @@ void _nc_trace_xnames(
#undef use_screen
int use_screen(
- SCREEN *screen,
- NCURSES_SCREEN_CB func,
+ SCREEN *screen,
+ NCURSES_SCREEN_CB func,
void *data)
{ return(*(int *)0); }
@@ -3676,8 +3688,8 @@ int use_screen(
#undef use_window
int use_window(
- WINDOW *win,
- NCURSES_WINDOW_CB func,
+ WINDOW *win,
+ NCURSES_WINDOW_CB func,
void *data)
{ return(*(int *)0); }
@@ -3685,8 +3697,8 @@ int use_window(
#undef wresize
int wresize(
- WINDOW *win,
- int ToLines,
+ WINDOW *win,
+ int ToLines,
int ToCols)
{ return(*(int *)0); }
@@ -3714,7 +3726,7 @@ char *_nc_basename(
#undef _nc_access
int _nc_access(
- const char *path,
+ const char *path,
int mode)
{ return(*(int *)0); }
@@ -3732,12 +3744,25 @@ NCURSES_BOOL _nc_is_file_path(
int _nc_env_access(void)
{ return(*(int *)0); }
+#undef _nc_safe_fopen
+FILE *_nc_safe_fopen(
+ const char *path,
+ const char *mode)
+ { return(*(FILE **)0); }
+
+#undef _nc_safe_open3
+int _nc_safe_open3(
+ const char *path,
+ int flags,
+ mode_t mode)
+ { return(*(int *)0); }
+
/* ./tinfo/add_tries.c */
#undef _nc_add_to_try
int _nc_add_to_try(
- TRIES **tree,
- const char *str,
+ TRIES **tree,
+ const char *str,
unsigned code)
{ return(*(int *)0); }
@@ -3745,25 +3770,25 @@ int _nc_add_to_try(
#undef _nc_align_termtype
void _nc_align_termtype(
- TERMTYPE2 *to,
+ TERMTYPE2 *to,
TERMTYPE2 *from)
{ /* void */ }
#undef _nc_copy_termtype
void _nc_copy_termtype(
- TERMTYPE *dst,
+ TERMTYPE *dst,
const TERMTYPE *src)
{ /* void */ }
#undef _nc_copy_termtype2
void _nc_copy_termtype2(
- TERMTYPE2 *dst,
+ TERMTYPE2 *dst,
const TERMTYPE2 *src)
{ /* void */ }
#undef _nc_export_termtype2
void _nc_export_termtype2(
- TERMTYPE *dst,
+ TERMTYPE *dst,
const TERMTYPE2 *src)
{ /* void */ }
@@ -3828,19 +3853,19 @@ void _nc_get_type(
#undef _nc_warning
void _nc_warning(
- const char *const fmt,
+ const char *const fmt,
...)
{ /* void */ }
#undef _nc_err_abort
void _nc_err_abort(
- const char *const fmt,
+ const char *const fmt,
...)
{ /* void */ }
#undef _nc_syserr_abort
void _nc_syserr_abort(
- const char *const fmt,
+ const char *const fmt,
...)
{ /* void */ }
@@ -3848,14 +3873,14 @@ void _nc_syserr_abort(
#undef _nc_find_entry
struct name_table_entry const *_nc_find_entry(
- const char *string,
+ 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,
+ const char *string,
+ int type,
NCURSES_BOOL termcap)
{ return(*(struct name_table_entry const **)0); }
@@ -3892,13 +3917,13 @@ void _nc_last_db(void)
#undef _nc_next_db
const char *_nc_next_db(
- DBDIRS *state,
+ DBDIRS *state,
int *offset)
{ return(*(const char **)0); }
#undef _nc_first_db
void _nc_first_db(
- DBDIRS *state,
+ DBDIRS *state,
int *offset)
{ /* void */ }
@@ -3906,7 +3931,7 @@ void _nc_first_db(
#undef _nc_doalloc
void *_nc_doalloc(
- void *oldp,
+ void *oldp,
size_t amount)
{ return(*(void **)0); }
@@ -3919,7 +3944,7 @@ ENTRY *_nc_tail;
#undef _nc_free_entry
void _nc_free_entry(
- ENTRY *headp,
+ ENTRY *headp,
TERMTYPE2 *tterm)
{ /* void */ }
@@ -3956,6 +3981,11 @@ void _nc_free_termtype(
TERMTYPE *ptr)
{ /* void */ }
+#undef _nc_free_termtype1
+void _nc_free_termtype1(
+ TERMTYPE *ptr)
+ { /* void */ }
+
#undef _nc_free_termtype2
void _nc_free_termtype2(
TERMTYPE2 *ptr)
@@ -3978,7 +4008,7 @@ int _nc_getenv_num(
#undef _nc_setenv_num
void _nc_setenv_num(
- const char *name,
+ const char *name,
int value)
{ /* void */ }
@@ -4012,8 +4042,8 @@ void _nc_init_acs(void)
/* ./tinfo/lib_baudrate.c */
struct speed {
- int given_speed;
- int actual_speed;
+ int given_speed;
+ int actual_speed;
};
#undef _nc_baudrate
@@ -4042,7 +4072,7 @@ TERMINAL *cur_term;
#undef set_curterm_sp
TERMINAL *set_curterm_sp(
- SCREEN *sp,
+ SCREEN *sp,
TERMINAL *termp)
{ return(*(TERMINAL **)0); }
@@ -4053,7 +4083,7 @@ TERMINAL *set_curterm(
#undef del_curterm_sp
int del_curterm_sp(
- SCREEN *sp,
+ SCREEN *sp,
TERMINAL *termp)
{ return(*(int *)0); }
@@ -4139,7 +4169,7 @@ struct kn { short offset; int code; };
#undef keyname_sp
const char *keyname_sp(
- SCREEN *sp,
+ SCREEN *sp,
int c)
{ return(*(const char **)0); }
@@ -4163,7 +4193,7 @@ char *longname(void)
#undef napms_sp
int napms_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ms)
{ return(*(int *)0); }
@@ -4176,19 +4206,19 @@ int napms(
#undef idlok
int idlok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef idcok
void idcok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ /* void */ }
#undef halfdelay_sp
int halfdelay_sp(
- SCREEN *sp,
+ SCREEN *sp,
int t)
{ return(*(int *)0); }
@@ -4199,37 +4229,37 @@ int halfdelay(
#undef nodelay
int nodelay(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef notimeout
int notimeout(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL f)
{ return(*(int *)0); }
#undef wtimeout
void wtimeout(
- WINDOW *win,
+ WINDOW *win,
int delay)
{ /* void */ }
#undef keypad
int keypad(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef meta
int meta(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef curs_set_sp
int curs_set_sp(
- SCREEN *sp,
+ SCREEN *sp,
int vis)
{ return(*(int *)0); }
@@ -4240,7 +4270,7 @@ int curs_set(
#undef typeahead_sp
int typeahead_sp(
- SCREEN *sp,
+ SCREEN *sp,
int fd)
{ return(*(int *)0); }
@@ -4251,7 +4281,7 @@ int typeahead(
#undef has_key_sp
int has_key_sp(
- SCREEN *sp,
+ SCREEN *sp,
int keycode)
{ return(*(int *)0); }
@@ -4262,14 +4292,14 @@ int has_key(
#undef _nc_putp_flush_sp
int _nc_putp_flush_sp(
- SCREEN *sp,
- const char *name,
+ SCREEN *sp,
+ const char *name,
const char *value)
{ return(*(int *)0); }
#undef _nc_keypad
int _nc_keypad(
- SCREEN *sp,
+ SCREEN *sp,
int flag)
{ return(*(int *)0); }
@@ -4331,17 +4361,53 @@ void noqiflush(void)
#undef intrflush_sp
int intrflush_sp(
- SCREEN *sp,
- WINDOW *win,
+ SCREEN *sp,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef intrflush
int intrflush(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
+#undef is_nl_sp
+int is_nl_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_raw_sp
+int is_raw_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_cbreak_sp
+int is_cbreak_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_echo_sp
+int is_echo_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_nl
+int is_nl(void)
+ { return(*(int *)0); }
+
+#undef is_raw
+int is_raw(void)
+ { return(*(int *)0); }
+
+#undef is_cbreak
+int is_cbreak(void)
+ { return(*(int *)0); }
+
+#undef is_echo
+int is_echo(void)
+ { return(*(int *)0); }
+
/* ./tinfo/lib_setup.c */
#undef ttytype
@@ -4355,7 +4421,7 @@ int TABSIZE;
#undef set_tabsize_sp
int set_tabsize_sp(
- SCREEN *sp,
+ SCREEN *sp,
int value)
{ return(*(int *)0); }
@@ -4371,13 +4437,13 @@ int _nc_handle_sigwinch(
#undef use_env_sp
void use_env_sp(
- SCREEN *sp,
+ SCREEN *sp,
NCURSES_BOOL f)
{ /* void */ }
#undef use_tioctl_sp
void use_tioctl_sp(
- SCREEN *sp,
+ SCREEN *sp,
NCURSES_BOOL f)
{ /* void */ }
@@ -4393,8 +4459,8 @@ void use_tioctl(
#undef _nc_get_screensize
void _nc_get_screensize(
- SCREEN *sp,
- int *linep,
+ SCREEN *sp,
+ int *linep,
int *colp)
{ /* void */ }
@@ -4405,13 +4471,13 @@ void _nc_update_screensize(
#undef _nc_setup_tinfo
int _nc_setup_tinfo(
- const char *const tn,
+ const char *const tn,
TERMTYPE2 *const tp)
{ return(*(int *)0); }
#undef _nc_tinfo_cmdch
void _nc_tinfo_cmdch(
- TERMINAL *termp,
+ TERMINAL *termp,
int proto)
{ /* void */ }
@@ -4430,9 +4496,9 @@ int _nc_locale_breaks_acs(
#undef _nc_setupterm
int _nc_setupterm(
- const char *tname,
- int Filedes,
- int *errret,
+ const char *tname,
+ int Filedes,
+ int *errret,
int reuse)
{ return(*(int *)0); }
@@ -4442,8 +4508,8 @@ SCREEN *new_prescr(void)
#undef setupterm
int setupterm(
- const char *tname,
- int Filedes,
+ const char *tname,
+ int Filedes,
int *errret)
{ return(*(int *)0); }
@@ -4456,20 +4522,20 @@ char *BC;
#undef tgetent_sp
int tgetent_sp(
- SCREEN *sp,
- char *bufp,
+ SCREEN *sp,
+ char *bufp,
const char *name)
{ return(*(int *)0); }
#undef tgetent
int tgetent(
- char *bufp,
+ char *bufp,
const char *name)
{ return(*(int *)0); }
#undef tgetflag_sp
int tgetflag_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *id)
{ return(*(int *)0); }
@@ -4480,7 +4546,7 @@ int tgetflag(
#undef tgetnum_sp
int tgetnum_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *id)
{ return(*(int *)0); }
@@ -4491,14 +4557,14 @@ int tgetnum(
#undef tgetstr_sp
char *tgetstr_sp(
- SCREEN *sp,
- const char *id,
+ SCREEN *sp,
+ const char *id,
char **area)
{ return(*(char **)0); }
#undef tgetstr
char *tgetstr(
- const char *id,
+ const char *id,
char **area)
{ return(*(char **)0); }
@@ -4517,8 +4583,8 @@ char *termname(void)
#undef tgoto
char *tgoto(
- const char *string,
- int x,
+ const char *string,
+ int x,
int y)
{ return(*(char **)0); }
@@ -4526,7 +4592,7 @@ char *tgoto(
#undef tigetflag_sp
int tigetflag_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(int *)0); }
@@ -4537,7 +4603,7 @@ int tigetflag(
#undef tigetnum_sp
int tigetnum_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(int *)0); }
@@ -4548,7 +4614,7 @@ int tigetnum(
#undef tigetstr_sp
char *tigetstr_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(char **)0); }
@@ -4562,32 +4628,58 @@ char *tigetstr(
#undef _nc_tparm_err
int _nc_tparm_err;
+#undef _nc_free_tparm
+void _nc_free_tparm(
+ TERMINAL *termp)
+ { /* void */ }
+
#undef _nc_tparm_analyze
int _nc_tparm_analyze(
- const char *string,
- char *p_is_s[9],
+ TERMINAL *term,
+ const char *string,
+ char **p_is_s,
int *_nc_popcount)
{ return(*(int *)0); }
#undef tparm
char *tparm(
- const char *string,
+ const char *string,
...)
{ return(*(char **)0); }
#undef tiparm
char *tiparm(
- const char *string,
+ const char *string,
+ ...)
+ { return(*(char **)0); }
+
+#undef tiparm_s
+char *tiparm_s(
+ int num_expected,
+ int tparm_type,
+ const char *string,
...)
{ return(*(char **)0); }
+#undef tiscan_s
+int tiscan_s(
+ int *num_expected,
+ int *tparm_type,
+ const char *string)
+ { return(*(int *)0); }
+
#undef _nc_tiparm
char *_nc_tiparm(
- int expected,
- const char *string,
+ int expected,
+ const char *string,
...)
{ return(*(char **)0); }
+#undef _nc_reset_tparm
+void _nc_reset_tparm(
+ TERMINAL *term)
+ { /* void */ }
+
/* ./tinfo/lib_tputs.c */
#undef PC
@@ -4604,7 +4696,7 @@ void _nc_set_no_padding(
#undef delay_output_sp
int delay_output_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ms)
{ return(*(int *)0); }
@@ -4624,7 +4716,7 @@ void _nc_flush(void)
#undef _nc_outch_sp
int _nc_outch_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ch)
{ return(*(int *)0); }
@@ -4635,7 +4727,7 @@ int _nc_outch(
#undef _nc_putchar_sp
int _nc_putchar_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ch)
{ return(*(int *)0); }
@@ -4646,7 +4738,7 @@ int _nc_putchar(
#undef putp_sp
int putp_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *string)
{ return(*(int *)0); }
@@ -4657,35 +4749,35 @@ int putp(
#undef _nc_putp_sp
int _nc_putp_sp(
- SCREEN *sp,
- const char *name,
+ SCREEN *sp,
+ const char *name,
const char *string)
{ return(*(int *)0); }
#undef _nc_putp
int _nc_putp(
- const char *name,
+ const char *name,
const char *string)
{ return(*(int *)0); }
#undef tputs_sp
int tputs_sp(
- SCREEN *sp,
- const char *string,
- int affcnt,
+ SCREEN *sp,
+ const char *string,
+ int affcnt,
NCURSES_OUTC_sp outc)
{ return(*(int *)0); }
#undef _nc_outc_wrapper
int _nc_outc_wrapper(
- SCREEN *sp,
+ SCREEN *sp,
int c)
{ return(*(int *)0); }
#undef tputs
int tputs(
- const char *string,
- int affcnt,
+ const char *string,
+ int affcnt,
int (*outc)(
int p1))
{ return(*(int *)0); }
@@ -4711,7 +4803,7 @@ void trace(
#undef _tracef
void _tracef(
- const char *fmt,
+ const char *fmt,
...)
{ /* void */ }
@@ -4767,8 +4859,8 @@ WINDOW *_nc_retrace_win(
#undef _nc_fmt_funcptr
char *_nc_fmt_funcptr(
- char *target,
- const char *source,
+ char *target,
+ const char *source,
size_t size)
{ return(*(char **)0); }
@@ -4776,7 +4868,7 @@ char *_nc_fmt_funcptr(
#undef _traceattr2
char *_traceattr2(
- int bufnum,
+ int bufnum,
chtype newmode)
{ return(*(char **)0); }
@@ -4797,13 +4889,13 @@ attr_t _nc_retrace_attr_t(
#undef _nc_altcharset_name
const char *_nc_altcharset_name(
- attr_t attr,
+ attr_t attr,
chtype ch)
{ return(*(const char **)0); }
#undef _tracechtype2
char *_tracechtype2(
- int bufnum,
+ int bufnum,
chtype ch)
{ return(*(char **)0); }
@@ -4819,7 +4911,7 @@ chtype _nc_retrace_chtype(
#undef _tracecchar_t2
char *_tracecchar_t2(
- int bufnum,
+ int bufnum,
const cchar_t *ch)
{ return(*(char **)0); }
@@ -4832,7 +4924,7 @@ char *_tracecchar_t(
#undef _nc_trace_ttymode
char *_nc_trace_ttymode(
- struct termios *tty)
+ const struct termios *tty)
{ return(*(char **)0); }
#undef _nc_tracebits
@@ -4843,7 +4935,7 @@ char *_nc_tracebits(void)
#undef _nc_tracechar
char *_nc_tracechar(
- SCREEN *sp,
+ SCREEN *sp,
int ch)
{ return(*(char **)0); }
@@ -4856,7 +4948,7 @@ char *_tracechar(
#undef _nc_get_tty_mode_sp
int _nc_get_tty_mode_sp(
- SCREEN *sp,
+ SCREEN *sp,
struct termios *buf)
{ return(*(int *)0); }
@@ -4867,7 +4959,7 @@ int _nc_get_tty_mode(
#undef _nc_set_tty_mode_sp
int _nc_set_tty_mode_sp(
- SCREEN *sp,
+ SCREEN *sp,
struct termios *buf)
{ return(*(int *)0); }
@@ -4934,9 +5026,9 @@ int resetty(void)
#undef _nc_timed_wait
int _nc_timed_wait(
- SCREEN *sp,
- int mode,
- int milliseconds,
+ SCREEN *sp,
+ int mode,
+ int milliseconds,
int *timeleft)
{ return(*(int *)0); }
@@ -4949,8 +5041,8 @@ char *_nc_first_name(
#undef _nc_name_match
int _nc_name_match(
- const char *const namelst,
- const char *const name,
+ const char *const namelst,
+ const char *const name,
const char *const delim)
{ return(*(int *)0); }
@@ -4973,14 +5065,14 @@ const char *const strfnames[] = {0};
#undef _nc_set_buffer_sp
void _nc_set_buffer_sp(
- SCREEN *sp,
- FILE *ofp,
+ SCREEN *sp,
+ FILE *ofp,
int buffered)
{ /* void */ }
#undef _nc_set_buffer
void _nc_set_buffer(
- FILE *ofp,
+ FILE *ofp,
int buffered)
{ /* void */ }
@@ -4993,28 +5085,28 @@ void _nc_init_termtype(
#undef _nc_read_termtype
int _nc_read_termtype(
- TERMTYPE2 *ptr,
- char *buffer,
+ TERMTYPE2 *ptr,
+ char *buffer,
int limit)
{ return(*(int *)0); }
#undef _nc_read_file_entry
int _nc_read_file_entry(
- const char *const filename,
+ const char *const filename,
TERMTYPE2 *ptr)
{ return(*(int *)0); }
#undef _nc_read_entry2
int _nc_read_entry2(
- const char *const name,
- char *const filename,
+ const char *const name,
+ char *const filename,
TERMTYPE2 *const tp)
{ return(*(int *)0); }
#undef _nc_read_entry
int _nc_read_entry(
- const char *const name,
- char *const filename,
+ const char *const name,
+ char *const filename,
TERMTYPE *const tp)
{ return(*(int *)0); }
@@ -5022,7 +5114,7 @@ int _nc_read_entry(
#undef _nc_read_termcap_entry
int _nc_read_termcap_entry(
- const char *const tn,
+ const char *const tn,
TERMTYPE2 *const tp)
{ return(*(int *)0); }
@@ -5030,32 +5122,32 @@ int _nc_read_termcap_entry(
#undef _nc_str_init
string_desc *_nc_str_init(
- string_desc *dst,
- char *src,
+ string_desc *dst,
+ char *src,
size_t len)
{ return(*(string_desc **)0); }
#undef _nc_str_null
string_desc *_nc_str_null(
- string_desc *dst,
+ string_desc *dst,
size_t len)
{ return(*(string_desc **)0); }
#undef _nc_str_copy
string_desc *_nc_str_copy(
- string_desc *dst,
- string_desc *src)
+ string_desc *dst,
+ const string_desc *const src)
{ return(*(string_desc **)0); }
#undef _nc_safe_strcat
NCURSES_BOOL _nc_safe_strcat(
- string_desc *dst,
+ string_desc *dst,
const char *src)
{ return(*(NCURSES_BOOL *)0); }
#undef _nc_safe_strcpy
NCURSES_BOOL _nc_safe_strcpy(
- string_desc *dst,
+ string_desc *dst,
const char *src)
{ return(*(NCURSES_BOOL *)0); }
@@ -5063,13 +5155,13 @@ NCURSES_BOOL _nc_safe_strcpy(
#undef _nc_trace_buf
char *_nc_trace_buf(
- int bufnum,
+ int bufnum,
size_t want)
{ return(*(char **)0); }
#undef _nc_trace_bufcat
char *_nc_trace_bufcat(
- int bufnum,
+ int bufnum,
const char *value)
{ return(*(char **)0); }
@@ -5084,21 +5176,21 @@ void _nc_trace_tries(
#undef _nc_expand_try
char *_nc_expand_try(
- TRIES *tree,
- unsigned code,
- int *count,
+ TRIES *tree,
+ unsigned code,
+ int *count,
size_t len)
{ return(*(char **)0); }
#undef _nc_remove_key
int _nc_remove_key(
- TRIES **tree,
+ TRIES **tree,
unsigned code)
{ return(*(int *)0); }
#undef _nc_remove_string
int _nc_remove_string(
- TRIES **tree,
+ TRIES **tree,
const char *string)
{ return(*(int *)0); }
@@ -5113,7 +5205,7 @@ char *_nc_trim_sgr0(
#undef unctrl_sp
const char *unctrl_sp(
- SCREEN *sp,
+ SCREEN *sp,
chtype ch)
{ return(*(const char **)0); }
@@ -5126,7 +5218,7 @@ const char *unctrl(
#undef _nc_visbuf2
const char *_nc_visbuf2(
- int bufnum,
+ int bufnum,
const char *buf)
{ return(*(const char **)0); }
@@ -5137,13 +5229,13 @@ const char *_nc_visbuf(
#undef _nc_visbufn
const char *_nc_visbufn(
- const char *buf,
+ const char *buf,
int len)
{ return(*(const char **)0); }
#undef _nc_viswbuf2
const char *_nc_viswbuf2(
- int bufnum,
+ int bufnum,
const wchar_t *buf)
{ return(*(const char **)0); }
@@ -5154,7 +5246,7 @@ const char *_nc_viswbuf(
#undef _nc_viswbufn
const char *_nc_viswbufn(
- const wchar_t *buf,
+ const wchar_t *buf,
int len)
{ return(*(const char **)0); }
@@ -5165,14 +5257,14 @@ const char *_nc_viswibuf(
#undef _nc_viscbuf2
const char *_nc_viscbuf2(
- int bufnum,
- const cchar_t *buf,
+ int bufnum,
+ const cchar_t *buf,
int len)
{ return(*(const char **)0); }
#undef _nc_viscbuf
const char *_nc_viscbuf(
- const cchar_t *buf,
+ const cchar_t *buf,
int len)
{ return(*(const char **)0); }
@@ -5190,18 +5282,18 @@ ENTRY *_nc_copy_entry(
#undef _nc_save_str
char *_nc_save_str(
- const char *const string)
+ const char *string)
{ return(*(char **)0); }
#undef _nc_wrap_entry
void _nc_wrap_entry(
- ENTRY *const ep,
+ ENTRY *const ep,
NCURSES_BOOL copy_strings)
{ /* void */ }
#undef _nc_merge_entry
void _nc_merge_entry(
- ENTRY *const target,
+ ENTRY *const target,
ENTRY *const source)
{ /* void */ }
@@ -5209,15 +5301,15 @@ void _nc_merge_entry(
#undef _nc_captoinfo
char *_nc_captoinfo(
- const char *cap,
- const char *s,
+ const char *cap,
+ const char *s,
int const parameterized)
{ return(*(char **)0); }
#undef _nc_infotocap
char *_nc_infotocap(
- const char *cap,
- const char *str,
+ const char *cap,
+ const char *str,
int const parameterized)
{ return(*(char **)0); }
@@ -5225,8 +5317,8 @@ char *_nc_infotocap(
#undef _nc_tic_expand
char *_nc_tic_expand(
- const char *srcp,
- NCURSES_BOOL tic_format,
+ const char *srcp,
+ NCURSES_BOOL tic_format,
int numbers)
{ return(*(char **)0); }
@@ -5234,28 +5326,28 @@ char *_nc_tic_expand(
#undef _nc_check_termtype2
void (*_nc_check_termtype2)(
- TERMTYPE2 *p1,
+ TERMTYPE2 *p1,
NCURSES_BOOL p2);
#undef _nc_entry_match
NCURSES_BOOL _nc_entry_match(
- char *n1,
+ char *n1,
char *n2)
{ return(*(NCURSES_BOOL *)0); }
#undef _nc_read_entry_source
void _nc_read_entry_source(
- FILE *fp,
- char *buf,
- int literal,
- NCURSES_BOOL silent,
+ FILE *fp,
+ char *buf,
+ int literal,
+ NCURSES_BOOL silent,
NCURSES_BOOL (*hook)(
ENTRY *p1))
{ /* void */ }
#undef _nc_resolve_uses2
int _nc_resolve_uses2(
- NCURSES_BOOL fullresolve,
+ NCURSES_BOOL fullresolve,
NCURSES_BOOL literal)
{ return(*(int *)0); }
@@ -5280,7 +5372,7 @@ NCURSES_BOOL _nc_disable_period;
#undef _nc_reset_input
void _nc_reset_input(
- FILE *fp,
+ FILE *fp,
char *buf)
{ /* void */ }
@@ -5291,8 +5383,8 @@ int _nc_get_token(
#undef _nc_trans_string
int _nc_trans_string(
- char *ptr,
- char *last)
+ char *ptr,
+ const char *const last)
{ return(*(int *)0); }
#undef _nc_push_token
@@ -5309,14 +5401,14 @@ void _nc_panic_mode(
#undef _nc_parse_entry
int _nc_parse_entry(
- ENTRY *entryp,
- int literal,
+ ENTRY *entryp,
+ int literal,
NCURSES_BOOL silent)
{ return(*(int *)0); }
#undef _nc_capcmp
int _nc_capcmp(
- const char *s,
+ const char *s,
const char *t)
{ return(*(int *)0); }
@@ -5334,9 +5426,9 @@ void _nc_write_entry(
#undef _nc_write_object
int _nc_write_object(
- TERMTYPE2 *tp,
- char *buffer,
- unsigned *offset,
+ TERMTYPE2 *tp,
+ char *buffer,
+ unsigned *offset,
unsigned limit)
{ return(*(int *)0); }
@@ -5348,14 +5440,14 @@ int _nc_tic_written(void)
#undef define_key_sp
int define_key_sp(
- SCREEN *sp,
- const char *str,
+ SCREEN *sp,
+ const char *str,
int keycode)
{ return(*(int *)0); }
#undef define_key
int define_key(
- const char *str,
+ const char *str,
int keycode)
{ return(*(int *)0); }
@@ -5369,7 +5461,7 @@ void _nc_hashed_db(void)
#undef key_defined_sp
int key_defined_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(int *)0); }
@@ -5382,14 +5474,14 @@ int key_defined(
#undef keybound_sp
char *keybound_sp(
- SCREEN *sp,
- int code,
+ SCREEN *sp,
+ int code,
int count)
{ return(*(char **)0); }
#undef keybound
char *keybound(
- int code,
+ int code,
int count)
{ return(*(char **)0); }
@@ -5397,14 +5489,14 @@ char *keybound(
#undef keyok_sp
int keyok_sp(
- SCREEN *sp,
- int c,
+ SCREEN *sp,
+ int c,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef keyok
int keyok(
- int c,
+ int c,
NCURSES_BOOL flag)
{ return(*(int *)0); }
diff --git a/ncurses/llib-ltic b/ncurses/llib-ltic
index 6ea27146dd09..9e87aaeae4a6 100644
--- a/ncurses/llib-ltic
+++ b/ncurses/llib-ltic
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020-2021,2023 Thomas E. Dickey *
* Copyright 2012-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -48,18 +48,18 @@ ENTRY *_nc_copy_entry(
#undef _nc_save_str
char *_nc_save_str(
- const char *const string)
+ const char *string)
{ return(*(char **)0); }
#undef _nc_wrap_entry
void _nc_wrap_entry(
- ENTRY *const ep,
+ ENTRY *const ep,
NCURSES_BOOL copy_strings)
{ /* void */ }
#undef _nc_merge_entry
void _nc_merge_entry(
- ENTRY *const target,
+ ENTRY *const target,
ENTRY *const source)
{ /* void */ }
@@ -67,15 +67,15 @@ void _nc_merge_entry(
#undef _nc_captoinfo
char *_nc_captoinfo(
- const char *cap,
- const char *s,
+ const char *cap,
+ const char *s,
int const parameterized)
{ return(*(char **)0); }
#undef _nc_infotocap
char *_nc_infotocap(
- const char *cap,
- const char *str,
+ const char *cap,
+ const char *str,
int const parameterized)
{ return(*(char **)0); }
@@ -83,8 +83,8 @@ char *_nc_infotocap(
#undef _nc_tic_expand
char *_nc_tic_expand(
- const char *srcp,
- NCURSES_BOOL tic_format,
+ const char *srcp,
+ NCURSES_BOOL tic_format,
int numbers)
{ return(*(char **)0); }
@@ -92,28 +92,28 @@ char *_nc_tic_expand(
#undef _nc_check_termtype2
void (*_nc_check_termtype2)(
- TERMTYPE2 *p1,
+ TERMTYPE *p1,
NCURSES_BOOL p2);
#undef _nc_entry_match
NCURSES_BOOL _nc_entry_match(
- char *n1,
+ char *n1,
char *n2)
{ return(*(NCURSES_BOOL *)0); }
#undef _nc_read_entry_source
void _nc_read_entry_source(
- FILE *fp,
- char *buf,
- int literal,
- NCURSES_BOOL silent,
+ FILE *fp,
+ char *buf,
+ int literal,
+ NCURSES_BOOL silent,
NCURSES_BOOL (*hook)(
ENTRY *p1))
{ /* void */ }
#undef _nc_resolve_uses2
int _nc_resolve_uses2(
- NCURSES_BOOL fullresolve,
+ NCURSES_BOOL fullresolve,
NCURSES_BOOL literal)
{ return(*(int *)0); }
@@ -138,7 +138,7 @@ NCURSES_BOOL _nc_disable_period;
#undef _nc_reset_input
void _nc_reset_input(
- FILE *fp,
+ FILE *fp,
char *buf)
{ /* void */ }
@@ -149,8 +149,8 @@ int _nc_get_token(
#undef _nc_trans_string
int _nc_trans_string(
- char *ptr,
- char *last)
+ char *ptr,
+ const char *const last)
{ return(*(int *)0); }
#undef _nc_push_token
@@ -167,14 +167,14 @@ void _nc_panic_mode(
#undef _nc_parse_entry
int _nc_parse_entry(
- ENTRY *entryp,
- int literal,
+ ENTRY *entryp,
+ int literal,
NCURSES_BOOL silent)
{ return(*(int *)0); }
#undef _nc_capcmp
int _nc_capcmp(
- const char *s,
+ const char *s,
const char *t)
{ return(*(int *)0); }
@@ -187,14 +187,14 @@ void _nc_set_writedir(
#undef _nc_write_entry
void _nc_write_entry(
- TERMTYPE2 *const tp)
+ TERMTYPE *const tp)
{ /* void */ }
#undef _nc_write_object
int _nc_write_object(
- TERMTYPE2 *tp,
- char *buffer,
- unsigned *offset,
+ TERMTYPE *tp,
+ char *buffer,
+ unsigned *offset,
unsigned limit)
{ return(*(int *)0); }
diff --git a/ncurses/llib-ltict b/ncurses/llib-ltict
index e1625df943e3..db9090b9125b 100644
--- a/ncurses/llib-ltict
+++ b/ncurses/llib-ltict
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020-2021,2023 Thomas E. Dickey *
* Copyright 2013-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -48,18 +48,18 @@ ENTRY *_nc_copy_entry(
#undef _nc_save_str
char *_nc_save_str(
- const char *const string)
+ const char *string)
{ return(*(char **)0); }
#undef _nc_wrap_entry
void _nc_wrap_entry(
- ENTRY *const ep,
+ ENTRY *const ep,
NCURSES_BOOL copy_strings)
{ /* void */ }
#undef _nc_merge_entry
void _nc_merge_entry(
- ENTRY *const target,
+ ENTRY *const target,
ENTRY *const source)
{ /* void */ }
@@ -67,15 +67,15 @@ void _nc_merge_entry(
#undef _nc_captoinfo
char *_nc_captoinfo(
- const char *cap,
- const char *s,
+ const char *cap,
+ const char *s,
int const parameterized)
{ return(*(char **)0); }
#undef _nc_infotocap
char *_nc_infotocap(
- const char *cap,
- const char *str,
+ const char *cap,
+ const char *str,
int const parameterized)
{ return(*(char **)0); }
@@ -83,8 +83,8 @@ char *_nc_infotocap(
#undef _nc_tic_expand
char *_nc_tic_expand(
- const char *srcp,
- NCURSES_BOOL tic_format,
+ const char *srcp,
+ NCURSES_BOOL tic_format,
int numbers)
{ return(*(char **)0); }
@@ -92,28 +92,28 @@ char *_nc_tic_expand(
#undef _nc_check_termtype2
void (*_nc_check_termtype2)(
- TERMTYPE2 *p1,
+ TERMTYPE *p1,
NCURSES_BOOL p2);
#undef _nc_entry_match
NCURSES_BOOL _nc_entry_match(
- char *n1,
+ char *n1,
char *n2)
{ return(*(NCURSES_BOOL *)0); }
#undef _nc_read_entry_source
void _nc_read_entry_source(
- FILE *fp,
- char *buf,
- int literal,
- NCURSES_BOOL silent,
+ FILE *fp,
+ char *buf,
+ int literal,
+ NCURSES_BOOL silent,
NCURSES_BOOL (*hook)(
ENTRY *p1))
{ /* void */ }
#undef _nc_resolve_uses2
int _nc_resolve_uses2(
- NCURSES_BOOL fullresolve,
+ NCURSES_BOOL fullresolve,
NCURSES_BOOL literal)
{ return(*(int *)0); }
@@ -138,7 +138,7 @@ NCURSES_BOOL _nc_disable_period;
#undef _nc_reset_input
void _nc_reset_input(
- FILE *fp,
+ FILE *fp,
char *buf)
{ /* void */ }
@@ -149,8 +149,8 @@ int _nc_get_token(
#undef _nc_trans_string
int _nc_trans_string(
- char *ptr,
- char *last)
+ char *ptr,
+ const char *const last)
{ return(*(int *)0); }
#undef _nc_push_token
@@ -167,14 +167,14 @@ void _nc_panic_mode(
#undef _nc_parse_entry
int _nc_parse_entry(
- ENTRY *entryp,
- int literal,
+ ENTRY *entryp,
+ int literal,
NCURSES_BOOL silent)
{ return(*(int *)0); }
#undef _nc_capcmp
int _nc_capcmp(
- const char *s,
+ const char *s,
const char *t)
{ return(*(int *)0); }
@@ -187,14 +187,14 @@ void _nc_set_writedir(
#undef _nc_write_entry
void _nc_write_entry(
- TERMTYPE2 *const tp)
+ TERMTYPE *const tp)
{ /* void */ }
#undef _nc_write_object
int _nc_write_object(
- TERMTYPE2 *tp,
- char *buffer,
- unsigned *offset,
+ TERMTYPE *tp,
+ char *buffer,
+ unsigned *offset,
unsigned limit)
{ return(*(int *)0); }
diff --git a/ncurses/llib-ltictw b/ncurses/llib-ltictw
index 6ea27146dd09..85db89bce08b 100644
--- a/ncurses/llib-ltictw
+++ b/ncurses/llib-ltictw
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020-2021,2023 Thomas E. Dickey *
* Copyright 2012-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -48,18 +48,18 @@ ENTRY *_nc_copy_entry(
#undef _nc_save_str
char *_nc_save_str(
- const char *const string)
+ const char *string)
{ return(*(char **)0); }
#undef _nc_wrap_entry
void _nc_wrap_entry(
- ENTRY *const ep,
+ ENTRY *const ep,
NCURSES_BOOL copy_strings)
{ /* void */ }
#undef _nc_merge_entry
void _nc_merge_entry(
- ENTRY *const target,
+ ENTRY *const target,
ENTRY *const source)
{ /* void */ }
@@ -67,15 +67,15 @@ void _nc_merge_entry(
#undef _nc_captoinfo
char *_nc_captoinfo(
- const char *cap,
- const char *s,
+ const char *cap,
+ const char *s,
int const parameterized)
{ return(*(char **)0); }
#undef _nc_infotocap
char *_nc_infotocap(
- const char *cap,
- const char *str,
+ const char *cap,
+ const char *str,
int const parameterized)
{ return(*(char **)0); }
@@ -83,8 +83,8 @@ char *_nc_infotocap(
#undef _nc_tic_expand
char *_nc_tic_expand(
- const char *srcp,
- NCURSES_BOOL tic_format,
+ const char *srcp,
+ NCURSES_BOOL tic_format,
int numbers)
{ return(*(char **)0); }
@@ -92,28 +92,28 @@ char *_nc_tic_expand(
#undef _nc_check_termtype2
void (*_nc_check_termtype2)(
- TERMTYPE2 *p1,
+ TERMTYPE2 *p1,
NCURSES_BOOL p2);
#undef _nc_entry_match
NCURSES_BOOL _nc_entry_match(
- char *n1,
+ char *n1,
char *n2)
{ return(*(NCURSES_BOOL *)0); }
#undef _nc_read_entry_source
void _nc_read_entry_source(
- FILE *fp,
- char *buf,
- int literal,
- NCURSES_BOOL silent,
+ FILE *fp,
+ char *buf,
+ int literal,
+ NCURSES_BOOL silent,
NCURSES_BOOL (*hook)(
ENTRY *p1))
{ /* void */ }
#undef _nc_resolve_uses2
int _nc_resolve_uses2(
- NCURSES_BOOL fullresolve,
+ NCURSES_BOOL fullresolve,
NCURSES_BOOL literal)
{ return(*(int *)0); }
@@ -138,7 +138,7 @@ NCURSES_BOOL _nc_disable_period;
#undef _nc_reset_input
void _nc_reset_input(
- FILE *fp,
+ FILE *fp,
char *buf)
{ /* void */ }
@@ -149,8 +149,8 @@ int _nc_get_token(
#undef _nc_trans_string
int _nc_trans_string(
- char *ptr,
- char *last)
+ char *ptr,
+ const char *const last)
{ return(*(int *)0); }
#undef _nc_push_token
@@ -167,14 +167,14 @@ void _nc_panic_mode(
#undef _nc_parse_entry
int _nc_parse_entry(
- ENTRY *entryp,
- int literal,
+ ENTRY *entryp,
+ int literal,
NCURSES_BOOL silent)
{ return(*(int *)0); }
#undef _nc_capcmp
int _nc_capcmp(
- const char *s,
+ const char *s,
const char *t)
{ return(*(int *)0); }
@@ -192,9 +192,9 @@ void _nc_write_entry(
#undef _nc_write_object
int _nc_write_object(
- TERMTYPE2 *tp,
- char *buffer,
- unsigned *offset,
+ TERMTYPE2 *tp,
+ char *buffer,
+ unsigned *offset,
unsigned limit)
{ return(*(int *)0); }
diff --git a/ncurses/llib-lticw b/ncurses/llib-lticw
index 6ea27146dd09..85db89bce08b 100644
--- a/ncurses/llib-lticw
+++ b/ncurses/llib-lticw
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020-2021,2023 Thomas E. Dickey *
* Copyright 2012-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -48,18 +48,18 @@ ENTRY *_nc_copy_entry(
#undef _nc_save_str
char *_nc_save_str(
- const char *const string)
+ const char *string)
{ return(*(char **)0); }
#undef _nc_wrap_entry
void _nc_wrap_entry(
- ENTRY *const ep,
+ ENTRY *const ep,
NCURSES_BOOL copy_strings)
{ /* void */ }
#undef _nc_merge_entry
void _nc_merge_entry(
- ENTRY *const target,
+ ENTRY *const target,
ENTRY *const source)
{ /* void */ }
@@ -67,15 +67,15 @@ void _nc_merge_entry(
#undef _nc_captoinfo
char *_nc_captoinfo(
- const char *cap,
- const char *s,
+ const char *cap,
+ const char *s,
int const parameterized)
{ return(*(char **)0); }
#undef _nc_infotocap
char *_nc_infotocap(
- const char *cap,
- const char *str,
+ const char *cap,
+ const char *str,
int const parameterized)
{ return(*(char **)0); }
@@ -83,8 +83,8 @@ char *_nc_infotocap(
#undef _nc_tic_expand
char *_nc_tic_expand(
- const char *srcp,
- NCURSES_BOOL tic_format,
+ const char *srcp,
+ NCURSES_BOOL tic_format,
int numbers)
{ return(*(char **)0); }
@@ -92,28 +92,28 @@ char *_nc_tic_expand(
#undef _nc_check_termtype2
void (*_nc_check_termtype2)(
- TERMTYPE2 *p1,
+ TERMTYPE2 *p1,
NCURSES_BOOL p2);
#undef _nc_entry_match
NCURSES_BOOL _nc_entry_match(
- char *n1,
+ char *n1,
char *n2)
{ return(*(NCURSES_BOOL *)0); }
#undef _nc_read_entry_source
void _nc_read_entry_source(
- FILE *fp,
- char *buf,
- int literal,
- NCURSES_BOOL silent,
+ FILE *fp,
+ char *buf,
+ int literal,
+ NCURSES_BOOL silent,
NCURSES_BOOL (*hook)(
ENTRY *p1))
{ /* void */ }
#undef _nc_resolve_uses2
int _nc_resolve_uses2(
- NCURSES_BOOL fullresolve,
+ NCURSES_BOOL fullresolve,
NCURSES_BOOL literal)
{ return(*(int *)0); }
@@ -138,7 +138,7 @@ NCURSES_BOOL _nc_disable_period;
#undef _nc_reset_input
void _nc_reset_input(
- FILE *fp,
+ FILE *fp,
char *buf)
{ /* void */ }
@@ -149,8 +149,8 @@ int _nc_get_token(
#undef _nc_trans_string
int _nc_trans_string(
- char *ptr,
- char *last)
+ char *ptr,
+ const char *const last)
{ return(*(int *)0); }
#undef _nc_push_token
@@ -167,14 +167,14 @@ void _nc_panic_mode(
#undef _nc_parse_entry
int _nc_parse_entry(
- ENTRY *entryp,
- int literal,
+ ENTRY *entryp,
+ int literal,
NCURSES_BOOL silent)
{ return(*(int *)0); }
#undef _nc_capcmp
int _nc_capcmp(
- const char *s,
+ const char *s,
const char *t)
{ return(*(int *)0); }
@@ -192,9 +192,9 @@ void _nc_write_entry(
#undef _nc_write_object
int _nc_write_object(
- TERMTYPE2 *tp,
- char *buffer,
- unsigned *offset,
+ TERMTYPE2 *tp,
+ char *buffer,
+ unsigned *offset,
unsigned limit)
{ return(*(int *)0); }
diff --git a/ncurses/llib-ltinfo b/ncurses/llib-ltinfo
index b2160d4f66b7..5cfa111a236d 100644
--- a/ncurses/llib-ltinfo
+++ b/ncurses/llib-ltinfo
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2019-2022,2023 Thomas E. Dickey *
* Copyright 2012-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -58,7 +58,7 @@ char *_nc_basename(
#undef _nc_access
int _nc_access(
- const char *path,
+ const char *path,
int mode)
{ return(*(int *)0); }
@@ -76,12 +76,25 @@ NCURSES_BOOL _nc_is_file_path(
int _nc_env_access(void)
{ return(*(int *)0); }
+#undef _nc_safe_fopen
+FILE *_nc_safe_fopen(
+ const char *path,
+ const char *mode)
+ { return(*(FILE **)0); }
+
+#undef _nc_safe_open3
+int _nc_safe_open3(
+ const char *path,
+ int flags,
+ mode_t mode)
+ { return(*(int *)0); }
+
/* ./tinfo/add_tries.c */
#undef _nc_add_to_try
int _nc_add_to_try(
- TRIES **tree,
- const char *str,
+ TRIES **tree,
+ const char *str,
unsigned code)
{ return(*(int *)0); }
@@ -89,13 +102,13 @@ int _nc_add_to_try(
#undef _nc_align_termtype
void _nc_align_termtype(
- TERMTYPE2 *to,
- TERMTYPE2 *from)
+ TERMTYPE *to,
+ TERMTYPE *from)
{ /* void */ }
#undef _nc_copy_termtype
void _nc_copy_termtype(
- TERMTYPE *dst,
+ TERMTYPE *dst,
const TERMTYPE *src)
{ /* void */ }
@@ -160,19 +173,19 @@ void _nc_get_type(
#undef _nc_warning
void _nc_warning(
- const char *const fmt,
+ const char *const fmt,
...)
{ /* void */ }
#undef _nc_err_abort
void _nc_err_abort(
- const char *const fmt,
+ const char *const fmt,
...)
{ /* void */ }
#undef _nc_syserr_abort
void _nc_syserr_abort(
- const char *const fmt,
+ const char *const fmt,
...)
{ /* void */ }
@@ -180,14 +193,14 @@ void _nc_syserr_abort(
#undef _nc_find_entry
struct name_table_entry const *_nc_find_entry(
- const char *string,
+ 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,
+ const char *string,
+ int type,
NCURSES_BOOL termcap)
{ return(*(struct name_table_entry const **)0); }
@@ -224,13 +237,13 @@ void _nc_last_db(void)
#undef _nc_next_db
const char *_nc_next_db(
- DBDIRS *state,
+ DBDIRS *state,
int *offset)
{ return(*(const char **)0); }
#undef _nc_first_db
void _nc_first_db(
- DBDIRS *state,
+ DBDIRS *state,
int *offset)
{ /* void */ }
@@ -238,7 +251,7 @@ void _nc_first_db(
#undef _nc_doalloc
void *_nc_doalloc(
- void *oldp,
+ void *oldp,
size_t amount)
{ return(*(void **)0); }
@@ -251,8 +264,8 @@ ENTRY *_nc_tail;
#undef _nc_free_entry
void _nc_free_entry(
- ENTRY *headp,
- TERMTYPE2 *tterm)
+ ENTRY *headp,
+ TERMTYPE *tterm)
{ /* void */ }
#undef _nc_free_entries
@@ -272,9 +285,9 @@ void exit_terminfo(
/* ./fallback.c */
#undef _nc_fallback
-const TERMTYPE2 *_nc_fallback(
+const TERMTYPE *_nc_fallback(
const char *name)
- { return(*(const TERMTYPE2 **)0); }
+ { return(*(const TERMTYPE **)0); }
/* ./tinfo/free_ttype.c */
@@ -283,6 +296,11 @@ void _nc_free_termtype(
TERMTYPE *ptr)
{ /* void */ }
+#undef _nc_free_termtype1
+void _nc_free_termtype1(
+ TERMTYPE *ptr)
+ { /* void */ }
+
#undef _nc_user_definable
NCURSES_BOOL _nc_user_definable;
@@ -300,7 +318,7 @@ int _nc_getenv_num(
#undef _nc_setenv_num
void _nc_setenv_num(
- const char *name,
+ const char *name,
int value)
{ /* void */ }
@@ -334,8 +352,8 @@ void _nc_init_acs(void)
/* ./tinfo/lib_baudrate.c */
struct speed {
- int given_speed;
- int actual_speed;
+ int given_speed;
+ int actual_speed;
};
#undef _nc_baudrate
@@ -364,7 +382,7 @@ TERMINAL *cur_term;
#undef set_curterm_sp
TERMINAL *set_curterm_sp(
- SCREEN *sp,
+ SCREEN *sp,
TERMINAL *termp)
{ return(*(TERMINAL **)0); }
@@ -375,7 +393,7 @@ TERMINAL *set_curterm(
#undef del_curterm_sp
int del_curterm_sp(
- SCREEN *sp,
+ SCREEN *sp,
TERMINAL *termp)
{ return(*(int *)0); }
@@ -461,7 +479,7 @@ struct kn { short offset; int code; };
#undef keyname_sp
const char *keyname_sp(
- SCREEN *sp,
+ SCREEN *sp,
int c)
{ return(*(const char **)0); }
@@ -485,7 +503,7 @@ char *longname(void)
#undef napms_sp
int napms_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ms)
{ return(*(int *)0); }
@@ -498,19 +516,19 @@ int napms(
#undef idlok
int idlok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef idcok
void idcok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ /* void */ }
#undef halfdelay_sp
int halfdelay_sp(
- SCREEN *sp,
+ SCREEN *sp,
int t)
{ return(*(int *)0); }
@@ -521,37 +539,37 @@ int halfdelay(
#undef nodelay
int nodelay(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef notimeout
int notimeout(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL f)
{ return(*(int *)0); }
#undef wtimeout
void wtimeout(
- WINDOW *win,
+ WINDOW *win,
int delay)
{ /* void */ }
#undef keypad
int keypad(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef meta
int meta(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef curs_set_sp
int curs_set_sp(
- SCREEN *sp,
+ SCREEN *sp,
int vis)
{ return(*(int *)0); }
@@ -562,7 +580,7 @@ int curs_set(
#undef typeahead_sp
int typeahead_sp(
- SCREEN *sp,
+ SCREEN *sp,
int fd)
{ return(*(int *)0); }
@@ -573,7 +591,7 @@ int typeahead(
#undef has_key_sp
int has_key_sp(
- SCREEN *sp,
+ SCREEN *sp,
int keycode)
{ return(*(int *)0); }
@@ -584,14 +602,14 @@ int has_key(
#undef _nc_putp_flush_sp
int _nc_putp_flush_sp(
- SCREEN *sp,
- const char *name,
+ SCREEN *sp,
+ const char *name,
const char *value)
{ return(*(int *)0); }
#undef _nc_keypad
int _nc_keypad(
- SCREEN *sp,
+ SCREEN *sp,
int flag)
{ return(*(int *)0); }
@@ -653,17 +671,53 @@ void noqiflush(void)
#undef intrflush_sp
int intrflush_sp(
- SCREEN *sp,
- WINDOW *win,
+ SCREEN *sp,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef intrflush
int intrflush(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
+#undef is_nl_sp
+int is_nl_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_raw_sp
+int is_raw_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_cbreak_sp
+int is_cbreak_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_echo_sp
+int is_echo_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_nl
+int is_nl(void)
+ { return(*(int *)0); }
+
+#undef is_raw
+int is_raw(void)
+ { return(*(int *)0); }
+
+#undef is_cbreak
+int is_cbreak(void)
+ { return(*(int *)0); }
+
+#undef is_echo
+int is_echo(void)
+ { return(*(int *)0); }
+
/* ./tinfo/lib_setup.c */
#undef ttytype
@@ -677,7 +731,7 @@ int TABSIZE;
#undef set_tabsize_sp
int set_tabsize_sp(
- SCREEN *sp,
+ SCREEN *sp,
int value)
{ return(*(int *)0); }
@@ -693,13 +747,13 @@ int _nc_handle_sigwinch(
#undef use_env_sp
void use_env_sp(
- SCREEN *sp,
+ SCREEN *sp,
NCURSES_BOOL f)
{ /* void */ }
#undef use_tioctl_sp
void use_tioctl_sp(
- SCREEN *sp,
+ SCREEN *sp,
NCURSES_BOOL f)
{ /* void */ }
@@ -715,8 +769,8 @@ void use_tioctl(
#undef _nc_get_screensize
void _nc_get_screensize(
- SCREEN *sp,
- int *linep,
+ SCREEN *sp,
+ int *linep,
int *colp)
{ /* void */ }
@@ -727,13 +781,13 @@ void _nc_update_screensize(
#undef _nc_setup_tinfo
int _nc_setup_tinfo(
- const char *const tn,
- TERMTYPE2 *const tp)
+ const char *const tn,
+ TERMTYPE *const tp)
{ return(*(int *)0); }
#undef _nc_tinfo_cmdch
void _nc_tinfo_cmdch(
- TERMINAL *termp,
+ TERMINAL *termp,
int proto)
{ /* void */ }
@@ -752,9 +806,9 @@ int _nc_locale_breaks_acs(
#undef _nc_setupterm
int _nc_setupterm(
- const char *tname,
- int Filedes,
- int *errret,
+ const char *tname,
+ int Filedes,
+ int *errret,
int reuse)
{ return(*(int *)0); }
@@ -764,8 +818,8 @@ SCREEN *new_prescr(void)
#undef setupterm
int setupterm(
- const char *tname,
- int Filedes,
+ const char *tname,
+ int Filedes,
int *errret)
{ return(*(int *)0); }
@@ -778,20 +832,20 @@ char *BC;
#undef tgetent_sp
int tgetent_sp(
- SCREEN *sp,
- char *bufp,
+ SCREEN *sp,
+ char *bufp,
const char *name)
{ return(*(int *)0); }
#undef tgetent
int tgetent(
- char *bufp,
+ char *bufp,
const char *name)
{ return(*(int *)0); }
#undef tgetflag_sp
int tgetflag_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *id)
{ return(*(int *)0); }
@@ -802,7 +856,7 @@ int tgetflag(
#undef tgetnum_sp
int tgetnum_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *id)
{ return(*(int *)0); }
@@ -813,14 +867,14 @@ int tgetnum(
#undef tgetstr_sp
char *tgetstr_sp(
- SCREEN *sp,
- const char *id,
+ SCREEN *sp,
+ const char *id,
char **area)
{ return(*(char **)0); }
#undef tgetstr
char *tgetstr(
- const char *id,
+ const char *id,
char **area)
{ return(*(char **)0); }
@@ -839,8 +893,8 @@ char *termname(void)
#undef tgoto
char *tgoto(
- const char *string,
- int x,
+ const char *string,
+ int x,
int y)
{ return(*(char **)0); }
@@ -848,7 +902,7 @@ char *tgoto(
#undef tigetflag_sp
int tigetflag_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(int *)0); }
@@ -859,7 +913,7 @@ int tigetflag(
#undef tigetnum_sp
int tigetnum_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(int *)0); }
@@ -870,7 +924,7 @@ int tigetnum(
#undef tigetstr_sp
char *tigetstr_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(char **)0); }
@@ -884,32 +938,58 @@ char *tigetstr(
#undef _nc_tparm_err
int _nc_tparm_err;
+#undef _nc_free_tparm
+void _nc_free_tparm(
+ TERMINAL *termp)
+ { /* void */ }
+
#undef _nc_tparm_analyze
int _nc_tparm_analyze(
- const char *string,
- char *p_is_s[9],
+ TERMINAL *term,
+ const char *string,
+ char **p_is_s,
int *_nc_popcount)
{ return(*(int *)0); }
#undef tparm
char *tparm(
- const char *string,
+ const char *string,
...)
{ return(*(char **)0); }
#undef tiparm
char *tiparm(
- const char *string,
+ const char *string,
...)
{ return(*(char **)0); }
+#undef tiparm_s
+char *tiparm_s(
+ int num_expected,
+ int tparm_type,
+ const char *string,
+ ...)
+ { return(*(char **)0); }
+
+#undef tiscan_s
+int tiscan_s(
+ int *num_expected,
+ int *tparm_type,
+ const char *string)
+ { return(*(int *)0); }
+
#undef _nc_tiparm
char *_nc_tiparm(
- int expected,
- const char *string,
+ int expected,
+ const char *string,
...)
{ return(*(char **)0); }
+#undef _nc_reset_tparm
+void _nc_reset_tparm(
+ TERMINAL *term)
+ { /* void */ }
+
/* ./tinfo/lib_tputs.c */
#undef PC
@@ -926,7 +1006,7 @@ void _nc_set_no_padding(
#undef delay_output_sp
int delay_output_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ms)
{ return(*(int *)0); }
@@ -946,7 +1026,7 @@ void _nc_flush(void)
#undef _nc_outch_sp
int _nc_outch_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ch)
{ return(*(int *)0); }
@@ -957,7 +1037,7 @@ int _nc_outch(
#undef _nc_putchar_sp
int _nc_putchar_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ch)
{ return(*(int *)0); }
@@ -968,7 +1048,7 @@ int _nc_putchar(
#undef putp_sp
int putp_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *string)
{ return(*(int *)0); }
@@ -979,35 +1059,35 @@ int putp(
#undef _nc_putp_sp
int _nc_putp_sp(
- SCREEN *sp,
- const char *name,
+ SCREEN *sp,
+ const char *name,
const char *string)
{ return(*(int *)0); }
#undef _nc_putp
int _nc_putp(
- const char *name,
+ const char *name,
const char *string)
{ return(*(int *)0); }
#undef tputs_sp
int tputs_sp(
- SCREEN *sp,
- const char *string,
- int affcnt,
+ SCREEN *sp,
+ const char *string,
+ int affcnt,
NCURSES_OUTC_sp outc)
{ return(*(int *)0); }
#undef _nc_outc_wrapper
int _nc_outc_wrapper(
- SCREEN *sp,
+ SCREEN *sp,
int c)
{ return(*(int *)0); }
#undef tputs
int tputs(
- const char *string,
- int affcnt,
+ const char *string,
+ int affcnt,
int (*outc)(
int p1))
{ return(*(int *)0); }
@@ -1033,7 +1113,7 @@ void trace(
#undef _tracef
void _tracef(
- const char *fmt,
+ const char *fmt,
...)
{ /* void */ }
@@ -1089,8 +1169,8 @@ WINDOW *_nc_retrace_win(
#undef _nc_fmt_funcptr
char *_nc_fmt_funcptr(
- char *target,
- const char *source,
+ char *target,
+ const char *source,
size_t size)
{ return(*(char **)0); }
@@ -1098,7 +1178,7 @@ char *_nc_fmt_funcptr(
#undef _traceattr2
char *_traceattr2(
- int bufnum,
+ int bufnum,
chtype newmode)
{ return(*(char **)0); }
@@ -1119,13 +1199,13 @@ attr_t _nc_retrace_attr_t(
#undef _nc_altcharset_name
const char *_nc_altcharset_name(
- attr_t attr,
+ attr_t attr,
chtype ch)
{ return(*(const char **)0); }
#undef _tracechtype2
char *_tracechtype2(
- int bufnum,
+ int bufnum,
chtype ch)
{ return(*(char **)0); }
@@ -1143,7 +1223,7 @@ chtype _nc_retrace_chtype(
#undef _nc_trace_ttymode
char *_nc_trace_ttymode(
- struct termios *tty)
+ const struct termios *tty)
{ return(*(char **)0); }
#undef _nc_tracebits
@@ -1154,7 +1234,7 @@ char *_nc_tracebits(void)
#undef _nc_tracechar
char *_nc_tracechar(
- SCREEN *sp,
+ SCREEN *sp,
int ch)
{ return(*(char **)0); }
@@ -1167,7 +1247,7 @@ char *_tracechar(
#undef _nc_get_tty_mode_sp
int _nc_get_tty_mode_sp(
- SCREEN *sp,
+ SCREEN *sp,
struct termios *buf)
{ return(*(int *)0); }
@@ -1178,7 +1258,7 @@ int _nc_get_tty_mode(
#undef _nc_set_tty_mode_sp
int _nc_set_tty_mode_sp(
- SCREEN *sp,
+ SCREEN *sp,
struct termios *buf)
{ return(*(int *)0); }
@@ -1245,9 +1325,9 @@ int resetty(void)
#undef _nc_timed_wait
int _nc_timed_wait(
- SCREEN *sp,
- int mode,
- int milliseconds,
+ SCREEN *sp,
+ int mode,
+ int milliseconds,
int *timeleft)
{ return(*(int *)0); }
@@ -1260,8 +1340,8 @@ char *_nc_first_name(
#undef _nc_name_match
int _nc_name_match(
- const char *const namelst,
- const char *const name,
+ const char *const namelst,
+ const char *const name,
const char *const delim)
{ return(*(int *)0); }
@@ -1284,14 +1364,14 @@ const char *const strfnames[] = {0};
#undef _nc_set_buffer_sp
void _nc_set_buffer_sp(
- SCREEN *sp,
- FILE *ofp,
+ SCREEN *sp,
+ FILE *ofp,
int buffered)
{ /* void */ }
#undef _nc_set_buffer
void _nc_set_buffer(
- FILE *ofp,
+ FILE *ofp,
int buffered)
{ /* void */ }
@@ -1299,27 +1379,27 @@ void _nc_set_buffer(
#undef _nc_init_termtype
void _nc_init_termtype(
- TERMTYPE2 *const tp)
+ TERMTYPE *const tp)
{ /* void */ }
#undef _nc_read_termtype
int _nc_read_termtype(
- TERMTYPE2 *ptr,
- char *buffer,
+ TERMTYPE *ptr,
+ char *buffer,
int limit)
{ return(*(int *)0); }
#undef _nc_read_file_entry
int _nc_read_file_entry(
- const char *const filename,
- TERMTYPE2 *ptr)
+ const char *const filename,
+ TERMTYPE *ptr)
{ return(*(int *)0); }
#undef _nc_read_entry
int _nc_read_entry(
- const char *const name,
- char *const filename,
- TERMTYPE2 *const tp)
+ const char *const name,
+ char *const filename,
+ TERMTYPE *const tp)
{ return(*(int *)0); }
/* ./tinfo/read_termcap.c */
@@ -1332,32 +1412,32 @@ void _nc_read_termcap(void)
#undef _nc_str_init
string_desc *_nc_str_init(
- string_desc *dst,
- char *src,
+ string_desc *dst,
+ char *src,
size_t len)
{ return(*(string_desc **)0); }
#undef _nc_str_null
string_desc *_nc_str_null(
- string_desc *dst,
+ string_desc *dst,
size_t len)
{ return(*(string_desc **)0); }
#undef _nc_str_copy
string_desc *_nc_str_copy(
- string_desc *dst,
- string_desc *src)
+ string_desc *dst,
+ const string_desc *const src)
{ return(*(string_desc **)0); }
#undef _nc_safe_strcat
NCURSES_BOOL _nc_safe_strcat(
- string_desc *dst,
+ string_desc *dst,
const char *src)
{ return(*(NCURSES_BOOL *)0); }
#undef _nc_safe_strcpy
NCURSES_BOOL _nc_safe_strcpy(
- string_desc *dst,
+ string_desc *dst,
const char *src)
{ return(*(NCURSES_BOOL *)0); }
@@ -1365,13 +1445,13 @@ NCURSES_BOOL _nc_safe_strcpy(
#undef _nc_trace_buf
char *_nc_trace_buf(
- int bufnum,
+ int bufnum,
size_t want)
{ return(*(char **)0); }
#undef _nc_trace_bufcat
char *_nc_trace_bufcat(
- int bufnum,
+ int bufnum,
const char *value)
{ return(*(char **)0); }
@@ -1386,21 +1466,21 @@ void _nc_trace_tries(
#undef _nc_expand_try
char *_nc_expand_try(
- TRIES *tree,
- unsigned code,
- int *count,
+ TRIES *tree,
+ unsigned code,
+ int *count,
size_t len)
{ return(*(char **)0); }
#undef _nc_remove_key
int _nc_remove_key(
- TRIES **tree,
+ TRIES **tree,
unsigned code)
{ return(*(int *)0); }
#undef _nc_remove_string
int _nc_remove_string(
- TRIES **tree,
+ TRIES **tree,
const char *string)
{ return(*(int *)0); }
@@ -1408,14 +1488,14 @@ int _nc_remove_string(
#undef _nc_trim_sgr0
char *_nc_trim_sgr0(
- TERMTYPE2 *tp)
+ TERMTYPE *tp)
{ return(*(char **)0); }
/* ./unctrl.c */
#undef unctrl_sp
const char *unctrl_sp(
- SCREEN *sp,
+ SCREEN *sp,
chtype ch)
{ return(*(const char **)0); }
@@ -1428,7 +1508,7 @@ const char *unctrl(
#undef _nc_visbuf2
const char *_nc_visbuf2(
- int bufnum,
+ int bufnum,
const char *buf)
{ return(*(const char **)0); }
@@ -1439,20 +1519,20 @@ const char *_nc_visbuf(
#undef _nc_visbufn
const char *_nc_visbufn(
- const char *buf,
+ const char *buf,
int len)
{ return(*(const char **)0); }
#undef _nc_viscbuf2
const char *_nc_viscbuf2(
- int bufnum,
- const chtype *buf,
+ int bufnum,
+ const chtype *buf,
int len)
{ return(*(const char **)0); }
#undef _nc_viscbuf
const char *_nc_viscbuf(
- const chtype *buf,
+ const chtype *buf,
int len)
{ return(*(const char **)0); }
@@ -1460,14 +1540,14 @@ const char *_nc_viscbuf(
#undef define_key_sp
int define_key_sp(
- SCREEN *sp,
- const char *str,
+ SCREEN *sp,
+ const char *str,
int keycode)
{ return(*(int *)0); }
#undef define_key
int define_key(
- const char *str,
+ const char *str,
int keycode)
{ return(*(int *)0); }
@@ -1481,7 +1561,7 @@ void _nc_hashed_db(void)
#undef key_defined_sp
int key_defined_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(int *)0); }
@@ -1494,14 +1574,14 @@ int key_defined(
#undef keybound_sp
char *keybound_sp(
- SCREEN *sp,
- int code,
+ SCREEN *sp,
+ int code,
int count)
{ return(*(char **)0); }
#undef keybound
char *keybound(
- int code,
+ int code,
int count)
{ return(*(char **)0); }
@@ -1509,14 +1589,14 @@ char *keybound(
#undef keyok_sp
int keyok_sp(
- SCREEN *sp,
- int c,
+ SCREEN *sp,
+ int c,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef keyok
int keyok(
- int c,
+ int c,
NCURSES_BOOL flag)
{ return(*(int *)0); }
diff --git a/ncurses/llib-ltinfot b/ncurses/llib-ltinfot
index 18780beb96b1..94ca9a7f0272 100644
--- a/ncurses/llib-ltinfot
+++ b/ncurses/llib-ltinfot
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2019-2022,2023 Thomas E. Dickey *
* Copyright 2013-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -58,7 +58,7 @@ char *_nc_basename(
#undef _nc_access
int _nc_access(
- const char *path,
+ const char *path,
int mode)
{ return(*(int *)0); }
@@ -76,12 +76,25 @@ NCURSES_BOOL _nc_is_file_path(
int _nc_env_access(void)
{ return(*(int *)0); }
+#undef _nc_safe_fopen
+FILE *_nc_safe_fopen(
+ const char *path,
+ const char *mode)
+ { return(*(FILE **)0); }
+
+#undef _nc_safe_open3
+int _nc_safe_open3(
+ const char *path,
+ int flags,
+ mode_t mode)
+ { return(*(int *)0); }
+
/* ./tinfo/add_tries.c */
#undef _nc_add_to_try
int _nc_add_to_try(
- TRIES **tree,
- const char *str,
+ TRIES **tree,
+ const char *str,
unsigned code)
{ return(*(int *)0); }
@@ -89,13 +102,13 @@ int _nc_add_to_try(
#undef _nc_align_termtype
void _nc_align_termtype(
- TERMTYPE2 *to,
- TERMTYPE2 *from)
+ TERMTYPE *to,
+ TERMTYPE *from)
{ /* void */ }
#undef _nc_copy_termtype
void _nc_copy_termtype(
- TERMTYPE *dst,
+ TERMTYPE *dst,
const TERMTYPE *src)
{ /* void */ }
@@ -165,19 +178,19 @@ void _nc_get_type(
#undef _nc_warning
void _nc_warning(
- const char *const fmt,
+ const char *const fmt,
...)
{ /* void */ }
#undef _nc_err_abort
void _nc_err_abort(
- const char *const fmt,
+ const char *const fmt,
...)
{ /* void */ }
#undef _nc_syserr_abort
void _nc_syserr_abort(
- const char *const fmt,
+ const char *const fmt,
...)
{ /* void */ }
@@ -185,14 +198,14 @@ void _nc_syserr_abort(
#undef _nc_find_entry
struct name_table_entry const *_nc_find_entry(
- const char *string,
+ 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,
+ const char *string,
+ int type,
NCURSES_BOOL termcap)
{ return(*(struct name_table_entry const **)0); }
@@ -229,13 +242,13 @@ void _nc_last_db(void)
#undef _nc_next_db
const char *_nc_next_db(
- DBDIRS *state,
+ DBDIRS *state,
int *offset)
{ return(*(const char **)0); }
#undef _nc_first_db
void _nc_first_db(
- DBDIRS *state,
+ DBDIRS *state,
int *offset)
{ /* void */ }
@@ -243,7 +256,7 @@ void _nc_first_db(
#undef _nc_doalloc
void *_nc_doalloc(
- void *oldp,
+ void *oldp,
size_t amount)
{ return(*(void **)0); }
@@ -256,8 +269,8 @@ ENTRY *_nc_tail;
#undef _nc_free_entry
void _nc_free_entry(
- ENTRY *headp,
- TERMTYPE2 *tterm)
+ ENTRY *headp,
+ TERMTYPE *tterm)
{ /* void */ }
#undef _nc_free_entries
@@ -277,9 +290,9 @@ void exit_terminfo(
/* ./fallback.c */
#undef _nc_fallback
-const TERMTYPE2 *_nc_fallback(
+const TERMTYPE *_nc_fallback(
const char *name)
- { return(*(const TERMTYPE2 **)0); }
+ { return(*(const TERMTYPE **)0); }
/* ./tinfo/free_ttype.c */
@@ -288,6 +301,11 @@ void _nc_free_termtype(
TERMTYPE *ptr)
{ /* void */ }
+#undef _nc_free_termtype1
+void _nc_free_termtype1(
+ TERMTYPE *ptr)
+ { /* void */ }
+
#undef _nc_user_definable
NCURSES_BOOL _nc_user_definable;
@@ -305,7 +323,7 @@ int _nc_getenv_num(
#undef _nc_setenv_num
void _nc_setenv_num(
- const char *name,
+ const char *name,
int value)
{ /* void */ }
@@ -340,8 +358,8 @@ void _nc_init_acs(void)
/* ./tinfo/lib_baudrate.c */
struct speed {
- int given_speed;
- int actual_speed;
+ int given_speed;
+ int actual_speed;
};
#undef _nc_baudrate
@@ -380,7 +398,7 @@ TERMINAL *_nc_cur_term(void)
#undef set_curterm_sp
TERMINAL *set_curterm_sp(
- SCREEN *sp,
+ SCREEN *sp,
TERMINAL *termp)
{ return(*(TERMINAL **)0); }
@@ -391,7 +409,7 @@ TERMINAL *set_curterm(
#undef del_curterm_sp
int del_curterm_sp(
- SCREEN *sp,
+ SCREEN *sp,
TERMINAL *termp)
{ return(*(int *)0); }
@@ -507,7 +525,7 @@ struct kn { short offset; int code; };
#undef keyname_sp
const char *keyname_sp(
- SCREEN *sp,
+ SCREEN *sp,
int c)
{ return(*(const char **)0); }
@@ -531,7 +549,7 @@ char *longname(void)
#undef napms_sp
int napms_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ms)
{ return(*(int *)0); }
@@ -544,19 +562,19 @@ int napms(
#undef idlok
int idlok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef idcok
void idcok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ /* void */ }
#undef halfdelay_sp
int halfdelay_sp(
- SCREEN *sp,
+ SCREEN *sp,
int t)
{ return(*(int *)0); }
@@ -567,37 +585,37 @@ int halfdelay(
#undef nodelay
int nodelay(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef notimeout
int notimeout(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL f)
{ return(*(int *)0); }
#undef wtimeout
void wtimeout(
- WINDOW *win,
+ WINDOW *win,
int delay)
{ /* void */ }
#undef keypad
int keypad(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef meta
int meta(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef curs_set_sp
int curs_set_sp(
- SCREEN *sp,
+ SCREEN *sp,
int vis)
{ return(*(int *)0); }
@@ -608,7 +626,7 @@ int curs_set(
#undef typeahead_sp
int typeahead_sp(
- SCREEN *sp,
+ SCREEN *sp,
int fd)
{ return(*(int *)0); }
@@ -619,7 +637,7 @@ int typeahead(
#undef has_key_sp
int has_key_sp(
- SCREEN *sp,
+ SCREEN *sp,
int keycode)
{ return(*(int *)0); }
@@ -630,14 +648,14 @@ int has_key(
#undef _nc_putp_flush_sp
int _nc_putp_flush_sp(
- SCREEN *sp,
- const char *name,
+ SCREEN *sp,
+ const char *name,
const char *value)
{ return(*(int *)0); }
#undef _nc_keypad
int _nc_keypad(
- SCREEN *sp,
+ SCREEN *sp,
int flag)
{ return(*(int *)0); }
@@ -699,17 +717,53 @@ void noqiflush(void)
#undef intrflush_sp
int intrflush_sp(
- SCREEN *sp,
- WINDOW *win,
+ SCREEN *sp,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef intrflush
int intrflush(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
+#undef is_nl_sp
+int is_nl_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_raw_sp
+int is_raw_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_cbreak_sp
+int is_cbreak_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_echo_sp
+int is_echo_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_nl
+int is_nl(void)
+ { return(*(int *)0); }
+
+#undef is_raw
+int is_raw(void)
+ { return(*(int *)0); }
+
+#undef is_cbreak
+int is_cbreak(void)
+ { return(*(int *)0); }
+
+#undef is_echo
+int is_echo(void)
+ { return(*(int *)0); }
+
/* ./tinfo/lib_setup.c */
#undef _nc_ttytype
@@ -745,7 +799,7 @@ int _nc_TABSIZE(void)
#undef set_tabsize_sp
int set_tabsize_sp(
- SCREEN *sp,
+ SCREEN *sp,
int value)
{ return(*(int *)0); }
@@ -761,13 +815,13 @@ int _nc_handle_sigwinch(
#undef use_env_sp
void use_env_sp(
- SCREEN *sp,
+ SCREEN *sp,
NCURSES_BOOL f)
{ /* void */ }
#undef use_tioctl_sp
void use_tioctl_sp(
- SCREEN *sp,
+ SCREEN *sp,
NCURSES_BOOL f)
{ /* void */ }
@@ -783,8 +837,8 @@ void use_tioctl(
#undef _nc_get_screensize
void _nc_get_screensize(
- SCREEN *sp,
- int *linep,
+ SCREEN *sp,
+ int *linep,
int *colp)
{ /* void */ }
@@ -795,13 +849,13 @@ void _nc_update_screensize(
#undef _nc_setup_tinfo
int _nc_setup_tinfo(
- const char *const tn,
- TERMTYPE2 *const tp)
+ const char *const tn,
+ TERMTYPE *const tp)
{ return(*(int *)0); }
#undef _nc_tinfo_cmdch
void _nc_tinfo_cmdch(
- TERMINAL *termp,
+ TERMINAL *termp,
int proto)
{ /* void */ }
@@ -820,9 +874,9 @@ int _nc_locale_breaks_acs(
#undef _nc_setupterm
int _nc_setupterm(
- const char *tname,
- int Filedes,
- int *errret,
+ const char *tname,
+ int Filedes,
+ int *errret,
int reuse)
{ return(*(int *)0); }
@@ -840,8 +894,8 @@ SCREEN *new_prescr(void)
#undef setupterm
int setupterm(
- const char *tname,
- int Filedes,
+ const char *tname,
+ int Filedes,
int *errret)
{ return(*(int *)0); }
@@ -854,20 +908,20 @@ char *BC;
#undef tgetent_sp
int tgetent_sp(
- SCREEN *sp,
- char *bufp,
+ SCREEN *sp,
+ char *bufp,
const char *name)
{ return(*(int *)0); }
#undef tgetent
int tgetent(
- char *bufp,
+ char *bufp,
const char *name)
{ return(*(int *)0); }
#undef tgetflag_sp
int tgetflag_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *id)
{ return(*(int *)0); }
@@ -878,7 +932,7 @@ int tgetflag(
#undef tgetnum_sp
int tgetnum_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *id)
{ return(*(int *)0); }
@@ -889,14 +943,14 @@ int tgetnum(
#undef tgetstr_sp
char *tgetstr_sp(
- SCREEN *sp,
- const char *id,
+ SCREEN *sp,
+ const char *id,
char **area)
{ return(*(char **)0); }
#undef tgetstr
char *tgetstr(
- const char *id,
+ const char *id,
char **area)
{ return(*(char **)0); }
@@ -915,8 +969,8 @@ char *termname(void)
#undef tgoto
char *tgoto(
- const char *string,
- int x,
+ const char *string,
+ int x,
int y)
{ return(*(char **)0); }
@@ -924,7 +978,7 @@ char *tgoto(
#undef tigetflag_sp
int tigetflag_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(int *)0); }
@@ -935,7 +989,7 @@ int tigetflag(
#undef tigetnum_sp
int tigetnum_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(int *)0); }
@@ -946,7 +1000,7 @@ int tigetnum(
#undef tigetstr_sp
char *tigetstr_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(char **)0); }
@@ -960,32 +1014,58 @@ char *tigetstr(
#undef _nc_tparm_err
int _nc_tparm_err;
+#undef _nc_free_tparm
+void _nc_free_tparm(
+ TERMINAL *termp)
+ { /* void */ }
+
#undef _nc_tparm_analyze
int _nc_tparm_analyze(
- const char *string,
- char *p_is_s[9],
+ TERMINAL *term,
+ const char *string,
+ char **p_is_s,
int *_nc_popcount)
{ return(*(int *)0); }
#undef tparm
char *tparm(
- const char *string,
+ const char *string,
...)
{ return(*(char **)0); }
#undef tiparm
char *tiparm(
- const char *string,
+ const char *string,
...)
{ return(*(char **)0); }
+#undef tiparm_s
+char *tiparm_s(
+ int num_expected,
+ int tparm_type,
+ const char *string,
+ ...)
+ { return(*(char **)0); }
+
+#undef tiscan_s
+int tiscan_s(
+ int *num_expected,
+ int *tparm_type,
+ const char *string)
+ { return(*(int *)0); }
+
#undef _nc_tiparm
char *_nc_tiparm(
- int expected,
- const char *string,
+ int expected,
+ const char *string,
...)
{ return(*(char **)0); }
+#undef _nc_reset_tparm
+void _nc_reset_tparm(
+ TERMINAL *term)
+ { /* void */ }
+
/* ./tinfo/lib_tputs.c */
#undef PC
@@ -1002,7 +1082,7 @@ void _nc_set_no_padding(
#undef delay_output_sp
int delay_output_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ms)
{ return(*(int *)0); }
@@ -1022,7 +1102,7 @@ void _nc_flush(void)
#undef _nc_outch_sp
int _nc_outch_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ch)
{ return(*(int *)0); }
@@ -1033,7 +1113,7 @@ int _nc_outch(
#undef _nc_putchar_sp
int _nc_putchar_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ch)
{ return(*(int *)0); }
@@ -1044,7 +1124,7 @@ int _nc_putchar(
#undef putp_sp
int putp_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *string)
{ return(*(int *)0); }
@@ -1055,35 +1135,35 @@ int putp(
#undef _nc_putp_sp
int _nc_putp_sp(
- SCREEN *sp,
- const char *name,
+ SCREEN *sp,
+ const char *name,
const char *string)
{ return(*(int *)0); }
#undef _nc_putp
int _nc_putp(
- const char *name,
+ const char *name,
const char *string)
{ return(*(int *)0); }
#undef tputs_sp
int tputs_sp(
- SCREEN *sp,
- const char *string,
- int affcnt,
+ SCREEN *sp,
+ const char *string,
+ int affcnt,
NCURSES_OUTC_sp outc)
{ return(*(int *)0); }
#undef _nc_outc_wrapper
int _nc_outc_wrapper(
- SCREEN *sp,
+ SCREEN *sp,
int c)
{ return(*(int *)0); }
#undef tputs
int tputs(
- const char *string,
- int affcnt,
+ const char *string,
+ int affcnt,
int (*outc)(
int p1))
{ return(*(int *)0); }
@@ -1123,7 +1203,7 @@ void trace(
#undef _tracef
void _tracef(
- const char *fmt,
+ const char *fmt,
...)
{ /* void */ }
@@ -1179,8 +1259,8 @@ WINDOW *_nc_retrace_win(
#undef _nc_fmt_funcptr
char *_nc_fmt_funcptr(
- char *target,
- const char *source,
+ char *target,
+ const char *source,
size_t size)
{ return(*(char **)0); }
@@ -1191,7 +1271,7 @@ int _nc_use_tracef(
#undef _nc_locked_tracef
void _nc_locked_tracef(
- const char *fmt,
+ const char *fmt,
...)
{ /* void */ }
@@ -1199,7 +1279,7 @@ void _nc_locked_tracef(
#undef _traceattr2
char *_traceattr2(
- int bufnum,
+ int bufnum,
chtype newmode)
{ return(*(char **)0); }
@@ -1220,13 +1300,13 @@ attr_t _nc_retrace_attr_t(
#undef _nc_altcharset_name
const char *_nc_altcharset_name(
- attr_t attr,
+ attr_t attr,
chtype ch)
{ return(*(const char **)0); }
#undef _tracechtype2
char *_tracechtype2(
- int bufnum,
+ int bufnum,
chtype ch)
{ return(*(char **)0); }
@@ -1244,7 +1324,7 @@ chtype _nc_retrace_chtype(
#undef _nc_trace_ttymode
char *_nc_trace_ttymode(
- struct termios *tty)
+ const struct termios *tty)
{ return(*(char **)0); }
#undef _nc_tracebits
@@ -1255,7 +1335,7 @@ char *_nc_tracebits(void)
#undef _nc_tracechar
char *_nc_tracechar(
- SCREEN *sp,
+ SCREEN *sp,
int ch)
{ return(*(char **)0); }
@@ -1268,7 +1348,7 @@ char *_tracechar(
#undef _nc_get_tty_mode_sp
int _nc_get_tty_mode_sp(
- SCREEN *sp,
+ SCREEN *sp,
struct termios *buf)
{ return(*(int *)0); }
@@ -1279,7 +1359,7 @@ int _nc_get_tty_mode(
#undef _nc_set_tty_mode_sp
int _nc_set_tty_mode_sp(
- SCREEN *sp,
+ SCREEN *sp,
struct termios *buf)
{ return(*(int *)0); }
@@ -1346,9 +1426,9 @@ int resetty(void)
#undef _nc_timed_wait
int _nc_timed_wait(
- SCREEN *sp,
- int mode,
- int milliseconds,
+ SCREEN *sp,
+ int mode,
+ int milliseconds,
int *timeleft)
{ return(*(int *)0); }
@@ -1361,8 +1441,8 @@ char *_nc_first_name(
#undef _nc_name_match
int _nc_name_match(
- const char *const namelst,
- const char *const name,
+ const char *const namelst,
+ const char *const name,
const char *const delim)
{ return(*(int *)0); }
@@ -1396,14 +1476,14 @@ const char *const *_nc_strfnames(void)
#undef _nc_set_buffer_sp
void _nc_set_buffer_sp(
- SCREEN *sp,
- FILE *ofp,
+ SCREEN *sp,
+ FILE *ofp,
int buffered)
{ /* void */ }
#undef _nc_set_buffer
void _nc_set_buffer(
- FILE *ofp,
+ FILE *ofp,
int buffered)
{ /* void */ }
@@ -1411,27 +1491,27 @@ void _nc_set_buffer(
#undef _nc_init_termtype
void _nc_init_termtype(
- TERMTYPE2 *const tp)
+ TERMTYPE *const tp)
{ /* void */ }
#undef _nc_read_termtype
int _nc_read_termtype(
- TERMTYPE2 *ptr,
- char *buffer,
+ TERMTYPE *ptr,
+ char *buffer,
int limit)
{ return(*(int *)0); }
#undef _nc_read_file_entry
int _nc_read_file_entry(
- const char *const filename,
- TERMTYPE2 *ptr)
+ const char *const filename,
+ TERMTYPE *ptr)
{ return(*(int *)0); }
#undef _nc_read_entry
int _nc_read_entry(
- const char *const name,
- char *const filename,
- TERMTYPE2 *const tp)
+ const char *const name,
+ char *const filename,
+ TERMTYPE *const tp)
{ return(*(int *)0); }
/* ./tinfo/read_termcap.c */
@@ -1444,32 +1524,32 @@ void _nc_read_termcap(void)
#undef _nc_str_init
string_desc *_nc_str_init(
- string_desc *dst,
- char *src,
+ string_desc *dst,
+ char *src,
size_t len)
{ return(*(string_desc **)0); }
#undef _nc_str_null
string_desc *_nc_str_null(
- string_desc *dst,
+ string_desc *dst,
size_t len)
{ return(*(string_desc **)0); }
#undef _nc_str_copy
string_desc *_nc_str_copy(
- string_desc *dst,
- string_desc *src)
+ string_desc *dst,
+ const string_desc *const src)
{ return(*(string_desc **)0); }
#undef _nc_safe_strcat
NCURSES_BOOL _nc_safe_strcat(
- string_desc *dst,
+ string_desc *dst,
const char *src)
{ return(*(NCURSES_BOOL *)0); }
#undef _nc_safe_strcpy
NCURSES_BOOL _nc_safe_strcpy(
- string_desc *dst,
+ string_desc *dst,
const char *src)
{ return(*(NCURSES_BOOL *)0); }
@@ -1477,13 +1557,13 @@ NCURSES_BOOL _nc_safe_strcpy(
#undef _nc_trace_buf
char *_nc_trace_buf(
- int bufnum,
+ int bufnum,
size_t want)
{ return(*(char **)0); }
#undef _nc_trace_bufcat
char *_nc_trace_bufcat(
- int bufnum,
+ int bufnum,
const char *value)
{ return(*(char **)0); }
@@ -1498,21 +1578,21 @@ void _nc_trace_tries(
#undef _nc_expand_try
char *_nc_expand_try(
- TRIES *tree,
- unsigned code,
- int *count,
+ TRIES *tree,
+ unsigned code,
+ int *count,
size_t len)
{ return(*(char **)0); }
#undef _nc_remove_key
int _nc_remove_key(
- TRIES **tree,
+ TRIES **tree,
unsigned code)
{ return(*(int *)0); }
#undef _nc_remove_string
int _nc_remove_string(
- TRIES **tree,
+ TRIES **tree,
const char *string)
{ return(*(int *)0); }
@@ -1520,14 +1600,14 @@ int _nc_remove_string(
#undef _nc_trim_sgr0
char *_nc_trim_sgr0(
- TERMTYPE2 *tp)
+ TERMTYPE *tp)
{ return(*(char **)0); }
/* ./unctrl.c */
#undef unctrl_sp
const char *unctrl_sp(
- SCREEN *sp,
+ SCREEN *sp,
chtype ch)
{ return(*(const char **)0); }
@@ -1540,7 +1620,7 @@ const char *unctrl(
#undef _nc_visbuf2
const char *_nc_visbuf2(
- int bufnum,
+ int bufnum,
const char *buf)
{ return(*(const char **)0); }
@@ -1551,20 +1631,20 @@ const char *_nc_visbuf(
#undef _nc_visbufn
const char *_nc_visbufn(
- const char *buf,
+ const char *buf,
int len)
{ return(*(const char **)0); }
#undef _nc_viscbuf2
const char *_nc_viscbuf2(
- int bufnum,
- const chtype *buf,
+ int bufnum,
+ const chtype *buf,
int len)
{ return(*(const char **)0); }
#undef _nc_viscbuf
const char *_nc_viscbuf(
- const chtype *buf,
+ const chtype *buf,
int len)
{ return(*(const char **)0); }
@@ -1572,14 +1652,14 @@ const char *_nc_viscbuf(
#undef define_key_sp
int define_key_sp(
- SCREEN *sp,
- const char *str,
+ SCREEN *sp,
+ const char *str,
int keycode)
{ return(*(int *)0); }
#undef define_key
int define_key(
- const char *str,
+ const char *str,
int keycode)
{ return(*(int *)0); }
@@ -1593,7 +1673,7 @@ void _nc_hashed_db(void)
#undef key_defined_sp
int key_defined_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(int *)0); }
@@ -1606,14 +1686,14 @@ int key_defined(
#undef keybound_sp
char *keybound_sp(
- SCREEN *sp,
- int code,
+ SCREEN *sp,
+ int code,
int count)
{ return(*(char **)0); }
#undef keybound
char *keybound(
- int code,
+ int code,
int count)
{ return(*(char **)0); }
@@ -1621,14 +1701,14 @@ char *keybound(
#undef keyok_sp
int keyok_sp(
- SCREEN *sp,
- int c,
+ SCREEN *sp,
+ int c,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef keyok
int keyok(
- int c,
+ int c,
NCURSES_BOOL flag)
{ return(*(int *)0); }
diff --git a/ncurses/llib-ltinfotw b/ncurses/llib-ltinfotw
index 0e7e76275885..3b21b8765761 100644
--- a/ncurses/llib-ltinfotw
+++ b/ncurses/llib-ltinfotw
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2022,2023 Thomas E. Dickey *
* Copyright 2012-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -58,7 +58,7 @@ char *_nc_basename(
#undef _nc_access
int _nc_access(
- const char *path,
+ const char *path,
int mode)
{ return(*(int *)0); }
@@ -76,12 +76,25 @@ NCURSES_BOOL _nc_is_file_path(
int _nc_env_access(void)
{ return(*(int *)0); }
+#undef _nc_safe_fopen
+FILE *_nc_safe_fopen(
+ const char *path,
+ const char *mode)
+ { return(*(FILE **)0); }
+
+#undef _nc_safe_open3
+int _nc_safe_open3(
+ const char *path,
+ int flags,
+ mode_t mode)
+ { return(*(int *)0); }
+
/* ./tinfo/add_tries.c */
#undef _nc_add_to_try
int _nc_add_to_try(
- TRIES **tree,
- const char *str,
+ TRIES **tree,
+ const char *str,
unsigned code)
{ return(*(int *)0); }
@@ -89,25 +102,25 @@ int _nc_add_to_try(
#undef _nc_align_termtype
void _nc_align_termtype(
- TERMTYPE2 *to,
+ TERMTYPE2 *to,
TERMTYPE2 *from)
{ /* void */ }
#undef _nc_copy_termtype
void _nc_copy_termtype(
- TERMTYPE *dst,
+ TERMTYPE *dst,
const TERMTYPE *src)
{ /* void */ }
#undef _nc_copy_termtype2
void _nc_copy_termtype2(
- TERMTYPE2 *dst,
+ TERMTYPE2 *dst,
const TERMTYPE2 *src)
{ /* void */ }
#undef _nc_export_termtype2
void _nc_export_termtype2(
- TERMTYPE *dst,
+ TERMTYPE *dst,
const TERMTYPE2 *src)
{ /* void */ }
@@ -177,19 +190,19 @@ void _nc_get_type(
#undef _nc_warning
void _nc_warning(
- const char *const fmt,
+ const char *const fmt,
...)
{ /* void */ }
#undef _nc_err_abort
void _nc_err_abort(
- const char *const fmt,
+ const char *const fmt,
...)
{ /* void */ }
#undef _nc_syserr_abort
void _nc_syserr_abort(
- const char *const fmt,
+ const char *const fmt,
...)
{ /* void */ }
@@ -197,14 +210,14 @@ void _nc_syserr_abort(
#undef _nc_find_entry
struct name_table_entry const *_nc_find_entry(
- const char *string,
+ 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,
+ const char *string,
+ int type,
NCURSES_BOOL termcap)
{ return(*(struct name_table_entry const **)0); }
@@ -241,13 +254,13 @@ void _nc_last_db(void)
#undef _nc_next_db
const char *_nc_next_db(
- DBDIRS *state,
+ DBDIRS *state,
int *offset)
{ return(*(const char **)0); }
#undef _nc_first_db
void _nc_first_db(
- DBDIRS *state,
+ DBDIRS *state,
int *offset)
{ /* void */ }
@@ -255,7 +268,7 @@ void _nc_first_db(
#undef _nc_doalloc
void *_nc_doalloc(
- void *oldp,
+ void *oldp,
size_t amount)
{ return(*(void **)0); }
@@ -268,7 +281,7 @@ ENTRY *_nc_tail;
#undef _nc_free_entry
void _nc_free_entry(
- ENTRY *headp,
+ ENTRY *headp,
TERMTYPE2 *tterm)
{ /* void */ }
@@ -305,6 +318,11 @@ void _nc_free_termtype(
TERMTYPE *ptr)
{ /* void */ }
+#undef _nc_free_termtype1
+void _nc_free_termtype1(
+ TERMTYPE *ptr)
+ { /* void */ }
+
#undef _nc_free_termtype2
void _nc_free_termtype2(
TERMTYPE2 *ptr)
@@ -327,7 +345,7 @@ int _nc_getenv_num(
#undef _nc_setenv_num
void _nc_setenv_num(
- const char *name,
+ const char *name,
int value)
{ /* void */ }
@@ -362,8 +380,8 @@ void _nc_init_acs(void)
/* ./tinfo/lib_baudrate.c */
struct speed {
- int given_speed;
- int actual_speed;
+ int given_speed;
+ int actual_speed;
};
#undef _nc_baudrate
@@ -402,7 +420,7 @@ TERMINAL *_nc_cur_term(void)
#undef set_curterm_sp
TERMINAL *set_curterm_sp(
- SCREEN *sp,
+ SCREEN *sp,
TERMINAL *termp)
{ return(*(TERMINAL **)0); }
@@ -413,7 +431,7 @@ TERMINAL *set_curterm(
#undef del_curterm_sp
int del_curterm_sp(
- SCREEN *sp,
+ SCREEN *sp,
TERMINAL *termp)
{ return(*(int *)0); }
@@ -529,7 +547,7 @@ struct kn { short offset; int code; };
#undef keyname_sp
const char *keyname_sp(
- SCREEN *sp,
+ SCREEN *sp,
int c)
{ return(*(const char **)0); }
@@ -553,7 +571,7 @@ char *longname(void)
#undef napms_sp
int napms_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ms)
{ return(*(int *)0); }
@@ -566,19 +584,19 @@ int napms(
#undef idlok
int idlok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef idcok
void idcok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ /* void */ }
#undef halfdelay_sp
int halfdelay_sp(
- SCREEN *sp,
+ SCREEN *sp,
int t)
{ return(*(int *)0); }
@@ -589,37 +607,37 @@ int halfdelay(
#undef nodelay
int nodelay(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef notimeout
int notimeout(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL f)
{ return(*(int *)0); }
#undef wtimeout
void wtimeout(
- WINDOW *win,
+ WINDOW *win,
int delay)
{ /* void */ }
#undef keypad
int keypad(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef meta
int meta(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef curs_set_sp
int curs_set_sp(
- SCREEN *sp,
+ SCREEN *sp,
int vis)
{ return(*(int *)0); }
@@ -630,7 +648,7 @@ int curs_set(
#undef typeahead_sp
int typeahead_sp(
- SCREEN *sp,
+ SCREEN *sp,
int fd)
{ return(*(int *)0); }
@@ -641,7 +659,7 @@ int typeahead(
#undef has_key_sp
int has_key_sp(
- SCREEN *sp,
+ SCREEN *sp,
int keycode)
{ return(*(int *)0); }
@@ -652,14 +670,14 @@ int has_key(
#undef _nc_putp_flush_sp
int _nc_putp_flush_sp(
- SCREEN *sp,
- const char *name,
+ SCREEN *sp,
+ const char *name,
const char *value)
{ return(*(int *)0); }
#undef _nc_keypad
int _nc_keypad(
- SCREEN *sp,
+ SCREEN *sp,
int flag)
{ return(*(int *)0); }
@@ -721,17 +739,53 @@ void noqiflush(void)
#undef intrflush_sp
int intrflush_sp(
- SCREEN *sp,
- WINDOW *win,
+ SCREEN *sp,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef intrflush
int intrflush(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
+#undef is_nl_sp
+int is_nl_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_raw_sp
+int is_raw_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_cbreak_sp
+int is_cbreak_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_echo_sp
+int is_echo_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_nl
+int is_nl(void)
+ { return(*(int *)0); }
+
+#undef is_raw
+int is_raw(void)
+ { return(*(int *)0); }
+
+#undef is_cbreak
+int is_cbreak(void)
+ { return(*(int *)0); }
+
+#undef is_echo
+int is_echo(void)
+ { return(*(int *)0); }
+
/* ./tinfo/lib_setup.c */
#undef _nc_ttytype
@@ -767,7 +821,7 @@ int _nc_TABSIZE(void)
#undef set_tabsize_sp
int set_tabsize_sp(
- SCREEN *sp,
+ SCREEN *sp,
int value)
{ return(*(int *)0); }
@@ -783,13 +837,13 @@ int _nc_handle_sigwinch(
#undef use_env_sp
void use_env_sp(
- SCREEN *sp,
+ SCREEN *sp,
NCURSES_BOOL f)
{ /* void */ }
#undef use_tioctl_sp
void use_tioctl_sp(
- SCREEN *sp,
+ SCREEN *sp,
NCURSES_BOOL f)
{ /* void */ }
@@ -805,8 +859,8 @@ void use_tioctl(
#undef _nc_get_screensize
void _nc_get_screensize(
- SCREEN *sp,
- int *linep,
+ SCREEN *sp,
+ int *linep,
int *colp)
{ /* void */ }
@@ -817,13 +871,13 @@ void _nc_update_screensize(
#undef _nc_setup_tinfo
int _nc_setup_tinfo(
- const char *const tn,
+ const char *const tn,
TERMTYPE2 *const tp)
{ return(*(int *)0); }
#undef _nc_tinfo_cmdch
void _nc_tinfo_cmdch(
- TERMINAL *termp,
+ TERMINAL *termp,
int proto)
{ /* void */ }
@@ -842,9 +896,9 @@ int _nc_locale_breaks_acs(
#undef _nc_setupterm
int _nc_setupterm(
- const char *tname,
- int Filedes,
- int *errret,
+ const char *tname,
+ int Filedes,
+ int *errret,
int reuse)
{ return(*(int *)0); }
@@ -862,8 +916,8 @@ SCREEN *new_prescr(void)
#undef setupterm
int setupterm(
- const char *tname,
- int Filedes,
+ const char *tname,
+ int Filedes,
int *errret)
{ return(*(int *)0); }
@@ -876,20 +930,20 @@ char *BC;
#undef tgetent_sp
int tgetent_sp(
- SCREEN *sp,
- char *bufp,
+ SCREEN *sp,
+ char *bufp,
const char *name)
{ return(*(int *)0); }
#undef tgetent
int tgetent(
- char *bufp,
+ char *bufp,
const char *name)
{ return(*(int *)0); }
#undef tgetflag_sp
int tgetflag_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *id)
{ return(*(int *)0); }
@@ -900,7 +954,7 @@ int tgetflag(
#undef tgetnum_sp
int tgetnum_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *id)
{ return(*(int *)0); }
@@ -911,14 +965,14 @@ int tgetnum(
#undef tgetstr_sp
char *tgetstr_sp(
- SCREEN *sp,
- const char *id,
+ SCREEN *sp,
+ const char *id,
char **area)
{ return(*(char **)0); }
#undef tgetstr
char *tgetstr(
- const char *id,
+ const char *id,
char **area)
{ return(*(char **)0); }
@@ -937,8 +991,8 @@ char *termname(void)
#undef tgoto
char *tgoto(
- const char *string,
- int x,
+ const char *string,
+ int x,
int y)
{ return(*(char **)0); }
@@ -946,7 +1000,7 @@ char *tgoto(
#undef tigetflag_sp
int tigetflag_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(int *)0); }
@@ -957,7 +1011,7 @@ int tigetflag(
#undef tigetnum_sp
int tigetnum_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(int *)0); }
@@ -968,7 +1022,7 @@ int tigetnum(
#undef tigetstr_sp
char *tigetstr_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(char **)0); }
@@ -982,32 +1036,58 @@ char *tigetstr(
#undef _nc_tparm_err
int _nc_tparm_err;
+#undef _nc_free_tparm
+void _nc_free_tparm(
+ TERMINAL *termp)
+ { /* void */ }
+
#undef _nc_tparm_analyze
int _nc_tparm_analyze(
- const char *string,
- char *p_is_s[9],
+ TERMINAL *term,
+ const char *string,
+ char **p_is_s,
int *_nc_popcount)
{ return(*(int *)0); }
#undef tparm
char *tparm(
- const char *string,
+ const char *string,
...)
{ return(*(char **)0); }
#undef tiparm
char *tiparm(
- const char *string,
+ const char *string,
...)
{ return(*(char **)0); }
+#undef tiparm_s
+char *tiparm_s(
+ int num_expected,
+ int tparm_type,
+ const char *string,
+ ...)
+ { return(*(char **)0); }
+
+#undef tiscan_s
+int tiscan_s(
+ int *num_expected,
+ int *tparm_type,
+ const char *string)
+ { return(*(int *)0); }
+
#undef _nc_tiparm
char *_nc_tiparm(
- int expected,
- const char *string,
+ int expected,
+ const char *string,
...)
{ return(*(char **)0); }
+#undef _nc_reset_tparm
+void _nc_reset_tparm(
+ TERMINAL *term)
+ { /* void */ }
+
/* ./tinfo/lib_tputs.c */
#undef PC
@@ -1024,7 +1104,7 @@ void _nc_set_no_padding(
#undef delay_output_sp
int delay_output_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ms)
{ return(*(int *)0); }
@@ -1044,7 +1124,7 @@ void _nc_flush(void)
#undef _nc_outch_sp
int _nc_outch_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ch)
{ return(*(int *)0); }
@@ -1055,7 +1135,7 @@ int _nc_outch(
#undef _nc_putchar_sp
int _nc_putchar_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ch)
{ return(*(int *)0); }
@@ -1066,7 +1146,7 @@ int _nc_putchar(
#undef putp_sp
int putp_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *string)
{ return(*(int *)0); }
@@ -1077,35 +1157,35 @@ int putp(
#undef _nc_putp_sp
int _nc_putp_sp(
- SCREEN *sp,
- const char *name,
+ SCREEN *sp,
+ const char *name,
const char *string)
{ return(*(int *)0); }
#undef _nc_putp
int _nc_putp(
- const char *name,
+ const char *name,
const char *string)
{ return(*(int *)0); }
#undef tputs_sp
int tputs_sp(
- SCREEN *sp,
- const char *string,
- int affcnt,
+ SCREEN *sp,
+ const char *string,
+ int affcnt,
NCURSES_OUTC_sp outc)
{ return(*(int *)0); }
#undef _nc_outc_wrapper
int _nc_outc_wrapper(
- SCREEN *sp,
+ SCREEN *sp,
int c)
{ return(*(int *)0); }
#undef tputs
int tputs(
- const char *string,
- int affcnt,
+ const char *string,
+ int affcnt,
int (*outc)(
int p1))
{ return(*(int *)0); }
@@ -1145,7 +1225,7 @@ void trace(
#undef _tracef
void _tracef(
- const char *fmt,
+ const char *fmt,
...)
{ /* void */ }
@@ -1201,8 +1281,8 @@ WINDOW *_nc_retrace_win(
#undef _nc_fmt_funcptr
char *_nc_fmt_funcptr(
- char *target,
- const char *source,
+ char *target,
+ const char *source,
size_t size)
{ return(*(char **)0); }
@@ -1213,7 +1293,7 @@ int _nc_use_tracef(
#undef _nc_locked_tracef
void _nc_locked_tracef(
- const char *fmt,
+ const char *fmt,
...)
{ /* void */ }
@@ -1221,7 +1301,7 @@ void _nc_locked_tracef(
#undef _traceattr2
char *_traceattr2(
- int bufnum,
+ int bufnum,
chtype newmode)
{ return(*(char **)0); }
@@ -1242,13 +1322,13 @@ attr_t _nc_retrace_attr_t(
#undef _nc_altcharset_name
const char *_nc_altcharset_name(
- attr_t attr,
+ attr_t attr,
chtype ch)
{ return(*(const char **)0); }
#undef _tracechtype2
char *_tracechtype2(
- int bufnum,
+ int bufnum,
chtype ch)
{ return(*(char **)0); }
@@ -1264,7 +1344,7 @@ chtype _nc_retrace_chtype(
#undef _tracecchar_t2
char *_tracecchar_t2(
- int bufnum,
+ int bufnum,
const cchar_t *ch)
{ return(*(char **)0); }
@@ -1277,7 +1357,7 @@ char *_tracecchar_t(
#undef _nc_trace_ttymode
char *_nc_trace_ttymode(
- struct termios *tty)
+ const struct termios *tty)
{ return(*(char **)0); }
#undef _nc_tracebits
@@ -1288,7 +1368,7 @@ char *_nc_tracebits(void)
#undef _nc_tracechar
char *_nc_tracechar(
- SCREEN *sp,
+ SCREEN *sp,
int ch)
{ return(*(char **)0); }
@@ -1301,7 +1381,7 @@ char *_tracechar(
#undef _nc_get_tty_mode_sp
int _nc_get_tty_mode_sp(
- SCREEN *sp,
+ SCREEN *sp,
struct termios *buf)
{ return(*(int *)0); }
@@ -1312,7 +1392,7 @@ int _nc_get_tty_mode(
#undef _nc_set_tty_mode_sp
int _nc_set_tty_mode_sp(
- SCREEN *sp,
+ SCREEN *sp,
struct termios *buf)
{ return(*(int *)0); }
@@ -1379,9 +1459,9 @@ int resetty(void)
#undef _nc_timed_wait
int _nc_timed_wait(
- SCREEN *sp,
- int mode,
- int milliseconds,
+ SCREEN *sp,
+ int mode,
+ int milliseconds,
int *timeleft)
{ return(*(int *)0); }
@@ -1394,8 +1474,8 @@ char *_nc_first_name(
#undef _nc_name_match
int _nc_name_match(
- const char *const namelst,
- const char *const name,
+ const char *const namelst,
+ const char *const name,
const char *const delim)
{ return(*(int *)0); }
@@ -1429,14 +1509,14 @@ const char *const *_nc_strfnames(void)
#undef _nc_set_buffer_sp
void _nc_set_buffer_sp(
- SCREEN *sp,
- FILE *ofp,
+ SCREEN *sp,
+ FILE *ofp,
int buffered)
{ /* void */ }
#undef _nc_set_buffer
void _nc_set_buffer(
- FILE *ofp,
+ FILE *ofp,
int buffered)
{ /* void */ }
@@ -1449,28 +1529,28 @@ void _nc_init_termtype(
#undef _nc_read_termtype
int _nc_read_termtype(
- TERMTYPE2 *ptr,
- char *buffer,
+ TERMTYPE2 *ptr,
+ char *buffer,
int limit)
{ return(*(int *)0); }
#undef _nc_read_file_entry
int _nc_read_file_entry(
- const char *const filename,
+ const char *const filename,
TERMTYPE2 *ptr)
{ return(*(int *)0); }
#undef _nc_read_entry2
int _nc_read_entry2(
- const char *const name,
- char *const filename,
+ const char *const name,
+ char *const filename,
TERMTYPE2 *const tp)
{ return(*(int *)0); }
#undef _nc_read_entry
int _nc_read_entry(
- const char *const name,
- char *const filename,
+ const char *const name,
+ char *const filename,
TERMTYPE *const tp)
{ return(*(int *)0); }
@@ -1484,32 +1564,32 @@ void _nc_read_termcap(void)
#undef _nc_str_init
string_desc *_nc_str_init(
- string_desc *dst,
- char *src,
+ string_desc *dst,
+ char *src,
size_t len)
{ return(*(string_desc **)0); }
#undef _nc_str_null
string_desc *_nc_str_null(
- string_desc *dst,
+ string_desc *dst,
size_t len)
{ return(*(string_desc **)0); }
#undef _nc_str_copy
string_desc *_nc_str_copy(
- string_desc *dst,
- string_desc *src)
+ string_desc *dst,
+ const string_desc *const src)
{ return(*(string_desc **)0); }
#undef _nc_safe_strcat
NCURSES_BOOL _nc_safe_strcat(
- string_desc *dst,
+ string_desc *dst,
const char *src)
{ return(*(NCURSES_BOOL *)0); }
#undef _nc_safe_strcpy
NCURSES_BOOL _nc_safe_strcpy(
- string_desc *dst,
+ string_desc *dst,
const char *src)
{ return(*(NCURSES_BOOL *)0); }
@@ -1517,13 +1597,13 @@ NCURSES_BOOL _nc_safe_strcpy(
#undef _nc_trace_buf
char *_nc_trace_buf(
- int bufnum,
+ int bufnum,
size_t want)
{ return(*(char **)0); }
#undef _nc_trace_bufcat
char *_nc_trace_bufcat(
- int bufnum,
+ int bufnum,
const char *value)
{ return(*(char **)0); }
@@ -1538,21 +1618,21 @@ void _nc_trace_tries(
#undef _nc_expand_try
char *_nc_expand_try(
- TRIES *tree,
- unsigned code,
- int *count,
+ TRIES *tree,
+ unsigned code,
+ int *count,
size_t len)
{ return(*(char **)0); }
#undef _nc_remove_key
int _nc_remove_key(
- TRIES **tree,
+ TRIES **tree,
unsigned code)
{ return(*(int *)0); }
#undef _nc_remove_string
int _nc_remove_string(
- TRIES **tree,
+ TRIES **tree,
const char *string)
{ return(*(int *)0); }
@@ -1567,7 +1647,7 @@ char *_nc_trim_sgr0(
#undef unctrl_sp
const char *unctrl_sp(
- SCREEN *sp,
+ SCREEN *sp,
chtype ch)
{ return(*(const char **)0); }
@@ -1580,7 +1660,7 @@ const char *unctrl(
#undef _nc_visbuf2
const char *_nc_visbuf2(
- int bufnum,
+ int bufnum,
const char *buf)
{ return(*(const char **)0); }
@@ -1591,13 +1671,13 @@ const char *_nc_visbuf(
#undef _nc_visbufn
const char *_nc_visbufn(
- const char *buf,
+ const char *buf,
int len)
{ return(*(const char **)0); }
#undef _nc_viswbuf2
const char *_nc_viswbuf2(
- int bufnum,
+ int bufnum,
const wchar_t *buf)
{ return(*(const char **)0); }
@@ -1608,7 +1688,7 @@ const char *_nc_viswbuf(
#undef _nc_viswbufn
const char *_nc_viswbufn(
- const wchar_t *buf,
+ const wchar_t *buf,
int len)
{ return(*(const char **)0); }
@@ -1619,14 +1699,14 @@ const char *_nc_viswibuf(
#undef _nc_viscbuf2
const char *_nc_viscbuf2(
- int bufnum,
- const cchar_t *buf,
+ int bufnum,
+ const cchar_t *buf,
int len)
{ return(*(const char **)0); }
#undef _nc_viscbuf
const char *_nc_viscbuf(
- const cchar_t *buf,
+ const cchar_t *buf,
int len)
{ return(*(const char **)0); }
@@ -1634,14 +1714,14 @@ const char *_nc_viscbuf(
#undef define_key_sp
int define_key_sp(
- SCREEN *sp,
- const char *str,
+ SCREEN *sp,
+ const char *str,
int keycode)
{ return(*(int *)0); }
#undef define_key
int define_key(
- const char *str,
+ const char *str,
int keycode)
{ return(*(int *)0); }
@@ -1655,7 +1735,7 @@ void _nc_hashed_db(void)
#undef key_defined_sp
int key_defined_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(int *)0); }
@@ -1668,14 +1748,14 @@ int key_defined(
#undef keybound_sp
char *keybound_sp(
- SCREEN *sp,
- int code,
+ SCREEN *sp,
+ int code,
int count)
{ return(*(char **)0); }
#undef keybound
char *keybound(
- int code,
+ int code,
int count)
{ return(*(char **)0); }
@@ -1683,14 +1763,14 @@ char *keybound(
#undef keyok_sp
int keyok_sp(
- SCREEN *sp,
- int c,
+ SCREEN *sp,
+ int c,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef keyok
int keyok(
- int c,
+ int c,
NCURSES_BOOL flag)
{ return(*(int *)0); }
diff --git a/ncurses/llib-ltinfow b/ncurses/llib-ltinfow
index 815e6b3e3c3e..fd308180722a 100644
--- a/ncurses/llib-ltinfow
+++ b/ncurses/llib-ltinfow
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2022,2023 Thomas E. Dickey *
* Copyright 2012-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -58,7 +58,7 @@ char *_nc_basename(
#undef _nc_access
int _nc_access(
- const char *path,
+ const char *path,
int mode)
{ return(*(int *)0); }
@@ -76,12 +76,25 @@ NCURSES_BOOL _nc_is_file_path(
int _nc_env_access(void)
{ return(*(int *)0); }
+#undef _nc_safe_fopen
+FILE *_nc_safe_fopen(
+ const char *path,
+ const char *mode)
+ { return(*(FILE **)0); }
+
+#undef _nc_safe_open3
+int _nc_safe_open3(
+ const char *path,
+ int flags,
+ mode_t mode)
+ { return(*(int *)0); }
+
/* ./tinfo/add_tries.c */
#undef _nc_add_to_try
int _nc_add_to_try(
- TRIES **tree,
- const char *str,
+ TRIES **tree,
+ const char *str,
unsigned code)
{ return(*(int *)0); }
@@ -89,25 +102,25 @@ int _nc_add_to_try(
#undef _nc_align_termtype
void _nc_align_termtype(
- TERMTYPE2 *to,
+ TERMTYPE2 *to,
TERMTYPE2 *from)
{ /* void */ }
#undef _nc_copy_termtype
void _nc_copy_termtype(
- TERMTYPE *dst,
+ TERMTYPE *dst,
const TERMTYPE *src)
{ /* void */ }
#undef _nc_copy_termtype2
void _nc_copy_termtype2(
- TERMTYPE2 *dst,
+ TERMTYPE2 *dst,
const TERMTYPE2 *src)
{ /* void */ }
#undef _nc_export_termtype2
void _nc_export_termtype2(
- TERMTYPE *dst,
+ TERMTYPE *dst,
const TERMTYPE2 *src)
{ /* void */ }
@@ -172,19 +185,19 @@ void _nc_get_type(
#undef _nc_warning
void _nc_warning(
- const char *const fmt,
+ const char *const fmt,
...)
{ /* void */ }
#undef _nc_err_abort
void _nc_err_abort(
- const char *const fmt,
+ const char *const fmt,
...)
{ /* void */ }
#undef _nc_syserr_abort
void _nc_syserr_abort(
- const char *const fmt,
+ const char *const fmt,
...)
{ /* void */ }
@@ -192,14 +205,14 @@ void _nc_syserr_abort(
#undef _nc_find_entry
struct name_table_entry const *_nc_find_entry(
- const char *string,
+ 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,
+ const char *string,
+ int type,
NCURSES_BOOL termcap)
{ return(*(struct name_table_entry const **)0); }
@@ -236,13 +249,13 @@ void _nc_last_db(void)
#undef _nc_next_db
const char *_nc_next_db(
- DBDIRS *state,
+ DBDIRS *state,
int *offset)
{ return(*(const char **)0); }
#undef _nc_first_db
void _nc_first_db(
- DBDIRS *state,
+ DBDIRS *state,
int *offset)
{ /* void */ }
@@ -250,7 +263,7 @@ void _nc_first_db(
#undef _nc_doalloc
void *_nc_doalloc(
- void *oldp,
+ void *oldp,
size_t amount)
{ return(*(void **)0); }
@@ -263,7 +276,7 @@ ENTRY *_nc_tail;
#undef _nc_free_entry
void _nc_free_entry(
- ENTRY *headp,
+ ENTRY *headp,
TERMTYPE2 *tterm)
{ /* void */ }
@@ -300,6 +313,11 @@ void _nc_free_termtype(
TERMTYPE *ptr)
{ /* void */ }
+#undef _nc_free_termtype1
+void _nc_free_termtype1(
+ TERMTYPE *ptr)
+ { /* void */ }
+
#undef _nc_free_termtype2
void _nc_free_termtype2(
TERMTYPE2 *ptr)
@@ -322,7 +340,7 @@ int _nc_getenv_num(
#undef _nc_setenv_num
void _nc_setenv_num(
- const char *name,
+ const char *name,
int value)
{ /* void */ }
@@ -356,8 +374,8 @@ void _nc_init_acs(void)
/* ./tinfo/lib_baudrate.c */
struct speed {
- int given_speed;
- int actual_speed;
+ int given_speed;
+ int actual_speed;
};
#undef _nc_baudrate
@@ -386,7 +404,7 @@ TERMINAL *cur_term;
#undef set_curterm_sp
TERMINAL *set_curterm_sp(
- SCREEN *sp,
+ SCREEN *sp,
TERMINAL *termp)
{ return(*(TERMINAL **)0); }
@@ -397,7 +415,7 @@ TERMINAL *set_curterm(
#undef del_curterm_sp
int del_curterm_sp(
- SCREEN *sp,
+ SCREEN *sp,
TERMINAL *termp)
{ return(*(int *)0); }
@@ -483,7 +501,7 @@ struct kn { short offset; int code; };
#undef keyname_sp
const char *keyname_sp(
- SCREEN *sp,
+ SCREEN *sp,
int c)
{ return(*(const char **)0); }
@@ -507,7 +525,7 @@ char *longname(void)
#undef napms_sp
int napms_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ms)
{ return(*(int *)0); }
@@ -520,19 +538,19 @@ int napms(
#undef idlok
int idlok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef idcok
void idcok(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ /* void */ }
#undef halfdelay_sp
int halfdelay_sp(
- SCREEN *sp,
+ SCREEN *sp,
int t)
{ return(*(int *)0); }
@@ -543,37 +561,37 @@ int halfdelay(
#undef nodelay
int nodelay(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef notimeout
int notimeout(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL f)
{ return(*(int *)0); }
#undef wtimeout
void wtimeout(
- WINDOW *win,
+ WINDOW *win,
int delay)
{ /* void */ }
#undef keypad
int keypad(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef meta
int meta(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef curs_set_sp
int curs_set_sp(
- SCREEN *sp,
+ SCREEN *sp,
int vis)
{ return(*(int *)0); }
@@ -584,7 +602,7 @@ int curs_set(
#undef typeahead_sp
int typeahead_sp(
- SCREEN *sp,
+ SCREEN *sp,
int fd)
{ return(*(int *)0); }
@@ -595,7 +613,7 @@ int typeahead(
#undef has_key_sp
int has_key_sp(
- SCREEN *sp,
+ SCREEN *sp,
int keycode)
{ return(*(int *)0); }
@@ -606,14 +624,14 @@ int has_key(
#undef _nc_putp_flush_sp
int _nc_putp_flush_sp(
- SCREEN *sp,
- const char *name,
+ SCREEN *sp,
+ const char *name,
const char *value)
{ return(*(int *)0); }
#undef _nc_keypad
int _nc_keypad(
- SCREEN *sp,
+ SCREEN *sp,
int flag)
{ return(*(int *)0); }
@@ -675,17 +693,53 @@ void noqiflush(void)
#undef intrflush_sp
int intrflush_sp(
- SCREEN *sp,
- WINDOW *win,
+ SCREEN *sp,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef intrflush
int intrflush(
- WINDOW *win,
+ WINDOW *win,
NCURSES_BOOL flag)
{ return(*(int *)0); }
+#undef is_nl_sp
+int is_nl_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_raw_sp
+int is_raw_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_cbreak_sp
+int is_cbreak_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_echo_sp
+int is_echo_sp(
+ SCREEN *sp)
+ { return(*(int *)0); }
+
+#undef is_nl
+int is_nl(void)
+ { return(*(int *)0); }
+
+#undef is_raw
+int is_raw(void)
+ { return(*(int *)0); }
+
+#undef is_cbreak
+int is_cbreak(void)
+ { return(*(int *)0); }
+
+#undef is_echo
+int is_echo(void)
+ { return(*(int *)0); }
+
/* ./tinfo/lib_setup.c */
#undef ttytype
@@ -699,7 +753,7 @@ int TABSIZE;
#undef set_tabsize_sp
int set_tabsize_sp(
- SCREEN *sp,
+ SCREEN *sp,
int value)
{ return(*(int *)0); }
@@ -715,13 +769,13 @@ int _nc_handle_sigwinch(
#undef use_env_sp
void use_env_sp(
- SCREEN *sp,
+ SCREEN *sp,
NCURSES_BOOL f)
{ /* void */ }
#undef use_tioctl_sp
void use_tioctl_sp(
- SCREEN *sp,
+ SCREEN *sp,
NCURSES_BOOL f)
{ /* void */ }
@@ -737,8 +791,8 @@ void use_tioctl(
#undef _nc_get_screensize
void _nc_get_screensize(
- SCREEN *sp,
- int *linep,
+ SCREEN *sp,
+ int *linep,
int *colp)
{ /* void */ }
@@ -749,13 +803,13 @@ void _nc_update_screensize(
#undef _nc_setup_tinfo
int _nc_setup_tinfo(
- const char *const tn,
+ const char *const tn,
TERMTYPE2 *const tp)
{ return(*(int *)0); }
#undef _nc_tinfo_cmdch
void _nc_tinfo_cmdch(
- TERMINAL *termp,
+ TERMINAL *termp,
int proto)
{ /* void */ }
@@ -774,9 +828,9 @@ int _nc_locale_breaks_acs(
#undef _nc_setupterm
int _nc_setupterm(
- const char *tname,
- int Filedes,
- int *errret,
+ const char *tname,
+ int Filedes,
+ int *errret,
int reuse)
{ return(*(int *)0); }
@@ -786,8 +840,8 @@ SCREEN *new_prescr(void)
#undef setupterm
int setupterm(
- const char *tname,
- int Filedes,
+ const char *tname,
+ int Filedes,
int *errret)
{ return(*(int *)0); }
@@ -800,20 +854,20 @@ char *BC;
#undef tgetent_sp
int tgetent_sp(
- SCREEN *sp,
- char *bufp,
+ SCREEN *sp,
+ char *bufp,
const char *name)
{ return(*(int *)0); }
#undef tgetent
int tgetent(
- char *bufp,
+ char *bufp,
const char *name)
{ return(*(int *)0); }
#undef tgetflag_sp
int tgetflag_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *id)
{ return(*(int *)0); }
@@ -824,7 +878,7 @@ int tgetflag(
#undef tgetnum_sp
int tgetnum_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *id)
{ return(*(int *)0); }
@@ -835,14 +889,14 @@ int tgetnum(
#undef tgetstr_sp
char *tgetstr_sp(
- SCREEN *sp,
- const char *id,
+ SCREEN *sp,
+ const char *id,
char **area)
{ return(*(char **)0); }
#undef tgetstr
char *tgetstr(
- const char *id,
+ const char *id,
char **area)
{ return(*(char **)0); }
@@ -861,8 +915,8 @@ char *termname(void)
#undef tgoto
char *tgoto(
- const char *string,
- int x,
+ const char *string,
+ int x,
int y)
{ return(*(char **)0); }
@@ -870,7 +924,7 @@ char *tgoto(
#undef tigetflag_sp
int tigetflag_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(int *)0); }
@@ -881,7 +935,7 @@ int tigetflag(
#undef tigetnum_sp
int tigetnum_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(int *)0); }
@@ -892,7 +946,7 @@ int tigetnum(
#undef tigetstr_sp
char *tigetstr_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(char **)0); }
@@ -906,32 +960,58 @@ char *tigetstr(
#undef _nc_tparm_err
int _nc_tparm_err;
+#undef _nc_free_tparm
+void _nc_free_tparm(
+ TERMINAL *termp)
+ { /* void */ }
+
#undef _nc_tparm_analyze
int _nc_tparm_analyze(
- const char *string,
- char *p_is_s[9],
+ TERMINAL *term,
+ const char *string,
+ char **p_is_s,
int *_nc_popcount)
{ return(*(int *)0); }
#undef tparm
char *tparm(
- const char *string,
+ const char *string,
...)
{ return(*(char **)0); }
#undef tiparm
char *tiparm(
- const char *string,
+ const char *string,
...)
{ return(*(char **)0); }
+#undef tiparm_s
+char *tiparm_s(
+ int num_expected,
+ int tparm_type,
+ const char *string,
+ ...)
+ { return(*(char **)0); }
+
+#undef tiscan_s
+int tiscan_s(
+ int *num_expected,
+ int *tparm_type,
+ const char *string)
+ { return(*(int *)0); }
+
#undef _nc_tiparm
char *_nc_tiparm(
- int expected,
- const char *string,
+ int expected,
+ const char *string,
...)
{ return(*(char **)0); }
+#undef _nc_reset_tparm
+void _nc_reset_tparm(
+ TERMINAL *term)
+ { /* void */ }
+
/* ./tinfo/lib_tputs.c */
#undef PC
@@ -948,7 +1028,7 @@ void _nc_set_no_padding(
#undef delay_output_sp
int delay_output_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ms)
{ return(*(int *)0); }
@@ -968,7 +1048,7 @@ void _nc_flush(void)
#undef _nc_outch_sp
int _nc_outch_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ch)
{ return(*(int *)0); }
@@ -979,7 +1059,7 @@ int _nc_outch(
#undef _nc_putchar_sp
int _nc_putchar_sp(
- SCREEN *sp,
+ SCREEN *sp,
int ch)
{ return(*(int *)0); }
@@ -990,7 +1070,7 @@ int _nc_putchar(
#undef putp_sp
int putp_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *string)
{ return(*(int *)0); }
@@ -1001,35 +1081,35 @@ int putp(
#undef _nc_putp_sp
int _nc_putp_sp(
- SCREEN *sp,
- const char *name,
+ SCREEN *sp,
+ const char *name,
const char *string)
{ return(*(int *)0); }
#undef _nc_putp
int _nc_putp(
- const char *name,
+ const char *name,
const char *string)
{ return(*(int *)0); }
#undef tputs_sp
int tputs_sp(
- SCREEN *sp,
- const char *string,
- int affcnt,
+ SCREEN *sp,
+ const char *string,
+ int affcnt,
NCURSES_OUTC_sp outc)
{ return(*(int *)0); }
#undef _nc_outc_wrapper
int _nc_outc_wrapper(
- SCREEN *sp,
+ SCREEN *sp,
int c)
{ return(*(int *)0); }
#undef tputs
int tputs(
- const char *string,
- int affcnt,
+ const char *string,
+ int affcnt,
int (*outc)(
int p1))
{ return(*(int *)0); }
@@ -1055,7 +1135,7 @@ void trace(
#undef _tracef
void _tracef(
- const char *fmt,
+ const char *fmt,
...)
{ /* void */ }
@@ -1111,8 +1191,8 @@ WINDOW *_nc_retrace_win(
#undef _nc_fmt_funcptr
char *_nc_fmt_funcptr(
- char *target,
- const char *source,
+ char *target,
+ const char *source,
size_t size)
{ return(*(char **)0); }
@@ -1120,7 +1200,7 @@ char *_nc_fmt_funcptr(
#undef _traceattr2
char *_traceattr2(
- int bufnum,
+ int bufnum,
chtype newmode)
{ return(*(char **)0); }
@@ -1141,13 +1221,13 @@ attr_t _nc_retrace_attr_t(
#undef _nc_altcharset_name
const char *_nc_altcharset_name(
- attr_t attr,
+ attr_t attr,
chtype ch)
{ return(*(const char **)0); }
#undef _tracechtype2
char *_tracechtype2(
- int bufnum,
+ int bufnum,
chtype ch)
{ return(*(char **)0); }
@@ -1163,7 +1243,7 @@ chtype _nc_retrace_chtype(
#undef _tracecchar_t2
char *_tracecchar_t2(
- int bufnum,
+ int bufnum,
const cchar_t *ch)
{ return(*(char **)0); }
@@ -1176,7 +1256,7 @@ char *_tracecchar_t(
#undef _nc_trace_ttymode
char *_nc_trace_ttymode(
- struct termios *tty)
+ const struct termios *tty)
{ return(*(char **)0); }
#undef _nc_tracebits
@@ -1187,7 +1267,7 @@ char *_nc_tracebits(void)
#undef _nc_tracechar
char *_nc_tracechar(
- SCREEN *sp,
+ SCREEN *sp,
int ch)
{ return(*(char **)0); }
@@ -1200,7 +1280,7 @@ char *_tracechar(
#undef _nc_get_tty_mode_sp
int _nc_get_tty_mode_sp(
- SCREEN *sp,
+ SCREEN *sp,
struct termios *buf)
{ return(*(int *)0); }
@@ -1211,7 +1291,7 @@ int _nc_get_tty_mode(
#undef _nc_set_tty_mode_sp
int _nc_set_tty_mode_sp(
- SCREEN *sp,
+ SCREEN *sp,
struct termios *buf)
{ return(*(int *)0); }
@@ -1278,9 +1358,9 @@ int resetty(void)
#undef _nc_timed_wait
int _nc_timed_wait(
- SCREEN *sp,
- int mode,
- int milliseconds,
+ SCREEN *sp,
+ int mode,
+ int milliseconds,
int *timeleft)
{ return(*(int *)0); }
@@ -1293,8 +1373,8 @@ char *_nc_first_name(
#undef _nc_name_match
int _nc_name_match(
- const char *const namelst,
- const char *const name,
+ const char *const namelst,
+ const char *const name,
const char *const delim)
{ return(*(int *)0); }
@@ -1317,14 +1397,14 @@ const char *const strfnames[] = {0};
#undef _nc_set_buffer_sp
void _nc_set_buffer_sp(
- SCREEN *sp,
- FILE *ofp,
+ SCREEN *sp,
+ FILE *ofp,
int buffered)
{ /* void */ }
#undef _nc_set_buffer
void _nc_set_buffer(
- FILE *ofp,
+ FILE *ofp,
int buffered)
{ /* void */ }
@@ -1337,28 +1417,28 @@ void _nc_init_termtype(
#undef _nc_read_termtype
int _nc_read_termtype(
- TERMTYPE2 *ptr,
- char *buffer,
+ TERMTYPE2 *ptr,
+ char *buffer,
int limit)
{ return(*(int *)0); }
#undef _nc_read_file_entry
int _nc_read_file_entry(
- const char *const filename,
+ const char *const filename,
TERMTYPE2 *ptr)
{ return(*(int *)0); }
#undef _nc_read_entry2
int _nc_read_entry2(
- const char *const name,
- char *const filename,
+ const char *const name,
+ char *const filename,
TERMTYPE2 *const tp)
{ return(*(int *)0); }
#undef _nc_read_entry
int _nc_read_entry(
- const char *const name,
- char *const filename,
+ const char *const name,
+ char *const filename,
TERMTYPE *const tp)
{ return(*(int *)0); }
@@ -1372,32 +1452,32 @@ void _nc_read_termcap(void)
#undef _nc_str_init
string_desc *_nc_str_init(
- string_desc *dst,
- char *src,
+ string_desc *dst,
+ char *src,
size_t len)
{ return(*(string_desc **)0); }
#undef _nc_str_null
string_desc *_nc_str_null(
- string_desc *dst,
+ string_desc *dst,
size_t len)
{ return(*(string_desc **)0); }
#undef _nc_str_copy
string_desc *_nc_str_copy(
- string_desc *dst,
- string_desc *src)
+ string_desc *dst,
+ const string_desc *const src)
{ return(*(string_desc **)0); }
#undef _nc_safe_strcat
NCURSES_BOOL _nc_safe_strcat(
- string_desc *dst,
+ string_desc *dst,
const char *src)
{ return(*(NCURSES_BOOL *)0); }
#undef _nc_safe_strcpy
NCURSES_BOOL _nc_safe_strcpy(
- string_desc *dst,
+ string_desc *dst,
const char *src)
{ return(*(NCURSES_BOOL *)0); }
@@ -1405,13 +1485,13 @@ NCURSES_BOOL _nc_safe_strcpy(
#undef _nc_trace_buf
char *_nc_trace_buf(
- int bufnum,
+ int bufnum,
size_t want)
{ return(*(char **)0); }
#undef _nc_trace_bufcat
char *_nc_trace_bufcat(
- int bufnum,
+ int bufnum,
const char *value)
{ return(*(char **)0); }
@@ -1426,21 +1506,21 @@ void _nc_trace_tries(
#undef _nc_expand_try
char *_nc_expand_try(
- TRIES *tree,
- unsigned code,
- int *count,
+ TRIES *tree,
+ unsigned code,
+ int *count,
size_t len)
{ return(*(char **)0); }
#undef _nc_remove_key
int _nc_remove_key(
- TRIES **tree,
+ TRIES **tree,
unsigned code)
{ return(*(int *)0); }
#undef _nc_remove_string
int _nc_remove_string(
- TRIES **tree,
+ TRIES **tree,
const char *string)
{ return(*(int *)0); }
@@ -1455,7 +1535,7 @@ char *_nc_trim_sgr0(
#undef unctrl_sp
const char *unctrl_sp(
- SCREEN *sp,
+ SCREEN *sp,
chtype ch)
{ return(*(const char **)0); }
@@ -1468,7 +1548,7 @@ const char *unctrl(
#undef _nc_visbuf2
const char *_nc_visbuf2(
- int bufnum,
+ int bufnum,
const char *buf)
{ return(*(const char **)0); }
@@ -1479,13 +1559,13 @@ const char *_nc_visbuf(
#undef _nc_visbufn
const char *_nc_visbufn(
- const char *buf,
+ const char *buf,
int len)
{ return(*(const char **)0); }
#undef _nc_viswbuf2
const char *_nc_viswbuf2(
- int bufnum,
+ int bufnum,
const wchar_t *buf)
{ return(*(const char **)0); }
@@ -1496,7 +1576,7 @@ const char *_nc_viswbuf(
#undef _nc_viswbufn
const char *_nc_viswbufn(
- const wchar_t *buf,
+ const wchar_t *buf,
int len)
{ return(*(const char **)0); }
@@ -1507,14 +1587,14 @@ const char *_nc_viswibuf(
#undef _nc_viscbuf2
const char *_nc_viscbuf2(
- int bufnum,
- const cchar_t *buf,
+ int bufnum,
+ const cchar_t *buf,
int len)
{ return(*(const char **)0); }
#undef _nc_viscbuf
const char *_nc_viscbuf(
- const cchar_t *buf,
+ const cchar_t *buf,
int len)
{ return(*(const char **)0); }
@@ -1522,14 +1602,14 @@ const char *_nc_viscbuf(
#undef define_key_sp
int define_key_sp(
- SCREEN *sp,
- const char *str,
+ SCREEN *sp,
+ const char *str,
int keycode)
{ return(*(int *)0); }
#undef define_key
int define_key(
- const char *str,
+ const char *str,
int keycode)
{ return(*(int *)0); }
@@ -1543,7 +1623,7 @@ void _nc_hashed_db(void)
#undef key_defined_sp
int key_defined_sp(
- SCREEN *sp,
+ SCREEN *sp,
const char *str)
{ return(*(int *)0); }
@@ -1556,14 +1636,14 @@ int key_defined(
#undef keybound_sp
char *keybound_sp(
- SCREEN *sp,
- int code,
+ SCREEN *sp,
+ int code,
int count)
{ return(*(char **)0); }
#undef keybound
char *keybound(
- int code,
+ int code,
int count)
{ return(*(char **)0); }
@@ -1571,14 +1651,14 @@ char *keybound(
#undef keyok_sp
int keyok_sp(
- SCREEN *sp,
- int c,
+ SCREEN *sp,
+ int c,
NCURSES_BOOL flag)
{ return(*(int *)0); }
#undef keyok
int keyok(
- int c,
+ int c,
NCURSES_BOOL flag)
{ return(*(int *)0); }
diff --git a/ncurses/new_pair.h b/ncurses/new_pair.h
index dfda89077207..49d7e8b8dbdd 100644
--- a/ncurses/new_pair.h
+++ b/ncurses/new_pair.h
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 2018-2020,2021 Thomas E. Dickey *
* Copyright 2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -34,13 +34,22 @@
/*
* Common type definitions and macros for new_pair.c, lib_color.c
*
- * $Id: new_pair.h,v 1.11 2020/04/11 16:43:47 tom Exp $
+ * $Id: new_pair.h,v 1.13 2021/09/24 17:52:01 tom Exp $
*/
#ifndef NEW_PAIR_H
#define NEW_PAIR_H 1
/* *INDENT-OFF* */
+#include <ncurses_cfg.h>
+#include <ncurses_dll.h>
+
+#include <sys/types.h>
+
+#undef SCREEN
+#define SCREEN struct screen
+SCREEN;
+
#define LIMIT_TYPED(n,t) \
(t)(((n) > MAX_OF_TYPE(t)) \
? MAX_OF_TYPE(t) \
diff --git a/ncurses/report_offsets.c b/ncurses/report_offsets.c
index 2e7083a1e43d..0f82dcf35db7 100644
--- a/ncurses/report_offsets.c
+++ b/ncurses/report_offsets.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 2018-2023,2024 Thomas E. Dickey *
* Copyright 2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -31,14 +31,17 @@
* Author: Thomas E. Dickey *
****************************************************************************/
+#define NEW_PAIR_INTERNAL 1
#include <curses.priv.h>
-MODULE_ID("$Id: report_offsets.c,v 1.21 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: report_offsets.c,v 1.28 2024/02/24 15:59:09 tom Exp $")
#define show_size(type) \
flag = 0; \
last = 0; \
printf("%5lu " #type "\n", (unsigned long)sizeof(type))
+#define show_name(name) \
+ printf("%5lu " #name "\n", (unsigned long)(name))
#define show_offset(type,member) \
next = (unsigned long)offsetof(type,member); \
if (last > next) \
@@ -65,12 +68,7 @@ MODULE_ID("$Id: report_offsets.c,v 1.21 2020/02/02 23:34:34 tom Exp $")
#define show_MLEAKS(type,member) /* nothing */
#endif
-#ifdef USE_TERM_DRIVER
-#define show_NORMAL(type,member) /* nothing */
-#else
#define show_NORMAL(type,member) { flag = "n"; show_offset(type,member); }
-#endif
-
#define show_OPTION(type,member) { flag = "+"; show_offset(type,member); }
#if USE_REENTRANT
@@ -116,9 +114,28 @@ main(void)
#if USE_WIDEC_SUPPORT
show_size(cchar_t);
#endif
+ show_size(color_t);
+ show_size(colorpair_t);
show_size(mmask_t);
+ show_size(rgb_bits_t);
show_size(MEVENT);
show_size(NCURSES_BOOL);
+ show_size(TRIES);
+
+ printf("\n");
+ printf("Sizes of buffers/arrays:\n");
+#if USE_WIDEC_SUPPORT
+ show_name(CCHARW_MAX);
+#endif
+ show_name(EV_MAX);
+ show_name(FIFO_SIZE);
+ show_name(NAMESIZE);
+ show_name(MB_LEN_MAX);
+ show_name(PATH_MAX);
+#ifdef TRACE
+ show_name(TRACECHR_BUF);
+ show_name(TRACEMSE_MAX);
+#endif
printf("\n");
show_size(SCREEN);
@@ -160,7 +177,9 @@ main(void)
#if USE_SIZECHANGE
show_OPTION(SCREEN, _resize);
#endif
- show_DRIVER(SCREEN, _windowlist);
+#ifdef USE_SP_WINDOWLIST
+ show_NORMAL(SCREEN, _windowlist);
+#endif
show_REENTR(SCREEN, _ttytype);
show_SPFUNC(SCREEN, use_tioctl);
show_WIDECH(SCREEN, _screen_acs_fix);
@@ -175,6 +194,7 @@ main(void)
show_offset(TERMINAL, Nttyb);
show_offset(TERMINAL, _baudrate);
show_offset(TERMINAL, _termname);
+ show_offset(TERMINAL, tparm_state);
#if HAVE_INIT_EXTENDED_COLOR
show_COLORS(TERMINAL, type2);
#endif
@@ -187,6 +207,15 @@ main(void)
#endif
printf("\n");
+ show_size(TPARM_STATE);
+ show_offset(TPARM_STATE, stack);
+ show_offset(TPARM_STATE, stack_ptr);
+ show_offset(TPARM_STATE, out_buff);
+ show_offset(TPARM_STATE, fmt_buff);
+ show_offset(TPARM_STATE, static_vars);
+ show_TRACES(TPARM_STATE, tname);
+
+ printf("\n");
show_size(WINDOW);
show_WIDECH(WINDOW, _bkgrnd);
show_COLORS(WINDOW, _color);
@@ -194,8 +223,15 @@ main(void)
printf("\n");
show_size(NCURSES_GLOBALS);
show_offset(NCURSES_GLOBALS, init_signals);
+ show_offset(NCURSES_GLOBALS, tgetent_cache);
+ show_offset(NCURSES_GLOBALS, dbd_vars);
+#if HAVE_TSEARCH
+ show_offset(NCURSES_GLOBALS, cached_tparm);
+#endif
show_DRIVER(NCURSES_GLOBALS, term_driver);
+#ifndef USE_SP_WINDOWLIST
show_NORMAL(NCURSES_GLOBALS, _nc_windowlist);
+#endif
#if USE_HOME_TERMINFO
show_OPTION(NCURSES_GLOBALS, home_terminfo);
#endif
@@ -208,14 +244,18 @@ main(void)
#endif
show_WIDECH(NCURSES_GLOBALS, key_name);
show_TRACES(NCURSES_GLOBALS, trace_opened);
+ show_TRACES(NCURSES_GLOBALS, trace_level);
show_MLEAKS(NCURSES_GLOBALS, leak_checking);
printf("\n");
show_size(NCURSES_PRESCREEN);
+ show_offset(NCURSES_PRESCREEN, tparm_state);
show_offset(NCURSES_PRESCREEN, saved_tty);
show_offset(NCURSES_PRESCREEN, use_tioctl);
show_offset(NCURSES_PRESCREEN, _outch);
+#ifndef USE_SP_RIPOFF
show_NORMAL(NCURSES_PRESCREEN, rippedoff);
+#endif
#if NCURSES_NO_PADDING
show_OPTION(NCURSES_PRESCREEN, _no_padding);
#endif
@@ -224,6 +264,9 @@ main(void)
#else
show_REENTR(NCURSES_PRESCREEN, real_acs_map);
#endif
+#if BROKEN_LINKER || USE_REENTRANT
+ show_TRACES(NCURSES_PRESCREEN, _outchars);
+#endif
return EXIT_SUCCESS;
}
diff --git a/ncurses/term.priv.h b/ncurses/term.priv.h
new file mode 100644
index 000000000000..1f436b5f8254
--- /dev/null
+++ b/ncurses/term.priv.h
@@ -0,0 +1,364 @@
+/****************************************************************************
+ * Copyright 2021-2023,2024 Thomas E. Dickey *
+ * *
+ * 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. *
+ ****************************************************************************/
+
+/*
+ * $Id: term.priv.h,v 1.13 2024/03/02 20:43:06 tom Exp $
+ *
+ * term.priv.h
+ *
+ * Header file for terminfo library objects which are private to
+ * the library.
+ */
+
+#ifndef _TERM_PRIV_H
+#define _TERM_PRIV_H 1
+/* *INDENT-OFF* */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <ncurses_cfg.h>
+
+#ifndef __NCURSES_H
+#include <curses.h>
+#endif
+
+#undef NCURSES_OPAQUE
+#define NCURSES_INTERNALS 1
+#define NCURSES_OPAQUE 0
+
+#if HAVE_LIMITS_H
+# include <limits.h> /* PATH_MAX, MB_LEN_MAX, etc */
+#elif HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+
+#include <signal.h> /* sig_atomic_t */
+#include <time.h> /* time_t */
+#include <term.h> /* time_t */
+
+#ifdef USE_PTHREADS
+#if USE_REENTRANT
+#include <pthread.h>
+#endif
+#endif
+
+/*
+ * If not properly configured to use the system's limits.h, we get gcc's
+ * fallback for limits.h which sets MB_LEN_MAX to 1, which is never correct.
+ */
+#if !HAVE_CONSISTENT_MB_LEN_MAX
+#undef MB_LEN_MAX
+#endif
+
+#ifndef MB_LEN_MAX
+#define MB_LEN_MAX 16 /* should be >= MB_CUR_MAX, but that may be a function */
+#endif
+
+#ifndef PATH_MAX
+# if defined(_POSIX_PATH_MAX)
+# define PATH_MAX _POSIX_PATH_MAX
+# elif defined(MAXPATHLEN)
+# define PATH_MAX MAXPATHLEN
+# else
+# define PATH_MAX 255 /* the Posix minimum path-size */
+# endif
+#endif
+
+/*
+ * State of tparm().
+ */
+#define STACKSIZE 20
+
+typedef struct {
+ union {
+ int num;
+ char * str;
+ } data;
+ bool num_type;
+} STACK_FRAME;
+
+#define NUM_VARS 26
+
+typedef struct {
+ const char * tparam_base;
+
+ STACK_FRAME stack[STACKSIZE];
+ int stack_ptr;
+
+ char * out_buff;
+ size_t out_size;
+ size_t out_used;
+
+ char * fmt_buff;
+ size_t fmt_size;
+
+ int static_vars[NUM_VARS];
+#ifdef TRACE
+ const char * tname;
+#endif
+} TPARM_STATE;
+
+typedef struct {
+ char * text;
+ size_t size;
+} TRACEBUF;
+
+typedef struct {
+ const char * name;
+ char * value;
+} ITERATOR_VARS;
+
+/*
+ * Internals for term.h
+ */
+typedef struct term { /* describe an actual terminal */
+ TERMTYPE type; /* terminal type description */
+ short Filedes; /* file description being written to */
+ TTY Ottyb; /* original state of the terminal */
+ TTY Nttyb; /* current state of the terminal */
+ int _baudrate; /* used to compute padding */
+ char * _termname; /* used for termname() */
+ TPARM_STATE tparm_state;
+#if NCURSES_EXT_COLORS
+ TERMTYPE2 type2; /* extended terminal type description */
+#endif
+#undef TERMINAL
+} TERMINAL;
+
+/*
+ * Internals for soft-keys
+ */
+typedef struct {
+ WINDOW * win; /* the window used in the hook */
+ int line; /* lines to take, < 0 => from bottom*/
+ int (*hook)(WINDOW *, int); /* callback for user */
+} ripoff_t;
+
+/*
+ * Internals for tgetent
+ */
+typedef struct {
+ long sequence;
+ bool last_used;
+ char * fix_sgr0; /* this holds the filtered sgr0 string */
+ char * last_bufp; /* help with fix_sgr0 leak */
+ TERMINAL * last_term;
+} TGETENT_CACHE;
+
+#define TGETENT_MAX 4
+
+#include <term_entry.h> /* dbdLAST */
+
+#ifdef USE_TERM_DRIVER
+struct DriverTCB; /* Terminal Control Block forward declaration */
+#endif
+
+/*
+ * Global data which is not specific to a screen.
+ */
+typedef struct {
+ SIG_ATOMIC_T have_sigtstp;
+ SIG_ATOMIC_T have_sigwinch;
+ SIG_ATOMIC_T cleanup_nested;
+
+ bool init_signals;
+ bool init_screen;
+
+ char * comp_sourcename;
+ char * comp_termtype;
+
+ bool have_tic_directory;
+ bool keep_tic_directory;
+ const char * tic_directory;
+
+ char * dbi_list;
+ int dbi_size;
+
+ char * first_name;
+ char ** keyname_table;
+ int init_keyname;
+
+ int slk_format;
+
+ int getstr_limit; /* getstr_limit based on POSIX LINE_MAX */
+
+ char * safeprint_buf;
+ size_t safeprint_used;
+
+ TGETENT_CACHE tgetent_cache[TGETENT_MAX];
+ int tgetent_index;
+ long tgetent_sequence;
+ int terminal_count;
+
+ char * dbd_blob; /* string-heap for dbd_list[] */
+ char ** dbd_list; /* distinct places to look for data */
+ int dbd_size; /* length of dbd_list[] */
+ time_t dbd_time; /* cache last updated */
+ ITERATOR_VARS dbd_vars[dbdLAST];
+
+#if HAVE_TSEARCH
+ void * cached_tparm;
+ int count_tparm;
+#endif /* HAVE_TSEARCH */
+
+#ifdef USE_TERM_DRIVER
+ int (*term_driver)(struct DriverTCB*, const char*, int*);
+#endif
+
+#define WINDOWLIST struct _win_list
+
+#ifndef USE_SP_WINDOWLIST
+ WINDOWLIST * _nc_windowlist;
+#define WindowList(sp) _nc_globals._nc_windowlist
+#endif
+
+#if USE_HOME_TERMINFO
+ char * home_terminfo;
+#endif
+
+#if !USE_SAFE_SPRINTF
+ int safeprint_cols;
+ int safeprint_rows;
+#endif
+
+#ifdef USE_PTHREADS
+ pthread_mutex_t mutex_curses;
+ pthread_mutex_t mutex_prescreen;
+ pthread_mutex_t mutex_screen;
+ pthread_mutex_t mutex_update;
+ pthread_mutex_t mutex_tst_tracef;
+ pthread_mutex_t mutex_tracef;
+ int nested_tracef;
+ int use_pthreads;
+#define _nc_use_pthreads _nc_globals.use_pthreads
+#if USE_PTHREADS_EINTR
+ pthread_t read_thread; /* The reading thread */
+#endif
+#endif
+#if USE_WIDEC_SUPPORT
+ char key_name[MB_LEN_MAX + 1];
+#endif
+
+#ifdef TRACE
+ bool trace_opened;
+ int trace_level;
+ FILE * trace_fp;
+ int trace_fd;
+
+ char * tracearg_buf;
+ size_t tracearg_used;
+
+ TRACEBUF * tracebuf_ptr;
+ size_t tracebuf_used;
+
+ char tracechr_buf[40];
+
+ char * tracedmp_buf;
+ size_t tracedmp_used;
+
+ unsigned char * tracetry_buf;
+ size_t tracetry_used;
+
+ 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 */
+
+#if NO_LEAKS
+ bool leak_checking;
+#endif
+} NCURSES_GLOBALS;
+
+extern NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals;
+
+#define N_RIPS 5
+
+#ifdef USE_PTHREADS
+typedef struct _prescreen_list {
+ struct _prescreen_list *next;
+ pthread_t id;
+ struct screen * sp;
+} PRESCREEN_LIST;
+#endif
+
+/*
+ * Global data which can be swept up into a SCREEN when one is created.
+ * It may be modified before the next SCREEN is created.
+ */
+typedef struct {
+#ifdef USE_PTHREADS
+ PRESCREEN_LIST *allocated;
+#else
+ struct screen * allocated;
+#endif
+ bool use_env;
+ bool filter_mode;
+ attr_t previous_attr;
+ TPARM_STATE tparm_state;
+ TTY * saved_tty; /* savetty/resetty information */
+ bool use_tioctl;
+ NCURSES_SP_OUTC _outch; /* output handler if not putc */
+#ifndef USE_SP_RIPOFF
+ ripoff_t rippedoff[N_RIPS];
+ ripoff_t * rsp;
+#endif
+#if NCURSES_NO_PADDING
+ bool _no_padding; /* flag to set if padding disabled */
+#endif
+#if BROKEN_LINKER || USE_REENTRANT
+ chtype * real_acs_map;
+ int _LINES;
+ int _COLS;
+ int _TABSIZE;
+ int _ESCDELAY;
+ TERMINAL * _cur_term;
+#endif
+#ifdef TRACE
+#if BROKEN_LINKER || USE_REENTRANT
+ long _outchars;
+ const char * _tputs_trace;
+#endif
+#endif
+} NCURSES_PRESCREEN;
+
+extern NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen;
+
+extern NCURSES_EXPORT(void) _nc_free_tparm(TERMINAL*);
+
+#ifdef __cplusplus
+}
+#endif
+
+/* *INDENT-ON* */
+
+#endif /* _TERM_PRIV_H */
diff --git a/ncurses/tinfo/MKcaptab.sh b/ncurses/tinfo/MKcaptab.sh
index c800023d105a..5f4135028f98 100755
--- a/ncurses/tinfo/MKcaptab.sh
+++ b/ncurses/tinfo/MKcaptab.sh
@@ -1,6 +1,6 @@
#!/bin/sh
##############################################################################
-# Copyright 2019,2020 Thomas E. Dickey #
+# Copyright 2019-2020,2023 Thomas E. Dickey #
# Copyright 2007-2010,2011 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
@@ -27,7 +27,7 @@
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: MKcaptab.sh,v 1.19 2020/02/02 23:34:34 tom Exp $
+# $Id: MKcaptab.sh,v 1.20 2023/04/22 15:12:57 tom Exp $
if test $# != 0
then
@@ -153,7 +153,6 @@ _nc_get_table(bool termcap)
return termcap ? build_names(cap) : build_names(info);
}
-/* entrypoint used by tack 1.07 */
NCURSES_EXPORT(const HashValue *)
_nc_get_hash_table(bool termcap)
{
diff --git a/ncurses/tinfo/MKfallback.sh b/ncurses/tinfo/MKfallback.sh
index 64c65f197e0d..02b36ed739b2 100755
--- a/ncurses/tinfo/MKfallback.sh
+++ b/ncurses/tinfo/MKfallback.sh
@@ -1,6 +1,6 @@
#!/bin/sh
##############################################################################
-# Copyright 2020 Thomas E. Dickey #
+# Copyright 2020,2023 Thomas E. Dickey #
# Copyright 1998-2019,2020 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
@@ -27,7 +27,7 @@
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: MKfallback.sh,v 1.25 2020/08/16 15:58:44 tom Exp $
+# $Id: MKfallback.sh,v 1.26 2023/04/22 15:12:57 tom Exp $
#
# MKfallback.sh -- create fallback table for entry reads
#
@@ -146,9 +146,6 @@ cat <<EOF
#if NCURSES_EXT_NUMBERS
#undef _nc_fallback
-/*
- * This entrypoint is used by tack 1.07
- */
NCURSES_EXPORT(const TERMTYPE *)
_nc_fallback (const char *name)
{
diff --git a/ncurses/tinfo/MKkeys_list.sh b/ncurses/tinfo/MKkeys_list.sh
index 3b8beaee56f3..05ac8cf62578 100755
--- a/ncurses/tinfo/MKkeys_list.sh
+++ b/ncurses/tinfo/MKkeys_list.sh
@@ -1,7 +1,7 @@
#! /bin/sh
-# $Id: MKkeys_list.sh,v 1.7 2020/02/02 23:34:34 tom Exp $
+# $Id: MKkeys_list.sh,v 1.9 2024/01/19 12:26:30 tom Exp $
##############################################################################
-# Copyright 2019,2020 Thomas E. Dickey #
+# Copyright 2019-2022,2024 Thomas E. Dickey #
# Copyright 2001-2003,2017 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
@@ -36,6 +36,7 @@
# Extract function-key names from the Caps file
#
: ${AWK-awk}
+: ${USE_SIGWINCH-0}
if test $# != 0
then
DATA="$*"
@@ -44,7 +45,8 @@ else
fi
data=data$$
-trap 'rm -f $data' EXIT INT QUIT TERM HUP
+trap 'rm -f $data; exit 1' 1 2 3 15
+trap 'rm -f $data' 0
cat $DATA | sed -e 's/[ ][ ]*/ /g' >$data
cat <<EOF
@@ -52,8 +54,8 @@ cat <<EOF
KEY_BREAK
KEY_SRESET
KEY_RESET
-KEY_RESIZE
EOF
+test "$USE_SIGWINCH" = 1 && echo KEY_RESIZE
${AWK-awk} <$data '
/^#/ {next;}
diff --git a/ncurses/tinfo/access.c b/ncurses/tinfo/access.c
index 15593688266e..50a5769c3d63 100644
--- a/ncurses/tinfo/access.c
+++ b/ncurses/tinfo/access.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2019-2021,2023 Thomas E. Dickey *
* Copyright 1998-2011,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -35,9 +35,24 @@
#include <ctype.h>
+#ifndef USE_ROOT_ACCESS
+#if HAVE_SETFSUID
+#include <sys/fsuid.h>
+#else
+#include <sys/stat.h>
+#endif
+#endif
+
+#if HAVE_GETAUXVAL && HAVE_SYS_AUXV_H && defined(__GLIBC__) && (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19)
+#include <sys/auxv.h>
+#define USE_GETAUXVAL 1
+#else
+#define USE_GETAUXVAL 0
+#endif
+
#include <tic.h>
-MODULE_ID("$Id: access.c,v 1.27 2020/08/29 16:22:03 juergen Exp $")
+MODULE_ID("$Id: access.c,v 1.37 2023/06/24 21:55:09 tom Exp $")
#define LOWERCASE(c) ((isalpha(UChar(c)) && isupper(UChar(c))) ? tolower(UChar(c)) : (c))
@@ -55,8 +70,8 @@ _nc_rootname(char *path)
static char *temp;
char *s;
- temp = strdup(result);
- result = temp;
+ if ((temp = strdup(result)) != 0)
+ result = temp;
#if !MIXEDCASE_FILENAMES
for (s = result; *s != '\0'; ++s) {
*s = (char) LOWERCASE(*s);
@@ -169,23 +184,101 @@ _nc_is_file_path(const char *path)
return result;
}
-#ifndef USE_ROOT_ENVIRON
+#if HAVE_GETEUID && HAVE_GETEGID
+#define is_posix_elevated() \
+ (getuid() != geteuid() \
+ || getgid() != getegid())
+#else
+#define is_posix_elevated() FALSE
+#endif
+
+#if HAVE_ISSETUGID
+#define is_elevated() issetugid()
+#elif USE_GETAUXVAL && defined(AT_SECURE)
+#define is_elevated() \
+ (getauxval(AT_SECURE) \
+ ? TRUE \
+ : (errno != ENOENT \
+ ? FALSE \
+ : is_posix_elevated()))
+#else
+#define is_elevated() is_posix_elevated()
+#endif
+
+#if HAVE_SETFSUID
+#define lower_privileges() \
+ int save_err = errno; \
+ setfsuid(getuid()); \
+ setfsgid(getgid()); \
+ errno = save_err
+#define resume_elevation() \
+ save_err = errno; \
+ setfsuid(geteuid()); \
+ setfsgid(getegid()); \
+ errno = save_err
+#else
+#define lower_privileges() /* nothing */
+#define resume_elevation() /* nothing */
+#endif
+
/*
- * Returns true if we allow application to use environment variables that are
- * used for searching lists of directories, etc.
+ * Returns true if not running as root or setuid. We use this check to allow
+ * applications to use environment variables that are used for searching lists
+ * of directories, etc.
*/
NCURSES_EXPORT(int)
_nc_env_access(void)
{
-#if HAVE_ISSETUGID
- if (issetugid())
- return FALSE;
-#elif HAVE_GETEUID && HAVE_GETEGID
- if (getuid() != geteuid()
- || getgid() != getegid())
- return FALSE;
+ int result = TRUE;
+
+#if HAVE_GETUID && HAVE_GETEUID
+#if !defined(USE_SETUID_ENVIRON)
+ if (is_elevated()) {
+ result = FALSE;
+ }
#endif
- /* ...finally, disallow root */
- return (getuid() != ROOT_UID) && (geteuid() != ROOT_UID);
+#if !defined(USE_ROOT_ENVIRON)
+ if ((getuid() == ROOT_UID) || (geteuid() == ROOT_UID)) {
+ result = FALSE;
+ }
+#endif
+#endif /* HAVE_GETUID && HAVE_GETEUID */
+ return result;
}
+
+#ifndef USE_ROOT_ACCESS
+/*
+ * Limit privileges if possible; otherwise disallow access for updating files.
+ */
+NCURSES_EXPORT(FILE *)
+_nc_safe_fopen(const char *path, const char *mode)
+{
+ FILE *result = NULL;
+#if HAVE_SETFSUID
+ lower_privileges();
+ result = fopen(path, mode);
+ resume_elevation();
+#else
+ if (!is_elevated() || *mode == 'r') {
+ result = fopen(path, mode);
+ }
#endif
+ return result;
+}
+
+NCURSES_EXPORT(int)
+_nc_safe_open3(const char *path, int flags, mode_t mode)
+{
+ int result = -1;
+#if HAVE_SETFSUID
+ lower_privileges();
+ result = open(path, flags, mode);
+ resume_elevation();
+#else
+ if (!is_elevated() || (flags & O_RDONLY)) {
+ result = open(path, flags, mode);
+ }
+#endif
+ return result;
+}
+#endif /* USE_ROOT_ACCESS */
diff --git a/ncurses/tinfo/add_tries.c b/ncurses/tinfo/add_tries.c
index d41f488300ae..9d215575fec0 100644
--- a/ncurses/tinfo/add_tries.c
+++ b/ncurses/tinfo/add_tries.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2019-2020,2023 Thomas E. Dickey *
* Copyright 1998-2009,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -39,8 +39,9 @@
*/
#include <curses.priv.h>
+#include <tic.h>
-MODULE_ID("$Id: add_tries.c,v 1.12 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: add_tries.c,v 1.13 2023/06/24 15:36:13 tom Exp $")
#define SET_TRY(dst,src) if ((dst->ch = *src++) == 128) dst->ch = '\0'
#define CMP_TRY(a,b) ((a)? (a == b) : (b == 128))
@@ -53,7 +54,7 @@ _nc_add_to_try(TRIES ** tree, const char *str, unsigned code)
T((T_CALLED("_nc_add_to_try(%p, %s, %u)"),
(void *) *tree, _nc_visbuf(str), code));
- if (txt == 0 || *txt == '\0' || code == 0)
+ if (!VALID_STRING(str) || *txt == '\0' || code == 0)
returnCode(ERR);
if ((*tree) != 0) {
diff --git a/ncurses/tinfo/alloc_entry.c b/ncurses/tinfo/alloc_entry.c
index 4bf7d6c8a082..6280ad4a2b2f 100644
--- a/ncurses/tinfo/alloc_entry.c
+++ b/ncurses/tinfo/alloc_entry.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2022,2023 Thomas E. Dickey *
* Copyright 1998-2013,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -48,13 +48,11 @@
#include <tic.h>
-MODULE_ID("$Id: alloc_entry.c,v 1.64 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: alloc_entry.c,v 1.79 2023/09/15 08:16:12 tom Exp $")
#define ABSENT_OFFSET -1
#define CANCELLED_OFFSET -2
-#define MAX_STRTAB 4096 /* documented maximum entry size */
-
static char *stringbuf; /* buffer for string capabilities */
static size_t next_free; /* next free character in stringbuf */
@@ -62,63 +60,77 @@ NCURSES_EXPORT(void)
_nc_init_entry(ENTRY * const tp)
/* initialize a terminal type data block */
{
+ DEBUG(2, (T_CALLED("_nc_init_entry(tp=%p)"), (void *) tp));
+
+ if (tp == NULL) {
#if NO_LEAKS
- if (tp == 0) {
- if (stringbuf != 0) {
+ if (stringbuf != NULL) {
FreeAndNull(stringbuf);
}
return;
- }
+#else
+ _nc_err_abort("_nc_init_entry called without initialization");
#endif
+ }
- if (stringbuf == 0)
- TYPE_MALLOC(char, (size_t) MAX_STRTAB, stringbuf);
+ if (stringbuf == NULL)
+ TYPE_CALLOC(char, (size_t) MAX_ENTRY_SIZE, stringbuf);
next_free = 0;
_nc_init_termtype(&(tp->tterm));
+
+ DEBUG(2, (T_RETURN("")));
}
NCURSES_EXPORT(ENTRY *)
_nc_copy_entry(ENTRY * oldp)
{
- ENTRY *newp = typeCalloc(ENTRY, 1);
+ ENTRY *newp;
- if (newp != 0) {
+ DEBUG(2, (T_CALLED("_nc_copy_entry(oldp=%p)"), (void *) oldp));
+
+ newp = typeCalloc(ENTRY, 1);
+ if (newp != NULL) {
*newp = *oldp;
_nc_copy_termtype2(&(newp->tterm), &(oldp->tterm));
}
- return newp;
+
+ DEBUG(2, (T_RETURN("%p"), (void *) newp));
+ return (newp);
}
/* save a copy of string in the string buffer */
NCURSES_EXPORT(char *)
-_nc_save_str(const char *const string)
+_nc_save_str(const char *string)
{
char *result = 0;
size_t old_next_free = next_free;
- size_t len;
- if (!VALID_STRING(string))
- return _nc_save_str("");
- len = strlen(string) + 1;
+ if (stringbuf != NULL) {
+ size_t len;
- if (len == 1 && next_free != 0) {
- /*
- * Cheat a little by making an empty string point to the end of the
- * previous string.
- */
- if (next_free < MAX_STRTAB) {
- result = (stringbuf + next_free - 1);
+ if (!VALID_STRING(string))
+ string = "";
+ len = strlen(string) + 1;
+
+ if (len == 1 && next_free != 0) {
+ /*
+ * Cheat a little by making an empty string point to the end of the
+ * previous string.
+ */
+ if (next_free < MAX_ENTRY_SIZE) {
+ result = (stringbuf + next_free - 1);
+ }
+ } else if (next_free + len < MAX_ENTRY_SIZE) {
+ _nc_STRCPY(&stringbuf[next_free], string, MAX_ENTRY_SIZE);
+ DEBUG(7, ("Saved string %s", _nc_visbuf(string)));
+ DEBUG(7, ("at location %d", (int) next_free));
+ next_free += len;
+ result = (stringbuf + old_next_free);
+ } else {
+ _nc_warning("Too much data, some is lost: %s", string);
}
- } else if (next_free + len < MAX_STRTAB) {
- _nc_STRCPY(&stringbuf[next_free], string, MAX_STRTAB);
- DEBUG(7, ("Saved string %s", _nc_visbuf(string)));
- DEBUG(7, ("at location %d", (int) next_free));
- next_free += len;
- result = (stringbuf + old_next_free);
- } else {
- _nc_warning("Too much data, some is lost: %s", string);
}
return result;
}
@@ -130,17 +142,23 @@ _nc_wrap_entry(ENTRY * const ep, bool copy_strings)
int offsets[MAX_ENTRY_SIZE / sizeof(short)];
int useoffsets[MAX_USES];
unsigned i, n;
- unsigned nuses = ep->nuses;
- TERMTYPE2 *tp = &(ep->tterm);
+ unsigned nuses;
+ TERMTYPE2 *tp;
+ DEBUG(2, (T_CALLED("_nc_wrap_entry(ep=%p, copy_strings=%d)"), (void *)
+ ep, copy_strings));
+ if (ep == NULL || stringbuf == NULL)
+ _nc_err_abort("_nc_wrap_entry called without initialization");
+
+ nuses = ep->nuses;
+ tp = &(ep->tterm);
if (copy_strings) {
next_free = 0; /* clear static storage */
/* copy term_names, Strings, uses */
tp->term_names = _nc_save_str(tp->term_names);
for_each_string(i, tp) {
- if (tp->Strings[i] != ABSENT_STRING &&
- tp->Strings[i] != CANCELLED_STRING) {
+ if (VALID_STRING(tp->Strings[i])) {
tp->Strings[i] = _nc_save_str(tp->Strings[i]);
}
}
@@ -215,11 +233,13 @@ _nc_wrap_entry(ENTRY * const ep, bool copy_strings)
#endif
for (i = 0; i < nuses; i++) {
- if (useoffsets[i] == ABSENT_OFFSET)
+ if (useoffsets[i] == ABSENT_OFFSET) {
ep->uses[i].name = 0;
- else
- ep->uses[i].name = (tp->str_table + useoffsets[i]);
+ } else {
+ ep->uses[i].name = strdup(tp->str_table + useoffsets[i]);
+ }
}
+ DEBUG(2, (T_RETURN("")));
}
NCURSES_EXPORT(void)
@@ -230,6 +250,8 @@ _nc_merge_entry(ENTRY * const target, ENTRY * const source)
TERMTYPE2 *from = &(source->tterm);
#if NCURSES_XNAMES
TERMTYPE2 copy;
+ size_t str_size, copy_size;
+ char *str_table;
#endif
unsigned i;
@@ -240,9 +262,102 @@ _nc_merge_entry(ENTRY * const target, ENTRY * const source)
_nc_copy_termtype2(&copy, from);
from = &copy;
_nc_align_termtype(to, from);
+ /*
+ * compute the maximum size of the string-table.
+ */
+ str_size = strlen(to->term_names) + 1;
+ for_each_string(i, from) {
+ if (VALID_STRING(from->Strings[i]))
+ str_size += strlen(from->Strings[i]) + 1;
+ }
+ for_each_string(i, to) {
+ if (VALID_STRING(to->Strings[i]))
+ str_size += strlen(to->Strings[i]) + 1;
+ }
+ /* allocate a string-table large enough for both source/target, and
+ * copy all of the strings into that table. In the merge, we will
+ * select from the original source/target lists to construct a new
+ * target list.
+ */
+ if (str_size != 0) {
+ char *str_copied;
+ if ((str_table = malloc(str_size)) == NULL)
+ _nc_err_abort(MSG_NO_MEMORY);
+ str_copied = str_table;
+ _nc_STRCPY(str_copied, to->term_names, str_size);
+ to->term_names = str_copied;
+ copy_size = strlen(str_copied) + 1;
+ str_copied += copy_size;
+ str_size -= copy_size;
+ for_each_string(i, from) {
+ if (VALID_STRING(from->Strings[i])) {
+ _nc_STRCPY(str_copied, from->Strings[i], str_size);
+ from->Strings[i] = str_copied;
+ copy_size = strlen(str_copied) + 1;
+ str_copied += copy_size;
+ str_size -= copy_size;
+ }
+ }
+ for_each_string(i, to) {
+ if (VALID_STRING(to->Strings[i])) {
+ _nc_STRCPY(str_copied, to->Strings[i], str_size);
+ to->Strings[i] = str_copied;
+ copy_size = strlen(str_copied) + 1;
+ str_copied += copy_size;
+ str_size -= copy_size;
+ }
+ }
+ free(to->str_table);
+ to->str_table = str_table;
+ free(from->str_table);
+ }
+ /*
+ * Do the same for the extended-strings (i.e., lists of capabilities).
+ */
+ str_size = 0;
+ for (i = 0; i < NUM_EXT_NAMES(from); ++i) {
+ if (VALID_STRING(from->ext_Names[i]))
+ str_size += strlen(from->ext_Names[i]) + 1;
+ }
+ for (i = 0; i < NUM_EXT_NAMES(to); ++i) {
+ if (VALID_STRING(to->ext_Names[i]))
+ str_size += strlen(to->ext_Names[i]) + 1;
+ }
+ /* allocate a string-table large enough for both source/target, and
+ * copy all of the strings into that table. In the merge, we will
+ * select from the original source/target lists to construct a new
+ * target list.
+ */
+ if (str_size != 0) {
+ char *str_copied;
+ if ((str_table = malloc(str_size)) == NULL)
+ _nc_err_abort(MSG_NO_MEMORY);
+ str_copied = str_table;
+ for (i = 0; i < NUM_EXT_NAMES(from); ++i) {
+ if (VALID_STRING(from->ext_Names[i])) {
+ _nc_STRCPY(str_copied, from->ext_Names[i], str_size);
+ from->ext_Names[i] = str_copied;
+ copy_size = strlen(str_copied) + 1;
+ str_copied += copy_size;
+ str_size -= copy_size;
+ }
+ }
+ for (i = 0; i < NUM_EXT_NAMES(to); ++i) {
+ if (VALID_STRING(to->ext_Names[i])) {
+ _nc_STRCPY(str_copied, to->ext_Names[i], str_size);
+ to->ext_Names[i] = str_copied;
+ copy_size = strlen(str_copied) + 1;
+ str_copied += copy_size;
+ str_size -= copy_size;
+ }
+ }
+ free(to->ext_str_table);
+ to->ext_str_table = str_table;
+ free(from->ext_str_table);
+ }
#endif
for_each_boolean(i, from) {
- if (to->Booleans[i] != (char) CANCELLED_BOOLEAN) {
+ if (to->Booleans[i] != (NCURSES_SBOOL) CANCELLED_BOOLEAN) {
int mergebool = from->Booleans[i];
if (mergebool == CANCELLED_BOOLEAN)
@@ -279,10 +394,7 @@ _nc_merge_entry(ENTRY * const target, ENTRY * const source)
}
}
#if NCURSES_XNAMES
- /* Discard the data allocated in _nc_copy_termtype2, but do not use
- * _nc_free_termtype2 because that frees the string-table (which is
- * not allocated by _nc_copy_termtype2).
- */
+ /* cleanup */
free(copy.Booleans);
free(copy.Numbers);
free(copy.Strings);
@@ -294,7 +406,7 @@ _nc_merge_entry(ENTRY * const target, ENTRY * const source)
NCURSES_EXPORT(void)
_nc_alloc_entry_leaks(void)
{
- if (stringbuf != 0) {
+ if (stringbuf != NULL) {
FreeAndNull(stringbuf);
}
next_free = 0;
diff --git a/ncurses/tinfo/alloc_ttype.c b/ncurses/tinfo/alloc_ttype.c
index 222868ecefcd..304c1b62f4e6 100644
--- a/ncurses/tinfo/alloc_ttype.c
+++ b/ncurses/tinfo/alloc_ttype.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2022,2023 Thomas E. Dickey *
* Copyright 1999-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -43,7 +43,7 @@
#include <tic.h>
-MODULE_ID("$Id: alloc_ttype.c,v 1.33 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: alloc_ttype.c,v 1.51 2023/09/09 23:15:53 tom Exp $")
#if NCURSES_XNAMES
/*
@@ -377,6 +377,9 @@ adjust_cancels(TERMTYPE2 *to, TERMTYPE2 *from)
int last = first + to->ext_Strings;
int j, k;
+ DEBUG(3, (T_CALLED("adjust_cancels(%s), from(%s)"),
+ NonNull(to->term_names),
+ NonNull(from->term_names)));
for (j = first; j < last;) {
char *name = to->ext_Names[j];
int j_str = to->num_Strings - first - to->ext_Strings;
@@ -413,6 +416,7 @@ adjust_cancels(TERMTYPE2 *to, TERMTYPE2 *from)
j++;
}
}
+ DEBUG(3, (T_RETURN("")));
}
NCURSES_EXPORT(void)
@@ -425,11 +429,11 @@ _nc_align_termtype(TERMTYPE2 *to, TERMTYPE2 *from)
na = to ? ((int) NUM_EXT_NAMES(to)) : 0;
nb = from ? ((int) NUM_EXT_NAMES(from)) : 0;
- DEBUG(2, ("align_termtype to(%d:%s), from(%d:%s)",
+ DEBUG(2, (T_CALLED("_nc_align_termtype to(%d:%s), from(%d:%s)"),
na, to ? NonNull(to->term_names) : "?",
nb, from ? NonNull(from->term_names) : "?"));
- if (na != 0 || nb != 0) {
+ if (to != NULL && from != NULL && (na != 0 || nb != 0)) {
int ext_Booleans, ext_Numbers, ext_Strings;
bool used_ext_Names = FALSE;
@@ -446,11 +450,13 @@ _nc_align_termtype(TERMTYPE2 *to, TERMTYPE2 *from)
break;
}
}
- if (same)
+ if (same) {
+ DEBUG(2, (T_RETURN("")));
return;
+ }
}
/*
- * This is where we pay for having a simple extension representation.
+ * This is where we pay for having a simple extension representation.
* Allocate a new ext_Names array and merge the two ext_Names arrays
* into it, updating to's counts for booleans, etc. Fortunately we do
* this only for the terminfo compiler (tic) and comparer (infocmp).
@@ -507,6 +513,7 @@ _nc_align_termtype(TERMTYPE2 *to, TERMTYPE2 *from)
if (!used_ext_Names)
free(ext_Names);
}
+ DEBUG(2, (T_RETURN("")));
}
#endif
@@ -520,15 +527,17 @@ _nc_align_termtype(TERMTYPE2 *to, TERMTYPE2 *from)
static void
copy_termtype(TERMTYPE2 *dst, const TERMTYPE2 *src, int mode)
{
-#if NCURSES_XNAMES || NCURSES_EXT_NUMBERS
unsigned i;
-#endif
+ int pass;
+ char *new_table;
+ size_t new_table_size;
#if NCURSES_EXT_NUMBERS
short *oldptr = 0;
int *newptr = 0;
#endif
- DEBUG(2, ("copy_termtype"));
+ DEBUG(2, (T_CALLED("copy_termtype(dst=%p, src=%p, mode=%d)"), (void *)
+ dst, (const void *) src, mode));
*dst = *src; /* ...to copy the sizes and string-tables */
TYPE_MALLOC(NCURSES_SBOOL, NUM_BOOLEANS(dst), dst->Booleans);
@@ -541,6 +550,40 @@ copy_termtype(TERMTYPE2 *dst, const TERMTYPE2 *src, int mode)
src->Strings,
NUM_STRINGS(dst) * sizeof(dst->Strings[0]));
+ new_table = NULL;
+ new_table_size = 0;
+ for (pass = 0; pass < 2; ++pass) {
+ size_t str_size = 0;
+ if (src->term_names != NULL) {
+ if (pass) {
+ dst->term_names = new_table + str_size;
+ _nc_STRCPY(dst->term_names + str_size,
+ src->term_names,
+ new_table_size - str_size);
+ }
+ str_size += strlen(src->term_names) + 1;
+ }
+ for_each_string(i, src) {
+ if (VALID_STRING(src->Strings[i])) {
+ if (pass) {
+ _nc_STRCPY(new_table + str_size,
+ src->Strings[i],
+ new_table_size - str_size);
+ dst->Strings[i] = new_table + str_size;
+ }
+ str_size += strlen(src->Strings[i]) + 1;
+ }
+ }
+ if (pass) {
+ dst->str_table = new_table;
+ } else {
+ ++str_size;
+ if ((new_table = malloc(str_size)) == NULL)
+ _nc_err_abort(MSG_NO_MEMORY);
+ new_table_size = str_size;
+ }
+ }
+
#if NCURSES_EXT_NUMBERS
if ((mode & dstINT) == 0) {
DEBUG(2, ("...convert int ->short"));
@@ -584,36 +627,75 @@ copy_termtype(TERMTYPE2 *dst, const TERMTYPE2 *src, int mode)
NUM_NUMBERS(dst) * sizeof(dst->Numbers[0]));
#endif
- /* FIXME: we probably should also copy str_table and ext_str_table,
- * but tic and infocmp are not written to exploit that (yet).
- */
-
#if NCURSES_XNAMES
if ((i = NUM_EXT_NAMES(src)) != 0) {
TYPE_MALLOC(char *, i, dst->ext_Names);
memcpy(dst->ext_Names, src->ext_Names, i * sizeof(char *));
+
+ new_table = NULL;
+ new_table_size = 0;
+ for (pass = 0; pass < 2; ++pass) {
+ size_t str_size = 0;
+ char *raw_data = src->ext_str_table;
+ if (raw_data != NULL) {
+ for (i = 0; i < src->ext_Strings; ++i) {
+ size_t skip = strlen(raw_data) + 1;
+ if (skip != 1) {
+ if (pass) {
+ _nc_STRCPY(new_table + str_size,
+ raw_data,
+ new_table_size - str_size);
+ }
+ str_size += skip;
+ raw_data += skip;
+ }
+ }
+ }
+ for (i = 0; i < NUM_EXT_NAMES(dst); ++i) {
+ if (VALID_STRING(src->ext_Names[i])) {
+ if (pass) {
+ _nc_STRCPY(new_table + str_size,
+ src->ext_Names[i],
+ new_table_size - str_size);
+ dst->ext_Names[i] = new_table + str_size;
+ }
+ str_size += strlen(src->ext_Names[i]) + 1;
+ }
+ }
+ if (pass) {
+ dst->ext_str_table = new_table;
+ } else {
+ ++str_size;
+ if ((new_table = calloc(str_size, 1)) == NULL)
+ _nc_err_abort(MSG_NO_MEMORY);
+ new_table_size = str_size;
+ }
+ }
} else {
dst->ext_Names = 0;
}
#endif
+ (void) new_table_size;
+ DEBUG(2, (T_RETURN("")));
}
-/*
- * This entrypoint is used by tack 1.07
- */
NCURSES_EXPORT(void)
_nc_copy_termtype(TERMTYPE *dst, const TERMTYPE *src)
{
- DEBUG(2, ("_nc_copy_termtype..."));
+ DEBUG(2, (T_CALLED("_nc_copy_termtype(dst=%p, src=%p)"), (void *) dst,
+ (const void *) src));
copy_termtype((TERMTYPE2 *) dst, (const TERMTYPE2 *) src, 0);
+ DEBUG(2, (T_RETURN("")));
}
#if NCURSES_EXT_NUMBERS
NCURSES_EXPORT(void)
_nc_copy_termtype2(TERMTYPE2 *dst, const TERMTYPE2 *src)
{
- DEBUG(2, ("_nc_copy_termtype2..."));
+ DEBUG(2, (T_CALLED("_nc_copy_termtype2(dst=%p, src=%p)"), (void *) dst,
+ (const void *) src));
copy_termtype(dst, src, srcINT | dstINT);
+ DEBUG(2, (T_RETURN("")));
}
/*
@@ -623,7 +705,9 @@ _nc_copy_termtype2(TERMTYPE2 *dst, const TERMTYPE2 *src)
NCURSES_EXPORT(void)
_nc_export_termtype2(TERMTYPE *dst, const TERMTYPE2 *src)
{
- DEBUG(2, ("_nc_export_termtype2..."));
+ DEBUG(2, (T_CALLED("_nc_export_termtype2(dst=%p, src=%p)"), (void *)
+ dst, (const void *) src));
copy_termtype((TERMTYPE2 *) dst, src, srcINT);
+ DEBUG(2, (T_RETURN("")));
}
#endif /* NCURSES_EXT_NUMBERS */
diff --git a/ncurses/tinfo/captoinfo.c b/ncurses/tinfo/captoinfo.c
index de0133b386c6..7e14731df368 100644
--- a/ncurses/tinfo/captoinfo.c
+++ b/ncurses/tinfo/captoinfo.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2020,2021 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -98,7 +98,7 @@
#include <ctype.h>
#include <tic.h>
-MODULE_ID("$Id: captoinfo.c,v 1.100 2020/07/08 21:39:54 tom Exp $")
+MODULE_ID("$Id: captoinfo.c,v 1.102 2021/09/04 10:29:15 tom Exp $")
#if 0
#define DEBUG_THIS(p) DEBUG(9, p)
@@ -634,7 +634,10 @@ _nc_infotocap(const char *cap GCC_UNUSED, const char *str, int const parameteriz
int offset;
} fixups[MAX_TC_FIXUPS];
- DEBUG_THIS(("_nc_infotocap params %d, %s", parameterized, str));
+ DEBUG_THIS(("_nc_infotocap %s params %d, %s",
+ _nc_strict_bsd ? "strict" : "loose",
+ parameterized,
+ _nc_visbuf(str)));
/* we may have to move some trailing mandatory padding up front */
padding = str + strlen(str) - 1;
@@ -673,6 +676,11 @@ _nc_infotocap(const char *cap GCC_UNUSED, const char *str, int const parameteriz
bufptr = save_char(bufptr, *str++);
bufptr = save_char(bufptr, *str);
}
+ } else if (str[0] == ':') {
+ bufptr = save_char(bufptr, '\\');
+ bufptr = save_char(bufptr, '0');
+ bufptr = save_char(bufptr, '7');
+ bufptr = save_char(bufptr, '2');
} else if (str[0] == '\\') {
if (str[1] == '\0' || (str + 1) == trimmed) {
bufptr = save_string(bufptr, "\\134");
@@ -932,7 +940,7 @@ _nc_infotocap(const char *cap GCC_UNUSED, const char *str, int const parameteriz
break;
/*
- * %s isn't in termcap, but it's convenient to pass it through
+ * %s isn't in termcap, but it is convenient to pass it through
* so we can represent things like terminfo pfkey strings in
* termcap notation.
*/
diff --git a/ncurses/tinfo/comp_error.c b/ncurses/tinfo/comp_error.c
index 48f48784d8db..3e6b4022a74b 100644
--- a/ncurses/tinfo/comp_error.c
+++ b/ncurses/tinfo/comp_error.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2019-2020,2023 Thomas E. Dickey *
* Copyright 1998-2012,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -42,7 +42,7 @@
#include <tic.h>
-MODULE_ID("$Id: comp_error.c,v 1.40 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: comp_error.c,v 1.44 2023/06/15 20:27:02 tom Exp $")
NCURSES_EXPORT_VAR(bool) _nc_suppress_warnings = FALSE;
NCURSES_EXPORT_VAR(int) _nc_curr_line = 0; /* current line # in input */
@@ -60,8 +60,15 @@ _nc_get_source(void)
NCURSES_EXPORT(void)
_nc_set_source(const char *const name)
{
- FreeIfNeeded(SourceName);
- SourceName = strdup(name);
+ if (name == NULL) {
+ free(SourceName);
+ SourceName = NULL;
+ } else if (SourceName == NULL) {
+ SourceName = strdup(name);
+ } else if (strcmp(name, SourceName)) {
+ free(SourceName);
+ SourceName = strdup(name);
+ }
}
NCURSES_EXPORT(void)
@@ -95,9 +102,9 @@ static NCURSES_INLINE void
where_is_problem(void)
{
fprintf(stderr, "\"%s\"", SourceName ? SourceName : "?");
- if (_nc_curr_line >= 0)
+ if (_nc_curr_line > 0)
fprintf(stderr, ", line %d", _nc_curr_line);
- if (_nc_curr_col >= 0)
+ if (_nc_curr_col > 0)
fprintf(stderr, ", col %d", _nc_curr_col);
if (TermType != 0 && TermType[0] != '\0')
fprintf(stderr, ", terminal '%s'", TermType);
@@ -148,9 +155,7 @@ _nc_syserr_abort(const char *const fmt, ...)
/* If we're debugging, try to show where the problem occurred - this
* will dump core.
*/
-#ifndef USE_ROOT_ENVIRON
- if (getuid() != ROOT_UID)
-#endif
+ if (_nc_env_access())
abort();
#endif
/* Dumping core in production code is not a good idea.
diff --git a/ncurses/tinfo/comp_expand.c b/ncurses/tinfo/comp_expand.c
index 02e38e6e3c7a..e971384f52f2 100644
--- a/ncurses/tinfo/comp_expand.c
+++ b/ncurses/tinfo/comp_expand.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020-2021,2023 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -36,7 +36,7 @@
#include <ctype.h>
#include <tic.h>
-MODULE_ID("$Id: comp_expand.c,v 1.32 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: comp_expand.c,v 1.35 2023/04/28 20:59:06 tom Exp $")
#if 0
#define DEBUG_THIS(p) DEBUG(9, p)
@@ -87,7 +87,10 @@ _nc_tic_expand(const char *srcp, bool tic_format, int numbers)
return 0;
}
- DEBUG_THIS(("_nc_tic_expand %s", _nc_visbuf(srcp)));
+ DEBUG_THIS(("_nc_tic_expand %s:%s:%s",
+ tic_format ? "ti" : "tc",
+ numbers ? "#" : "",
+ _nc_visbuf(srcp)));
bufp = 0;
while ((ch = UChar(*str)) != 0) {
if (ch == '%' && REALPRINT(str + 1)) {
@@ -126,7 +129,6 @@ _nc_tic_expand(const char *srcp, bool tic_format, int numbers)
if (dst != 0
&& *dst == R_BRACE
&& value < 127
- && value != '\\' /* FIXME */
&& isprint((int) value)) {
ch = (int) value;
buffer[bufp++] = S_QUOTE;
@@ -162,12 +164,12 @@ _nc_tic_expand(const char *srcp, bool tic_format, int numbers)
trailing_spaces(str))) {
buffer[bufp++] = '\\';
buffer[bufp++] = 's';
- } else if ((ch == ',' || ch == ':' || ch == '^') && tic_format) {
+ } else if ((ch == ',' || ch == '^') && tic_format) {
buffer[bufp++] = '\\';
buffer[bufp++] = (char) ch;
} else if (REALPRINT(str)
&& (ch != ','
- && ch != ':'
+ && !(ch == ':' && !tic_format)
&& !(ch == '!' && !tic_format)
&& ch != '^'))
buffer[bufp++] = (char) ch;
@@ -203,7 +205,7 @@ _nc_tic_expand(const char *srcp, bool tic_format, int numbers)
/*
* If most of a short string is ASCII control characters, reformat the
- * string to show those in up-arrow format. For longer strings, it's
+ * string to show those in up-arrow format. For longer strings, it is
* more likely that the characters are just binary coding.
*
* If we're formatting termcap, just use the shorter format (up-arrows).
diff --git a/ncurses/tinfo/comp_hash.c b/ncurses/tinfo/comp_hash.c
index 80755f22052c..4b081afa2c28 100644
--- a/ncurses/tinfo/comp_hash.c
+++ b/ncurses/tinfo/comp_hash.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2019-2020,2023 Thomas E. Dickey *
* Copyright 1998-2008,2009 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -45,13 +45,12 @@
#include <tic.h>
#include <hashsize.h>
-MODULE_ID("$Id: comp_hash.c,v 1.53 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: comp_hash.c,v 1.55 2023/06/24 13:29:43 tom Exp $")
/*
* Finds the entry for the given string in the hash table if present.
* Returns a pointer to the entry in the table or 0 if not found.
*/
-/* entrypoint used by tack 1.07 */
NCURSES_EXPORT(struct name_table_entry const *)
_nc_find_entry(const char *string,
const HashValue * hash_table)
@@ -104,14 +103,16 @@ _nc_find_type_entry(const char *string,
&& data->table_data[hashvalue] >= 0) {
const struct name_table_entry *const table = _nc_get_table(termcap);
- ptr = table + data->table_data[hashvalue];
- while (ptr->nte_type != type
- || !data->compare_names(ptr->nte_name, string)) {
- if (ptr->nte_link < 0) {
- ptr = 0;
- break;
+ if (table != NULL) {
+ ptr = table + data->table_data[hashvalue];
+ while (ptr->nte_type != type
+ || !data->compare_names(ptr->nte_name, string)) {
+ if (ptr->nte_link < 0) {
+ ptr = 0;
+ break;
+ }
+ ptr = table + (ptr->nte_link + data->table_data[data->table_size]);
}
- ptr = table + (ptr->nte_link + data->table_data[data->table_size]);
}
}
diff --git a/ncurses/tinfo/comp_parse.c b/ncurses/tinfo/comp_parse.c
index 2a89a866c374..dec4b925625e 100644
--- a/ncurses/tinfo/comp_parse.c
+++ b/ncurses/tinfo/comp_parse.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2023,2024 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -48,7 +48,7 @@
#include <tic.h>
-MODULE_ID("$Id: comp_parse.c,v 1.110 2020/02/29 15:46:00 anonymous.maarten Exp $")
+MODULE_ID("$Id: comp_parse.c,v 1.134 2024/02/10 15:52:11 tom Exp $")
static void sanity_check2(TERMTYPE2 *, bool);
NCURSES_IMPEXP void (NCURSES_API *_nc_check_termtype2) (TERMTYPE2 *, bool) = sanity_check2;
@@ -59,8 +59,11 @@ static void
enqueue(ENTRY * ep)
/* add an entry to the in-core list */
{
- ENTRY *newp = _nc_copy_entry(ep);
+ ENTRY *newp;
+ DEBUG(2, (T_CALLED("enqueue(ep=%p)"), (void *) ep));
+
+ newp = _nc_copy_entry(ep);
if (newp == 0)
_nc_err_abort(MSG_NO_MEMORY);
@@ -70,6 +73,7 @@ enqueue(ENTRY * ep)
newp->next = 0;
if (newp->last)
newp->last->next = newp;
+ DEBUG(2, (T_RETURN("")));
}
#define NAMEBUFFER_SIZE (MAX_NAME_SIZE + 2)
@@ -217,6 +221,12 @@ _nc_read_entry_source(FILE *fp, char *buf,
bool oldsuppress = _nc_suppress_warnings;
int immediate = 0;
+ DEBUG(2,
+ (T_CALLED("_nc_read_entry_source("
+ "file=%p, buf=%p, literal=%d, silent=%d, hook=%#"
+ PRIxPTR ")"),
+ (void *) fp, buf, literal, silent, CASTxPTR(hook)));
+
if (silent)
_nc_suppress_warnings = TRUE; /* shut the lexer up, too */
@@ -244,29 +254,33 @@ _nc_read_entry_source(FILE *fp, char *buf,
FreeIfNeeded(thisentry.tterm.Booleans);
FreeIfNeeded(thisentry.tterm.Numbers);
FreeIfNeeded(thisentry.tterm.Strings);
+ FreeIfNeeded(thisentry.tterm.str_table);
#if NCURSES_XNAMES
FreeIfNeeded(thisentry.tterm.ext_Names);
+ FreeIfNeeded(thisentry.tterm.ext_str_table);
#endif
}
}
if (_nc_tail) {
/* set up the head pointer */
- for (_nc_head = _nc_tail; _nc_head->last; _nc_head = _nc_head->last)
- continue;
+ for (_nc_head = _nc_tail; _nc_head->last; _nc_head = _nc_head->last) {
+ /* EMPTY */ ;
+ }
- DEBUG(1, ("head = %s", _nc_head->tterm.term_names));
- DEBUG(1, ("tail = %s", _nc_tail->tterm.term_names));
+ DEBUG(2, ("head = %s", _nc_head->tterm.term_names));
+ DEBUG(2, ("tail = %s", _nc_tail->tterm.term_names));
}
#ifdef TRACE
else if (!immediate)
- DEBUG(1, ("no entries parsed"));
+ DEBUG(2, ("no entries parsed"));
#endif
_nc_suppress_warnings = oldsuppress;
+ DEBUG(2, (T_RETURN("")));
}
-#if NCURSES_XNAMES
+#if 0 && NCURSES_XNAMES
static unsigned
find_capname(TERMTYPE2 *p, const char *name)
{
@@ -298,7 +312,9 @@ extended_captype(TERMTYPE2 *p, unsigned which)
} else {
limit += p->ext_Strings;
if (limit != 0 && which < limit) {
- result = STRING;
+ result = ((p->Strings[STRCOUNT + which] != CANCELLED_STRING)
+ ? STRING
+ : CANCEL);
} else if (which >= limit) {
result = CANCEL;
}
@@ -354,24 +370,19 @@ invalid_merge(TERMTYPE2 *to, TERMTYPE2 *from)
&& tf <= STRING
&& (tt == STRING) != (tf == STRING)) {
if (from_name != 0 && strcmp(to_name, from_name)) {
- DEBUG(2,
- ("merge of %s to %s changes type of %s from %s to %s",
- from_name,
- to_name,
- from->ext_Names[n],
- name_of_captype(tf),
- name_of_captype(tt)));
+ _nc_warning("merge of %s to %s changes type of %s from %s to %s",
+ from_name,
+ to_name,
+ from->ext_Names[n],
+ name_of_captype(tf),
+ name_of_captype(tt));
} else {
- DEBUG(2, ("merge of %s changes type of %s from %s to %s",
- to_name,
- from->ext_Names[n],
- name_of_captype(tf),
- name_of_captype(tt)));
+ _nc_warning("merge of %s changes type of %s from %s to %s",
+ to_name,
+ from->ext_Names[n],
+ name_of_captype(tf),
+ name_of_captype(tt));
}
- _nc_warning("merge changes type of %s from %s to %s",
- from->ext_Names[n],
- name_of_captype(tf),
- name_of_captype(tt));
rc = TRUE;
}
}
@@ -392,10 +403,10 @@ _nc_resolve_uses2(bool fullresolve, bool literal)
{
ENTRY *qp, *rp, *lastread = 0;
bool keepgoing;
- unsigned i;
- int unresolved, total_unresolved, multiples;
+ unsigned i, j;
+ int total_unresolved, multiples;
- DEBUG(2, ("RESOLUTION BEGINNING"));
+ DEBUG(2, (T_CALLED("_nc_resolve_uses2")));
/*
* Check for multiple occurrences of the same name.
@@ -404,7 +415,7 @@ _nc_resolve_uses2(bool fullresolve, bool literal)
for_entry_list(qp) {
int matchcount = 0;
- for_entry_list(rp) {
+ for_entry_list2(rp, qp->next) {
if (qp > rp
&& check_collisions(qp->tterm.term_names,
rp->tterm.term_names,
@@ -420,8 +431,10 @@ _nc_resolve_uses2(bool fullresolve, bool literal)
}
}
}
- if (multiples > 0)
+ if (multiples > 0) {
+ DEBUG(2, (T_RETURN("false")));
return (FALSE);
+ }
DEBUG(2, ("NO MULTIPLE NAME OCCURRENCES"));
@@ -431,7 +444,6 @@ _nc_resolve_uses2(bool fullresolve, bool literal)
total_unresolved = 0;
_nc_curr_col = -1;
for_entry_list(qp) {
- unresolved = 0;
for (i = 0; i < qp->nuses; i++) {
bool foundit;
char *child = _nc_first_name(qp->tterm.term_names);
@@ -449,11 +461,21 @@ _nc_resolve_uses2(bool fullresolve, bool literal)
for_entry_list(rp) {
if (rp != qp
&& _nc_name_match(rp->tterm.term_names, lookfor, "|")) {
- DEBUG(2, ("%s: resolving use=%s (in core)",
- child, lookfor));
+ DEBUG(2, ("%s: resolving use=%s %p (in core)",
+ child, lookfor, lookfor));
qp->uses[i].link = rp;
foundit = TRUE;
+
+ /* verify that there are no earlier uses */
+ for (j = 0; j < i; ++j) {
+ if (qp->uses[j].link != NULL
+ && !strcmp(qp->uses[j].link->tterm.term_names,
+ rp->tterm.term_names)) {
+ _nc_warning("duplicate use=%s", lookfor);
+ break;
+ }
+ }
}
}
@@ -475,12 +497,21 @@ _nc_resolve_uses2(bool fullresolve, bool literal)
qp->uses[i].link = rp;
foundit = TRUE;
+
+ /* verify that there are no earlier uses */
+ for (j = 0; j < i; ++j) {
+ if (qp->uses[j].link != NULL
+ && !strcmp(qp->uses[j].link->tterm.term_names,
+ rp->tterm.term_names)) {
+ _nc_warning("duplicate use=%s", lookfor);
+ break;
+ }
+ }
}
}
/* no good, mark this one unresolvable and complain */
if (!foundit) {
- unresolved++;
total_unresolved++;
_nc_curr_line = (int) lookline;
@@ -492,6 +523,7 @@ _nc_resolve_uses2(bool fullresolve, bool literal)
if (total_unresolved) {
/* free entries read in off disk */
_nc_free_entries(lastread);
+ DEBUG(2, (T_RETURN("false")));
return (FALSE);
}
@@ -510,20 +542,22 @@ _nc_resolve_uses2(bool fullresolve, bool literal)
for_entry_list(qp) {
if (qp->nuses > 0) {
- DEBUG(2, ("%s: attempting merge",
- _nc_first_name(qp->tterm.term_names)));
+ DEBUG(2, ("%s: attempting merge of %d entries",
+ _nc_first_name(qp->tterm.term_names),
+ qp->nuses));
/*
* If any of the use entries we're looking for is
* incomplete, punt. We'll catch this entry on a
* subsequent pass.
*/
- for (i = 0; i < qp->nuses; i++)
+ for (i = 0; i < qp->nuses; i++) {
if (qp->uses[i].link
&& qp->uses[i].link->nuses) {
DEBUG(2, ("%s: use entry %d unresolved",
_nc_first_name(qp->tterm.term_names), i));
goto incomplete;
}
+ }
/*
* First, make sure there is no garbage in the
@@ -538,10 +572,10 @@ _nc_resolve_uses2(bool fullresolve, bool literal)
* (reverse) order.
*/
for (; qp->nuses; qp->nuses--) {
- validate_merge(&merged,
- qp->uses[qp->nuses - 1].link);
- _nc_merge_entry(&merged,
- qp->uses[qp->nuses - 1].link);
+ int n = (int) (qp->nuses - 1);
+ validate_merge(&merged, qp->uses[n].link);
+ _nc_merge_entry(&merged, qp->uses[n].link);
+ free(qp->uses[n].name);
}
/*
@@ -556,8 +590,10 @@ _nc_resolve_uses2(bool fullresolve, bool literal)
FreeIfNeeded(qp->tterm.Booleans);
FreeIfNeeded(qp->tterm.Numbers);
FreeIfNeeded(qp->tterm.Strings);
+ FreeIfNeeded(qp->tterm.str_table);
#if NCURSES_XNAMES
FreeIfNeeded(qp->tterm.ext_Names);
+ FreeIfNeeded(qp->tterm.ext_str_table);
#endif
qp->tterm = merged.tterm;
_nc_wrap_entry(qp, TRUE);
@@ -577,13 +613,6 @@ _nc_resolve_uses2(bool fullresolve, bool literal)
DEBUG(2, ("MERGES COMPLETED OK"));
}
- /*
- * We'd like to free entries read in off disk at this point, but can't.
- * The merge_entry() code doesn't copy the strings in the use entries,
- * it just aliases them. If this ever changes, do a
- * free_entries(lastread) here.
- */
-
DEBUG(2, ("RESOLUTION FINISHED"));
if (fullresolve) {
@@ -614,6 +643,14 @@ _nc_resolve_uses2(bool fullresolve, bool literal)
_nc_check_termtype2(&qp->tterm, literal);
+ /*
+ * Checking calls tparm, which can allocate memory. Fix leaks.
+ */
+#define TPS(name) fake_tm.tparm_state.name
+ FreeAndNull(TPS(out_buff));
+ FreeAndNull(TPS(fmt_buff));
+#undef TPS
+
_nc_set_screen(save_SP);
set_curterm(save_tm);
} else {
@@ -623,6 +660,7 @@ _nc_resolve_uses2(bool fullresolve, bool literal)
DEBUG(2, ("SANITY CHECK FINISHED"));
}
+ DEBUG(2, (T_RETURN("true")));
return (TRUE);
}
@@ -709,7 +747,7 @@ sanity_check2(TERMTYPE2 *tp, bool literal)
NCURSES_EXPORT(void)
_nc_leaks_tic(void)
{
- T((T_CALLED("_nc_free_tic()")));
+ T((T_CALLED("_nc_leaks_tic()")));
_nc_globals.leak_checking = TRUE;
_nc_alloc_entry_leaks();
_nc_captoinfo_leaks();
@@ -719,11 +757,13 @@ _nc_leaks_tic(void)
_nc_codes_leaks();
#endif
_nc_tic_expand(0, FALSE, 0);
+ T((T_RETURN("")));
}
NCURSES_EXPORT(void)
_nc_free_tic(int code)
{
+ T((T_CALLED("_nc_free_tic(%d)"), code));
_nc_leaks_tic();
exit_terminfo(code);
}
diff --git a/ncurses/tinfo/comp_scan.c b/ncurses/tinfo/comp_scan.c
index 87929d20aeb9..3ba0835e2fb8 100644
--- a/ncurses/tinfo/comp_scan.c
+++ b/ncurses/tinfo/comp_scan.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+,* Copyright 2020-2022,2023 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -51,7 +51,7 @@
#include <ctype.h>
#include <tic.h>
-MODULE_ID("$Id: comp_scan.c,v 1.109 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: comp_scan.c,v 1.122 2023/05/27 20:13:10 tom Exp $")
/*
* Maximum length of string capability we'll accept before raising an error.
@@ -112,6 +112,9 @@ static FILE *yyin; /* scanner's input file descriptor */
NCURSES_EXPORT(void)
_nc_reset_input(FILE *fp, char *buf)
{
+ TR(TRACE_DATABASE,
+ (T_CALLED("_nc_reset_input(fp=%p, buf=%p)"), (void *) fp, buf));
+
pushtype = NO_PUSHBACK;
if (pushname != 0)
pushname[0] = '\0';
@@ -121,6 +124,8 @@ _nc_reset_input(FILE *fp, char *buf)
if (fp != 0)
_nc_curr_line = 0;
_nc_curr_col = 0;
+
+ returnVoidDB;
}
/*
@@ -136,7 +141,7 @@ last_char(int from_end)
while (len--) {
if (!isspace(UChar(bufptr[len]))) {
- if (from_end < (int) len)
+ if (from_end <= (int) len)
result = bufptr[(int) len - from_end];
break;
}
@@ -145,6 +150,32 @@ last_char(int from_end)
}
/*
+ * Read, like fgets(), but error-out if the input contains nulls.
+ */
+static int
+get_text(char *buffer, int length)
+{
+ int count = 0;
+ int limit = length - 1;
+
+ while (limit-- > 0) {
+ int ch = fgetc(yyin);
+
+ if (ch == '\0') {
+ _nc_err_abort("This is not a text-file");
+ } else if (ch == EOF) {
+ break;
+ }
+ ++count;
+ *buffer++ = (char) ch;
+ if (ch == '\n')
+ break;
+ }
+ *buffer = '\0';
+ return count;
+}
+
+/*
* int next_char()
*
* Returns the next character in the input stream. Comments and leading
@@ -209,7 +240,7 @@ next_char(void)
if (used == 0)
_nc_curr_file_pos = ftell(yyin);
- if (fgets(result + used, (int) (allocated - used), yyin) != 0) {
+ if (get_text(result + used, (int) (allocated - used))) {
bufstart = result;
if (used == 0) {
if (_nc_curr_line == 0
@@ -271,7 +302,7 @@ push_back(int c)
/* push a character back onto the input stream */
{
if (bufptr == bufstart)
- _nc_syserr_abort("Can't backspace off beginning of line");
+ _nc_syserr_abort("cannot backspace off beginning of line");
*--bufptr = (char) c;
_nc_curr_col--;
}
@@ -280,14 +311,16 @@ static long
stream_pos(void)
/* return our current character position in the input stream */
{
- return (yyin ? ftell(yyin) : (bufptr ? bufptr - bufstart : 0));
+ return (yyin ? ftell(yyin) : (bufptr ? (long) (bufptr - bufstart) : 0));
}
static bool
end_of_stream(void)
/* are we at end of input? */
{
- return ((yyin ? feof(yyin) : (bufptr && *bufptr == '\0'))
+ return ((yyin
+ ? (feof(yyin) && (bufptr == NULL || *bufptr == '\0'))
+ : (bufptr && *bufptr == '\0'))
? TRUE : FALSE);
}
@@ -295,9 +328,11 @@ end_of_stream(void)
static NCURSES_INLINE int
eat_escaped_newline(int ch)
{
- if (ch == '\\')
- while ((ch = next_char()) == '\n' || iswhite(ch))
- continue;
+ if (ch == '\\') {
+ while ((ch = next_char()) == '\n' || iswhite(ch)) {
+ /* EMPTY */ ;
+ }
+ }
return ch;
}
@@ -367,6 +402,8 @@ _nc_get_token(bool silent)
int old_col;
#endif
+ DEBUG(3, (T_CALLED("_nc_get_token(silent=%d)"), silent));
+
if (pushtype != NO_PUSHBACK) {
int retval = pushtype;
@@ -379,6 +416,7 @@ _nc_get_token(bool silent)
pushname[0] = '\0';
/* currtok wasn't altered by _nc_push_token() */
+ DEBUG(3, (T_RETURN("%d"), retval));
return (retval);
}
@@ -389,6 +427,7 @@ _nc_get_token(bool silent)
if (_nc_curr_token.tk_name == tok_buf)
_nc_curr_token.tk_name = 0;
}
+ DEBUG(3, (T_RETURN("%d"), EOF));
return (EOF);
}
@@ -397,7 +436,6 @@ _nc_get_token(bool silent)
while ((ch = next_char()) == '\n' || iswhite(ch)) {
if (ch == '\n')
had_newline = TRUE;
- continue;
}
ch = eat_escaped_newline(ch);
@@ -422,8 +460,9 @@ _nc_get_token(bool silent)
dot_flag = TRUE;
DEBUG(8, ("dot-flag set"));
- while ((ch = next_char()) == '.' || iswhite(ch))
- continue;
+ while ((ch = next_char()) == '.' || iswhite(ch)) {
+ /* EMPTY */ ;
+ }
}
if (ch == EOF) {
@@ -556,7 +595,7 @@ _nc_get_token(bool silent)
* Grrr...what we ought to do here is barf, complaining that
* the entry is malformed. But because a couple of name fields
* in the 8.2 termcap file end with |\, we just have to assume
- * it's termcap syntax.
+ * it is termcap syntax.
*/
_nc_syntax = SYN_TERMCAP;
separator = ':';
@@ -564,8 +603,9 @@ _nc_get_token(bool silent)
/* throw away trailing /, *$/ */
for (--tok_ptr;
iswhite(*tok_ptr) || *tok_ptr == ',';
- tok_ptr--)
- continue;
+ tok_ptr--) {
+ /* EMPTY */ ;
+ }
tok_ptr[1] = '\0';
}
@@ -587,14 +627,15 @@ _nc_get_token(bool silent)
*/
if (after_list != 0) {
if (!silent) {
- if (*after_list == '\0')
+ if (*after_list == '\0' || strchr("|", after_list[1]) != NULL) {
_nc_warning("empty longname field");
- else if (strchr(after_list, ' ') == 0)
+ } else if (strchr(after_list, ' ') == 0) {
_nc_warning("older tic versions may treat the description field as an alias");
+ }
}
} else {
after_list = tok_buf + strlen(tok_buf);
- DEBUG(1, ("missing description"));
+ DEBUG(2, ("missing description"));
}
/*
@@ -769,6 +810,7 @@ _nc_get_token(bool silent)
: "<null>"),
type));
+ DEBUG(3, (T_RETURN("%d"), type));
return (type);
}
@@ -792,7 +834,7 @@ _nc_get_token(bool silent)
*/
NCURSES_EXPORT(int)
-_nc_trans_string(char *ptr, char *last)
+_nc_trans_string(char *ptr, const char *const last)
{
int count = 0;
int number = 0;
diff --git a/ncurses/tinfo/db_iterator.c b/ncurses/tinfo/db_iterator.c
index f0726682c403..db3872e3f90d 100644
--- a/ncurses/tinfo/db_iterator.c
+++ b/ncurses/tinfo/db_iterator.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 2018-2022,2023 Thomas E. Dickey *
* Copyright 2006-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -44,7 +44,7 @@
#include <hashed_db.h>
#endif
-MODULE_ID("$Id: db_iterator.c,v 1.48 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: db_iterator.c,v 1.50 2023/06/24 21:52:32 tom Exp $")
#define HaveTicDirectory _nc_globals.have_tic_directory
#define KeepTicDirectory _nc_globals.keep_tic_directory
@@ -202,6 +202,13 @@ free_cache(void)
FreeAndNull(my_list);
}
+static void
+update_tic_dir(const char *update)
+{
+ free((char *) TicDirectory);
+ TicDirectory = update;
+}
+
/*
* Record the "official" location of the terminfo directory, according to
* the place where we're writing to, or the normal default, if not.
@@ -211,8 +218,9 @@ _nc_tic_dir(const char *path)
{
T(("_nc_tic_dir %s", NonNull(path)));
if (!KeepTicDirectory) {
- if (path != 0) {
- TicDirectory = path;
+ if (path != NULL) {
+ if (path != TicDirectory)
+ update_tic_dir(strdup(path));
HaveTicDirectory = TRUE;
} else if (HaveTicDirectory == 0) {
if (use_terminfo_vars()) {
@@ -375,8 +383,11 @@ _nc_first_db(DBDIRS * state, int *offset)
*/
for (j = 0; my_list[j] != 0; ++j) {
#ifdef TERMINFO
- if (*my_list[j] == '\0')
- my_list[j] = strdup(TERMINFO);
+ if (*my_list[j] == '\0') {
+ char *my_copy = strdup(TERMINFO);
+ if (my_copy != 0)
+ my_list[j] = my_copy;
+ }
#endif
trim_formatting(my_list[j]);
for (k = 0; k < j; ++k) {
@@ -444,5 +455,6 @@ _nc_db_iterator_leaks(void)
FreeIfNeeded(my_vars[which].value);
my_vars[which].value = 0;
}
+ update_tic_dir(NULL);
}
#endif
diff --git a/ncurses/tinfo/doalloc.c b/ncurses/tinfo/doalloc.c
index 0bda12cae8be..e3b1a2e96c1b 100644
--- a/ncurses/tinfo/doalloc.c
+++ b/ncurses/tinfo/doalloc.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2002,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -40,15 +40,18 @@
#include <curses.priv.h>
-MODULE_ID("$Id: doalloc.c,v 1.13 2020/08/30 00:27:15 tom Exp $")
+MODULE_ID("$Id: doalloc.c,v 1.14 2021/04/24 23:43:39 tom Exp $")
void *
_nc_doalloc(void *oldp, size_t amount)
{
void *newp;
- if (oldp != 0) {
- if ((newp = realloc(oldp, amount)) == 0) {
+ if (oldp != NULL) {
+ if (amount == 0) {
+ free(oldp);
+ newp = NULL;
+ } else if ((newp = realloc(oldp, amount)) == 0) {
free(oldp);
errno = ENOMEM; /* just in case 'free' reset */
}
diff --git a/ncurses/tinfo/entries.c b/ncurses/tinfo/entries.c
index 1c55bfec0b78..f47fd3fe9eff 100644
--- a/ncurses/tinfo/entries.c
+++ b/ncurses/tinfo/entries.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2019-2022,2023 Thomas E. Dickey *
* Copyright 2006-2012,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -38,7 +38,7 @@
#include <tic.h>
-MODULE_ID("$Id: entries.c,v 1.30 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: entries.c,v 1.35 2023/05/27 20:13:10 tom Exp $")
/****************************************************************************
*
@@ -65,7 +65,7 @@ NCURSES_EXPORT_VAR(ENTRY *) _nc_head = 0;
NCURSES_EXPORT_VAR(ENTRY *) _nc_tail = 0;
static ENTRY *
-_nc_delink_entry(ENTRY * headp, TERMTYPE2 *tterm)
+_nc_delink_entry(ENTRY * headp, const TERMTYPE2 *const tterm)
/* delink the allocated storage for the given list entry */
{
ENTRY *ep, *last;
@@ -119,12 +119,28 @@ _nc_leaks_tinfo(void)
char *s;
#endif
- T((T_CALLED("_nc_free_tinfo()")));
+ T((T_CALLED("_nc_leaks_tinfo()")));
#if NO_LEAKS
_nc_globals.leak_checking = TRUE;
- _nc_free_tparm();
+ _nc_free_tparm(cur_term);
_nc_tgetent_leaks();
+#ifdef USE_PTHREADS
+ /*
+ * Discard any prescreen data which is not used for the current screen.
+ */
+ _nc_lock_global(screen);
+ {
+ PRESCREEN_LIST *p;
+ pthread_t id = GetThreadID();
+ for (p = _nc_prescreen.allocated; p != 0; p = p->next) {
+ if (p->id == id && p->sp != CURRENT_SCREEN) {
+ FreeAndNull(p->sp);
+ }
+ }
+ }
+ _nc_unlock_global(screen);
+#endif
if (TerminalOf(CURRENT_SCREEN) != 0) {
del_curterm(TerminalOf(CURRENT_SCREEN));
}
@@ -161,6 +177,7 @@ _nc_leaks_tinfo(void)
NCURSES_EXPORT(void)
_nc_free_tinfo(int code)
{
+ T((T_CALLED("_nc_free_tinfo(%d)"), code));
_nc_leaks_tinfo();
exit(code);
}
@@ -169,6 +186,7 @@ _nc_free_tinfo(int code)
NCURSES_EXPORT(void)
exit_terminfo(int code)
{
+ T((T_CALLED("exit_terminfo(%d)"), code));
#if NO_LEAKS
_nc_leaks_tinfo();
#endif
diff --git a/ncurses/tinfo/free_ttype.c b/ncurses/tinfo/free_ttype.c
index 7f0fbcc35f29..7935152a7920 100644
--- a/ncurses/tinfo/free_ttype.c
+++ b/ncurses/tinfo/free_ttype.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020-2022,2023 Thomas E. Dickey *
* Copyright 1999-2011,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -43,12 +43,12 @@
#include <tic.h>
-MODULE_ID("$Id: free_ttype.c,v 1.19 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: free_ttype.c,v 1.22 2023/04/22 15:12:57 tom Exp $")
static void
really_free_termtype(TERMTYPE2 *ptr, bool freeStrings)
{
- T(("_nc_free_termtype(%s)", ptr->term_names));
+ T(("really_free_termtype(%s) %d", ptr->term_names, freeStrings));
if (freeStrings) {
FreeIfNeeded(ptr->str_table);
@@ -66,15 +66,21 @@ really_free_termtype(TERMTYPE2 *ptr, bool freeStrings)
_nc_free_entry(_nc_head, ptr);
}
-/*
- * This entrypoint is used by tack 1.07
- */
NCURSES_EXPORT(void)
_nc_free_termtype(TERMTYPE *ptr)
{
really_free_termtype((TERMTYPE2 *) ptr, !NCURSES_EXT_NUMBERS);
}
+/*
+ * These similar entrypoints are not used outside of ncurses.
+ */
+NCURSES_EXPORT(void)
+_nc_free_termtype1(TERMTYPE *ptr)
+{
+ really_free_termtype((TERMTYPE2 *) ptr, TRUE);
+}
+
#if NCURSES_EXT_NUMBERS
NCURSES_EXPORT(void)
_nc_free_termtype2(TERMTYPE2 *ptr)
diff --git a/ncurses/tinfo/init_keytry.c b/ncurses/tinfo/init_keytry.c
index 1669c6414c18..ef20dfb1da08 100644
--- a/ncurses/tinfo/init_keytry.c
+++ b/ncurses/tinfo/init_keytry.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2023 Thomas E. Dickey *
* Copyright 1999-2010,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -30,7 +30,7 @@
#include <curses.priv.h>
#include <tic.h> /* struct tinfo_fkeys */
-MODULE_ID("$Id: init_keytry.c,v 1.19 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: init_keytry.c,v 1.20 2023/09/16 12:55:01 tom Exp $")
/*
** _nc_init_keytry()
@@ -67,6 +67,8 @@ _nc_tinfo_fkeysf(void)
NCURSES_EXPORT(void)
_nc_init_keytry(SCREEN *sp)
{
+ T(("_nc_init_keytry(%p)", (void *) sp));
+
/* The sp->_keytry value is initialized in newterm(), where the sp
* structure is created, because we can not tell where keypad() or
* mouse_activate() (which will call keyok()) are first called.
@@ -95,7 +97,7 @@ _nc_init_keytry(SCREEN *sp)
char *value = tp->Strings[n];
if (name != 0
&& *name == 'k'
- && value != 0
+ && VALID_STRING(value)
&& NCURSES_SP_NAME(key_defined) (NCURSES_SP_ARGx
value) == 0) {
(void) _nc_add_to_try(&(sp->_keytry),
diff --git a/ncurses/tinfo/lib_cur_term.c b/ncurses/tinfo/lib_cur_term.c
index 0373aebb11b9..1f8db2c1e0c8 100644
--- a/ncurses/tinfo/lib_cur_term.c
+++ b/ncurses/tinfo/lib_cur_term.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+,* Copyright 2020-2021,2022 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -41,7 +41,7 @@
#include <termcap.h> /* ospeed */
#include <tic.h> /* VALID_STRING */
-MODULE_ID("$Id: lib_cur_term.c,v 1.43 2020/10/24 18:54:32 tom Exp $")
+MODULE_ID("$Id: lib_cur_term.c,v 1.49 2022/05/28 17:56:55 tom Exp $")
#undef CUR
#define CUR TerminalType(termp).
@@ -147,7 +147,11 @@ NCURSES_SP_NAME(del_curterm) (NCURSES_SP_DCLx TERMINAL *termp)
);
#if NCURSES_EXT_NUMBERS
- _nc_free_termtype(&termp->type);
+#if NCURSES_EXT_COLORS
+ _nc_free_termtype1(&termp->type);
+#else
+ _nc_free_termtype2(&termp->type);
+#endif
#endif
_nc_free_termtype2(&TerminalType(termp));
if (termp == cur)
@@ -167,10 +171,17 @@ NCURSES_SP_NAME(del_curterm) (NCURSES_SP_DCLx TERMINAL *termp)
/* discard memory used in tgetent's cache for this terminal */
_nc_tgetent_leak(termp);
#endif
+ if (--_nc_globals.terminal_count == 0) {
+ _nc_free_tparm(termp);
+ }
+
+ free(termp->tparm_state.fmt_buff);
+ free(termp->tparm_state.out_buff);
free(termp);
rc = OK;
}
+
returnCode(rc);
}
diff --git a/ncurses/tinfo/lib_data.c b/ncurses/tinfo/lib_data.c
index 39274f4e7c39..b817f49bd78a 100644
--- a/ncurses/tinfo/lib_data.c
+++ b/ncurses/tinfo/lib_data.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 2018-2022,2024 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -43,7 +43,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_data.c,v 1.81 2020/06/13 22:01:14 tom Exp $")
+MODULE_ID("$Id: lib_data.c,v 1.89 2024/02/24 18:11:38 tom Exp $")
/*
* OS/2's native linker complains if we don't initialize public data when
@@ -148,6 +148,7 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = {
TGETENT_0s, /* tgetent_cache */
0, /* tgetent_index */
0, /* tgetent_sequence */
+ 0, /* terminal_count */
0, /* dbd_blob */
0, /* dbd_list */
@@ -195,7 +196,6 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = {
#endif
#ifdef TRACE
FALSE, /* trace_opened */
- CHARS_0s, /* trace_fname */
0, /* trace_level */
NULL, /* trace_fp */
-1, /* trace_fd */
@@ -251,7 +251,6 @@ NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen = {
NULL, /* fmt_buff */
0, /* fmt_size */
- NUM_VARS_0s, /* dynamic_var */
NUM_VARS_0s, /* static_vars */
#ifdef TRACE
NULL, /* tname */
@@ -363,25 +362,28 @@ _nc_mutex_init(pthread_mutex_t * obj)
NCURSES_EXPORT(int)
_nc_mutex_lock(pthread_mutex_t * obj)
{
- if (_nc_use_pthreads == 0)
- return 0;
- return pthread_mutex_lock(obj);
+ int rc = 0;
+ if (_nc_use_pthreads != 0)
+ rc = pthread_mutex_lock(obj);
+ return rc;
}
NCURSES_EXPORT(int)
_nc_mutex_trylock(pthread_mutex_t * obj)
{
- if (_nc_use_pthreads == 0)
- return 0;
- return pthread_mutex_trylock(obj);
+ int rc = 0;
+ if (_nc_use_pthreads != 0)
+ rc = pthread_mutex_trylock(obj);
+ return rc;
}
NCURSES_EXPORT(int)
_nc_mutex_unlock(pthread_mutex_t * obj)
{
- if (_nc_use_pthreads == 0)
- return 0;
- return pthread_mutex_unlock(obj);
+ int rc = 0;
+ if (_nc_use_pthreads != 0)
+ rc = pthread_mutex_unlock(obj);
+ return rc;
}
#endif /* USE_PTHREADS */
diff --git a/ncurses/tinfo/lib_kernel.c b/ncurses/tinfo/lib_kernel.c
index d5b021b80728..46f652b0a30a 100644
--- a/ncurses/tinfo/lib_kernel.c
+++ b/ncurses/tinfo/lib_kernel.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020-2022,2023 Thomas E. Dickey *
* Copyright 1998-2009,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -49,7 +49,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_kernel.c,v 1.34 2020/11/21 22:05:58 tom Exp $")
+MODULE_ID("$Id: lib_kernel.c,v 1.36 2023/06/10 13:29:06 tom Exp $")
#ifdef TERMIOS
static int
@@ -59,7 +59,7 @@ _nc_vdisable(void)
#if defined(_POSIX_VDISABLE) && HAVE_UNISTD_H
value = _POSIX_VDISABLE;
#endif
-#if defined(_PC_VDISABLE)
+#if defined(_PC_VDISABLE) && HAVE_FPATHCONF
if (value == -1) {
value = (int) fpathconf(0, _PC_VDISABLE);
if (value == -1) {
@@ -148,34 +148,40 @@ killchar(void)
}
#endif
+static void
+flush_input(int fd)
+{
+#ifdef TERMIOS
+ tcflush(fd, TCIFLUSH);
+#else /* !TERMIOS */
+ errno = 0;
+ do {
+#if defined(EXP_WIN32_DRIVER)
+ _nc_console_flush(_nc_console_fd2handle(fd));
+#else
+ ioctl(fd, TIOCFLUSH, 0);
+#endif
+ } while
+ (errno == EINTR);
+#endif
+}
+
/*
* flushinp()
*
- * Flush any input on cur_term->Filedes
- *
+ * Flush any input on tty
*/
NCURSES_EXPORT(int)
NCURSES_SP_NAME(flushinp) (NCURSES_SP_DCL0)
{
- TERMINAL *termp = TerminalOf(SP_PARM);
-
T((T_CALLED("flushinp(%p)"), (void *) SP_PARM));
- if (termp != 0) {
-#ifdef TERMIOS
- tcflush(termp->Filedes, TCIFLUSH);
-#else
- errno = 0;
- do {
-#if defined(EXP_WIN32_DRIVER)
- _nc_console_flush(_nc_console_fd2handle(termp->Filedes));
-#else
- ioctl(termp->Filedes, TIOCFLUSH, 0);
-#endif
- } while
- (errno == EINTR);
-#endif
+ if (SP_PARM != 0) {
+ if (NC_ISATTY(SP_PARM->_ifd))
+ flush_input(SP_PARM->_ifd);
+ else if (NC_ISATTY(SP_PARM->_ofd))
+ flush_input(SP_PARM->_ofd);
if (SP_PARM) {
SP_PARM->_fifohead = -1;
SP_PARM->_fifotail = 0;
diff --git a/ncurses/tinfo/lib_longname.c b/ncurses/tinfo/lib_longname.c
index 835d15ccafc1..9dc6d71e2ad4 100644
--- a/ncurses/tinfo/lib_longname.c
+++ b/ncurses/tinfo/lib_longname.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2010,2015 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -43,7 +43,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_longname.c,v 1.14 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_longname.c,v 1.15 2021/04/03 22:36:21 tom Exp $")
#if USE_REENTRANT
NCURSES_EXPORT(char *)
@@ -51,11 +51,12 @@ NCURSES_SP_NAME(longname) (NCURSES_SP_DCL0)
{
static char empty[] =
{'\0'};
- char *ptr;
T((T_CALLED("longname(%p)"), (void *) SP_PARM));
if (SP_PARM) {
+ char *ptr;
+
for (ptr = SP_PARM->_ttytype + strlen(SP_PARM->_ttytype);
ptr > SP_PARM->_ttytype;
ptr--)
diff --git a/ncurses/tinfo/lib_napms.c b/ncurses/tinfo/lib_napms.c
index 3a9fc3168784..1b89a54c799b 100644
--- a/ncurses/tinfo/lib_napms.c
+++ b/ncurses/tinfo/lib_napms.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2023 Thomas E. Dickey *
* Copyright 1998-2014,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -52,13 +52,16 @@
#endif
#endif
-MODULE_ID("$Id: lib_napms.c,v 1.27 2020/08/15 19:45:23 tom Exp $")
+MODULE_ID("$Id: lib_napms.c,v 1.28 2023/09/16 16:09:33 tom Exp $")
NCURSES_EXPORT(int)
NCURSES_SP_NAME(napms) (NCURSES_SP_DCLx int ms)
{
T((T_CALLED("napms(%d)"), ms));
+ if (ms > MAX_DELAY_MSECS)
+ ms = MAX_DELAY_MSECS;
+
#ifdef USE_TERM_DRIVER
CallDriver_1(SP_PARM, td_nap, ms);
#else /* !USE_TERM_DRIVER */
diff --git a/ncurses/tinfo/lib_options.c b/ncurses/tinfo/lib_options.c
index 017a34aac6e7..6a8bb39489ce 100644
--- a/ncurses/tinfo/lib_options.c
+++ b/ncurses/tinfo/lib_options.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020,2021 Thomas E. Dickey *
+ * Copyright 2020-2021,2023 Thomas E. Dickey *
* Copyright 1998-2014,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -47,7 +47,7 @@
#define CUR SP_TERMTYPE
#endif
-MODULE_ID("$Id: lib_options.c,v 1.82 2021/02/14 00:17:35 tom Exp $")
+MODULE_ID("$Id: lib_options.c,v 1.83 2023/04/29 18:56:12 tom Exp $")
NCURSES_EXPORT(int)
idlok(WINDOW *win, bool flag)
@@ -92,7 +92,7 @@ NCURSES_SP_NAME(halfdelay) (NCURSES_SP_DCLx int t)
returnCode(ERR);
NCURSES_SP_NAME(cbreak) (NCURSES_SP_ARG);
- SP_PARM->_cbreak = t + 1;
+ IsCbreak(SP_PARM) = t + 1;
returnCode(OK);
}
diff --git a/ncurses/tinfo/lib_print.c b/ncurses/tinfo/lib_print.c
index 4accdf6786ea..e7d8535ef603 100644
--- a/ncurses/tinfo/lib_print.c
+++ b/ncurses/tinfo/lib_print.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 2018-2021,2023 Thomas E. Dickey *
* Copyright 1998-2011,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -40,14 +40,14 @@
#define CUR SP_TERMTYPE
#endif
-MODULE_ID("$Id: lib_print.c,v 1.28 2020/08/29 16:22:03 juergen Exp $")
+MODULE_ID("$Id: lib_print.c,v 1.31 2023/06/10 12:44:41 tom Exp $")
NCURSES_EXPORT(int)
NCURSES_SP_NAME(mcprint) (NCURSES_SP_DCLx char *data, int len)
/* ship binary character data to the printer via mc4/mc5/mc5p */
{
int result;
- char *mybuf, *switchon;
+ char *mybuf = NULL, *switchon;
size_t onsize, offsize;
size_t need;
@@ -73,6 +73,7 @@ NCURSES_SP_NAME(mcprint) (NCURSES_SP_DCLx char *data, int len)
if (switchon == 0
|| (mybuf = typeMalloc(char, need + 1)) == 0) {
+ free(mybuf);
errno = ENOMEM;
return (ERR);
}
@@ -89,7 +90,7 @@ NCURSES_SP_NAME(mcprint) (NCURSES_SP_DCLx char *data, int len)
* data has actually been shipped to the terminal. If the write(2)
* operation is truly atomic we're protected from this.
*/
- result = (int) write(TerminalOf(SP_PARM)->Filedes, mybuf, need);
+ result = (int) write(SP_PARM->_ofd, mybuf, need);
/*
* By giving up our scheduler slot here we increase the odds that the
diff --git a/ncurses/tinfo/lib_raw.c b/ncurses/tinfo/lib_raw.c
index 1e47f3b6fbfb..fda6deada2a7 100644
--- a/ncurses/tinfo/lib_raw.c
+++ b/ncurses/tinfo/lib_raw.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020-2023,2024 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -50,7 +50,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_raw.c,v 1.26 2020/11/21 22:07:48 tom Exp $")
+MODULE_ID("$Id: lib_raw.c,v 1.30 2024/03/30 15:54:17 tom Exp $")
#if HAVE_SYS_TERMIO_H
#include <sys/termio.h> /* needed for ISC */
@@ -116,8 +116,8 @@ NCURSES_SP_NAME(raw) (NCURSES_SP_DCL0)
KbdSetStatus(&kbdinfo, 0);
#endif
if (SP_PARM) {
- SP_PARM->_raw = TRUE;
- SP_PARM->_cbreak = 1;
+ IsRaw(SP_PARM) = TRUE;
+ IsCbreak(SP_PARM) = 1;
}
termp->Nttyb = buf;
}
@@ -151,7 +151,6 @@ NCURSES_SP_NAME(cbreak) (NCURSES_SP_DCL0)
#ifdef TERMIOS
buf.c_lflag &= (unsigned) ~ICANON;
buf.c_iflag &= (unsigned) ~ICRNL;
- buf.c_lflag |= ISIG;
buf.c_cc[VMIN] = 1;
buf.c_cc[VTIME] = 0;
#elif defined(EXP_WIN32_DRIVER)
@@ -163,7 +162,7 @@ NCURSES_SP_NAME(cbreak) (NCURSES_SP_DCL0)
result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf);
if (result == OK) {
if (SP_PARM) {
- SP_PARM->_cbreak = 1;
+ IsCbreak(SP_PARM) = 1;
}
termp->Nttyb = buf;
}
@@ -255,8 +254,8 @@ NCURSES_SP_NAME(noraw) (NCURSES_SP_DCL0)
KbdSetStatus(&kbdinfo, 0);
#endif
if (SP_PARM) {
- SP_PARM->_raw = FALSE;
- SP_PARM->_cbreak = 0;
+ IsRaw(SP_PARM) = FALSE;
+ IsCbreak(SP_PARM) = 0;
}
termp->Nttyb = buf;
}
@@ -298,7 +297,7 @@ NCURSES_SP_NAME(nocbreak) (NCURSES_SP_DCL0)
result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf);
if (result == OK) {
if (SP_PARM) {
- SP_PARM->_cbreak = 0;
+ IsCbreak(SP_PARM) = 0;
}
termp->Nttyb = buf;
}
@@ -395,3 +394,46 @@ intrflush(WINDOW *win GCC_UNUSED, bool flag)
return NCURSES_SP_NAME(intrflush) (CURRENT_SCREEN, win, flag);
}
#endif
+
+#if NCURSES_EXT_FUNCS
+/* *INDENT-OFF* */
+
+/*
+ * SCREEN is always opaque, but nl/raw/cbreak/echo set properties in it.
+ * As an extension, provide a way to query the properties.
+ *
+ * There are other properties which could be queried, e.g., filter, keypad,
+ * use_env, use_meta, but these particular properties are saved/restored within
+ * the wgetnstr() and wgetn_wstr() functions, which requires that the higher
+ * level curses library knows about the internal state of the lower level
+ * terminfo library.
+ */
+
+#define is_TEST(show,what) \
+ NCURSES_EXPORT(int) \
+ NCURSES_SP_NAME(show) (NCURSES_SP_DCL0) \
+ { \
+ return ((SP_PARM != NULL) ? (what(SP_PARM) ? 1 : 0) : -1); \
+ }
+
+is_TEST(is_nl, IsNl)
+is_TEST(is_raw, IsRaw)
+is_TEST(is_cbreak, IsCbreak)
+is_TEST(is_echo, IsEcho)
+
+#if NCURSES_SP_FUNCS
+#undef is_TEST
+#define is_TEST(show) \
+ NCURSES_EXPORT(int) \
+ show(void) \
+ { \
+ return NCURSES_SP_NAME(show) (CURRENT_SCREEN); \
+ }
+is_TEST(is_nl)
+is_TEST(is_raw)
+is_TEST(is_cbreak)
+is_TEST(is_echo)
+#endif
+
+/* *INDENT-ON* */
+#endif /* extensions */
diff --git a/ncurses/tinfo/lib_setup.c b/ncurses/tinfo/lib_setup.c
index 976227effade..99097f00fc1d 100644
--- a/ncurses/tinfo/lib_setup.c
+++ b/ncurses/tinfo/lib_setup.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2023,2024 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -49,7 +49,7 @@
#include <locale.h>
#endif
-MODULE_ID("$Id: lib_setup.c,v 1.212 2020/09/09 19:43:00 juergen Exp $")
+MODULE_ID("$Id: lib_setup.c,v 1.240 2024/04/20 17:04:05 tom Exp $")
/****************************************************************************
*
@@ -66,7 +66,7 @@ MODULE_ID("$Id: lib_setup.c,v 1.212 2020/09/09 19:43:00 juergen Exp $")
#endif
#if NEED_PTEM_H
- /* On SCO, they neglected to define struct winsize in termios.h -- it's only
+ /* On SCO, they neglected to define struct winsize in termios.h -- it is only
* in termio.h and ptem.h (the former conflicts with other definitions).
*/
# include <sys/stream.h>
@@ -272,6 +272,191 @@ use_tioctl(bool f)
}
#endif
+#if !(defined(USE_TERM_DRIVER) || defined(EXP_WIN32_DRIVER))
+static void
+_nc_default_screensize(TERMINAL *termp, int *linep, int *colp)
+{
+ /* if we can't get dynamic info about the size, use static */
+ if (*linep <= 0) {
+ *linep = (int) lines;
+ }
+ if (*colp <= 0) {
+ *colp = (int) columns;
+ }
+
+ /* the ultimate fallback, assume fixed 24x80 size */
+ if (*linep <= 0) {
+ *linep = 24;
+ }
+ if (*colp <= 0) {
+ *colp = 80;
+ }
+}
+
+#if defined(USE_CHECK_SIZE) && defined(user6) && defined(user7)
+static const char *
+skip_csi(const char *value)
+{
+ if (UChar(*value) == CSI_CHR) {
+ ++value;
+ } else if (*value == ESC_CHR && value[1] == L_BLOCK) {
+ value += 2;
+ }
+ return value;
+}
+
+static bool
+is_expected(const char *value, const char *expected)
+{
+ bool result = FALSE;
+ if (VALID_STRING(value)) {
+ const char *skipped = skip_csi(value);
+ if (skipped != value) {
+ if (!strcmp(skipped, expected))
+ result = TRUE;
+ }
+ }
+ return result;
+}
+
+static bool
+get_position(TERMINAL *termp, int fd, int *row, int *col)
+{
+ bool result = FALSE;
+ size_t need = strlen(user7);
+ int have;
+
+ have = (int) write(fd, user7, need);
+
+ if (have == (int) need) {
+ int y, x;
+ char buf[20];
+ char *s;
+ char cc;
+ const char *skipped;
+ int scanned;
+
+ s = memset(buf, '\0', sizeof(buf));
+ do {
+ size_t ask = (sizeof(buf) - 1 - (size_t) (s - buf));
+ int got = (int) read(fd, s, ask);
+ if (got == 0)
+ break;
+ s += got;
+ *s = '\0';
+ } while (strchr(buf, 'R') == NULL && (size_t) (s + 1 - buf) < sizeof(buf));
+ T(("CPR response %s", _nc_visbuf(buf)));
+ skipped = skip_csi(buf);
+ cc = '\0';
+ if (skipped != buf
+ && *skipped != '\0'
+ && (scanned = sscanf(skip_csi(buf), "%d;%d%c", &y, &x, &cc)) == 3
+ && (cc == 'R')) {
+ *row = y;
+ *col = x;
+ result = TRUE;
+ }
+ }
+ T(("get_position %s %d,%d", result ? "OK" : "ERR", *row, *col));
+ return result;
+}
+
+static bool
+set_position(NCURSES_SP_DCLx TERMINAL *termp, int row, int col)
+{
+ bool result;
+ char *actual = TIPARM_2(cursor_address, row, col);
+ T((T_CALLED("set_position %d,%d)"), row, col));
+#if NCURSES_SP_FUNCS
+ result = (NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "set_position",
+ actual) == OK);
+ NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG);
+#else
+ /* This does not support padding because without sp-funcs, we have only
+ * the interface using stdio, but we are not guaranteed that Filedes
+ * is the same as fileno(stdout).
+ */
+ result = FALSE;
+ if (actual != NULL) {
+ size_t want = strlen(actual);
+ int have = (int) write(termp->Filedes, actual, want);
+ result = ((int) want == have);
+ }
+#endif
+ returnBool(result);
+}
+
+/*
+ * This is a little more complicated than one might expect, because we do this
+ * before setting up the terminal modes, etc., and cannot use the timeout or
+ * buffering functions.
+ *
+ * We check if the terminal description has the ECMA-48 CPR (cursor position
+ * report) in u7 and the response in u6. The two variations of is_expected()
+ * cover the termcap style and terminfo style, and are equivalent as far as we
+ * are concerned. For analyzing the response, we wait (a short time) for 'R'
+ * to be echoed, and then check if we received two integers in the response.
+ *
+ * In principle, this could run on "any" ECMA-48 terminal, but in practice,
+ * there is a scenario using GNU screen where it uses ncurses with a partially
+ * configured pseudo-terminal, and the CPR response goes to the wrong place.
+ * So we do a simple check to exclude pseudo-terminals.
+ */
+static void
+_nc_check_screensize(SCREEN *sp, TERMINAL *termp, int *linep, int *colp)
+{
+ int fd = termp->Filedes;
+ TTY saved;
+ const char *name = NULL;
+
+ if (IsRealTty(fd, name)
+ && VALID_STRING(cursor_address)
+ && is_expected(user7, "6n")
+ && (is_expected(user6, "%i%d;%dR") ||
+ is_expected(user6, "%i%p1%d;%p2%dR"))
+ && GET_TTY(fd, &saved) == OK) {
+ int current_y = -1, current_x = -1;
+ int updated_y = -1, updated_x = -1;
+ TTY alter = saved;
+
+#if NCURSES_SP_FUNCS
+ if (sp == NULL) {
+ sp = new_prescr();
+ sp->_term = termp;
+ NCURSES_SP_NAME(baudrate) (NCURSES_SP_ARG);
+ }
+#else
+ (void) sp;
+#endif
+
+ T(("trying CPR (u7/u6) with %s", name));
+ alter.c_lflag &= (unsigned) ~(ECHO | ICANON | ISIG | IEXTEN);
+ alter.c_iflag &= (unsigned) ~(IXON | BRKINT | PARMRK);
+ alter.c_cc[VMIN] = 0;
+ alter.c_cc[VTIME] = 1;
+ SET_TTY(fd, &alter);
+
+ if (get_position(termp, fd, &current_y, &current_x)
+ && set_position(NCURSES_SP_ARGx termp, 9999, 9999)
+ && get_position(termp, fd, &updated_y, &updated_x)) {
+ *linep = updated_y;
+ *colp = updated_x;
+ set_position(NCURSES_SP_ARGx termp, current_y, current_x);
+ }
+ /* restore tty modes */
+ SET_TTY(fd, &saved);
+ } else {
+ T(("NOT trying CPR with fd %d (%s): %s",
+ fd, NonNull(name), NC_ISATTY(fd) ? "tty" : "not a tty"));
+ }
+
+ _nc_default_screensize(termp, linep, colp);
+}
+#else /* !USE_CHECK_SIZE */
+#define _nc_check_screensize(sp, termp, linep, colp) /* nothing */
+#endif
+#endif /* !(defined(USE_TERM_DRIVER) || defined(EXP_WIN32_DRIVER)) */
+
NCURSES_EXPORT(void)
_nc_get_screensize(SCREEN *sp,
#ifdef USE_TERM_DRIVER
@@ -305,6 +490,7 @@ _nc_get_screensize(SCREEN *sp,
bool useEnv = _nc_prescreen.use_env;
bool useTioctl = _nc_prescreen.use_tioctl;
+ T((T_CALLED("_nc_get_screensize (%p)"), (void *) sp));
#ifdef EXP_WIN32_DRIVER
/* If we are here, then Windows console is used in terminfo mode.
We need to figure out the size using the console API
@@ -326,6 +512,7 @@ _nc_get_screensize(SCREEN *sp,
}
#endif
+ T(("useEnv:%d useTioctl:%d", useEnv, useTioctl));
if (useEnv || useTioctl) {
#ifdef __EMX__
{
@@ -389,22 +576,10 @@ _nc_get_screensize(SCREEN *sp,
*colp = value;
T(("screen size: environment COLUMNS = %d", *colp));
}
- }
- /* if we can't get dynamic info about the size, use static */
- if (*linep <= 0) {
- *linep = (int) lines;
- }
- if (*colp <= 0) {
- *colp = (int) columns;
- }
-
- /* the ultimate fallback, assume fixed 24x80 size */
- if (*linep <= 0) {
- *linep = 24;
- }
- if (*colp <= 0) {
- *colp = 80;
+ _nc_default_screensize(termp, linep, colp);
+ } else {
+ _nc_check_screensize(sp, termp, linep, colp);
}
/*
@@ -419,6 +594,8 @@ _nc_get_screensize(SCREEN *sp,
OldNumber(termp, lines) = (short) (*linep);
OldNumber(termp, columns) = (short) (*colp);
#endif
+ } else {
+ _nc_check_screensize(sp, termp, linep, colp);
}
T(("screen size is %dx%d", *linep, *colp));
@@ -435,6 +612,7 @@ _nc_get_screensize(SCREEN *sp,
TABSIZE = my_tabsize;
#endif
T(("TABSIZE = %d", TABSIZE));
+ returnVoid;
#endif /* USE_TERM_DRIVER */
}
@@ -503,6 +681,7 @@ _nc_setup_tinfo(const char *const tn, TERMTYPE2 *const tp)
*/
if (status == TGETENT_YES) {
unsigned n;
+ T(("_nc_setup_tinfo - resetting invalid booleans/strings"));
for_each_boolean(n, tp) {
if (!VALID_BOOLEAN(tp->Booleans[n]))
tp->Booleans[n] = FALSE;
@@ -517,9 +696,9 @@ _nc_setup_tinfo(const char *const tn, TERMTYPE2 *const tp)
#endif
/*
-** Take the real command character out of the CC environment variable
-** and substitute it in for the prototype given in 'command_character'.
-*/
+ * Take the real command character out of the CC environment variable
+ * and substitute it in for the prototype given in 'command_character'.
+ */
void
_nc_tinfo_cmdch(TERMINAL *termp, int proto)
{
@@ -535,9 +714,12 @@ _nc_tinfo_cmdch(TERMINAL *termp, int proto)
char CC = *tmp;
for_each_string(i, &(termp->type)) {
- for (tmp = termp->type.Strings[i]; tmp && *tmp; tmp++) {
- if (UChar(*tmp) == proto)
- *tmp = CC;
+ tmp = termp->type.Strings[i];
+ if (VALID_STRING(tmp)) {
+ for (; *tmp; ++tmp) {
+ if (UChar(*tmp) == proto)
+ *tmp = CC;
+ }
}
}
}
@@ -573,22 +755,27 @@ _nc_get_locale(void)
NCURSES_EXPORT(int)
_nc_unicode_locale(void)
{
- int result = 0;
+ static bool initialized = FALSE;
+ static int result = 0;
+
+ if (!initialized) {
#if defined(_NC_WINDOWS) && USE_WIDEC_SUPPORT
- result = 1;
+ result = 1;
#elif HAVE_LANGINFO_CODESET
- char *env = nl_langinfo(CODESET);
- result = !strcmp(env, "UTF-8");
- T(("_nc_unicode_locale(%s) ->%d", env, result));
+ char *env = nl_langinfo(CODESET);
+ result = !strcmp(env, "UTF-8");
+ T(("_nc_unicode_locale(%s) ->%d", env, result));
#else
- char *env = _nc_get_locale();
- if (env != 0) {
- if (strstr(env, ".UTF-8") != 0) {
- result = 1;
- T(("_nc_unicode_locale(%s) ->%d", env, result));
+ char *env = _nc_get_locale();
+ if (env != 0) {
+ if (strstr(env, ".UTF-8") != 0) {
+ result = 1;
+ T(("_nc_unicode_locale(%s) ->%d", env, result));
+ }
}
- }
#endif
+ initialized = TRUE;
+ }
return result;
}
@@ -679,10 +866,9 @@ TINFO_SETUP_TERM(TERMINAL **tp,
#endif
}
myname = strdup(tname);
-
- if (strlen(myname) > MAX_NAME_SIZE) {
+ if (myname == NULL || strlen(myname) > MAX_NAME_SIZE) {
ret_error(TGETENT_ERR,
- "TERM environment must be <= %d characters.\n",
+ "TERM environment must be 1..%d characters.\n",
MAX_NAME_SIZE,
free(myname));
}
@@ -743,6 +929,7 @@ TINFO_SETUP_TERM(TERMINAL **tp,
"Not enough memory to create terminal structure.\n",
myname, free(myname));
}
+ ++_nc_globals.terminal_count;
#if HAVE_SYSCONF
{
long limit;
@@ -763,10 +950,14 @@ TINFO_SETUP_TERM(TERMINAL **tp,
#ifdef USE_TERM_DRIVER
INIT_TERM_DRIVER();
+ /*
+ * _nc_get_driver() will call td_CanHandle() for each driver, and win_driver
+ * needs file descriptor to do the test, so set it before calling.
+ */
+ termp->Filedes = (short) Filedes;
TCB = (TERMINAL_CONTROL_BLOCK *) termp;
code = _nc_globals.term_driver(TCB, myname, errret);
if (code == OK) {
- termp->Filedes = (short) Filedes;
termp->_termname = strdup(myname);
} else {
ret_error1(errret ? *errret : TGETENT_ERR,
@@ -802,6 +993,7 @@ TINFO_SETUP_TERM(TERMINAL **tp,
ret_error1(status, "unknown terminal type.\n",
myname, free(myname));
} else {
+ free(myname);
ret_error0(status, "unexpected return-code\n");
}
}
@@ -817,7 +1009,7 @@ TINFO_SETUP_TERM(TERMINAL **tp,
set_curterm(termp);
- if (command_character)
+ if (VALID_STRING(command_character))
_nc_tinfo_cmdch(termp, UChar(*command_character));
/*
@@ -829,7 +1021,7 @@ TINFO_SETUP_TERM(TERMINAL **tp,
if (NC_ISATTY(Filedes)) {
NCURSES_SP_NAME(def_shell_mode) (NCURSES_SP_ARG);
NCURSES_SP_NAME(def_prog_mode) (NCURSES_SP_ARG);
- baudrate();
+ NCURSES_SP_NAME(baudrate) (NCURSES_SP_ARG);
}
code = OK;
#endif
@@ -906,6 +1098,7 @@ _nc_forget_prescr(void)
{
PRESCREEN_LIST *p, *q;
pthread_t id = GetThreadID();
+ _nc_lock_global(screen);
for (p = _nc_prescreen.allocated, q = 0; p != 0; q = p, p = p->next) {
if (p->id == id) {
if (q) {
@@ -917,6 +1110,7 @@ _nc_forget_prescr(void)
break;
}
}
+ _nc_unlock_global(screen);
}
#endif /* USE_PTHREADS */
@@ -988,6 +1182,7 @@ _nc_setupterm(const char *tname,
int rc = ERR;
TERMINAL *termp = 0;
+ _nc_init_pthreads();
_nc_lock_global(prescreen);
START_TRACE();
if (TINFO_SETUP_TERM(&termp, tname, Filedes, errret, reuse) == OK) {
@@ -997,6 +1192,7 @@ _nc_setupterm(const char *tname,
}
}
_nc_unlock_global(prescreen);
+
return rc;
}
#endif
diff --git a/ncurses/tinfo/lib_termcap.c b/ncurses/tinfo/lib_termcap.c
index 5ce43a3c4890..2ece985914e9 100644
--- a/ncurses/tinfo/lib_termcap.c
+++ b/ncurses/tinfo/lib_termcap.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 2018-2020,2023 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -49,7 +49,7 @@
#define CUR SP_TERMTYPE
#endif
-MODULE_ID("$Id: lib_termcap.c,v 1.88 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_termcap.c,v 1.89 2023/05/27 20:13:10 tom Exp $")
NCURSES_EXPORT_VAR(char *) UP = 0;
NCURSES_EXPORT_VAR(char *) BC = 0;
@@ -399,7 +399,7 @@ tgetstr(const char *id, char **area)
#undef CacheInx
#define CacheInx num
NCURSES_EXPORT(void)
-_nc_tgetent_leak(TERMINAL *termp)
+_nc_tgetent_leak(const TERMINAL *const termp)
{
if (termp != 0) {
int num;
diff --git a/ncurses/tinfo/lib_tgoto.c b/ncurses/tinfo/lib_tgoto.c
index 9cf5e100ce87..58b561fa7c78 100644
--- a/ncurses/tinfo/lib_tgoto.c
+++ b/ncurses/tinfo/lib_tgoto.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2020,2023 Thomas E. Dickey *
* Copyright 2000-2008,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -36,7 +36,7 @@
#include <ctype.h>
#include <termcap.h>
-MODULE_ID("$Id: lib_tgoto.c,v 1.21 2020/05/27 23:55:56 tom Exp $")
+MODULE_ID("$Id: lib_tgoto.c,v 1.23 2023/04/16 17:19:40 tom Exp $")
#if !PURE_TERMINFO
static bool
@@ -207,6 +207,16 @@ tgoto(const char *string, int x, int y)
result = tgoto_internal(string, x, y);
else
#endif
- result = TIPARM_2(string, y, x);
+ if ((result = TIPARM_2(string, y, x)) == NULL) {
+ /*
+ * Because termcap did not provide a more general solution such as
+ * tparm(), it was necessary to handle single-parameter capabilities
+ * using tgoto(). The internal _nc_tiparm() function returns a NULL
+ * for that case; retry for the single-parameter case.
+ */
+ if ((result = TIPARM_1(string, y)) == NULL) {
+ result = TIPARM_0(string);
+ }
+ }
returnPtr(result);
}
diff --git a/ncurses/tinfo/lib_tparm.c b/ncurses/tinfo/lib_tparm.c
index b8104eabcd5e..5666b27b7e09 100644
--- a/ncurses/tinfo/lib_tparm.c
+++ b/ncurses/tinfo/lib_tparm.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2020,2021 Thomas E. Dickey *
+ * Copyright 2018-2021,2023 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -53,7 +53,7 @@
#include <ctype.h>
#include <tic.h>
-MODULE_ID("$Id: lib_tparm.c,v 1.129 2021/02/14 00:09:49 tom Exp $")
+MODULE_ID("$Id: lib_tparm.c,v 1.153 2023/11/04 19:28:41 tom Exp $")
/*
* char *
@@ -117,9 +117,14 @@ MODULE_ID("$Id: lib_tparm.c,v 1.129 2021/02/14 00:09:49 tom Exp $")
NCURSES_EXPORT_VAR(int) _nc_tparm_err = 0;
-#define TPS(var) _nc_prescreen.tparm_state.var
+#define TPS(var) tps->var
#define popcount _nc_popcount /* workaround for NetBSD 6.0 defect */
+#define get_tparm_state(term) \
+ (term != NULL \
+ ? &(term->tparm_state) \
+ : &(_nc_prescreen.tparm_state))
+
#define isUPPER(c) ((c) >= 'A' && (c) <= 'Z')
#define isLOWER(c) ((c) >= 'a' && (c) <= 'z')
#define tc_BUMP() if (level < 0 && number < 2) number++
@@ -137,10 +142,8 @@ typedef struct {
#if HAVE_TSEARCH
#define MyCache _nc_globals.cached_tparm
#define MyCount _nc_globals.count_tparm
-#if NO_LEAKS
static int which_tparm;
static TPARM_DATA **delete_tparm;
-#endif
#endif /* HAVE_TSEARCH */
static char dummy[] = ""; /* avoid const-cast */
@@ -155,10 +158,9 @@ cmp_format(const void *p, const void *q)
}
#endif
-#if NO_LEAKS
#if HAVE_TSEARCH
static void
-visit_nodes(const void *nodep, const VISIT which, const int depth)
+visit_nodes(const void *nodep, VISIT which, int depth)
{
(void) depth;
if (which == preorder || which == leaf) {
@@ -169,22 +171,27 @@ visit_nodes(const void *nodep, const VISIT which, const int depth)
#endif
NCURSES_EXPORT(void)
-_nc_free_tparm(void)
+_nc_free_tparm(TERMINAL *termp)
{
+ TPARM_STATE *tps = get_tparm_state(termp);
#if HAVE_TSEARCH
if (MyCount != 0) {
- delete_tparm = typeMalloc(TPARM_DATA *, MyCount);
- which_tparm = 0;
- twalk(MyCache, visit_nodes);
- for (which_tparm = 0; which_tparm < MyCount; ++which_tparm) {
- TPARM_DATA *ptr = delete_tparm[which_tparm];
- tdelete(ptr, &MyCache, cmp_format);
- free((char *) ptr->format);
- free(ptr);
+ delete_tparm = typeCalloc(TPARM_DATA *, MyCount);
+ if (delete_tparm != NULL) {
+ which_tparm = 0;
+ twalk(MyCache, visit_nodes);
+ for (which_tparm = 0; which_tparm < MyCount; ++which_tparm) {
+ TPARM_DATA *ptr = delete_tparm[which_tparm];
+ if (ptr != NULL) {
+ tdelete(ptr, &MyCache, cmp_format);
+ free((char *) ptr->format);
+ free(ptr);
+ }
+ }
+ which_tparm = 0;
+ twalk(MyCache, visit_nodes);
+ FreeAndNull(delete_tparm);
}
- which_tparm = 0;
- twalk(MyCache, visit_nodes);
- FreeAndNull(delete_tparm);
MyCount = 0;
which_tparm = 0;
}
@@ -196,107 +203,159 @@ _nc_free_tparm(void)
FreeAndNull(TPS(fmt_buff));
TPS(fmt_size) = 0;
}
-#endif
-static NCURSES_INLINE void
-get_space(size_t need)
+static int
+tparm_error(TPARM_STATE *tps, const char *message)
{
- need += TPS(out_used);
- if (need > TPS(out_size)) {
- TPS(out_size) = need * 2;
- TYPE_REALLOC(char, TPS(out_size), TPS(out_buff));
- }
+ (void) tps;
+ (void) message;
+ DEBUG(2, ("%s: %s", message, _nc_visbuf(TPS(tparam_base))));
+ return ++_nc_tparm_err;
+}
+
+#define get_space(tps, need) \
+{ \
+ size_t need2get = need + TPS(out_used); \
+ if (need2get > TPS(out_size)) { \
+ TPS(out_size) = need2get * 2; \
+ TYPE_REALLOC(char, TPS(out_size), TPS(out_buff)); \
+ } \
}
+#if NCURSES_EXPANDED
static NCURSES_INLINE void
-save_text(const char *fmt, const char *s, int len)
-{
- size_t s_len = (size_t) len + strlen(s) + strlen(fmt);
- get_space(s_len + 1);
+ (get_space) (TPARM_STATE *tps, size_t need) {
+ get_space(tps, need);
+}
- _nc_SPRINTF(TPS(out_buff) + TPS(out_used),
- _nc_SLIMIT(TPS(out_size) - TPS(out_used))
- fmt, s);
- TPS(out_used) += strlen(TPS(out_buff) + TPS(out_used));
+#undef get_space
+#endif
+
+#define save_text(tps, fmt, s, len) \
+{ \
+ size_t s_len = (size_t) len + strlen(s) + strlen(fmt); \
+ get_space(tps, s_len + 1); \
+ _nc_SPRINTF(TPS(out_buff) + TPS(out_used), \
+ _nc_SLIMIT(TPS(out_size) - TPS(out_used)) \
+ fmt, s); \
+ TPS(out_used) += strlen(TPS(out_buff) + TPS(out_used)); \
}
+#if NCURSES_EXPANDED
static NCURSES_INLINE void
-save_number(const char *fmt, int number, int len)
-{
- size_t s_len = (size_t) len + 30 + strlen(fmt);
- get_space(s_len + 1);
+ (save_text) (TPARM_STATE *tps, const char *fmt, const char *s, int len) {
+ save_text(tps, fmt, s, len);
+}
- _nc_SPRINTF(TPS(out_buff) + TPS(out_used),
- _nc_SLIMIT(TPS(out_size) - TPS(out_used))
- fmt, number);
- TPS(out_used) += strlen(TPS(out_buff) + TPS(out_used));
+#undef save_text
+#endif
+
+#define save_number(tps, fmt, number, len) \
+{ \
+ size_t s_len = (size_t) len + 30 + strlen(fmt); \
+ get_space(tps, s_len + 1); \
+ _nc_SPRINTF(TPS(out_buff) + TPS(out_used), \
+ _nc_SLIMIT(TPS(out_size) - TPS(out_used)) \
+ fmt, number); \
+ TPS(out_used) += strlen(TPS(out_buff) + TPS(out_used)); \
}
+#if NCURSES_EXPANDED
static NCURSES_INLINE void
-save_char(int c)
-{
- if (c == 0)
- c = 0200;
- get_space((size_t) 1);
- TPS(out_buff)[TPS(out_used)++] = (char) c;
+ (save_number) (TPARM_STATE *tps, const char *fmt, int number, int len) {
+ save_number(tps, fmt, number, len);
}
+#undef save_number
+#endif
+
+#define save_char(tps, c) \
+{ \
+ get_space(tps, (size_t) 1); \
+ TPS(out_buff)[TPS(out_used)++] = (char) ((c == 0) ? 0200 : c); \
+}
+
+#if NCURSES_EXPANDED
static NCURSES_INLINE void
-npush(int x)
-{
- if (TPS(stack_ptr) < STACKSIZE) {
- TPS(stack)[TPS(stack_ptr)].num_type = TRUE;
- TPS(stack)[TPS(stack_ptr)].data.num = x;
- TPS(stack_ptr)++;
- } else {
- DEBUG(2, ("npush: stack overflow: %s", _nc_visbuf(TPS(tparam_base))));
- _nc_tparm_err++;
- }
+ (save_char) (TPARM_STATE *tps, int c) {
+ save_char(tps, c);
}
-static NCURSES_INLINE int
-npop(void)
-{
- int result = 0;
- if (TPS(stack_ptr) > 0) {
- TPS(stack_ptr)--;
- if (TPS(stack)[TPS(stack_ptr)].num_type)
- result = TPS(stack)[TPS(stack_ptr)].data.num;
- } else {
- DEBUG(2, ("npop: stack underflow: %s", _nc_visbuf(TPS(tparam_base))));
- _nc_tparm_err++;
- }
- return result;
+#undef save_char
+#endif
+
+#define npush(tps, x) \
+{ \
+ if (TPS(stack_ptr) < STACKSIZE) { \
+ TPS(stack)[TPS(stack_ptr)].num_type = TRUE; \
+ TPS(stack)[TPS(stack_ptr)].data.num = x; \
+ TPS(stack_ptr)++; \
+ } else { \
+ (void) tparm_error(tps, "npush: stack overflow"); \
+ } \
}
+#if NCURSES_EXPANDED
static NCURSES_INLINE void
-spush(char *x)
-{
- if (TPS(stack_ptr) < STACKSIZE) {
- TPS(stack)[TPS(stack_ptr)].num_type = FALSE;
- TPS(stack)[TPS(stack_ptr)].data.str = x;
- TPS(stack_ptr)++;
- } else {
- DEBUG(2, ("spush: stack overflow: %s", _nc_visbuf(TPS(tparam_base))));
- _nc_tparm_err++;
- }
+ (npush) (TPARM_STATE *tps, int x) {
+ npush(tps, x);
+}
+
+#undef npush
+#endif
+
+#define spush(tps, x) \
+{ \
+ if (TPS(stack_ptr) < STACKSIZE) { \
+ TPS(stack)[TPS(stack_ptr)].num_type = FALSE; \
+ TPS(stack)[TPS(stack_ptr)].data.str = x; \
+ TPS(stack_ptr)++; \
+ } else { \
+ (void) tparm_error(tps, "spush: stack overflow"); \
+ } \
+}
+
+#if NCURSES_EXPANDED
+static NCURSES_INLINE void
+ (spush) (TPARM_STATE *tps, char *x) {
+ spush(tps, x);
+}
+
+#undef spush
+#endif
+
+#define npop(tps) \
+ ((TPS(stack_ptr)-- > 0) \
+ ? ((TPS(stack)[TPS(stack_ptr)].num_type) \
+ ? TPS(stack)[TPS(stack_ptr)].data.num \
+ : 0) \
+ : (tparm_error(tps, "npop: stack underflow"), \
+ TPS(stack_ptr) = 0))
+
+#if NCURSES_EXPANDED
+static NCURSES_INLINE int
+ (npop) (TPARM_STATE *tps) {
+ return npop(tps);
}
+#undef npop
+#endif
+
+#define spop(tps) \
+ ((TPS(stack_ptr)-- > 0) \
+ ? ((!TPS(stack)[TPS(stack_ptr)].num_type \
+ && TPS(stack)[TPS(stack_ptr)].data.str != 0) \
+ ? TPS(stack)[TPS(stack_ptr)].data.str \
+ : dummy) \
+ : (tparm_error(tps, "spop: stack underflow"), \
+ dummy))
+#if NCURSES_EXPANDED
static NCURSES_INLINE char *
-spop(void)
-{
- char *result = dummy;
- if (TPS(stack_ptr) > 0) {
- TPS(stack_ptr)--;
- if (!TPS(stack)[TPS(stack_ptr)].num_type
- && TPS(stack)[TPS(stack_ptr)].data.str != 0)
- result = TPS(stack)[TPS(stack_ptr)].data.str;
- } else {
- DEBUG(2, ("spop: stack underflow: %s", _nc_visbuf(TPS(tparam_base))));
- _nc_tparm_err++;
- }
- return result;
+ (spop) (TPARM_STATE *tps) {
+ return spop(tps);
}
+#undef spop
+#endif
static NCURSES_INLINE const char *
parse_format(const char *s, char *format, int *len)
@@ -405,8 +464,9 @@ parse_format(const char *s, char *format, int *len)
* may be cases that we cannot see the explicit parameter numbers.
*/
NCURSES_EXPORT(int)
-_nc_tparm_analyze(const char *string, char **p_is_s, int *popcount)
+_nc_tparm_analyze(TERMINAL *term, const char *string, char **p_is_s, int *popcount)
{
+ TPARM_STATE *tps = get_tparm_state(term);
size_t len2;
int i;
int lastpop = -1;
@@ -539,15 +599,16 @@ _nc_tparm_analyze(const char *string, char **p_is_s, int *popcount)
* TODO: cache the result so that this is done once per capability per term.
*/
static int
-tparm_setup(const char *string, TPARM_DATA * result)
+tparm_setup(TERMINAL *term, const char *string, TPARM_DATA *result)
{
+ TPARM_STATE *tps = get_tparm_state(term);
int rc = OK;
TPS(out_used) = 0;
memset(result, 0, sizeof(*result));
- if (string == NULL) {
- TR(TRACE_CALLS, ("%s: format is null", TPS(tname)));
+ if (!VALID_STRING(string)) {
+ TR(TRACE_CALLS, ("%s: format is invalid", TPS(tname)));
rc = ERR;
} else {
#if HAVE_TSEARCH
@@ -556,8 +617,15 @@ tparm_setup(const char *string, TPARM_DATA * result)
result->format = string;
if ((ft = tfind(result, &MyCache, cmp_format)) != 0) {
+ size_t len2;
fs = *(TPARM_DATA **) ft;
*result = *fs;
+ if ((len2 = strlen(string)) + 2 > TPS(fmt_size)) {
+ TPS(fmt_size) += len2 + 2;
+ TPS(fmt_buff) = typeRealloc(char, TPS(fmt_size), TPS(fmt_buff));
+ if (TPS(fmt_buff) == 0)
+ return ERR;
+ }
} else
#endif
{
@@ -566,7 +634,7 @@ tparm_setup(const char *string, TPARM_DATA * result)
* string. Use this value to limit the number of arguments copied
* from the variable-length argument list.
*/
- result->num_parsed = _nc_tparm_analyze(string,
+ result->num_parsed = _nc_tparm_analyze(term, string,
result->p_is_s,
&(result->num_popped));
if (TPS(fmt_buff) == 0) {
@@ -579,7 +647,7 @@ tparm_setup(const char *string, TPARM_DATA * result)
result->num_parsed = NUM_PARM;
if (result->num_popped > NUM_PARM)
result->num_popped = NUM_PARM;
- result->num_actual = max(result->num_popped, result->num_parsed);
+ result->num_actual = Max(result->num_popped, result->num_parsed);
for (n = 0; n < result->num_actual; ++n) {
if (result->p_is_s[n])
@@ -592,9 +660,11 @@ tparm_setup(const char *string, TPARM_DATA * result)
if (tsearch(fs, &MyCache, cmp_format) != 0) {
++MyCount;
} else {
+ free(fs);
rc = ERR;
}
} else {
+ free(fs);
rc = ERR;
}
} else {
@@ -615,7 +685,7 @@ tparm_setup(const char *string, TPARM_DATA * result)
* long's, which is consistent with our va_arg() usage.
*/
static void
-tparm_copy_valist(TPARM_DATA * data, int use_TPARM_ARG, va_list ap)
+tparm_copy_valist(TPARM_DATA *data, int use_TPARM_ARG, va_list ap)
{
int i;
@@ -642,7 +712,7 @@ tparm_copy_valist(TPARM_DATA * data, int use_TPARM_ARG, va_list ap)
* will expand termcap strings OK.
*/
static bool
-tparm_tc_compat(TPARM_DATA * data)
+tparm_tc_compat(TPARM_STATE *tps, TPARM_DATA *data)
{
bool termcap_hack = FALSE;
@@ -653,10 +723,11 @@ tparm_tc_compat(TPARM_DATA * data)
termcap_hack = TRUE;
for (i = data->num_parsed - 1; i >= 0; i--) {
- if (data->p_is_s[i])
- spush(data->p_is_s[i]);
- else
- npush((int) data->param[i]);
+ if (data->p_is_s[i]) {
+ spush(tps, data->p_is_s[i]);
+ } else {
+ npush(tps, (int) data->param[i]);
+ }
}
}
return termcap_hack;
@@ -664,20 +735,20 @@ tparm_tc_compat(TPARM_DATA * data)
#ifdef TRACE
static void
-tparm_trace_call(const char *string, TPARM_DATA * data)
+tparm_trace_call(TPARM_STATE *tps, const char *string, TPARM_DATA *data)
{
if (USE_TRACEF(TRACE_CALLS)) {
int i;
for (i = 0; i < data->num_actual; i++) {
if (data->p_is_s[i] != 0) {
- save_text(", %s", _nc_visbuf(data->p_is_s[i]), 0);
+ save_text(tps, ", %s", _nc_visbuf(data->p_is_s[i]), 0);
} else if ((long) data->param[i] > MAX_OF_TYPE(NCURSES_INT2) ||
(long) data->param[i] < 0) {
_tracef("BUG: problem with tparm parameter #%d of %d",
i + 1, data->num_actual);
break;
} else {
- save_number(", %d", (int) data->param[i], 0);
+ save_number(tps, ", %d", (int) data->param[i], 0);
}
}
_tracef(T_CALLED("%s(%s%s)"), TPS(tname), _nc_visbuf(string), TPS(out_buff));
@@ -687,27 +758,54 @@ tparm_trace_call(const char *string, TPARM_DATA * data)
}
#else
-#define tparm_trace_call(string, data) /* nothing */
+#define tparm_trace_call(tps, string, data) /* nothing */
#endif /* TRACE */
+#define init_vars(name) \
+ if (!name##_used) { \
+ name##_used = TRUE; \
+ memset(name##_vars, 0, sizeof(name##_vars)); \
+ }
+
static NCURSES_INLINE char *
-tparam_internal(const char *string, TPARM_DATA * data)
+tparam_internal(TPARM_STATE *tps, const char *string, TPARM_DATA *data)
{
int number;
int len;
int level;
int x, y;
int i;
+ const char *s;
const char *cp = string;
size_t len2 = strlen(cp);
bool incremented_two = FALSE;
- bool termcap_hack = tparm_tc_compat(data);
+ bool termcap_hack = tparm_tc_compat(tps, data);
+ /*
+ * SVr4 curses stores variables 'A' to 'Z' in the TERMINAL structure (so
+ * they are initialized once to zero), and variables 'a' to 'z' on the
+ * stack in tparm, referring to the former as "static" and the latter as
+ * "dynamic". However, it makes no check to ensure that the "dynamic"
+ * variables are initialized.
+ *
+ * Solaris xpg4 curses makes no distinction between the upper/lower, and
+ * stores the common set of 26 variables on the stack, without initializing
+ * them.
+ *
+ * In ncurses, both sets of variables are initialized on the first use.
+ */
+ bool dynamic_used = FALSE;
+ int dynamic_vars[NUM_VARS];
- tparm_trace_call(string, data);
+ tparm_trace_call(tps, string, data);
+
+ if (TPS(fmt_buff) == NULL) {
+ T((T_RETURN("<null>")));
+ return NULL;
+ }
while ((cp - string) < (int) len2) {
if (*cp != '%') {
- save_char(UChar(*cp));
+ save_char(tps, UChar(*cp));
} else {
TPS(tparam_base) = cp++;
cp = parse_format(cp, TPS(fmt_buff), &len);
@@ -715,40 +813,44 @@ tparam_internal(const char *string, TPARM_DATA * data)
default:
break;
case '%':
- save_char('%');
+ save_char(tps, '%');
break;
case 'd': /* FALLTHRU */
case 'o': /* FALLTHRU */
case 'x': /* FALLTHRU */
case 'X': /* FALLTHRU */
- save_number(TPS(fmt_buff), npop(), len);
+ x = npop(tps);
+ save_number(tps, TPS(fmt_buff), x, len);
break;
case 'c': /* FALLTHRU */
- save_char(npop());
+ x = npop(tps);
+ save_char(tps, x);
break;
#ifdef EXP_XTERM_1005
case 'u':
{
unsigned char target[10];
- unsigned source = (unsigned) npop();
+ unsigned source = (unsigned) npop(tps);
int rc = _nc_conv_to_utf8(target, source, (unsigned)
sizeof(target));
int n;
for (n = 0; n < rc; ++n) {
- save_char(target[n]);
+ save_char(tps, target[n]);
}
}
break;
#endif
case 'l':
- npush((int) strlen(spop()));
+ s = spop(tps);
+ npush(tps, (int) strlen(s));
break;
case 's':
- save_text(TPS(fmt_buff), spop(), len);
+ s = spop(tps);
+ save_text(tps, TPS(fmt_buff), s, len);
break;
case 'p':
@@ -756,9 +858,9 @@ tparam_internal(const char *string, TPARM_DATA * data)
i = (UChar(*cp) - '1');
if (i >= 0 && i < NUM_PARM) {
if (data->p_is_s[i]) {
- spush(data->p_is_s[i]);
+ spush(tps, data->p_is_s[i]);
} else {
- npush((int) data->param[i]);
+ npush(tps, (int) data->param[i]);
}
}
break;
@@ -767,10 +869,11 @@ tparam_internal(const char *string, TPARM_DATA * data)
cp++;
if (isUPPER(*cp)) {
i = (UChar(*cp) - 'A');
- TPS(static_vars)[i] = npop();
+ TPS(static_vars)[i] = npop(tps);
} else if (isLOWER(*cp)) {
i = (UChar(*cp) - 'a');
- TPS(dynamic_var)[i] = npop();
+ init_vars(dynamic);
+ dynamic_vars[i] = npop(tps);
}
break;
@@ -778,16 +881,17 @@ tparam_internal(const char *string, TPARM_DATA * data)
cp++;
if (isUPPER(*cp)) {
i = (UChar(*cp) - 'A');
- npush(TPS(static_vars)[i]);
+ npush(tps, TPS(static_vars)[i]);
} else if (isLOWER(*cp)) {
i = (UChar(*cp) - 'a');
- npush(TPS(dynamic_var)[i]);
+ init_vars(dynamic);
+ npush(tps, dynamic_vars[i]);
}
break;
case S_QUOTE:
cp++;
- npush(UChar(*cp));
+ npush(tps, UChar(*cp));
cp++;
break;
@@ -798,83 +902,95 @@ tparam_internal(const char *string, TPARM_DATA * data)
number = (number * 10) + (UChar(*cp) - '0');
cp++;
}
- npush(number);
+ npush(tps, number);
break;
case '+':
- npush(npop() + npop());
+ y = npop(tps);
+ x = npop(tps);
+ npush(tps, x + y);
break;
case '-':
- y = npop();
- x = npop();
- npush(x - y);
+ y = npop(tps);
+ x = npop(tps);
+ npush(tps, x - y);
break;
case '*':
- npush(npop() * npop());
+ y = npop(tps);
+ x = npop(tps);
+ npush(tps, x * y);
break;
case '/':
- y = npop();
- x = npop();
- npush(y ? (x / y) : 0);
+ y = npop(tps);
+ x = npop(tps);
+ npush(tps, y ? (x / y) : 0);
break;
case 'm':
- y = npop();
- x = npop();
- npush(y ? (x % y) : 0);
+ y = npop(tps);
+ x = npop(tps);
+ npush(tps, y ? (x % y) : 0);
break;
case 'A':
- y = npop();
- x = npop();
- npush(y && x);
+ y = npop(tps);
+ x = npop(tps);
+ npush(tps, y && x);
break;
case 'O':
- y = npop();
- x = npop();
- npush(y || x);
+ y = npop(tps);
+ x = npop(tps);
+ npush(tps, y || x);
break;
case '&':
- npush(npop() & npop());
+ y = npop(tps);
+ x = npop(tps);
+ npush(tps, x & y);
break;
case '|':
- npush(npop() | npop());
+ y = npop(tps);
+ x = npop(tps);
+ npush(tps, x | y);
break;
case '^':
- npush(npop() ^ npop());
+ y = npop(tps);
+ x = npop(tps);
+ npush(tps, x ^ y);
break;
case '=':
- y = npop();
- x = npop();
- npush(x == y);
+ y = npop(tps);
+ x = npop(tps);
+ npush(tps, x == y);
break;
case '<':
- y = npop();
- x = npop();
- npush(x < y);
+ y = npop(tps);
+ x = npop(tps);
+ npush(tps, x < y);
break;
case '>':
- y = npop();
- x = npop();
- npush(x > y);
+ y = npop(tps);
+ x = npop(tps);
+ npush(tps, x > y);
break;
case '!':
- npush(!npop());
+ x = npop(tps);
+ npush(tps, !x);
break;
case '~':
- npush(~npop());
+ x = npop(tps);
+ npush(tps, ~x);
break;
case 'i':
@@ -904,7 +1020,7 @@ tparam_internal(const char *string, TPARM_DATA * data)
break;
case 't':
- x = npop();
+ x = npop(tps);
if (!x) {
/* scan forward for %e or %; at level zero */
cp++;
@@ -963,7 +1079,7 @@ tparam_internal(const char *string, TPARM_DATA * data)
cp++;
} /* endwhile (*cp) */
- get_space((size_t) 1);
+ get_space(tps, (size_t) 1);
TPS(out_buff)[TPS(out_used)] = '\0';
if (TPS(stack_ptr) && !_nc_tparm_err) {
@@ -977,27 +1093,89 @@ tparam_internal(const char *string, TPARM_DATA * data)
return (TPS(out_buff));
}
+#ifdef CUR
+/*
+ * Only a few standard capabilities accept string parameters. The others that
+ * are parameterized accept only numeric parameters.
+ */
+static bool
+check_string_caps(TPARM_DATA *data, const char *string)
+{
+ bool result = FALSE;
+
+#define CHECK_CAP(name) (VALID_STRING(name) && !strcmp(name, string))
+
+ /*
+ * Disallow string parameters unless we can check them against a terminal
+ * description.
+ */
+ if (cur_term != NULL) {
+ int want_type = 0;
+
+ if (CHECK_CAP(pkey_key))
+ want_type = 2; /* function key #1, type string #2 */
+ else if (CHECK_CAP(pkey_local))
+ want_type = 2; /* function key #1, execute string #2 */
+ else if (CHECK_CAP(pkey_xmit))
+ want_type = 2; /* function key #1, transmit string #2 */
+ else if (CHECK_CAP(plab_norm))
+ want_type = 2; /* label #1, show string #2 */
+#ifdef pkey_plab
+ else if (CHECK_CAP(pkey_plab))
+ want_type = 6; /* function key #1, type string #2, show string #3 */
+#endif
+#if NCURSES_XNAMES
+ else {
+ char *check;
+
+ check = tigetstr("Cs");
+ if (CHECK_CAP(check))
+ want_type = 1; /* style #1 */
+
+ check = tigetstr("Ms");
+ if (CHECK_CAP(check))
+ want_type = 3; /* storage unit #1, content #2 */
+ }
+#endif
+
+ if (want_type == data->tparm_type) {
+ result = TRUE;
+ } else {
+ T(("unexpected string-parameter"));
+ }
+ }
+ return result;
+}
+
+#define ValidCap(allow_strings) (myData.tparm_type == 0 || \
+ (allow_strings && \
+ check_string_caps(&myData, string)))
+#else
+#define ValidCap(allow_strings) 1
+#endif
+
#if NCURSES_TPARM_VARARGS
NCURSES_EXPORT(char *)
tparm(const char *string, ...)
{
+ TPARM_STATE *tps = get_tparm_state(cur_term);
TPARM_DATA myData;
- va_list ap;
char *result = NULL;
_nc_tparm_err = 0;
#ifdef TRACE
- TPS(tname) = "tparm";
+ tps->tname = "tparm";
#endif /* TRACE */
- if (tparm_setup(string, &myData) == OK) {
+ if (tparm_setup(cur_term, string, &myData) == OK && ValidCap(TRUE)) {
+ va_list ap;
va_start(ap, string);
tparm_copy_valist(&myData, TRUE, ap);
va_end(ap);
- result = tparam_internal(string, &myData);
+ result = tparam_internal(tps, string, &myData);
}
return result;
}
@@ -1016,15 +1194,18 @@ tparm(const char *string,
TPARM_ARG a8,
TPARM_ARG a9)
{
+ TPARM_STATE *tps = get_tparm_state(cur_term);
TPARM_DATA myData;
char *result = NULL;
_nc_tparm_err = 0;
#ifdef TRACE
- TPS(tname) = "tparm";
+ tps->tname = "tparm";
#endif /* TRACE */
- if (tparm_setup(string, &myData) == OK) {
+#define string_ok (sizeof(char*) <= sizeof(TPARM_ARG))
+
+ if (tparm_setup(cur_term, string, &myData) == OK && ValidCap(string_ok)) {
myData.param[0] = a1;
myData.param[1] = a2;
@@ -1036,7 +1217,7 @@ tparm(const char *string,
myData.param[7] = a8;
myData.param[8] = a9;
- result = tparam_internal(string, &myData);
+ result = tparam_internal(tps, string, &myData);
}
return result;
}
@@ -1046,50 +1227,182 @@ tparm(const char *string,
NCURSES_EXPORT(char *)
tiparm(const char *string, ...)
{
+ TPARM_STATE *tps = get_tparm_state(cur_term);
TPARM_DATA myData;
- va_list ap;
char *result = NULL;
_nc_tparm_err = 0;
#ifdef TRACE
- TPS(tname) = "tiparm";
+ tps->tname = "tiparm";
#endif /* TRACE */
- if (tparm_setup(string, &myData) == OK) {
+ if (tparm_setup(cur_term, string, &myData) == OK && ValidCap(TRUE)) {
+ va_list ap;
va_start(ap, string);
tparm_copy_valist(&myData, FALSE, ap);
va_end(ap);
- result = tparam_internal(string, &myData);
+ result = tparam_internal(tps, string, &myData);
}
return result;
}
/*
- * The internal-use flavor ensures that the parameters are numbers, not strings
+ * Use tparm if the formatting string matches the expected number of parameters
+ * counting string-parameters.
*/
NCURSES_EXPORT(char *)
-_nc_tiparm(int expected, const char *string, ...)
+tiparm_s(int num_expected, int tparm_type, const char *string, ...)
{
+ TPARM_STATE *tps = get_tparm_state(cur_term);
TPARM_DATA myData;
- va_list ap;
char *result = NULL;
_nc_tparm_err = 0;
#ifdef TRACE
- TPS(tname) = "_nc_tiparm";
+ tps->tname = "tiparm_s";
#endif /* TRACE */
-
- if (tparm_setup(string, &myData) == OK
- && myData.num_actual <= expected
- && myData.tparm_type == 0) {
+ if (num_expected >= 0 &&
+ num_expected <= 9 &&
+ tparm_type >= 0 &&
+ tparm_type < 7 && /* limit to 2 string parameters */
+ tparm_setup(cur_term, string, &myData) == OK &&
+ myData.tparm_type == tparm_type &&
+ myData.num_actual == num_expected) {
+ va_list ap;
va_start(ap, string);
tparm_copy_valist(&myData, FALSE, ap);
va_end(ap);
- result = tparam_internal(string, &myData);
+ result = tparam_internal(tps, string, &myData);
+ }
+ return result;
+}
+
+/*
+ * Analyze the formatting string, return the analysis.
+ */
+NCURSES_EXPORT(int)
+tiscan_s(int *num_expected, int *tparm_type, const char *string)
+{
+ TPARM_DATA myData;
+ int result = ERR;
+
+#ifdef TRACE
+ TPARM_STATE *tps = get_tparm_state(cur_term);
+ tps->tname = "tiscan_s";
+#endif /* TRACE */
+
+ if (tparm_setup(cur_term, string, &myData) == OK) {
+ *num_expected = myData.num_actual;
+ *tparm_type = myData.tparm_type;
+ result = OK;
}
return result;
}
+
+/*
+ * The internal-use flavor ensures that parameters are numbers, not strings.
+ * In addition to ensuring that they are numbers, it ensures that the parameter
+ * count is consistent with intended usage.
+ *
+ * Unlike the general-purpose tparm/tiparm, these internal calls are fairly
+ * well defined:
+ *
+ * expected == 0 - not applicable
+ * expected == 1 - set color, or vertical/horizontal addressing
+ * expected == 2 - cursor addressing
+ * expected == 4 - initialize color or color pair
+ * expected == 9 - set attributes
+ *
+ * Only for the last case (set attributes) should a parameter be optional.
+ * Also, a capability which calls for more parameters than expected should be
+ * ignored.
+ *
+ * Return a null if the parameter-checks fail. Otherwise, return a pointer to
+ * the formatted capability string.
+ */
+NCURSES_EXPORT(char *)
+_nc_tiparm(int expected, const char *string, ...)
+{
+ TPARM_STATE *tps = get_tparm_state(cur_term);
+ TPARM_DATA myData;
+ char *result = NULL;
+
+ _nc_tparm_err = 0;
+ T((T_CALLED("_nc_tiparm(%d, %s, ...)"), expected, _nc_visbuf(string)));
+#ifdef TRACE
+ tps->tname = "_nc_tiparm";
+#endif /* TRACE */
+
+ if (tparm_setup(cur_term, string, &myData) == OK && ValidCap(FALSE)) {
+#ifdef CUR
+ if (myData.num_actual != expected && cur_term != NULL) {
+ int needed = expected;
+ if (CHECK_CAP(to_status_line)) {
+ needed = 0; /* allow for xterm's status line */
+ } else if (CHECK_CAP(set_a_background)) {
+ needed = 0; /* allow for monochrome fakers */
+ } else if (CHECK_CAP(set_a_foreground)) {
+ needed = 0;
+ } else if (CHECK_CAP(set_background)) {
+ needed = 0;
+ } else if (CHECK_CAP(set_foreground)) {
+ needed = 0;
+ }
+#if NCURSES_XNAMES
+ else {
+ char *check;
+
+ check = tigetstr("xm");
+ if (CHECK_CAP(check)) {
+ needed = 3;
+ }
+ check = tigetstr("S0");
+ if (CHECK_CAP(check)) {
+ needed = 0; /* used in screen-base */
+ }
+ }
+#endif
+ if (myData.num_actual >= needed && myData.num_actual <= expected)
+ expected = myData.num_actual;
+ }
+#endif
+ if (myData.num_actual == 0 && expected) {
+ T(("missing parameter%s, expected %s%d",
+ expected > 1 ? "s" : "",
+ expected == 9 ? "up to " : "",
+ expected));
+ } else if (myData.num_actual > expected) {
+ T(("too many parameters, have %d, expected %d",
+ myData.num_actual,
+ expected));
+ } else if (expected != 9 && myData.num_actual != expected) {
+ T(("expected %d parameters, have %d",
+ myData.num_actual,
+ expected));
+ } else {
+ va_list ap;
+
+ va_start(ap, string);
+ tparm_copy_valist(&myData, FALSE, ap);
+ va_end(ap);
+
+ result = tparam_internal(tps, string, &myData);
+ }
+ }
+ returnPtr(result);
+}
+
+/*
+ * Improve tic's checks by resetting the terminfo "static variables" before
+ * calling functions which may update them.
+ */
+NCURSES_EXPORT(void)
+_nc_reset_tparm(TERMINAL *term)
+{
+ TPARM_STATE *tps = get_tparm_state(term);
+ memset(TPS(static_vars), 0, sizeof(TPS(static_vars)));
+}
diff --git a/ncurses/tinfo/lib_tputs.c b/ncurses/tinfo/lib_tputs.c
index 3eb19d2d9662..f834532c9193 100644
--- a/ncurses/tinfo/lib_tputs.c
+++ b/ncurses/tinfo/lib_tputs.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2022,2023 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -52,12 +52,12 @@
#include <termcap.h> /* ospeed */
#include <tic.h>
-MODULE_ID("$Id: lib_tputs.c,v 1.106 2020/11/29 00:40:08 tom Exp $")
+MODULE_ID("$Id: lib_tputs.c,v 1.111 2023/09/16 16:05:15 tom Exp $")
NCURSES_EXPORT_VAR(char) PC = 0; /* used by termcap library */
NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed = 0; /* used by termcap library */
-NCURSES_EXPORT_VAR(int) _nc_nulls_sent = 0; /* used by 'tack' program */
+NCURSES_EXPORT_VAR(int) _nc_nulls_sent = 0;
#if NCURSES_NO_PADDING
NCURSES_EXPORT(void)
@@ -89,6 +89,9 @@ NCURSES_SP_NAME(delay_output) (NCURSES_SP_DCLx int ms)
{
T((T_CALLED("delay_output(%p,%d)"), (void *) SP_PARM, ms));
+ if (ms > MAX_DELAY_MSECS)
+ ms = MAX_DELAY_MSECS;
+
if (!HasTInfoTerminal(SP_PARM))
returnCode(ERR);
@@ -128,9 +131,8 @@ NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_DCL0)
SP_PARM->out_buffer));
if (SP_PARM->out_inuse) {
char *buf = SP_PARM->out_buffer;
- size_t amount = SP->out_inuse;
+ size_t amount = SP_PARM->out_inuse;
- SP->out_inuse = 0;
TR(TRACE_CHARPUT, ("flushing %ld/%ld bytes",
(unsigned long) amount, _nc_outchars));
while (amount) {
@@ -155,6 +157,8 @@ NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_DCL0)
TR(TRACE_CHARPUT, ("flushing stdout"));
fflush(stdout);
}
+ if (SP_PARM != 0)
+ SP_PARM->out_inuse = 0;
returnVoid;
}
@@ -276,8 +280,8 @@ NCURSES_SP_NAME(tputs) (NCURSES_SP_DCLx
NCURSES_SP_OUTC outc)
{
NCURSES_SP_OUTC my_outch = GetOutCh();
- bool always_delay;
- bool normal_delay;
+ bool always_delay = FALSE;
+ bool normal_delay = FALSE;
int number;
#if BSD_TPUTS
int trailpad;
@@ -305,32 +309,30 @@ NCURSES_SP_NAME(tputs) (NCURSES_SP_DCLx
}
#endif /* TRACE */
- if (SP_PARM != 0 && !HasTInfoTerminal(SP_PARM))
- return ERR;
-
if (!VALID_STRING(string))
return ERR;
- if (
+ if (SP_PARM != 0 && HasTInfoTerminal(SP_PARM)) {
+ if (
#if NCURSES_SP_FUNCS
- (SP_PARM != 0 && SP_PARM->_term == 0)
+ (SP_PARM != 0 && SP_PARM->_term == 0)
#else
- cur_term == 0
+ cur_term == 0
#endif
- ) {
- always_delay = FALSE;
- normal_delay = TRUE;
- } else {
- always_delay = (string == bell) || (string == flash_screen);
- normal_delay =
- !xon_xoff
- && padding_baud_rate
+ ) {
+ always_delay = FALSE;
+ normal_delay = TRUE;
+ } else {
+ always_delay = (string == bell) || (string == flash_screen);
+ normal_delay =
+ !xon_xoff
+ && padding_baud_rate
#if NCURSES_NO_PADDING
- && !GetNoPadding(SP_PARM)
+ && !GetNoPadding(SP_PARM)
#endif
- && (_nc_baudrate(ospeed) >= padding_baud_rate);
+ && (_nc_baudrate(ospeed) >= padding_baud_rate);
+ }
}
-
#if BSD_TPUTS
/*
* This ugly kluge deals with the fact that some ancient BSD programs
@@ -429,7 +431,7 @@ NCURSES_SP_NAME(tputs) (NCURSES_SP_DCLx
*/
if (trailpad > 0
&& (always_delay || normal_delay))
- delay_output(trailpad / 10);
+ NCURSES_SP_NAME(delay_output) (NCURSES_SP_ARGx trailpad / 10);
#endif /* BSD_TPUTS */
SetOutCh(my_outch);
diff --git a/ncurses/tinfo/lib_win32con.c b/ncurses/tinfo/lib_win32con.c
index 3c0fe8160734..2d6857aeb4a8 100644
--- a/ncurses/tinfo/lib_win32con.c
+++ b/ncurses/tinfo/lib_win32con.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020-2021,2023 Thomas E. Dickey *
* Copyright 1998-2009,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -38,7 +38,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_win32con.c,v 1.6 2020/11/21 23:44:58 tom Exp $")
+MODULE_ID("$Id: lib_win32con.c,v 1.14 2023/08/05 20:44:38 tom Exp $")
#ifdef _NC_WINDOWS
@@ -58,19 +58,7 @@ MODULE_ID("$Id: lib_win32con.c,v 1.6 2020/11/21 23:44:58 tom Exp $")
#define read_screen ReadConsoleOutput
#endif
-static BOOL IsConsoleHandle(HANDLE hdl);
-static bool save_original_screen(void);
-static bool restore_original_screen(void) GCC_UNUSED;
static bool read_screen_data(void);
-static int Adjust(int milliseconds, int diff);
-static int decode_mouse(SCREEN *sp, int mask);
-static bool handle_mouse(SCREEN *sp, MOUSE_EVENT_RECORD mer);
-static int rkeycompare(const void *el1, const void *el2);
-static int keycompare(const void *el1, const void *el2);
-static int MapKey(WORD vKey);
-static int AnsiKey(WORD vKey);
-
-static ULONGLONG tdiff(FILETIME fstart, FILETIME fend);
#define GenMap(vKey,key) MAKELONG(key, vKey)
static const LONG keylist[] =
@@ -104,7 +92,7 @@ static const LONG ansi_keys[] =
#define FKEYS 24
#define MAPSIZE (FKEYS + N_INI)
-/* A process can only have a single console, so it's safe
+/* A process can only have a single console, so it is safe
to maintain all the information about it in a single
static structure.
*/
@@ -136,32 +124,32 @@ _nc_console_vt_supported(void)
osvi.dwMinorVersion,
osvi.dwBuildNumber));
if (osvi.dwMajorVersion >= REQUIRED_MAX_V) {
- if (osvi.dwMajorVersion == REQUIRED_MAX_V) {
- if (((osvi.dwMinorVersion == REQUIRED_MIN_V) &&
- (osvi.dwBuildNumber >= REQUIRED_BUILD)) ||
- ((osvi.dwMinorVersion > REQUIRED_MIN_V)))
- res = 1;
- } else
- res = 1;
+ if (osvi.dwMajorVersion == REQUIRED_MAX_V) {
+ if (((osvi.dwMinorVersion == REQUIRED_MIN_V) &&
+ (osvi.dwBuildNumber >= REQUIRED_BUILD)) ||
+ ((osvi.dwMinorVersion > REQUIRED_MIN_V)))
+ res = 1;
+ } else
+ res = 1;
}
returnCode(res);
}
NCURSES_EXPORT(void)
-_nc_console_size(int* Lines, int* Cols)
+_nc_console_size(int *Lines, int *Cols)
{
- EnsureInit();
- if (Lines != NULL && Cols != NULL) {
- if (WINCONSOLE.buffered) {
- *Lines = (int) (WINCONSOLE.SBI.dwSize.Y);
- *Cols = (int) (WINCONSOLE.SBI.dwSize.X);
- } else {
- *Lines = (int) (WINCONSOLE.SBI.srWindow.Bottom + 1 -
- WINCONSOLE.SBI.srWindow.Top);
- *Cols = (int) (WINCONSOLE.SBI.srWindow.Right + 1 -
- WINCONSOLE.SBI.srWindow.Left);
- }
- }
+ EnsureInit();
+ if (Lines != NULL && Cols != NULL) {
+ if (WINCONSOLE.buffered) {
+ *Lines = (int) (WINCONSOLE.SBI.dwSize.Y);
+ *Cols = (int) (WINCONSOLE.SBI.dwSize.X);
+ } else {
+ *Lines = (int) (WINCONSOLE.SBI.srWindow.Bottom + 1 -
+ WINCONSOLE.SBI.srWindow.Top);
+ *Cols = (int) (WINCONSOLE.SBI.srWindow.Right + 1 -
+ WINCONSOLE.SBI.srWindow.Left);
+ }
+ }
}
/* Convert a file descriptor into a HANDLE
@@ -188,9 +176,9 @@ IsConsoleHandle(HANDLE hdl)
EnsureInit();
if (!GetConsoleMode(hdl, &dwFlag)) {
- T(("GetConsoleMode failed"));
+ T(("GetConsoleMode failed"));
} else {
- result = TRUE;
+ result = TRUE;
}
returnBool(result);
@@ -198,7 +186,7 @@ IsConsoleHandle(HANDLE hdl)
/* This is used when running in terminfo mode to discover,
whether or not the "terminal" is actually a Windows
- Console. It's the responsibility of the console to deal
+ Console. It is the responsibility of the console to deal
with the terminal escape sequences that are sent by
terminfo.
*/
@@ -219,8 +207,8 @@ NCURSES_EXPORT(void)
_nc_console_selectActiveHandle(void)
{
if (WINCONSOLE.lastOut != WINCONSOLE.hdl) {
- WINCONSOLE.lastOut = WINCONSOLE.hdl;
- SetConsoleActiveScreenBuffer(WINCONSOLE.lastOut);
+ WINCONSOLE.lastOut = WINCONSOLE.hdl;
+ SetConsoleActiveScreenBuffer(WINCONSOLE.lastOut);
}
}
@@ -228,32 +216,32 @@ NCURSES_EXPORT(HANDLE)
_nc_console_fd2handle(int fd)
{
HANDLE hdl = _nc_console_handle(fd);
- if (hdl==WINCONSOLE.inp) {
- T(("lib_win32con:validateHandle %d -> WINCONSOLE.inp", fd));
- } else if (hdl==WINCONSOLE.hdl) {
- T(("lib_win32con:validateHandle %d -> WINCONSOLE.hdl", fd));
- } else if (hdl==WINCONSOLE.out) {
- T(("lib_win32con:validateHandle %d -> WINCONSOLE.out", fd));
+ if (hdl == WINCONSOLE.inp) {
+ T(("lib_win32con:validateHandle %d -> WINCONSOLE.inp", fd));
+ } else if (hdl == WINCONSOLE.hdl) {
+ T(("lib_win32con:validateHandle %d -> WINCONSOLE.hdl", fd));
+ } else if (hdl == WINCONSOLE.out) {
+ T(("lib_win32con:validateHandle %d -> WINCONSOLE.out", fd));
} else {
- T(("lib_win32con:validateHandle %d maps to unknown HANDLE", fd));
- hdl = INVALID_HANDLE_VALUE;
+ T(("lib_win32con:validateHandle %d maps to unknown HANDLE", fd));
+ hdl = INVALID_HANDLE_VALUE;
}
#if 1
assert(hdl != INVALID_HANDLE_VALUE);
#endif
if (hdl != INVALID_HANDLE_VALUE) {
- if (hdl != WINCONSOLE.inp && (!WINCONSOLE.isTermInfoConsole && WINCONSOLE.progMode)) {
- if (hdl==WINCONSOLE.out && hdl!=WINCONSOLE.hdl) {
- T(("lib_win32con:validateHandle forcing WINCONSOLE.out -> WINCONSOLE.hdl"));
- hdl = WINCONSOLE.hdl;
- }
- }
+ if (hdl != WINCONSOLE.inp && (!WINCONSOLE.isTermInfoConsole && WINCONSOLE.progMode)) {
+ if (hdl == WINCONSOLE.out && hdl != WINCONSOLE.hdl) {
+ T(("lib_win32con:validateHandle forcing WINCONSOLE.out -> WINCONSOLE.hdl"));
+ hdl = WINCONSOLE.hdl;
+ }
+ }
}
return hdl;
}
NCURSES_EXPORT(int)
-_nc_console_setmode(HANDLE hdl, const TTY *arg)
+_nc_console_setmode(HANDLE hdl, const TTY * arg)
{
DWORD dwFlag = 0;
int code = ERR;
@@ -261,86 +249,86 @@ _nc_console_setmode(HANDLE hdl, const TTY *arg)
if (arg) {
#ifdef TRACE
- TTY TRCTTY;
+ TTY TRCTTY;
#define TRCTTYOUT(flag) TRCTTY.dwFlagOut = flag
#define TRCTTYIN(flag) TRCTTY.dwFlagIn = flag
#else
#define TRCTTYOUT(flag)
#define TRCTTYIN(flag)
#endif
- T(("lib_win32con:_nc_console_setmode %s", _nc_trace_ttymode(arg)));
- if (hdl==WINCONSOLE.inp) {
- dwFlag = arg->dwFlagIn | ENABLE_MOUSE_INPUT | VT_FLAG_IN;
- if (WINCONSOLE.isTermInfoConsole)
- dwFlag |= (VT_FLAG_IN);
- else
- dwFlag &= (DWORD) ~(VT_FLAG_IN);
- TRCTTYIN(dwFlag);
- SetConsoleMode(hdl, dwFlag);
+ T(("lib_win32con:_nc_console_setmode %s", _nc_trace_ttymode(arg)));
+ if (hdl == WINCONSOLE.inp) {
+ dwFlag = arg->dwFlagIn | ENABLE_MOUSE_INPUT | VT_FLAG_IN;
+ if (WINCONSOLE.isTermInfoConsole)
+ dwFlag |= (VT_FLAG_IN);
+ else
+ dwFlag &= (DWORD) ~ (VT_FLAG_IN);
+ TRCTTYIN(dwFlag);
+ SetConsoleMode(hdl, dwFlag);
- alt = OutHandle();
- dwFlag = arg->dwFlagOut;
- if (WINCONSOLE.isTermInfoConsole)
- dwFlag |= (VT_FLAG_OUT);
- else
- dwFlag |= (VT_FLAG_OUT);
- TRCTTYOUT(dwFlag);
- SetConsoleMode(alt, dwFlag);
- } else {
- dwFlag = arg->dwFlagOut;
- if (WINCONSOLE.isTermInfoConsole)
- dwFlag |= (VT_FLAG_OUT);
- else
- dwFlag |= (VT_FLAG_OUT);
- TRCTTYOUT(dwFlag);
- SetConsoleMode(hdl, dwFlag);
+ alt = OutHandle();
+ dwFlag = arg->dwFlagOut;
+ if (WINCONSOLE.isTermInfoConsole)
+ dwFlag |= (VT_FLAG_OUT);
+ else
+ dwFlag |= (VT_FLAG_OUT);
+ TRCTTYOUT(dwFlag);
+ SetConsoleMode(alt, dwFlag);
+ } else {
+ dwFlag = arg->dwFlagOut;
+ if (WINCONSOLE.isTermInfoConsole)
+ dwFlag |= (VT_FLAG_OUT);
+ else
+ dwFlag |= (VT_FLAG_OUT);
+ TRCTTYOUT(dwFlag);
+ SetConsoleMode(hdl, dwFlag);
- alt = WINCONSOLE.inp;
- dwFlag = arg->dwFlagIn | ENABLE_MOUSE_INPUT;
- if (WINCONSOLE.isTermInfoConsole)
- dwFlag |= (VT_FLAG_IN);
- else
- dwFlag &= (DWORD) ~(VT_FLAG_IN);
- TRCTTYIN(dwFlag);
- SetConsoleMode(alt, dwFlag);
- T(("effective mode set %s", _nc_trace_ttymode(&TRCTTY)));
- }
- code = OK;
+ alt = WINCONSOLE.inp;
+ dwFlag = arg->dwFlagIn | ENABLE_MOUSE_INPUT;
+ if (WINCONSOLE.isTermInfoConsole)
+ dwFlag |= (VT_FLAG_IN);
+ else
+ dwFlag &= (DWORD) ~ (VT_FLAG_IN);
+ TRCTTYIN(dwFlag);
+ SetConsoleMode(alt, dwFlag);
+ T(("effective mode set %s", _nc_trace_ttymode(&TRCTTY)));
+ }
+ code = OK;
}
- return(code);
+ return (code);
}
NCURSES_EXPORT(int)
-_nc_console_getmode(HANDLE hdl, TTY *arg)
+_nc_console_getmode(HANDLE hdl, TTY * arg)
{
int code = ERR;
if (arg) {
- DWORD dwFlag = 0;
- HANDLE alt;
+ DWORD dwFlag = 0;
+ HANDLE alt;
- if (hdl==WINCONSOLE.inp) {
- if(GetConsoleMode(hdl, &dwFlag)) {
- arg->dwFlagIn = dwFlag;
- alt = OutHandle();
- if (GetConsoleMode(alt, &dwFlag)) {
- arg->dwFlagOut = dwFlag;
- code = OK;
- }
- }
- } else {
- if (GetConsoleMode(hdl, &dwFlag)) {
- arg->dwFlagOut = dwFlag;
- alt = WINCONSOLE.inp;
- if (GetConsoleMode(alt, &dwFlag)) {
- arg->dwFlagIn = dwFlag;
- code = OK;
- }
- }
- }
+ if (hdl == WINCONSOLE.inp) {
+ if (GetConsoleMode(hdl, &dwFlag)) {
+ arg->dwFlagIn = dwFlag;
+ alt = OutHandle();
+ if (GetConsoleMode(alt, &dwFlag)) {
+ arg->dwFlagOut = dwFlag;
+ code = OK;
+ }
+ }
+ } else {
+ if (GetConsoleMode(hdl, &dwFlag)) {
+ arg->dwFlagOut = dwFlag;
+ alt = WINCONSOLE.inp;
+ if (GetConsoleMode(alt, &dwFlag)) {
+ arg->dwFlagIn = dwFlag;
+ code = OK;
+ }
+ }
+ }
}
T(("lib_win32con:_nc_console_getmode %s", _nc_trace_ttymode(arg)));
- return(code);
+ return (code);
}
NCURSES_EXPORT(int)
@@ -351,15 +339,15 @@ _nc_console_flush(HANDLE hdl)
T((T_CALLED("lib_win32con::_nc_console_flush(hdl=%p"), hdl));
if (hdl != INVALID_HANDLE_VALUE) {
- if (hdl == WINCONSOLE.hdl ||
- hdl == WINCONSOLE.inp ||
- hdl == WINCONSOLE.out) {
- if (!FlushConsoleInputBuffer(WINCONSOLE.inp))
- code = ERR;
- } else {
- code = ERR;
- T(("_nc_console_flush not requesting a handle owned by console."));
- }
+ if (hdl == WINCONSOLE.hdl ||
+ hdl == WINCONSOLE.inp ||
+ hdl == WINCONSOLE.out) {
+ if (!FlushConsoleInputBuffer(WINCONSOLE.inp))
+ code = ERR;
+ } else {
+ code = ERR;
+ T(("_nc_console_flush not requesting a handle owned by console."));
+ }
}
returnCode(code);
}
@@ -368,18 +356,17 @@ NCURSES_EXPORT(WORD)
_nc_console_MapColor(bool fore, int color)
{
static const int _cmap[] =
- {0, 4, 2, 6, 1, 5, 3, 7};
+ {0, 4, 2, 6, 1, 5, 3, 7};
int a;
if (color < 0 || color > 7)
- a = fore ? 7 : 0;
+ a = fore ? 7 : 0;
else
- a = _cmap[color];
+ a = _cmap[color];
if (!fore)
- a = a << 4;
+ a = a << 4;
return (WORD) a;
}
-
/*
* Attempt to save the screen contents. PDCurses does this if
* PDC_RESTORE_SCREEN is set, giving the same visual appearance on
@@ -398,25 +385,26 @@ save_original_screen(void)
WINCONSOLE.save_region.Right = (SHORT) (WINCONSOLE.SBI.dwSize.X - 1);
if (read_screen_data()) {
- result = TRUE;
+ result = TRUE;
} else {
- WINCONSOLE.save_region.Top = WINCONSOLE.SBI.srWindow.Top;
- WINCONSOLE.save_region.Left = WINCONSOLE.SBI.srWindow.Left;
- WINCONSOLE.save_region.Bottom = WINCONSOLE.SBI.srWindow.Bottom;
- WINCONSOLE.save_region.Right = WINCONSOLE.SBI.srWindow.Right;
+ WINCONSOLE.save_region.Top = WINCONSOLE.SBI.srWindow.Top;
+ WINCONSOLE.save_region.Left = WINCONSOLE.SBI.srWindow.Left;
+ WINCONSOLE.save_region.Bottom = WINCONSOLE.SBI.srWindow.Bottom;
+ WINCONSOLE.save_region.Right = WINCONSOLE.SBI.srWindow.Right;
- WINCONSOLE.window_only = TRUE;
+ WINCONSOLE.window_only = TRUE;
- if (read_screen_data()) {
- result = TRUE;
- }
+ if (read_screen_data()) {
+ result = TRUE;
+ }
}
T(("... save original screen contents %s", result ? "ok" : "err"));
return result;
}
+#if 0
static bool
restore_original_screen(void)
{
@@ -428,29 +416,30 @@ restore_original_screen(void)
WINCONSOLE.window_only ? "window" : "entire buffer"));
bufferCoord.X = (SHORT) (WINCONSOLE.window_only ?
- WINCONSOLE.SBI.srWindow.Left : 0);
+ WINCONSOLE.SBI.srWindow.Left : 0);
bufferCoord.Y = (SHORT) (WINCONSOLE.window_only ?
- WINCONSOLE.SBI.srWindow.Top : 0);
+ WINCONSOLE.SBI.srWindow.Top : 0);
if (write_screen(WINCONSOLE.hdl,
- WINCONSOLE.save_screen,
- WINCONSOLE.save_size,
- bufferCoord,
- &save_region)) {
- result = TRUE;
- mvcur(-1, -1, LINES - 2, 0);
- T(("... restore original screen contents ok %dx%d (%d,%d - %d,%d)",
- WINCONSOLE.save_size.Y,
- WINCONSOLE.save_size.X,
- save_region.Top,
- save_region.Left,
- save_region.Bottom,
- save_region.Right));
+ WINCONSOLE.save_screen,
+ WINCONSOLE.save_size,
+ bufferCoord,
+ &save_region)) {
+ result = TRUE;
+ mvcur(-1, -1, LINES - 2, 0);
+ T(("... restore original screen contents ok %dx%d (%d,%d - %d,%d)",
+ WINCONSOLE.save_size.Y,
+ WINCONSOLE.save_size.X,
+ save_region.Top,
+ save_region.Left,
+ save_region.Bottom,
+ save_region.Right));
} else {
- T(("... restore original screen contents err"));
+ T(("... restore original screen contents err"));
}
return result;
}
+#endif
static bool
read_screen_data(void)
@@ -460,38 +449,38 @@ read_screen_data(void)
size_t want;
WINCONSOLE.save_size.X = (SHORT) (WINCONSOLE.save_region.Right
- - WINCONSOLE.save_region.Left + 1);
+ - WINCONSOLE.save_region.Left + 1);
WINCONSOLE.save_size.Y = (SHORT) (WINCONSOLE.save_region.Bottom
- - WINCONSOLE.save_region.Top + 1);
+ - WINCONSOLE.save_region.Top + 1);
want = (size_t) (WINCONSOLE.save_size.X * WINCONSOLE.save_size.Y);
if ((WINCONSOLE.save_screen = malloc(want * sizeof(CHAR_INFO))) != 0) {
- bufferCoord.X = (SHORT) (WINCONSOLE.window_only ?
- WINCONSOLE.SBI.srWindow.Left : 0);
- bufferCoord.Y = (SHORT) (WINCONSOLE.window_only ?
- WINCONSOLE.SBI.srWindow.Top : 0);
+ bufferCoord.X = (SHORT) (WINCONSOLE.window_only ?
+ WINCONSOLE.SBI.srWindow.Left : 0);
+ bufferCoord.Y = (SHORT) (WINCONSOLE.window_only ?
+ WINCONSOLE.SBI.srWindow.Top : 0);
- T(("... reading console %s %dx%d into %d,%d - %d,%d at %d,%d",
- WINCONSOLE.window_only ? "window" : "buffer",
- WINCONSOLE.save_size.Y, WINCONSOLE.save_size.X,
- WINCONSOLE.save_region.Top,
- WINCONSOLE.save_region.Left,
- WINCONSOLE.save_region.Bottom,
- WINCONSOLE.save_region.Right,
- bufferCoord.Y,
- bufferCoord.X));
+ T(("... reading console %s %dx%d into %d,%d - %d,%d at %d,%d",
+ WINCONSOLE.window_only ? "window" : "buffer",
+ WINCONSOLE.save_size.Y, WINCONSOLE.save_size.X,
+ WINCONSOLE.save_region.Top,
+ WINCONSOLE.save_region.Left,
+ WINCONSOLE.save_region.Bottom,
+ WINCONSOLE.save_region.Right,
+ bufferCoord.Y,
+ bufferCoord.X));
- if (read_screen(WINCONSOLE.hdl,
- WINCONSOLE.save_screen,
- WINCONSOLE.save_size,
- bufferCoord,
- &WINCONSOLE.save_region)) {
- result = TRUE;
- } else {
- T((" error %#lx", (unsigned long) GetLastError()));
- FreeAndNull(WINCONSOLE.save_screen);
- }
+ if (read_screen(WINCONSOLE.hdl,
+ WINCONSOLE.save_screen,
+ WINCONSOLE.save_size,
+ bufferCoord,
+ &WINCONSOLE.save_region)) {
+ result = TRUE;
+ } else {
+ T((" error %#lx", (unsigned long) GetLastError()));
+ FreeAndNull(WINCONSOLE.save_screen);
+ }
}
return result;
@@ -502,31 +491,31 @@ _nc_console_get_SBI(void)
{
bool rc = FALSE;
if (GetConsoleScreenBufferInfo(WINCONSOLE.hdl, &(WINCONSOLE.SBI))) {
- T(("GetConsoleScreenBufferInfo"));
- T(("... buffer(X:%d Y:%d)",
- WINCONSOLE.SBI.dwSize.X,
- WINCONSOLE.SBI.dwSize.Y));
- T(("... window(X:%d Y:%d)",
- WINCONSOLE.SBI.dwMaximumWindowSize.X,
- WINCONSOLE.SBI.dwMaximumWindowSize.Y));
- T(("... cursor(X:%d Y:%d)",
- WINCONSOLE.SBI.dwCursorPosition.X,
- WINCONSOLE.SBI.dwCursorPosition.Y));
- T(("... display(Top:%d Bottom:%d Left:%d Right:%d)",
- WINCONSOLE.SBI.srWindow.Top,
- WINCONSOLE.SBI.srWindow.Bottom,
- WINCONSOLE.SBI.srWindow.Left,
- WINCONSOLE.SBI.srWindow.Right));
- if (WINCONSOLE.buffered) {
- WINCONSOLE.origin.X = 0;
- WINCONSOLE.origin.Y = 0;
- } else {
- WINCONSOLE.origin.X = WINCONSOLE.SBI.srWindow.Left;
- WINCONSOLE.origin.Y = WINCONSOLE.SBI.srWindow.Top;
- }
- rc = TRUE;
+ T(("GetConsoleScreenBufferInfo"));
+ T(("... buffer(X:%d Y:%d)",
+ WINCONSOLE.SBI.dwSize.X,
+ WINCONSOLE.SBI.dwSize.Y));
+ T(("... window(X:%d Y:%d)",
+ WINCONSOLE.SBI.dwMaximumWindowSize.X,
+ WINCONSOLE.SBI.dwMaximumWindowSize.Y));
+ T(("... cursor(X:%d Y:%d)",
+ WINCONSOLE.SBI.dwCursorPosition.X,
+ WINCONSOLE.SBI.dwCursorPosition.Y));
+ T(("... display(Top:%d Bottom:%d Left:%d Right:%d)",
+ WINCONSOLE.SBI.srWindow.Top,
+ WINCONSOLE.SBI.srWindow.Bottom,
+ WINCONSOLE.SBI.srWindow.Left,
+ WINCONSOLE.SBI.srWindow.Right));
+ if (WINCONSOLE.buffered) {
+ WINCONSOLE.origin.X = 0;
+ WINCONSOLE.origin.Y = 0;
+ } else {
+ WINCONSOLE.origin.X = WINCONSOLE.SBI.srWindow.Left;
+ WINCONSOLE.origin.Y = WINCONSOLE.SBI.srWindow.Top;
+ }
+ rc = TRUE;
} else {
- T(("GetConsoleScreenBufferInfo ERR"));
+ T(("GetConsoleScreenBufferInfo ERR"));
}
return rc;
}
@@ -546,8 +535,8 @@ _nc_console_set_scrollback(bool normal, CONSOLE_SCREEN_BUFFER_INFO * info)
T((T_CALLED("lib_win32con::_nc_console_set_scrollback(%s)"),
(normal
- ? "normal"
- : "application")));
+ ? "normal"
+ : "application")));
T(("... SBI.srWindow %d,%d .. %d,%d",
info->srWindow.Top,
@@ -559,52 +548,52 @@ _nc_console_set_scrollback(bool normal, CONSOLE_SCREEN_BUFFER_INFO * info)
info->dwSize.X));
if (normal) {
- rect = info->srWindow;
- coord = info->dwSize;
- if (memcmp(info, &WINCONSOLE.SBI, sizeof(*info)) != 0) {
- changed = TRUE;
- WINCONSOLE.SBI = *info;
- }
+ rect = info->srWindow;
+ coord = info->dwSize;
+ if (memcmp(info, &WINCONSOLE.SBI, sizeof(*info)) != 0) {
+ changed = TRUE;
+ WINCONSOLE.SBI = *info;
+ }
} else {
- int high = info->srWindow.Bottom - info->srWindow.Top + 1;
- int wide = info->srWindow.Right - info->srWindow.Left + 1;
+ int high = info->srWindow.Bottom - info->srWindow.Top + 1;
+ int wide = info->srWindow.Right - info->srWindow.Left + 1;
- if (high < MIN_HIGH) {
- T(("... height %d < %d", high, MIN_HIGH));
- high = MIN_HIGH;
- changed = TRUE;
- }
- if (wide < MIN_WIDE) {
- T(("... width %d < %d", wide, MIN_WIDE));
- wide = MIN_WIDE;
- changed = TRUE;
- }
+ if (high < MIN_HIGH) {
+ T(("... height %d < %d", high, MIN_HIGH));
+ high = MIN_HIGH;
+ changed = TRUE;
+ }
+ if (wide < MIN_WIDE) {
+ T(("... width %d < %d", wide, MIN_WIDE));
+ wide = MIN_WIDE;
+ changed = TRUE;
+ }
- rect.Left =
- rect.Top = 0;
- rect.Right = (SHORT) (wide - 1);
- rect.Bottom = (SHORT) (high - 1);
+ rect.Left =
+ rect.Top = 0;
+ rect.Right = (SHORT) (wide - 1);
+ rect.Bottom = (SHORT) (high - 1);
- coord.X = (SHORT) wide;
- coord.Y = (SHORT) high;
+ coord.X = (SHORT) wide;
+ coord.Y = (SHORT) high;
- if (info->dwSize.Y != high ||
- info->dwSize.X != wide ||
- info->srWindow.Top != 0 ||
- info->srWindow.Left != 0) {
- changed = TRUE;
- }
+ if (info->dwSize.Y != high ||
+ info->dwSize.X != wide ||
+ info->srWindow.Top != 0 ||
+ info->srWindow.Left != 0) {
+ changed = TRUE;
+ }
}
if (changed) {
- T(("... coord %d,%d", coord.Y, coord.X));
- T(("... rect %d,%d - %d,%d",
- rect.Top, rect.Left,
- rect.Bottom, rect.Right));
- SetConsoleScreenBufferSize(WINCONSOLE.hdl, coord); /* dwSize */
- SetConsoleWindowInfo(WINCONSOLE.hdl, TRUE, &rect); /* srWindow */
- _nc_console_get_SBI();
+ T(("... coord %d,%d", coord.Y, coord.X));
+ T(("... rect %d,%d - %d,%d",
+ rect.Top, rect.Left,
+ rect.Bottom, rect.Right));
+ SetConsoleScreenBufferSize(WINCONSOLE.hdl, coord); /* dwSize */
+ SetConsoleWindowInfo(WINCONSOLE.hdl, TRUE, &rect); /* srWindow */
+ _nc_console_get_SBI();
}
returnVoid;
}
@@ -629,9 +618,9 @@ static int
Adjust(int milliseconds, int diff)
{
if (milliseconds != INFINITY) {
- milliseconds -= diff;
- if (milliseconds < 0)
- milliseconds = 0;
+ milliseconds -= diff;
+ if (milliseconds < 0)
+ milliseconds = 0;
}
return milliseconds;
}
@@ -642,38 +631,38 @@ Adjust(int milliseconds, int diff)
FROM_LEFT_4TH_BUTTON_PRESSED | \
RIGHTMOST_BUTTON_PRESSED)
-static int
+static mmask_t
decode_mouse(SCREEN *sp, int mask)
{
- int result = 0;
+ mmask_t result = 0;
(void) sp;
assert(sp && console_initialized);
if (mask & FROM_LEFT_1ST_BUTTON_PRESSED)
- result |= BUTTON1_PRESSED;
+ result |= BUTTON1_PRESSED;
if (mask & FROM_LEFT_2ND_BUTTON_PRESSED)
- result |= BUTTON2_PRESSED;
+ result |= BUTTON2_PRESSED;
if (mask & FROM_LEFT_3RD_BUTTON_PRESSED)
- result |= BUTTON3_PRESSED;
+ result |= BUTTON3_PRESSED;
if (mask & FROM_LEFT_4TH_BUTTON_PRESSED)
- result |= BUTTON4_PRESSED;
+ result |= BUTTON4_PRESSED;
if (mask & RIGHTMOST_BUTTON_PRESSED) {
- switch (WINCONSOLE.numButtons) {
- case 1:
- result |= BUTTON1_PRESSED;
- break;
- case 2:
- result |= BUTTON2_PRESSED;
- break;
- case 3:
- result |= BUTTON3_PRESSED;
- break;
- case 4:
- result |= BUTTON4_PRESSED;
- break;
- }
+ switch (WINCONSOLE.numButtons) {
+ case 1:
+ result |= BUTTON1_PRESSED;
+ break;
+ case 2:
+ result |= BUTTON2_PRESSED;
+ break;
+ case 3:
+ result |= BUTTON3_PRESSED;
+ break;
+ case 4:
+ result |= BUTTON4_PRESSED;
+ break;
+ }
}
return result;
@@ -697,26 +686,22 @@ handle_mouse(SCREEN *sp, MOUSE_EVENT_RECORD mer)
* FIXME: implement continuous event-tracking.
*/
if (sp->_drv_mouse_new_buttons != sp->_drv_mouse_old_buttons) {
- memset(&work, 0, sizeof(work));
+ memset(&work, 0, sizeof(work));
- if (sp->_drv_mouse_new_buttons) {
- work.bstate |=
- (mmask_t) decode_mouse(sp,
- sp->_drv_mouse_new_buttons);
- } else {
- /* cf: BUTTON_PRESSED, BUTTON_RELEASED */
- work.bstate |=
- (mmask_t) (decode_mouse(sp,
- sp->_drv_mouse_old_buttons)
- >> 1);
- result = TRUE;
- }
+ if (sp->_drv_mouse_new_buttons) {
+ work.bstate |= decode_mouse(sp, sp->_drv_mouse_new_buttons);
+ } else {
+ /* cf: BUTTON_PRESSED, BUTTON_RELEASED */
+ work.bstate |= (decode_mouse(sp, sp->_drv_mouse_old_buttons)
+ >> 1);
+ result = TRUE;
+ }
- work.x = mer.dwMousePosition.X;
- work.y = mer.dwMousePosition.Y - AdjustY();
+ work.x = mer.dwMousePosition.X;
+ work.y = mer.dwMousePosition.Y - AdjustY();
- sp->_drv_mouse_fifo[sp->_drv_mouse_tail] = work;
- sp->_drv_mouse_tail += 1;
+ sp->_drv_mouse_fifo[sp->_drv_mouse_tail] = work;
+ sp->_drv_mouse_tail += 1;
}
return result;
}
@@ -730,7 +715,6 @@ rkeycompare(const void *el1, const void *el2)
return ((key1 < key2) ? -1 : ((key1 == key2) ? 0 : 1));
}
-
static int
keycompare(const void *el1, const void *el2)
{
@@ -746,22 +730,22 @@ MapKey(WORD vKey)
int code = -1;
if (!WINCONSOLE.isTermInfoConsole) {
- WORD nKey = 0;
- void *res;
- LONG key = GenMap(vKey, 0);
+ WORD nKey = 0;
+ void *res;
+ LONG key = GenMap(vKey, 0);
- res = bsearch(&key,
- WINCONSOLE.map,
- (size_t) (N_INI + FKEYS),
- sizeof(keylist[0]),
- keycompare);
- if (res) {
- key = *((LONG *) res);
- nKey = LOWORD(key);
- code = (int) (nKey & 0x7fff);
- if (nKey & 0x8000)
- code = -code;
- }
+ res = bsearch(&key,
+ WINCONSOLE.map,
+ (size_t) (N_INI + FKEYS),
+ sizeof(keylist[0]),
+ keycompare);
+ if (res) {
+ key = *((LONG *) res);
+ nKey = LOWORD(key);
+ code = (int) (nKey & 0x7fff);
+ if (nKey & 0x8000)
+ code = -code;
+ }
}
return code;
}
@@ -772,22 +756,22 @@ AnsiKey(WORD vKey)
int code = -1;
if (!WINCONSOLE.isTermInfoConsole) {
- WORD nKey = 0;
- void *res;
- LONG key = GenMap(vKey, 0);
+ WORD nKey = 0;
+ void *res;
+ LONG key = GenMap(vKey, 0);
- res = bsearch(&key,
- WINCONSOLE.ansi_map,
- (size_t) (N_INI + FKEYS),
- sizeof(keylist[0]),
- keycompare);
- if (res) {
- key = *((LONG *) res);
- nKey = LOWORD(key);
- code = (int) (nKey & 0x7fff);
- if (nKey & 0x8000)
- code = -code;
- }
+ res = bsearch(&key,
+ WINCONSOLE.ansi_map,
+ (size_t) (N_INI + FKEYS),
+ sizeof(keylist[0]),
+ keycompare);
+ if (res) {
+ key = *((LONG *) res);
+ nKey = LOWORD(key);
+ code = (int) (nKey & 0x7fff);
+ if (nKey & 0x8000)
+ code = -code;
+ }
}
return code;
}
@@ -804,17 +788,17 @@ _nc_console_keyok(int keycode, int flag)
T((T_CALLED("lib_win32con::_nc_console_keyok(%d, %d)"), keycode, flag));
res = bsearch(&key,
- WINCONSOLE.rmap,
- (size_t) (N_INI + FKEYS),
- sizeof(keylist[0]),
- rkeycompare);
+ WINCONSOLE.rmap,
+ (size_t) (N_INI + FKEYS),
+ sizeof(keylist[0]),
+ rkeycompare);
if (res) {
- key = *((LONG *) res);
- vKey = HIWORD(key);
- nKey = (LOWORD(key)) & 0x7fff;
- if (!flag)
- nKey |= 0x8000;
- *(LONG *) res = GenMap(vKey, nKey);
+ key = *((LONG *) res);
+ vKey = HIWORD(key);
+ nKey = (LOWORD(key)) & 0x7fff;
+ if (!flag)
+ nKey |= 0x8000;
+ *(LONG *) res = GenMap(vKey, nKey);
}
returnCode(code);
}
@@ -829,27 +813,27 @@ _nc_console_keyExist(int keycode)
T((T_CALLED("lib_win32con::_nc_console_keyExist(%d)"), keycode));
res = bsearch(&key,
- WINCONSOLE.rmap,
- (size_t) (N_INI + FKEYS),
- sizeof(keylist[0]),
- rkeycompare);
+ WINCONSOLE.rmap,
+ (size_t) (N_INI + FKEYS),
+ sizeof(keylist[0]),
+ rkeycompare);
if (res) {
- key = *((LONG *) res);
- nKey = LOWORD(key);
- if (!(nKey & 0x8000))
- found = TRUE;
+ key = *((LONG *) res);
+ nKey = LOWORD(key);
+ if (!(nKey & 0x8000))
+ found = TRUE;
}
returnCode(found);
}
NCURSES_EXPORT(int)
_nc_console_twait(
- SCREEN *sp,
- HANDLE hdl,
- int mode,
- int milliseconds,
- int *timeleft
- EVENTLIST_2nd(_nc_eventlist * evl))
+ SCREEN *sp,
+ HANDLE hdl,
+ int mode,
+ int milliseconds,
+ int *timeleft
+ EVENTLIST_2nd(_nc_eventlist * evl))
{
INPUT_RECORD inp_rec;
BOOL b;
@@ -861,7 +845,7 @@ _nc_console_twait(
bool isNoDelay = (milliseconds == 0);
#ifdef NCURSES_WGETCH_EVENTS
- (void) evl; /* TODO: implement wgetch-events */
+ (void) evl; /* TODO: implement wgetch-events */
#endif
#define IGNORE_CTRL_KEYS (SHIFT_PRESSED|LEFT_ALT_PRESSED|RIGHT_ALT_PRESSED| \
@@ -871,174 +855,174 @@ _nc_console_twait(
assert(sp);
TR(TRACE_IEVENT, ("start twait: hdl=%p, %d milliseconds, mode: %d",
- hdl, milliseconds, mode));
+ hdl, milliseconds, mode));
if (milliseconds < 0)
- milliseconds = INFINITY;
+ milliseconds = INFINITY;
memset(&inp_rec, 0, sizeof(inp_rec));
while (true) {
- if (!isNoDelay) {
- GetSystemTimeAsFileTime(&fstart);
- rc = WaitForSingleObject(hdl, (DWORD) milliseconds);
- GetSystemTimeAsFileTime(&fend);
- diff = (int) tdiff(fstart, fend);
- milliseconds = Adjust(milliseconds, diff);
- if (milliseconds< 0)
- break;
- }
+ if (!isNoDelay) {
+ GetSystemTimeAsFileTime(&fstart);
+ rc = WaitForSingleObject(hdl, (DWORD) milliseconds);
+ GetSystemTimeAsFileTime(&fend);
+ diff = (int) tdiff(fstart, fend);
+ milliseconds = Adjust(milliseconds, diff);
+ if (milliseconds < 0)
+ break;
+ }
- if (isNoDelay || (rc == WAIT_OBJECT_0)) {
- if (mode) {
- nRead = 0;
- b = GetNumberOfConsoleInputEvents(hdl, &nRead);
- if (!b) {
- T(("twait:err GetNumberOfConsoleInputEvents"));
- }
- if (isNoDelay && b) {
- T(("twait: Events Available: %ld", nRead));
- if (nRead==0) {
- code = 0;
- goto end;
- } else {
- DWORD n = 0;
- INPUT_RECORD* pInpRec =
- TypeAlloca(INPUT_RECORD, nRead);
- if (pInpRec != NULL) {
- DWORD i;
- BOOL f;
- memset(pInpRec, 0, sizeof(INPUT_RECORD)*nRead);
- f = PeekConsoleInput(hdl, pInpRec, nRead, &n);
- if (f) {
- for(i = 0; i < n; i++) {
- if (pInpRec[i].EventType==KEY_EVENT) {
- if(pInpRec[i].Event.KeyEvent.bKeyDown) {
- DWORD ctrlMask =
- (pInpRec[i].Event.KeyEvent.dwControlKeyState &
- IGNORE_CTRL_KEYS);
- if (!ctrlMask) {
- code = TW_INPUT;
- goto end;
- }
- }
- }
- }
- } else {
- T(("twait:err PeekConsoleInput"));
- }
- code = 0;
- goto end;
- } else {
- T(("twait:err could not alloca input records"));
- }
- }
- }
- if (b && nRead > 0) {
- b = PeekConsoleInput(hdl, &inp_rec, 1, &nRead);
- if (!b) {
- T(("twait:err PeekConsoleInput"));
- }
- if (b && nRead > 0) {
- switch (inp_rec.EventType) {
- case KEY_EVENT:
- if (mode & TW_INPUT) {
- WORD vk =
- inp_rec.Event.KeyEvent.wVirtualKeyCode;
- char ch =
- inp_rec.Event.KeyEvent.uChar.AsciiChar;
- T(("twait:event KEY_EVENT"));
- T(("twait vk=%d, ch=%d, keydown=%d",
- vk, ch, inp_rec.Event.KeyEvent.bKeyDown));
- if (inp_rec.Event.KeyEvent.bKeyDown) {
- T(("twait:event KeyDown"));
- if (!WINCONSOLE.isTermInfoConsole &&
- (0 == ch)) {
- int nKey = MapKey(vk);
- if (nKey < 0) {
- CONSUME();
- continue;
- }
- }
- code = TW_INPUT;
- goto end;
- } else {
- CONSUME();
- }
- }
- continue;
- case MOUSE_EVENT:
- T(("twait:event MOUSE_EVENT"));
- if (decode_mouse(sp,
- (inp_rec.Event.MouseEvent.dwButtonState
- & BUTTON_MASK)) == 0) {
- CONSUME();
- } else if (mode & TW_MOUSE) {
- code = TW_MOUSE;
- goto end;
- }
- continue;
- /* e.g., FOCUS_EVENT */
- default:
- T(("twait:event Tyoe %d", inp_rec.EventType));
- CONSUME();
- _nc_console_selectActiveHandle();
- continue;
- }
- }
- }
- }
- continue;
- } else {
- if (rc != WAIT_TIMEOUT) {
- code = -1;
- break;
- } else {
- code = 0;
- break;
- }
- }
+ if (isNoDelay || (rc == WAIT_OBJECT_0)) {
+ if (mode) {
+ nRead = 0;
+ b = GetNumberOfConsoleInputEvents(hdl, &nRead);
+ if (!b) {
+ T(("twait:err GetNumberOfConsoleInputEvents"));
+ }
+ if (isNoDelay && b) {
+ T(("twait: Events Available: %ld", nRead));
+ if (nRead == 0) {
+ code = 0;
+ goto end;
+ } else {
+ DWORD n = 0;
+ INPUT_RECORD *pInpRec =
+ TypeAlloca(INPUT_RECORD, nRead);
+ if (pInpRec != NULL) {
+ DWORD i;
+ BOOL f;
+ memset(pInpRec, 0, sizeof(INPUT_RECORD) * nRead);
+ f = PeekConsoleInput(hdl, pInpRec, nRead, &n);
+ if (f) {
+ for (i = 0; i < n; i++) {
+ if (pInpRec[i].EventType == KEY_EVENT) {
+ if (pInpRec[i].Event.KeyEvent.bKeyDown) {
+ DWORD ctrlMask =
+ (pInpRec[i].Event.KeyEvent.dwControlKeyState &
+ IGNORE_CTRL_KEYS);
+ if (!ctrlMask) {
+ code = TW_INPUT;
+ goto end;
+ }
+ }
+ }
+ }
+ } else {
+ T(("twait:err PeekConsoleInput"));
+ }
+ code = 0;
+ goto end;
+ } else {
+ T(("twait:err could not alloca input records"));
+ }
+ }
+ }
+ if (b && nRead > 0) {
+ b = PeekConsoleInput(hdl, &inp_rec, 1, &nRead);
+ if (!b) {
+ T(("twait:err PeekConsoleInput"));
+ }
+ if (b && nRead > 0) {
+ switch (inp_rec.EventType) {
+ case KEY_EVENT:
+ if (mode & TW_INPUT) {
+ WORD vk =
+ inp_rec.Event.KeyEvent.wVirtualKeyCode;
+ char ch =
+ inp_rec.Event.KeyEvent.uChar.AsciiChar;
+ T(("twait:event KEY_EVENT"));
+ T(("twait vk=%d, ch=%d, keydown=%d",
+ vk, ch, inp_rec.Event.KeyEvent.bKeyDown));
+ if (inp_rec.Event.KeyEvent.bKeyDown) {
+ T(("twait:event KeyDown"));
+ if (!WINCONSOLE.isTermInfoConsole &&
+ (0 == ch)) {
+ int nKey = MapKey(vk);
+ if (nKey < 0) {
+ CONSUME();
+ continue;
+ }
+ }
+ code = TW_INPUT;
+ goto end;
+ } else {
+ CONSUME();
+ }
+ }
+ continue;
+ case MOUSE_EVENT:
+ T(("twait:event MOUSE_EVENT"));
+ if (decode_mouse(sp,
+ (inp_rec.Event.MouseEvent.dwButtonState
+ & BUTTON_MASK)) == 0) {
+ CONSUME();
+ } else if (mode & TW_MOUSE) {
+ code = TW_MOUSE;
+ goto end;
+ }
+ continue;
+ /* e.g., FOCUS_EVENT */
+ default:
+ T(("twait:event Tyoe %d", inp_rec.EventType));
+ CONSUME();
+ _nc_console_selectActiveHandle();
+ continue;
+ }
+ }
+ }
+ }
+ continue;
+ } else {
+ if (rc != WAIT_TIMEOUT) {
+ code = -1;
+ break;
+ } else {
+ code = 0;
+ break;
+ }
+ }
}
-end:
+ end:
TR(TRACE_IEVENT, ("end twait: returned %d (%lu), remaining time %d msec",
- code, GetLastError(), milliseconds));
+ code, GetLastError(), milliseconds));
if (timeleft)
- *timeleft = milliseconds;
+ *timeleft = milliseconds;
return code;
}
NCURSES_EXPORT(int)
_nc_console_testmouse(
- SCREEN *sp,
- HANDLE hdl,
- int delay
- EVENTLIST_2nd(_nc_eventlist * evl))
+ SCREEN *sp,
+ HANDLE hdl,
+ int delay
+ EVENTLIST_2nd(_nc_eventlist * evl))
{
int rc = 0;
assert(sp);
if (sp->_drv_mouse_head < sp->_drv_mouse_tail) {
- rc = TW_MOUSE;
+ rc = TW_MOUSE;
} else {
- rc = _nc_console_twait(sp,
- hdl,
- TWAIT_MASK,
- delay,
- (int *) 0
- EVENTLIST_2nd(evl));
+ rc = _nc_console_twait(sp,
+ hdl,
+ TWAIT_MASK,
+ delay,
+ (int *) 0
+ EVENTLIST_2nd(evl));
}
return rc;
}
NCURSES_EXPORT(int)
_nc_console_read(
- SCREEN *sp,
- HANDLE hdl,
- int *buf)
+ SCREEN *sp,
+ HANDLE hdl,
+ int *buf)
{
int rc = -1;
INPUT_RECORD inp_rec;
@@ -1054,47 +1038,47 @@ _nc_console_read(
T((T_CALLED("lib_win32con::_nc_console_read(%p)"), sp));
while ((b = ReadConsoleInput(hdl, &inp_rec, 1, &nRead))) {
- if (b && nRead > 0) {
- if (rc < 0)
- rc = 0;
- rc = rc + (int) nRead;
- if (inp_rec.EventType == KEY_EVENT) {
- if (!inp_rec.Event.KeyEvent.bKeyDown)
- continue;
- *buf = (int) inp_rec.Event.KeyEvent.uChar.AsciiChar;
- vk = inp_rec.Event.KeyEvent.wVirtualKeyCode;
- /*
- * There are 24 virtual function-keys, and typically
- * 12 function-keys on a keyboard. Use the shift-modifier
- * to provide the remaining 12 keys.
- */
- if (vk >= VK_F1 && vk <= VK_F12) {
- if (inp_rec.Event.KeyEvent.dwControlKeyState &
- SHIFT_PRESSED) {
- vk = (WORD) (vk + 12);
- }
- }
- if (*buf == 0) {
- int key = MapKey(vk);
- if (key < 0)
- continue;
- if (sp->_keypad_on) {
- *buf = key;
- } else {
- ungetch('\0');
- *buf = AnsiKey(vk);
- }
- }
- break;
- } else if (inp_rec.EventType == MOUSE_EVENT) {
- if (handle_mouse(sp,
- inp_rec.Event.MouseEvent)) {
- *buf = KEY_MOUSE;
- break;
- }
- }
- continue;
- }
+ if (b && nRead > 0) {
+ if (rc < 0)
+ rc = 0;
+ rc = rc + (int) nRead;
+ if (inp_rec.EventType == KEY_EVENT) {
+ if (!inp_rec.Event.KeyEvent.bKeyDown)
+ continue;
+ *buf = (int) inp_rec.Event.KeyEvent.uChar.AsciiChar;
+ vk = inp_rec.Event.KeyEvent.wVirtualKeyCode;
+ /*
+ * There are 24 virtual function-keys, and typically
+ * 12 function-keys on a keyboard. Use the shift-modifier
+ * to provide the remaining 12 keys.
+ */
+ if (vk >= VK_F1 && vk <= VK_F12) {
+ if (inp_rec.Event.KeyEvent.dwControlKeyState &
+ SHIFT_PRESSED) {
+ vk = (WORD) (vk + 12);
+ }
+ }
+ if (*buf == 0) {
+ int key = MapKey(vk);
+ if (key < 0)
+ continue;
+ if (sp->_keypad_on) {
+ *buf = key;
+ } else {
+ ungetch('\0');
+ *buf = AnsiKey(vk);
+ }
+ }
+ break;
+ } else if (inp_rec.EventType == MOUSE_EVENT) {
+ if (handle_mouse(sp,
+ inp_rec.Event.MouseEvent)) {
+ *buf = KEY_MOUSE;
+ break;
+ }
+ }
+ continue;
+ }
}
returnCode(rc);
}
@@ -1115,16 +1099,17 @@ _nc_console_isatty(int fd)
T((T_CALLED("lib_win32con::_nc_console_isatty(%d"), fd));
if (_isatty(fd))
- result = 1;
+ result = 1;
#ifdef _NC_CHECK_MINTTY
else {
- if (_nc_console_checkmintty(fd, NULL)) {
- result = 2;
- fprintf(stderr, "ncurses on Windows must run in a Windows console.\n");
- fprintf(stderr, "On newer versions of Windows, the calling program should create a PTY-like.\n");
- fprintf(stderr, "device using the CreatePseudoConsole Windows API call.\n");
- exit(EXIT_FAILURE);
- }
+ if (_nc_console_checkmintty(fd, NULL)) {
+ result = 2;
+ fprintf(stderr,
+ "ncurses on Windows must run in a Windows console.\n"
+ "On newer versions of Windows, the calling program should create a PTY-like.\n"
+ "device using the CreatePseudoConsole Windows API call.\n");
+ exit(EXIT_FAILURE);
+ }
}
#endif
returnCode(result);
@@ -1139,116 +1124,127 @@ _nc_console_checkinit(bool initFlag, bool assumeTermInfo)
initFlag, assumeTermInfo));
if (!initFlag) {
- res = console_initialized;
+ res = console_initialized;
} else {
- /* initialize once, or not at all */
- if (!console_initialized) {
- int i;
- DWORD num_buttons;
- WORD a;
- BOOL buffered = FALSE;
- BOOL b;
+ /* initialize once, or not at all */
+ if (!console_initialized) {
+ int i;
+ DWORD num_buttons;
+ WORD a;
+ BOOL buffered = FALSE;
+ BOOL b;
+
+ START_TRACE();
+ WINCONSOLE.isTermInfoConsole = assumeTermInfo;
+
+ WINCONSOLE.map = (LPDWORD) malloc(sizeof(DWORD) * MAPSIZE);
+ WINCONSOLE.rmap = (LPDWORD) malloc(sizeof(DWORD) * MAPSIZE);
+ WINCONSOLE.ansi_map = (LPDWORD) malloc(sizeof(DWORD) * MAPSIZE);
+
+ for (i = 0; i < (N_INI + FKEYS); i++) {
+ if (i < N_INI) {
+ WINCONSOLE.rmap[i] = WINCONSOLE.map[i] =
+ (DWORD) keylist[i];
+ WINCONSOLE.ansi_map[i] = (DWORD) ansi_keys[i];
+ } else {
+ WINCONSOLE.rmap[i] = WINCONSOLE.map[i] =
+ (DWORD) GenMap((VK_F1 + (i - N_INI)),
+ (KEY_F(1) + (i - N_INI)));
+ WINCONSOLE.ansi_map[i] =
+ (DWORD) GenMap((VK_F1 + (i - N_INI)),
+ (';' + (i - N_INI)));
+ }
+ }
+ qsort(WINCONSOLE.ansi_map,
+ (size_t) (MAPSIZE),
+ sizeof(keylist[0]),
+ keycompare);
+ qsort(WINCONSOLE.map,
+ (size_t) (MAPSIZE),
+ sizeof(keylist[0]),
+ keycompare);
+ qsort(WINCONSOLE.rmap,
+ (size_t) (MAPSIZE),
+ sizeof(keylist[0]),
+ rkeycompare);
- START_TRACE();
- WINCONSOLE.isTermInfoConsole = assumeTermInfo;
+ if (GetNumberOfConsoleMouseButtons(&num_buttons)) {
+ WINCONSOLE.numButtons = (int) num_buttons;
+ } else {
+ WINCONSOLE.numButtons = 1;
+ }
- WINCONSOLE.map = (LPDWORD)malloc(sizeof(DWORD)*MAPSIZE);
- WINCONSOLE.rmap = (LPDWORD)malloc(sizeof(DWORD)*MAPSIZE);
- WINCONSOLE.ansi_map = (LPDWORD)malloc(sizeof(DWORD)*MAPSIZE);
+ a = _nc_console_MapColor(true, COLOR_WHITE) |
+ _nc_console_MapColor(false, COLOR_BLACK);
+ for (i = 0; i < CON_NUMPAIRS; i++)
+ WINCONSOLE.pairs[i] = a;
- for (i = 0; i < (N_INI + FKEYS); i++) {
- if (i < N_INI) {
- WINCONSOLE.rmap[i] = WINCONSOLE.map[i] =
- (DWORD) keylist[i];
- WINCONSOLE.ansi_map[i] = (DWORD) ansi_keys[i];
- } else {
- WINCONSOLE.rmap[i] = WINCONSOLE.map[i] =
- (DWORD) GenMap((VK_F1 + (i - N_INI)),
- (KEY_F(1) + (i - N_INI)));
- WINCONSOLE.ansi_map[i] =
- (DWORD) GenMap((VK_F1 + (i - N_INI)),
- (';' + (i - N_INI)));
- }
- }
- qsort(WINCONSOLE.ansi_map,
- (size_t) (MAPSIZE),
- sizeof(keylist[0]),
- keycompare);
- qsort(WINCONSOLE.map,
- (size_t) (MAPSIZE),
- sizeof(keylist[0]),
- keycompare);
- qsort(WINCONSOLE.rmap,
- (size_t) (MAPSIZE),
- sizeof(keylist[0]),
- rkeycompare);
+#define SaveConsoleMode(handle, value) \
+ GetConsoleMode(WINCONSOLE.handle, &WINCONSOLE.originalMode.value)
- if (GetNumberOfConsoleMouseButtons(&num_buttons)) {
- WINCONSOLE.numButtons = (int) num_buttons;
- } else {
- WINCONSOLE.numButtons = 1;
- }
+ if (WINCONSOLE.isTermInfoConsole) {
+ WINCONSOLE.inp = GetStdHandle(STD_INPUT_HANDLE);
+ WINCONSOLE.out = GetStdHandle(STD_OUTPUT_HANDLE);
+ WINCONSOLE.hdl = WINCONSOLE.out;
- a = _nc_console_MapColor(true, COLOR_WHITE) |
- _nc_console_MapColor(false, COLOR_BLACK);
- for (i = 0; i < CON_NUMPAIRS; i++)
- WINCONSOLE.pairs[i] = a;
+ SaveConsoleMode(inp, dwFlagIn);
+ SaveConsoleMode(out, dwFlagOut);
- WINCONSOLE.inp = GetStdHandle(STD_INPUT_HANDLE);
- WINCONSOLE.out = GetStdHandle(STD_OUTPUT_HANDLE);
- WINCONSOLE.hdl = WINCONSOLE.out;
+ } else {
+ b = AllocConsole();
- GetConsoleMode(WINCONSOLE.inp, &WINCONSOLE.originalMode.dwFlagIn);
- GetConsoleMode(WINCONSOLE.out, &WINCONSOLE.originalMode.dwFlagOut);
+ if (!b)
+ b = AttachConsole(ATTACH_PARENT_PROCESS);
- if (!WINCONSOLE.isTermInfoConsole) {
- b = AllocConsole();
+ WINCONSOLE.inp = GetDirectHandle("CONIN$", FILE_SHARE_READ);
+ WINCONSOLE.out = GetDirectHandle("CONOUT$", FILE_SHARE_WRITE);
- if (!b)
- b = AttachConsole(ATTACH_PARENT_PROCESS);
+ SaveConsoleMode(inp, dwFlagIn);
+ SaveConsoleMode(out, dwFlagOut);
- if (getenv("NCGDB") || getenv("NCURSES_CONSOLE2")) {
- T(("... will not buffer console"));
- } else {
- T(("... creating console buffer"));
- WINCONSOLE.hdl =
- CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE,
- 0,
- NULL,
- CONSOLE_TEXTMODE_BUFFER,
- NULL);
- buffered = TRUE;
- }
- }
+ if (getenv("NCGDB") || getenv("NCURSES_CONSOLE2")) {
+ WINCONSOLE.hdl = WINCONSOLE.out;
+ T(("... will not buffer console"));
+ } else {
+ T(("... creating console buffer"));
+ WINCONSOLE.hdl =
+ CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
+ NULL,
+ CONSOLE_TEXTMODE_BUFFER,
+ NULL);
+ buffered = TRUE;
+ }
+ }
- /* We set binary I/O even when using the console
- driver to cover the situation, that the
- TERM variable is set to #win32con, but actually
- Windows supports virtual terminal processing.
- So if terminfo functions are used in this setup,
- they actually may work.
- */
- _setmode(fileno(stdin), _O_BINARY);
- _setmode(fileno(stdout), _O_BINARY);
+ /* We set binary I/O even when using the console
+ driver to cover the situation, that the
+ TERM variable is set to #win32con, but actually
+ Windows supports virtual terminal processing.
+ So if terminfo functions are used in this setup,
+ they actually may work.
+ */
+ _setmode(fileno(stdin), _O_BINARY);
+ _setmode(fileno(stdout), _O_BINARY);
- if (WINCONSOLE.hdl != INVALID_HANDLE_VALUE) {
- WINCONSOLE.buffered = buffered;
- _nc_console_get_SBI();
- WINCONSOLE.save_SBI = WINCONSOLE.SBI;
- if (!buffered) {
- save_original_screen();
- _nc_console_set_scrollback(FALSE, &WINCONSOLE.SBI);
- }
- GetConsoleCursorInfo(WINCONSOLE.hdl, &WINCONSOLE.save_CI);
- T(("... initial cursor is %svisible, %d%%",
- (WINCONSOLE.save_CI.bVisible ? "" : "not-"),
- (int) WINCONSOLE.save_CI.dwSize));
- }
+ if (WINCONSOLE.hdl != INVALID_HANDLE_VALUE) {
+ WINCONSOLE.buffered = buffered;
+ _nc_console_get_SBI();
+ WINCONSOLE.save_SBI = WINCONSOLE.SBI;
+ if (!buffered) {
+ save_original_screen();
+ _nc_console_set_scrollback(FALSE, &WINCONSOLE.SBI);
+ }
+ GetConsoleCursorInfo(WINCONSOLE.hdl, &WINCONSOLE.save_CI);
+ T(("... initial cursor is %svisible, %d%%",
+ (WINCONSOLE.save_CI.bVisible ? "" : "not-"),
+ (int) WINCONSOLE.save_CI.dwSize));
+ }
- WINCONSOLE.initialized = TRUE;
- console_initialized = TRUE;
- }
- res = (WINCONSOLE.hdl != INVALID_HANDLE_VALUE);
+ WINCONSOLE.initialized = TRUE;
+ console_initialized = TRUE;
+ }
+ res = (WINCONSOLE.hdl != INVALID_HANDLE_VALUE);
}
returnBool(res);
}
diff --git a/ncurses/tinfo/lib_win32util.c b/ncurses/tinfo/lib_win32util.c
index d5bcd70199ed..c67c8ceb9862 100644
--- a/ncurses/tinfo/lib_win32util.c
+++ b/ncurses/tinfo/lib_win32util.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020-2021,2023 Thomas E. Dickey *
* Copyright 1998-2009,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -34,7 +34,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_win32util.c,v 1.1 2020/08/14 21:57:01 juergen Exp $")
+MODULE_ID("$Id: lib_win32util.c,v 1.4 2023/06/17 17:19:06 tom Exp $")
#ifdef _NC_WINDOWS
#include <io.h>
@@ -48,13 +48,13 @@ MODULE_ID("$Id: lib_win32util.c,v 1.1 2020/08/14 21:57:01 juergen Exp $")
/* This function tests, whether or not the ncurses application
is running as a descendant of MSYS2/cygwin mintty terminal
- application. mintty doesn't use Windows Console for it's screen
+ application. mintty doesn't use Windows Console for its screen
I/O, so the native Windows _isatty doesn't recognize it as
character device. But we can discover we are at the end of an
Pipe and can query the server side of the pipe, looking whether
or not this is mintty.
For now we terminate the program if we discover that situation.
- Althogh in theory it would be possible, to remotely manipulate
+ Although in theory it would be possible, to remotely manipulate
the terminal state of mintty, this is out of scope for now and
not worth the significant effort.
*/
@@ -68,10 +68,10 @@ _nc_console_checkmintty(int fd, LPHANDLE pMinTTY)
T((T_CALLED("lib_winhelper::_nc_console_checkmintty(%d, %p)"), fd, pMinTTY));
if (handle != INVALID_HANDLE_VALUE) {
- dw = GetFileType(handle);
+ dw = GetFileType(handle);
if (dw == FILE_TYPE_PIPE) {
if (GetNamedPipeInfo(handle, 0, 0, 0, 0)) {
- ULONG pPid;
+ ULONG pPid;
/* Requires NT6 */
if (GetNamedPipeServerProcessId(handle, &pPid)) {
TCHAR buf[MAX_PATH];
@@ -79,8 +79,7 @@ _nc_console_checkmintty(int fd, LPHANDLE pMinTTY)
/* These security attributes may allow us to
create a remote thread in mintty to manipulate
the terminal state remotely */
- HANDLE pHandle = OpenProcess(
- PROCESS_CREATE_THREAD
+ HANDLE pHandle = OpenProcess(PROCESS_CREATE_THREAD
| PROCESS_QUERY_INFORMATION
| PROCESS_VM_OPERATION
| PROCESS_VM_WRITE
@@ -88,20 +87,19 @@ _nc_console_checkmintty(int fd, LPHANDLE pMinTTY)
FALSE,
pPid);
if (pMinTTY)
- *pMinTTY = INVALID_HANDLE_VALUE;
+ *pMinTTY = INVALID_HANDLE_VALUE;
if (pHandle != INVALID_HANDLE_VALUE) {
- if ((len = GetProcessImageFileName(
- pHandle,
+ if ((len = GetProcessImageFileName(pHandle,
buf,
(DWORD)
array_length(buf)))) {
TCHAR *pos = _tcsrchr(buf, _T('\\'));
if (pos) {
- pos++;
+ pos++;
if (_tcsnicmp(pos, _TEXT("mintty.exe"), 10)
== 0) {
if (pMinTTY)
- *pMinTTY = pHandle;
+ *pMinTTY = pHandle;
code = 1;
}
}
@@ -114,7 +112,8 @@ _nc_console_checkmintty(int fd, LPHANDLE pMinTTY)
returnCode(code);
}
#endif /* _NC_CHECK_MINTTY */
-
+
+#if HAVE_GETTIMEOFDAY == 2
#define JAN1970 116444736000000000LL /* the value for 01/01/1970 00:00 */
NCURSES_EXPORT(int)
@@ -130,5 +129,6 @@ _nc_gettimeofday(struct timeval *tv, void *tz GCC_UNUSED)
tv->tv_sec = (long) ((data.since1601 - JAN1970) / 10000000LL);
return (0);
}
+#endif // HAVE_GETTIMEOFDAY == 2
#endif // _NC_WINDOWS
diff --git a/ncurses/tinfo/make_hash.c b/ncurses/tinfo/make_hash.c
index 9980279b2d21..78a684cc8bcb 100644
--- a/ncurses/tinfo/make_hash.c
+++ b/ncurses/tinfo/make_hash.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2020,2024 Thomas E. Dickey *
* Copyright 2009-2013,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -44,7 +44,7 @@
#include <ctype.h>
-MODULE_ID("$Id: make_hash.c,v 1.33 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: make_hash.c,v 1.34 2024/03/02 19:35:40 tom Exp $")
/*
* _nc_make_hash_table()
@@ -250,7 +250,7 @@ main(int argc, char **argv)
struct user_table_entry *name_table = typeCalloc(struct
user_table_entry, tablesize);
HashValue *hash_table = typeCalloc(HashValue, HASHTABSIZE);
- const char *root_name = "";
+ const char *root_name;
int column = 0;
int bigstring = 0;
unsigned n;
diff --git a/ncurses/tinfo/make_keys.c b/ncurses/tinfo/make_keys.c
index 80bbf63198a5..b8eb934357a3 100644
--- a/ncurses/tinfo/make_keys.c
+++ b/ncurses/tinfo/make_keys.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2011,2015 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -40,7 +40,7 @@
#define USE_TERMLIB 1
#include <build.priv.h>
-MODULE_ID("$Id: make_keys.c,v 1.22 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: make_keys.c,v 1.23 2021/08/18 20:55:25 tom Exp $")
#include <names.c>
@@ -128,11 +128,13 @@ main(int argc, char *argv[])
{
static const char *prefix[] =
{
- "#ifndef NCU_KEYS_H",
- "#define NCU_KEYS_H 1",
+ "#ifndef _INIT_KEYTRY_H",
+ "#define _INIT_KEYTRY_H 1",
"",
"/* This file was generated by MAKE_KEYS */",
"",
+ "#include <tic.h>",
+ "",
"#if BROKEN_LINKER",
"static",
"#endif",
@@ -143,7 +145,7 @@ main(int argc, char *argv[])
{
"\t{ 0, 0} };",
"",
- "#endif /* NCU_KEYS_H */",
+ "#endif /* _INIT_KEYTRY_H */",
0
};
diff --git a/ncurses/tinfo/obsolete.c b/ncurses/tinfo/obsolete.c
index 972a9a180e78..cc62f18cb3f4 100644
--- a/ncurses/tinfo/obsolete.c
+++ b/ncurses/tinfo/obsolete.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2023 Thomas E. Dickey *
* Copyright 2013-2014,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -37,7 +37,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: obsolete.c,v 1.6 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: obsolete.c,v 1.11 2023/10/21 15:38:47 tom Exp $")
/*
* Obsolete entrypoint retained for binary compatibility.
@@ -238,3 +238,98 @@ _nc_conv_to_utf32(unsigned *target, const char *source, unsigned limit)
#undef CH
}
#endif /* EXP_XTERM_1005 */
+
+#ifdef EXP_OOM_TESTING
+/*
+ * Out-of-memory testing, suitable for checking if initialization (and limited
+ * running) recovers from errors due to insufficient memory. In practice, this
+ * is unlikely except with artificially constructed tests (or poorly behaved
+ * applications).
+ */
+#undef malloc
+#undef calloc
+#undef realloc
+#undef free
+#undef strdup
+
+#define TR_OOM(stmt) T(stmt)
+
+static long oom_limit = -1;
+static long oom_count = 0;
+
+static bool
+oom_check(void)
+{
+ static bool initialized = FALSE;
+ static bool triggered = FALSE;
+ bool result = FALSE;
+
+ if (!initialized) {
+ char *env = getenv("NCURSES_OOM_TESTING");
+ initialized = TRUE;
+ if (env != NULL) {
+ char *check;
+ oom_limit = strtol(env, &check, 0);
+ if (check != NULL && *check != '\0')
+ oom_limit = 0;
+ }
+ }
+ ++oom_count;
+ if (oom_limit >= 0) {
+ result = (oom_count > oom_limit);
+ if (result && !triggered) {
+ triggered = TRUE;
+ TR_OOM(("out-of-memory"));
+ }
+ }
+ return result;
+}
+
+NCURSES_EXPORT(void *)
+_nc_oom_malloc(size_t size)
+{
+ char *result = (oom_check()
+ ? NULL
+ : malloc(size));
+ TR_OOM(("oom #%ld malloc(%ld) %p", oom_count, size, result));
+ return result;
+}
+
+NCURSES_EXPORT(void *)
+_nc_oom_calloc(size_t nmemb, size_t size)
+{
+ char *result = (oom_check()
+ ? NULL
+ : calloc(nmemb, size));
+ TR_OOM(("oom #%ld calloc(%ld, %ld) %p", oom_count, nmemb, size, result));
+ return result;
+}
+
+NCURSES_EXPORT(void *)
+_nc_oom_realloc(void *ptr, size_t size)
+{
+ char *result = (oom_check()
+ ? NULL
+ : realloc(ptr, size));
+ TR_OOM(("oom #%ld realloc(%p, %ld) %p", oom_count, ptr, size, result));
+ return result;
+}
+
+NCURSES_EXPORT(void)
+_nc_oom_free(void *ptr)
+{
+ ++oom_count;
+ TR_OOM(("oom #%ld free(%p)", oom_count, ptr));
+ free(ptr);
+}
+
+NCURSES_EXPORT(char *)
+_nc_oom_strdup(const char *ptr)
+{
+ char *result = (oom_check()
+ ? NULL
+ : strdup(ptr));
+ TR_OOM(("oom #%ld strdup(%p) %p", oom_count, ptr, result));
+ return result;
+}
+#endif /* EXP_OOM_TESTING */
diff --git a/ncurses/tinfo/parse_entry.c b/ncurses/tinfo/parse_entry.c
index ec2d3364234e..13fef495aec9 100644
--- a/ncurses/tinfo/parse_entry.c
+++ b/ncurses/tinfo/parse_entry.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2022,2023 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -48,7 +48,7 @@
#include <ctype.h>
#include <tic.h>
-MODULE_ID("$Id: parse_entry.c,v 1.101 2020/10/24 21:37:13 tom Exp $")
+MODULE_ID("$Id: parse_entry.c,v 1.108 2023/04/24 22:32:33 tom Exp $")
#ifdef LINT
static short const parametrized[] =
@@ -110,7 +110,7 @@ _nc_extend_names(ENTRY * entryp, const char *name, int token_type)
/* Well, we are given a cancel for a name that we don't recognize */
return _nc_extend_names(entryp, name, STRING);
default:
- return 0;
+ return NULL;
}
/* Adjust the 'offset' (insertion-point) to keep the lists of extended
@@ -142,6 +142,11 @@ _nc_extend_names(ENTRY * entryp, const char *name, int token_type)
for (last = (unsigned) (max - 1); last > tindex; last--)
if (!found) {
+ char *saved;
+
+ if ((saved = _nc_save_str(name)) == NULL)
+ return NULL;
+
switch (token_type) {
case BOOLEAN:
tp->ext_Booleans++;
@@ -169,7 +174,7 @@ _nc_extend_names(ENTRY * entryp, const char *name, int token_type)
TYPE_REALLOC(char *, actual, tp->ext_Names);
while (--actual > offset)
tp->ext_Names[actual] = tp->ext_Names[actual - 1];
- tp->ext_Names[offset] = _nc_save_str(name);
+ tp->ext_Names[offset] = saved;
}
temp.nte_name = tp->ext_Names[offset];
@@ -214,16 +219,39 @@ expected_type(const char *name, int token_type, bool silent)
}
#endif /* NCURSES_XNAMES */
+/*
+ * A valid entry name uses characters from the "portable character set"
+ * (more commonly referred to as US-ASCII), and disallows some of the
+ * punctuation characters:
+ *
+ * '/' is a pathname separator
+ * '\' may be a pathname separator, but more important, is an escape
+ * '|' delimits names and description
+ * '#' denotes a numeric value
+ * '=' denotes a string value
+ * '@' denotes a cancelled symbol
+ * ',' separates terminfo capabilities
+ * ':' separates termcap capabilities
+ *
+ * Termcap capability names may begin with a '#' or '@' (since they have
+ * exactly two characters).
+ */
static bool
valid_entryname(const char *name)
{
bool result = TRUE;
+ bool first = TRUE;
int ch;
while ((ch = UChar(*name++)) != '\0') {
- if (ch <= ' ' || ch > '~' || ch == '/') {
+ if (ch <= ' ' || ch > '~' || strchr("/\\|=,:", ch) != NULL) {
+ result = FALSE;
+ break;
+ }
+ if (!first && strchr("#@", ch) != NULL) {
result = FALSE;
break;
}
+ first = FALSE;
}
return result;
}
@@ -262,10 +290,14 @@ _nc_parse_entry(ENTRY * entryp, int literal, bool silent)
const char *name;
bool bad_tc_usage = FALSE;
+ TR(TRACE_DATABASE,
+ (T_CALLED("_nc_parse_entry(entry=%p, literal=%d, silent=%d)"),
+ (void *) entryp, literal, silent));
+
token_type = _nc_get_token(silent);
if (token_type == EOF)
- return (EOF);
+ returnDB(EOF);
if (token_type != NAMES)
_nc_err_abort("Entry does not start with terminal names in column one");
@@ -301,9 +333,9 @@ _nc_parse_entry(ENTRY * entryp, int literal, bool silent)
entryp->tterm.str_table = entryp->tterm.term_names = _nc_save_str(ptr);
if (entryp->tterm.str_table == 0)
- return (ERR);
+ returnDB(ERR);
- DEBUG(1, ("Starting '%s'", ptr));
+ DEBUG(2, ("Starting '%s'", ptr));
/*
* We do this because the one-token lookahead in the parse loop
@@ -337,6 +369,8 @@ _nc_parse_entry(ENTRY * entryp, int literal, bool silent)
bool is_use = (strcmp(_nc_curr_token.tk_name, "use") == 0);
bool is_tc = !is_use && (strcmp(_nc_curr_token.tk_name, "tc") == 0);
if (is_use || is_tc) {
+ char *saved;
+
if (!VALID_STRING(_nc_curr_token.tk_valstring)
|| _nc_curr_token.tk_valstring[0] == '\0') {
_nc_warning("missing name for use-clause");
@@ -350,11 +384,13 @@ _nc_parse_entry(ENTRY * entryp, int literal, bool silent)
_nc_curr_token.tk_valstring);
continue;
}
- entryp->uses[entryp->nuses].name = _nc_save_str(_nc_curr_token.tk_valstring);
- entryp->uses[entryp->nuses].line = _nc_curr_line;
- entryp->nuses++;
- if (entryp->nuses > 1 && is_tc) {
- BAD_TC_USAGE
+ if ((saved = _nc_save_str(_nc_curr_token.tk_valstring)) != NULL) {
+ entryp->uses[entryp->nuses].name = saved;
+ entryp->uses[entryp->nuses].line = _nc_curr_line;
+ entryp->nuses++;
+ if (entryp->nuses > 1 && is_tc) {
+ BAD_TC_USAGE
+ }
}
} else {
/* normal token lookup */
@@ -362,7 +398,7 @@ _nc_parse_entry(ENTRY * entryp, int literal, bool silent)
_nc_get_hash_table(_nc_syntax));
/*
- * Our kluge to handle aliasing. The reason it's done
+ * Our kluge to handle aliasing. The reason it is done
* this ugly way, with a linear search, is so the hashing
* machinery doesn't have to be made really complicated
* (also we get better warnings this way). No point in
@@ -605,7 +641,7 @@ _nc_parse_entry(ENTRY * entryp, int literal, bool silent)
}
_nc_wrap_entry(entryp, FALSE);
- return (OK);
+ returnDB(OK);
}
NCURSES_EXPORT(int)
@@ -737,6 +773,10 @@ postprocess_termcap(TERMTYPE2 *tp, bool has_base)
char buf[MAX_LINE * 2 + 2];
string_desc result;
+ TR(TRACE_DATABASE,
+ (T_CALLED("postprocess_termcap(tp=%p, has_base=%d)"),
+ (void *) tp, has_base));
+
/*
* TERMCAP DEFAULTS AND OBSOLETE-CAPABILITY TRANSLATIONS
*
@@ -929,7 +969,7 @@ postprocess_termcap(TERMTYPE2 *tp, bool has_base)
if (tp->Strings[to_ptr->nte_index]) {
const char *s = tp->Strings[from_ptr->nte_index];
const char *t = tp->Strings[to_ptr->nte_index];
- /* There's no point in warning about it if it's the same
+ /* There's no point in warning about it if it is the same
* string; that's just an inefficiency.
*/
if (VALID_STRING(s) && VALID_STRING(t) && strcmp(s, t) != 0)
@@ -1023,11 +1063,16 @@ postprocess_termcap(TERMTYPE2 *tp, bool has_base)
&& PRESENT(exit_alt_charset_mode)) {
acs_chars = _nc_save_str(VT_ACSC);
}
+ returnVoidDB;
}
static void
postprocess_terminfo(TERMTYPE2 *tp)
{
+ TR(TRACE_DATABASE,
+ (T_CALLED("postprocess_terminfo(tp=%p)"),
+ (void *) tp));
+
/*
* TERMINFO-TO-TERMINFO MAPPINGS FOR SOURCE TRANSLATION
* ----------------------------------------------------------------------
@@ -1064,6 +1109,7 @@ postprocess_terminfo(TERMTYPE2 *tp)
/*
* ----------------------------------------------------------------------
*/
+ returnVoidDB;
}
/*
diff --git a/ncurses/tinfo/read_entry.c b/ncurses/tinfo/read_entry.c
index 9741e103b7a9..b0f360eca800 100644
--- a/ncurses/tinfo/read_entry.c
+++ b/ncurses/tinfo/read_entry.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2020,2021 Thomas E. Dickey *
+ * Copyright 2018-2022,2023 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -42,9 +42,7 @@
#include <tic.h>
-MODULE_ID("$Id: read_entry.c,v 1.159 2021/02/14 00:17:09 tom Exp $")
-
-#define TYPE_CALLOC(type,elts) typeCalloc(type, (unsigned)(elts))
+MODULE_ID("$Id: read_entry.c,v 1.171 2023/09/16 16:30:34 tom Exp $")
#define MyNumber(n) (short) LOW_MSB(n)
@@ -140,11 +138,13 @@ convert_16bits(char *buf, NCURSES_INT2 *Numbers, int count)
}
#endif
-static void
-convert_strings(char *buf, char **Strings, int count, int size, char *table)
+static bool
+convert_strings(char *buf, char **Strings, int count, int size,
+ char *table, bool always)
{
int i;
char *p;
+ bool success = TRUE;
for (i = 0; i < count; i++) {
if (IS_NEG1(buf + 2 * i)) {
@@ -154,8 +154,17 @@ convert_strings(char *buf, char **Strings, int count, int size, char *table)
} else if (MyNumber(buf + 2 * i) > size) {
Strings[i] = ABSENT_STRING;
} else {
- Strings[i] = (MyNumber(buf + 2 * i) + table);
- TR(TRACE_DATABASE, ("Strings[%d] = %s", i, _nc_visbuf(Strings[i])));
+ int nn = MyNumber(buf + 2 * i);
+ if (nn >= 0 && nn < size) {
+ Strings[i] = (nn + table);
+ TR(TRACE_DATABASE, ("Strings[%d] = %s", i,
+ _nc_visbuf(Strings[i])));
+ } else {
+ TR(TRACE_DATABASE,
+ ("found out-of-range index %d to Strings[%d]", nn, i));
+ success = FALSE;
+ break;
+ }
}
/* make sure all strings are NUL terminated */
@@ -164,10 +173,25 @@ convert_strings(char *buf, char **Strings, int count, int size, char *table)
if (*p == '\0')
break;
/* if there is no NUL, ignore the string */
- if (p >= table + size)
+ if (p >= table + size) {
Strings[i] = ABSENT_STRING;
+ } else if (p == Strings[i] && always) {
+ TR(TRACE_DATABASE,
+ ("found empty but required Strings[%d]", i));
+ success = FALSE;
+ break;
+ }
+ } else if (always) { /* names are always needed */
+ TR(TRACE_DATABASE,
+ ("found invalid but required Strings[%d]", i));
+ success = FALSE;
+ break;
}
}
+ if (!success) {
+ _nc_warning("corrupt data found in convert_strings");
+ }
+ return success;
}
static int
@@ -203,6 +227,8 @@ _nc_init_termtype(TERMTYPE2 *const tp)
{
unsigned i;
+ DEBUG(2, (T_CALLED("_nc_init_termtype(tp=%p)"), (void *) tp));
+
#if NCURSES_XNAMES
tp->num_Booleans = BOOLCOUNT;
tp->num_Numbers = NUMCOUNT;
@@ -226,6 +252,8 @@ _nc_init_termtype(TERMTYPE2 *const tp)
for_each_string(i, tp)
tp->Strings[i] = ABSENT_STRING;
+
+ DEBUG(2, (T_RETURN("")));
}
#if NCURSES_USE_DATABASE
@@ -308,6 +336,9 @@ _nc_read_termtype(TERMTYPE2 *ptr, char *buffer, int limit)
|| bool_count < 0
|| num_count < 0
|| str_count < 0
+ || bool_count > BOOLCOUNT
+ || num_count > NUMCOUNT
+ || str_count > STRCOUNT
|| str_size < 0) {
returnDB(TGETENT_NO);
}
@@ -320,7 +351,7 @@ _nc_read_termtype(TERMTYPE2 *ptr, char *buffer, int limit)
}
/* grab the name (a null-terminated string) */
- want = min(MAX_NAME_SIZE, (unsigned) name_size);
+ want = Min(MAX_NAME_SIZE, (unsigned) name_size);
ptr->str_table = string_table;
ptr->term_names = string_table;
if ((have = (unsigned) Read(ptr->term_names, want)) != want) {
@@ -333,9 +364,8 @@ _nc_read_termtype(TERMTYPE2 *ptr, char *buffer, int limit)
offset = (int) (have - MAX_NAME_SIZE);
/* grab the booleans */
- if ((ptr->Booleans = TYPE_CALLOC(NCURSES_SBOOL,
- max(BOOLCOUNT, bool_count))) == 0
- || Read(ptr->Booleans, (unsigned) bool_count) < bool_count) {
+ TYPE_CALLOC(NCURSES_SBOOL, Max(BOOLCOUNT, bool_count), ptr->Booleans);
+ if (Read(ptr->Booleans, (unsigned) bool_count) < bool_count) {
returnDB(TGETENT_NO);
}
@@ -348,15 +378,13 @@ _nc_read_termtype(TERMTYPE2 *ptr, char *buffer, int limit)
even_boundary(name_size + bool_count);
/* grab the numbers */
- if (!(ptr->Numbers = TYPE_CALLOC(NCURSES_INT2, max(NUMCOUNT, num_count)))
- || !read_numbers(buf, num_count)) {
+ TYPE_CALLOC(NCURSES_INT2, Max(NUMCOUNT, num_count), ptr->Numbers);
+ if (!read_numbers(buf, num_count)) {
returnDB(TGETENT_NO);
}
convert_numbers(buf, ptr->Numbers, num_count);
- if ((ptr->Strings = TYPE_CALLOC(char *, max(STRCOUNT, str_count))) == 0) {
- returnDB(TGETENT_NO);
- }
+ TYPE_CALLOC(char *, Max(STRCOUNT, str_count), ptr->Strings);
if (str_count) {
/* grab the string offsets */
@@ -367,7 +395,10 @@ _nc_read_termtype(TERMTYPE2 *ptr, char *buffer, int limit)
if (Read(string_table, (unsigned) str_size) != str_size) {
returnDB(TGETENT_NO);
}
- convert_strings(buf, ptr->Strings, str_count, str_size, string_table);
+ if (!convert_strings(buf, ptr->Strings, str_count, str_size,
+ string_table, FALSE)) {
+ returnDB(TGETENT_NO);
+ }
}
#if NCURSES_XNAMES
@@ -468,8 +499,10 @@ _nc_read_termtype(TERMTYPE2 *ptr, char *buffer, int limit)
("Before computing extended-string capabilities "
"str_count=%d, ext_str_count=%d",
str_count, ext_str_count));
- convert_strings(buf, ptr->Strings + str_count, ext_str_count,
- ext_str_limit, ptr->ext_str_table);
+ if (!convert_strings(buf, ptr->Strings + str_count, ext_str_count,
+ ext_str_limit, ptr->ext_str_table, FALSE)) {
+ returnDB(TGETENT_NO);
+ }
for (i = ext_str_count - 1; i >= 0; i--) {
TR(TRACE_DATABASE, ("MOVE from [%d:%d] %s",
i, i + str_count,
@@ -497,16 +530,17 @@ _nc_read_termtype(TERMTYPE2 *ptr, char *buffer, int limit)
if (ext_str_count >= (max_entry_size / 2)) {
returnDB(TGETENT_NO);
}
- if ((ptr->ext_Names = TYPE_CALLOC(char *, need)) == 0) {
- returnDB(TGETENT_NO);
- }
+ TYPE_CALLOC(char *, need, ptr->ext_Names);
TR(TRACE_DATABASE,
("ext_NAMES starting @%d in extended_strings, first = %s",
base, _nc_visbuf(ptr->ext_str_table + base)));
- convert_strings(buf + (2 * ext_str_count),
- ptr->ext_Names,
- (int) need,
- ext_str_limit, ptr->ext_str_table + base);
+ if (!convert_strings(buf + (2 * ext_str_count),
+ ptr->ext_Names,
+ (int) need,
+ ext_str_limit, ptr->ext_str_table + base,
+ TRUE)) {
+ returnDB(TGETENT_NO);
+ }
}
TR(TRACE_DATABASE,
@@ -552,20 +586,24 @@ _nc_read_file_entry(const char *const filename, TERMTYPE2 *ptr)
int code;
if (_nc_access(filename, R_OK) < 0
- || (fp = fopen(filename, BIN_R)) == 0) {
+ || (fp = safe_fopen(filename, BIN_R)) == 0) {
TR(TRACE_DATABASE, ("cannot open terminfo %s (errno=%d)", filename, errno));
code = TGETENT_NO;
} else {
int limit;
char buffer[MAX_ENTRY_SIZE + 1];
- if ((limit = (int) fread(buffer, sizeof(char), sizeof(buffer), fp))
- > 0) {
+ limit = (int) fread(buffer, sizeof(char), sizeof(buffer), fp);
+ if (limit > 0) {
+ const char *old_source = _nc_get_source();
TR(TRACE_DATABASE, ("read terminfo %s", filename));
+ if (old_source == NULL)
+ _nc_set_source(filename);
if ((code = _nc_read_termtype(ptr, buffer, limit)) == TGETENT_NO) {
_nc_free_termtype2(ptr);
}
+ _nc_set_source(old_source);
} else {
code = TGETENT_NO;
}
@@ -765,6 +803,9 @@ _nc_read_tic_entry(char *filename,
int reccnt = 0;
char *save = strdup(name);
+ if (save == 0)
+ returnDB(code);
+
memset(&key, 0, sizeof(key));
key.data = save;
key.size = strlen(save);
@@ -774,7 +815,7 @@ _nc_read_tic_entry(char *filename,
* looking for compiled (binary) terminfo data.
*
* cgetent uses a two-level lookup. On the first it uses the given
- * name to return a record containing only the aliases for an entry.
+ * name to return a record containing only the aliases for an entry.
* On the second (using that list of aliases as a key), it returns the
* content of the terminal description. We expect second lookup to
* return data beginning with the same set of aliases.
@@ -831,7 +872,7 @@ _nc_read_tic_entry(char *filename,
#endif /* NCURSES_USE_DATABASE */
/*
- * Find and read the compiled entry for a given terminal type, if it exists.
+ * Find and read the compiled entry for a given terminal type, if it exists.
* We take pains here to make sure no combination of environment variables and
* terminal type name can be used to overrun the file buffer.
*/
@@ -879,9 +920,6 @@ _nc_read_entry2(const char *const name, char *const filename, TERMTYPE2 *const t
}
#if NCURSES_EXT_NUMBERS
-/*
- * This entrypoint is used by tack 1.07
- */
NCURSES_EXPORT(int)
_nc_read_entry(const char *const name, char *const filename, TERMTYPE *const tp)
{
diff --git a/ncurses/tinfo/read_termcap.c b/ncurses/tinfo/read_termcap.c
index fcb43a442b7a..1a294848b827 100644
--- a/ncurses/tinfo/read_termcap.c
+++ b/ncurses/tinfo/read_termcap.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2021,2023 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -57,7 +57,7 @@
#include <sys/types.h>
#include <tic.h>
-MODULE_ID("$Id: read_termcap.c,v 1.98 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: read_termcap.c,v 1.104 2023/06/24 21:53:16 tom Exp $")
#if !PURE_TERMINFO
@@ -187,7 +187,7 @@ _nc_cgetcap(char *buf, const char *cap, int type)
bp = buf;
for (;;) {
/*
- * Skip past the current capability field - it's either the
+ * Skip past the current capability field - it is either the
* name field if this is the first time through the loop, or
* the remainder of a field whose name failed to match cap.
*/
@@ -324,7 +324,7 @@ _nc_getent(
if (fd >= 0) {
(void) lseek(fd, (off_t) 0, SEEK_SET);
} else if ((_nc_access(db_array[current], R_OK) < 0)
- || (fd = open(db_array[current], O_RDONLY, 0)) < 0) {
+ || (fd = safe_open2(db_array[current], O_RDONLY)) < 0) {
/* No error on unfound file. */
if (errno == ENOENT)
continue;
@@ -803,7 +803,7 @@ _nc_tgetent(char *bp, char **sourcename, int *lineno, const char *name)
/*
* TERMCAP can have one of two things in it. It can be the name of a file
* to use instead of /etc/termcap. In this case it better start with a
- * "/". Or it can be an entry to use so we don't have to read the file.
+ * "/". Or it can be an entry to use so we don't have to read the file.
* In this case it has to already have the newlines crunched out. If
* TERMCAP does not hold a file name then a path of names is searched
* instead. The path is found in the TERMPATH variable, or becomes
@@ -1055,23 +1055,25 @@ _nc_read_termcap_entry(const char *const tn, TERMTYPE2 *const tp)
if (normal) { /* normal case */
char envhome[PATH_MAX], *h;
- copied = strdup(get_termpath());
- for (cp = copied; *cp; cp++) {
- if (*cp == NCURSES_PATHSEP)
- *cp = '\0';
- else if (cp == copied || cp[-1] == '\0') {
- ADD_TC(cp, filecount);
+ if ((copied = strdup(get_termpath())) != 0) {
+ for (cp = copied; *cp; cp++) {
+ if (*cp == NCURSES_PATHSEP)
+ *cp = '\0';
+ else if (cp == copied || cp[-1] == '\0') {
+ ADD_TC(cp, filecount);
+ }
}
}
-
-#define PRIVATE_CAP "%s/.termcap"
+#define PRIVATE_CAP "%.*s/.termcap"
if (use_terminfo_vars() && (h = getenv("HOME")) != NULL && *h != '\0'
&& (strlen(h) + sizeof(PRIVATE_CAP)) < PATH_MAX) {
/* user's .termcap, if any, should override it */
_nc_STRCPY(envhome, h, sizeof(envhome));
_nc_SPRINTF(pathbuf, _nc_SLIMIT(sizeof(pathbuf))
- PRIVATE_CAP, envhome);
+ PRIVATE_CAP,
+ (int) (sizeof(pathbuf) - sizeof(PRIVATE_CAP)),
+ envhome);
ADD_TC(pathbuf, filecount);
}
}
@@ -1113,7 +1115,7 @@ _nc_read_termcap_entry(const char *const tn, TERMTYPE2 *const tp)
/*
* We don't suppress warning messages here. The presumption is
- * that since it's just a single entry, they won't be a pain.
+ * that since it is just a single entry, they won't be a pain.
*/
_nc_read_entry_source((FILE *) 0, tc_buf, FALSE, FALSE, NULLHOOK);
free(tc_buf);
@@ -1124,7 +1126,7 @@ _nc_read_termcap_entry(const char *const tn, TERMTYPE2 *const tp)
TR(TRACE_DATABASE, ("Looking for %s in %s", tn, termpaths[i]));
if (_nc_access(termpaths[i], R_OK) == 0
- && (fp = fopen(termpaths[i], "r")) != (FILE *) 0) {
+ && (fp = safe_fopen(termpaths[i], "r")) != (FILE *) 0) {
_nc_set_source(termpaths[i]);
/*
@@ -1164,7 +1166,7 @@ _nc_read_termcap_entry(const char *const tn, TERMTYPE2 *const tp)
_nc_free_entry(_nc_head, &(ep->tterm));
/*
- * OK, now try to write the type to user's terminfo directory.
+ * OK, now try to write the type to user's terminfo directory.
* Next time he loads this, it will come through terminfo.
*
* Advantage: Second and subsequent fetches of this entry will
diff --git a/ncurses/tinfo/strings.c b/ncurses/tinfo/strings.c
index a1d8beb63f31..03f59c24e9ad 100644
--- a/ncurses/tinfo/strings.c
+++ b/ncurses/tinfo/strings.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2023 Thomas E. Dickey *
* Copyright 2000-2012,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -38,7 +38,7 @@
#include <curses.priv.h>
#include <tic.h>
-MODULE_ID("$Id: strings.c,v 1.10 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: strings.c,v 1.11 2023/05/27 20:13:10 tom Exp $")
/****************************************************************************
* Useful string functions (especially for mvcur)
@@ -95,7 +95,7 @@ _nc_str_null(string_desc * dst, size_t len)
* Copy a descriptor
*/
NCURSES_EXPORT(string_desc *)
-_nc_str_copy(string_desc * dst, string_desc * src)
+_nc_str_copy(string_desc * dst, const string_desc * const src)
{
*dst = *src;
return dst;
diff --git a/ncurses/tinfo/tinfo_driver.c b/ncurses/tinfo/tinfo_driver.c
index c28d76415549..fd993b820381 100644
--- a/ncurses/tinfo/tinfo_driver.c
+++ b/ncurses/tinfo/tinfo_driver.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2022,2023 Thomas E. Dickey *
* Copyright 2008-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -52,7 +52,7 @@
# endif
#endif
-MODULE_ID("$Id: tinfo_driver.c,v 1.71 2020/12/12 01:06:40 tom Exp $")
+MODULE_ID("$Id: tinfo_driver.c,v 1.74 2023/09/16 10:44:33 tom Exp $")
/*
* SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS,
@@ -206,8 +206,8 @@ drv_CanHandle(TERMINAL_CONTROL_BLOCK * TCB, const char *tname, int *errret)
save_ttytype(termp);
#endif
- if (command_character)
- _nc_tinfo_cmdch(termp, *command_character);
+ if (VALID_STRING(command_character))
+ _nc_tinfo_cmdch(termp, UChar(*command_character));
/*
* If an application calls setupterm() rather than initscr() or
@@ -1282,10 +1282,7 @@ drv_read(TERMINAL_CONTROL_BLOCK * TCB, int *buf)
assert(buf);
SetSP();
-# if USE_PTHREADS_EINTR
- if ((pthread_self) && (pthread_kill) && (pthread_equal))
- _nc_globals.read_thread = pthread_self();
-# endif
+ _nc_set_read_thread(TRUE);
#ifdef EXP_WIN32_DRIVER
n = _nc_console_read(sp,
_nc_console_handle(sp->_ifd),
@@ -1293,9 +1290,7 @@ drv_read(TERMINAL_CONTROL_BLOCK * TCB, int *buf)
#else
n = (int) read(sp->_ifd, &c2, (size_t) 1);
#endif
-#if USE_PTHREADS_EINTR
- _nc_globals.read_thread = 0;
-#endif
+ _nc_set_read_thread(FALSE);
#ifndef EXP_WIN32_DRIVER
*buf = (int) c2;
#endif
@@ -1532,7 +1527,7 @@ _nc_get_driver(TERMINAL_CONTROL_BLOCK * TCB, const char *name, int *errret)
res = DriverTable[i].driver;
#ifdef _NC_WINDOWS
if ((i + 1) == SIZEOF(DriverTable)) {
- /* For Windows >= 10.0.17763 Windows Console interface implements
+ /* For Windows >= 10.0.17763 Windows Console interface implements
virtual Terminal functionality.
If on Windows td_CanHandle returned FALSE although the terminal
name is empty, we default to ms-terminal as tinfo TERM type.
diff --git a/ncurses/tinfo/trim_sgr0.c b/ncurses/tinfo/trim_sgr0.c
index 30c8f75c1e8a..177dcd87225e 100644
--- a/ncurses/tinfo/trim_sgr0.c
+++ b/ncurses/tinfo/trim_sgr0.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020-2021,2023 Thomas E. Dickey *
* Copyright 2005-2012,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -37,15 +37,11 @@
#include <tic.h>
-MODULE_ID("$Id: trim_sgr0.c,v 1.20 2020/05/27 23:54:31 tom Exp $")
+MODULE_ID("$Id: trim_sgr0.c,v 1.22 2023/09/23 18:47:56 tom Exp $")
#undef CUR
#define CUR tp->
-#define CSI 233
-#define ESC 033 /* ^[ */
-#define L_BRACK '['
-
static char *
set_attribute_9(TERMTYPE2 *tp, int flag)
{
@@ -65,9 +61,9 @@ is_csi(const char *s)
{
int result = 0;
if (s != 0) {
- if (UChar(s[0]) == CSI)
+ if (UChar(s[0]) == CSI_CHR)
result = 1;
- else if (s[0] == ESC && s[1] == L_BRACK)
+ else if (s[0] == ESC_CHR && s[1] == L_BLOCK)
result = 2;
}
return result;
@@ -222,7 +218,7 @@ compare_part(const char *part, const char *full)
}
/*
- * While 'sgr0' is the "same" as termcap 'me', there is a compatibility issue.
+ * While 'sgr0' is the "same" as termcap 'me', there is a compatibility issue.
* The sgr/sgr0 capabilities include setting/clearing alternate character set
* mode. A termcap application cannot use sgr, so sgr0 strings that reset
* alternate character set mode will be misinterpreted. Here, we remove those
diff --git a/ncurses/tinfo/write_entry.c b/ncurses/tinfo/write_entry.c
index 5bb7aee7f360..8ccca9eca6fc 100644
--- a/ncurses/tinfo/write_entry.c
+++ b/ncurses/tinfo/write_entry.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2023,2024 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -42,6 +42,8 @@
#include <tic.h>
+MODULE_ID("$Id: write_entry.c,v 1.132 2024/04/20 17:58:51 tom Exp $")
+
#if 1
#define TRACE_OUT(p) DEBUG(2, p)
#define TRACE_NUM(n) if (VALID_NUMERIC(Numbers[n])) { \
@@ -51,7 +53,15 @@
#define TRACE_NUM(n) /* nothing */
#endif
-MODULE_ID("$Id: write_entry.c,v 1.116 2020/08/29 16:22:03 juergen Exp $")
+/*
+ * FIXME: special case to work around Cygwin bug in link(), which updates
+ * the target file's timestamp.
+ */
+#if HAVE_LINK && !USE_SYMLINKS && !MIXEDCASE_FILENAMES && defined(__CYGWIN__)
+#define LINK_TOUCHES 1
+#else
+#define LINK_TOUCHES 0
+#endif
static int total_written;
static int total_parts;
@@ -71,13 +81,13 @@ write_file(char *filename, TERMTYPE2 *tp)
_nc_warning("entry is larger than %u bytes", limit);
} else {
FILE *fp = ((_nc_access(filename, W_OK) == 0)
- ? fopen(filename, BIN_W)
+ ? safe_fopen(filename, BIN_W)
: 0);
size_t actual;
if (fp == 0) {
perror(filename);
- _nc_syserr_abort("can't open %s/%s", _nc_tic_dir(0), filename);
+ _nc_syserr_abort("cannot open %s/%s", _nc_tic_dir(0), filename);
}
actual = fwrite(buffer, sizeof(char), (size_t) offset, fp);
@@ -85,12 +95,12 @@ write_file(char *filename, TERMTYPE2 *tp)
int myerr = ferror(fp) ? errno : 0;
if (myerr) {
_nc_syserr_abort("error writing %s/%s: %s",
- _nc_tic_dir(0),
+ _nc_tic_dir(NULL),
filename,
strerror(myerr));
} else {
_nc_syserr_abort("error writing %s/%s: %u bytes vs actual %lu",
- _nc_tic_dir(0),
+ _nc_tic_dir(NULL),
filename,
offset,
(unsigned long) actual);
@@ -118,18 +128,16 @@ check_writeable(int code)
char dir[sizeof(LEAF_FMT)];
char *s = 0;
- if (code == 0 || (s = (strchr) (dirnames, code)) == 0)
+ if (code == 0 || (s = (strchr) (dirnames, code)) == 0) {
_nc_err_abort("Illegal terminfo subdirectory \"" LEAF_FMT "\"", code);
-
- if (verified[s - dirnames])
- return;
-
- _nc_SPRINTF(dir, _nc_SLIMIT(sizeof(dir)) LEAF_FMT, code);
- if (make_db_root(dir) < 0) {
- _nc_err_abort("%s/%s: permission denied", _nc_tic_dir(0), dir);
+ } else if (!verified[s - dirnames]) {
+ _nc_SPRINTF(dir, _nc_SLIMIT(sizeof(dir)) LEAF_FMT, code);
+ if (make_db_root(dir) < 0) {
+ _nc_err_abort("%s/%s: permission denied", _nc_tic_dir(NULL), dir);
+ } else {
+ verified[s - dirnames] = TRUE;
+ }
}
-
- verified[s - dirnames] = TRUE;
}
#endif /* !USE_HASHED_DB */
@@ -137,7 +145,7 @@ static int
make_db_path(char *dst, const char *src, size_t limit)
{
int rc = -1;
- const char *top = _nc_tic_dir(0);
+ const char *top = _nc_tic_dir(NULL);
if (src == top || _nc_is_abs_path(src)) {
if (strlen(src) + 1 <= limit) {
@@ -145,7 +153,7 @@ make_db_path(char *dst, const char *src, size_t limit)
rc = 0;
}
} else {
- if (strlen(top) + strlen(src) + 2 <= limit) {
+ if ((strlen(top) + strlen(src) + 6) <= limit) {
_nc_SPRINTF(dst, _nc_SLIMIT(limit) "%s/%s", top, src);
rc = 0;
}
@@ -190,7 +198,7 @@ make_db_root(const char *path)
#else
struct stat statbuf;
- if ((rc = stat(path, &statbuf)) < 0) {
+ if ((rc = stat(path, &statbuf)) == -1) {
rc = mkdir(path
#ifndef _NC_WINDOWS
,0777
@@ -214,26 +222,30 @@ _nc_set_writedir(const char *dir)
{
const char *destination;
char actual[PATH_MAX];
+ bool specific = (dir != NULL);
- if (dir == 0
-#ifndef USE_ROOT_ENVIRON
- && use_terminfo_vars()
-#endif
- )
+ if (!specific && use_terminfo_vars())
dir = getenv("TERMINFO");
- if (dir != 0)
+ if (dir != NULL)
(void) _nc_tic_dir(dir);
- destination = _nc_tic_dir(0);
+ destination = _nc_tic_dir(NULL);
if (make_db_root(destination) < 0) {
- char *home = _nc_home_terminfo();
+ bool success = FALSE;
+
+ if (!specific) {
+ char *home = _nc_home_terminfo();
- if (home != 0) {
- destination = home;
- if (make_db_root(destination) < 0)
- _nc_err_abort("%s: permission denied (errno %d)",
- destination, errno);
+ if (home != NULL) {
+ destination = home;
+ if (make_db_root(destination) == 0)
+ success = TRUE;
+ }
+ }
+ if (!success) {
+ _nc_err_abort("%s: permission denied (errno %d)",
+ destination, errno);
}
}
@@ -245,10 +257,10 @@ _nc_set_writedir(const char *dir)
make_db_path(actual, destination, sizeof(actual));
#else
if (chdir(_nc_tic_dir(destination)) < 0
- || getcwd(actual, sizeof(actual)) == 0)
+ || getcwd(actual, sizeof(actual)) == NULL)
_nc_err_abort("%s: not a directory", destination);
#endif
- _nc_keep_tic_dir(strdup(actual));
+ _nc_keep_tic_dir(actual);
}
/*
@@ -327,8 +339,9 @@ _nc_write_entry(TERMTYPE2 *const tp)
if (ptr != name_list) {
*ptr = '\0';
- for (ptr = name_list; *ptr != '\0' && *ptr != '|'; ptr++)
- continue;
+ for (ptr = name_list; *ptr != '\0' && *ptr != '|'; ptr++) {
+ /* EMPTY */ ;
+ }
if (*ptr == '\0')
other_names = ptr;
@@ -345,10 +358,10 @@ _nc_write_entry(TERMTYPE2 *const tp)
#if USE_HASHED_DB
if (_nc_write_object(tp, buffer + 1, &offset, limit - 1) != ERR) {
- DB *capdb = _nc_db_open(_nc_tic_dir(0), TRUE);
+ DB *capdb = _nc_db_open(_nc_tic_dir(NULL), TRUE);
DBT key, data;
- if (capdb != 0) {
+ if (capdb != NULL) {
buffer[0] = 0;
memset(&key, 0, sizeof(key));
@@ -371,7 +384,7 @@ _nc_write_entry(TERMTYPE2 *const tp)
sizeof(buffer) - 1);
data.size = name_size + 1;
- total_size += data.size;
+ total_size += (int) data.size;
total_parts++;
_nc_db_put(capdb, &key, &data);
@@ -387,7 +400,7 @@ _nc_write_entry(TERMTYPE2 *const tp)
key.data = ptr;
key.size = strlen(ptr);
- total_size += data.size;
+ total_size += (int) data.size;
total_parts++;
_nc_db_put(capdb, &key, &data);
}
@@ -442,10 +455,10 @@ _nc_write_entry(TERMTYPE2 *const tp)
write_file(filename, tp);
if (start_time == 0) {
- if (stat(filename, &statbuf) < 0
+ if (stat(filename, &statbuf) == -1
|| (start_time = statbuf.st_mtime) == 0) {
_nc_syserr_abort("error obtaining time from %s/%s",
- _nc_tic_dir(0), filename);
+ _nc_tic_dir(NULL), filename);
}
}
while (*other_names != '\0') {
@@ -460,7 +473,7 @@ _nc_write_entry(TERMTYPE2 *const tp)
_nc_warning("terminal alias %s too long.", ptr);
continue;
}
- if (strchr(ptr, '/') != 0) {
+ if (strchr(ptr, '/') != NULL) {
_nc_warning("cannot link alias %s.", ptr);
continue;
}
@@ -472,10 +485,14 @@ _nc_write_entry(TERMTYPE2 *const tp)
if (strcmp(filename, linkname) == 0) {
_nc_warning("self-synonym ignored");
- } else if (stat(linkname, &statbuf) >= 0 &&
- statbuf.st_mtime < start_time) {
+ }
+#if !LINK_TOUCHES
+ else if (stat(linkname, &statbuf) >= 0 &&
+ statbuf.st_mtime < start_time) {
_nc_warning("alias %s multiply defined.", ptr);
- } else if (_nc_access(linkname, W_OK) == 0)
+ }
+#endif
+ else if (_nc_access(linkname, W_OK) == 0)
#if HAVE_LINK
{
int code;
@@ -514,9 +531,9 @@ _nc_write_entry(TERMTYPE2 *const tp)
write_file(linkname, tp);
else {
#if MIXEDCASE_FILENAMES
- _nc_syserr_abort("can't link %s to %s", filename, linkname);
+ _nc_syserr_abort("cannot link %s to %s", filename, linkname);
#else
- _nc_warning("can't link %s to %s (errno=%d)", filename,
+ _nc_warning("cannot link %s to %s (errno=%d)", filename,
linkname, errno);
#endif
}
@@ -712,7 +729,7 @@ _nc_write_object(TERMTYPE2 *tp, char *buffer, unsigned *offset, unsigned limit)
unsigned last_str = STRWRITE;
#if NCURSES_EXT_NUMBERS
bool need_ints = FALSE;
- size_t (*convert_numbers) (unsigned char *, NCURSES_INT2 *, size_t) = convert_32bit;
+ size_t (*convert_numbers) (unsigned char *, NCURSES_INT2 *, size_t);
#else
#define convert_numbers convert_shorts
#endif
@@ -773,7 +790,8 @@ _nc_write_object(TERMTYPE2 *tp, char *buffer, unsigned *offset, unsigned limit)
#else
LITTLE_ENDIAN(buf, MAGIC);
#endif
- LITTLE_ENDIAN(buf + 2, min(namelen, MAX_NAME_SIZE + 1));
+ namelen = Min(namelen, MAX_NAME_SIZE + 1);
+ LITTLE_ENDIAN(buf + 2, namelen);
LITTLE_ENDIAN(buf + 4, boolmax);
LITTLE_ENDIAN(buf + 6, nummax);
LITTLE_ENDIAN(buf + 8, strmax);
diff --git a/ncurses/trace/lib_trace.c b/ncurses/trace/lib_trace.c
index 5eb87fe0c176..0904c132fee1 100644
--- a/ncurses/trace/lib_trace.c
+++ b/ncurses/trace/lib_trace.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2023,2024 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -37,7 +37,7 @@
/*
* lib_trace.c - Tracing/Debugging routines
*
- * The _tracef() function is originally from pcurses (by Pavel Curtis) in 1982.
+ * The _tracef() function is originally from pcurses (by Pavel Curtis) in 1982.
* pcurses allowed one to enable/disable tracing using traceon() and traceoff()
* functions. ncurses provides a trace() function which allows one to
* selectively enable or disable several tracing features.
@@ -48,7 +48,7 @@
#include <ctype.h>
-MODULE_ID("$Id: lib_trace.c,v 1.97 2020/08/29 16:22:03 juergen Exp $")
+MODULE_ID("$Id: lib_trace.c,v 1.106 2024/02/24 18:28:19 tom Exp $")
NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0; /* always define this */
@@ -89,45 +89,74 @@ NCURSES_EXPORT_VAR(long) _nc_outchars = 0;
#define MyFP _nc_globals.trace_fp
#define MyFD _nc_globals.trace_fd
#define MyInit _nc_globals.trace_opened
-#define MyPath _nc_globals.trace_fname
#define MyLevel _nc_globals.trace_level
#define MyNested _nc_globals.nested_tracef
#endif /* TRACE */
+#if USE_REENTRANT
+#define Locked(statement) \
+ do { \
+ _nc_lock_global(tst_tracef); \
+ statement; \
+ _nc_unlock_global(tst_tracef); \
+ } while (0)
+#else
+#define Locked(statement) statement
+#endif
+
NCURSES_EXPORT(unsigned)
curses_trace(unsigned tracelevel)
{
unsigned result;
+
#if defined(TRACE)
- result = _nc_tracing;
+ int bit;
+
+#define DATA(name) { name, #name }
+ static struct {
+ unsigned mask;
+ const char *name;
+ } trace_names[] = {
+ DATA(TRACE_TIMES),
+ DATA(TRACE_TPUTS),
+ DATA(TRACE_UPDATE),
+ DATA(TRACE_MOVE),
+ DATA(TRACE_CHARPUT),
+ DATA(TRACE_CALLS),
+ DATA(TRACE_VIRTPUT),
+ DATA(TRACE_IEVENT),
+ DATA(TRACE_BITS),
+ DATA(TRACE_ICALLS),
+ DATA(TRACE_CCALLS),
+ DATA(TRACE_DATABASE),
+ DATA(TRACE_ATTRS)
+ };
+#undef DATA
+
+ Locked(result = _nc_tracing);
+
if ((MyFP == 0) && tracelevel) {
MyInit = TRUE;
if (MyFD >= 0) {
MyFP = fdopen(MyFD, BIN_W);
} else {
- if (MyPath[0] == '\0') {
- size_t size = sizeof(MyPath) - 12;
- if (getcwd(MyPath, size) == 0) {
- perror("curses: Can't get working directory");
- exit(EXIT_FAILURE);
- }
- MyPath[size] = '\0';
- assert(strlen(MyPath) <= size);
- _nc_STRCAT(MyPath, "/trace", sizeof(MyPath));
- if (_nc_is_dir_path(MyPath)) {
- _nc_STRCAT(MyPath, ".log", sizeof(MyPath));
- }
+ char myFile[80];
+
+ _nc_STRCPY(myFile, "trace", sizeof(myFile));
+ if (_nc_is_dir_path(myFile)) {
+ _nc_STRCAT(myFile, ".log", sizeof(myFile));
}
- if (_nc_access(MyPath, W_OK) < 0
- || (MyFD = open(MyPath, O_CREAT | O_EXCL | O_RDWR, 0600)) < 0
+#define SAFE_MODE (O_CREAT | O_EXCL | O_RDWR)
+ if (_nc_access(myFile, W_OK) < 0
+ || (MyFD = safe_open3(myFile, SAFE_MODE, 0600)) < 0
|| (MyFP = fdopen(MyFD, BIN_W)) == 0) {
; /* EMPTY */
}
}
- _nc_tracing = tracelevel;
+ Locked(_nc_tracing = tracelevel);
/* Try to set line-buffered mode, or (failing that) unbuffered,
* so that the trace-output gets flushed automatically at the
- * end of each line. This is useful in case the program dies.
+ * end of each line. This is useful in case the program dies.
*/
if (MyFP != 0) {
#if HAVE_SETVBUF /* ANSI */
@@ -140,15 +169,33 @@ curses_trace(unsigned tracelevel)
NCURSES_VERSION,
NCURSES_VERSION_PATCH,
tracelevel);
+
+#define SPECIAL_MASK(mask) \
+ if ((tracelevel & mask) == mask) \
+ _tracef("- %s (%u)", #mask, mask)
+
+ for (bit = 0; bit < TRACE_SHIFT; ++bit) {
+ unsigned mask = (1U << bit) & tracelevel;
+ if ((mask & trace_names[bit].mask) != 0) {
+ _tracef("- %s (%u)", trace_names[bit].name, mask);
+ }
+ }
+ SPECIAL_MASK(TRACE_MAXIMUM);
+ else
+ SPECIAL_MASK(TRACE_ORDINARY);
+
+ if (tracelevel > TRACE_MAXIMUM) {
+ _tracef("- DEBUG_LEVEL(%u)", tracelevel >> TRACE_SHIFT);
+ }
} else if (tracelevel == 0) {
if (MyFP != 0) {
MyFD = dup(MyFD); /* allow reopen of same file */
fclose(MyFP);
MyFP = 0;
}
- _nc_tracing = tracelevel;
+ Locked(_nc_tracing = tracelevel);
} else if (_nc_tracing != tracelevel) {
- _nc_tracing = tracelevel;
+ Locked(_nc_tracing = tracelevel);
_tracef("tracelevel=%#x", tracelevel);
}
#else
@@ -213,11 +260,13 @@ _nc_va_tracef(const char *fmt, va_list ap)
# if USE_WEAK_SYMBOLS
if ((pthread_self))
# endif
+ fprintf(fp, "%#" PRIxPTR ":",
#ifdef _NC_WINDOWS
- fprintf(fp, "%#lx:", (long) (intptr_t) pthread_self().p);
+ CASTxPTR(pthread_self().p)
#else
- fprintf(fp, "%#lx:", (long) (intptr_t) pthread_self());
+ CASTxPTR(pthread_self())
#endif
+ );
#endif
if (before || after) {
int n;
diff --git a/ncurses/trace/lib_traceatr.c b/ncurses/trace/lib_traceatr.c
index 940262750508..b36286253d6d 100644
--- a/ncurses/trace/lib_traceatr.c
+++ b/ncurses/trace/lib_traceatr.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2022,2024 Thomas E. Dickey *
* Copyright 1998-2017,2018 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -44,7 +44,7 @@
#define CUR SP_TERMTYPE
#endif
-MODULE_ID("$Id: lib_traceatr.c,v 1.94 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_traceatr.c,v 1.96 2024/02/04 00:11:35 tom Exp $")
#define COLOR_OF(c) ((c < 0) ? "default" : (c > 7 ? color_of(c) : colors[c].name))
@@ -343,6 +343,7 @@ _tracecchar_t2(int bufnum, const cchar_t *ch)
} else {
PUTC_DATA;
int n;
+ int assume_unicode = _nc_unicode_locale()? 128 : 255;
(void) _nc_trace_bufcat(bufnum, "{ ");
for (PUTC_i = 0; PUTC_i < CCHARW_MAX; ++PUTC_i) {
@@ -362,21 +363,22 @@ _tracecchar_t2(int bufnum, const cchar_t *ch)
UChar(ch->chars[PUTC_i])));
}
break;
- } else if (ch->chars[PUTC_i] > 255) {
+ } else if (ch->chars[PUTC_i] > assume_unicode) {
char temp[80];
_nc_SPRINTF(temp, _nc_SLIMIT(sizeof(temp))
- "{%d:\\u%lx}",
+ "{%d:\\u%04lx}",
_nc_wacs_width(ch->chars[PUTC_i]),
(unsigned long) ch->chars[PUTC_i]);
(void) _nc_trace_bufcat(bufnum, temp);
- break;
- }
- for (n = 0; n < PUTC_n; n++) {
- if (n)
- (void) _nc_trace_bufcat(bufnum, ", ");
- (void) _nc_trace_bufcat(bufnum,
- _nc_tracechar(CURRENT_SCREEN,
- UChar(PUTC_buf[n])));
+ attr &= ~A_CHARTEXT; /* ignore WidecExt(ch) */
+ } else {
+ for (n = 0; n < PUTC_n; n++) {
+ if (n)
+ (void) _nc_trace_bufcat(bufnum, ", ");
+ (void) _nc_trace_bufcat(bufnum,
+ _nc_tracechar(CURRENT_SCREEN,
+ UChar(PUTC_buf[n])));
+ }
}
}
(void) _nc_trace_bufcat(bufnum, " }");
diff --git a/ncurses/trace/lib_tracechr.c b/ncurses/trace/lib_tracechr.c
index 36158d6f45a6..9c879dc67397 100644
--- a/ncurses/trace/lib_tracechr.c
+++ b/ncurses/trace/lib_tracechr.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2024 Thomas E. Dickey *
* Copyright 1998-2009,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -40,7 +40,7 @@
#include <ctype.h>
-MODULE_ID("$Id: lib_tracechr.c,v 1.23 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_tracechr.c,v 1.24 2024/02/04 00:11:35 tom Exp $")
#ifdef TRACE
@@ -54,26 +54,28 @@ _nc_tracechar(SCREEN *sp, int ch)
? sp->tracechr_buf
: _nc_globals.tracechr_buf);
- if (ch > KEY_MIN || ch < 0) {
+ if ((ch > KEY_MIN && !_nc_unicode_locale()) || ch < 0) {
name = safe_keyname(SP_PARM, ch);
if (name == 0 || *name == '\0')
name = "NULL";
_nc_SPRINTF(MyBuffer, _nc_SLIMIT(MyBufSize)
- "'%.30s' = %#03o", name, ch);
- } else if (!is8bits(ch) || !isprint(UChar(ch))) {
+ "'%.30s' = \\x%02x", name, ch);
+ } else if (!is8bits(ch)
+ || (_nc_unicode_locale() && !is7bits(ch))
+ || !isprint(UChar(ch))) {
/*
* workaround for glibc bug:
* sprintf changes the result from unctrl() to an empty string if it
* does not correspond to a valid multibyte sequence.
*/
_nc_SPRINTF(MyBuffer, _nc_SLIMIT(MyBufSize)
- "%#03o", ch);
+ "\\x%02x", ch);
} else {
name = safe_unctrl(SP_PARM, (chtype) ch);
if (name == 0 || *name == 0)
name = "null"; /* shouldn't happen */
_nc_SPRINTF(MyBuffer, _nc_SLIMIT(MyBufSize)
- "'%.30s' = %#03o", name, ch);
+ "'%.30s' = \\x%02x", name, ch);
}
return (MyBuffer);
}
diff --git a/ncurses/trace/lib_tracedmp.c b/ncurses/trace/lib_tracedmp.c
index 3b7ea0749986..529148bb785a 100644
--- a/ncurses/trace/lib_tracedmp.c
+++ b/ncurses/trace/lib_tracedmp.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2023 Thomas E. Dickey *
* Copyright 1998-2012,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -40,7 +40,7 @@
#include <curses.priv.h>
#include <ctype.h>
-MODULE_ID("$Id: lib_tracedmp.c,v 1.36 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_tracedmp.c,v 1.37 2023/06/24 15:49:45 tom Exp $")
#ifdef TRACE
@@ -71,9 +71,9 @@ _tracedump(const char *name, WINDOW *win)
if (++width + 1 > (int) my_length) {
my_length = (unsigned) (2 * (width + 1));
my_buffer = typeRealloc(char, my_length, my_buffer);
- if (my_buffer == 0)
- return;
}
+ if (my_buffer == 0)
+ return;
for (n = 0; n <= win->_maxy; ++n) {
char *ep = my_buffer;
diff --git a/ncurses/trace/trace_buf.c b/ncurses/trace/trace_buf.c
index 7e6384b54153..91b12e45c248 100644
--- a/ncurses/trace/trace_buf.c
+++ b/ncurses/trace/trace_buf.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2023 Thomas E. Dickey *
* Copyright 1998-2011,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -36,7 +36,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: trace_buf.c,v 1.21 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: trace_buf.c,v 1.22 2023/06/24 13:37:25 tom Exp $")
#ifdef TRACE
@@ -104,7 +104,11 @@ _nc_trace_buf(int bufnum, size_t want)
NCURSES_EXPORT(char *)
_nc_trace_bufcat(int bufnum, const char *value)
{
- char *buffer = _nc_trace_alloc(bufnum, (size_t) 0);
+ char *buffer;
+
+ if (value == NULL)
+ value = "";
+ buffer = _nc_trace_alloc(bufnum, (size_t) 0);
if (buffer != 0) {
size_t have = strlen(buffer);
size_t need = strlen(value) + have;
diff --git a/ncurses/trace/varargs.c b/ncurses/trace/varargs.c
index 9be5fc254fb0..7b9533bd62f4 100644
--- a/ncurses/trace/varargs.c
+++ b/ncurses/trace/varargs.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2023 Thomas E. Dickey *
* Copyright 2001-2008,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -35,7 +35,7 @@
#include <ctype.h>
-MODULE_ID("$Id: varargs.c,v 1.12 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: varargs.c,v 1.13 2023/06/24 13:41:46 tom Exp $")
#ifdef TRACE
@@ -59,18 +59,16 @@ typedef enum {
NCURSES_EXPORT(char *)
_nc_varargs(const char *fmt, va_list ap)
{
- static char dummy[] = "";
-
char buffer[BUFSIZ];
const char *param;
int n;
if (fmt == 0 || *fmt == '\0')
- return dummy;
+ return NULL;
if (MyLength == 0)
MyBuffer = typeMalloc(char, MyLength = BUFSIZ);
if (MyBuffer == 0)
- return dummy;
+ return NULL;
*MyBuffer = '\0';
while (*fmt != '\0') {
@@ -185,7 +183,7 @@ _nc_varargs(const char *fmt, va_list ap)
}
}
- return (MyBuffer ? MyBuffer : dummy);
+ return (MyBuffer ? MyBuffer : NULL);
}
#else
EMPTY_MODULE(_nc_varargs)
diff --git a/ncurses/trace/visbuf.c b/ncurses/trace/visbuf.c
index 5f95a6bc50c0..590e42306f51 100644
--- a/ncurses/trace/visbuf.c
+++ b/ncurses/trace/visbuf.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2019-2021,2023 Thomas E. Dickey *
* Copyright 2001-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -43,7 +43,7 @@
#include <tic.h>
#include <ctype.h>
-MODULE_ID("$Id: visbuf.c,v 1.52 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: visbuf.c,v 1.54 2023/05/27 20:13:10 tom Exp $")
#define NUM_VISBUFS 4
@@ -67,7 +67,9 @@ static const char r_brace[] = StringOf(R_BRACE);
static char *
_nc_vischar(char *tp, unsigned c LIMIT_ARG)
{
- if (c == '"' || c == '\\') {
+ if (tp == NULL) {
+ return NULL;
+ } else if (c == '"' || c == '\\') {
*tp++ = '\\';
*tp++ = (char) c;
} else if (is7bits((int) c) && (isgraph((int) c) || c == ' ')) {
@@ -283,7 +285,7 @@ _nc_viswibuf(const wint_t *buf)
/* use these functions for displaying parts of a line within a window */
NCURSES_EXPORT(const char *)
-_nc_viscbuf2(int bufnum, const NCURSES_CH_T * buf, int len)
+_nc_viscbuf2(int bufnum, const NCURSES_CH_T *buf, int len)
{
char *result = _nc_trace_buf(bufnum, (size_t) BUFSIZ);
@@ -371,7 +373,7 @@ _nc_viscbuf2(int bufnum, const NCURSES_CH_T * buf, int len)
}
NCURSES_EXPORT(const char *)
-_nc_viscbuf(const NCURSES_CH_T * buf, int len)
+_nc_viscbuf(const NCURSES_CH_T *buf, int len)
{
return _nc_viscbuf2(0, buf, len);
}
diff --git a/ncurses/tty/MKexpanded.sh b/ncurses/tty/MKexpanded.sh
index 65c6b93e4627..0072be2cd35d 100755
--- a/ncurses/tty/MKexpanded.sh
+++ b/ncurses/tty/MKexpanded.sh
@@ -1,6 +1,6 @@
#! /bin/sh
##############################################################################
-# Copyright 2019,2020 Thomas E. Dickey #
+# Copyright 2019-2020,2021 Thomas E. Dickey #
# Copyright 1998-2015,2017 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
@@ -30,7 +30,7 @@
#
# Author: Thomas E. Dickey, 1997-on
#
-# $Id: MKexpanded.sh,v 1.22 2020/02/02 23:34:34 tom Exp $
+# $Id: MKexpanded.sh,v 1.24 2022/02/05 17:27:18 tom Exp $
#
# Script to generate 'expanded.c', a dummy source that contains functions
# corresponding to complex macros used in this library. By making functions,
@@ -49,7 +49,8 @@ else
fi
TMP=gen$$.c
-trap "rm -f $TMP" EXIT INT QUIT TERM HUP
+trap "rm -f $TMP; exit 1" 1 2 3 15
+trap "rm -f $TMP" 0
cat <<EOF
/* generated by MKexpanded.sh */
@@ -81,7 +82,7 @@ _nc_toggle_attr_on (attr_t *S, attr_t at)
}
NCURSES_EXPORT(void)
-_nc_toggle_attr_off (attr_t *S, attr_t at)
+_nc_toggle_attr_off (attr_t *S, attr_t at)
{
toggle_attr_off(*S,at);
}
diff --git a/ncurses/tty/hardscroll.c b/ncurses/tty/hardscroll.c
index abb21cfddfe3..2b1f079e4b9e 100644
--- a/ncurses/tty/hardscroll.c
+++ b/ncurses/tty/hardscroll.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2023 Thomas E. Dickey *
* Copyright 1998-2015,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -148,7 +148,7 @@ AUTHOR
#include <curses.priv.h>
-MODULE_ID("$Id: hardscroll.c,v 1.54 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: hardscroll.c,v 1.58 2023/09/09 16:04:08 Nicholas.Marriott Exp $")
#if defined(SCROLLDEBUG) || defined(HASHDEBUG)
@@ -204,13 +204,19 @@ NCURSES_SP_NAME(_nc_scroll_optimize) (NCURSES_SP_DCL0)
int *new_oldnums = typeRealloc(int,
(size_t) need_lines,
oldnums(SP_PARM));
- if (!new_oldnums)
+ if (!new_oldnums) {
+ TR(TRACE_ICALLS, (T_RETURN("")));
return;
+ }
oldnums(SP_PARM) = new_oldnums;
OLDNUM_SIZE(SP_PARM) = need_lines;
}
/* calculate the indices */
NCURSES_SP_NAME(_nc_hash_map) (NCURSES_SP_ARG);
+ if (SP_PARM->hashtab_len < screen_lines(SP_PARM)) {
+ TR(TRACE_ICALLS, (T_RETURN("")));
+ return;
+ }
#endif
#endif /* !defined(SCROLLDEBUG) && !defined(HASHDEBUG) */
@@ -301,20 +307,27 @@ NCURSES_EXPORT(void)
NCURSES_SP_NAME(_nc_linedump) (NCURSES_SP_DCL0)
/* dump the state of the real and virtual oldnum fields */
{
- char *buf = 0;
- size_t want = ((size_t) screen_lines(SP_PARM) + 1) * 4;
- (void) SP_PARM;
+ if (USE_TRACEF(TRACE_UPDATE | TRACE_MOVE)) {
+ char *buf = 0;
+ size_t want = ((size_t) screen_lines(SP_PARM) + 1) * 4;
+ (void) SP_PARM;
- if ((buf = typeMalloc(char, want)) != 0) {
- int n;
+ if ((buf = typeMalloc(char, want)) != 0) {
+ int n;
- *buf = '\0';
- for (n = 0; n < screen_lines(SP_PARM); n++)
- _nc_SPRINTF(buf + strlen(buf),
- _nc_SLIMIT(want - strlen(buf))
- " %02d", OLDNUM(SP_PARM, n));
- TR(TRACE_UPDATE | TRACE_MOVE, ("virt %s", buf));
- free(buf);
+ *buf = '\0';
+ for (n = 0; n < screen_lines(SP_PARM); n++) {
+ int number = OLDNUM(SP_PARM, n);
+ if (number >= -99 && number < 999) {
+ _nc_SPRINTF(buf + strlen(buf),
+ _nc_SLIMIT(want - strlen(buf))
+ " %02d", number);
+ } else {
+ _nc_STRCAT(buf, " ??", want - strlen(buf));
+ }
+ }
+ free(buf);
+ }
}
}
diff --git a/ncurses/tty/hashmap.c b/ncurses/tty/hashmap.c
index 3f124c96c896..e50b63847b99 100644
--- a/ncurses/tty/hashmap.c
+++ b/ncurses/tty/hashmap.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2019-2020,2023 Thomas E. Dickey *
* Copyright 1998-2015,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -74,7 +74,7 @@ AUTHOR
#define CUR SP_TERMTYPE
#endif
-MODULE_ID("$Id: hashmap.c,v 1.69 2020/05/31 17:50:48 tom Exp $")
+MODULE_ID("$Id: hashmap.c,v 1.71 2023/09/16 16:28:53 tom Exp $")
#ifdef HASHDEBUG
@@ -318,8 +318,11 @@ NCURSES_SP_NAME(_nc_hash_map) (NCURSES_SP_DCL0)
if (newhash(SP_PARM) == 0)
newhash(SP_PARM) = typeCalloc(unsigned long,
(size_t) screen_lines(SP_PARM));
- if (!oldhash(SP_PARM) || !newhash(SP_PARM))
+ if (!oldhash(SP_PARM) || !newhash(SP_PARM)) {
+ FreeAndNull(oldhash(SP_PARM));
+ FreeAndNull(newhash(SP_PARM));
return; /* malloc failure */
+ }
for (i = 0; i < screen_lines(SP_PARM); i++) {
newhash(SP_PARM)[i] = hash(SP_PARM, NEWTEXT(SP_PARM, i));
oldhash(SP_PARM)[i] = hash(SP_PARM, OLDTEXT(SP_PARM, i));
@@ -403,7 +406,7 @@ NCURSES_SP_NAME(_nc_hash_map) (NCURSES_SP_DCL0)
&& OLDNUM(SP_PARM, i) - i == shift)
i++;
size = i - start;
- if (size < 3 || size + min(size / 8, 2) < abs(shift)) {
+ if (size < 3 || size + Min(size / 8, 2) < abs(shift)) {
while (start < i) {
OLDNUM(SP_PARM, start) = _NEWINDEX;
start++;
diff --git a/ncurses/tty/lib_mvcur.c b/ncurses/tty/lib_mvcur.c
index dd0dc3d9b712..8fad93c727ae 100644
--- a/ncurses/tty/lib_mvcur.c
+++ b/ncurses/tty/lib_mvcur.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2020,2021 Thomas E. Dickey *
+ * Copyright 2018-2022,2023 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -83,8 +83,8 @@
/*
* The average overhead of a full optimization computation in character
- * transmission times. If it's too high, the algorithm will be a bit
- * over-biased toward using cup rather than local motions; if it's too
+ * transmission times. If it is too high, the algorithm will be a bit
+ * over-biased toward using cup rather than local motions; if it is too
* low, the algorithm may spend more time than is strictly optimal
* looking for non-cup motions. Profile the optimizer using the `t'
* command of the exerciser (see below), and round to the nearest integer.
@@ -98,7 +98,7 @@
/*
* LONG_DIST is the distance we consider to be just as costly to move over as a
- * cup sequence is to emit. In other words, it's the length of a cup sequence
+ * cup sequence is to emit. In other words, it is the length of a cup sequence
* adjusted for average computation overhead. The magic number is the length
* of "\033[yy;xxH", the typical cup sequence these days.
*/
@@ -148,7 +148,7 @@
* int _rep_cost; // cost of (repeat_char)
*
* The USE_HARD_TABS switch controls whether it is reliable to use tab/backtabs
- * for local motions. On many systems, it's not, due to uncertainties about
+ * for local motions. On many systems, it is not, due to uncertainties about
* tab delays and whether or not tabs will be expanded in raw mode. If you
* have parm_right_cursor, tab motions don't win you a lot anyhow.
*/
@@ -160,7 +160,7 @@
#define CUR SP_TERMTYPE
#endif
-MODULE_ID("$Id: lib_mvcur.c,v 1.155 2021/02/06 13:53:41 tom Exp $")
+MODULE_ID("$Id: lib_mvcur.c,v 1.161 2023/09/16 16:29:02 tom Exp $")
#define WANT_CHAR(sp, y, x) NewScreen(sp)->_line[y].text[x] /* desired state */
@@ -232,14 +232,33 @@ NCURSES_SP_NAME(_nc_msec_cost) (NCURSES_SP_DCLx const char *const cap, int affcn
/* extract padding, either mandatory or required */
if (cp[0] == '$' && cp[1] == '<' && strchr(cp, '>')) {
float number = 0.0;
+ int state = 0;
for (cp += 2; *cp != '>'; cp++) {
- if (isdigit(UChar(*cp)))
- number = number * 10 + (float) (*cp - '0');
- else if (*cp == '*')
- number *= (float) affcnt;
- else if (*cp == '.' && (*++cp != '>') && isdigit(UChar(*cp)))
- number += (float) ((*cp - '0') / 10.0);
+ if (isdigit(UChar(*cp))) {
+ switch (state) {
+ case 0:
+ number = number * 10 + (float) (*cp - '0');
+ break;
+ case 2:
+ number += (float) ((*cp - '0') / 10.0);
+ ++state;
+ break;
+ }
+ } else if (*cp == '*') {
+ /* padding is always a suffix */
+ if (state < 4) {
+ number *= (float) affcnt;
+ state = 4;
+ }
+ } else if (*cp == '.') {
+ /* a single decimal point is allowed */
+ state = (state == 0) ? 2 : 3;
+ }
+ if (number > MAX_DELAY_MSECS) {
+ number = MAX_DELAY_MSECS;
+ break;
+ }
}
#if NCURSES_NO_PADDING
@@ -432,8 +451,8 @@ NCURSES_SP_NAME(_nc_mvcur_init) (NCURSES_SP_DCL0)
1);
SP_PARM->_hpa_ch_cost = NormalizedCost(TIPARM_1(column_address, 23), 1);
SP_PARM->_cuf_ch_cost = NormalizedCost(TIPARM_1(parm_right_cursor, 23), 1);
- SP_PARM->_inline_cost = min(SP_PARM->_cup_ch_cost,
- min(SP_PARM->_hpa_ch_cost,
+ SP_PARM->_inline_cost = Min(SP_PARM->_cup_ch_cost,
+ Min(SP_PARM->_hpa_ch_cost,
SP_PARM->_cuf_ch_cost));
/*
@@ -470,12 +489,12 @@ NCURSES_EXPORT(void)
NCURSES_SP_NAME(_nc_mvcur_wrap) (NCURSES_SP_DCL0)
/* wrap up cursor-addressing mode */
{
- /* leave cursor at screen bottom */
- TINFO_MVCUR(NCURSES_SP_ARGx -1, -1, screen_lines(SP_PARM) - 1, 0);
-
if (!SP_PARM || !IsTermInfo(SP_PARM))
return;
+ /* leave cursor at screen bottom */
+ TINFO_MVCUR(NCURSES_SP_ARGx -1, -1, screen_lines(SP_PARM) - 1, 0);
+
/* set cursor to normal mode */
if (SP_PARM->_cursor != -1) {
int cursor = SP_PARM->_cursor;
@@ -675,7 +694,7 @@ relative_move(NCURSES_SP_DCLx
* and the time the structure WANT_CHAR would access has been
* updated.
*/
- if (ovw) {
+ if (ovw && to_y >= 0) {
int i;
for (i = 0; i < n; i++) {
@@ -690,7 +709,7 @@ relative_move(NCURSES_SP_DCLx
}
}
}
- if (ovw) {
+ if (ovw && to_y >= 0) {
int i;
for (i = 0; i < n; i++)
@@ -760,7 +779,7 @@ relative_move(NCURSES_SP_DCLx
#endif /* !NO_OPTIMIZE */
/*
- * With the machinery set up above, it's conceivable that
+ * With the machinery set up above, it is conceivable that
* onscreen_mvcur could be modified into a recursive function that does
* an alpha-beta search of motion space, as though it were a chess
* move tree, with the weight function being boolean and the search
diff --git a/ncurses/tty/lib_tstp.c b/ncurses/tty/lib_tstp.c
index 43a58e660a16..dd925c7efd12 100644
--- a/ncurses/tty/lib_tstp.c
+++ b/ncurses/tty/lib_tstp.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020-2021,2022 Thomas E. Dickey *
* Copyright 1998-2014,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -43,7 +43,7 @@
#include <SigAction.h>
-MODULE_ID("$Id: lib_tstp.c,v 1.50 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_tstp.c,v 1.54 2022/12/24 22:22:10 tom Exp $")
#if defined(SIGTSTP) && (HAVE_SIGACTION || HAVE_SIGVEC)
#define USE_SIGTSTP 1
@@ -130,7 +130,7 @@ signal_name(int sig)
* (this may include XENIX).
*
* This implementation will probably be changed to use signal(3) in
- * the future. If nothing else, it's simpler...
+ * the future. If nothing else, it is simpler...
*/
#if USE_SIGTSTP
@@ -283,7 +283,25 @@ handle_SIGINT(int sig)
_exit(EXIT_FAILURE);
}
+# ifndef _nc_set_read_thread
+NCURSES_EXPORT(void)
+_nc_set_read_thread(bool enable)
+{
+ _nc_lock_global(curses);
+ if (enable) {
+# if USE_WEAK_SYMBOLS
+ if ((pthread_self) && (pthread_kill) && (pthread_equal))
+# endif
+ _nc_globals.read_thread = pthread_self();
+ } else {
+ _nc_globals.read_thread = 0;
+ }
+ _nc_unlock_global(curses);
+}
+# endif
+
#if USE_SIGWINCH
+
static void
handle_SIGWINCH(int sig GCC_UNUSED)
{
diff --git a/ncurses/tty/lib_twait.c b/ncurses/tty/lib_twait.c
index a7604b3e293b..6fa73eedb4ce 100644
--- a/ncurses/tty/lib_twait.c
+++ b/ncurses/tty/lib_twait.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 2018-2020,2023 Thomas E. Dickey *
* Copyright 1998-2015,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -76,8 +76,11 @@
#endif
#undef CUR
-MODULE_ID("$Id: lib_twait.c,v 1.75 2020/02/29 15:46:00 anonymous.maarten Exp $")
+MODULE_ID("$Id: lib_twait.c,v 1.81 2023/09/16 16:30:40 tom Exp $")
+/*
+ * Returns an elapsed time, in milliseconds (if possible).
+ */
static long
_nc_gettime(TimeType * t0, int first)
{
@@ -85,18 +88,20 @@ _nc_gettime(TimeType * t0, int first)
#if PRECISE_GETTIME
TimeType t1;
- gettimeofday(&t1, (struct timezone *) 0);
- if (first) {
+ if (GetClockTime(&t1) == -1) {
+ *t0 = t1;
+ res = first ? 0 : 1;
+ } else if (first) {
*t0 = t1;
res = 0;
} else {
/* .tv_sec and .tv_usec are unsigned, be careful when subtracting */
- if (t0->tv_usec > t1.tv_usec) {
- t1.tv_usec += 1000000; /* Convert 1s in 1e6 microsecs */
+ if (t0->sub_secs > t1.sub_secs) {
+ t1.sub_secs += TimeScale;
t1.tv_sec--;
}
- res = (t1.tv_sec - t0->tv_sec) * 1000
- + (t1.tv_usec - t0->tv_usec) / 1000;
+ res = (long) ((t1.tv_sec - t0->tv_sec) * 1000L
+ + (t1.sub_secs - t0->sub_secs) / (TimeScale / 1000L));
}
#else
time_t t1 = time((time_t *) 0);
@@ -355,7 +360,7 @@ _nc_timed_wait(SCREEN *sp MAYBE_UNUSED,
if ((mode & TW_MOUSE)
&& (fd = sp->_mouse_fd) >= 0) {
FD_SET(fd, &set);
- count = max(fd, count) + 1;
+ count = Max(fd, count) + 1;
}
#ifdef NCURSES_WGETCH_EVENTS
if ((mode & TW_EVENT) && evl) {
@@ -365,7 +370,7 @@ _nc_timed_wait(SCREEN *sp MAYBE_UNUSED,
if (ev->type == _NC_EVENT_FILE
&& (ev->data.fev.flags & _NC_EVENT_FILE_READABLE)) {
FD_SET(ev->data.fev.fd, &set);
- count = max(ev->data.fev.fd + 1, count);
+ count = Max(ev->data.fev.fd + 1, count);
}
}
}
diff --git a/ncurses/tty/lib_vidattr.c b/ncurses/tty/lib_vidattr.c
index 15e7397d5dbb..2c7a0b27bd6d 100644
--- a/ncurses/tty/lib_vidattr.c
+++ b/ncurses/tty/lib_vidattr.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2020,2023 Thomas E. Dickey *
* Copyright 1998-2014,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -70,7 +70,7 @@
#define CUR SP_TERMTYPE
#endif
-MODULE_ID("$Id: lib_vidattr.c,v 1.78 2020/05/27 23:56:32 tom Exp $")
+MODULE_ID("$Id: lib_vidattr.c,v 1.79 2023/04/28 20:59:26 tom Exp $")
#define doPut(mode) \
TPUTS_TRACE(#mode); \
@@ -249,6 +249,7 @@ NCURSES_SP_NAME(vidputs) (NCURSES_SP_DCLx
TurnOff(A_ITALIC, exit_italics_mode);
}
#endif
+ (void) turn_off;
}
PreviousAttr &= ALL_BUT_COLOR;
}
@@ -278,6 +279,7 @@ NCURSES_SP_NAME(vidputs) (NCURSES_SP_DCLx
} else if (turn_off & A_ITALIC) {
TurnOff(A_ITALIC, exit_italics_mode);
}
+ (void) turn_off;
}
#endif
SetColorsIf((pair != 0) || fix_pair0, PreviousAttr);
diff --git a/ncurses/tty/tty_update.c b/ncurses/tty/tty_update.c
index 20f9349bd688..0427024cb084 100644
--- a/ncurses/tty/tty_update.c
+++ b/ncurses/tty/tty_update.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2020,2021 Thomas E. Dickey *
+ * Copyright 2018-2023,2024 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -85,7 +85,7 @@
#include <ctype.h>
-MODULE_ID("$Id: tty_update.c,v 1.310 2021/02/06 14:24:38 tom Exp $")
+MODULE_ID("$Id: tty_update.c,v 1.316 2024/02/04 00:09:34 tom Exp $")
/*
* This define controls the line-breakout optimization. Every once in a
@@ -256,6 +256,7 @@ PutAttrChar(NCURSES_SP_DCLx CARG_CH_T ch)
* not checked.
*/
if (is8bits(CharOf(CHDEREF(ch)))
+ && (!is7bits(CharOf(CHDEREF(ch))) && _nc_unicode_locale())
&& (isprint(CharOf(CHDEREF(ch)))
|| (SP_PARM->_legacy_coding > 0 && CharOf(CHDEREF(ch)) >= 160)
|| (SP_PARM->_legacy_coding > 1 && CharOf(CHDEREF(ch)) >= 128)
@@ -473,7 +474,7 @@ wrap_cursor(NCURSES_SP_DCL0)
* An aggressive way to handle this would be to emit CR/LF after the
* char and then assume the wrap is done, you're on the first position
* of the next line, and the terminal out of its weird state. Here
- * it's safe to just tell the code that the cursor is in hyperspace and
+ * it is safe to just tell the code that the cursor is in hyperspace and
* let the next mvcur() call straighten things out.
*/
SP_PARM->_curscol = -1;
@@ -757,14 +758,20 @@ TINFO_DOUPDATE(NCURSES_SP_DCL0)
* We do not allow applications to assign new values in the reentrant
* model.
*/
+#if NCURSES_SP_FUNCS
+ if (SP_PARM == CURRENT_SCREEN) {
+#endif
#define SyncScreens(internal,exported) \
if (internal == 0) internal = exported; \
if (internal != exported) exported = internal
- SyncScreens(CurScreen(SP_PARM), curscr);
- SyncScreens(NewScreen(SP_PARM), newscr);
- SyncScreens(StdScreen(SP_PARM), stdscr);
+ SyncScreens(CurScreen(SP_PARM), curscr);
+ SyncScreens(NewScreen(SP_PARM), newscr);
+ SyncScreens(StdScreen(SP_PARM), stdscr);
+#if NCURSES_SP_FUNCS
+ }
#endif
+#endif /* !USE_REENTRANT */
if (CurScreen(SP_PARM) == 0
|| NewScreen(SP_PARM) == 0
@@ -823,7 +830,7 @@ TINFO_DOUPDATE(NCURSES_SP_DCL0)
/*
* This is the support for magic-cookie terminals. The theory: we scan
* the virtual screen looking for attribute turnons. Where we find one,
- * check to make sure it's realizable by seeing if the required number of
+ * check to make sure it is realizable by seeing if the required number of
* un-attributed blanks are present before and after the attributed range;
* try to shift the range boundaries over blanks (not changing the screen
* display) so this becomes true. If it is, shift the beginning attribute
@@ -885,7 +892,7 @@ TINFO_DOUPDATE(NCURSES_SP_DCL0)
bool end_onscreen = FALSE;
int m, n = j;
- /* find end of span, if it's onscreen */
+ /* find end of span, if it is onscreen */
for (m = i; m < screen_lines(SP_PARM); m++) {
for (; n < screen_columns(SP_PARM); n++) {
attr_t testattr =
@@ -998,7 +1005,7 @@ TINFO_DOUPDATE(NCURSES_SP_DCL0)
if (check_pending(NCURSES_SP_ARG))
goto cleanup;
- nonempty = min(screen_lines(SP_PARM), NewScreen(SP_PARM)->_maxy + 1);
+ nonempty = Min(screen_lines(SP_PARM), NewScreen(SP_PARM)->_maxy + 1);
if (SP_PARM->_scrolling) {
NCURSES_SP_NAME(_nc_scroll_optimize) (NCURSES_SP_ARG);
@@ -1128,7 +1135,7 @@ ClrUpdate(NCURSES_SP_DCL0)
if (0 != SP_PARM) {
int i;
NCURSES_CH_T blank = ClrBlank(NCURSES_SP_ARGx StdScreen(SP_PARM));
- int nonempty = min(screen_lines(SP_PARM),
+ int nonempty = Min(screen_lines(SP_PARM),
NewScreen(SP_PARM)->_maxy + 1);
ClearScreen(NCURSES_SP_ARGx blank);
@@ -1227,7 +1234,7 @@ static int
ClrBottom(NCURSES_SP_DCLx int total)
{
int top = total;
- int last = min(screen_columns(SP_PARM), NewScreen(SP_PARM)->_maxx + 1);
+ int last = Min(screen_columns(SP_PARM), NewScreen(SP_PARM)->_maxx + 1);
NCURSES_CH_T blank = NewScreen(SP_PARM)->_line[total - 1].text[last - 1];
if (clr_eos && can_clear_with(NCURSES_SP_ARGx CHREF(blank))) {
@@ -1287,7 +1294,7 @@ ClrBottom(NCURSES_SP_DCLx int total)
** nLastChar = position of last different character in new line
**
** move to firstChar
-** overwrite chars up to min(oLastChar, nLastChar)
+** overwrite chars up to Min(oLastChar, nLastChar)
** if oLastChar < nLastChar
** insert newLine[oLastChar+1..nLastChar]
** else
@@ -1325,8 +1332,8 @@ TransformLine(NCURSES_SP_DCLx int const lineno)
newPair = GetPair(newLine[n]);
if (oldPair != newPair
&& unColor(oldLine[n]) == unColor(newLine[n])) {
- if (oldPair < SP_PARM->_pair_limit
- && newPair < SP_PARM->_pair_limit
+ if (oldPair < SP_PARM->_pair_alloc
+ && newPair < SP_PARM->_pair_alloc
&& (isSamePair(SP_PARM->_color_pairs[oldPair],
SP_PARM->_color_pairs[newPair]))) {
SetPair(oldLine[n], GetPair(newLine[n]));
@@ -1525,7 +1532,7 @@ TransformLine(NCURSES_SP_DCLx int const lineno)
}
ClrToEOL(NCURSES_SP_ARGx blank, FALSE);
} else {
- n = max(nLastChar, oLastChar);
+ n = Max(nLastChar, oLastChar);
PutRange(NCURSES_SP_ARGx
oldLine,
newLine,
@@ -1550,7 +1557,7 @@ TransformLine(NCURSES_SP_DCLx int const lineno)
break;
}
- n = min(oLastChar, nLastChar);
+ n = Min(oLastChar, nLastChar);
if (n >= firstChar) {
GoTo(NCURSES_SP_ARGx lineno, firstChar);
PutRange(NCURSES_SP_ARGx
@@ -1562,7 +1569,7 @@ TransformLine(NCURSES_SP_DCLx int const lineno)
}
if (oLastChar < nLastChar) {
- int m = max(nLastNonblank, oLastNonblank);
+ int m = Max(nLastNonblank, oLastNonblank);
#if USE_WIDEC_SUPPORT
if (n) {
while (isWidecExt(newLine[n + 1]) && n) {
diff --git a/ncurses/wcwidth.h b/ncurses/wcwidth.h
index ccae41a9b994..76673da65845 100644
--- a/ncurses/wcwidth.h
+++ b/ncurses/wcwidth.h
@@ -59,6 +59,16 @@
* Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
*/
+#ifndef _WCWIDTH_H_incl
+#define _WCWIDTH_H_incl 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <ncurses_cfg.h>
+#include <ncurses_dll.h>
+
#include <wchar.h>
struct interval {
@@ -187,7 +197,7 @@ NCURSES_EXPORT(int) mk_wcwidth(wchar_t ucs)
/* if we arrive here, ucs is not a combining or C0/C1 control character */
- return 1 +
+ return 1 +
(ucs >= 0x1100 &&
(ucs <= 0x115f || /* Hangul Jamo init. consonants */
ucs == 0x2329 || ucs == 0x232a ||
@@ -310,3 +320,9 @@ NCURSES_EXPORT(int) mk_wcswidth_cjk(const wchar_t *pwcs, size_t n)
return width;
}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _WCWIDTH_H_incl 1 */
diff --git a/ncurses/widechar/lib_add_wch.c b/ncurses/widechar/lib_add_wch.c
index 5d6d5547f2f4..be1bbb051ad3 100644
--- a/ncurses/widechar/lib_add_wch.c
+++ b/ncurses/widechar/lib_add_wch.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2019-2021,2023 Thomas E. Dickey *
* Copyright 2004-2011,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -40,7 +40,7 @@
#include <wctype.h>
#endif
-MODULE_ID("$Id: lib_add_wch.c,v 1.16 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_add_wch.c,v 1.18 2023/07/15 17:34:12 tom Exp $")
/* clone/adapt lib_addch.c */
static const cchar_t blankchar = NewChar(BLANK_TEXT);
@@ -133,7 +133,7 @@ newline_forces_scroll(WINDOW *win, NCURSES_SIZE_T *ypos)
* wrapped the cursor. We don't do anything with this flag except set it when
* wrapping, and clear it whenever we move the cursor. If we try to wrap at
* the lower-right corner of a window, we cannot move the cursor (since that
- * wouldn't be legal). So we return an error (which is what SVr4 does).
+ * wouldn't be legal). So we return an error (which is what SVr4 does).
* Unlike SVr4, we can successfully add a character to the lower-right corner
* (Solaris 2.6 does this also, however).
*/
@@ -204,10 +204,16 @@ wadd_wch_literal(WINDOW *win, cchar_t ch)
if (len == 0) { /* non-spacing */
if ((x > 0 && y >= 0)
|| (win->_maxx >= 0 && win->_cury >= 1)) {
- if (x > 0 && y >= 0)
- chars = (win->_line[y].text[x - 1].chars);
- else
+ if (x > 0 && y >= 0) {
+ for (j = x - 1; j > 0; --j) {
+ if (!isWidecExt(win->_line[y].text[j])) {
+ break;
+ }
+ }
+ chars = (win->_line[y].text[j].chars);
+ } else {
chars = (win->_line[y - 1].text[win->_maxx].chars);
+ }
for (i = 0; i < CCHARW_MAX; ++i) {
if (chars[i] == 0) {
TR(TRACE_VIRTPUT,
diff --git a/ncurses/widechar/lib_cchar.c b/ncurses/widechar/lib_cchar.c
index 62a1113ecaa6..451c5dcb518b 100644
--- a/ncurses/widechar/lib_cchar.c
+++ b/ncurses/widechar/lib_cchar.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2019-2020,2021 Thomas E. Dickey *
+ * Copyright 2019-2021,2022 Thomas E. Dickey *
* Copyright 2001-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -37,9 +37,9 @@
#include <curses.priv.h>
#include <wchar.h>
-MODULE_ID("$Id: lib_cchar.c,v 1.35 2021/01/17 00:04:08 tom Exp $")
+MODULE_ID("$Id: lib_cchar.c,v 1.38 2022/07/27 08:03:16 tom Exp $")
-/*
+/*
* The SuSv2 description leaves some room for interpretation. We'll assume wch
* points to a string which is L'\0' terminated, contains at least one
* character with strictly positive width, which must be the first, and
@@ -105,7 +105,6 @@ getcchar(const cchar_t *wcval,
void *opts)
{
int code = ERR;
- int color_pair;
TR(TRACE_CCALLS, (T_CALLED("getcchar(%p,%p,%p,%p,%p)"),
(const void *) wcval,
@@ -123,10 +122,13 @@ getcchar(const cchar_t *wcval,
wchar_t *wp;
int len;
+#if HAVE_WMEMCHR
len = ((wp = wmemchr(wcval->chars, L'\0', (size_t) CCHARW_MAX))
? (int) (wp - wcval->chars)
: CCHARW_MAX);
-
+#else
+ len = wcsnlen(wcval->chars, CCHARW_MAX);
+#endif
if (wch == NULL) {
/*
* If the value is a null, set the length to 1.
@@ -136,6 +138,8 @@ getcchar(const cchar_t *wcval,
} else if (attrs == 0 || pair_arg == 0) {
code = ERR;
} else if (len >= 0) {
+ int color_pair;
+
TR(TRACE_CCALLS, ("copy %d wchars, first is %s", len,
_tracecchar_t(wcval)));
*attrs = AttrOf(*wcval) & A_ATTRIBUTES;
diff --git a/ncurses/widechar/lib_erasewchar.c b/ncurses/widechar/lib_erasewchar.c
index f49d6413bd02..197f80b59b79 100644
--- a/ncurses/widechar/lib_erasewchar.c
+++ b/ncurses/widechar/lib_erasewchar.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 2002-2010,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -33,46 +33,64 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_erasewchar.c,v 1.4 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_erasewchar.c,v 1.5 2021/05/22 23:51:14 tom Exp $")
/*
* erasewchar()
*
* Return erase character as given in cur_term->Ottyb.
- *
*/
NCURSES_EXPORT(int)
-erasewchar(wchar_t *wch)
+NCURSES_SP_NAME(erasewchar) (NCURSES_SP_DCLx wchar_t *wch);
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(erasewchar) (NCURSES_SP_DCLx wchar_t *wch)
{
int value;
int result = ERR;
T((T_CALLED("erasewchar()")));
- if ((value = erasechar()) != ERR) {
+ if ((value = NCURSES_SP_NAME(erasechar) (NCURSES_SP_ARG)) != ERR) {
*wch = (wchar_t) value;
result = OK;
}
returnCode(result);
}
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+erasewchar(wchar_t *wch)
+{
+ return NCURSES_SP_NAME(erasewchar) (CURRENT_SCREEN, wch);
+}
+#endif
+
/*
* killwchar()
*
* Return kill character as given in cur_term->Ottyb.
- *
*/
NCURSES_EXPORT(int)
-killwchar(wchar_t *wch)
+NCURSES_SP_NAME(killwchar) (NCURSES_SP_DCLx wchar_t *wch);
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(killwchar) (NCURSES_SP_DCLx wchar_t *wch)
{
int value;
int result = ERR;
T((T_CALLED("killwchar()")));
- if ((value = killchar()) != ERR) {
+ if ((value = NCURSES_SP_NAME(killchar) (NCURSES_SP_ARG)) != ERR) {
*wch = (wchar_t) value;
result = OK;
}
returnCode(result);
}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+killwchar(wchar_t *wch)
+{
+ return NCURSES_SP_NAME(killwchar) (CURRENT_SCREEN, wch);
+}
+#endif
diff --git a/ncurses/widechar/lib_get_wch.c b/ncurses/widechar/lib_get_wch.c
index 2bd49187aa12..9f10d3bcf121 100644
--- a/ncurses/widechar/lib_get_wch.c
+++ b/ncurses/widechar/lib_get_wch.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 2002-2011,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -41,7 +41,7 @@
#include <curses.priv.h>
#include <ctype.h>
-MODULE_ID("$Id: lib_get_wch.c,v 1.25 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_get_wch.c,v 1.26 2021/04/17 16:12:54 tom Exp $")
NCURSES_EXPORT(int)
wget_wch(WINDOW *win, wint_t *result)
@@ -49,7 +49,6 @@ wget_wch(WINDOW *win, wint_t *result)
SCREEN *sp;
int code;
int value = 0;
- wchar_t wch;
#ifndef state_unused
mbstate_t state;
#endif
@@ -98,6 +97,7 @@ wget_wch(WINDOW *win, wint_t *result)
reset_mbytes(state);
status = count_mbytes(buffer, count, state);
if (status >= 0) {
+ wchar_t wch;
reset_mbytes(state);
if (check_mbytes(wch, buffer, count, state) != status) {
code = ERR; /* the two calls should match */
diff --git a/ncurses/widechar/lib_get_wstr.c b/ncurses/widechar/lib_get_wstr.c
index 695b5263946a..3b3bd522c2d8 100644
--- a/ncurses/widechar/lib_get_wstr.c
+++ b/ncurses/widechar/lib_get_wstr.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 2018-2021,2023 Thomas E. Dickey *
* Copyright 2002-2009,2011 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -40,7 +40,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_get_wstr.c,v 1.16 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_get_wstr.c,v 1.21 2023/04/29 19:02:03 tom Exp $")
static int
wadd_wint(WINDOW *win, wint_t *src)
@@ -88,9 +88,9 @@ wgetn_wstr(WINDOW *win, wint_t *str, int maxlen)
{
SCREEN *sp = _nc_screen_of(win);
TTY buf;
- bool oldnl, oldecho, oldraw, oldcbreak;
- wint_t erasec;
- wint_t killc;
+ TTY_FLAGS save_flags;
+ wchar_t erasec = 0;
+ wchar_t killc = 0;
wint_t *oldstr = str;
wint_t *tmpstr = str;
wint_t ch;
@@ -105,17 +105,14 @@ wgetn_wstr(WINDOW *win, wint_t *str, int maxlen)
_nc_get_tty_mode(&buf);
- oldnl = sp->_nl;
- oldecho = sp->_echo;
- oldraw = sp->_raw;
- oldcbreak = sp->_cbreak;
- nl();
- noecho();
- noraw();
- cbreak();
+ save_flags = sp->_tty_flags;
+ NCURSES_SP_NAME(nl) (NCURSES_SP_ARG);
+ NCURSES_SP_NAME(noecho) (NCURSES_SP_ARG);
+ if (!save_flags._raw)
+ NCURSES_SP_NAME(cbreak) (NCURSES_SP_ARG);
- erasec = (wint_t) erasechar();
- killc = (wint_t) killchar();
+ NCURSES_SP_NAME(erasewchar) (NCURSES_SP_ARGx &erasec);
+ NCURSES_SP_NAME(killwchar) (NCURSES_SP_ARGx &killc);
getyx(win, y, x);
@@ -132,12 +129,12 @@ wgetn_wstr(WINDOW *win, wint_t *str, int maxlen)
code = KEY_CODE_YES;
ch = KEY_ENTER;
}
- if (ch < KEY_MIN) {
- if (ch == erasec) {
+ if (ch != 0 && ch < KEY_MIN) {
+ if (ch == (wint_t) erasec) {
ch = KEY_BACKSPACE;
code = KEY_CODE_YES;
}
- if (ch == killc) {
+ if (ch == (wint_t) killc) {
ch = KEY_EOL;
code = KEY_CODE_YES;
}
@@ -145,12 +142,12 @@ wgetn_wstr(WINDOW *win, wint_t *str, int maxlen)
if (code == KEY_CODE_YES) {
/*
* Some terminals (the Wyse-50 is the most common) generate a \n
- * from the down-arrow key. With this logic, it's the user's
+ * from the down-arrow key. With this logic, it is the user's
* choice whether to set kcud=\n for wget_wch(); terminating
* *getn_wstr() with \n should work either way.
*/
if (ch == KEY_DOWN || ch == KEY_ENTER) {
- if (oldecho == TRUE
+ if (save_flags._echo == TRUE
&& win->_cury == win->_maxy
&& win->_scroll)
wechochar(win, (chtype) '\n');
@@ -158,11 +155,11 @@ wgetn_wstr(WINDOW *win, wint_t *str, int maxlen)
}
if (ch == KEY_LEFT || ch == KEY_BACKSPACE) {
if (tmpstr > oldstr) {
- tmpstr = WipeOut(win, y, x, oldstr, tmpstr, oldecho);
+ tmpstr = WipeOut(win, y, x, oldstr, tmpstr, save_flags._echo);
}
} else if (ch == KEY_EOL) {
while (tmpstr > oldstr) {
- tmpstr = WipeOut(win, y, x, oldstr, tmpstr, oldecho);
+ tmpstr = WipeOut(win, y, x, oldstr, tmpstr, save_flags._echo);
}
} else {
beep();
@@ -172,7 +169,7 @@ wgetn_wstr(WINDOW *win, wint_t *str, int maxlen)
} else {
*tmpstr++ = ch;
*tmpstr = 0;
- if (oldecho == TRUE) {
+ if (save_flags._echo == TRUE) {
int oldy = win->_cury;
if (wadd_wint(win, tmpstr - 1) == ERR) {
@@ -182,9 +179,9 @@ wgetn_wstr(WINDOW *win, wint_t *str, int maxlen)
*/
win->_flags &= ~_WRAPPED;
waddch(win, (chtype) ' ');
- tmpstr = WipeOut(win, y, x, oldstr, tmpstr, oldecho);
+ tmpstr = WipeOut(win, y, x, oldstr, tmpstr, save_flags._echo);
continue;
- } else if (win->_flags & _WRAPPED) {
+ } else if (IS_WRAPPED(win)) {
/*
* If the last waddch forced a wrap & scroll, adjust our
* reference point for erasures.
@@ -212,11 +209,7 @@ wgetn_wstr(WINDOW *win, wint_t *str, int maxlen)
/* Restore with a single I/O call, to fix minor asymmetry between
* raw/noraw, etc.
*/
- sp->_nl = oldnl;
- sp->_echo = oldecho;
- sp->_raw = oldraw;
- sp->_cbreak = oldcbreak;
-
+ sp->_tty_flags = save_flags;
(void) _nc_set_tty_mode(&buf);
*tmpstr = 0;
diff --git a/ncurses/widechar/lib_ins_wch.c b/ncurses/widechar/lib_ins_wch.c
index f75361081b62..ecaabcc9b73e 100644
--- a/ncurses/widechar/lib_ins_wch.c
+++ b/ncurses/widechar/lib_ins_wch.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2019-2020,2023 Thomas E. Dickey *
* Copyright 2002-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -40,7 +40,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_ins_wch.c,v 1.25 2020/12/05 20:04:59 tom Exp $")
+MODULE_ID("$Id: lib_ins_wch.c,v 1.29 2023/11/21 21:53:28 tom Exp $")
/*
* Insert the given character, updating the current location to simplify
@@ -109,9 +109,12 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n)
(void *) win, _nc_viswbufn(wstr, n), n));
if (win != 0
- && wstr != 0) {
- if (n < 1)
+ && wstr != 0
+ && n != 0) {
+
+ if (n < 0) {
n = INT_MAX;
+ }
code = OK;
if (n > 0) {
@@ -120,7 +123,7 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n)
NCURSES_SIZE_T oy = win->_cury;
NCURSES_SIZE_T ox = win->_curx;
- for (cp = wstr; (*cp != L'\0') && ((cp - wstr) < n); cp++) {
+ for (cp = wstr; ((cp - wstr) < n) && (*cp != L'\0'); cp++) {
int len = _nc_wacs_width(*cp);
if ((len >= 0 && len != 1) || !is7bits(*cp)) {
diff --git a/ncurses/widechar/lib_key_name.c b/ncurses/widechar/lib_key_name.c
index 8acfe7a2f498..379bdc2d48dd 100644
--- a/ncurses/widechar/lib_key_name.c
+++ b/ncurses/widechar/lib_key_name.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2023 Thomas E. Dickey *
* Copyright 2007-2008,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -36,7 +36,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_key_name.c,v 1.5 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_key_name.c,v 1.6 2023/06/03 12:15:34 tom Exp $")
#define MyData _nc_globals.key_name
@@ -46,17 +46,22 @@ key_name(wchar_t c)
cchar_t my_cchar;
wchar_t *my_wchars;
size_t len;
+ NCURSES_CONST char *result = NULL;
memset(&my_cchar, 0, sizeof(my_cchar));
my_cchar.chars[0] = c;
my_cchar.chars[1] = L'\0';
my_wchars = wunctrl(&my_cchar);
+ /*
+ * wunctrl() could return a wide character rather than just a "printable"
+ * representation. Check for that and return a corresponding multibyte
+ * character string.
+ */
len = wcstombs(MyData, my_wchars, sizeof(MyData) - 1);
- if (isEILSEQ(len) || (len == 0)) {
- return 0;
+ if (!isEILSEQ(len) && (len != 0) && (len <= MB_LEN_MAX)) {
+ MyData[len] = '\0';
+ result = MyData;
}
-
- MyData[len] = '\0';
- return MyData;
+ return result;
}
diff --git a/ncurses/widechar/lib_pecho_wchar.c b/ncurses/widechar/lib_pecho_wchar.c
index 82b49b686b07..502967fd4e4d 100644
--- a/ncurses/widechar/lib_pecho_wchar.c
+++ b/ncurses/widechar/lib_pecho_wchar.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 2004,2009 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -33,7 +33,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_pecho_wchar.c,v 1.3 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_pecho_wchar.c,v 1.4 2021/10/23 17:07:56 tom Exp $")
NCURSES_EXPORT(int)
pecho_wchar(WINDOW *pad, const cchar_t *wch)
@@ -43,7 +43,7 @@ pecho_wchar(WINDOW *pad, const cchar_t *wch)
if (pad == 0)
returnCode(ERR);
- if (!(pad->_flags & _ISPAD))
+ if (!IS_PAD(pad))
returnCode(wecho_wchar(pad, wch));
wadd_wch(pad, wch);
diff --git a/ncurses/widechar/lib_unget_wch.c b/ncurses/widechar/lib_unget_wch.c
index 4ea26b6034b5..1a81fecc8705 100644
--- a/ncurses/widechar/lib_unget_wch.c
+++ b/ncurses/widechar/lib_unget_wch.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2023 Thomas E. Dickey *
* Copyright 2002-2011,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -40,7 +40,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_unget_wch.c,v 1.17 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_unget_wch.c,v 1.18 2023/06/03 12:50:52 tom Exp $")
/*
* Wrapper for wcrtomb() which obtains the length needed for the given
@@ -60,7 +60,7 @@ _nc_wcrtomb(char *target, wchar_t source, mbstate_t * state)
} else {
result = (int) wcrtomb(target, source, state);
}
- if (!isEILSEQ(result) && (result == 0))
+ if (!isEILSEQ(result) && ((result == 0) || (result > MB_LEN_MAX)))
result = 1;
return (size_t) result;
}
diff --git a/ncurses/widechar/lib_vid_attr.c b/ncurses/widechar/lib_vid_attr.c
index 2d9531f1b864..f108b307d9a7 100644
--- a/ncurses/widechar/lib_vid_attr.c
+++ b/ncurses/widechar/lib_vid_attr.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2020,2023 Thomas E. Dickey *
* Copyright 2002-2014,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -37,7 +37,7 @@
#define CUR SP_TERMTYPE
#endif
-MODULE_ID("$Id: lib_vid_attr.c,v 1.30 2020/05/27 23:54:31 tom Exp $")
+MODULE_ID("$Id: lib_vid_attr.c,v 1.31 2023/04/28 20:59:34 tom Exp $")
#define doPut(mode) \
TPUTS_TRACE(#mode); \
@@ -181,6 +181,7 @@ NCURSES_SP_NAME(vid_puts) (NCURSES_SP_DCLx
TurnOff(A_ITALIC, exit_italics_mode);
}
#endif
+ (void) turn_off;
}
previous_attr &= ALL_BUT_COLOR;
previous_pair = 0;
@@ -212,6 +213,7 @@ NCURSES_SP_NAME(vid_puts) (NCURSES_SP_DCLx
} else if (turn_off & A_ITALIC) {
TurnOff(A_ITALIC, exit_italics_mode);
}
+ (void) turn_off;
}
#endif
SetColorsIf((color_pair != 0) || fix_pair0, previous_attr, previous_pair);
diff --git a/ncurses/win32con/gettimeofday.c b/ncurses/win32con/gettimeofday.c
index 94be7b563b95..603a6f462b78 100644
--- a/ncurses/win32con/gettimeofday.c
+++ b/ncurses/win32con/gettimeofday.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2023 Thomas E. Dickey *
* Copyright 2008-2010,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -36,8 +36,9 @@
#include <windows.h>
-MODULE_ID("$Id: gettimeofday.c,v 1.6 2020/07/11 21:03:53 tom Exp $")
+MODULE_ID("$Id: gettimeofday.c,v 1.7 2023/02/25 20:05:36 tom Exp $")
+#if HAVE_GETTIMEOFDAY == 2
#define JAN1970 116444736000000000LL /* the value for 01/01/1970 00:00 */
NCURSES_EXPORT(int)
@@ -53,3 +54,4 @@ gettimeofday(struct timeval *tv, void *tz GCC_UNUSED)
tv->tv_sec = (long) ((data.since1601 - JAN1970) / 10000000LL);
return (0);
}
+#endif // HAVE_GETTIMEOFDAY == 2
diff --git a/ncurses/win32con/win32_driver.c b/ncurses/win32con/win32_driver.c
index 45aadf2f596a..0a43588b1714 100644
--- a/ncurses/win32con/win32_driver.c
+++ b/ncurses/win32con/win32_driver.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 2018-2020,2023 Thomas E. Dickey *
* Copyright 2008-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -48,7 +48,7 @@
#define CUR TerminalType(my_term).
-MODULE_ID("$Id: win32_driver.c,v 1.2 2020/11/21 23:35:56 tom Exp $")
+MODULE_ID("$Id: win32_driver.c,v 1.4 2023/09/16 16:29:24 tom Exp $")
#define WINMAGIC NCDRV_MAGIC(NCDRV_WINCONSOLE)
#define EXP_OPTIMIZE 0
@@ -393,7 +393,7 @@ wcon_doupdate(TERMINAL_CONTROL_BLOCK * TCB)
Width = screen_columns(sp);
Height = screen_lines(sp);
- nonempty = min(Height, NewScreen(sp)->_maxy + 1);
+ nonempty = Min(Height, NewScreen(sp)->_maxy + 1);
T(("... %dx%d clear cur:%d new:%d",
Height, Width,
@@ -924,11 +924,14 @@ wcon_initmouse(TERMINAL_CONTROL_BLOCK * TCB)
{
SCREEN *sp;
+ T((T_CALLED("win32con::wcon_initmouse(%p)"), TCB));
+
if (validateConsoleHandle()) {
SetSP();
sp->_mouse_type = M_TERM_DRIVER;
}
+ returnVoid;
}
static int
@@ -939,6 +942,7 @@ wcon_testmouse(TERMINAL_CONTROL_BLOCK * TCB,
int rc = 0;
SCREEN *sp;
+ T((T_CALLED("win32con::wcon_testmouse(%p)"), TCB));
if (validateConsoleHandle()) {
SetSP();
@@ -953,7 +957,7 @@ wcon_testmouse(TERMINAL_CONTROL_BLOCK * TCB,
}
}
- return rc;
+ returnCode(rc);
}
static int
diff --git a/ncurses/win32con/win_driver.c b/ncurses/win32con/win_driver.c
index 72a9cf53525f..2425b3a44ce6 100644
--- a/ncurses/win32con/win_driver.c
+++ b/ncurses/win32con/win_driver.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 2018-2021,2023 Thomas E. Dickey *
* Copyright 2008-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -55,7 +55,9 @@
#define CUR TerminalType(my_term).
-MODULE_ID("$Id: win_driver.c,v 1.66 2020/03/01 00:18:49 tom Exp $")
+#define CONTROL_PRESSED (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED)
+
+MODULE_ID("$Id: win_driver.c,v 1.74 2023/09/16 16:27:44 tom Exp $")
#define TypeAlloca(type,count) (type*) _alloca(sizeof(type) * (size_t) (count))
@@ -82,39 +84,40 @@ static bool okConsoleHandle(TERMINAL_CONTROL_BLOCK *);
#define write_screen WriteConsoleOutput
#define read_screen ReadConsoleOutput
#endif
-
+/* *INDENT-OFF* */
static const LONG keylist[] =
{
- GenMap(VK_PRIOR, KEY_PPAGE),
- GenMap(VK_NEXT, KEY_NPAGE),
- GenMap(VK_END, KEY_END),
- GenMap(VK_HOME, KEY_HOME),
- GenMap(VK_LEFT, KEY_LEFT),
- GenMap(VK_UP, KEY_UP),
- GenMap(VK_RIGHT, KEY_RIGHT),
- GenMap(VK_DOWN, KEY_DOWN),
+ GenMap(VK_PRIOR, KEY_PPAGE),
+ GenMap(VK_NEXT, KEY_NPAGE),
+ GenMap(VK_END, KEY_END),
+ GenMap(VK_HOME, KEY_HOME),
+ GenMap(VK_LEFT, KEY_LEFT),
+ GenMap(VK_UP, KEY_UP),
+ GenMap(VK_RIGHT, KEY_RIGHT),
+ GenMap(VK_DOWN, KEY_DOWN),
GenMap(VK_DELETE, KEY_DC),
GenMap(VK_INSERT, KEY_IC)
};
static const LONG ansi_keys[] =
{
- GenMap(VK_PRIOR, 'I'),
- GenMap(VK_NEXT, 'Q'),
- GenMap(VK_END, 'O'),
- GenMap(VK_HOME, 'H'),
- GenMap(VK_LEFT, 'K'),
- GenMap(VK_UP, 'H'),
- GenMap(VK_RIGHT, 'M'),
- GenMap(VK_DOWN, 'P'),
+ GenMap(VK_PRIOR, 'I'),
+ GenMap(VK_NEXT, 'Q'),
+ GenMap(VK_END, 'O'),
+ GenMap(VK_HOME, 'H'),
+ GenMap(VK_LEFT, 'K'),
+ GenMap(VK_UP, 'H'),
+ GenMap(VK_RIGHT, 'M'),
+ GenMap(VK_DOWN, 'P'),
GenMap(VK_DELETE, 'S'),
GenMap(VK_INSERT, 'R')
};
+/* *INDENT-ON* */
#define N_INI ((int)array_length(keylist))
#define FKEYS 24
#define MAPSIZE (FKEYS + N_INI)
#define NUMPAIRS 64
-/* A process can only have a single console, so it's safe
+/* A process can only have a single console, so it is safe
to maintain all the information about it in a single
static structure.
*/
@@ -123,7 +126,6 @@ static struct {
BOOL buffered;
BOOL window_only;
BOOL progMode;
- BOOL isMinTTY;
BOOL isTermInfoConsole;
HANDLE out;
HANDLE inp;
@@ -486,7 +488,7 @@ wcon_doupdate(TERMINAL_CONTROL_BLOCK * TCB)
Width = screen_columns(sp);
Height = screen_lines(sp);
- nonempty = min(Height, NewScreen(sp)->_maxy + 1);
+ nonempty = Min(Height, NewScreen(sp)->_maxy + 1);
T(("... %dx%d clear cur:%d new:%d",
Height, Width,
@@ -610,6 +612,12 @@ wcon_doupdate(TERMINAL_CONTROL_BLOCK * TCB)
returnCode(result);
}
+#ifdef __MING32__
+#define SysISATTY(fd) _isatty(fd)
+#else
+#define SysISATTY(fd) isatty(fd)
+#endif
+
static bool
wcon_CanHandle(TERMINAL_CONTROL_BLOCK * TCB,
const char *tname,
@@ -641,6 +649,8 @@ wcon_CanHandle(TERMINAL_CONTROL_BLOCK * TCB,
}
} else if (tname != 0 && stricmp(tname, "unknown") == 0) {
code = TRUE;
+ } else if (SysISATTY(TCB->term.Filedes)) {
+ code = TRUE;
}
/*
@@ -1476,10 +1486,10 @@ Adjust(int milliseconds, int diff)
FROM_LEFT_4TH_BUTTON_PRESSED | \
RIGHTMOST_BUTTON_PRESSED)
-static int
+static mmask_t
decode_mouse(SCREEN *sp, int mask)
{
- int result = 0;
+ mmask_t result = 0;
(void) sp;
assert(sp && console_initialized);
@@ -1668,14 +1678,14 @@ handle_mouse(SCREEN *sp, MOUSE_EVENT_RECORD mer)
if (sp->_drv_mouse_new_buttons) {
- work.bstate |= (mmask_t) decode_mouse(sp, sp->_drv_mouse_new_buttons);
+ work.bstate |= decode_mouse(sp, sp->_drv_mouse_new_buttons);
} else {
/* cf: BUTTON_PRESSED, BUTTON_RELEASED */
- work.bstate |= (mmask_t) (decode_mouse(sp,
- sp->_drv_mouse_old_buttons)
- >> 1);
+ work.bstate |= (decode_mouse(sp,
+ sp->_drv_mouse_old_buttons)
+ >> 1);
result = TRUE;
}
@@ -1867,7 +1877,7 @@ get_handle(int fd)
#if WINVER >= 0x0600
/* This function tests, whether or not the ncurses application
is running as a descendant of MSYS2/cygwin mintty terminal
- application. mintty doesn't use Windows Console for it's screen
+ application. mintty doesn't use Windows Console for its screen
I/O, so the native Windows _isatty doesn't recognize it as
character device. But we can discover we are at the end of an
Pipe and can query to server side of the pipe, looking whether
@@ -1957,11 +1967,6 @@ _nc_mingw_isatty(int fd)
{
int result = 0;
-#ifdef __MING32__
-#define SysISATTY(fd) _isatty(fd)
-#else
-#define SysISATTY(fd) isatty(fd)
-#endif
if (SysISATTY(fd)) {
result = 1;
} else {
@@ -1974,7 +1979,7 @@ _nc_mingw_isatty(int fd)
/* This is used when running in terminfo mode to discover,
whether or not the "terminal" is actually a Windows
- Console. It's the responsibility of the console to deal
+ Console. It is the responsibility of the console to deal
with the terminal escape sequences that are sent by
terminfo.
*/
@@ -2126,9 +2131,9 @@ _nc_mingw_console_read(
*buf = (int) inp_rec.Event.KeyEvent.uChar.AsciiChar;
vk = inp_rec.Event.KeyEvent.wVirtualKeyCode;
/*
- * There are 24 virtual function-keys, and typically
- * 12 function-keys on a keyboard. Use the shift-modifier
- * to provide the remaining 12 keys.
+ * There are 24 virtual function-keys (defined in winuser.h),
+ * and typically 12 function-keys on a keyboard. Use the
+ * shift-modifier to provide the remaining keys.
*/
if (vk >= VK_F1 && vk <= VK_F12) {
if (inp_rec.Event.KeyEvent.dwControlKeyState & SHIFT_PRESSED) {
@@ -2145,6 +2150,11 @@ _nc_mingw_console_read(
ungetch('\0');
*buf = AnsiKey(vk);
}
+ } else if (vk == VK_BACK) {
+ if (!(inp_rec.Event.KeyEvent.dwControlKeyState
+ & (SHIFT_PRESSED | CONTROL_PRESSED))) {
+ *buf = KEY_BACKSPACE;
+ }
}
break;
} else if (inp_rec.EventType == MOUSE_EVENT) {
@@ -2172,9 +2182,6 @@ InitConsole(void)
BOOL b;
START_TRACE();
- if (_nc_mingw_isatty(0)) {
- CON.isMinTTY = TRUE;
- }
for (i = 0; i < (N_INI + FKEYS); i++) {
if (i < N_INI) {
@@ -2213,14 +2220,14 @@ InitConsole(void)
for (i = 0; i < NUMPAIRS; i++)
CON.pairs[i] = a;
- CON.inp = GetStdHandle(STD_INPUT_HANDLE);
- CON.out = GetStdHandle(STD_OUTPUT_HANDLE);
-
b = AllocConsole();
if (!b)
b = AttachConsole(ATTACH_PARENT_PROCESS);
+ CON.inp = GetDirectHandle("CONIN$", FILE_SHARE_READ);
+ CON.out = GetDirectHandle("CONOUT$", FILE_SHARE_WRITE);
+
if (getenv("NCGDB") || getenv("NCURSES_CONSOLE2")) {
T(("... will not buffer console"));
buffered = FALSE;
@@ -2228,7 +2235,7 @@ InitConsole(void)
} else {
T(("... creating console buffer"));
CON.hdl = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE,
- 0,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
CONSOLE_TEXTMODE_BUFFER,
NULL);