diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2021-10-20 23:22:45 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2021-10-20 23:22:45 +0000 |
commit | 332fa27640b1901ac632e6d37a4aa9643d0f8594 (patch) | |
tree | bfb5303e24d1cd4ddd22df12f45a013fefb9ca23 /ncurses | |
parent | ff448436b2b70771d09b8d5ff34a509dcf02f81b (diff) | |
download | ncurses-master.tar.gz |
ncurses-6.3HEADncurses-6.3master
Diffstat (limited to 'ncurses')
100 files changed, 9645 insertions, 5596 deletions
diff --git a/ncurses/Makefile.in b/ncurses/Makefile.in index b242078..aba25fd 100644 --- a/ncurses/Makefile.in +++ b/ncurses/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.168 2020/02/02 23:34:34 tom Exp $ +# $Id: Makefile.in,v 1.182 2021/08/19 23:43:40 tom Exp $ ############################################################################## -# Copyright 2018-2019,2020 Thomas E. Dickey # +# Copyright 2018-2020,2021 Thomas E. Dickey # # Copyright 1998-2017,2018 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # @@ -50,7 +50,7 @@ SHELL = @SHELL@ VPATH = @srcdir@ THIS = Makefile -CF_MFLAGS = @cf_cv_makeflags@ +TOP_MFLAGS = @cf_cv_makeflags@ DESTDIR="$(DESTDIR)" RPATH_LIST="$(RPATH_LIST)" @SET_MAKE@ x = @EXEEXT@ @@ -99,14 +99,15 @@ ETAGS = @ETAGS@ CC = @CC@ CPP = @CPP@ -CFLAGS = @CFLAGS@ +CFLAGS = @CFLAGS@ @EXTRA_CFLAGS@ +LIBS = @LIBS@ INCDIR = $(srcdir)/../include -CPPFLAGS = -DHAVE_CONFIG_H -I../ncurses @CPPFLAGS@ +CPPFLAGS = -DHAVE_CONFIG_H -DBUILDING_NCURSES -I../ncurses @CPPFLAGS@ CCFLAGS = $(CPPFLAGS) $(CFLAGS) -BUILD_CPPFLAGS = -DHAVE_CONFIG_H -DUSE_BUILD_CC -I../ncurses -I$(srcdir) -I../include -I$(INCDIR) @BUILD_CPPFLAGS@ +BUILD_CPPFLAGS = -DHAVE_CONFIG_H -DUSE_BUILD_CC -I../ncurses -I$(srcdir) -I../include -I$(INCDIR) @BUILD_CPPFLAGS@ BUILD_CC = @BUILD_CC@ BUILD_CCFLAGS = @BUILD_CFLAGS@ BUILD_LDFLAGS = @BUILD_LDFLAGS@ @@ -119,9 +120,9 @@ BUILD_EXEEXT = @BUILD_EXEEXT@ x = @EXEEXT@ CFLAGS_LIBTOOL = $(CCFLAGS) -CFLAGS_NORMAL = $(CCFLAGS) -CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE -CFLAGS_PROFILE = $(CCFLAGS) -pg +CFLAGS_NORMAL = $(CCFLAGS) -DNCURSES_STATIC +CFLAGS_DEBUG = $(CCFLAGS) -DNCURSES_STATIC @CC_G_OPT@ -DTRACE +CFLAGS_PROFILE = $(CCFLAGS) -DNCURSES_STATIC -pg CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) @@ -177,20 +178,26 @@ AUTO_SRC = \ init_keytry.h \ keys.list -HEADER_DEPS = \ - $(srcdir)/curses.priv.h \ - ../include/ncurses_dll.h \ +HEADER_DEPS = @INTERNALS_HDR@ \ ../include/ncurses_cfg.h \ + ../include/ncurses_def.h \ + ../include/ncurses_dll.h \ ../include/curses.h \ - $(INCDIR)/nc_panel.h \ ../include/term.h \ - $(INCDIR)/term_entry.h \ - $(INCDIR)/nc_tparm.h \ + ../include/unctrl.h \ $(INCDIR)/nc_alloc.h \ - $(INCDIR)/nc_mingw.h + $(INCDIR)/nc_panel.h \ + $(INCDIR)/nc_string.h \ + $(INCDIR)/nc_termios.h \ + $(INCDIR)/nc_tparm.h \ + $(INCDIR)/nc_win32.h \ + $(INCDIR)/term_entry.h \ + $(srcdir)/curses.priv.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 = \ @@ -211,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) @@ -224,12 +242,12 @@ $(DESTDIR)$(libdir) : ../lib : ; mkdir $@ ./fallback.c : $(tinfo)/MKfallback.sh - $(SHELL) -e $(tinfo)/MKfallback.sh $(TERMINFO) $(TERMINFO_SRC) $(TIC_PATH) $(INFOCMP_PATH) $(FALLBACK_LIST) >$@ + $(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 >$@ -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 @@ -238,7 +256,7 @@ keys.list : $(tinfo)/MKkeys_list.sh make_keys$(BUILD_EXEEXT) : \ build.priv.h \ $(tinfo)/make_keys.c \ - names.c + ./names.c $(BUILD_CC) -o $@ $(BUILD_CPPFLAGS) $(BUILD_CCFLAGS) $(tinfo)/make_keys.c $(BUILD_LDFLAGS) $(BUILD_LIBS) make_hash$(BUILD_EXEEXT) : \ @@ -308,9 +326,10 @@ realclean :: distclean ../include/hashsize.h \ ../include/parametrized.h \ ../include/term.h : - cd ../include; $(MAKE) $(CF_MFLAGS) + ( 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 @@ -334,13 +353,30 @@ link_test$x : ./link_test.c $(TEST_DEPS) \ @ECHO_LD@ $(CC) -o $@ $(CFLAGS_DEFAULT) ../@DFT_OBJ_SUBDIR@/link_test$o $(TEST_LDFLAGS) ../@DFT_OBJ_SUBDIR@/dump_entry$o: - cd ../progs && $(MAKE) ../@DFT_OBJ_SUBDIR@/dump_entry$o + ( cd ../progs && $(MAKE) ../@DFT_OBJ_SUBDIR@/dump_entry$o ) report_hashing$x : \ $(srcdir)/curses.priv.h \ $(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 25058a9..a9e52ea 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 5a3770e..9dc0855 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.63 2020/02/02 23:34:34 tom Exp $) +# ($Id: MKlib_gen.sh,v 1.71 2021/09/26 22:08:53 tom Exp $) # ############################################################################## -# Copyright 2018,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 # @@ -69,16 +69,25 @@ 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. -PRG=`echo "$1" | $AWK '{ sub(/^[ ]*/,""); sub(/[ ].*$/, ""); print; }' || exit 0` -FSF=`"$PRG" --version 2>/dev/null || exit 0 | fgrep "Free Software Foundation" | head -n 1` +# +# 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` ALL=`"$PRG" -dumpversion 2>/dev/null || exit 0` -ONE=`echo "$ALL" | sed -e 's/\..*$//'` +ONE=`echo "$ALL" | sed -e 's/[^0-9].*$//'` if test -n "$FSF" && test -n "$ALL" && test -n "$ONE" ; then - if test $ONE -ge 5 ; then + if test "$ONE" -ge 5 ; then echo ".. adding -P option to work around $PRG $ALL" >&2 preprocessor="$preprocessor -P" fi @@ -96,7 +105,6 @@ trap "rm -f $ED1 $ED2 $ED3 $ED4 $AW1 $AW2 $TMP" 0 1 2 3 15 ALL=$USE if test "$USE" = implemented ; then - CALL="call_" cat >$ED1 <<EOF1 /^extern.*implemented/{ h @@ -119,7 +127,6 @@ if test "$USE" = implemented ; then } EOF1 else - CALL="" cat >$ED1 <<EOF1 /^extern.*${ALL}/{ h @@ -178,7 +185,7 @@ EOF3 if test "$USE" = generated ; then cat >$ED4 <<EOF - s/^\(.*\) \(.*\) (\(.*\))\$/NCURSES_EXPORT(\1) (\2) (\3)/ + s/^\(.*\) \(.*\) (\(.*\))\$/NCURSES_EXPORT(\1) \2 (\3)/ /attr_[sg]et.* z)/s,z),z GCC_UNUSED), EOF else @@ -433,6 +440,7 @@ BEGIN { print "#include <ncurses_cfg.h>" print "" print "#undef NCURSES_NOMACROS /* _this_ file uses macros */" + print "#define NCURSES_NOMACROS 1" print "" print "#include <curses.priv.h>" print "" @@ -462,8 +470,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); @@ -495,7 +504,7 @@ EOF sed -n -f $ED1 \ | sed -e 's/NCURSES_EXPORT(\(.*\)) \(.*\) (\(.*\))/\1 \2(\3)/' \ | sed -f $ED2 \ -| $AWK -f $AW1 using=$USE \ +| "$AWK" -f $AW1 using="$USE" \ | sed \ -e 's/ [ ]*$//g' \ -e 's/^\([a-zA-Z_][a-zA-Z_]*[ *]*\)/\1 gen_/' \ @@ -507,7 +516,7 @@ $preprocessor $TMP 2>/dev/null \ -e 's/ / /g' \ -e 's/^ //' \ -e 's/_Bool/NCURSES_BOOL/g' \ -| $AWK -f $AW2 \ +| "$AWK" -f $AW2 \ | sed -f $ED3 \ | sed \ -e 's/^.*T_CALLED.*returnCode( \([a-z].*) \));/ return \1;/' \ diff --git a/ncurses/base/keyok.c b/ncurses/base/keyok.c index 8e0b962..945228a 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 604b13b..a144328 100644 --- a/ncurses/base/lib_addch.c +++ b/ncurses/base/lib_addch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2019,2020 Thomas E. Dickey * + * Copyright 2019-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 * @@ -37,7 +37,7 @@ #include <curses.priv.h> #include <ctype.h> -MODULE_ID("$Id: lib_addch.c,v 1.134 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_addch.c,v 1.138 2021/06/17 21:11:08 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). */ @@ -208,6 +208,20 @@ _nc_build_wch(WINDOW *win, ARG_CH_T ch) WINDOW_EXT(win, addch_x) = x; WINDOW_EXT(win, addch_y) = y; + /* + * If the background character is a wide-character, that may interfere with + * processing multibyte characters in this function. + */ + if (!is8bits(CharOf(CHDEREF(ch)))) { + if (WINDOW_EXT(win, addch_used) != 0) { + /* discard the incomplete multibyte character */ + WINDOW_EXT(win, addch_used) = 0; + TR(TRACE_VIRTPUT, + ("Alert discarded incomplete multibyte")); + } + return 1; + } + init_mb(state); buffer[WINDOW_EXT(win, addch_used)] = (char) CharOf(CHDEREF(ch)); WINDOW_EXT(win, addch_used) += 1; diff --git a/ncurses/base/lib_addstr.c b/ncurses/base/lib_addstr.c index 19ebfcd..a1e8829 100644 --- a/ncurses/base/lib_addstr.c +++ b/ncurses/base/lib_addstr.c @@ -45,7 +45,7 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_addstr.c,v 1.56 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_addstr.c,v 1.57 2020/12/05 20:06:19 tom Exp $") NCURSES_EXPORT(int) waddnstr(WINDOW *win, const char *astr, int n) @@ -60,10 +60,10 @@ waddnstr(WINDOW *win, const char *astr, int n) ("... current %s", _traceattr(WINDOW_ATTRS(win)))); code = OK; if (n < 0) - n = (int) strlen(astr); + n = INT_MAX; TR(TRACE_VIRTPUT, ("str is not null, length = %d", n)); - while ((n-- > 0) && (*str != '\0')) { + while ((*str != '\0') && (n-- > 0)) { NCURSES_CH_T ch; TR(TRACE_VIRTPUT, ("*str = %#o", UChar(*str))); SetChar(ch, UChar(*str++), A_NORMAL); @@ -232,10 +232,10 @@ waddnwstr(WINDOW *win, const wchar_t *str, int n) ("... current %s", _traceattr(WINDOW_ATTRS(win)))); code = OK; if (n < 0) - n = (int) wcslen(str); + n = INT_MAX; TR(TRACE_VIRTPUT, ("str is not null, length = %d", n)); - while ((n-- > 0) && (*str != L('\0'))) { + while ((*str != L('\0')) && (n-- > 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 2030030..4f99080 100644 --- a/ncurses/base/lib_bkgd.c +++ b/ncurses/base/lib_bkgd.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2018-2019,2020 Thomas E. Dickey * + * Copyright 2018-2020,2021 Thomas E. Dickey * * Copyright 1998-2014,2016 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -37,7 +37,9 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_bkgd.c,v 1.54 2020/02/02 23:34:34 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); /* * Set the window's background information. @@ -49,7 +51,7 @@ static NCURSES_INLINE void #endif wbkgrndset(WINDOW *win, const ARG_CH_T ch) { - T((T_CALLED("wbkgdset(%p,%s)"), (void *) win, _tracech_t(ch))); + T((T_CALLED("wbkgrndset(%p,%s)"), (void *) win, _tracech_t(ch))); if (win) { attr_t off = AttrOf(win->_nc_bkgd); @@ -62,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); @@ -103,26 +105,36 @@ NCURSES_EXPORT(void) wbkgdset(WINDOW *win, chtype ch) { NCURSES_CH_T wch; + T((T_CALLED("wbkgdset(%p,%s)"), (void *) win, _tracechtype(ch))); SetChar2(wch, ch); wbkgrndset(win, CHREF(wch)); + returnVoid; } /* * Set the window's background information and apply it to each cell. */ -#if USE_WIDEC_SUPPORT -NCURSES_EXPORT(int) -#else static NCURSES_INLINE int -#undef wbkgrnd -#endif -wbkgrnd(WINDOW *win, const ARG_CH_T ch) +_nc_background(WINDOW *win, const ARG_CH_T ch, bool narrow) { #undef SP_PARM #define SP_PARM SP /* to use Charable() */ int code = ERR; - T((T_CALLED("wbkgd(%p,%s)"), (void *) win, _tracech_t(ch))); +#if USE_WIDEC_SUPPORT + T((T_CALLED("%s(%p,%s)"), + narrow ? "wbkgd" : "wbkgrnd", + (void *) win, + _tracecchar_t(ch))); +#define TraceChar(c) _tracecchar_t2(1, &(c)) +#else + T((T_CALLED("%s(%p,%s)"), + "wbkgd", + (void *) win, + _tracech_t(ch))); + (void) narrow; +#define TraceChar(c) _tracechar(CharOf(c)) +#endif if (SP == 0) { ; @@ -143,6 +155,14 @@ wbkgrnd(WINDOW *win, const ARG_CH_T ch) SetPair(new_bkgd, 0); } + /* avoid setting background-character to a null */ + if (CharOf(new_bkgd) == 0) { + NCURSES_CH_T tmp_bkgd = blank; + SetAttr(tmp_bkgd, AttrOf(new_bkgd)); + SetPair(tmp_bkgd, GetPair(new_bkgd)); + new_bkgd = tmp_bkgd; + } + memset(&old_bkgd, 0, sizeof(old_bkgd)); (void) wgetbkgrnd(win, &old_bkgd); @@ -160,7 +180,7 @@ wbkgrnd(WINDOW *win, const ARG_CH_T ch) old_pair = 0; } T(("... old background char %s, attr %s, pair %d", - _tracechar(CharOf(old_char)), _traceattr(old_attr), old_pair)); + TraceChar(old_char), _traceattr(old_attr), old_pair)); new_char = new_bkgd; RemAttr(new_char, ~A_CHARTEXT); @@ -168,14 +188,18 @@ wbkgrnd(WINDOW *win, const ARG_CH_T ch) new_pair = GetPair(new_bkgd); /* SVr4 limits background character to printable 7-bits */ - if (!Charable(new_bkgd)) { + if ( +#if USE_WIDEC_SUPPORT + narrow && +#endif + !Charable(new_bkgd)) { new_char = old_char; } if (!(new_attr & A_COLOR)) { new_pair = 0; } T(("... new background char %s, attr %s, pair %d", - _tracechar(CharOf(new_char)), _traceattr(new_attr), new_pair)); + TraceChar(new_char), _traceattr(new_attr), new_pair)); (void) wbkgrndset(win, CHREF(new_bkgd)); @@ -196,7 +220,19 @@ wbkgrnd(WINDOW *win, const ARG_CH_T ch) attr_t tmp_attr = AttrOf(*cp); if (CharEq(*cp, old_bkgd)) { - SetChar2(*cp, CharOf(new_char)); +#if USE_WIDEC_SUPPORT + if (!narrow) { + if (Charable(new_bkgd)) { + SetChar2(*cp, CharOf(new_char)); + } else { + SetChar(*cp, L' ', AttrOf(new_char)); + } + memcpy(cp->chars, + new_char.chars, + CCHARW_MAX * sizeof(cp->chars[0])); + } else +#endif + SetChar2(*cp, CharOf(new_char)); } if (tmp_pair != 0) { if (tmp_pair == old_pair) { @@ -220,10 +256,18 @@ wbkgrnd(WINDOW *win, const ARG_CH_T ch) returnCode(code); } +#if USE_WIDEC_SUPPORT +NCURSES_EXPORT(int) +wbkgrnd(WINDOW *win, const ARG_CH_T ch) +{ + return _nc_background(win, ch, FALSE); +} +#endif + NCURSES_EXPORT(int) wbkgd(WINDOW *win, chtype ch) { NCURSES_CH_T wch; SetChar2(wch, ch); - return wbkgrnd(win, CHREF(wch)); + return _nc_background(win, CHREF(wch), TRUE); } diff --git a/ncurses/base/lib_color.c b/ncurses/base/lib_color.c index 376ad4f..e4dc79b 100644 --- a/ncurses/base/lib_color.c +++ b/ncurses/base/lib_color.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 * @@ -49,7 +49,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_color.c,v 1.143 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_color.c,v 1.148 2021/10/02 22:55:48 tom Exp $") #ifdef USE_TERM_DRIVER #define CanChange InfoOf(SP_PARM).canchange @@ -140,7 +140,6 @@ NCURSES_EXPORT_VAR(const color_t*) _nc_hls_palette = hls_palette; #endif /* *INDENT-ON* */ - #if NCURSES_EXT_FUNCS /* * These are called from _nc_do_color(), which in turn is called from @@ -190,12 +189,12 @@ set_background_color(NCURSES_SP_DCLx int bg, NCURSES_SP_OUTC outc) if (set_a_background) { TPUTS_TRACE("set_a_background"); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_1(set_a_background, bg), + TIPARM_1(set_a_background, bg), 1, outc); } else { TPUTS_TRACE("set_background"); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_1(set_background, toggled_colors(bg)), + TIPARM_1(set_background, toggled_colors(bg)), 1, outc); } #endif @@ -210,12 +209,12 @@ set_foreground_color(NCURSES_SP_DCLx int fg, NCURSES_SP_OUTC outc) if (set_a_foreground) { TPUTS_TRACE("set_a_foreground"); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_1(set_a_foreground, fg), + TIPARM_1(set_a_foreground, fg), 1, outc); } else { TPUTS_TRACE("set_foreground"); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_1(set_foreground, toggled_colors(fg)), + TIPARM_1(set_foreground, toggled_colors(fg)), 1, outc); } #endif @@ -253,20 +252,21 @@ init_direct_colors(NCURSES_SP_DCL0) { static NCURSES_CONST char name[] = "RGB"; - int n; - const char *s; - int width; rgb_bits_t *result = &(SP_PARM->_direct_color); result->value = 0; if (COLORS >= 8) { + int n; + const char *s; + int width; + /* find the number of bits needed for the maximum color value */ for (width = 0; (1 << width) - 1 < (COLORS - 1); ++width) { ; } - if ((n = tigetflag(name)) > 0) { + if (tigetflag(name) > 0) { n = (width + 2) / 3; result->bits.red = UChar(n); result->bits.green = UChar(n); @@ -361,7 +361,6 @@ NCURSES_EXPORT(int) NCURSES_SP_NAME(start_color) (NCURSES_SP_DCL0) { int result = ERR; - int maxpairs = 0, maxcolors = 0; T((T_CALLED("start_color(%p)"), (void *) SP_PARM)); @@ -370,8 +369,8 @@ NCURSES_SP_NAME(start_color) (NCURSES_SP_DCL0) } else if (SP_PARM->_coloron) { result = OK; } else { - maxpairs = MaxPairs; - maxcolors = MaxColors; + int maxpairs = MaxPairs; + int maxcolors = MaxColors; if (reset_color_pair(NCURSES_SP_ARG) != TRUE) { set_foreground_color(NCURSES_SP_ARGx default_fg(NCURSES_SP_ARG), @@ -672,14 +671,14 @@ _nc_init_pair(SCREEN *sp, int pair, int f, int b) (int) tp[b].red, (int) tp[b].green, (int) tp[b].blue)); NCURSES_PUTP2("initialize_pair", - TPARM_7(initialize_pair, - pair, - (int) tp[f].red, - (int) tp[f].green, - (int) tp[f].blue, - (int) tp[b].red, - (int) tp[b].green, - (int) tp[b].blue)); + TIPARM_7(initialize_pair, + pair, + (int) tp[f].red, + (int) tp[f].green, + (int) tp[f].blue, + (int) tp[b].red, + (int) tp[b].green, + (int) tp[b].blue)); } #endif @@ -746,7 +745,7 @@ _nc_init_color(SCREEN *sp, int color, int r, int g, int b) CallDriver_4(sp, td_initcolor, color, r, g, b); #else NCURSES_PUTP2("initialize_color", - TPARM_4(initialize_color, color, r, g, b)); + TIPARM_4(initialize_color, color, r, g, b)); #endif sp->_color_defs = max(color + 1, sp->_color_defs); @@ -832,7 +831,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, @@ -841,52 +839,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); } @@ -1004,7 +1007,7 @@ NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_DCLx if (set_color_pair) { TPUTS_TRACE("set_color_pair"); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_1(set_color_pair, pair), + TIPARM_1(set_color_pair, pair), 1, outc); return; } else if (SP_PARM != 0) { diff --git a/ncurses/base/lib_dft_fgbg.c b/ncurses/base/lib_dft_fgbg.c index 95dc0c2..4dd43bb 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_driver.c b/ncurses/base/lib_driver.c index 5467607..c53802f 100644 --- a/ncurses/base/lib_driver.c +++ b/ncurses/base/lib_driver.c @@ -34,8 +34,9 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_driver.c,v 1.8 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_driver.c,v 1.9 2020/08/29 19:53:35 tom Exp $") +#ifndef EXP_WIN32_DRIVER typedef struct DriverEntry { const char *name; TERM_DRIVER *driver; @@ -77,6 +78,7 @@ _nc_get_driver(TERMINAL_CONTROL_BLOCK * TCB, const char *name, int *errret) } returnCode(code); } +#endif /* !EXP_WIN32_DRIVER */ NCURSES_EXPORT(int) NCURSES_SP_NAME(has_key) (SCREEN *sp, int keycode) diff --git a/ncurses/base/lib_freeall.c b/ncurses/base/lib_freeall.c index 9133d08..c027151 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.74 2021/03/20 22:57:53 tom Exp $") /* * Free all ncurses data. This is used for testing only (there's no practical @@ -171,8 +171,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 bf2115d..bdb8a04 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-2020,2021 Thomas E. Dickey * * Copyright 1998-2015,2016 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -41,9 +41,10 @@ ** */ +#define NEED_KEY_EVENT #include <curses.priv.h> -MODULE_ID("$Id: lib_getch.c,v 1.139 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_getch.c,v 1.142 2021/09/04 10:52:55 tom Exp $") #include <fifo_defs.h> @@ -134,7 +135,7 @@ _nc_use_meta(WINDOW *win) } #ifdef USE_TERM_DRIVER -# ifdef _WIN32 +# if defined(_NC_WINDOWS) && !defined(EXP_WIN32_DRIVER) static HANDLE _nc_get_handle(int fd) { @@ -155,7 +156,14 @@ check_mouse_activity(SCREEN *sp, int delay EVENTLIST_2nd(_nc_eventlist * evl)) #ifdef USE_TERM_DRIVER TERMINAL_CONTROL_BLOCK *TCB = TCBOf(sp); rc = TCBOf(sp)->drv->td_testmouse(TCBOf(sp), delay EVENTLIST_2nd(evl)); -# ifdef _WIN32 +# if defined(EXP_WIN32_DRIVER) + /* if we emulate terminfo on console, we have to use the console routine */ + if (IsTermInfoOnConsole(sp)) { + rc = _nc_console_testmouse(sp, + _nc_console_handle(sp->_ifd), + delay EVENTLIST_2nd(evl)); + } else +# elif defined(_NC_WINDOWS) /* if we emulate terminfo on console, we have to use the console routine */ if (IsTermInfoOnConsole(sp)) { HANDLE fd = _nc_get_handle(sp->_ifd); @@ -163,29 +171,36 @@ check_mouse_activity(SCREEN *sp, int delay EVENTLIST_2nd(_nc_eventlist * evl)) } else # endif rc = TCB->drv->td_testmouse(TCB, delay EVENTLIST_2nd(evl)); -#else -#if USE_SYSMOUSE +#else /* !USE_TERM_DRIVER */ +# if USE_SYSMOUSE if ((sp->_mouse_type == M_SYSMOUSE) && (sp->_sysmouse_head < sp->_sysmouse_tail)) { rc = TW_MOUSE; } else -#endif +# endif { +# if defined(EXP_WIN32_DRIVER) + rc = _nc_console_testmouse(sp, + _nc_console_handle(sp->_ifd), + delay + EVENTLIST_2nd(evl)); +# else rc = _nc_timed_wait(sp, TWAIT_MASK, delay, (int *) 0 EVENTLIST_2nd(evl)); -#if USE_SYSMOUSE +# endif +# if USE_SYSMOUSE if ((sp->_mouse_type == M_SYSMOUSE) && (sp->_sysmouse_head < sp->_sysmouse_tail) && (rc == 0) && (errno == EINTR)) { rc |= TW_MOUSE; } -#endif +# endif } -#endif +#endif /* USE_TERM_DRIVER */ return rc; } @@ -290,31 +305,54 @@ fifo_push(SCREEN *sp EVENTLIST_2nd(_nc_eventlist * evl)) } else #endif { /* Can block... */ -#ifdef USE_TERM_DRIVER +#if defined(USE_TERM_DRIVER) int buf; -#ifdef _WIN32 +# 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 + n = _nc_console_read(sp, + _nc_console_handle(sp->_ifd), + &buf); +# if USE_PTHREADS_EINTR + _nc_globals.read_thread = 0; +# endif + } else +# elif defined(_NC_WINDOWS) if (NC_ISATTY(sp->_ifd) && IsTermInfoOnConsole(sp) && sp->_cbreak) n = _nc_mingw_console_read(sp, _nc_get_handle(sp->_ifd), &buf); else -#endif +# endif /* EXP_WIN32_DRIVER */ n = CallDriver_1(sp, td_read, &buf); ch = buf; -#else +#else /* !USE_TERM_DRIVER */ +#if defined(EXP_WIN32_DRIVER) + int buf; +#endif unsigned char c2 = 0; -# if USE_PTHREADS_EINTR -# if USE_WEAK_SYMBOLS +#if USE_PTHREADS_EINTR +#if USE_WEAK_SYMBOLS if ((pthread_self) && (pthread_kill) && (pthread_equal)) -# endif +#endif _nc_globals.read_thread = pthread_self(); -# endif +#endif +#if defined(EXP_WIN32_DRIVER) + n = _nc_console_read(sp, + _nc_console_handle(sp->_ifd), + &buf); + c2 = buf; +#else n = (int) read(sp->_ifd, &c2, (size_t) 1); +#endif #if USE_PTHREADS_EINTR _nc_globals.read_thread = 0; #endif ch = c2; -#endif +#endif /* USE_TERM_DRIVER */ } if ((n == -1) || (n == 0)) { @@ -513,7 +551,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 diff --git a/ncurses/base/lib_getstr.c b/ncurses/base/lib_getstr.c index d0b09a3..5feb351 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-2020,2021 Thomas E. Dickey * * Copyright 1998-2011,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -39,9 +39,10 @@ ** */ +#define NEED_KEY_EVENT #include <curses.priv.h> -MODULE_ID("$Id: lib_getstr.c,v 1.34 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_getstr.c,v 1.37 2021/09/04 10:29:15 tom Exp $") /* * This wipes out the last character, no matter whether it was a tab, control @@ -99,8 +100,7 @@ wgetnstr_events(WINDOW *win, oldcbreak = sp->_cbreak; NCURSES_SP_NAME(nl) (NCURSES_SP_ARG); NCURSES_SP_NAME(noecho) (NCURSES_SP_ARG); - NCURSES_SP_NAME(noraw) (NCURSES_SP_ARG); - NCURSES_SP_NAME(cbreak) (NCURSES_SP_ARG); + NCURSES_SP_NAME(raw) (NCURSES_SP_ARG); erasec = NCURSES_SP_NAME(erasechar) (NCURSES_SP_ARG); killc = NCURSES_SP_NAME(killchar) (NCURSES_SP_ARG); @@ -114,7 +114,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. */ diff --git a/ncurses/base/lib_initscr.c b/ncurses/base/lib_initscr.c index 2ace092..6b91491 100644 --- a/ncurses/base/lib_initscr.c +++ b/ncurses/base/lib_initscr.c @@ -46,7 +46,7 @@ #include <sys/termio.h> /* needed for ISC */ #endif -MODULE_ID("$Id: lib_initscr.c,v 1.45 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_initscr.c,v 1.48 2020/09/07 14:26:48 tom Exp $") NCURSES_EXPORT(WINDOW *) initscr(void) @@ -66,10 +66,9 @@ initscr(void) _nc_globals.init_screen = TRUE; - if ((env = getenv("TERM")) == 0 - || *env == '\0') { - env = "unknown"; - } + env = getenv("TERM"); + (void) VALID_TERM_ENV(env, "unknown"); + if ((name = strdup(env)) == NULL) { fprintf(stderr, "Error opening allocating $TERM.\n"); ExitProgram(EXIT_FAILURE); diff --git a/ncurses/base/lib_instr.c b/ncurses/base/lib_instr.c index 2aa0fc3..b9874b7 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 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.25 2021/04/03 22:24:18 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,6 +78,7 @@ 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); diff --git a/ncurses/base/lib_mouse.c b/ncurses/base/lib_mouse.c index 2530dec..2fb261d 100644 --- a/ncurses/base/lib_mouse.c +++ b/ncurses/base/lib_mouse.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 * @@ -85,7 +85,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_mouse.c,v 1.184 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_mouse.c,v 1.193 2021/03/20 12:56:32 tom Exp $") #include <tic.h> @@ -142,19 +142,29 @@ make an error #define MASK_RESERVED_EVENT(x) (mmask_t) NCURSES_MOUSE_MASK(x, 040) #if NCURSES_MOUSE_VERSION == 1 + #define BUTTON_CLICKED (BUTTON1_CLICKED | BUTTON2_CLICKED | BUTTON3_CLICKED | BUTTON4_CLICKED) #define BUTTON_PRESSED (BUTTON1_PRESSED | BUTTON2_PRESSED | BUTTON3_PRESSED | BUTTON4_PRESSED) #define BUTTON_RELEASED (BUTTON1_RELEASED | BUTTON2_RELEASED | BUTTON3_RELEASED | BUTTON4_RELEASED) #define BUTTON_DOUBLE_CLICKED (BUTTON1_DOUBLE_CLICKED | BUTTON2_DOUBLE_CLICKED | BUTTON3_DOUBLE_CLICKED | BUTTON4_DOUBLE_CLICKED) #define BUTTON_TRIPLE_CLICKED (BUTTON1_TRIPLE_CLICKED | BUTTON2_TRIPLE_CLICKED | BUTTON3_TRIPLE_CLICKED | BUTTON4_TRIPLE_CLICKED) + #define MAX_BUTTONS 4 + #else + #define BUTTON_CLICKED (BUTTON1_CLICKED | BUTTON2_CLICKED | BUTTON3_CLICKED | BUTTON4_CLICKED | BUTTON5_CLICKED) #define BUTTON_PRESSED (BUTTON1_PRESSED | BUTTON2_PRESSED | BUTTON3_PRESSED | BUTTON4_PRESSED | BUTTON5_PRESSED) #define BUTTON_RELEASED (BUTTON1_RELEASED | BUTTON2_RELEASED | BUTTON3_RELEASED | BUTTON4_RELEASED | BUTTON5_RELEASED) #define BUTTON_DOUBLE_CLICKED (BUTTON1_DOUBLE_CLICKED | BUTTON2_DOUBLE_CLICKED | BUTTON3_DOUBLE_CLICKED | BUTTON4_DOUBLE_CLICKED | BUTTON5_DOUBLE_CLICKED) #define BUTTON_TRIPLE_CLICKED (BUTTON1_TRIPLE_CLICKED | BUTTON2_TRIPLE_CLICKED | BUTTON3_TRIPLE_CLICKED | BUTTON4_TRIPLE_CLICKED | BUTTON5_TRIPLE_CLICKED) + +#if NCURSES_MOUSE_VERSION == 2 #define MAX_BUTTONS 5 +#else +#define MAX_BUTTONS 11 +#endif + #endif #define INVALID_EVENT -1 @@ -409,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 @@ -426,7 +445,7 @@ enable_xterm_mouse(SCREEN *sp, int enable) #if USE_EMX_MOUSE sp->_emxmouse_activated = enable; #else - NCURSES_PUTP2("xterm-mouse", TPARM_1(sp->_mouse_xtermcap, enable)); + NCURSES_PUTP2("xterm-mouse", TIPARM_1(sp->_mouse_xtermcap, enable)); #endif sp->_mouse_active = enable; } @@ -477,8 +496,6 @@ unload_gpm_library(SCREEN *sp) T(("unload GPM library")); sp->_mouse_gpm_loaded = FALSE; sp->_mouse_fd = -1; - dlclose(sp->_dlopen_gpm); - sp->_dlopen_gpm = 0; } } @@ -486,7 +503,14 @@ static void load_gpm_library(SCREEN *sp) { sp->_mouse_gpm_found = FALSE; - if ((sp->_dlopen_gpm = dlopen(LIBGPM_SONAME, my_RTLD)) != 0) { + + /* + * If we already had a successful dlopen, reuse it. + */ + if (sp->_dlopen_gpm != 0) { + sp->_mouse_gpm_found = TRUE; + sp->_mouse_gpm_loaded = TRUE; + } else if ((sp->_dlopen_gpm = dlopen(LIBGPM_SONAME, my_RTLD)) != 0) { #if (defined(__GNUC__) && (__GNUC__ >= 5)) || defined(__clang__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpedantic" @@ -500,13 +524,15 @@ load_gpm_library(SCREEN *sp) #endif T(("GPM initialization failed: %s", dlerror())); unload_gpm_library(sp); + dlclose(sp->_dlopen_gpm); + sp->_dlopen_gpm = 0; } else { sp->_mouse_gpm_found = TRUE; sp->_mouse_gpm_loaded = TRUE; } } } -#endif +#endif /* HAVE_LIBDL */ static bool enable_gpm_mouse(SCREEN *sp, bool enable) @@ -928,7 +954,7 @@ handle_wheel(SCREEN *sp, MEVENT * eventp, int button, int wheel) break; case 1: if (wheel) { -#if NCURSES_MOUSE_VERSION == 2 +#if NCURSES_MOUSE_VERSION >= 2 eventp->bstate = MASK_PRESS(5); /* See comment above for button 4 */ #else @@ -953,10 +979,24 @@ static bool decode_X10_bstate(SCREEN *sp, MEVENT * eventp, unsigned intro) { bool result; + int button = 0; + int wheel = (intro & 96) == 96; eventp->bstate = 0; - if (!handle_wheel(sp, eventp, (int) intro, (intro & 96) == 96)) { + if (intro >= 96) { + if (intro >= 160) { + button = (int) (intro - 152); /* buttons 8-11 */ + } else { + button = (int) (intro - 92); /* buttons 4-7 */ + } + } else { + button = (intro & 3); + } + + if (button > MAX_BUTTONS) { + eventp->bstate = REPORT_MOUSE_POSITION; + } else if (!handle_wheel(sp, eventp, (int) intro, wheel)) { /* * Release events aren't reported for individual buttons, just for @@ -1261,10 +1301,21 @@ decode_xterm_SGR1006(SCREEN *sp, MEVENT * eventp) if (read_SGR(sp, &data)) { int b = data.params[0]; int b3 = 1 + (b & 3); + int wheel = ((b & 64) == 64); + + if (b >= 132) { + b3 = MAX_BUTTONS + 1; + } else if (b >= 128) { + b3 = (b - 120); /* buttons 8-11 */ + } else if (b >= 64) { + b3 = (b - 60); /* buttons 6-7 */ + } eventp->id = NORMAL_EVENT; if (data.final == 'M') { - (void) handle_wheel(sp, eventp, b, (b & 64) == 64); + (void) handle_wheel(sp, eventp, b, wheel); + } else if (b3 > MAX_BUTTONS) { + eventp->bstate = REPORT_MOUSE_POSITION; } else { mmask_t pressed = (mmask_t) NCURSES_MOUSE_MASK(b3, NCURSES_BUTTON_PRESSED); mmask_t release = (mmask_t) NCURSES_MOUSE_MASK(b3, NCURSES_BUTTON_RELEASED); diff --git a/ncurses/base/lib_newterm.c b/ncurses/base/lib_newterm.c index ac89790..bba97ba 100644 --- a/ncurses/base/lib_newterm.c +++ b/ncurses/base/lib_newterm.c @@ -49,7 +49,7 @@ #include <tic.h> -MODULE_ID("$Id: lib_newterm.c,v 1.102 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_newterm.c,v 1.103 2020/09/05 21:34:04 tom Exp $") #ifdef USE_TERM_DRIVER #define NumLabels InfoOf(SP_PARM).numlabels @@ -88,6 +88,12 @@ _nc_initscr(NCURSES_SP_DCL0) buf.c_oflag &= (unsigned) ~(ONLCR); #elif HAVE_SGTTY_H buf.sg_flags &= ~(ECHO | CRMOD); +#elif defined(EXP_WIN32_DRIVER) + buf.dwFlagIn = CONMODE_IN_DEFAULT; + buf.dwFlagOut = CONMODE_OUT_DEFAULT | VT_FLAG_OUT; + if (WINCONSOLE.isTermInfoConsole) { + buf.dwFlagIn |= VT_FLAG_IN; + } #else memset(&buf, 0, sizeof(buf)); #endif @@ -195,6 +201,11 @@ NCURSES_SP_NAME(newterm) (NCURSES_SP_DCLx current = CURRENT_SCREEN; its_term = (current ? current->_term : 0); +#if defined(EXP_WIN32_DRIVER) + _setmode(fileno(_ifp), _O_BINARY); + _setmode(fileno(_ofp), _O_BINARY); +#endif + INIT_TERM_DRIVER(); /* this loads the capability entry, then sets LINES and COLS */ if ( diff --git a/ncurses/base/lib_pad.c b/ncurses/base/lib_pad.c index 73978fb..f49a5eb 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.49 2021/09/04 10:52:55 tom Exp $") NCURSES_EXPORT(WINDOW *) NCURSES_SP_NAME(newpad) (NCURSES_SP_DCLx int l, int c) @@ -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 diff --git a/ncurses/base/lib_screen.c b/ncurses/base/lib_screen.c index 164356d..eacb03a 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-2020,2021 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.97 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_screen.c,v 1.103 2021/10/18 22:40:48 tom Exp $") #define MAX_SIZE 0x3fff /* 16k is big enough for a window or pad */ @@ -58,7 +58,7 @@ MODULE_ID("$Id: lib_screen.c,v 1.97 2020/02/02 23:34:34 tom Exp $") #define ARG_SLIMIT(name) /* nothing */ #endif -#define CUR_SLIMIT _nc_SLIMIT(limit - (target - base)) +#define CUR_SLIMIT _nc_SLIMIT(limit - (size_t) (target - base)) #define TOP_SLIMIT _nc_SLIMIT(sizeof(buffer)) /* @@ -67,7 +67,7 @@ MODULE_ID("$Id: lib_screen.c,v 1.97 2020/02/02 23:34:34 tom Exp $") * format. It happens to be unused in the file 5.22 database (2015/03/07). */ static const char my_magic[] = -{'\210', '\210', '\210', '\210'}; +{'\210', '\210', '\210', '\210', 0}; #if NCURSES_EXT_PUTWIN typedef enum { @@ -200,7 +200,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 +214,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 +272,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 +329,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 +347,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; @@ -441,7 +441,7 @@ read_win(WINDOW *win, FILE *fp) } static int -read_row(char *source, NCURSES_CH_T * prior, NCURSES_CH_T * target, int length) +read_row(char *source, NCURSES_CH_T *prior, NCURSES_CH_T *target, int length) { while (*source != '\0' && length > 0) { #if NCURSES_WIDECHAR @@ -940,6 +940,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 +974,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 +1004,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 +1031,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 c5f26bc..264fb98 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-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,10 +44,17 @@ #include <curses.priv.h> #include <tic.h> +#if USE_GPM_SUPPORT +#ifdef HAVE_LIBDL +/* use dynamic loader to avoid linkage dependency */ +#include <dlfcn.h> +#endif +#endif + #undef CUR #define CUR SP_TERMTYPE -MODULE_ID("$Id: lib_set_term.c,v 1.169 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_set_term.c,v 1.179 2021/05/08 21:48:34 tom Exp $") #ifdef USE_TERM_DRIVER #define MaxColors InfoOf(sp).maxcolors @@ -140,8 +147,8 @@ delscreen(SCREEN *sp) _nc_lock_global(curses); if (delink_screen(sp)) { #ifdef USE_SP_RIPOFF - ripoff_t *rop; if (safe_ripoff_sp && safe_ripoff_sp != safe_ripoff_stack) { + ripoff_t *rop; for (rop = safe_ripoff_stack; rop != safe_ripoff_sp && (rop - safe_ripoff_stack) < N_RIPS; rop++) { @@ -197,6 +204,14 @@ delscreen(SCREEN *sp) if (_nc_find_prescr() == sp) { _nc_forget_prescr(); } +#if USE_GPM_SUPPORT +#ifdef HAVE_LIBDL + if (sp->_dlopen_gpm != 0) { + dlclose(sp->_dlopen_gpm); + sp->_dlopen_gpm = 0; + } +#endif +#endif /* USE_GPM_SUPPORT */ free(sp); /* @@ -314,9 +329,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(); } @@ -340,8 +360,9 @@ NCURSES_SP_NAME(_nc_setupscreen) ( sp->_next_screen = _nc_screen_chain; _nc_screen_chain = sp; - if ((sp->_current_attr = typeCalloc(NCURSES_CH_T, 1)) == 0) + if ((sp->_current_attr = typeCalloc(NCURSES_CH_T, 1)) == 0) { returnCode(ERR); + } #endif /* @@ -391,7 +412,11 @@ NCURSES_SP_NAME(_nc_setupscreen) ( fflush(output); setmode(output, O_BINARY); #endif - NCURSES_SP_NAME(_nc_set_buffer) (NCURSES_SP_ARGx output, TRUE); +#if defined(EXP_WIN32_DRIVER) + T(("setting output mode to binary")); + fflush(output); + _setmode(fileno(output), _O_BINARY); +#endif sp->_lines = (NCURSES_SIZE_T) slines; sp->_lines_avail = (NCURSES_SIZE_T) slines; sp->_columns = (NCURSES_SIZE_T) scolumns; @@ -399,6 +424,10 @@ NCURSES_SP_NAME(_nc_setupscreen) ( fflush(output); sp->_ofd = output ? fileno(output) : -1; sp->_ofp = output; +#if defined(EXP_WIN32_DRIVER) + if (output) + _setmode(fileno(output), _O_BINARY); +#endif sp->out_limit = (size_t) ((2 + slines) * (6 + scolumns)); if ((sp->out_buffer = malloc(sp->out_limit)) == 0) sp->out_limit = 0; @@ -470,7 +499,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) { @@ -667,6 +696,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; } diff --git a/ncurses/base/lib_slkrefr.c b/ncurses/base/lib_slkrefr.c index c6bf9d2..7a40624 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/new_pair.c b/ncurses/base/new_pair.c index 547ab28..70866c6 100644 --- a/ncurses/base/new_pair.c +++ b/ncurses/base/new_pair.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2018-2019,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 * @@ -61,7 +61,7 @@ #endif -MODULE_ID("$Id: new_pair.c,v 1.19 2020/02/02 23:34:34 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) @@ -144,17 +144,16 @@ static int _nc_find_color_pair(SCREEN *sp, int fg, int bg) { colorpair_t find; - int result; - void *pp; + int result = -1; find.fg = fg; find.bg = bg; - if (sp != 0 && - (pp = tfind(&find, &sp->_ordered_pairs, compare_data)) != 0) { - colorpair_t *temp = *(colorpair_t **) pp; - result = (int) (temp - sp->_color_pairs); - } else { - result = -1; + if (sp != 0) { + void *pp; + if ((pp = tfind(&find, &sp->_ordered_pairs, compare_data)) != 0) { + colorpair_t *temp = *(colorpair_t **) pp; + result = (int) (temp - sp->_color_pairs); + } } return result; } @@ -197,7 +196,10 @@ NCURSES_EXPORT(void) _nc_reset_color_pair(SCREEN *sp, int pair, colorpair_t * next) { colorpair_t *last; + if (ValidPair(sp, pair)) { + bool used; + ReservePairs(sp, pair); last = &(sp->_color_pairs[pair]); delink_color_pair(sp, pair); @@ -205,6 +207,11 @@ _nc_reset_color_pair(SCREEN *sp, int pair, colorpair_t * next) (last->fg != next->fg || last->bg != next->bg)) { /* remove the old entry from fast index */ tdelete(last, &sp->_ordered_pairs, compare_data); + used = FALSE; + } else { + used = (last->mode != cpFREE); + } + if (!used) { /* create a new entry in fast index */ *last = *next; tsearch(last, &sp->_ordered_pairs, compare_data); @@ -290,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 9b04287..225f552 100644 --- a/ncurses/base/resizeterm.c +++ b/ncurses/base/resizeterm.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020 Thomas E. Dickey * + * Copyright 2020,2021 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.51 2021/09/04 10:54:35 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) diff --git a/ncurses/base/safe_sprintf.c b/ncurses/base/safe_sprintf.c index 1868c00..3fff2e8 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-2020,2021 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.35 2021/10/03 00:25:09 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,30 @@ 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; + while ((used = vsnprintf(my_buffer, my_length, fmt, ap)) + >= (int) my_length) { + my_length = (size_t) ((3 * used) / 2); + my_buffer = typeRealloc(char, my_length, my_buffer); + } # 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/wresize.c b/ncurses/base/wresize.c index 93276ef..30718b8 100644 --- a/ncurses/base/wresize.c +++ b/ncurses/base/wresize.c @@ -34,7 +34,7 @@ #include <curses.priv.h> -MODULE_ID("$Id: wresize.c,v 1.39 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: wresize.c,v 1.41 2020/04/18 21:01:00 tom Exp $") static int cleanup_lines(struct ldat *data, int length) @@ -176,7 +176,15 @@ wresize(WINDOW *win, int ToLines, int ToCols) if (s == 0) returnCode(cleanup_lines(new_lines, row)); for (col = 0; col <= ToCols; ++col) { - s[col] = (col <= size_x + bool valid = (col <= size_x); + if_WIDEC({ + if (col == ToCols + && col < size_x + && isWidecBase(win->_line[row].text[col])) { + valid = FALSE; + } + }); + s[col] = (valid ? win->_line[row].text[col] : win->_nc_bkgd); } diff --git a/ncurses/curses.priv.h b/ncurses/curses.priv.h index 9ca0263..872d25a 100644 --- a/ncurses/curses.priv.h +++ b/ncurses/curses.priv.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2018-2019,2020 Thomas E. Dickey * + * Copyright 2018-2020,2021 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.628 2020/02/02 23:34:34 tom Exp $ + * $Id: curses.priv.h,v 1.646 2021/09/24 16:09:35 tom Exp $ * * curses.priv.h * @@ -72,10 +72,6 @@ extern "C" { #include <unistd.h> #endif -#if HAVE_SYS_BSDTYPES_H && !(defined(_WIN32) || defined(_WIN64)) -#include <sys/bsdtypes.h> /* needed for ISC */ -#endif - #if HAVE_LIMITS_H # include <limits.h> #elif HAVE_SYS_PARAM_H @@ -107,6 +103,24 @@ extern "C" { extern int errno; #endif +/* Some Windows related defines */ +#undef _NC_WINDOWS +#if (defined(_WIN32) || defined(_WIN64)) +#define _NC_WINDOWS +#else +#undef EXP_WIN32_DRIVER +#endif + +#undef _NC_MINGW +#if (defined(__MINGW32__) || defined(__MINGW64__)) +#define _NC_MINGW +#endif + +#undef _NC_MSC +#ifdef _MSC_VER +#define _NC_MSC +#endif + /* Some systems have a broken 'select()', but workable 'poll()'. Use that */ #if HAVE_WORKING_POLL #define USE_FUNC_POLL 1 @@ -185,7 +199,7 @@ extern int errno; * the path separator in configure doesn't work properly. So, if building * for MinGW, we enforce the correct Windows PATH separator */ -#ifdef _WIN32 +#if defined(_NC_WINDOWS) # ifdef NCURSES_PATHSEP # undef NCURSES_PATHSEP # endif @@ -193,17 +207,6 @@ extern int errno; #endif /* - * If desired, one can configure this, disabling environment variables that - * point to custom terminfo/termcap locations. - */ -#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); -#endif - -/* * Not all platforms have memmove; some have an equivalent bcopy. (Some may * have neither). */ @@ -275,11 +278,20 @@ extern NCURSES_EXPORT(void *) _nc_memmove (void *, const void *, size_t); * Options for terminal drivers, etc... */ #ifdef USE_TERM_DRIVER +#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 +#define VALID_TERM_ENV(term_env, no_terminal) \ + (term_env = (NonEmpty(term_env) \ + ? term_env \ + : no_terminal), \ + NonEmpty(term_env)) + /* * 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 @@ -337,6 +349,10 @@ typedef TRIES { #include <curses.h> /* we'll use -Ipath directive to get the right one! */ +#if !(defined(NCURSES_WGETCH_EVENTS) && defined(NEED_KEY_EVENT)) +#undef KEY_EVENT /* reduce compiler-warnings with Visual C++ */ +#endif + typedef struct { int red, green, blue; /* what color_content() returns */ @@ -380,7 +396,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) @@ -783,12 +799,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> @@ -816,16 +826,6 @@ 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 - /* * When converting from terminfo to termcap, check for cases where we can trim * octal escapes down to 2-character form. It is useful for terminfo format @@ -837,46 +837,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. @@ -906,127 +866,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]; - -#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) \ @@ -1036,54 +877,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. */ @@ -1106,8 +899,7 @@ typedef enum { /* * 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 */ @@ -1334,7 +1126,7 @@ struct screen { int _sysmouse_new_buttons; #endif -#ifdef USE_TERM_DRIVER +#if defined(USE_TERM_DRIVER) || defined(EXP_WIN32_DRIVER) MEVENT _drv_mouse_fifo[FIFO_SIZE]; int _drv_mouse_head; int _drv_mouse_tail; @@ -1391,7 +1183,8 @@ struct screen { 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; @@ -1517,7 +1310,7 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch; #if USE_WIDEC_SUPPORT /* { */ #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 @@ -1551,14 +1344,14 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch; #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; \ @@ -1696,6 +1489,7 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch; #define FreeAndNull(p) do { free(p); p = 0; } while (0) #include <nc_alloc.h> +#include <nc_access.h> /* * Use these for tic/infocmp malloc failures. Generally the ncurses library @@ -1828,7 +1622,7 @@ extern NCURSES_EXPORT(SCREEN *) _nc_retrace_sp (SCREEN *); extern NCURSES_EXPORT(WINDOW *) _nc_retrace_win (WINDOW *); extern NCURSES_EXPORT(attr_t) _nc_retrace_attr_t (attr_t); extern NCURSES_EXPORT(char *) _nc_retrace_ptr (char *); -extern NCURSES_EXPORT(char *) _nc_trace_ttymode(TTY *tty); +extern NCURSES_EXPORT(char *) _nc_trace_ttymode(const TTY *tty); extern NCURSES_EXPORT(char *) _nc_varargs (const char *, va_list); extern NCURSES_EXPORT(chtype) _nc_retrace_chtype (chtype); extern NCURSES_EXPORT(const char *) _nc_altcharset_name(attr_t, chtype); @@ -2343,11 +2137,10 @@ extern NCURSES_EXPORT(int) _nc_eventlist_timeout(_nc_eventlist *); */ #if USE_WIDEC_SUPPORT -#if defined(_WIN32) +#if defined(_NC_WINDOWS) && !defined(_NC_MSC) && !defined(EXP_WIN32_DRIVER) /* * MinGW has wide-character functions, but they do not work correctly. */ - extern int __MINGW_NOTHROW _nc_wctomb(char *, wchar_t); #define wctomb(s,wc) _nc_wctomb(s,wc) #define wcrtomb(s,wc,n) _nc_wctomb(s,wc) @@ -2358,19 +2151,19 @@ extern int __MINGW_NOTHROW _nc_mbtowc(wchar_t *, const char *, size_t); extern int __MINGW_NOTHROW _nc_mblen(const char *, size_t); #define mblen(s,n) _nc_mblen(s, n) -#endif /* _WIN32 */ +#endif /* _NC_WINDOWS && !_NC_MSC */ #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 @@ -2419,7 +2212,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 @@ -2580,6 +2373,10 @@ extern NCURSES_EXPORT(int) TINFO_MVCUR(SCREEN*, int, int, int, int); #define TINFO_MVCUR NCURSES_SP_NAME(_nc_mvcur) #endif +#if defined(EXP_WIN32_DRIVER) +#include <nc_win32.h> +#endif + /* * Entrypoints using an extra parameter with the terminal driver. */ @@ -2602,6 +2399,9 @@ extern NCURSES_EXPORT(void) _nc_get_screensize(SCREEN *, int *, int *); _nc_setupterm(name, fd, err, reuse) #endif /* !USE_TERM_DRIVER */ +#ifdef EXP_WIN32_DRIVER +extern NCURSES_EXPORT_VAR(TERM_DRIVER) _nc_TINFO_DRIVER; +#else #ifdef USE_TERM_DRIVER #if defined(USE_WIN32CON_DRIVER) #include <nc_mingw.h> @@ -2619,9 +2419,12 @@ extern NCURSES_EXPORT(int) _nc_mingw_testmouse( #else #endif extern NCURSES_EXPORT_VAR(TERM_DRIVER) _nc_TINFO_DRIVER; -#endif +#endif /* USE_TERM_DRIVER */ +#endif /* EXP_WIN32_DRIVER */ -#if defined(USE_TERM_DRIVER) && defined(USE_WIN32CON_DRIVER) +#if defined(USE_TERM_DRIVER) && defined(EXP_WIN32_DRIVER) +#define NC_ISATTY(fd) (0 != _nc_console_isatty(fd)) +#elif defined(USE_TERM_DRIVER) && defined(USE_WIN32CON_DRIVER) #define NC_ISATTY(fd) _nc_mingw_isatty(fd) #else #define NC_ISATTY(fd) isatty(fd) @@ -2630,15 +2433,21 @@ extern NCURSES_EXPORT_VAR(TERM_DRIVER) _nc_TINFO_DRIVER; #ifdef USE_TERM_DRIVER # define IsTermInfo(sp) ((TCBOf(sp) != 0) && ((TCBOf(sp)->drv->isTerminfo))) # define HasTInfoTerminal(sp) ((0 != TerminalOf(sp)) && IsTermInfo(sp)) -# if defined(USE_WIN32CON_DRIVER) -# define IsTermInfoOnConsole(sp) (IsTermInfo(sp)&&_nc_mingw_isconsole(TerminalOf(sp)->Filedes)) -#else +# if defined(EXP_WIN32_DRIVER) +# 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)) +# else # define IsTermInfoOnConsole(sp) FALSE # endif #else # define IsTermInfo(sp) TRUE # define HasTInfoTerminal(sp) (0 != TerminalOf(sp)) -# define IsTermInfoOnConsole(sp) FALSE +# if defined(EXP_WIN32_DRIVER) +# define IsTermInfoOnConsole(sp) _nc_console_test(TerminalOf(sp)->Filedes) +# else +# define IsTermInfoOnConsole(sp) FALSE +# endif #endif #define IsValidTIScreen(sp) (HasTInfoTerminal(sp)) @@ -2686,7 +2495,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*); diff --git a/ncurses/llib-lncurses b/ncurses/llib-lncurses index 642c68d..c0adc1e 100644 --- a/ncurses/llib-lncurses +++ b/ncurses/llib-lncurses @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2019,2020 Thomas E. Dickey * + * Copyright 2019,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 * @@ -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); } @@ -452,831 +452,831 @@ int flash(void) /* ./lib_gen.c */ #undef addch -int (addch)( +int addch( const chtype z) { return(*(int *)0); } #undef addchnstr -int (addchnstr)( - const chtype *a1, +int addchnstr( + const chtype *a1, int z) { return(*(int *)0); } #undef addchstr -int (addchstr)( +int addchstr( const chtype *z) { return(*(int *)0); } #undef addnstr -int (addnstr)( - const char *a1, +int addnstr( + const char *a1, int z) { return(*(int *)0); } #undef addstr -int (addstr)( +int addstr( const char *z) { return(*(int *)0); } #undef attroff -int (attroff)( +int attroff( NCURSES_ATTR_T z) { return(*(int *)0); } #undef attron -int (attron)( +int attron( NCURSES_ATTR_T z) { return(*(int *)0); } #undef attrset -int (attrset)( +int attrset( NCURSES_ATTR_T z) { return(*(int *)0); } #undef attr_get -int (attr_get)( - attr_t *a1, - short *a2, +int attr_get( + attr_t *a1, + short *a2, void *z) { return(*(int *)0); } #undef attr_off -int (attr_off)( - attr_t a1, +int attr_off( + attr_t a1, void *z) { return(*(int *)0); } #undef attr_on -int (attr_on)( - attr_t a1, +int attr_on( + attr_t a1, void *z) { return(*(int *)0); } #undef attr_set -int (attr_set)( - attr_t a1, - short a2, +int attr_set( + attr_t a1, + short a2, void *z) { return(*(int *)0); } #undef bkgd -int (bkgd)( +int bkgd( chtype z) { return(*(int *)0); } #undef bkgdset -void (bkgdset)( +void bkgdset( chtype z) { /* void */ } #undef border -int (border)( - chtype a1, - chtype a2, - chtype a3, - chtype a4, - chtype a5, - chtype a6, - chtype a7, +int border( + chtype a1, + chtype a2, + chtype a3, + chtype a4, + chtype a5, + chtype a6, + chtype a7, chtype z) { return(*(int *)0); } #undef box -int (box)( - WINDOW *a1, - chtype a2, +int box( + WINDOW *a1, + chtype a2, chtype z) { return(*(int *)0); } #undef chgat -int (chgat)( - int a1, - attr_t a2, - short a3, +int chgat( + int a1, + attr_t a2, + short a3, const void *z) { return(*(int *)0); } #undef clear -int (clear)(void) +int clear(void) { return(*(int *)0); } #undef clrtobot -int (clrtobot)(void) +int clrtobot(void) { return(*(int *)0); } #undef clrtoeol -int (clrtoeol)(void) +int clrtoeol(void) { return(*(int *)0); } #undef color_set -int (color_set)( - short a1, +int color_set( + short a1, void *z) { return(*(int *)0); } #undef COLOR_PAIR -int (COLOR_PAIR)( +int COLOR_PAIR( int z) { return(*(int *)0); } #undef delch -int (delch)(void) +int delch(void) { return(*(int *)0); } #undef deleteln -int (deleteln)(void) +int deleteln(void) { return(*(int *)0); } #undef echochar -int (echochar)( +int echochar( const chtype z) { return(*(int *)0); } #undef erase -int (erase)(void) +int erase(void) { return(*(int *)0); } #undef getbkgd -chtype (getbkgd)( +chtype getbkgd( WINDOW *z) { return(*(chtype *)0); } #undef getch -int (getch)(void) +int getch(void) { return(*(int *)0); } #undef getnstr -int (getnstr)( - char *a1, +int getnstr( + char *a1, int z) { return(*(int *)0); } #undef getstr -int (getstr)( +int getstr( char *z) { return(*(int *)0); } #undef hline -int (hline)( - chtype a1, +int hline( + chtype a1, int z) { return(*(int *)0); } #undef inch -chtype (inch)(void) +chtype inch(void) { return(*(chtype *)0); } #undef inchnstr -int (inchnstr)( - chtype *a1, +int inchnstr( + chtype *a1, int z) { return(*(int *)0); } #undef inchstr -int (inchstr)( +int inchstr( chtype *z) { return(*(int *)0); } #undef innstr -int (innstr)( - char *a1, +int innstr( + char *a1, int z) { return(*(int *)0); } #undef insch -int (insch)( +int insch( chtype z) { return(*(int *)0); } #undef insdelln -int (insdelln)( +int insdelln( int z) { return(*(int *)0); } #undef insertln -int (insertln)(void) +int insertln(void) { return(*(int *)0); } #undef insnstr -int (insnstr)( - const char *a1, +int insnstr( + const char *a1, int z) { return(*(int *)0); } #undef insstr -int (insstr)( +int insstr( const char *z) { return(*(int *)0); } #undef instr -int (instr)( +int instr( char *z) { return(*(int *)0); } #undef move -int (move)( - int a1, +int move( + int a1, int z) { return(*(int *)0); } #undef mvaddch -int (mvaddch)( - int a1, - int a2, +int mvaddch( + int a1, + int a2, const chtype z) { return(*(int *)0); } #undef mvaddchnstr -int (mvaddchnstr)( - int a1, - int a2, - const chtype *a3, +int mvaddchnstr( + int a1, + int a2, + const chtype *a3, int z) { return(*(int *)0); } #undef mvaddchstr -int (mvaddchstr)( - int a1, - int a2, +int mvaddchstr( + int a1, + int a2, const chtype *z) { return(*(int *)0); } #undef mvaddnstr -int (mvaddnstr)( - int a1, - int a2, - const char *a3, +int mvaddnstr( + int a1, + int a2, + const char *a3, int z) { return(*(int *)0); } #undef mvaddstr -int (mvaddstr)( - int a1, - int a2, +int mvaddstr( + int a1, + int a2, const char *z) { return(*(int *)0); } #undef mvchgat -int (mvchgat)( - int a1, - int a2, - int a3, - attr_t a4, - short a5, +int mvchgat( + int a1, + int a2, + int a3, + attr_t a4, + short a5, const void *z) { return(*(int *)0); } #undef mvdelch -int (mvdelch)( - int a1, +int mvdelch( + int a1, int z) { return(*(int *)0); } #undef mvgetch -int (mvgetch)( - int a1, +int mvgetch( + int a1, int z) { return(*(int *)0); } #undef mvgetnstr -int (mvgetnstr)( - int a1, - int a2, - char *a3, +int mvgetnstr( + int a1, + int a2, + char *a3, int z) { return(*(int *)0); } #undef mvgetstr -int (mvgetstr)( - int a1, - int a2, +int mvgetstr( + int a1, + int a2, char *z) { return(*(int *)0); } #undef mvhline -int (mvhline)( - int a1, - int a2, - chtype a3, +int mvhline( + int a1, + int a2, + chtype a3, int z) { return(*(int *)0); } #undef mvinch -chtype (mvinch)( - int a1, +chtype mvinch( + int a1, int z) { return(*(chtype *)0); } #undef mvinchnstr -int (mvinchnstr)( - int a1, - int a2, - chtype *a3, +int mvinchnstr( + int a1, + int a2, + chtype *a3, int z) { return(*(int *)0); } #undef mvinchstr -int (mvinchstr)( - int a1, - int a2, +int mvinchstr( + int a1, + int a2, chtype *z) { return(*(int *)0); } #undef mvinnstr -int (mvinnstr)( - int a1, - int a2, - char *a3, +int mvinnstr( + int a1, + int a2, + char *a3, int z) { return(*(int *)0); } #undef mvinsch -int (mvinsch)( - int a1, - int a2, +int mvinsch( + int a1, + int a2, chtype z) { return(*(int *)0); } #undef mvinsnstr -int (mvinsnstr)( - int a1, - int a2, - const char *a3, +int mvinsnstr( + int a1, + int a2, + const char *a3, int z) { return(*(int *)0); } #undef mvinsstr -int (mvinsstr)( - int a1, - int a2, +int mvinsstr( + int a1, + int a2, const char *z) { return(*(int *)0); } #undef mvinstr -int (mvinstr)( - int a1, - int a2, +int mvinstr( + int a1, + int a2, char *z) { return(*(int *)0); } #undef mvvline -int (mvvline)( - int a1, - int a2, - chtype a3, +int mvvline( + int a1, + int a2, + chtype a3, int z) { return(*(int *)0); } #undef mvwaddch -int (mvwaddch)( - WINDOW *a1, - int a2, - int a3, +int mvwaddch( + WINDOW *a1, + int a2, + int a3, const chtype z) { return(*(int *)0); } #undef mvwaddchnstr -int (mvwaddchnstr)( - WINDOW *a1, - int a2, - int a3, - const chtype *a4, +int mvwaddchnstr( + WINDOW *a1, + int a2, + int a3, + const chtype *a4, int z) { return(*(int *)0); } #undef mvwaddchstr -int (mvwaddchstr)( - WINDOW *a1, - int a2, - int a3, +int mvwaddchstr( + WINDOW *a1, + int a2, + int a3, const chtype *z) { return(*(int *)0); } #undef mvwaddnstr -int (mvwaddnstr)( - WINDOW *a1, - int a2, - int a3, - const char *a4, +int mvwaddnstr( + WINDOW *a1, + int a2, + int a3, + const char *a4, int z) { return(*(int *)0); } #undef mvwaddstr -int (mvwaddstr)( - WINDOW *a1, - int a2, - int a3, +int mvwaddstr( + WINDOW *a1, + int a2, + int a3, const char *z) { return(*(int *)0); } #undef mvwchgat -int (mvwchgat)( - WINDOW *a1, - int a2, - int a3, - int a4, - attr_t a5, - short a6, +int mvwchgat( + WINDOW *a1, + int a2, + int a3, + int a4, + attr_t a5, + short a6, const void *z) { return(*(int *)0); } #undef mvwdelch -int (mvwdelch)( - WINDOW *a1, - int a2, +int mvwdelch( + WINDOW *a1, + int a2, int z) { return(*(int *)0); } #undef mvwgetch -int (mvwgetch)( - WINDOW *a1, - int a2, +int mvwgetch( + WINDOW *a1, + int a2, int z) { return(*(int *)0); } #undef mvwgetnstr -int (mvwgetnstr)( - WINDOW *a1, - int a2, - int a3, - char *a4, +int mvwgetnstr( + WINDOW *a1, + int a2, + int a3, + char *a4, int z) { return(*(int *)0); } #undef mvwgetstr -int (mvwgetstr)( - WINDOW *a1, - int a2, - int a3, +int mvwgetstr( + WINDOW *a1, + int a2, + int a3, char *z) { return(*(int *)0); } #undef mvwhline -int (mvwhline)( - WINDOW *a1, - int a2, - int a3, - chtype a4, +int mvwhline( + WINDOW *a1, + int a2, + int a3, + chtype a4, int z) { return(*(int *)0); } #undef mvwinch -chtype (mvwinch)( - WINDOW *a1, - int a2, +chtype mvwinch( + WINDOW *a1, + int a2, int z) { return(*(chtype *)0); } #undef mvwinchnstr -int (mvwinchnstr)( - WINDOW *a1, - int a2, - int a3, - chtype *a4, +int mvwinchnstr( + WINDOW *a1, + int a2, + int a3, + chtype *a4, int z) { return(*(int *)0); } #undef mvwinchstr -int (mvwinchstr)( - WINDOW *a1, - int a2, - int a3, +int mvwinchstr( + WINDOW *a1, + int a2, + int a3, chtype *z) { return(*(int *)0); } #undef mvwinnstr -int (mvwinnstr)( - WINDOW *a1, - int a2, - int a3, - char *a4, +int mvwinnstr( + WINDOW *a1, + int a2, + int a3, + char *a4, int z) { return(*(int *)0); } #undef mvwinsch -int (mvwinsch)( - WINDOW *a1, - int a2, - int a3, +int mvwinsch( + WINDOW *a1, + int a2, + int a3, chtype z) { return(*(int *)0); } #undef mvwinsnstr -int (mvwinsnstr)( - WINDOW *a1, - int a2, - int a3, - const char *a4, +int mvwinsnstr( + WINDOW *a1, + int a2, + int a3, + const char *a4, int z) { return(*(int *)0); } #undef mvwinsstr -int (mvwinsstr)( - WINDOW *a1, - int a2, - int a3, +int mvwinsstr( + WINDOW *a1, + int a2, + int a3, const char *z) { return(*(int *)0); } #undef mvwinstr -int (mvwinstr)( - WINDOW *a1, - int a2, - int a3, +int mvwinstr( + WINDOW *a1, + int a2, + int a3, char *z) { return(*(int *)0); } #undef mvwvline -int (mvwvline)( - WINDOW *a1, - int a2, - int a3, - chtype a4, +int mvwvline( + WINDOW *a1, + int a2, + int a3, + chtype a4, int z) { return(*(int *)0); } #undef PAIR_NUMBER -int (PAIR_NUMBER)( +int PAIR_NUMBER( int z) { return(*(int *)0); } #undef redrawwin -int (redrawwin)( +int redrawwin( WINDOW *z) { return(*(int *)0); } #undef refresh -int (refresh)(void) +int refresh(void) { return(*(int *)0); } #undef scrl -int (scrl)( +int scrl( int z) { return(*(int *)0); } #undef scroll -int (scroll)( +int scroll( WINDOW *z) { return(*(int *)0); } #undef setscrreg -int (setscrreg)( - int a1, +int setscrreg( + int a1, int z) { return(*(int *)0); } #undef standout -int (standout)(void) +int standout(void) { return(*(int *)0); } #undef standend -int (standend)(void) +int standend(void) { return(*(int *)0); } #undef timeout -void (timeout)( +void timeout( int z) { /* void */ } #undef touchline -int (touchline)( - WINDOW *a1, - int a2, +int touchline( + WINDOW *a1, + int a2, int z) { return(*(int *)0); } #undef touchwin -int (touchwin)( +int touchwin( WINDOW *z) { return(*(int *)0); } #undef untouchwin -int (untouchwin)( +int untouchwin( WINDOW *z) { return(*(int *)0); } #undef vline -int (vline)( - chtype a1, +int vline( + chtype a1, int z) { return(*(int *)0); } #undef waddchstr -int (waddchstr)( - WINDOW *a1, +int waddchstr( + WINDOW *a1, const chtype *z) { return(*(int *)0); } #undef waddstr -int (waddstr)( - WINDOW *a1, +int waddstr( + WINDOW *a1, const char *z) { return(*(int *)0); } #undef wattron -int (wattron)( - WINDOW *a1, +int wattron( + WINDOW *a1, int z) { return(*(int *)0); } #undef wattroff -int (wattroff)( - WINDOW *a1, +int wattroff( + WINDOW *a1, int z) { return(*(int *)0); } #undef wattrset -int (wattrset)( - WINDOW *a1, +int wattrset( + WINDOW *a1, int z) { return(*(int *)0); } #undef wattr_get -int (wattr_get)( - WINDOW *a1, - attr_t *a2, - short *a3, +int wattr_get( + WINDOW *a1, + attr_t *a2, + short *a3, void *z) { return(*(int *)0); } #undef wattr_set -int (wattr_set)( - WINDOW *a1, - attr_t a2, - short a3, +int wattr_set( + WINDOW *a1, + attr_t a2, + short a3, void *z) { return(*(int *)0); } #undef wdeleteln -int (wdeleteln)( +int wdeleteln( WINDOW *z) { return(*(int *)0); } #undef wgetstr -int (wgetstr)( - WINDOW *a1, +int wgetstr( + WINDOW *a1, char *z) { return(*(int *)0); } #undef winchstr -int (winchstr)( - WINDOW *a1, +int winchstr( + WINDOW *a1, chtype *z) { return(*(int *)0); } #undef winsertln -int (winsertln)( +int winsertln( WINDOW *z) { return(*(int *)0); } #undef winsstr -int (winsstr)( - WINDOW *a1, +int winsstr( + WINDOW *a1, const char *z) { return(*(int *)0); } #undef winstr -int (winstr)( - WINDOW *a1, +int winstr( + WINDOW *a1, char *z) { return(*(int *)0); } #undef wstandout -int (wstandout)( +int wstandout( WINDOW *z) { return(*(int *)0); } #undef wstandend -int (wstandend)( +int wstandend( WINDOW *z) { return(*(int *)0); } #undef getattrs -int (getattrs)( +int getattrs( const WINDOW *z) { return(*(int *)0); } #undef getcurx -int (getcurx)( +int getcurx( const WINDOW *z) { return(*(int *)0); } #undef getcury -int (getcury)( +int getcury( const WINDOW *z) { return(*(int *)0); } #undef getbegx -int (getbegx)( +int getbegx( const WINDOW *z) { return(*(int *)0); } #undef getbegy -int (getbegy)( +int getbegy( const WINDOW *z) { return(*(int *)0); } #undef getmaxx -int (getmaxx)( +int getmaxx( const WINDOW *z) { return(*(int *)0); } #undef getmaxy -int (getmaxy)( +int getmaxy( const WINDOW *z) { return(*(int *)0); } #undef getparx -int (getparx)( +int getparx( const WINDOW *z) { return(*(int *)0); } #undef getpary -int (getpary)( +int getpary( const WINDOW *z) { return(*(int *)0); } #undef wgetparent -WINDOW *(wgetparent)( +WINDOW *wgetparent( const WINDOW *z) { return(*(WINDOW **)0); } #undef is_cleared -NCURSES_BOOL (is_cleared)( +NCURSES_BOOL is_cleared( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_idcok -NCURSES_BOOL (is_idcok)( +NCURSES_BOOL is_idcok( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_idlok -NCURSES_BOOL (is_idlok)( +NCURSES_BOOL is_idlok( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_immedok -NCURSES_BOOL (is_immedok)( +NCURSES_BOOL is_immedok( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_keypad -NCURSES_BOOL (is_keypad)( +NCURSES_BOOL is_keypad( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_leaveok -NCURSES_BOOL (is_leaveok)( +NCURSES_BOOL is_leaveok( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_nodelay -NCURSES_BOOL (is_nodelay)( +NCURSES_BOOL is_nodelay( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_notimeout -NCURSES_BOOL (is_notimeout)( +NCURSES_BOOL is_notimeout( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_pad -NCURSES_BOOL (is_pad)( +NCURSES_BOOL is_pad( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_scrollok -NCURSES_BOOL (is_scrollok)( +NCURSES_BOOL is_scrollok( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_subwin -NCURSES_BOOL (is_subwin)( +NCURSES_BOOL is_subwin( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_syncok -NCURSES_BOOL (is_syncok)( +NCURSES_BOOL is_syncok( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef wgetdelay -int (wgetdelay)( +int wgetdelay( const WINDOW *z) { return(*(int *)0); } #undef wgetscrreg -int (wgetscrreg)( - const WINDOW *a1, - int *a2, +int wgetscrreg( + const WINDOW *a1, + int *a2, int *z) { return(*(int *)0); } #undef mouse_trafo -NCURSES_BOOL (mouse_trafo)( - int *a1, - int *a2, +NCURSES_BOOL mouse_trafo( + 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 */ @@ -3029,7 +3042,7 @@ int _nc_getenv_num( #undef _nc_setenv_num void _nc_setenv_num( - const char *name, + const char *name, int value) { /* void */ } @@ -3063,8 +3076,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 +3106,7 @@ TERMINAL *cur_term; #undef set_curterm_sp TERMINAL *set_curterm_sp( - SCREEN *sp, + SCREEN *sp, TERMINAL *termp) { return(*(TERMINAL **)0); } @@ -3104,7 +3117,7 @@ TERMINAL *set_curterm( #undef del_curterm_sp int del_curterm_sp( - SCREEN *sp, + SCREEN *sp, TERMINAL *termp) { return(*(int *)0); } @@ -3190,7 +3203,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 +3227,7 @@ char *longname(void) #undef napms_sp int napms_sp( - SCREEN *sp, + SCREEN *sp, int ms) { return(*(int *)0); } @@ -3227,19 +3240,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 +3263,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 +3304,7 @@ int curs_set( #undef typeahead_sp int typeahead_sp( - SCREEN *sp, + SCREEN *sp, int fd) { return(*(int *)0); } @@ -3302,7 +3315,7 @@ int typeahead( #undef has_key_sp int has_key_sp( - SCREEN *sp, + SCREEN *sp, int keycode) { return(*(int *)0); } @@ -3313,14 +3326,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,14 +3395,14 @@ 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); } @@ -3406,7 +3419,7 @@ int TABSIZE; #undef set_tabsize_sp int set_tabsize_sp( - SCREEN *sp, + SCREEN *sp, int value) { return(*(int *)0); } @@ -3422,13 +3435,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 +3457,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 +3469,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 +3494,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 +3506,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 +3520,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 +3544,7 @@ int tgetflag( #undef tgetnum_sp int tgetnum_sp( - SCREEN *sp, + SCREEN *sp, const char *id) { return(*(int *)0); } @@ -3542,14 +3555,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 +3581,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 +3590,7 @@ char *tgoto( #undef tigetflag_sp int tigetflag_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(int *)0); } @@ -3588,7 +3601,7 @@ int tigetflag( #undef tigetnum_sp int tigetnum_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(int *)0); } @@ -3599,7 +3612,7 @@ int tigetnum( #undef tigetstr_sp char *tigetstr_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(char **)0); } @@ -3615,23 +3628,36 @@ int _nc_tparm_err; #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 _nc_tiparm +char *_nc_tiparm( + 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 @@ -3648,7 +3674,7 @@ void _nc_set_no_padding( #undef delay_output_sp int delay_output_sp( - SCREEN *sp, + SCREEN *sp, int ms) { return(*(int *)0); } @@ -3668,7 +3694,7 @@ void _nc_flush(void) #undef _nc_outch_sp int _nc_outch_sp( - SCREEN *sp, + SCREEN *sp, int ch) { return(*(int *)0); } @@ -3679,7 +3705,7 @@ int _nc_outch( #undef _nc_putchar_sp int _nc_putchar_sp( - SCREEN *sp, + SCREEN *sp, int ch) { return(*(int *)0); } @@ -3690,7 +3716,7 @@ int _nc_putchar( #undef putp_sp int putp_sp( - SCREEN *sp, + SCREEN *sp, const char *string) { return(*(int *)0); } @@ -3701,35 +3727,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); } @@ -3755,7 +3781,7 @@ void trace( #undef _tracef void _tracef( - const char *fmt, + const char *fmt, ...) { /* void */ } @@ -3811,8 +3837,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); } @@ -3820,7 +3846,7 @@ char *_nc_fmt_funcptr( #undef _traceattr2 char *_traceattr2( - int bufnum, + int bufnum, chtype newmode) { return(*(char **)0); } @@ -3841,13 +3867,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); } @@ -3865,7 +3891,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 @@ -3876,7 +3902,7 @@ char *_nc_tracebits(void) #undef _nc_tracechar char *_nc_tracechar( - SCREEN *sp, + SCREEN *sp, int ch) { return(*(char **)0); } @@ -3889,7 +3915,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); } @@ -3900,7 +3926,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); } @@ -3967,9 +3993,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); } @@ -3982,8 +4008,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); } @@ -4006,14 +4032,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 */ } @@ -4021,67 +4047,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 *dst, string_desc *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); } @@ -4089,13 +4115,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); } @@ -4110,21 +4136,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); } @@ -4132,14 +4158,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); } @@ -4152,7 +4178,7 @@ const char *unctrl( #undef _nc_visbuf2 const char *_nc_visbuf2( - int bufnum, + int bufnum, const char *buf) { return(*(const char **)0); } @@ -4163,20 +4189,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); } @@ -4194,18 +4220,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 */ } @@ -4213,15 +4239,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); } @@ -4229,8 +4255,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); } @@ -4238,28 +4264,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); } @@ -4284,7 +4310,7 @@ NCURSES_BOOL _nc_disable_period; #undef _nc_reset_input void _nc_reset_input( - FILE *fp, + FILE *fp, char *buf) { /* void */ } @@ -4295,7 +4321,7 @@ int _nc_get_token( #undef _nc_trans_string int _nc_trans_string( - char *ptr, + char *ptr, char *last) { return(*(int *)0); } @@ -4313,14 +4339,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); } @@ -4333,14 +4359,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); } @@ -4352,14 +4378,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); } @@ -4373,7 +4399,7 @@ void _nc_hashed_db(void) #undef key_defined_sp int key_defined_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(int *)0); } @@ -4386,14 +4412,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); } @@ -4401,14 +4427,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 0fbde93..7c54b32 100644 --- a/ncurses/llib-lncursest +++ b/ncurses/llib-lncursest @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2019,2020 Thomas E. Dickey * + * Copyright 2019,2020,2021 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); } @@ -455,831 +455,831 @@ int flash(void) /* ./lib_gen.c */ #undef addch -int (addch)( +int addch( const chtype z) { return(*(int *)0); } #undef addchnstr -int (addchnstr)( - const chtype *a1, +int addchnstr( + const chtype *a1, int z) { return(*(int *)0); } #undef addchstr -int (addchstr)( +int addchstr( const chtype *z) { return(*(int *)0); } #undef addnstr -int (addnstr)( - const char *a1, +int addnstr( + const char *a1, int z) { return(*(int *)0); } #undef addstr -int (addstr)( +int addstr( const char *z) { return(*(int *)0); } #undef attroff -int (attroff)( +int attroff( NCURSES_ATTR_T z) { return(*(int *)0); } #undef attron -int (attron)( +int attron( NCURSES_ATTR_T z) { return(*(int *)0); } #undef attrset -int (attrset)( +int attrset( NCURSES_ATTR_T z) { return(*(int *)0); } #undef attr_get -int (attr_get)( - attr_t *a1, - short *a2, +int attr_get( + attr_t *a1, + short *a2, void *z) { return(*(int *)0); } #undef attr_off -int (attr_off)( - attr_t a1, +int attr_off( + attr_t a1, void *z) { return(*(int *)0); } #undef attr_on -int (attr_on)( - attr_t a1, +int attr_on( + attr_t a1, void *z) { return(*(int *)0); } #undef attr_set -int (attr_set)( - attr_t a1, - short a2, +int attr_set( + attr_t a1, + short a2, void *z) { return(*(int *)0); } #undef bkgd -int (bkgd)( +int bkgd( chtype z) { return(*(int *)0); } #undef bkgdset -void (bkgdset)( +void bkgdset( chtype z) { /* void */ } #undef border -int (border)( - chtype a1, - chtype a2, - chtype a3, - chtype a4, - chtype a5, - chtype a6, - chtype a7, +int border( + chtype a1, + chtype a2, + chtype a3, + chtype a4, + chtype a5, + chtype a6, + chtype a7, chtype z) { return(*(int *)0); } #undef box -int (box)( - WINDOW *a1, - chtype a2, +int box( + WINDOW *a1, + chtype a2, chtype z) { return(*(int *)0); } #undef chgat -int (chgat)( - int a1, - attr_t a2, - short a3, +int chgat( + int a1, + attr_t a2, + short a3, const void *z) { return(*(int *)0); } #undef clear -int (clear)(void) +int clear(void) { return(*(int *)0); } #undef clrtobot -int (clrtobot)(void) +int clrtobot(void) { return(*(int *)0); } #undef clrtoeol -int (clrtoeol)(void) +int clrtoeol(void) { return(*(int *)0); } #undef color_set -int (color_set)( - short a1, +int color_set( + short a1, void *z) { return(*(int *)0); } #undef COLOR_PAIR -int (COLOR_PAIR)( +int COLOR_PAIR( int z) { return(*(int *)0); } #undef delch -int (delch)(void) +int delch(void) { return(*(int *)0); } #undef deleteln -int (deleteln)(void) +int deleteln(void) { return(*(int *)0); } #undef echochar -int (echochar)( +int echochar( const chtype z) { return(*(int *)0); } #undef erase -int (erase)(void) +int erase(void) { return(*(int *)0); } #undef getbkgd -chtype (getbkgd)( +chtype getbkgd( WINDOW *z) { return(*(chtype *)0); } #undef getch -int (getch)(void) +int getch(void) { return(*(int *)0); } #undef getnstr -int (getnstr)( - char *a1, +int getnstr( + char *a1, int z) { return(*(int *)0); } #undef getstr -int (getstr)( +int getstr( char *z) { return(*(int *)0); } #undef hline -int (hline)( - chtype a1, +int hline( + chtype a1, int z) { return(*(int *)0); } #undef inch -chtype (inch)(void) +chtype inch(void) { return(*(chtype *)0); } #undef inchnstr -int (inchnstr)( - chtype *a1, +int inchnstr( + chtype *a1, int z) { return(*(int *)0); } #undef inchstr -int (inchstr)( +int inchstr( chtype *z) { return(*(int *)0); } #undef innstr -int (innstr)( - char *a1, +int innstr( + char *a1, int z) { return(*(int *)0); } #undef insch -int (insch)( +int insch( chtype z) { return(*(int *)0); } #undef insdelln -int (insdelln)( +int insdelln( int z) { return(*(int *)0); } #undef insertln -int (insertln)(void) +int insertln(void) { return(*(int *)0); } #undef insnstr -int (insnstr)( - const char *a1, +int insnstr( + const char *a1, int z) { return(*(int *)0); } #undef insstr -int (insstr)( +int insstr( const char *z) { return(*(int *)0); } #undef instr -int (instr)( +int instr( char *z) { return(*(int *)0); } #undef move -int (move)( - int a1, +int move( + int a1, int z) { return(*(int *)0); } #undef mvaddch -int (mvaddch)( - int a1, - int a2, +int mvaddch( + int a1, + int a2, const chtype z) { return(*(int *)0); } #undef mvaddchnstr -int (mvaddchnstr)( - int a1, - int a2, - const chtype *a3, +int mvaddchnstr( + int a1, + int a2, + const chtype *a3, int z) { return(*(int *)0); } #undef mvaddchstr -int (mvaddchstr)( - int a1, - int a2, +int mvaddchstr( + int a1, + int a2, const chtype *z) { return(*(int *)0); } #undef mvaddnstr -int (mvaddnstr)( - int a1, - int a2, - const char *a3, +int mvaddnstr( + int a1, + int a2, + const char *a3, int z) { return(*(int *)0); } #undef mvaddstr -int (mvaddstr)( - int a1, - int a2, +int mvaddstr( + int a1, + int a2, const char *z) { return(*(int *)0); } #undef mvchgat -int (mvchgat)( - int a1, - int a2, - int a3, - attr_t a4, - short a5, +int mvchgat( + int a1, + int a2, + int a3, + attr_t a4, + short a5, const void *z) { return(*(int *)0); } #undef mvdelch -int (mvdelch)( - int a1, +int mvdelch( + int a1, int z) { return(*(int *)0); } #undef mvgetch -int (mvgetch)( - int a1, +int mvgetch( + int a1, int z) { return(*(int *)0); } #undef mvgetnstr -int (mvgetnstr)( - int a1, - int a2, - char *a3, +int mvgetnstr( + int a1, + int a2, + char *a3, int z) { return(*(int *)0); } #undef mvgetstr -int (mvgetstr)( - int a1, - int a2, +int mvgetstr( + int a1, + int a2, char *z) { return(*(int *)0); } #undef mvhline -int (mvhline)( - int a1, - int a2, - chtype a3, +int mvhline( + int a1, + int a2, + chtype a3, int z) { return(*(int *)0); } #undef mvinch -chtype (mvinch)( - int a1, +chtype mvinch( + int a1, int z) { return(*(chtype *)0); } #undef mvinchnstr -int (mvinchnstr)( - int a1, - int a2, - chtype *a3, +int mvinchnstr( + int a1, + int a2, + chtype *a3, int z) { return(*(int *)0); } #undef mvinchstr -int (mvinchstr)( - int a1, - int a2, +int mvinchstr( + int a1, + int a2, chtype *z) { return(*(int *)0); } #undef mvinnstr -int (mvinnstr)( - int a1, - int a2, - char *a3, +int mvinnstr( + int a1, + int a2, + char *a3, int z) { return(*(int *)0); } #undef mvinsch -int (mvinsch)( - int a1, - int a2, +int mvinsch( + int a1, + int a2, chtype z) { return(*(int *)0); } #undef mvinsnstr -int (mvinsnstr)( - int a1, - int a2, - const char *a3, +int mvinsnstr( + int a1, + int a2, + const char *a3, int z) { return(*(int *)0); } #undef mvinsstr -int (mvinsstr)( - int a1, - int a2, +int mvinsstr( + int a1, + int a2, const char *z) { return(*(int *)0); } #undef mvinstr -int (mvinstr)( - int a1, - int a2, +int mvinstr( + int a1, + int a2, char *z) { return(*(int *)0); } #undef mvvline -int (mvvline)( - int a1, - int a2, - chtype a3, +int mvvline( + int a1, + int a2, + chtype a3, int z) { return(*(int *)0); } #undef mvwaddch -int (mvwaddch)( - WINDOW *a1, - int a2, - int a3, +int mvwaddch( + WINDOW *a1, + int a2, + int a3, const chtype z) { return(*(int *)0); } #undef mvwaddchnstr -int (mvwaddchnstr)( - WINDOW *a1, - int a2, - int a3, - const chtype *a4, +int mvwaddchnstr( + WINDOW *a1, + int a2, + int a3, + const chtype *a4, int z) { return(*(int *)0); } #undef mvwaddchstr -int (mvwaddchstr)( - WINDOW *a1, - int a2, - int a3, +int mvwaddchstr( + WINDOW *a1, + int a2, + int a3, const chtype *z) { return(*(int *)0); } #undef mvwaddnstr -int (mvwaddnstr)( - WINDOW *a1, - int a2, - int a3, - const char *a4, +int mvwaddnstr( + WINDOW *a1, + int a2, + int a3, + const char *a4, int z) { return(*(int *)0); } #undef mvwaddstr -int (mvwaddstr)( - WINDOW *a1, - int a2, - int a3, +int mvwaddstr( + WINDOW *a1, + int a2, + int a3, const char *z) { return(*(int *)0); } #undef mvwchgat -int (mvwchgat)( - WINDOW *a1, - int a2, - int a3, - int a4, - attr_t a5, - short a6, +int mvwchgat( + WINDOW *a1, + int a2, + int a3, + int a4, + attr_t a5, + short a6, const void *z) { return(*(int *)0); } #undef mvwdelch -int (mvwdelch)( - WINDOW *a1, - int a2, +int mvwdelch( + WINDOW *a1, + int a2, int z) { return(*(int *)0); } #undef mvwgetch -int (mvwgetch)( - WINDOW *a1, - int a2, +int mvwgetch( + WINDOW *a1, + int a2, int z) { return(*(int *)0); } #undef mvwgetnstr -int (mvwgetnstr)( - WINDOW *a1, - int a2, - int a3, - char *a4, +int mvwgetnstr( + WINDOW *a1, + int a2, + int a3, + char *a4, int z) { return(*(int *)0); } #undef mvwgetstr -int (mvwgetstr)( - WINDOW *a1, - int a2, - int a3, +int mvwgetstr( + WINDOW *a1, + int a2, + int a3, char *z) { return(*(int *)0); } #undef mvwhline -int (mvwhline)( - WINDOW *a1, - int a2, - int a3, - chtype a4, +int mvwhline( + WINDOW *a1, + int a2, + int a3, + chtype a4, int z) { return(*(int *)0); } #undef mvwinch -chtype (mvwinch)( - WINDOW *a1, - int a2, +chtype mvwinch( + WINDOW *a1, + int a2, int z) { return(*(chtype *)0); } #undef mvwinchnstr -int (mvwinchnstr)( - WINDOW *a1, - int a2, - int a3, - chtype *a4, +int mvwinchnstr( + WINDOW *a1, + int a2, + int a3, + chtype *a4, int z) { return(*(int *)0); } #undef mvwinchstr -int (mvwinchstr)( - WINDOW *a1, - int a2, - int a3, +int mvwinchstr( + WINDOW *a1, + int a2, + int a3, chtype *z) { return(*(int *)0); } #undef mvwinnstr -int (mvwinnstr)( - WINDOW *a1, - int a2, - int a3, - char *a4, +int mvwinnstr( + WINDOW *a1, + int a2, + int a3, + char *a4, int z) { return(*(int *)0); } #undef mvwinsch -int (mvwinsch)( - WINDOW *a1, - int a2, - int a3, +int mvwinsch( + WINDOW *a1, + int a2, + int a3, chtype z) { return(*(int *)0); } #undef mvwinsnstr -int (mvwinsnstr)( - WINDOW *a1, - int a2, - int a3, - const char *a4, +int mvwinsnstr( + WINDOW *a1, + int a2, + int a3, + const char *a4, int z) { return(*(int *)0); } #undef mvwinsstr -int (mvwinsstr)( - WINDOW *a1, - int a2, - int a3, +int mvwinsstr( + WINDOW *a1, + int a2, + int a3, const char *z) { return(*(int *)0); } #undef mvwinstr -int (mvwinstr)( - WINDOW *a1, - int a2, - int a3, +int mvwinstr( + WINDOW *a1, + int a2, + int a3, char *z) { return(*(int *)0); } #undef mvwvline -int (mvwvline)( - WINDOW *a1, - int a2, - int a3, - chtype a4, +int mvwvline( + WINDOW *a1, + int a2, + int a3, + chtype a4, int z) { return(*(int *)0); } #undef PAIR_NUMBER -int (PAIR_NUMBER)( +int PAIR_NUMBER( int z) { return(*(int *)0); } #undef redrawwin -int (redrawwin)( +int redrawwin( WINDOW *z) { return(*(int *)0); } #undef refresh -int (refresh)(void) +int refresh(void) { return(*(int *)0); } #undef scrl -int (scrl)( +int scrl( int z) { return(*(int *)0); } #undef scroll -int (scroll)( +int scroll( WINDOW *z) { return(*(int *)0); } #undef setscrreg -int (setscrreg)( - int a1, +int setscrreg( + int a1, int z) { return(*(int *)0); } #undef standout -int (standout)(void) +int standout(void) { return(*(int *)0); } #undef standend -int (standend)(void) +int standend(void) { return(*(int *)0); } #undef timeout -void (timeout)( +void timeout( int z) { /* void */ } #undef touchline -int (touchline)( - WINDOW *a1, - int a2, +int touchline( + WINDOW *a1, + int a2, int z) { return(*(int *)0); } #undef touchwin -int (touchwin)( +int touchwin( WINDOW *z) { return(*(int *)0); } #undef untouchwin -int (untouchwin)( +int untouchwin( WINDOW *z) { return(*(int *)0); } #undef vline -int (vline)( - chtype a1, +int vline( + chtype a1, int z) { return(*(int *)0); } #undef waddchstr -int (waddchstr)( - WINDOW *a1, +int waddchstr( + WINDOW *a1, const chtype *z) { return(*(int *)0); } #undef waddstr -int (waddstr)( - WINDOW *a1, +int waddstr( + WINDOW *a1, const char *z) { return(*(int *)0); } #undef wattron -int (wattron)( - WINDOW *a1, +int wattron( + WINDOW *a1, int z) { return(*(int *)0); } #undef wattroff -int (wattroff)( - WINDOW *a1, +int wattroff( + WINDOW *a1, int z) { return(*(int *)0); } #undef wattrset -int (wattrset)( - WINDOW *a1, +int wattrset( + WINDOW *a1, int z) { return(*(int *)0); } #undef wattr_get -int (wattr_get)( - WINDOW *a1, - attr_t *a2, - short *a3, +int wattr_get( + WINDOW *a1, + attr_t *a2, + short *a3, void *z) { return(*(int *)0); } #undef wattr_set -int (wattr_set)( - WINDOW *a1, - attr_t a2, - short a3, +int wattr_set( + WINDOW *a1, + attr_t a2, + short a3, void *z) { return(*(int *)0); } #undef wdeleteln -int (wdeleteln)( +int wdeleteln( WINDOW *z) { return(*(int *)0); } #undef wgetstr -int (wgetstr)( - WINDOW *a1, +int wgetstr( + WINDOW *a1, char *z) { return(*(int *)0); } #undef winchstr -int (winchstr)( - WINDOW *a1, +int winchstr( + WINDOW *a1, chtype *z) { return(*(int *)0); } #undef winsertln -int (winsertln)( +int winsertln( WINDOW *z) { return(*(int *)0); } #undef winsstr -int (winsstr)( - WINDOW *a1, +int winsstr( + WINDOW *a1, const char *z) { return(*(int *)0); } #undef winstr -int (winstr)( - WINDOW *a1, +int winstr( + WINDOW *a1, char *z) { return(*(int *)0); } #undef wstandout -int (wstandout)( +int wstandout( WINDOW *z) { return(*(int *)0); } #undef wstandend -int (wstandend)( +int wstandend( WINDOW *z) { return(*(int *)0); } #undef getattrs -int (getattrs)( +int getattrs( const WINDOW *z) { return(*(int *)0); } #undef getcurx -int (getcurx)( +int getcurx( const WINDOW *z) { return(*(int *)0); } #undef getcury -int (getcury)( +int getcury( const WINDOW *z) { return(*(int *)0); } #undef getbegx -int (getbegx)( +int getbegx( const WINDOW *z) { return(*(int *)0); } #undef getbegy -int (getbegy)( +int getbegy( const WINDOW *z) { return(*(int *)0); } #undef getmaxx -int (getmaxx)( +int getmaxx( const WINDOW *z) { return(*(int *)0); } #undef getmaxy -int (getmaxy)( +int getmaxy( const WINDOW *z) { return(*(int *)0); } #undef getparx -int (getparx)( +int getparx( const WINDOW *z) { return(*(int *)0); } #undef getpary -int (getpary)( +int getpary( const WINDOW *z) { return(*(int *)0); } #undef wgetparent -WINDOW *(wgetparent)( +WINDOW *wgetparent( const WINDOW *z) { return(*(WINDOW **)0); } #undef is_cleared -NCURSES_BOOL (is_cleared)( +NCURSES_BOOL is_cleared( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_idcok -NCURSES_BOOL (is_idcok)( +NCURSES_BOOL is_idcok( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_idlok -NCURSES_BOOL (is_idlok)( +NCURSES_BOOL is_idlok( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_immedok -NCURSES_BOOL (is_immedok)( +NCURSES_BOOL is_immedok( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_keypad -NCURSES_BOOL (is_keypad)( +NCURSES_BOOL is_keypad( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_leaveok -NCURSES_BOOL (is_leaveok)( +NCURSES_BOOL is_leaveok( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_nodelay -NCURSES_BOOL (is_nodelay)( +NCURSES_BOOL is_nodelay( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_notimeout -NCURSES_BOOL (is_notimeout)( +NCURSES_BOOL is_notimeout( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_pad -NCURSES_BOOL (is_pad)( +NCURSES_BOOL is_pad( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_scrollok -NCURSES_BOOL (is_scrollok)( +NCURSES_BOOL is_scrollok( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_subwin -NCURSES_BOOL (is_subwin)( +NCURSES_BOOL is_subwin( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_syncok -NCURSES_BOOL (is_syncok)( +NCURSES_BOOL is_syncok( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef wgetdelay -int (wgetdelay)( +int wgetdelay( const WINDOW *z) { return(*(int *)0); } #undef wgetscrreg -int (wgetscrreg)( - const WINDOW *a1, - int *a2, +int wgetscrreg( + const WINDOW *a1, + int *a2, int *z) { return(*(int *)0); } #undef mouse_trafo -NCURSES_BOOL (mouse_trafo)( - int *a1, - int *a2, +NCURSES_BOOL mouse_trafo( + 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 */ @@ -3043,7 +3056,7 @@ int _nc_getenv_num( #undef _nc_setenv_num void _nc_setenv_num( - const char *name, + const char *name, int value) { /* void */ } @@ -3078,8 +3091,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 +3131,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 +3142,7 @@ TERMINAL *set_curterm( #undef del_curterm_sp int del_curterm_sp( - SCREEN *sp, + SCREEN *sp, TERMINAL *termp) { return(*(int *)0); } @@ -3245,7 +3258,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 +3282,7 @@ char *longname(void) #undef napms_sp int napms_sp( - SCREEN *sp, + SCREEN *sp, int ms) { return(*(int *)0); } @@ -3282,19 +3295,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 +3318,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 +3359,7 @@ int curs_set( #undef typeahead_sp int typeahead_sp( - SCREEN *sp, + SCREEN *sp, int fd) { return(*(int *)0); } @@ -3357,7 +3370,7 @@ int typeahead( #undef has_key_sp int has_key_sp( - SCREEN *sp, + SCREEN *sp, int keycode) { return(*(int *)0); } @@ -3368,14 +3381,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,14 +3450,14 @@ 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); } @@ -3483,7 +3496,7 @@ int _nc_TABSIZE(void) #undef set_tabsize_sp int set_tabsize_sp( - SCREEN *sp, + SCREEN *sp, int value) { return(*(int *)0); } @@ -3499,13 +3512,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 +3534,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 +3546,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 +3571,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 +3591,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 +3605,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 +3629,7 @@ int tgetflag( #undef tgetnum_sp int tgetnum_sp( - SCREEN *sp, + SCREEN *sp, const char *id) { return(*(int *)0); } @@ -3627,14 +3640,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 +3666,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 +3675,7 @@ char *tgoto( #undef tigetflag_sp int tigetflag_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(int *)0); } @@ -3673,7 +3686,7 @@ int tigetflag( #undef tigetnum_sp int tigetnum_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(int *)0); } @@ -3684,7 +3697,7 @@ int tigetnum( #undef tigetstr_sp char *tigetstr_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(char **)0); } @@ -3700,23 +3713,36 @@ int _nc_tparm_err; #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 _nc_tiparm +char *_nc_tiparm( + 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 @@ -3733,7 +3759,7 @@ void _nc_set_no_padding( #undef delay_output_sp int delay_output_sp( - SCREEN *sp, + SCREEN *sp, int ms) { return(*(int *)0); } @@ -3753,7 +3779,7 @@ void _nc_flush(void) #undef _nc_outch_sp int _nc_outch_sp( - SCREEN *sp, + SCREEN *sp, int ch) { return(*(int *)0); } @@ -3764,7 +3790,7 @@ int _nc_outch( #undef _nc_putchar_sp int _nc_putchar_sp( - SCREEN *sp, + SCREEN *sp, int ch) { return(*(int *)0); } @@ -3775,7 +3801,7 @@ int _nc_putchar( #undef putp_sp int putp_sp( - SCREEN *sp, + SCREEN *sp, const char *string) { return(*(int *)0); } @@ -3786,35 +3812,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); } @@ -3854,7 +3880,7 @@ void trace( #undef _tracef void _tracef( - const char *fmt, + const char *fmt, ...) { /* void */ } @@ -3910,8 +3936,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); } @@ -3922,7 +3948,7 @@ int _nc_use_tracef( #undef _nc_locked_tracef void _nc_locked_tracef( - const char *fmt, + const char *fmt, ...) { /* void */ } @@ -3930,7 +3956,7 @@ void _nc_locked_tracef( #undef _traceattr2 char *_traceattr2( - int bufnum, + int bufnum, chtype newmode) { return(*(char **)0); } @@ -3951,13 +3977,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); } @@ -3975,7 +4001,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 @@ -3986,7 +4012,7 @@ char *_nc_tracebits(void) #undef _nc_tracechar char *_nc_tracechar( - SCREEN *sp, + SCREEN *sp, int ch) { return(*(char **)0); } @@ -3999,7 +4025,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); } @@ -4010,7 +4036,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); } @@ -4077,9 +4103,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); } @@ -4092,8 +4118,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); } @@ -4127,14 +4153,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 */ } @@ -4142,67 +4168,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 *dst, string_desc *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); } @@ -4210,13 +4236,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); } @@ -4231,21 +4257,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); } @@ -4253,14 +4279,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); } @@ -4273,7 +4299,7 @@ const char *unctrl( #undef _nc_visbuf2 const char *_nc_visbuf2( - int bufnum, + int bufnum, const char *buf) { return(*(const char **)0); } @@ -4284,20 +4310,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); } @@ -4315,18 +4341,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 */ } @@ -4334,15 +4360,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); } @@ -4350,8 +4376,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); } @@ -4359,28 +4385,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); } @@ -4405,7 +4431,7 @@ NCURSES_BOOL _nc_disable_period; #undef _nc_reset_input void _nc_reset_input( - FILE *fp, + FILE *fp, char *buf) { /* void */ } @@ -4416,7 +4442,7 @@ int _nc_get_token( #undef _nc_trans_string int _nc_trans_string( - char *ptr, + char *ptr, char *last) { return(*(int *)0); } @@ -4434,14 +4460,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); } @@ -4454,14 +4480,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); } @@ -4473,14 +4499,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); } @@ -4494,7 +4520,7 @@ void _nc_hashed_db(void) #undef key_defined_sp int key_defined_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(int *)0); } @@ -4507,14 +4533,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); } @@ -4522,14 +4548,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 0463139..d553e5c 100644 --- a/ncurses/llib-lncursestw +++ b/ncurses/llib-lncursestw @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2018-2019,2020 Thomas E. Dickey * + * Copyright 2018-2020,2021 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); } @@ -565,1302 +565,1302 @@ int flash(void) /* ./lib_gen.c */ #undef addch -int (addch)( +int addch( const chtype z) { return(*(int *)0); } #undef addchnstr -int (addchnstr)( - const chtype *a1, +int addchnstr( + const chtype *a1, int z) { return(*(int *)0); } #undef addchstr -int (addchstr)( +int addchstr( const chtype *z) { return(*(int *)0); } #undef addnstr -int (addnstr)( - const char *a1, +int addnstr( + const char *a1, int z) { return(*(int *)0); } #undef addstr -int (addstr)( +int addstr( const char *z) { return(*(int *)0); } #undef attroff -int (attroff)( +int attroff( NCURSES_ATTR_T z) { return(*(int *)0); } #undef attron -int (attron)( +int attron( NCURSES_ATTR_T z) { return(*(int *)0); } #undef attrset -int (attrset)( +int attrset( NCURSES_ATTR_T z) { return(*(int *)0); } #undef attr_get -int (attr_get)( - attr_t *a1, - short *a2, +int attr_get( + attr_t *a1, + short *a2, void *z) { return(*(int *)0); } #undef attr_off -int (attr_off)( - attr_t a1, +int attr_off( + attr_t a1, void *z) { return(*(int *)0); } #undef attr_on -int (attr_on)( - attr_t a1, +int attr_on( + attr_t a1, void *z) { return(*(int *)0); } #undef attr_set -int (attr_set)( - attr_t a1, - short a2, +int attr_set( + attr_t a1, + short a2, void *z) { return(*(int *)0); } #undef bkgd -int (bkgd)( +int bkgd( chtype z) { return(*(int *)0); } #undef bkgdset -void (bkgdset)( +void bkgdset( chtype z) { /* void */ } #undef border -int (border)( - chtype a1, - chtype a2, - chtype a3, - chtype a4, - chtype a5, - chtype a6, - chtype a7, +int border( + chtype a1, + chtype a2, + chtype a3, + chtype a4, + chtype a5, + chtype a6, + chtype a7, chtype z) { return(*(int *)0); } #undef box -int (box)( - WINDOW *a1, - chtype a2, +int box( + WINDOW *a1, + chtype a2, chtype z) { return(*(int *)0); } #undef chgat -int (chgat)( - int a1, - attr_t a2, - short a3, +int chgat( + int a1, + attr_t a2, + short a3, const void *z) { return(*(int *)0); } #undef clear -int (clear)(void) +int clear(void) { return(*(int *)0); } #undef clrtobot -int (clrtobot)(void) +int clrtobot(void) { return(*(int *)0); } #undef clrtoeol -int (clrtoeol)(void) +int clrtoeol(void) { return(*(int *)0); } #undef color_set -int (color_set)( - short a1, +int color_set( + short a1, void *z) { return(*(int *)0); } #undef COLOR_PAIR -int (COLOR_PAIR)( +int COLOR_PAIR( int z) { return(*(int *)0); } #undef delch -int (delch)(void) +int delch(void) { return(*(int *)0); } #undef deleteln -int (deleteln)(void) +int deleteln(void) { return(*(int *)0); } #undef echochar -int (echochar)( +int echochar( const chtype z) { return(*(int *)0); } #undef erase -int (erase)(void) +int erase(void) { return(*(int *)0); } #undef getbkgd -chtype (getbkgd)( +chtype getbkgd( WINDOW *z) { return(*(chtype *)0); } #undef getch -int (getch)(void) +int getch(void) { return(*(int *)0); } #undef getnstr -int (getnstr)( - char *a1, +int getnstr( + char *a1, int z) { return(*(int *)0); } #undef getstr -int (getstr)( +int getstr( char *z) { return(*(int *)0); } #undef hline -int (hline)( - chtype a1, +int hline( + chtype a1, int z) { return(*(int *)0); } #undef inch -chtype (inch)(void) +chtype inch(void) { return(*(chtype *)0); } #undef inchnstr -int (inchnstr)( - chtype *a1, +int inchnstr( + chtype *a1, int z) { return(*(int *)0); } #undef inchstr -int (inchstr)( +int inchstr( chtype *z) { return(*(int *)0); } #undef innstr -int (innstr)( - char *a1, +int innstr( + char *a1, int z) { return(*(int *)0); } #undef insch -int (insch)( +int insch( chtype z) { return(*(int *)0); } #undef insdelln -int (insdelln)( +int insdelln( int z) { return(*(int *)0); } #undef insertln -int (insertln)(void) +int insertln(void) { return(*(int *)0); } #undef insnstr -int (insnstr)( - const char *a1, +int insnstr( + const char *a1, int z) { return(*(int *)0); } #undef insstr -int (insstr)( +int insstr( const char *z) { return(*(int *)0); } #undef instr -int (instr)( +int instr( char *z) { return(*(int *)0); } #undef move -int (move)( - int a1, +int move( + int a1, int z) { return(*(int *)0); } #undef mvaddch -int (mvaddch)( - int a1, - int a2, +int mvaddch( + int a1, + int a2, const chtype z) { return(*(int *)0); } #undef mvaddchnstr -int (mvaddchnstr)( - int a1, - int a2, - const chtype *a3, +int mvaddchnstr( + int a1, + int a2, + const chtype *a3, int z) { return(*(int *)0); } #undef mvaddchstr -int (mvaddchstr)( - int a1, - int a2, +int mvaddchstr( + int a1, + int a2, const chtype *z) { return(*(int *)0); } #undef mvaddnstr -int (mvaddnstr)( - int a1, - int a2, - const char *a3, +int mvaddnstr( + int a1, + int a2, + const char *a3, int z) { return(*(int *)0); } #undef mvaddstr -int (mvaddstr)( - int a1, - int a2, +int mvaddstr( + int a1, + int a2, const char *z) { return(*(int *)0); } #undef mvchgat -int (mvchgat)( - int a1, - int a2, - int a3, - attr_t a4, - short a5, +int mvchgat( + int a1, + int a2, + int a3, + attr_t a4, + short a5, const void *z) { return(*(int *)0); } #undef mvdelch -int (mvdelch)( - int a1, +int mvdelch( + int a1, int z) { return(*(int *)0); } #undef mvgetch -int (mvgetch)( - int a1, +int mvgetch( + int a1, int z) { return(*(int *)0); } #undef mvgetnstr -int (mvgetnstr)( - int a1, - int a2, - char *a3, +int mvgetnstr( + int a1, + int a2, + char *a3, int z) { return(*(int *)0); } #undef mvgetstr -int (mvgetstr)( - int a1, - int a2, +int mvgetstr( + int a1, + int a2, char *z) { return(*(int *)0); } #undef mvhline -int (mvhline)( - int a1, - int a2, - chtype a3, +int mvhline( + int a1, + int a2, + chtype a3, int z) { return(*(int *)0); } #undef mvinch -chtype (mvinch)( - int a1, +chtype mvinch( + int a1, int z) { return(*(chtype *)0); } #undef mvinchnstr -int (mvinchnstr)( - int a1, - int a2, - chtype *a3, +int mvinchnstr( + int a1, + int a2, + chtype *a3, int z) { return(*(int *)0); } #undef mvinchstr -int (mvinchstr)( - int a1, - int a2, +int mvinchstr( + int a1, + int a2, chtype *z) { return(*(int *)0); } #undef mvinnstr -int (mvinnstr)( - int a1, - int a2, - char *a3, +int mvinnstr( + int a1, + int a2, + char *a3, int z) { return(*(int *)0); } #undef mvinsch -int (mvinsch)( - int a1, - int a2, +int mvinsch( + int a1, + int a2, chtype z) { return(*(int *)0); } #undef mvinsnstr -int (mvinsnstr)( - int a1, - int a2, - const char *a3, +int mvinsnstr( + int a1, + int a2, + const char *a3, int z) { return(*(int *)0); } #undef mvinsstr -int (mvinsstr)( - int a1, - int a2, +int mvinsstr( + int a1, + int a2, const char *z) { return(*(int *)0); } #undef mvinstr -int (mvinstr)( - int a1, - int a2, +int mvinstr( + int a1, + int a2, char *z) { return(*(int *)0); } #undef mvvline -int (mvvline)( - int a1, - int a2, - chtype a3, +int mvvline( + int a1, + int a2, + chtype a3, int z) { return(*(int *)0); } #undef mvwaddch -int (mvwaddch)( - WINDOW *a1, - int a2, - int a3, +int mvwaddch( + WINDOW *a1, + int a2, + int a3, const chtype z) { return(*(int *)0); } #undef mvwaddchnstr -int (mvwaddchnstr)( - WINDOW *a1, - int a2, - int a3, - const chtype *a4, +int mvwaddchnstr( + WINDOW *a1, + int a2, + int a3, + const chtype *a4, int z) { return(*(int *)0); } #undef mvwaddchstr -int (mvwaddchstr)( - WINDOW *a1, - int a2, - int a3, +int mvwaddchstr( + WINDOW *a1, + int a2, + int a3, const chtype *z) { return(*(int *)0); } #undef mvwaddnstr -int (mvwaddnstr)( - WINDOW *a1, - int a2, - int a3, - const char *a4, +int mvwaddnstr( + WINDOW *a1, + int a2, + int a3, + const char *a4, int z) { return(*(int *)0); } #undef mvwaddstr -int (mvwaddstr)( - WINDOW *a1, - int a2, - int a3, +int mvwaddstr( + WINDOW *a1, + int a2, + int a3, const char *z) { return(*(int *)0); } #undef mvwchgat -int (mvwchgat)( - WINDOW *a1, - int a2, - int a3, - int a4, - attr_t a5, - short a6, +int mvwchgat( + WINDOW *a1, + int a2, + int a3, + int a4, + attr_t a5, + short a6, const void *z) { return(*(int *)0); } #undef mvwdelch -int (mvwdelch)( - WINDOW *a1, - int a2, +int mvwdelch( + WINDOW *a1, + int a2, int z) { return(*(int *)0); } #undef mvwgetch -int (mvwgetch)( - WINDOW *a1, - int a2, +int mvwgetch( + WINDOW *a1, + int a2, int z) { return(*(int *)0); } #undef mvwgetnstr -int (mvwgetnstr)( - WINDOW *a1, - int a2, - int a3, - char *a4, +int mvwgetnstr( + WINDOW *a1, + int a2, + int a3, + char *a4, int z) { return(*(int *)0); } #undef mvwgetstr -int (mvwgetstr)( - WINDOW *a1, - int a2, - int a3, +int mvwgetstr( + WINDOW *a1, + int a2, + int a3, char *z) { return(*(int *)0); } #undef mvwhline -int (mvwhline)( - WINDOW *a1, - int a2, - int a3, - chtype a4, +int mvwhline( + WINDOW *a1, + int a2, + int a3, + chtype a4, int z) { return(*(int *)0); } #undef mvwinch -chtype (mvwinch)( - WINDOW *a1, - int a2, +chtype mvwinch( + WINDOW *a1, + int a2, int z) { return(*(chtype *)0); } #undef mvwinchnstr -int (mvwinchnstr)( - WINDOW *a1, - int a2, - int a3, - chtype *a4, +int mvwinchnstr( + WINDOW *a1, + int a2, + int a3, + chtype *a4, int z) { return(*(int *)0); } #undef mvwinchstr -int (mvwinchstr)( - WINDOW *a1, - int a2, - int a3, +int mvwinchstr( + WINDOW *a1, + int a2, + int a3, chtype *z) { return(*(int *)0); } #undef mvwinnstr -int (mvwinnstr)( - WINDOW *a1, - int a2, - int a3, - char *a4, +int mvwinnstr( + WINDOW *a1, + int a2, + int a3, + char *a4, int z) { return(*(int *)0); } #undef mvwinsch -int (mvwinsch)( - WINDOW *a1, - int a2, - int a3, +int mvwinsch( + WINDOW *a1, + int a2, + int a3, chtype z) { return(*(int *)0); } #undef mvwinsnstr -int (mvwinsnstr)( - WINDOW *a1, - int a2, - int a3, - const char *a4, +int mvwinsnstr( + WINDOW *a1, + int a2, + int a3, + const char *a4, int z) { return(*(int *)0); } #undef mvwinsstr -int (mvwinsstr)( - WINDOW *a1, - int a2, - int a3, +int mvwinsstr( + WINDOW *a1, + int a2, + int a3, const char *z) { return(*(int *)0); } #undef mvwinstr -int (mvwinstr)( - WINDOW *a1, - int a2, - int a3, +int mvwinstr( + WINDOW *a1, + int a2, + int a3, char *z) { return(*(int *)0); } #undef mvwvline -int (mvwvline)( - WINDOW *a1, - int a2, - int a3, - chtype a4, +int mvwvline( + WINDOW *a1, + int a2, + int a3, + chtype a4, int z) { return(*(int *)0); } #undef PAIR_NUMBER -int (PAIR_NUMBER)( +int PAIR_NUMBER( int z) { return(*(int *)0); } #undef redrawwin -int (redrawwin)( +int redrawwin( WINDOW *z) { return(*(int *)0); } #undef refresh -int (refresh)(void) +int refresh(void) { return(*(int *)0); } #undef scrl -int (scrl)( +int scrl( int z) { return(*(int *)0); } #undef scroll -int (scroll)( +int scroll( WINDOW *z) { return(*(int *)0); } #undef setscrreg -int (setscrreg)( - int a1, +int setscrreg( + int a1, int z) { return(*(int *)0); } #undef slk_attr_off -int (slk_attr_off)( - const attr_t a1, +int slk_attr_off( + const attr_t a1, void *z) { return(*(int *)0); } #undef slk_attr_on -int (slk_attr_on)( - attr_t a1, +int slk_attr_on( + attr_t a1, void *z) { return(*(int *)0); } #undef standout -int (standout)(void) +int standout(void) { return(*(int *)0); } #undef standend -int (standend)(void) +int standend(void) { return(*(int *)0); } #undef timeout -void (timeout)( +void timeout( int z) { /* void */ } #undef touchline -int (touchline)( - WINDOW *a1, - int a2, +int touchline( + WINDOW *a1, + int a2, int z) { return(*(int *)0); } #undef touchwin -int (touchwin)( +int touchwin( WINDOW *z) { return(*(int *)0); } #undef untouchwin -int (untouchwin)( +int untouchwin( WINDOW *z) { return(*(int *)0); } #undef vline -int (vline)( - chtype a1, +int vline( + chtype a1, int z) { return(*(int *)0); } #undef waddchstr -int (waddchstr)( - WINDOW *a1, +int waddchstr( + WINDOW *a1, const chtype *z) { return(*(int *)0); } #undef waddstr -int (waddstr)( - WINDOW *a1, +int waddstr( + WINDOW *a1, const char *z) { return(*(int *)0); } #undef wattron -int (wattron)( - WINDOW *a1, +int wattron( + WINDOW *a1, int z) { return(*(int *)0); } #undef wattroff -int (wattroff)( - WINDOW *a1, +int wattroff( + WINDOW *a1, int z) { return(*(int *)0); } #undef wattrset -int (wattrset)( - WINDOW *a1, +int wattrset( + WINDOW *a1, int z) { return(*(int *)0); } #undef wattr_get -int (wattr_get)( - WINDOW *a1, - attr_t *a2, - short *a3, +int wattr_get( + WINDOW *a1, + attr_t *a2, + short *a3, void *z) { return(*(int *)0); } #undef wattr_set -int (wattr_set)( - WINDOW *a1, - attr_t a2, - short a3, +int wattr_set( + WINDOW *a1, + attr_t a2, + short a3, void *z) { return(*(int *)0); } #undef wdeleteln -int (wdeleteln)( +int wdeleteln( WINDOW *z) { return(*(int *)0); } #undef wgetstr -int (wgetstr)( - WINDOW *a1, +int wgetstr( + WINDOW *a1, char *z) { return(*(int *)0); } #undef winchstr -int (winchstr)( - WINDOW *a1, +int winchstr( + WINDOW *a1, chtype *z) { return(*(int *)0); } #undef winsertln -int (winsertln)( +int winsertln( WINDOW *z) { return(*(int *)0); } #undef winsstr -int (winsstr)( - WINDOW *a1, +int winsstr( + WINDOW *a1, const char *z) { return(*(int *)0); } #undef winstr -int (winstr)( - WINDOW *a1, +int winstr( + WINDOW *a1, char *z) { return(*(int *)0); } #undef wstandout -int (wstandout)( +int wstandout( WINDOW *z) { return(*(int *)0); } #undef wstandend -int (wstandend)( +int wstandend( WINDOW *z) { return(*(int *)0); } #undef getattrs -int (getattrs)( +int getattrs( const WINDOW *z) { return(*(int *)0); } #undef getcurx -int (getcurx)( +int getcurx( const WINDOW *z) { return(*(int *)0); } #undef getcury -int (getcury)( +int getcury( const WINDOW *z) { return(*(int *)0); } #undef getbegx -int (getbegx)( +int getbegx( const WINDOW *z) { return(*(int *)0); } #undef getbegy -int (getbegy)( +int getbegy( const WINDOW *z) { return(*(int *)0); } #undef getmaxx -int (getmaxx)( +int getmaxx( const WINDOW *z) { return(*(int *)0); } #undef getmaxy -int (getmaxy)( +int getmaxy( const WINDOW *z) { return(*(int *)0); } #undef getparx -int (getparx)( +int getparx( const WINDOW *z) { return(*(int *)0); } #undef getpary -int (getpary)( +int getpary( const WINDOW *z) { return(*(int *)0); } #undef wgetparent -WINDOW *(wgetparent)( +WINDOW *wgetparent( const WINDOW *z) { return(*(WINDOW **)0); } #undef is_cleared -NCURSES_BOOL (is_cleared)( +NCURSES_BOOL is_cleared( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_idcok -NCURSES_BOOL (is_idcok)( +NCURSES_BOOL is_idcok( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_idlok -NCURSES_BOOL (is_idlok)( +NCURSES_BOOL is_idlok( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_immedok -NCURSES_BOOL (is_immedok)( +NCURSES_BOOL is_immedok( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_keypad -NCURSES_BOOL (is_keypad)( +NCURSES_BOOL is_keypad( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_leaveok -NCURSES_BOOL (is_leaveok)( +NCURSES_BOOL is_leaveok( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_nodelay -NCURSES_BOOL (is_nodelay)( +NCURSES_BOOL is_nodelay( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_notimeout -NCURSES_BOOL (is_notimeout)( +NCURSES_BOOL is_notimeout( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_pad -NCURSES_BOOL (is_pad)( +NCURSES_BOOL is_pad( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_scrollok -NCURSES_BOOL (is_scrollok)( +NCURSES_BOOL is_scrollok( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_subwin -NCURSES_BOOL (is_subwin)( +NCURSES_BOOL is_subwin( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_syncok -NCURSES_BOOL (is_syncok)( +NCURSES_BOOL is_syncok( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef wgetdelay -int (wgetdelay)( +int wgetdelay( const WINDOW *z) { return(*(int *)0); } #undef wgetscrreg -int (wgetscrreg)( - const WINDOW *a1, - int *a2, +int wgetscrreg( + const WINDOW *a1, + int *a2, int *z) { return(*(int *)0); } #undef add_wch -int (add_wch)( +int add_wch( const cchar_t *z) { return(*(int *)0); } #undef add_wchnstr -int (add_wchnstr)( - const cchar_t *a1, +int add_wchnstr( + const cchar_t *a1, int z) { return(*(int *)0); } #undef add_wchstr -int (add_wchstr)( +int add_wchstr( const cchar_t *z) { return(*(int *)0); } #undef addnwstr -int (addnwstr)( - const wchar_t *a1, +int addnwstr( + const wchar_t *a1, int z) { return(*(int *)0); } #undef addwstr -int (addwstr)( +int addwstr( const wchar_t *z) { return(*(int *)0); } #undef bkgrnd -int (bkgrnd)( +int bkgrnd( const cchar_t *z) { return(*(int *)0); } #undef bkgrndset -void (bkgrndset)( +void bkgrndset( const cchar_t *z) { /* void */ } #undef border_set -int (border_set)( - const cchar_t *a1, - const cchar_t *a2, - const cchar_t *a3, - const cchar_t *a4, - const cchar_t *a5, - const cchar_t *a6, - const cchar_t *a7, +int border_set( + const cchar_t *a1, + const cchar_t *a2, + const cchar_t *a3, + const cchar_t *a4, + const cchar_t *a5, + const cchar_t *a6, + const cchar_t *a7, const cchar_t *z) { return(*(int *)0); } #undef box_set -int (box_set)( - WINDOW *a1, - const cchar_t *a2, +int box_set( + WINDOW *a1, + const cchar_t *a2, const cchar_t *z) { return(*(int *)0); } #undef echo_wchar -int (echo_wchar)( +int echo_wchar( const cchar_t *z) { return(*(int *)0); } #undef get_wch -int (get_wch)( +int get_wch( wint_t *z) { return(*(int *)0); } #undef get_wstr -int (get_wstr)( +int get_wstr( wint_t *z) { return(*(int *)0); } #undef getbkgrnd -int (getbkgrnd)( +int getbkgrnd( cchar_t *z) { return(*(int *)0); } #undef getn_wstr -int (getn_wstr)( - wint_t *a1, +int getn_wstr( + wint_t *a1, int z) { return(*(int *)0); } #undef hline_set -int (hline_set)( - const cchar_t *a1, +int hline_set( + const cchar_t *a1, int z) { return(*(int *)0); } #undef in_wch -int (in_wch)( +int in_wch( cchar_t *z) { return(*(int *)0); } #undef in_wchnstr -int (in_wchnstr)( - cchar_t *a1, +int in_wchnstr( + cchar_t *a1, int z) { return(*(int *)0); } #undef in_wchstr -int (in_wchstr)( +int in_wchstr( cchar_t *z) { return(*(int *)0); } #undef innwstr -int (innwstr)( - wchar_t *a1, +int innwstr( + wchar_t *a1, int z) { return(*(int *)0); } #undef ins_nwstr -int (ins_nwstr)( - const wchar_t *a1, +int ins_nwstr( + const wchar_t *a1, int z) { return(*(int *)0); } #undef ins_wch -int (ins_wch)( +int ins_wch( const cchar_t *z) { return(*(int *)0); } #undef ins_wstr -int (ins_wstr)( +int ins_wstr( const wchar_t *z) { return(*(int *)0); } #undef inwstr -int (inwstr)( +int inwstr( wchar_t *z) { return(*(int *)0); } #undef mvadd_wch -int (mvadd_wch)( - int a1, - int a2, +int mvadd_wch( + int a1, + int a2, const cchar_t *z) { return(*(int *)0); } #undef mvadd_wchnstr -int (mvadd_wchnstr)( - int a1, - int a2, - const cchar_t *a3, +int mvadd_wchnstr( + int a1, + int a2, + const cchar_t *a3, int z) { return(*(int *)0); } #undef mvadd_wchstr -int (mvadd_wchstr)( - int a1, - int a2, +int mvadd_wchstr( + int a1, + int a2, const cchar_t *z) { return(*(int *)0); } #undef mvaddnwstr -int (mvaddnwstr)( - int a1, - int a2, - const wchar_t *a3, +int mvaddnwstr( + int a1, + int a2, + const wchar_t *a3, int z) { return(*(int *)0); } #undef mvaddwstr -int (mvaddwstr)( - int a1, - int a2, +int mvaddwstr( + int a1, + int a2, const wchar_t *z) { return(*(int *)0); } #undef mvget_wch -int (mvget_wch)( - int a1, - int a2, +int mvget_wch( + int a1, + int a2, wint_t *z) { return(*(int *)0); } #undef mvget_wstr -int (mvget_wstr)( - int a1, - int a2, +int mvget_wstr( + int a1, + int a2, wint_t *z) { return(*(int *)0); } #undef mvgetn_wstr -int (mvgetn_wstr)( - int a1, - int a2, - wint_t *a3, +int mvgetn_wstr( + int a1, + int a2, + wint_t *a3, int z) { return(*(int *)0); } #undef mvhline_set -int (mvhline_set)( - int a1, - int a2, - const cchar_t *a3, +int mvhline_set( + int a1, + int a2, + const cchar_t *a3, int z) { return(*(int *)0); } #undef mvin_wch -int (mvin_wch)( - int a1, - int a2, +int mvin_wch( + int a1, + int a2, cchar_t *z) { return(*(int *)0); } #undef mvin_wchnstr -int (mvin_wchnstr)( - int a1, - int a2, - cchar_t *a3, +int mvin_wchnstr( + int a1, + int a2, + cchar_t *a3, int z) { return(*(int *)0); } #undef mvin_wchstr -int (mvin_wchstr)( - int a1, - int a2, +int mvin_wchstr( + int a1, + int a2, cchar_t *z) { return(*(int *)0); } #undef mvinnwstr -int (mvinnwstr)( - int a1, - int a2, - wchar_t *a3, +int mvinnwstr( + int a1, + int a2, + wchar_t *a3, int z) { return(*(int *)0); } #undef mvins_nwstr -int (mvins_nwstr)( - int a1, - int a2, - const wchar_t *a3, +int mvins_nwstr( + int a1, + int a2, + const wchar_t *a3, int z) { return(*(int *)0); } #undef mvins_wch -int (mvins_wch)( - int a1, - int a2, +int mvins_wch( + int a1, + int a2, const cchar_t *z) { return(*(int *)0); } #undef mvins_wstr -int (mvins_wstr)( - int a1, - int a2, +int mvins_wstr( + int a1, + int a2, const wchar_t *z) { return(*(int *)0); } #undef mvinwstr -int (mvinwstr)( - int a1, - int a2, +int mvinwstr( + int a1, + int a2, wchar_t *z) { return(*(int *)0); } #undef mvvline_set -int (mvvline_set)( - int a1, - int a2, - const cchar_t *a3, +int mvvline_set( + int a1, + int a2, + const cchar_t *a3, int z) { return(*(int *)0); } #undef mvwadd_wch -int (mvwadd_wch)( - WINDOW *a1, - int a2, - int a3, +int mvwadd_wch( + WINDOW *a1, + int a2, + int a3, const cchar_t *z) { return(*(int *)0); } #undef mvwadd_wchnstr -int (mvwadd_wchnstr)( - WINDOW *a1, - int a2, - int a3, - const cchar_t *a4, +int mvwadd_wchnstr( + WINDOW *a1, + int a2, + int a3, + const cchar_t *a4, int z) { return(*(int *)0); } #undef mvwadd_wchstr -int (mvwadd_wchstr)( - WINDOW *a1, - int a2, - int a3, +int mvwadd_wchstr( + WINDOW *a1, + int a2, + int a3, const cchar_t *z) { return(*(int *)0); } #undef mvwaddnwstr -int (mvwaddnwstr)( - WINDOW *a1, - int a2, - int a3, - const wchar_t *a4, +int mvwaddnwstr( + WINDOW *a1, + int a2, + int a3, + const wchar_t *a4, int z) { return(*(int *)0); } #undef mvwaddwstr -int (mvwaddwstr)( - WINDOW *a1, - int a2, - int a3, +int mvwaddwstr( + WINDOW *a1, + int a2, + int a3, const wchar_t *z) { return(*(int *)0); } #undef mvwget_wch -int (mvwget_wch)( - WINDOW *a1, - int a2, - int a3, +int mvwget_wch( + WINDOW *a1, + int a2, + int a3, wint_t *z) { return(*(int *)0); } #undef mvwget_wstr -int (mvwget_wstr)( - WINDOW *a1, - int a2, - int a3, +int mvwget_wstr( + WINDOW *a1, + int a2, + int a3, wint_t *z) { return(*(int *)0); } #undef mvwgetn_wstr -int (mvwgetn_wstr)( - WINDOW *a1, - int a2, - int a3, - wint_t *a4, +int mvwgetn_wstr( + WINDOW *a1, + int a2, + int a3, + wint_t *a4, int z) { return(*(int *)0); } #undef mvwhline_set -int (mvwhline_set)( - WINDOW *a1, - int a2, - int a3, - const cchar_t *a4, +int mvwhline_set( + WINDOW *a1, + int a2, + int a3, + const cchar_t *a4, int z) { return(*(int *)0); } #undef mvwin_wch -int (mvwin_wch)( - WINDOW *a1, - int a2, - int a3, +int mvwin_wch( + WINDOW *a1, + int a2, + int a3, cchar_t *z) { return(*(int *)0); } #undef mvwin_wchnstr -int (mvwin_wchnstr)( - WINDOW *a1, - int a2, - int a3, - cchar_t *a4, +int mvwin_wchnstr( + WINDOW *a1, + int a2, + int a3, + cchar_t *a4, int z) { return(*(int *)0); } #undef mvwin_wchstr -int (mvwin_wchstr)( - WINDOW *a1, - int a2, - int a3, +int mvwin_wchstr( + WINDOW *a1, + int a2, + int a3, cchar_t *z) { return(*(int *)0); } #undef mvwinnwstr -int (mvwinnwstr)( - WINDOW *a1, - int a2, - int a3, - wchar_t *a4, +int mvwinnwstr( + WINDOW *a1, + int a2, + int a3, + wchar_t *a4, int z) { return(*(int *)0); } #undef mvwins_nwstr -int (mvwins_nwstr)( - WINDOW *a1, - int a2, - int a3, - const wchar_t *a4, +int mvwins_nwstr( + WINDOW *a1, + int a2, + int a3, + const wchar_t *a4, int z) { return(*(int *)0); } #undef mvwins_wch -int (mvwins_wch)( - WINDOW *a1, - int a2, - int a3, +int mvwins_wch( + WINDOW *a1, + int a2, + int a3, const cchar_t *z) { return(*(int *)0); } #undef mvwins_wstr -int (mvwins_wstr)( - WINDOW *a1, - int a2, - int a3, +int mvwins_wstr( + WINDOW *a1, + int a2, + int a3, const wchar_t *z) { return(*(int *)0); } #undef mvwinwstr -int (mvwinwstr)( - WINDOW *a1, - int a2, - int a3, +int mvwinwstr( + WINDOW *a1, + int a2, + int a3, wchar_t *z) { return(*(int *)0); } #undef mvwvline_set -int (mvwvline_set)( - WINDOW *a1, - int a2, - int a3, - const cchar_t *a4, +int mvwvline_set( + WINDOW *a1, + int a2, + int a3, + const cchar_t *a4, int z) { return(*(int *)0); } #undef vline_set -int (vline_set)( - const cchar_t *a1, +int vline_set( + const cchar_t *a1, int z) { return(*(int *)0); } #undef wadd_wchstr -int (wadd_wchstr)( - WINDOW *a1, +int wadd_wchstr( + WINDOW *a1, const cchar_t *z) { return(*(int *)0); } #undef waddwstr -int (waddwstr)( - WINDOW *a1, +int waddwstr( + WINDOW *a1, const wchar_t *z) { return(*(int *)0); } #undef wget_wstr -int (wget_wstr)( - WINDOW *a1, +int wget_wstr( + WINDOW *a1, wint_t *z) { return(*(int *)0); } #undef wgetbkgrnd -int (wgetbkgrnd)( - WINDOW *a1, +int wgetbkgrnd( + WINDOW *a1, cchar_t *z) { return(*(int *)0); } #undef win_wchstr -int (win_wchstr)( - WINDOW *a1, +int win_wchstr( + WINDOW *a1, cchar_t *z) { return(*(int *)0); } #undef wins_wstr -int (wins_wstr)( - WINDOW *a1, +int wins_wstr( + WINDOW *a1, const wchar_t *z) { return(*(int *)0); } #undef mouse_trafo -NCURSES_BOOL (mouse_trafo)( - int *a1, - int *a2, +NCURSES_BOOL mouse_trafo( + 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 */ } @@ -3992,7 +4017,7 @@ int _nc_getenv_num( #undef _nc_setenv_num void _nc_setenv_num( - const char *name, + const char *name, int value) { /* void */ } @@ -4027,8 +4052,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 +4092,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 +4103,7 @@ TERMINAL *set_curterm( #undef del_curterm_sp int del_curterm_sp( - SCREEN *sp, + SCREEN *sp, TERMINAL *termp) { return(*(int *)0); } @@ -4194,7 +4219,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 +4243,7 @@ char *longname(void) #undef napms_sp int napms_sp( - SCREEN *sp, + SCREEN *sp, int ms) { return(*(int *)0); } @@ -4231,19 +4256,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 +4279,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 +4320,7 @@ int curs_set( #undef typeahead_sp int typeahead_sp( - SCREEN *sp, + SCREEN *sp, int fd) { return(*(int *)0); } @@ -4306,7 +4331,7 @@ int typeahead( #undef has_key_sp int has_key_sp( - SCREEN *sp, + SCREEN *sp, int keycode) { return(*(int *)0); } @@ -4317,14 +4342,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,14 +4411,14 @@ 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); } @@ -4432,7 +4457,7 @@ int _nc_TABSIZE(void) #undef set_tabsize_sp int set_tabsize_sp( - SCREEN *sp, + SCREEN *sp, int value) { return(*(int *)0); } @@ -4448,13 +4473,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 +4495,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 +4507,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 +4532,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 +4552,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 +4566,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 +4590,7 @@ int tgetflag( #undef tgetnum_sp int tgetnum_sp( - SCREEN *sp, + SCREEN *sp, const char *id) { return(*(int *)0); } @@ -4576,14 +4601,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 +4627,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 +4636,7 @@ char *tgoto( #undef tigetflag_sp int tigetflag_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(int *)0); } @@ -4622,7 +4647,7 @@ int tigetflag( #undef tigetnum_sp int tigetnum_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(int *)0); } @@ -4633,7 +4658,7 @@ int tigetnum( #undef tigetstr_sp char *tigetstr_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(char **)0); } @@ -4649,23 +4674,36 @@ int _nc_tparm_err; #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 _nc_tiparm +char *_nc_tiparm( + 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 @@ -4682,7 +4720,7 @@ void _nc_set_no_padding( #undef delay_output_sp int delay_output_sp( - SCREEN *sp, + SCREEN *sp, int ms) { return(*(int *)0); } @@ -4702,7 +4740,7 @@ void _nc_flush(void) #undef _nc_outch_sp int _nc_outch_sp( - SCREEN *sp, + SCREEN *sp, int ch) { return(*(int *)0); } @@ -4713,7 +4751,7 @@ int _nc_outch( #undef _nc_putchar_sp int _nc_putchar_sp( - SCREEN *sp, + SCREEN *sp, int ch) { return(*(int *)0); } @@ -4724,7 +4762,7 @@ int _nc_putchar( #undef putp_sp int putp_sp( - SCREEN *sp, + SCREEN *sp, const char *string) { return(*(int *)0); } @@ -4735,35 +4773,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); } @@ -4803,7 +4841,7 @@ void trace( #undef _tracef void _tracef( - const char *fmt, + const char *fmt, ...) { /* void */ } @@ -4859,8 +4897,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); } @@ -4871,7 +4909,7 @@ int _nc_use_tracef( #undef _nc_locked_tracef void _nc_locked_tracef( - const char *fmt, + const char *fmt, ...) { /* void */ } @@ -4879,7 +4917,7 @@ void _nc_locked_tracef( #undef _traceattr2 char *_traceattr2( - int bufnum, + int bufnum, chtype newmode) { return(*(char **)0); } @@ -4900,13 +4938,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); } @@ -4922,7 +4960,7 @@ chtype _nc_retrace_chtype( #undef _tracecchar_t2 char *_tracecchar_t2( - int bufnum, + int bufnum, const cchar_t *ch) { return(*(char **)0); } @@ -4935,7 +4973,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 @@ -4946,7 +4984,7 @@ char *_nc_tracebits(void) #undef _nc_tracechar char *_nc_tracechar( - SCREEN *sp, + SCREEN *sp, int ch) { return(*(char **)0); } @@ -4959,7 +4997,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); } @@ -4970,7 +5008,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); } @@ -5037,9 +5075,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); } @@ -5052,8 +5090,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); } @@ -5087,14 +5125,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 */ } @@ -5107,28 +5145,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); } @@ -5136,7 +5174,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); } @@ -5144,32 +5182,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 *dst, string_desc *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); } @@ -5177,13 +5215,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); } @@ -5198,21 +5236,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); } @@ -5227,7 +5265,7 @@ char *_nc_trim_sgr0( #undef unctrl_sp const char *unctrl_sp( - SCREEN *sp, + SCREEN *sp, chtype ch) { return(*(const char **)0); } @@ -5240,7 +5278,7 @@ const char *unctrl( #undef _nc_visbuf2 const char *_nc_visbuf2( - int bufnum, + int bufnum, const char *buf) { return(*(const char **)0); } @@ -5251,13 +5289,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); } @@ -5268,7 +5306,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); } @@ -5279,14 +5317,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); } @@ -5304,18 +5342,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 */ } @@ -5323,15 +5361,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); } @@ -5339,8 +5377,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); } @@ -5348,28 +5386,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); } @@ -5394,7 +5432,7 @@ NCURSES_BOOL _nc_disable_period; #undef _nc_reset_input void _nc_reset_input( - FILE *fp, + FILE *fp, char *buf) { /* void */ } @@ -5405,7 +5443,7 @@ int _nc_get_token( #undef _nc_trans_string int _nc_trans_string( - char *ptr, + char *ptr, char *last) { return(*(int *)0); } @@ -5423,14 +5461,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); } @@ -5448,9 +5486,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); } @@ -5462,14 +5500,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); } @@ -5483,7 +5521,7 @@ void _nc_hashed_db(void) #undef key_defined_sp int key_defined_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(int *)0); } @@ -5496,14 +5534,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); } @@ -5511,14 +5549,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 dd084a4..0f41959 100644 --- a/ncurses/llib-lncursesw +++ b/ncurses/llib-lncursesw @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2018-2019,2020 Thomas E. Dickey * + * Copyright 2018-2020,2021 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); } @@ -562,1302 +562,1302 @@ int flash(void) /* ./lib_gen.c */ #undef addch -int (addch)( +int addch( const chtype z) { return(*(int *)0); } #undef addchnstr -int (addchnstr)( - const chtype *a1, +int addchnstr( + const chtype *a1, int z) { return(*(int *)0); } #undef addchstr -int (addchstr)( +int addchstr( const chtype *z) { return(*(int *)0); } #undef addnstr -int (addnstr)( - const char *a1, +int addnstr( + const char *a1, int z) { return(*(int *)0); } #undef addstr -int (addstr)( +int addstr( const char *z) { return(*(int *)0); } #undef attroff -int (attroff)( +int attroff( NCURSES_ATTR_T z) { return(*(int *)0); } #undef attron -int (attron)( +int attron( NCURSES_ATTR_T z) { return(*(int *)0); } #undef attrset -int (attrset)( +int attrset( NCURSES_ATTR_T z) { return(*(int *)0); } #undef attr_get -int (attr_get)( - attr_t *a1, - short *a2, +int attr_get( + attr_t *a1, + short *a2, void *z) { return(*(int *)0); } #undef attr_off -int (attr_off)( - attr_t a1, +int attr_off( + attr_t a1, void *z) { return(*(int *)0); } #undef attr_on -int (attr_on)( - attr_t a1, +int attr_on( + attr_t a1, void *z) { return(*(int *)0); } #undef attr_set -int (attr_set)( - attr_t a1, - short a2, +int attr_set( + attr_t a1, + short a2, void *z) { return(*(int *)0); } #undef bkgd -int (bkgd)( +int bkgd( chtype z) { return(*(int *)0); } #undef bkgdset -void (bkgdset)( +void bkgdset( chtype z) { /* void */ } #undef border -int (border)( - chtype a1, - chtype a2, - chtype a3, - chtype a4, - chtype a5, - chtype a6, - chtype a7, +int border( + chtype a1, + chtype a2, + chtype a3, + chtype a4, + chtype a5, + chtype a6, + chtype a7, chtype z) { return(*(int *)0); } #undef box -int (box)( - WINDOW *a1, - chtype a2, +int box( + WINDOW *a1, + chtype a2, chtype z) { return(*(int *)0); } #undef chgat -int (chgat)( - int a1, - attr_t a2, - short a3, +int chgat( + int a1, + attr_t a2, + short a3, const void *z) { return(*(int *)0); } #undef clear -int (clear)(void) +int clear(void) { return(*(int *)0); } #undef clrtobot -int (clrtobot)(void) +int clrtobot(void) { return(*(int *)0); } #undef clrtoeol -int (clrtoeol)(void) +int clrtoeol(void) { return(*(int *)0); } #undef color_set -int (color_set)( - short a1, +int color_set( + short a1, void *z) { return(*(int *)0); } #undef COLOR_PAIR -int (COLOR_PAIR)( +int COLOR_PAIR( int z) { return(*(int *)0); } #undef delch -int (delch)(void) +int delch(void) { return(*(int *)0); } #undef deleteln -int (deleteln)(void) +int deleteln(void) { return(*(int *)0); } #undef echochar -int (echochar)( +int echochar( const chtype z) { return(*(int *)0); } #undef erase -int (erase)(void) +int erase(void) { return(*(int *)0); } #undef getbkgd -chtype (getbkgd)( +chtype getbkgd( WINDOW *z) { return(*(chtype *)0); } #undef getch -int (getch)(void) +int getch(void) { return(*(int *)0); } #undef getnstr -int (getnstr)( - char *a1, +int getnstr( + char *a1, int z) { return(*(int *)0); } #undef getstr -int (getstr)( +int getstr( char *z) { return(*(int *)0); } #undef hline -int (hline)( - chtype a1, +int hline( + chtype a1, int z) { return(*(int *)0); } #undef inch -chtype (inch)(void) +chtype inch(void) { return(*(chtype *)0); } #undef inchnstr -int (inchnstr)( - chtype *a1, +int inchnstr( + chtype *a1, int z) { return(*(int *)0); } #undef inchstr -int (inchstr)( +int inchstr( chtype *z) { return(*(int *)0); } #undef innstr -int (innstr)( - char *a1, +int innstr( + char *a1, int z) { return(*(int *)0); } #undef insch -int (insch)( +int insch( chtype z) { return(*(int *)0); } #undef insdelln -int (insdelln)( +int insdelln( int z) { return(*(int *)0); } #undef insertln -int (insertln)(void) +int insertln(void) { return(*(int *)0); } #undef insnstr -int (insnstr)( - const char *a1, +int insnstr( + const char *a1, int z) { return(*(int *)0); } #undef insstr -int (insstr)( +int insstr( const char *z) { return(*(int *)0); } #undef instr -int (instr)( +int instr( char *z) { return(*(int *)0); } #undef move -int (move)( - int a1, +int move( + int a1, int z) { return(*(int *)0); } #undef mvaddch -int (mvaddch)( - int a1, - int a2, +int mvaddch( + int a1, + int a2, const chtype z) { return(*(int *)0); } #undef mvaddchnstr -int (mvaddchnstr)( - int a1, - int a2, - const chtype *a3, +int mvaddchnstr( + int a1, + int a2, + const chtype *a3, int z) { return(*(int *)0); } #undef mvaddchstr -int (mvaddchstr)( - int a1, - int a2, +int mvaddchstr( + int a1, + int a2, const chtype *z) { return(*(int *)0); } #undef mvaddnstr -int (mvaddnstr)( - int a1, - int a2, - const char *a3, +int mvaddnstr( + int a1, + int a2, + const char *a3, int z) { return(*(int *)0); } #undef mvaddstr -int (mvaddstr)( - int a1, - int a2, +int mvaddstr( + int a1, + int a2, const char *z) { return(*(int *)0); } #undef mvchgat -int (mvchgat)( - int a1, - int a2, - int a3, - attr_t a4, - short a5, +int mvchgat( + int a1, + int a2, + int a3, + attr_t a4, + short a5, const void *z) { return(*(int *)0); } #undef mvdelch -int (mvdelch)( - int a1, +int mvdelch( + int a1, int z) { return(*(int *)0); } #undef mvgetch -int (mvgetch)( - int a1, +int mvgetch( + int a1, int z) { return(*(int *)0); } #undef mvgetnstr -int (mvgetnstr)( - int a1, - int a2, - char *a3, +int mvgetnstr( + int a1, + int a2, + char *a3, int z) { return(*(int *)0); } #undef mvgetstr -int (mvgetstr)( - int a1, - int a2, +int mvgetstr( + int a1, + int a2, char *z) { return(*(int *)0); } #undef mvhline -int (mvhline)( - int a1, - int a2, - chtype a3, +int mvhline( + int a1, + int a2, + chtype a3, int z) { return(*(int *)0); } #undef mvinch -chtype (mvinch)( - int a1, +chtype mvinch( + int a1, int z) { return(*(chtype *)0); } #undef mvinchnstr -int (mvinchnstr)( - int a1, - int a2, - chtype *a3, +int mvinchnstr( + int a1, + int a2, + chtype *a3, int z) { return(*(int *)0); } #undef mvinchstr -int (mvinchstr)( - int a1, - int a2, +int mvinchstr( + int a1, + int a2, chtype *z) { return(*(int *)0); } #undef mvinnstr -int (mvinnstr)( - int a1, - int a2, - char *a3, +int mvinnstr( + int a1, + int a2, + char *a3, int z) { return(*(int *)0); } #undef mvinsch -int (mvinsch)( - int a1, - int a2, +int mvinsch( + int a1, + int a2, chtype z) { return(*(int *)0); } #undef mvinsnstr -int (mvinsnstr)( - int a1, - int a2, - const char *a3, +int mvinsnstr( + int a1, + int a2, + const char *a3, int z) { return(*(int *)0); } #undef mvinsstr -int (mvinsstr)( - int a1, - int a2, +int mvinsstr( + int a1, + int a2, const char *z) { return(*(int *)0); } #undef mvinstr -int (mvinstr)( - int a1, - int a2, +int mvinstr( + int a1, + int a2, char *z) { return(*(int *)0); } #undef mvvline -int (mvvline)( - int a1, - int a2, - chtype a3, +int mvvline( + int a1, + int a2, + chtype a3, int z) { return(*(int *)0); } #undef mvwaddch -int (mvwaddch)( - WINDOW *a1, - int a2, - int a3, +int mvwaddch( + WINDOW *a1, + int a2, + int a3, const chtype z) { return(*(int *)0); } #undef mvwaddchnstr -int (mvwaddchnstr)( - WINDOW *a1, - int a2, - int a3, - const chtype *a4, +int mvwaddchnstr( + WINDOW *a1, + int a2, + int a3, + const chtype *a4, int z) { return(*(int *)0); } #undef mvwaddchstr -int (mvwaddchstr)( - WINDOW *a1, - int a2, - int a3, +int mvwaddchstr( + WINDOW *a1, + int a2, + int a3, const chtype *z) { return(*(int *)0); } #undef mvwaddnstr -int (mvwaddnstr)( - WINDOW *a1, - int a2, - int a3, - const char *a4, +int mvwaddnstr( + WINDOW *a1, + int a2, + int a3, + const char *a4, int z) { return(*(int *)0); } #undef mvwaddstr -int (mvwaddstr)( - WINDOW *a1, - int a2, - int a3, +int mvwaddstr( + WINDOW *a1, + int a2, + int a3, const char *z) { return(*(int *)0); } #undef mvwchgat -int (mvwchgat)( - WINDOW *a1, - int a2, - int a3, - int a4, - attr_t a5, - short a6, +int mvwchgat( + WINDOW *a1, + int a2, + int a3, + int a4, + attr_t a5, + short a6, const void *z) { return(*(int *)0); } #undef mvwdelch -int (mvwdelch)( - WINDOW *a1, - int a2, +int mvwdelch( + WINDOW *a1, + int a2, int z) { return(*(int *)0); } #undef mvwgetch -int (mvwgetch)( - WINDOW *a1, - int a2, +int mvwgetch( + WINDOW *a1, + int a2, int z) { return(*(int *)0); } #undef mvwgetnstr -int (mvwgetnstr)( - WINDOW *a1, - int a2, - int a3, - char *a4, +int mvwgetnstr( + WINDOW *a1, + int a2, + int a3, + char *a4, int z) { return(*(int *)0); } #undef mvwgetstr -int (mvwgetstr)( - WINDOW *a1, - int a2, - int a3, +int mvwgetstr( + WINDOW *a1, + int a2, + int a3, char *z) { return(*(int *)0); } #undef mvwhline -int (mvwhline)( - WINDOW *a1, - int a2, - int a3, - chtype a4, +int mvwhline( + WINDOW *a1, + int a2, + int a3, + chtype a4, int z) { return(*(int *)0); } #undef mvwinch -chtype (mvwinch)( - WINDOW *a1, - int a2, +chtype mvwinch( + WINDOW *a1, + int a2, int z) { return(*(chtype *)0); } #undef mvwinchnstr -int (mvwinchnstr)( - WINDOW *a1, - int a2, - int a3, - chtype *a4, +int mvwinchnstr( + WINDOW *a1, + int a2, + int a3, + chtype *a4, int z) { return(*(int *)0); } #undef mvwinchstr -int (mvwinchstr)( - WINDOW *a1, - int a2, - int a3, +int mvwinchstr( + WINDOW *a1, + int a2, + int a3, chtype *z) { return(*(int *)0); } #undef mvwinnstr -int (mvwinnstr)( - WINDOW *a1, - int a2, - int a3, - char *a4, +int mvwinnstr( + WINDOW *a1, + int a2, + int a3, + char *a4, int z) { return(*(int *)0); } #undef mvwinsch -int (mvwinsch)( - WINDOW *a1, - int a2, - int a3, +int mvwinsch( + WINDOW *a1, + int a2, + int a3, chtype z) { return(*(int *)0); } #undef mvwinsnstr -int (mvwinsnstr)( - WINDOW *a1, - int a2, - int a3, - const char *a4, +int mvwinsnstr( + WINDOW *a1, + int a2, + int a3, + const char *a4, int z) { return(*(int *)0); } #undef mvwinsstr -int (mvwinsstr)( - WINDOW *a1, - int a2, - int a3, +int mvwinsstr( + WINDOW *a1, + int a2, + int a3, const char *z) { return(*(int *)0); } #undef mvwinstr -int (mvwinstr)( - WINDOW *a1, - int a2, - int a3, +int mvwinstr( + WINDOW *a1, + int a2, + int a3, char *z) { return(*(int *)0); } #undef mvwvline -int (mvwvline)( - WINDOW *a1, - int a2, - int a3, - chtype a4, +int mvwvline( + WINDOW *a1, + int a2, + int a3, + chtype a4, int z) { return(*(int *)0); } #undef PAIR_NUMBER -int (PAIR_NUMBER)( +int PAIR_NUMBER( int z) { return(*(int *)0); } #undef redrawwin -int (redrawwin)( +int redrawwin( WINDOW *z) { return(*(int *)0); } #undef refresh -int (refresh)(void) +int refresh(void) { return(*(int *)0); } #undef scrl -int (scrl)( +int scrl( int z) { return(*(int *)0); } #undef scroll -int (scroll)( +int scroll( WINDOW *z) { return(*(int *)0); } #undef setscrreg -int (setscrreg)( - int a1, +int setscrreg( + int a1, int z) { return(*(int *)0); } #undef slk_attr_off -int (slk_attr_off)( - const attr_t a1, +int slk_attr_off( + const attr_t a1, void *z) { return(*(int *)0); } #undef slk_attr_on -int (slk_attr_on)( - attr_t a1, +int slk_attr_on( + attr_t a1, void *z) { return(*(int *)0); } #undef standout -int (standout)(void) +int standout(void) { return(*(int *)0); } #undef standend -int (standend)(void) +int standend(void) { return(*(int *)0); } #undef timeout -void (timeout)( +void timeout( int z) { /* void */ } #undef touchline -int (touchline)( - WINDOW *a1, - int a2, +int touchline( + WINDOW *a1, + int a2, int z) { return(*(int *)0); } #undef touchwin -int (touchwin)( +int touchwin( WINDOW *z) { return(*(int *)0); } #undef untouchwin -int (untouchwin)( +int untouchwin( WINDOW *z) { return(*(int *)0); } #undef vline -int (vline)( - chtype a1, +int vline( + chtype a1, int z) { return(*(int *)0); } #undef waddchstr -int (waddchstr)( - WINDOW *a1, +int waddchstr( + WINDOW *a1, const chtype *z) { return(*(int *)0); } #undef waddstr -int (waddstr)( - WINDOW *a1, +int waddstr( + WINDOW *a1, const char *z) { return(*(int *)0); } #undef wattron -int (wattron)( - WINDOW *a1, +int wattron( + WINDOW *a1, int z) { return(*(int *)0); } #undef wattroff -int (wattroff)( - WINDOW *a1, +int wattroff( + WINDOW *a1, int z) { return(*(int *)0); } #undef wattrset -int (wattrset)( - WINDOW *a1, +int wattrset( + WINDOW *a1, int z) { return(*(int *)0); } #undef wattr_get -int (wattr_get)( - WINDOW *a1, - attr_t *a2, - short *a3, +int wattr_get( + WINDOW *a1, + attr_t *a2, + short *a3, void *z) { return(*(int *)0); } #undef wattr_set -int (wattr_set)( - WINDOW *a1, - attr_t a2, - short a3, +int wattr_set( + WINDOW *a1, + attr_t a2, + short a3, void *z) { return(*(int *)0); } #undef wdeleteln -int (wdeleteln)( +int wdeleteln( WINDOW *z) { return(*(int *)0); } #undef wgetstr -int (wgetstr)( - WINDOW *a1, +int wgetstr( + WINDOW *a1, char *z) { return(*(int *)0); } #undef winchstr -int (winchstr)( - WINDOW *a1, +int winchstr( + WINDOW *a1, chtype *z) { return(*(int *)0); } #undef winsertln -int (winsertln)( +int winsertln( WINDOW *z) { return(*(int *)0); } #undef winsstr -int (winsstr)( - WINDOW *a1, +int winsstr( + WINDOW *a1, const char *z) { return(*(int *)0); } #undef winstr -int (winstr)( - WINDOW *a1, +int winstr( + WINDOW *a1, char *z) { return(*(int *)0); } #undef wstandout -int (wstandout)( +int wstandout( WINDOW *z) { return(*(int *)0); } #undef wstandend -int (wstandend)( +int wstandend( WINDOW *z) { return(*(int *)0); } #undef getattrs -int (getattrs)( +int getattrs( const WINDOW *z) { return(*(int *)0); } #undef getcurx -int (getcurx)( +int getcurx( const WINDOW *z) { return(*(int *)0); } #undef getcury -int (getcury)( +int getcury( const WINDOW *z) { return(*(int *)0); } #undef getbegx -int (getbegx)( +int getbegx( const WINDOW *z) { return(*(int *)0); } #undef getbegy -int (getbegy)( +int getbegy( const WINDOW *z) { return(*(int *)0); } #undef getmaxx -int (getmaxx)( +int getmaxx( const WINDOW *z) { return(*(int *)0); } #undef getmaxy -int (getmaxy)( +int getmaxy( const WINDOW *z) { return(*(int *)0); } #undef getparx -int (getparx)( +int getparx( const WINDOW *z) { return(*(int *)0); } #undef getpary -int (getpary)( +int getpary( const WINDOW *z) { return(*(int *)0); } #undef wgetparent -WINDOW *(wgetparent)( +WINDOW *wgetparent( const WINDOW *z) { return(*(WINDOW **)0); } #undef is_cleared -NCURSES_BOOL (is_cleared)( +NCURSES_BOOL is_cleared( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_idcok -NCURSES_BOOL (is_idcok)( +NCURSES_BOOL is_idcok( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_idlok -NCURSES_BOOL (is_idlok)( +NCURSES_BOOL is_idlok( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_immedok -NCURSES_BOOL (is_immedok)( +NCURSES_BOOL is_immedok( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_keypad -NCURSES_BOOL (is_keypad)( +NCURSES_BOOL is_keypad( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_leaveok -NCURSES_BOOL (is_leaveok)( +NCURSES_BOOL is_leaveok( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_nodelay -NCURSES_BOOL (is_nodelay)( +NCURSES_BOOL is_nodelay( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_notimeout -NCURSES_BOOL (is_notimeout)( +NCURSES_BOOL is_notimeout( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_pad -NCURSES_BOOL (is_pad)( +NCURSES_BOOL is_pad( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_scrollok -NCURSES_BOOL (is_scrollok)( +NCURSES_BOOL is_scrollok( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_subwin -NCURSES_BOOL (is_subwin)( +NCURSES_BOOL is_subwin( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef is_syncok -NCURSES_BOOL (is_syncok)( +NCURSES_BOOL is_syncok( const WINDOW *z) { return(*(NCURSES_BOOL *)0); } #undef wgetdelay -int (wgetdelay)( +int wgetdelay( const WINDOW *z) { return(*(int *)0); } #undef wgetscrreg -int (wgetscrreg)( - const WINDOW *a1, - int *a2, +int wgetscrreg( + const WINDOW *a1, + int *a2, int *z) { return(*(int *)0); } #undef add_wch -int (add_wch)( +int add_wch( const cchar_t *z) { return(*(int *)0); } #undef add_wchnstr -int (add_wchnstr)( - const cchar_t *a1, +int add_wchnstr( + const cchar_t *a1, int z) { return(*(int *)0); } #undef add_wchstr -int (add_wchstr)( +int add_wchstr( const cchar_t *z) { return(*(int *)0); } #undef addnwstr -int (addnwstr)( - const wchar_t *a1, +int addnwstr( + const wchar_t *a1, int z) { return(*(int *)0); } #undef addwstr -int (addwstr)( +int addwstr( const wchar_t *z) { return(*(int *)0); } #undef bkgrnd -int (bkgrnd)( +int bkgrnd( const cchar_t *z) { return(*(int *)0); } #undef bkgrndset -void (bkgrndset)( +void bkgrndset( const cchar_t *z) { /* void */ } #undef border_set -int (border_set)( - const cchar_t *a1, - const cchar_t *a2, - const cchar_t *a3, - const cchar_t *a4, - const cchar_t *a5, - const cchar_t *a6, - const cchar_t *a7, +int border_set( + const cchar_t *a1, + const cchar_t *a2, + const cchar_t *a3, + const cchar_t *a4, + const cchar_t *a5, + const cchar_t *a6, + const cchar_t *a7, const cchar_t *z) { return(*(int *)0); } #undef box_set -int (box_set)( - WINDOW *a1, - const cchar_t *a2, +int box_set( + WINDOW *a1, + const cchar_t *a2, const cchar_t *z) { return(*(int *)0); } #undef echo_wchar -int (echo_wchar)( +int echo_wchar( const cchar_t *z) { return(*(int *)0); } #undef get_wch -int (get_wch)( +int get_wch( wint_t *z) { return(*(int *)0); } #undef get_wstr -int (get_wstr)( +int get_wstr( wint_t *z) { return(*(int *)0); } #undef getbkgrnd -int (getbkgrnd)( +int getbkgrnd( cchar_t *z) { return(*(int *)0); } #undef getn_wstr -int (getn_wstr)( - wint_t *a1, +int getn_wstr( + wint_t *a1, int z) { return(*(int *)0); } #undef hline_set -int (hline_set)( - const cchar_t *a1, +int hline_set( + const cchar_t *a1, int z) { return(*(int *)0); } #undef in_wch -int (in_wch)( +int in_wch( cchar_t *z) { return(*(int *)0); } #undef in_wchnstr -int (in_wchnstr)( - cchar_t *a1, +int in_wchnstr( + cchar_t *a1, int z) { return(*(int *)0); } #undef in_wchstr -int (in_wchstr)( +int in_wchstr( cchar_t *z) { return(*(int *)0); } #undef innwstr -int (innwstr)( - wchar_t *a1, +int innwstr( + wchar_t *a1, int z) { return(*(int *)0); } #undef ins_nwstr -int (ins_nwstr)( - const wchar_t *a1, +int ins_nwstr( + const wchar_t *a1, int z) { return(*(int *)0); } #undef ins_wch -int (ins_wch)( +int ins_wch( const cchar_t *z) { return(*(int *)0); } #undef ins_wstr -int (ins_wstr)( +int ins_wstr( const wchar_t *z) { return(*(int *)0); } #undef inwstr -int (inwstr)( +int inwstr( wchar_t *z) { return(*(int *)0); } #undef mvadd_wch -int (mvadd_wch)( - int a1, - int a2, +int mvadd_wch( + int a1, + int a2, const cchar_t *z) { return(*(int *)0); } #undef mvadd_wchnstr -int (mvadd_wchnstr)( - int a1, - int a2, - const cchar_t *a3, +int mvadd_wchnstr( + int a1, + int a2, + const cchar_t *a3, int z) { return(*(int *)0); } #undef mvadd_wchstr -int (mvadd_wchstr)( - int a1, - int a2, +int mvadd_wchstr( + int a1, + int a2, const cchar_t *z) { return(*(int *)0); } #undef mvaddnwstr -int (mvaddnwstr)( - int a1, - int a2, - const wchar_t *a3, +int mvaddnwstr( + int a1, + int a2, + const wchar_t *a3, int z) { return(*(int *)0); } #undef mvaddwstr -int (mvaddwstr)( - int a1, - int a2, +int mvaddwstr( + int a1, + int a2, const wchar_t *z) { return(*(int *)0); } #undef mvget_wch -int (mvget_wch)( - int a1, - int a2, +int mvget_wch( + int a1, + int a2, wint_t *z) { return(*(int *)0); } #undef mvget_wstr -int (mvget_wstr)( - int a1, - int a2, +int mvget_wstr( + int a1, + int a2, wint_t *z) { return(*(int *)0); } #undef mvgetn_wstr -int (mvgetn_wstr)( - int a1, - int a2, - wint_t *a3, +int mvgetn_wstr( + int a1, + int a2, + wint_t *a3, int z) { return(*(int *)0); } #undef mvhline_set -int (mvhline_set)( - int a1, - int a2, - const cchar_t *a3, +int mvhline_set( + int a1, + int a2, + const cchar_t *a3, int z) { return(*(int *)0); } #undef mvin_wch -int (mvin_wch)( - int a1, - int a2, +int mvin_wch( + int a1, + int a2, cchar_t *z) { return(*(int *)0); } #undef mvin_wchnstr -int (mvin_wchnstr)( - int a1, - int a2, - cchar_t *a3, +int mvin_wchnstr( + int a1, + int a2, + cchar_t *a3, int z) { return(*(int *)0); } #undef mvin_wchstr -int (mvin_wchstr)( - int a1, - int a2, +int mvin_wchstr( + int a1, + int a2, cchar_t *z) { return(*(int *)0); } #undef mvinnwstr -int (mvinnwstr)( - int a1, - int a2, - wchar_t *a3, +int mvinnwstr( + int a1, + int a2, + wchar_t *a3, int z) { return(*(int *)0); } #undef mvins_nwstr -int (mvins_nwstr)( - int a1, - int a2, - const wchar_t *a3, +int mvins_nwstr( + int a1, + int a2, + const wchar_t *a3, int z) { return(*(int *)0); } #undef mvins_wch -int (mvins_wch)( - int a1, - int a2, +int mvins_wch( + int a1, + int a2, const cchar_t *z) { return(*(int *)0); } #undef mvins_wstr -int (mvins_wstr)( - int a1, - int a2, +int mvins_wstr( + int a1, + int a2, const wchar_t *z) { return(*(int *)0); } #undef mvinwstr -int (mvinwstr)( - int a1, - int a2, +int mvinwstr( + int a1, + int a2, wchar_t *z) { return(*(int *)0); } #undef mvvline_set -int (mvvline_set)( - int a1, - int a2, - const cchar_t *a3, +int mvvline_set( + int a1, + int a2, + const cchar_t *a3, int z) { return(*(int *)0); } #undef mvwadd_wch -int (mvwadd_wch)( - WINDOW *a1, - int a2, - int a3, +int mvwadd_wch( + WINDOW *a1, + int a2, + int a3, const cchar_t *z) { return(*(int *)0); } #undef mvwadd_wchnstr -int (mvwadd_wchnstr)( - WINDOW *a1, - int a2, - int a3, - const cchar_t *a4, +int mvwadd_wchnstr( + WINDOW *a1, + int a2, + int a3, + const cchar_t *a4, int z) { return(*(int *)0); } #undef mvwadd_wchstr -int (mvwadd_wchstr)( - WINDOW *a1, - int a2, - int a3, +int mvwadd_wchstr( + WINDOW *a1, + int a2, + int a3, const cchar_t *z) { return(*(int *)0); } #undef mvwaddnwstr -int (mvwaddnwstr)( - WINDOW *a1, - int a2, - int a3, - const wchar_t *a4, +int mvwaddnwstr( + WINDOW *a1, + int a2, + int a3, + const wchar_t *a4, int z) { return(*(int *)0); } #undef mvwaddwstr -int (mvwaddwstr)( - WINDOW *a1, - int a2, - int a3, +int mvwaddwstr( + WINDOW *a1, + int a2, + int a3, const wchar_t *z) { return(*(int *)0); } #undef mvwget_wch -int (mvwget_wch)( - WINDOW *a1, - int a2, - int a3, +int mvwget_wch( + WINDOW *a1, + int a2, + int a3, wint_t *z) { return(*(int *)0); } #undef mvwget_wstr -int (mvwget_wstr)( - WINDOW *a1, - int a2, - int a3, +int mvwget_wstr( + WINDOW *a1, + int a2, + int a3, wint_t *z) { return(*(int *)0); } #undef mvwgetn_wstr -int (mvwgetn_wstr)( - WINDOW *a1, - int a2, - int a3, - wint_t *a4, +int mvwgetn_wstr( + WINDOW *a1, + int a2, + int a3, + wint_t *a4, int z) { return(*(int *)0); } #undef mvwhline_set -int (mvwhline_set)( - WINDOW *a1, - int a2, - int a3, - const cchar_t *a4, +int mvwhline_set( + WINDOW *a1, + int a2, + int a3, + const cchar_t *a4, int z) { return(*(int *)0); } #undef mvwin_wch -int (mvwin_wch)( - WINDOW *a1, - int a2, - int a3, +int mvwin_wch( + WINDOW *a1, + int a2, + int a3, cchar_t *z) { return(*(int *)0); } #undef mvwin_wchnstr -int (mvwin_wchnstr)( - WINDOW *a1, - int a2, - int a3, - cchar_t *a4, +int mvwin_wchnstr( + WINDOW *a1, + int a2, + int a3, + cchar_t *a4, int z) { return(*(int *)0); } #undef mvwin_wchstr -int (mvwin_wchstr)( - WINDOW *a1, - int a2, - int a3, +int mvwin_wchstr( + WINDOW *a1, + int a2, + int a3, cchar_t *z) { return(*(int *)0); } #undef mvwinnwstr -int (mvwinnwstr)( - WINDOW *a1, - int a2, - int a3, - wchar_t *a4, +int mvwinnwstr( + WINDOW *a1, + int a2, + int a3, + wchar_t *a4, int z) { return(*(int *)0); } #undef mvwins_nwstr -int (mvwins_nwstr)( - WINDOW *a1, - int a2, - int a3, - const wchar_t *a4, +int mvwins_nwstr( + WINDOW *a1, + int a2, + int a3, + const wchar_t *a4, int z) { return(*(int *)0); } #undef mvwins_wch -int (mvwins_wch)( - WINDOW *a1, - int a2, - int a3, +int mvwins_wch( + WINDOW *a1, + int a2, + int a3, const cchar_t *z) { return(*(int *)0); } #undef mvwins_wstr -int (mvwins_wstr)( - WINDOW *a1, - int a2, - int a3, +int mvwins_wstr( + WINDOW *a1, + int a2, + int a3, const wchar_t *z) { return(*(int *)0); } #undef mvwinwstr -int (mvwinwstr)( - WINDOW *a1, - int a2, - int a3, +int mvwinwstr( + WINDOW *a1, + int a2, + int a3, wchar_t *z) { return(*(int *)0); } #undef mvwvline_set -int (mvwvline_set)( - WINDOW *a1, - int a2, - int a3, - const cchar_t *a4, +int mvwvline_set( + WINDOW *a1, + int a2, + int a3, + const cchar_t *a4, int z) { return(*(int *)0); } #undef vline_set -int (vline_set)( - const cchar_t *a1, +int vline_set( + const cchar_t *a1, int z) { return(*(int *)0); } #undef wadd_wchstr -int (wadd_wchstr)( - WINDOW *a1, +int wadd_wchstr( + WINDOW *a1, const cchar_t *z) { return(*(int *)0); } #undef waddwstr -int (waddwstr)( - WINDOW *a1, +int waddwstr( + WINDOW *a1, const wchar_t *z) { return(*(int *)0); } #undef wget_wstr -int (wget_wstr)( - WINDOW *a1, +int wget_wstr( + WINDOW *a1, wint_t *z) { return(*(int *)0); } #undef wgetbkgrnd -int (wgetbkgrnd)( - WINDOW *a1, +int wgetbkgrnd( + WINDOW *a1, cchar_t *z) { return(*(int *)0); } #undef win_wchstr -int (win_wchstr)( - WINDOW *a1, +int win_wchstr( + WINDOW *a1, cchar_t *z) { return(*(int *)0); } #undef wins_wstr -int (wins_wstr)( - WINDOW *a1, +int wins_wstr( + WINDOW *a1, const wchar_t *z) { return(*(int *)0); } #undef mouse_trafo -NCURSES_BOOL (mouse_trafo)( - int *a1, - int *a2, +NCURSES_BOOL mouse_trafo( + 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 */ } @@ -3978,7 +4003,7 @@ int _nc_getenv_num( #undef _nc_setenv_num void _nc_setenv_num( - const char *name, + const char *name, int value) { /* void */ } @@ -4012,8 +4037,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 +4067,7 @@ TERMINAL *cur_term; #undef set_curterm_sp TERMINAL *set_curterm_sp( - SCREEN *sp, + SCREEN *sp, TERMINAL *termp) { return(*(TERMINAL **)0); } @@ -4053,7 +4078,7 @@ TERMINAL *set_curterm( #undef del_curterm_sp int del_curterm_sp( - SCREEN *sp, + SCREEN *sp, TERMINAL *termp) { return(*(int *)0); } @@ -4139,7 +4164,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 +4188,7 @@ char *longname(void) #undef napms_sp int napms_sp( - SCREEN *sp, + SCREEN *sp, int ms) { return(*(int *)0); } @@ -4176,19 +4201,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 +4224,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 +4265,7 @@ int curs_set( #undef typeahead_sp int typeahead_sp( - SCREEN *sp, + SCREEN *sp, int fd) { return(*(int *)0); } @@ -4251,7 +4276,7 @@ int typeahead( #undef has_key_sp int has_key_sp( - SCREEN *sp, + SCREEN *sp, int keycode) { return(*(int *)0); } @@ -4262,14 +4287,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,14 +4356,14 @@ 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); } @@ -4355,7 +4380,7 @@ int TABSIZE; #undef set_tabsize_sp int set_tabsize_sp( - SCREEN *sp, + SCREEN *sp, int value) { return(*(int *)0); } @@ -4371,13 +4396,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 +4418,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 +4430,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 +4455,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 +4467,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 +4481,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 +4505,7 @@ int tgetflag( #undef tgetnum_sp int tgetnum_sp( - SCREEN *sp, + SCREEN *sp, const char *id) { return(*(int *)0); } @@ -4491,14 +4516,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 +4542,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 +4551,7 @@ char *tgoto( #undef tigetflag_sp int tigetflag_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(int *)0); } @@ -4537,7 +4562,7 @@ int tigetflag( #undef tigetnum_sp int tigetnum_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(int *)0); } @@ -4548,7 +4573,7 @@ int tigetnum( #undef tigetstr_sp char *tigetstr_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(char **)0); } @@ -4564,23 +4589,36 @@ int _nc_tparm_err; #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 _nc_tiparm +char *_nc_tiparm( + 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 @@ -4597,7 +4635,7 @@ void _nc_set_no_padding( #undef delay_output_sp int delay_output_sp( - SCREEN *sp, + SCREEN *sp, int ms) { return(*(int *)0); } @@ -4617,7 +4655,7 @@ void _nc_flush(void) #undef _nc_outch_sp int _nc_outch_sp( - SCREEN *sp, + SCREEN *sp, int ch) { return(*(int *)0); } @@ -4628,7 +4666,7 @@ int _nc_outch( #undef _nc_putchar_sp int _nc_putchar_sp( - SCREEN *sp, + SCREEN *sp, int ch) { return(*(int *)0); } @@ -4639,7 +4677,7 @@ int _nc_putchar( #undef putp_sp int putp_sp( - SCREEN *sp, + SCREEN *sp, const char *string) { return(*(int *)0); } @@ -4650,35 +4688,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); } @@ -4704,7 +4742,7 @@ void trace( #undef _tracef void _tracef( - const char *fmt, + const char *fmt, ...) { /* void */ } @@ -4760,8 +4798,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); } @@ -4769,7 +4807,7 @@ char *_nc_fmt_funcptr( #undef _traceattr2 char *_traceattr2( - int bufnum, + int bufnum, chtype newmode) { return(*(char **)0); } @@ -4790,13 +4828,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); } @@ -4812,7 +4850,7 @@ chtype _nc_retrace_chtype( #undef _tracecchar_t2 char *_tracecchar_t2( - int bufnum, + int bufnum, const cchar_t *ch) { return(*(char **)0); } @@ -4825,7 +4863,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 @@ -4836,7 +4874,7 @@ char *_nc_tracebits(void) #undef _nc_tracechar char *_nc_tracechar( - SCREEN *sp, + SCREEN *sp, int ch) { return(*(char **)0); } @@ -4849,7 +4887,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); } @@ -4860,7 +4898,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); } @@ -4927,9 +4965,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); } @@ -4942,8 +4980,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); } @@ -4966,14 +5004,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 */ } @@ -4986,28 +5024,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); } @@ -5015,7 +5053,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); } @@ -5023,32 +5061,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 *dst, string_desc *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); } @@ -5056,13 +5094,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); } @@ -5077,21 +5115,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); } @@ -5106,7 +5144,7 @@ char *_nc_trim_sgr0( #undef unctrl_sp const char *unctrl_sp( - SCREEN *sp, + SCREEN *sp, chtype ch) { return(*(const char **)0); } @@ -5119,7 +5157,7 @@ const char *unctrl( #undef _nc_visbuf2 const char *_nc_visbuf2( - int bufnum, + int bufnum, const char *buf) { return(*(const char **)0); } @@ -5130,13 +5168,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); } @@ -5147,7 +5185,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); } @@ -5158,14 +5196,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); } @@ -5183,18 +5221,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 */ } @@ -5202,15 +5240,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); } @@ -5218,8 +5256,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); } @@ -5227,28 +5265,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); } @@ -5273,7 +5311,7 @@ NCURSES_BOOL _nc_disable_period; #undef _nc_reset_input void _nc_reset_input( - FILE *fp, + FILE *fp, char *buf) { /* void */ } @@ -5284,7 +5322,7 @@ int _nc_get_token( #undef _nc_trans_string int _nc_trans_string( - char *ptr, + char *ptr, char *last) { return(*(int *)0); } @@ -5302,14 +5340,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); } @@ -5327,9 +5365,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); } @@ -5341,14 +5379,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); } @@ -5362,7 +5400,7 @@ void _nc_hashed_db(void) #undef key_defined_sp int key_defined_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(int *)0); } @@ -5375,14 +5413,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); } @@ -5390,14 +5428,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 6ea2714..0037884 100644 --- a/ncurses/llib-ltic +++ b/ncurses/llib-ltic @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020 Thomas E. Dickey * + * Copyright 2020,2021 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,7 +149,7 @@ int _nc_get_token( #undef _nc_trans_string int _nc_trans_string( - char *ptr, + char *ptr, char *last) { return(*(int *)0); } @@ -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 e1625df..b9895bc 100644 --- a/ncurses/llib-ltict +++ b/ncurses/llib-ltict @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020 Thomas E. Dickey * + * Copyright 2020,2021 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,7 +149,7 @@ int _nc_get_token( #undef _nc_trans_string int _nc_trans_string( - char *ptr, + char *ptr, char *last) { return(*(int *)0); } @@ -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 6ea2714..2e407fd 100644 --- a/ncurses/llib-ltictw +++ b/ncurses/llib-ltictw @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020 Thomas E. Dickey * + * Copyright 2020,2021 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,7 +149,7 @@ int _nc_get_token( #undef _nc_trans_string int _nc_trans_string( - char *ptr, + char *ptr, char *last) { return(*(int *)0); } @@ -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 6ea2714..2e407fd 100644 --- a/ncurses/llib-lticw +++ b/ncurses/llib-lticw @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020 Thomas E. Dickey * + * Copyright 2020,2021 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,7 +149,7 @@ int _nc_get_token( #undef _nc_trans_string int _nc_trans_string( - char *ptr, + char *ptr, char *last) { return(*(int *)0); } @@ -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 27680ca..5dabf89 100644 --- a/ncurses/llib-ltinfo +++ b/ncurses/llib-ltinfo @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2019,2020 Thomas E. Dickey * + * Copyright 2019-2020,2021 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 @@ -264,12 +277,17 @@ void _nc_free_entries( void _nc_leaks_tinfo(void) { /* void */ } +#undef exit_terminfo +void exit_terminfo( + int code) + { /* void */ } + /* ./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 */ @@ -295,7 +313,7 @@ int _nc_getenv_num( #undef _nc_setenv_num void _nc_setenv_num( - const char *name, + const char *name, int value) { /* void */ } @@ -329,8 +347,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 @@ -359,7 +377,7 @@ TERMINAL *cur_term; #undef set_curterm_sp TERMINAL *set_curterm_sp( - SCREEN *sp, + SCREEN *sp, TERMINAL *termp) { return(*(TERMINAL **)0); } @@ -370,7 +388,7 @@ TERMINAL *set_curterm( #undef del_curterm_sp int del_curterm_sp( - SCREEN *sp, + SCREEN *sp, TERMINAL *termp) { return(*(int *)0); } @@ -456,7 +474,7 @@ struct kn { short offset; int code; }; #undef keyname_sp const char *keyname_sp( - SCREEN *sp, + SCREEN *sp, int c) { return(*(const char **)0); } @@ -480,7 +498,7 @@ char *longname(void) #undef napms_sp int napms_sp( - SCREEN *sp, + SCREEN *sp, int ms) { return(*(int *)0); } @@ -493,19 +511,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); } @@ -516,37 +534,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); } @@ -557,7 +575,7 @@ int curs_set( #undef typeahead_sp int typeahead_sp( - SCREEN *sp, + SCREEN *sp, int fd) { return(*(int *)0); } @@ -568,7 +586,7 @@ int typeahead( #undef has_key_sp int has_key_sp( - SCREEN *sp, + SCREEN *sp, int keycode) { return(*(int *)0); } @@ -579,14 +597,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); } @@ -648,14 +666,14 @@ 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); } @@ -672,7 +690,7 @@ int TABSIZE; #undef set_tabsize_sp int set_tabsize_sp( - SCREEN *sp, + SCREEN *sp, int value) { return(*(int *)0); } @@ -688,13 +706,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 */ } @@ -710,8 +728,8 @@ void use_tioctl( #undef _nc_get_screensize void _nc_get_screensize( - SCREEN *sp, - int *linep, + SCREEN *sp, + int *linep, int *colp) { /* void */ } @@ -722,13 +740,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 */ } @@ -747,9 +765,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); } @@ -759,8 +777,8 @@ SCREEN *new_prescr(void) #undef setupterm int setupterm( - const char *tname, - int Filedes, + const char *tname, + int Filedes, int *errret) { return(*(int *)0); } @@ -773,20 +791,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); } @@ -797,7 +815,7 @@ int tgetflag( #undef tgetnum_sp int tgetnum_sp( - SCREEN *sp, + SCREEN *sp, const char *id) { return(*(int *)0); } @@ -808,14 +826,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); } @@ -834,8 +852,8 @@ char *termname(void) #undef tgoto char *tgoto( - const char *string, - int x, + const char *string, + int x, int y) { return(*(char **)0); } @@ -843,7 +861,7 @@ char *tgoto( #undef tigetflag_sp int tigetflag_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(int *)0); } @@ -854,7 +872,7 @@ int tigetflag( #undef tigetnum_sp int tigetnum_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(int *)0); } @@ -865,7 +883,7 @@ int tigetnum( #undef tigetstr_sp char *tigetstr_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(char **)0); } @@ -881,23 +899,36 @@ int _nc_tparm_err; #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 _nc_tiparm +char *_nc_tiparm( + 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 @@ -914,7 +945,7 @@ void _nc_set_no_padding( #undef delay_output_sp int delay_output_sp( - SCREEN *sp, + SCREEN *sp, int ms) { return(*(int *)0); } @@ -934,7 +965,7 @@ void _nc_flush(void) #undef _nc_outch_sp int _nc_outch_sp( - SCREEN *sp, + SCREEN *sp, int ch) { return(*(int *)0); } @@ -945,7 +976,7 @@ int _nc_outch( #undef _nc_putchar_sp int _nc_putchar_sp( - SCREEN *sp, + SCREEN *sp, int ch) { return(*(int *)0); } @@ -956,7 +987,7 @@ int _nc_putchar( #undef putp_sp int putp_sp( - SCREEN *sp, + SCREEN *sp, const char *string) { return(*(int *)0); } @@ -967,35 +998,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); } @@ -1009,6 +1040,11 @@ const char *_nc_tputs_trace = {0}; #undef _nc_outchars long _nc_outchars; +#undef curses_trace +unsigned curses_trace( + unsigned tracelevel) + { return(*(unsigned *)0); } + #undef trace void trace( const unsigned int tracelevel) @@ -1016,7 +1052,7 @@ void trace( #undef _tracef void _tracef( - const char *fmt, + const char *fmt, ...) { /* void */ } @@ -1072,8 +1108,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); } @@ -1081,7 +1117,7 @@ char *_nc_fmt_funcptr( #undef _traceattr2 char *_traceattr2( - int bufnum, + int bufnum, chtype newmode) { return(*(char **)0); } @@ -1102,13 +1138,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); } @@ -1126,7 +1162,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 @@ -1137,7 +1173,7 @@ char *_nc_tracebits(void) #undef _nc_tracechar char *_nc_tracechar( - SCREEN *sp, + SCREEN *sp, int ch) { return(*(char **)0); } @@ -1150,7 +1186,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); } @@ -1161,7 +1197,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); } @@ -1228,9 +1264,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); } @@ -1243,8 +1279,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); } @@ -1267,14 +1303,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 */ } @@ -1282,27 +1318,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 */ @@ -1315,32 +1351,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 *dst, string_desc *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); } @@ -1348,13 +1384,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); } @@ -1369,21 +1405,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); } @@ -1391,14 +1427,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); } @@ -1411,7 +1447,7 @@ const char *unctrl( #undef _nc_visbuf2 const char *_nc_visbuf2( - int bufnum, + int bufnum, const char *buf) { return(*(const char **)0); } @@ -1422,20 +1458,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); } @@ -1443,14 +1479,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); } @@ -1464,7 +1500,7 @@ void _nc_hashed_db(void) #undef key_defined_sp int key_defined_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(int *)0); } @@ -1477,14 +1513,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); } @@ -1492,14 +1528,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 8ac9fac..7d5dcf0 100644 --- a/ncurses/llib-ltinfot +++ b/ncurses/llib-ltinfot @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2019,2020 Thomas E. Dickey * + * Copyright 2019-2020,2021 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 @@ -269,12 +282,17 @@ void _nc_free_entries( void _nc_leaks_tinfo(void) { /* void */ } +#undef exit_terminfo +void exit_terminfo( + int code) + { /* void */ } + /* ./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 */ @@ -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 */ } @@ -335,8 +353,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 @@ -375,7 +393,7 @@ TERMINAL *_nc_cur_term(void) #undef set_curterm_sp TERMINAL *set_curterm_sp( - SCREEN *sp, + SCREEN *sp, TERMINAL *termp) { return(*(TERMINAL **)0); } @@ -386,7 +404,7 @@ TERMINAL *set_curterm( #undef del_curterm_sp int del_curterm_sp( - SCREEN *sp, + SCREEN *sp, TERMINAL *termp) { return(*(int *)0); } @@ -502,7 +520,7 @@ struct kn { short offset; int code; }; #undef keyname_sp const char *keyname_sp( - SCREEN *sp, + SCREEN *sp, int c) { return(*(const char **)0); } @@ -526,7 +544,7 @@ char *longname(void) #undef napms_sp int napms_sp( - SCREEN *sp, + SCREEN *sp, int ms) { return(*(int *)0); } @@ -539,19 +557,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); } @@ -562,37 +580,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); } @@ -603,7 +621,7 @@ int curs_set( #undef typeahead_sp int typeahead_sp( - SCREEN *sp, + SCREEN *sp, int fd) { return(*(int *)0); } @@ -614,7 +632,7 @@ int typeahead( #undef has_key_sp int has_key_sp( - SCREEN *sp, + SCREEN *sp, int keycode) { return(*(int *)0); } @@ -625,14 +643,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); } @@ -694,14 +712,14 @@ 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); } @@ -740,7 +758,7 @@ int _nc_TABSIZE(void) #undef set_tabsize_sp int set_tabsize_sp( - SCREEN *sp, + SCREEN *sp, int value) { return(*(int *)0); } @@ -756,13 +774,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 */ } @@ -778,8 +796,8 @@ void use_tioctl( #undef _nc_get_screensize void _nc_get_screensize( - SCREEN *sp, - int *linep, + SCREEN *sp, + int *linep, int *colp) { /* void */ } @@ -790,13 +808,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 */ } @@ -815,9 +833,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); } @@ -835,8 +853,8 @@ SCREEN *new_prescr(void) #undef setupterm int setupterm( - const char *tname, - int Filedes, + const char *tname, + int Filedes, int *errret) { return(*(int *)0); } @@ -849,20 +867,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); } @@ -873,7 +891,7 @@ int tgetflag( #undef tgetnum_sp int tgetnum_sp( - SCREEN *sp, + SCREEN *sp, const char *id) { return(*(int *)0); } @@ -884,14 +902,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); } @@ -910,8 +928,8 @@ char *termname(void) #undef tgoto char *tgoto( - const char *string, - int x, + const char *string, + int x, int y) { return(*(char **)0); } @@ -919,7 +937,7 @@ char *tgoto( #undef tigetflag_sp int tigetflag_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(int *)0); } @@ -930,7 +948,7 @@ int tigetflag( #undef tigetnum_sp int tigetnum_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(int *)0); } @@ -941,7 +959,7 @@ int tigetnum( #undef tigetstr_sp char *tigetstr_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(char **)0); } @@ -957,23 +975,36 @@ int _nc_tparm_err; #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 _nc_tiparm +char *_nc_tiparm( + 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 @@ -990,7 +1021,7 @@ void _nc_set_no_padding( #undef delay_output_sp int delay_output_sp( - SCREEN *sp, + SCREEN *sp, int ms) { return(*(int *)0); } @@ -1010,7 +1041,7 @@ void _nc_flush(void) #undef _nc_outch_sp int _nc_outch_sp( - SCREEN *sp, + SCREEN *sp, int ch) { return(*(int *)0); } @@ -1021,7 +1052,7 @@ int _nc_outch( #undef _nc_putchar_sp int _nc_putchar_sp( - SCREEN *sp, + SCREEN *sp, int ch) { return(*(int *)0); } @@ -1032,7 +1063,7 @@ int _nc_putchar( #undef putp_sp int putp_sp( - SCREEN *sp, + SCREEN *sp, const char *string) { return(*(int *)0); } @@ -1043,35 +1074,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); } @@ -1099,6 +1130,11 @@ void _nc_count_outchars( long increment) { /* void */ } +#undef curses_trace +unsigned curses_trace( + unsigned tracelevel) + { return(*(unsigned *)0); } + #undef trace void trace( const unsigned int tracelevel) @@ -1106,7 +1142,7 @@ void trace( #undef _tracef void _tracef( - const char *fmt, + const char *fmt, ...) { /* void */ } @@ -1162,8 +1198,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); } @@ -1174,7 +1210,7 @@ int _nc_use_tracef( #undef _nc_locked_tracef void _nc_locked_tracef( - const char *fmt, + const char *fmt, ...) { /* void */ } @@ -1182,7 +1218,7 @@ void _nc_locked_tracef( #undef _traceattr2 char *_traceattr2( - int bufnum, + int bufnum, chtype newmode) { return(*(char **)0); } @@ -1203,13 +1239,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); } @@ -1227,7 +1263,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 @@ -1238,7 +1274,7 @@ char *_nc_tracebits(void) #undef _nc_tracechar char *_nc_tracechar( - SCREEN *sp, + SCREEN *sp, int ch) { return(*(char **)0); } @@ -1251,7 +1287,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); } @@ -1262,7 +1298,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); } @@ -1329,9 +1365,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); } @@ -1344,8 +1380,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); } @@ -1379,14 +1415,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 */ } @@ -1394,27 +1430,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 */ @@ -1427,32 +1463,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 *dst, string_desc *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); } @@ -1460,13 +1496,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); } @@ -1481,21 +1517,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); } @@ -1503,14 +1539,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); } @@ -1523,7 +1559,7 @@ const char *unctrl( #undef _nc_visbuf2 const char *_nc_visbuf2( - int bufnum, + int bufnum, const char *buf) { return(*(const char **)0); } @@ -1534,20 +1570,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); } @@ -1555,14 +1591,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); } @@ -1576,7 +1612,7 @@ void _nc_hashed_db(void) #undef key_defined_sp int key_defined_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(int *)0); } @@ -1589,14 +1625,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); } @@ -1604,14 +1640,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 7011dbe..0fd8d28 100644 --- a/ncurses/llib-ltinfotw +++ b/ncurses/llib-ltinfotw @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2018-2019,2020 Thomas E. Dickey * + * Copyright 2018-2020,2021 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 */ } @@ -281,6 +294,11 @@ void _nc_free_entries( void _nc_leaks_tinfo(void) { /* void */ } +#undef exit_terminfo +void exit_terminfo( + int code) + { /* void */ } + /* ./fallback.c */ #undef _nc_fallback2 @@ -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 */ } @@ -357,8 +375,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 @@ -397,7 +415,7 @@ TERMINAL *_nc_cur_term(void) #undef set_curterm_sp TERMINAL *set_curterm_sp( - SCREEN *sp, + SCREEN *sp, TERMINAL *termp) { return(*(TERMINAL **)0); } @@ -408,7 +426,7 @@ TERMINAL *set_curterm( #undef del_curterm_sp int del_curterm_sp( - SCREEN *sp, + SCREEN *sp, TERMINAL *termp) { return(*(int *)0); } @@ -524,7 +542,7 @@ struct kn { short offset; int code; }; #undef keyname_sp const char *keyname_sp( - SCREEN *sp, + SCREEN *sp, int c) { return(*(const char **)0); } @@ -548,7 +566,7 @@ char *longname(void) #undef napms_sp int napms_sp( - SCREEN *sp, + SCREEN *sp, int ms) { return(*(int *)0); } @@ -561,19 +579,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); } @@ -584,37 +602,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); } @@ -625,7 +643,7 @@ int curs_set( #undef typeahead_sp int typeahead_sp( - SCREEN *sp, + SCREEN *sp, int fd) { return(*(int *)0); } @@ -636,7 +654,7 @@ int typeahead( #undef has_key_sp int has_key_sp( - SCREEN *sp, + SCREEN *sp, int keycode) { return(*(int *)0); } @@ -647,14 +665,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); } @@ -716,14 +734,14 @@ 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); } @@ -762,7 +780,7 @@ int _nc_TABSIZE(void) #undef set_tabsize_sp int set_tabsize_sp( - SCREEN *sp, + SCREEN *sp, int value) { return(*(int *)0); } @@ -778,13 +796,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 */ } @@ -800,8 +818,8 @@ void use_tioctl( #undef _nc_get_screensize void _nc_get_screensize( - SCREEN *sp, - int *linep, + SCREEN *sp, + int *linep, int *colp) { /* void */ } @@ -812,13 +830,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 */ } @@ -837,9 +855,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); } @@ -857,8 +875,8 @@ SCREEN *new_prescr(void) #undef setupterm int setupterm( - const char *tname, - int Filedes, + const char *tname, + int Filedes, int *errret) { return(*(int *)0); } @@ -871,20 +889,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); } @@ -895,7 +913,7 @@ int tgetflag( #undef tgetnum_sp int tgetnum_sp( - SCREEN *sp, + SCREEN *sp, const char *id) { return(*(int *)0); } @@ -906,14 +924,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); } @@ -932,8 +950,8 @@ char *termname(void) #undef tgoto char *tgoto( - const char *string, - int x, + const char *string, + int x, int y) { return(*(char **)0); } @@ -941,7 +959,7 @@ char *tgoto( #undef tigetflag_sp int tigetflag_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(int *)0); } @@ -952,7 +970,7 @@ int tigetflag( #undef tigetnum_sp int tigetnum_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(int *)0); } @@ -963,7 +981,7 @@ int tigetnum( #undef tigetstr_sp char *tigetstr_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(char **)0); } @@ -979,23 +997,36 @@ int _nc_tparm_err; #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 _nc_tiparm +char *_nc_tiparm( + 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 @@ -1012,7 +1043,7 @@ void _nc_set_no_padding( #undef delay_output_sp int delay_output_sp( - SCREEN *sp, + SCREEN *sp, int ms) { return(*(int *)0); } @@ -1032,7 +1063,7 @@ void _nc_flush(void) #undef _nc_outch_sp int _nc_outch_sp( - SCREEN *sp, + SCREEN *sp, int ch) { return(*(int *)0); } @@ -1043,7 +1074,7 @@ int _nc_outch( #undef _nc_putchar_sp int _nc_putchar_sp( - SCREEN *sp, + SCREEN *sp, int ch) { return(*(int *)0); } @@ -1054,7 +1085,7 @@ int _nc_putchar( #undef putp_sp int putp_sp( - SCREEN *sp, + SCREEN *sp, const char *string) { return(*(int *)0); } @@ -1065,35 +1096,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); } @@ -1121,6 +1152,11 @@ void _nc_count_outchars( long increment) { /* void */ } +#undef curses_trace +unsigned curses_trace( + unsigned tracelevel) + { return(*(unsigned *)0); } + #undef trace void trace( const unsigned int tracelevel) @@ -1128,7 +1164,7 @@ void trace( #undef _tracef void _tracef( - const char *fmt, + const char *fmt, ...) { /* void */ } @@ -1184,8 +1220,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); } @@ -1196,7 +1232,7 @@ int _nc_use_tracef( #undef _nc_locked_tracef void _nc_locked_tracef( - const char *fmt, + const char *fmt, ...) { /* void */ } @@ -1204,7 +1240,7 @@ void _nc_locked_tracef( #undef _traceattr2 char *_traceattr2( - int bufnum, + int bufnum, chtype newmode) { return(*(char **)0); } @@ -1225,13 +1261,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); } @@ -1247,7 +1283,7 @@ chtype _nc_retrace_chtype( #undef _tracecchar_t2 char *_tracecchar_t2( - int bufnum, + int bufnum, const cchar_t *ch) { return(*(char **)0); } @@ -1260,7 +1296,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 @@ -1271,7 +1307,7 @@ char *_nc_tracebits(void) #undef _nc_tracechar char *_nc_tracechar( - SCREEN *sp, + SCREEN *sp, int ch) { return(*(char **)0); } @@ -1284,7 +1320,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); } @@ -1295,7 +1331,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); } @@ -1362,9 +1398,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); } @@ -1377,8 +1413,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); } @@ -1412,14 +1448,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 */ } @@ -1432,28 +1468,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); } @@ -1467,32 +1503,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 *dst, string_desc *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); } @@ -1500,13 +1536,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); } @@ -1521,21 +1557,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); } @@ -1550,7 +1586,7 @@ char *_nc_trim_sgr0( #undef unctrl_sp const char *unctrl_sp( - SCREEN *sp, + SCREEN *sp, chtype ch) { return(*(const char **)0); } @@ -1563,7 +1599,7 @@ const char *unctrl( #undef _nc_visbuf2 const char *_nc_visbuf2( - int bufnum, + int bufnum, const char *buf) { return(*(const char **)0); } @@ -1574,13 +1610,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); } @@ -1591,7 +1627,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); } @@ -1602,14 +1638,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); } @@ -1617,14 +1653,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); } @@ -1638,7 +1674,7 @@ void _nc_hashed_db(void) #undef key_defined_sp int key_defined_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(int *)0); } @@ -1651,14 +1687,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); } @@ -1666,14 +1702,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 7a68d70..93c9274 100644 --- a/ncurses/llib-ltinfow +++ b/ncurses/llib-ltinfow @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2018-2019,2020 Thomas E. Dickey * + * Copyright 2018-2020,2021 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 */ } @@ -276,6 +289,11 @@ void _nc_free_entries( void _nc_leaks_tinfo(void) { /* void */ } +#undef exit_terminfo +void exit_terminfo( + int code) + { /* void */ } + /* ./fallback.c */ #undef _nc_fallback2 @@ -317,7 +335,7 @@ int _nc_getenv_num( #undef _nc_setenv_num void _nc_setenv_num( - const char *name, + const char *name, int value) { /* void */ } @@ -351,8 +369,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 @@ -381,7 +399,7 @@ TERMINAL *cur_term; #undef set_curterm_sp TERMINAL *set_curterm_sp( - SCREEN *sp, + SCREEN *sp, TERMINAL *termp) { return(*(TERMINAL **)0); } @@ -392,7 +410,7 @@ TERMINAL *set_curterm( #undef del_curterm_sp int del_curterm_sp( - SCREEN *sp, + SCREEN *sp, TERMINAL *termp) { return(*(int *)0); } @@ -478,7 +496,7 @@ struct kn { short offset; int code; }; #undef keyname_sp const char *keyname_sp( - SCREEN *sp, + SCREEN *sp, int c) { return(*(const char **)0); } @@ -502,7 +520,7 @@ char *longname(void) #undef napms_sp int napms_sp( - SCREEN *sp, + SCREEN *sp, int ms) { return(*(int *)0); } @@ -515,19 +533,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); } @@ -538,37 +556,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); } @@ -579,7 +597,7 @@ int curs_set( #undef typeahead_sp int typeahead_sp( - SCREEN *sp, + SCREEN *sp, int fd) { return(*(int *)0); } @@ -590,7 +608,7 @@ int typeahead( #undef has_key_sp int has_key_sp( - SCREEN *sp, + SCREEN *sp, int keycode) { return(*(int *)0); } @@ -601,14 +619,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); } @@ -670,14 +688,14 @@ 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); } @@ -694,7 +712,7 @@ int TABSIZE; #undef set_tabsize_sp int set_tabsize_sp( - SCREEN *sp, + SCREEN *sp, int value) { return(*(int *)0); } @@ -710,13 +728,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 */ } @@ -732,8 +750,8 @@ void use_tioctl( #undef _nc_get_screensize void _nc_get_screensize( - SCREEN *sp, - int *linep, + SCREEN *sp, + int *linep, int *colp) { /* void */ } @@ -744,13 +762,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 */ } @@ -769,9 +787,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); } @@ -781,8 +799,8 @@ SCREEN *new_prescr(void) #undef setupterm int setupterm( - const char *tname, - int Filedes, + const char *tname, + int Filedes, int *errret) { return(*(int *)0); } @@ -795,20 +813,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); } @@ -819,7 +837,7 @@ int tgetflag( #undef tgetnum_sp int tgetnum_sp( - SCREEN *sp, + SCREEN *sp, const char *id) { return(*(int *)0); } @@ -830,14 +848,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); } @@ -856,8 +874,8 @@ char *termname(void) #undef tgoto char *tgoto( - const char *string, - int x, + const char *string, + int x, int y) { return(*(char **)0); } @@ -865,7 +883,7 @@ char *tgoto( #undef tigetflag_sp int tigetflag_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(int *)0); } @@ -876,7 +894,7 @@ int tigetflag( #undef tigetnum_sp int tigetnum_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(int *)0); } @@ -887,7 +905,7 @@ int tigetnum( #undef tigetstr_sp char *tigetstr_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(char **)0); } @@ -903,23 +921,36 @@ int _nc_tparm_err; #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 _nc_tiparm +char *_nc_tiparm( + 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 @@ -936,7 +967,7 @@ void _nc_set_no_padding( #undef delay_output_sp int delay_output_sp( - SCREEN *sp, + SCREEN *sp, int ms) { return(*(int *)0); } @@ -956,7 +987,7 @@ void _nc_flush(void) #undef _nc_outch_sp int _nc_outch_sp( - SCREEN *sp, + SCREEN *sp, int ch) { return(*(int *)0); } @@ -967,7 +998,7 @@ int _nc_outch( #undef _nc_putchar_sp int _nc_putchar_sp( - SCREEN *sp, + SCREEN *sp, int ch) { return(*(int *)0); } @@ -978,7 +1009,7 @@ int _nc_putchar( #undef putp_sp int putp_sp( - SCREEN *sp, + SCREEN *sp, const char *string) { return(*(int *)0); } @@ -989,35 +1020,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); } @@ -1031,6 +1062,11 @@ const char *_nc_tputs_trace = {0}; #undef _nc_outchars long _nc_outchars; +#undef curses_trace +unsigned curses_trace( + unsigned tracelevel) + { return(*(unsigned *)0); } + #undef trace void trace( const unsigned int tracelevel) @@ -1038,7 +1074,7 @@ void trace( #undef _tracef void _tracef( - const char *fmt, + const char *fmt, ...) { /* void */ } @@ -1094,8 +1130,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); } @@ -1103,7 +1139,7 @@ char *_nc_fmt_funcptr( #undef _traceattr2 char *_traceattr2( - int bufnum, + int bufnum, chtype newmode) { return(*(char **)0); } @@ -1124,13 +1160,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); } @@ -1146,7 +1182,7 @@ chtype _nc_retrace_chtype( #undef _tracecchar_t2 char *_tracecchar_t2( - int bufnum, + int bufnum, const cchar_t *ch) { return(*(char **)0); } @@ -1159,7 +1195,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 @@ -1170,7 +1206,7 @@ char *_nc_tracebits(void) #undef _nc_tracechar char *_nc_tracechar( - SCREEN *sp, + SCREEN *sp, int ch) { return(*(char **)0); } @@ -1183,7 +1219,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); } @@ -1194,7 +1230,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); } @@ -1261,9 +1297,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); } @@ -1276,8 +1312,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); } @@ -1300,14 +1336,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 */ } @@ -1320,28 +1356,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); } @@ -1355,32 +1391,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 *dst, string_desc *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); } @@ -1388,13 +1424,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); } @@ -1409,21 +1445,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); } @@ -1438,7 +1474,7 @@ char *_nc_trim_sgr0( #undef unctrl_sp const char *unctrl_sp( - SCREEN *sp, + SCREEN *sp, chtype ch) { return(*(const char **)0); } @@ -1451,7 +1487,7 @@ const char *unctrl( #undef _nc_visbuf2 const char *_nc_visbuf2( - int bufnum, + int bufnum, const char *buf) { return(*(const char **)0); } @@ -1462,13 +1498,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); } @@ -1479,7 +1515,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); } @@ -1490,14 +1526,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); } @@ -1505,14 +1541,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); } @@ -1526,7 +1562,7 @@ void _nc_hashed_db(void) #undef key_defined_sp int key_defined_sp( - SCREEN *sp, + SCREEN *sp, const char *str) { return(*(int *)0); } @@ -1539,14 +1575,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); } @@ -1554,14 +1590,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/modules b/ncurses/modules index f4c3e8b..e111712 100644 --- a/ncurses/modules +++ b/ncurses/modules @@ -1,4 +1,4 @@ -# $Id: modules,v 1.124 2020/02/02 23:34:34 tom Exp $ +# $Id: modules,v 1.127 2020/09/12 17:58:12 tom Exp $ ############################################################################## # Copyright 2019,2020 Thomas E. Dickey # # Copyright 1998-2013,2017 Free Software Foundation, Inc. # @@ -241,6 +241,12 @@ wcwidth lib $(win32con) $(HEADER_DEPS) widechars lib $(wide) $(HEADER_DEPS) win_driver lib $(win32con) $(HEADER_DEPS) +@ port_win32 +lib_win32con lib $(tinfo) $(HEADER_DEPS) +lib_win32util lib $(tinfo) $(HEADER_DEPS) +wcwidth lib $(win32con) $(HEADER_DEPS) +win32_driver lib $(win32con) $(HEADER_DEPS) + @ port_tinfo tinfo_driver lib $(tinfo) $(HEADER_DEPS) $(INCDIR)/tic.h diff --git a/ncurses/new_pair.h b/ncurses/new_pair.h index 811abc1..49d7e8b 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.10 2020/02/02 23:34:34 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) \ @@ -77,8 +86,7 @@ typedef enum { cpKEEP = -1, /* color pair 0 */ cpFREE = 0, /* free for use */ - cpINIT = 1, /* init_pair() */ - cpAUTO = 1 /* alloc_pair() */ + cpINIT = 1 /* initialized */ } CPMODE; typedef struct _color_pairs diff --git a/ncurses/report_offsets.c b/ncurses/report_offsets.c index 2e7083a..83f6f38 100644 --- a/ncurses/report_offsets.c +++ b/ncurses/report_offsets.c @@ -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 * @@ -33,7 +33,7 @@ #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.22 2021/08/19 19:51:33 tom Exp $") #define show_size(type) \ flag = 0; \ @@ -175,6 +175,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 +188,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,6 +204,11 @@ 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); show_NORMAL(NCURSES_GLOBALS, _nc_windowlist); #if USE_HOME_TERMINFO @@ -212,10 +227,13 @@ main(void) 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 +242,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 0000000..ce7a986 --- /dev/null +++ b/ncurses/term.priv.h @@ -0,0 +1,332 @@ +/**************************************************************************** + * Copyright 2021 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.6 2021/09/26 20:43:08 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> + +#undef NCURSES_OPAQUE +#define NCURSES_INTERNALS 1 +#define NCURSES_OPAQUE 0 + +#include <limits.h> /* PATH_MAX */ +#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 + +/* + * 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; + + 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; + 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 + +#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; + +#ifdef __cplusplus +} +#endif + +/* *INDENT-ON* */ + +#endif /* _TERM_PRIV_H */ diff --git a/ncurses/tinfo/MKcaptab.sh b/ncurses/tinfo/MKcaptab.sh index c800023..c800023 100755..100644 --- a/ncurses/tinfo/MKcaptab.sh +++ b/ncurses/tinfo/MKcaptab.sh diff --git a/ncurses/tinfo/MKfallback.sh b/ncurses/tinfo/MKfallback.sh index 319ab06..64c65f1 100755..100644 --- a/ncurses/tinfo/MKfallback.sh +++ b/ncurses/tinfo/MKfallback.sh @@ -27,7 +27,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: MKfallback.sh,v 1.24 2020/02/08 21:52:37 tom Exp $ +# $Id: MKfallback.sh,v 1.25 2020/08/16 15:58:44 tom Exp $ # # MKfallback.sh -- create fallback table for entry reads # @@ -44,12 +44,14 @@ terminfo_src=$1 shift tic_path=$1 +test -z "$tic_path" && tic_path=tic shift infocmp_path=$1 +test -z "$infocmp_path" && infocmp_path=infocmp shift -case $tic_path in #(vi +case "$tic_path" in #(vi /*) tic_head=`echo "$tic_path" | sed -e 's,/[^/]*$,,'` PATH=$tic_head:$PATH @@ -67,7 +69,7 @@ if test $# != 0 ; then TERMINFO_DIRS=$TERMINFO:$terminfo_dir export TERMINFO_DIRS - $tic_path -x $terminfo_src >&2 + "$tic_path" -x "$terminfo_src" >&2 else tmp_info= fi @@ -90,10 +92,10 @@ then /* fallback entries for: $* */ EOF - for x in $* + for x in "$@" do echo "/* $x */" - $infocmp_path -E $x | sed -e 's/\<short\>/NCURSES_INT2/g' + "$infocmp_path" -E "$x" | sed -e 's/\<short\>/NCURSES_INT2/g' done cat <<EOF @@ -101,10 +103,10 @@ static const TERMTYPE2 fallbacks[$#] = { EOF comma="" - for x in $* + for x in "$@" do echo "$comma /* $x */" - $infocmp_path -e $x + "$infocmp_path" -e "$x" comma="," done diff --git a/ncurses/tinfo/MKkeys_list.sh b/ncurses/tinfo/MKkeys_list.sh index 3b8beae..3b8beae 100755..100644 --- a/ncurses/tinfo/MKkeys_list.sh +++ b/ncurses/tinfo/MKkeys_list.sh diff --git a/ncurses/tinfo/MKuserdefs.sh b/ncurses/tinfo/MKuserdefs.sh index 109dd64..109dd64 100755..100644 --- a/ncurses/tinfo/MKuserdefs.sh +++ b/ncurses/tinfo/MKuserdefs.sh diff --git a/ncurses/tinfo/access.c b/ncurses/tinfo/access.c index c69707f..a735db2 100644 --- a/ncurses/tinfo/access.c +++ b/ncurses/tinfo/access.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2019,2020 Thomas E. Dickey * + * Copyright 2019-2020,2021 Thomas E. Dickey * * Copyright 1998-2011,2012 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -35,12 +35,26 @@ #include <ctype.h> +#ifndef USE_ROOT_ACCESS +#if HAVE_SETFSUID +#include <sys/fsuid.h> +#else +#include <sys/stat.h> +#endif +#endif + #include <tic.h> -MODULE_ID("$Id: access.c,v 1.25 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: access.c,v 1.31 2021/08/29 10:35:17 tom Exp $") #define LOWERCASE(c) ((isalpha(UChar(c)) && isupper(UChar(c))) ? tolower(UChar(c)) : (c)) +#ifdef _NC_MSC +# define ACCESS(FN, MODE) access((FN), (MODE)&(R_OK|W_OK)) +#else +# define ACCESS access +#endif + NCURSES_EXPORT(char *) _nc_rootname(char *path) { @@ -112,7 +126,7 @@ _nc_access(const char *path, int mode) if (path == 0) { result = -1; - } else if (access(path, mode) < 0) { + } else if (ACCESS(path, mode) < 0) { if ((mode & W_OK) != 0 && errno == ENOENT && strlen(path) < PATH_MAX) { @@ -127,7 +141,7 @@ _nc_access(const char *path, int mode) if (head == leaf) _nc_STRCPY(head, ".", sizeof(head)); - result = access(head, R_OK | W_OK | X_OK); + result = ACCESS(head, R_OK | W_OK | X_OK); } else { result = -1; } @@ -163,6 +177,32 @@ _nc_is_file_path(const char *path) return result; } +#if HAVE_ISSETUGID +#define is_elevated() issetugid() +#elif HAVE_GETEUID && HAVE_GETEGID +#define is_elevated() \ + (getuid() != geteuid() \ + || getgid() != getegid()) +#else +#define is_elevated() FALSE +#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 + #ifndef USE_ROOT_ENVIRON /* * Returns true if we allow application to use environment variables that are @@ -171,15 +211,50 @@ _nc_is_file_path(const char *path) 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 (is_elevated()) { + result = FALSE; + } else if ((getuid() == ROOT_UID) || (geteuid() == ROOT_UID)) { + result = FALSE; + } + return result; +} +#endif /* USE_ROOT_ENVIRON */ + +#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 - /* ...finally, disallow root */ - return (getuid() != ROOT_UID) && (geteuid() != ROOT_UID); + 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_ENVIRON */ diff --git a/ncurses/tinfo/alloc_entry.c b/ncurses/tinfo/alloc_entry.c index 4bf7d6c..c13f86e 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-2020,2021 Thomas E. Dickey * * Copyright 1998-2013,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: alloc_entry.c,v 1.64 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: alloc_entry.c,v 1.66 2021/08/08 00:09:37 tom Exp $") #define ABSENT_OFFSET -1 #define CANCELLED_OFFSET -2 @@ -93,14 +93,14 @@ _nc_copy_entry(ENTRY * oldp) /* 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(""); + string = ""; len = strlen(string) + 1; if (len == 1 && next_free != 0) { @@ -242,7 +242,7 @@ _nc_merge_entry(ENTRY * const target, ENTRY * const source) _nc_align_termtype(to, from); #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) diff --git a/ncurses/tinfo/alloc_ttype.c b/ncurses/tinfo/alloc_ttype.c index 222868e..cb82411 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-2020,2021 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.35 2021/06/17 21:11:08 tom Exp $") #if NCURSES_XNAMES /* @@ -429,7 +429,7 @@ _nc_align_termtype(TERMTYPE2 *to, TERMTYPE2 *from) 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; @@ -450,7 +450,7 @@ _nc_align_termtype(TERMTYPE2 *to, TERMTYPE2 *from) 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). diff --git a/ncurses/tinfo/captoinfo.c b/ncurses/tinfo/captoinfo.c index 8b3b83d..7e14731 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.98 2020/02/02 23:34:34 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) @@ -216,12 +216,15 @@ cvtchar(register const char *sp) } break; case '^': + len = 2; c = UChar(*++sp); - if (c == '?') + if (c == '?') { c = 127; - else + } else if (c == '\0') { + len = 1; + } else { c &= 0x1f; - len = 2; + } break; default: c = UChar(*sp); @@ -631,12 +634,15 @@ _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; if (padding > str && *padding == '>') { - if (*--padding == '/') + if (padding > (str + 1) && *--padding == '/') --padding; while (isdigit(UChar(*padding)) || *padding == '.' || *padding == '*') padding--; @@ -670,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"); @@ -929,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_expand.c b/ncurses/tinfo/comp_expand.c index 02e38e6..724283c 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 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.34 2021/09/04 10:29:15 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)) { @@ -162,12 +165,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 +206,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_parse.c b/ncurses/tinfo/comp_parse.c index ab25d5b..2bc9485 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-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 * @@ -48,10 +48,10 @@ #include <tic.h> -MODULE_ID("$Id: comp_parse.c,v 1.109 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: comp_parse.c,v 1.113 2021/05/08 15:03:42 tom Exp $") static void sanity_check2(TERMTYPE2 *, bool); -NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype2) (TERMTYPE2 *, bool) = sanity_check2; +NCURSES_IMPEXP void (NCURSES_API *_nc_check_termtype2) (TERMTYPE2 *, bool) = sanity_check2; static void fixup_acsc(TERMTYPE2 *, int); @@ -392,7 +392,7 @@ _nc_resolve_uses2(bool fullresolve, bool literal) { ENTRY *qp, *rp, *lastread = 0; bool keepgoing; - unsigned i; + unsigned i, j; int unresolved, total_unresolved, multiples; DEBUG(2, ("RESOLUTION BEGINNING")); @@ -454,6 +454,16 @@ _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; + } + } } } @@ -475,6 +485,16 @@ _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; + } + } } } diff --git a/ncurses/tinfo/comp_scan.c b/ncurses/tinfo/comp_scan.c index 87929d2..08e0e7e 100644 --- a/ncurses/tinfo/comp_scan.c +++ b/ncurses/tinfo/comp_scan.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 * @@ -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.112 2021/10/04 23:56:28 tom Exp $") /* * Maximum length of string capability we'll accept before raising an error. @@ -136,7 +136,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; } @@ -556,7 +556,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 = ':'; @@ -587,10 +587,11 @@ _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); diff --git a/ncurses/tinfo/doalloc.c b/ncurses/tinfo/doalloc.c index f0c8141..e3b1a2e 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.12 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: doalloc.c,v 1.14 2021/04/24 23:43:39 tom Exp $") -NCURSES_EXPORT(void *) +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/lib_baudrate.c b/ncurses/tinfo/lib_baudrate.c index 4f72de5..311c41a 100644 --- a/ncurses/tinfo/lib_baudrate.c +++ b/ncurses/tinfo/lib_baudrate.c @@ -84,7 +84,7 @@ #undef USE_OLD_TTY #endif /* USE_OLD_TTY */ -MODULE_ID("$Id: lib_baudrate.c,v 1.44 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_baudrate.c,v 1.45 2020/09/05 21:15:32 tom Exp $") /* * int @@ -99,6 +99,7 @@ struct speed { int actual_speed; /* the actual speed */ }; +#if !defined(EXP_WIN32_DRIVER) #define DATA(number) { B##number, number } static struct speed const speeds[] = @@ -188,10 +189,16 @@ static struct speed const speeds[] = #endif #endif }; +#endif /* !EXP_WIN32_DRIVER */ NCURSES_EXPORT(int) _nc_baudrate(int OSpeed) { +#if defined(EXP_WIN32_DRIVER) + /* On Windows this is a noop */ + (void) OSpeed; + return (OK); +#else #if !USE_REENTRANT static int last_OSpeed; static int last_baudrate; @@ -230,13 +237,16 @@ _nc_baudrate(int OSpeed) #endif } return (result); +#endif /* !EXP_WIN32_DRIVER */ } NCURSES_EXPORT(int) _nc_ospeed(int BaudRate) { int result = 1; - +#if defined(EXP_WIN32_DRIVER) + (void) BaudRate; +#else if (BaudRate >= 0) { unsigned i; @@ -247,6 +257,7 @@ _nc_ospeed(int BaudRate) } } } +#endif return (result); } @@ -257,6 +268,9 @@ NCURSES_SP_NAME(baudrate) (NCURSES_SP_DCL0) T((T_CALLED("baudrate(%p)"), (void *) SP_PARM)); +#if defined(EXP_WIN32_DRIVER) + result = OK; +#else /* * In debugging, allow the environment symbol to override when we're * redirecting to a file, so we can construct repeatable test-cases @@ -290,7 +304,7 @@ NCURSES_SP_NAME(baudrate) (NCURSES_SP_DCL0) } else { result = ERR; } - +#endif /* !EXP_WIN32_DRIVER */ returnCode(result); } diff --git a/ncurses/tinfo/lib_cur_term.c b/ncurses/tinfo/lib_cur_term.c index 4a90335..0373aeb 100644 --- a/ncurses/tinfo/lib_cur_term.c +++ b/ncurses/tinfo/lib_cur_term.c @@ -39,8 +39,9 @@ #include <curses.priv.h> #include <termcap.h> /* ospeed */ +#include <tic.h> /* VALID_STRING */ -MODULE_ID("$Id: lib_cur_term.c,v 1.42 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_cur_term.c,v 1.43 2020/10/24 18:54:32 tom Exp $") #undef CUR #define CUR TerminalType(termp). @@ -99,13 +100,13 @@ NCURSES_SP_NAME(set_curterm) (NCURSES_SP_DCLx TERMINAL *termp) if (TCB->drv && TCB->drv->isTerminfo && TerminalType(termp).Strings) { - PC = (char) ((pad_char != NULL) ? pad_char[0] : 0); + PC = (char) (VALID_STRING(pad_char) ? pad_char[0] : 0); } TCB->csp = SP_PARM; #else ospeed = (NCURSES_OSPEED) _nc_ospeed(termp->_baudrate); if (TerminalType(termp).Strings) { - PC = (char) ((pad_char != NULL) ? pad_char[0] : 0); + PC = (char) (VALID_STRING(pad_char) ? pad_char[0] : 0); } #endif #if !USE_REENTRANT diff --git a/ncurses/tinfo/lib_data.c b/ncurses/tinfo/lib_data.c index bf3e554..8bebc3d 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-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 * @@ -43,7 +43,7 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_data.c,v 1.80 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_data.c,v 1.85 2021/09/04 10:54:35 tom Exp $") /* * OS/2's native linker complains if we don't initialize public data when @@ -155,6 +155,11 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = { 0, /* dbd_time */ { { 0, 0 } }, /* dbd_vars */ +#if HAVE_TSEARCH + NULL, /* cached_tparm */ + 0, /* count_tparm */ +#endif /* HAVE_TSEARCH */ + #ifdef USE_TERM_DRIVER 0, /* term_driver */ #endif @@ -246,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 */ diff --git a/ncurses/tinfo/lib_kernel.c b/ncurses/tinfo/lib_kernel.c index 482657a..d5b021b 100644 --- a/ncurses/tinfo/lib_kernel.c +++ b/ncurses/tinfo/lib_kernel.c @@ -49,8 +49,9 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_kernel.c,v 1.32 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_kernel.c,v 1.34 2020/11/21 22:05:58 tom Exp $") +#ifdef TERMIOS static int _nc_vdisable(void) { @@ -71,6 +72,7 @@ _nc_vdisable(void) #endif return value; } +#endif /* TERMIOS */ /* * erasechar() @@ -92,6 +94,8 @@ NCURSES_SP_NAME(erasechar) (NCURSES_SP_DCL0) result = termp->Ottyb.c_cc[VERASE]; if (result == _nc_vdisable()) result = ERR; +#elif defined(EXP_WIN32_DRIVER) + result = ERR; #else result = termp->Ottyb.sg_erase; #endif @@ -127,6 +131,8 @@ NCURSES_SP_NAME(killchar) (NCURSES_SP_DCL0) result = termp->Ottyb.c_cc[VKILL]; if (result == _nc_vdisable()) result = ERR; +#elif defined(EXP_WIN32_DRIVER) + result = ERR; #else result = termp->Ottyb.sg_kill; #endif @@ -162,7 +168,11 @@ NCURSES_SP_NAME(flushinp) (NCURSES_SP_DCL0) #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 diff --git a/ncurses/tinfo/lib_longname.c b/ncurses/tinfo/lib_longname.c index 835d15c..9dc6d71 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 99dacd7..3a9fc31 100644 --- a/ncurses/tinfo/lib_napms.c +++ b/ncurses/tinfo/lib_napms.c @@ -52,7 +52,7 @@ #endif #endif -MODULE_ID("$Id: lib_napms.c,v 1.26 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_napms.c,v 1.27 2020/08/15 19:45:23 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(napms) (NCURSES_SP_DCLx int ms) @@ -75,6 +75,8 @@ NCURSES_SP_NAME(napms) (NCURSES_SP_DCLx int ms) request = remaining; } } +#elif defined(_NC_WINDOWS) + Sleep((DWORD) ms); #else _nc_timed_wait(0, 0, ms, (int *) 0 EVENTLIST_2nd(0)); #endif diff --git a/ncurses/tinfo/lib_options.c b/ncurses/tinfo/lib_options.c index 784e06c..017a34a 100644 --- a/ncurses/tinfo/lib_options.c +++ b/ncurses/tinfo/lib_options.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 * @@ -47,7 +47,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_options.c,v 1.81 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_options.c,v 1.82 2021/02/14 00:17:35 tom Exp $") NCURSES_EXPORT(int) idlok(WINDOW *win, bool flag) @@ -361,7 +361,7 @@ _nc_keypad(SCREEN *sp, int flag) #else if (flag) { (void) NCURSES_PUTP2_FLUSH("keypad_xmit", keypad_xmit); - } else if (!flag && keypad_local) { + } else if (keypad_local) { (void) NCURSES_PUTP2_FLUSH("keypad_local", keypad_local); } diff --git a/ncurses/tinfo/lib_print.c b/ncurses/tinfo/lib_print.c index eb92149..aa65041 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-2020,2021 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.25 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_print.c,v 1.30 2021/04/18 14:58:57 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; @@ -60,7 +60,7 @@ NCURSES_SP_NAME(mcprint) (NCURSES_SP_DCLx char *data, int len) } if (prtr_non) { - switchon = TPARM_1(prtr_non, len); + switchon = TIPARM_1(prtr_non, len); onsize = strlen(switchon); offsize = 0; } else { @@ -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); } @@ -96,7 +97,7 @@ NCURSES_SP_NAME(mcprint) (NCURSES_SP_DCLx char *data, int len) * kernel will ship the contiguous clist items from the last write * immediately. */ -#ifndef _WIN32 +#ifndef _NC_WINDOWS (void) sleep(0); #endif free(mybuf); diff --git a/ncurses/tinfo/lib_raw.c b/ncurses/tinfo/lib_raw.c index a691a26..1e47f3b 100644 --- a/ncurses/tinfo/lib_raw.c +++ b/ncurses/tinfo/lib_raw.c @@ -50,7 +50,7 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_raw.c,v 1.24 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_raw.c,v 1.26 2020/11/21 22:07:48 tom Exp $") #if HAVE_SYS_TERMIO_H #include <sys/termio.h> /* needed for ISC */ @@ -97,6 +97,8 @@ NCURSES_SP_NAME(raw) (NCURSES_SP_DCL0) buf.c_iflag &= (unsigned) ~(COOKED_INPUT); buf.c_cc[VMIN] = 1; buf.c_cc[VTIME] = 0; +#elif defined(EXP_WIN32_DRIVER) + buf.dwFlagIn &= (unsigned long) ~CONMODE_NORAW; #else buf.sg_flags |= RAW; #endif @@ -152,6 +154,9 @@ NCURSES_SP_NAME(cbreak) (NCURSES_SP_DCL0) buf.c_lflag |= ISIG; buf.c_cc[VMIN] = 1; buf.c_cc[VTIME] = 0; +#elif defined(EXP_WIN32_DRIVER) + buf.dwFlagIn |= CONMODE_NORAW; + buf.dwFlagIn &= (unsigned long) ~CONMODE_NOCBREAK; #else buf.sg_flags |= CBREAK; #endif @@ -231,6 +236,8 @@ NCURSES_SP_NAME(noraw) (NCURSES_SP_DCL0) buf.c_lflag |= ISIG | ICANON | (termp->Ottyb.c_lflag & IEXTEN); buf.c_iflag |= COOKED_INPUT; +#elif defined(EXP_WIN32_DRIVER) + buf.dwFlagIn |= CONMODE_NORAW; #else buf.sg_flags &= ~(RAW | CBREAK); #endif @@ -283,6 +290,8 @@ NCURSES_SP_NAME(nocbreak) (NCURSES_SP_DCL0) #ifdef TERMIOS buf.c_lflag |= ICANON; buf.c_iflag |= ICRNL; +#elif defined(EXP_WIN32_DRIVER) + buf.dwFlagIn |= (CONMODE_NOCBREAK | CONMODE_NORAW); #else buf.sg_flags &= ~CBREAK; #endif diff --git a/ncurses/tinfo/lib_setup.c b/ncurses/tinfo/lib_setup.c index a6527bf..0aaaa93 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-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 * @@ -49,7 +49,7 @@ #include <locale.h> #endif -MODULE_ID("$Id: lib_setup.c,v 1.207 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_setup.c,v 1.214 2021/09/01 23:38:12 tom Exp $") /**************************************************************************** * @@ -66,7 +66,7 @@ MODULE_ID("$Id: lib_setup.c,v 1.207 2020/02/02 23:34:34 tom 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> @@ -305,11 +305,19 @@ _nc_get_screensize(SCREEN *sp, bool useEnv = _nc_prescreen.use_env; bool useTioctl = _nc_prescreen.use_tioctl; +#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 + */ + _nc_console_size(linep, colp); + T(("screen size: winconsole lines = %d columns = %d", *linep, *colp)); +#else /* figure out the size of the screen */ T(("screen size: terminfo lines = %d columns = %d", lines, columns)); *linep = (int) lines; *colp = (int) columns; +#endif #if NCURSES_SP_FUNCS if (sp) { @@ -566,7 +574,7 @@ NCURSES_EXPORT(int) _nc_unicode_locale(void) { int result = 0; -#if defined(_WIN32) && USE_WIDEC_SUPPORT +#if defined(_NC_WINDOWS) && USE_WIDEC_SUPPORT result = 1; #elif HAVE_LANGINFO_CODESET char *env = nl_langinfo(CODESET); @@ -655,13 +663,20 @@ TINFO_SETUP_TERM(TERMINAL **tp, if (tname == 0) { tname = getenv("TERM"); - if (tname == 0 || *tname == '\0') { -#ifdef USE_TERM_DRIVER +#if defined(EXP_WIN32_DRIVER) + if (!VALID_TERM_ENV(tname, NO_TERMINAL)) { + T(("Failure with TERM=%s", NonNull(tname))); + ret_error0(TGETENT_ERR, "TERM environment variable not set.\n"); + } +#elif defined(USE_TERM_DRIVER) + if (!NonEmpty(tname)) tname = "unknown"; #else + if (!NonEmpty(tname)) { + T(("Failure with TERM=%s", NonNull(tname))); ret_error0(TGETENT_ERR, "TERM environment variable not set.\n"); -#endif } +#endif } myname = strdup(tname); @@ -680,6 +695,10 @@ TINFO_SETUP_TERM(TERMINAL **tp, */ if (Filedes == STDOUT_FILENO && !NC_ISATTY(Filedes)) Filedes = STDERR_FILENO; +#if defined(EXP_WIN32_DRIVER) + if (Filedes != STDERR_FILENO && NC_ISATTY(Filedes)) + _setmode(Filedes, _O_BINARY); +#endif /* * Check if we have already initialized to use this terminal. If so, we @@ -783,6 +802,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"); } } diff --git a/ncurses/tinfo/lib_tgoto.c b/ncurses/tinfo/lib_tgoto.c index 8e24085..9cf5e10 100644 --- a/ncurses/tinfo/lib_tgoto.c +++ b/ncurses/tinfo/lib_tgoto.c @@ -36,7 +36,7 @@ #include <ctype.h> #include <termcap.h> -MODULE_ID("$Id: lib_tgoto.c,v 1.19 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_tgoto.c,v 1.21 2020/05/27 23:55:56 tom Exp $") #if !PURE_TERMINFO static bool @@ -207,6 +207,6 @@ tgoto(const char *string, int x, int y) result = tgoto_internal(string, x, y); else #endif - result = TPARM_2(string, y, x); + result = TIPARM_2(string, y, x); returnPtr(result); } diff --git a/ncurses/tinfo/lib_tparm.c b/ncurses/tinfo/lib_tparm.c index 400cd31..72d8813 100644 --- a/ncurses/tinfo/lib_tparm.c +++ b/ncurses/tinfo/lib_tparm.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 * @@ -38,12 +38,22 @@ * */ +#define entry _ncu_entry +#define ENTRY _ncu_ENTRY + #include <curses.priv.h> +#undef entry +#undef ENTRY + +#if HAVE_TSEARCH +#include <search.h> +#endif + #include <ctype.h> #include <tic.h> -MODULE_ID("$Id: lib_tparm.c,v 1.108 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_tparm.c,v 1.134 2021/08/21 21:52:08 tom Exp $") /* * char * @@ -107,128 +117,245 @@ MODULE_ID("$Id: lib_tparm.c,v 1.108 2020/02/02 23:34:34 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++ + +typedef struct { + const char *format; /* format-string can be used as cache-key */ + int tparm_type; /* bit-set for each string-parameter */ + int num_actual; + int num_parsed; + int num_popped; + TPARM_ARG param[NUM_PARM]; + char *p_is_s[NUM_PARM]; +} TPARM_DATA; + +#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 */ + +#if HAVE_TSEARCH +static int +cmp_format(const void *p, const void *q) +{ + const char *a = *(char *const *) p; + const char *b = *(char *const *) q; + return strcmp(a, b); +} +#endif + #if NO_LEAKS +#if HAVE_TSEARCH +static void +visit_nodes(const void *nodep, const VISIT which, const int depth) +{ + (void) depth; + if (which == preorder || which == leaf) { + delete_tparm[which_tparm] = *(TPARM_DATA **) nodep; + which_tparm++; + } +} +#endif + NCURSES_EXPORT(void) _nc_free_tparm(void) { - if (TPS(out_buff) != 0) { - FreeAndNull(TPS(out_buff)); - TPS(out_size) = 0; - TPS(out_used) = 0; - FreeAndNull(TPS(fmt_buff)); - TPS(fmt_size) = 0; + TPARM_STATE *tps = get_tparm_state(cur_term); /* FIXME */ +#if HAVE_TSEARCH + if (MyCount != 0) { + delete_tparm = typeCalloc(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]; + if (ptr != NULL) { + tdelete(ptr, &MyCache, cmp_format); + free((char *) ptr->format); + free(ptr); + } + } + which_tparm = 0; + twalk(MyCache, visit_nodes); + FreeAndNull(delete_tparm); + MyCount = 0; + which_tparm = 0; } +#endif + FreeAndNull(TPS(out_buff)); + TPS(out_size) = 0; + TPS(out_used) = 0; + + 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)); - } + 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 = strlen(s); - if (len > (int) s_len) - s_len = (size_t) len; + (get_space) (TPARM_STATE *tps, size_t need) { + get_space(tps, need); +} - get_space(s_len + 1); +#undef get_space +#endif - _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)); +#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) -{ - if (len < 30) - len = 30; /* actually log10(MAX_INT)+1 */ + (save_text) (TPARM_STATE *tps, const char *fmt, const char *s, int len) { + save_text(tps, fmt, s, len); +} - get_space((size_t) len + 1); +#undef save_text +#endif - _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)); +#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) -{ - static char dummy[] = ""; /* avoid const-cast */ - 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) @@ -325,10 +452,6 @@ parse_format(const char *s, char *format, int *len) return s; } -#define isUPPER(c) ((c) >= 'A' && (c) <= 'Z') -#define isLOWER(c) ((c) >= 'a' && (c) <= 'z') -#define tc_BUMP() if (level < 0 && number < 2) number++ - /* * Analyze the string to see how many parameters we need from the varargs list, * and what their types are. We will only accept string parameters if they @@ -341,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[NUM_PARM], 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; @@ -350,7 +474,6 @@ _nc_tparm_analyze(const char *string, char *p_is_s[NUM_PARM], int *popcount) int number = 0; int level = -1; const char *cp = string; - static char dummy[] = ""; if (cp == 0) return 0; @@ -469,109 +592,215 @@ _nc_tparm_analyze(const char *string, char *p_is_s[NUM_PARM], int *popcount) return number; } -static NCURSES_INLINE char * -tparam_internal(int use_TPARM_ARG, const char *string, va_list ap) +/* + * Analyze the capability string, finding the number of parameters and their + * types. + * + * TODO: cache the result so that this is done once per capability per term. + */ +static int +tparm_setup(TERMINAL *term, const char *string, TPARM_DATA *result) { - char *p_is_s[NUM_PARM]; - TPARM_ARG param[NUM_PARM]; - int popcount = 0; - int number; - int num_args; - int len; - int level; - int x, y; - int i; - const char *cp = string; - size_t len2; - bool termcap_hack; - bool incremented_two; + TPARM_STATE *tps = get_tparm_state(term); + int rc = OK; + + TPS(out_used) = 0; + memset(result, 0, sizeof(*result)); - if (cp == NULL) { + if (string == NULL) { TR(TRACE_CALLS, ("%s: format is null", TPS(tname))); - return NULL; - } + rc = ERR; + } else { +#if HAVE_TSEARCH + TPARM_DATA *fs; + void *ft; + + 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 + { + /* + * Find the highest parameter-number referred to in the format + * string. Use this value to limit the number of arguments copied + * from the variable-length argument list. + */ + result->num_parsed = _nc_tparm_analyze(term, string, + result->p_is_s, + &(result->num_popped)); + if (TPS(fmt_buff) == 0) { + TR(TRACE_CALLS, ("%s: error in analysis", TPS(tname))); + rc = ERR; + } else { + int n; - TPS(out_used) = 0; - len2 = strlen(cp); + if (result->num_parsed > NUM_PARM) + 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); - /* - * Find the highest parameter-number referred to in the format string. - * Use this value to limit the number of arguments copied from the - * variable-length argument list. - */ - number = _nc_tparm_analyze(cp, p_is_s, &popcount); - if (TPS(fmt_buff) == 0) { - TR(TRACE_CALLS, ("%s: error in analysis", TPS(tname))); - return NULL; + for (n = 0; n < result->num_actual; ++n) { + if (result->p_is_s[n]) + result->tparm_type |= (1 << n); + } +#if HAVE_TSEARCH + if ((fs = typeCalloc(TPARM_DATA, 1)) != 0) { + *fs = *result; + if ((fs->format = strdup(string)) != 0) { + if (tsearch(fs, &MyCache, cmp_format) != 0) { + ++MyCount; + } else { + free(fs); + rc = ERR; + } + } else { + free(fs); + rc = ERR; + } + } else { + rc = ERR; + } +#endif + } + } } - incremented_two = FALSE; + return rc; +} - if (number > NUM_PARM) - number = NUM_PARM; - if (popcount > NUM_PARM) - popcount = NUM_PARM; - num_args = max(popcount, number); +/* + * A few caps (such as plab_norm) have string-valued parms. We'll have to + * assume that the caller knows the difference, since a char* and an int may + * not be the same size on the stack. The normal prototype for tparm uses 9 + * 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) +{ + int i; - for (i = 0; i < num_args; i++) { - /* - * A few caps (such as plab_norm) have string-valued parms. - * We'll have to assume that the caller knows the difference, since - * a char* and an int may not be the same size on the stack. The - * normal prototype for this uses 9 long's, which is consistent with - * our va_arg() usage. - */ - if (p_is_s[i] != 0) { - p_is_s[i] = va_arg(ap, char *); - param[i] = 0; + for (i = 0; i < data->num_actual; i++) { + if (data->p_is_s[i] != 0) { + char *value = va_arg(ap, char *); + if (value == 0) + value = dummy; + data->p_is_s[i] = value; + data->param[i] = 0; } else if (use_TPARM_ARG) { - param[i] = va_arg(ap, TPARM_ARG); + data->param[i] = va_arg(ap, TPARM_ARG); } else { - param[i] = (TPARM_ARG) va_arg(ap, int); + data->param[i] = (TPARM_ARG) va_arg(ap, int); } } +} + +/* + * This is a termcap compatibility hack. If there are no explicit pop + * operations in the string, load the stack in such a way that successive pops + * will grab successive parameters. That will make the expansion of (for + * example) \E[%d;%dH work correctly in termcap style, which means tparam() + * will expand termcap strings OK. + */ +static bool +tparm_tc_compat(TPARM_STATE *tps, TPARM_DATA *data) +{ + bool termcap_hack = FALSE; - /* - * This is a termcap compatibility hack. If there are no explicit pop - * operations in the string, load the stack in such a way that - * successive pops will grab successive parameters. That will make - * the expansion of (for example) \E[%d;%dH work correctly in termcap - * style, which means tparam() will expand termcap strings OK. - */ TPS(stack_ptr) = 0; - termcap_hack = FALSE; - if (popcount == 0) { + + if (data->num_popped == 0) { + int i; + termcap_hack = TRUE; - for (i = number - 1; i >= 0; i--) { - if (p_is_s[i]) - spush(p_is_s[i]); - else - npush((int) param[i]); + for (i = data->num_parsed - 1; i >= 0; i--) { + if (data->p_is_s[i]) { + spush(tps, data->p_is_s[i]); + } else { + npush(tps, (int) data->param[i]); + } } } + return termcap_hack; +} + #ifdef TRACE +static void +tparm_trace_call(TPARM_STATE *tps, const char *string, TPARM_DATA *data) +{ if (USE_TRACEF(TRACE_CALLS)) { - for (i = 0; i < num_args; i++) { - if (p_is_s[i] != 0) { - save_text(", %s", _nc_visbuf(p_is_s[i]), 0); - } else if ((long) param[i] > MAX_OF_TYPE(NCURSES_INT2) || - (long) param[i] < 0) { + int i; + for (i = 0; i < data->num_actual; i++) { + if (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, num_args); + i + 1, data->num_actual); break; } else { - save_number(", %d", (int) param[i], 0); + save_number(tps, ", %d", (int) data->param[i], 0); } } - _tracef(T_CALLED("%s(%s%s)"), TPS(tname), _nc_visbuf(cp), TPS(out_buff)); + _tracef(T_CALLED("%s(%s%s)"), TPS(tname), _nc_visbuf(string), TPS(out_buff)); TPS(out_used) = 0; _nc_unlock_global(tracef); } +} + +#else +#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(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(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(tps, string, data); + 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); @@ -579,50 +808,54 @@ tparam_internal(int use_TPARM_ARG, const char *string, va_list ap) 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': cp++; i = (UChar(*cp) - '1'); if (i >= 0 && i < NUM_PARM) { - if (p_is_s[i]) { - spush(p_is_s[i]); + if (data->p_is_s[i]) { + spush(tps, data->p_is_s[i]); } else { - npush((int) param[i]); + npush(tps, (int) data->param[i]); } } break; @@ -631,10 +864,11 @@ tparam_internal(int use_TPARM_ARG, const char *string, va_list ap) 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; @@ -642,16 +876,17 @@ tparam_internal(int use_TPARM_ARG, const char *string, va_list ap) 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; @@ -662,83 +897,95 @@ tparam_internal(int use_TPARM_ARG, const char *string, va_list ap) 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': @@ -751,15 +998,15 @@ tparam_internal(int use_TPARM_ARG, const char *string, va_list ap) */ if (!incremented_two) { incremented_two = TRUE; - if (p_is_s[0] == 0) { - param[0]++; + if (data->p_is_s[0] == 0) { + data->param[0]++; if (termcap_hack) - TPS(stack)[0].data.num = (int) param[0]; + TPS(stack)[0].data.num = (int) data->param[0]; } - if (p_is_s[1] == 0) { - param[1]++; + if (data->p_is_s[1] == 0) { + data->param[1]++; if (termcap_hack) - TPS(stack)[1].data.num = (int) param[1]; + TPS(stack)[1].data.num = (int) data->param[1]; } } break; @@ -768,7 +1015,7 @@ tparam_internal(int use_TPARM_ARG, const char *string, va_list ap) break; case 't': - x = npop(); + x = npop(tps); if (!x) { /* scan forward for %e or %; at level zero */ cp++; @@ -827,64 +1074,148 @@ tparam_internal(int use_TPARM_ARG, const char *string, va_list ap) 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) { + DEBUG(2, ("tparm: stack has %d item%s on return", + TPS(stack_ptr), + TPS(stack_ptr) == 1 ? "" : "s")); + _nc_tparm_err++; + } + T((T_RETURN("%s"), _nc_visbuf(TPS(out_buff)))); return (TPS(out_buff)); } #if NCURSES_TPARM_VARARGS -#define tparm_varargs tparm -#else -#define tparm_proto tparm -#endif NCURSES_EXPORT(char *) -tparm_varargs(const char *string, ...) +tparm(const char *string, ...) { - va_list ap; - char *result; + TPARM_STATE *tps = get_tparm_state(cur_term); + TPARM_DATA myData; + char *result = NULL; _nc_tparm_err = 0; - va_start(ap, string); #ifdef TRACE - TPS(tname) = "tparm"; + tps->tname = "tparm"; #endif /* TRACE */ - result = tparam_internal(TRUE, string, ap); - va_end(ap); + + if (tparm_setup(cur_term, string, &myData) == OK) { + va_list ap; + + va_start(ap, string); + tparm_copy_valist(&myData, TRUE, ap); + va_end(ap); + + result = tparam_internal(tps, string, &myData); + } return result; } -#if !NCURSES_TPARM_VARARGS +#else /* !NCURSES_TPARM_VARARGS */ + NCURSES_EXPORT(char *) -tparm_proto(const char *string, - TPARM_ARG a1, - TPARM_ARG a2, - TPARM_ARG a3, - TPARM_ARG a4, - TPARM_ARG a5, - TPARM_ARG a6, - TPARM_ARG a7, - TPARM_ARG a8, - TPARM_ARG a9) +tparm(const char *string, + TPARM_ARG a1, + TPARM_ARG a2, + TPARM_ARG a3, + TPARM_ARG a4, + TPARM_ARG a5, + TPARM_ARG a6, + TPARM_ARG a7, + TPARM_ARG a8, + TPARM_ARG a9) { - return tparm_varargs(string, a1, a2, a3, a4, a5, a6, a7, a8, a9); + TPARM_STATE *tps = get_tparm_state(cur_term); + TPARM_DATA myData; + char *result = NULL; + + _nc_tparm_err = 0; +#ifdef TRACE + tps->tname = "tparm"; +#endif /* TRACE */ + + if (tparm_setup(cur_term, string, &myData) == OK) { + + myData.param[0] = a1; + myData.param[1] = a2; + myData.param[2] = a3; + myData.param[3] = a4; + myData.param[4] = a5; + myData.param[5] = a6; + myData.param[6] = a7; + myData.param[7] = a8; + myData.param[8] = a9; + + result = tparam_internal(tps, string, &myData); + } + return result; } + #endif /* NCURSES_TPARM_VARARGS */ NCURSES_EXPORT(char *) tiparm(const char *string, ...) { - va_list ap; - char *result; + TPARM_STATE *tps = get_tparm_state(cur_term); + TPARM_DATA myData; + char *result = NULL; _nc_tparm_err = 0; - va_start(ap, string); #ifdef TRACE - TPS(tname) = "tiparm"; + tps->tname = "tiparm"; #endif /* TRACE */ - result = tparam_internal(FALSE, string, ap); - va_end(ap); + + if (tparm_setup(cur_term, string, &myData) == OK) { + va_list ap; + + va_start(ap, string); + tparm_copy_valist(&myData, FALSE, ap); + va_end(ap); + + result = tparam_internal(tps, string, &myData); + } return result; } + +/* + * The internal-use flavor ensures that the parameters are numbers, not strings + */ +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; +#ifdef TRACE + tps->tname = "_nc_tiparm"; +#endif /* TRACE */ + + if (tparm_setup(cur_term, string, &myData) == OK + && myData.num_actual <= expected + && myData.tparm_type == 0) { + va_list ap; + + va_start(ap, string); + tparm_copy_valist(&myData, FALSE, ap); + va_end(ap); + + result = tparam_internal(tps, string, &myData); + } + return 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 bfde26e..b9ca41c 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-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 * @@ -52,7 +52,7 @@ #include <termcap.h> /* ospeed */ #include <tic.h> -MODULE_ID("$Id: lib_tputs.c,v 1.103 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_tputs.c,v 1.108 2021/05/08 23:27:40 tom Exp $") NCURSES_EXPORT_VAR(char) PC = 0; /* used by termcap library */ NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed = 0; /* used by termcap library */ @@ -120,16 +120,21 @@ delay_output(int ms) NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_DCL0) { + T((T_CALLED("_nc_flush(%p)"), (void *) SP_PARM)); if (SP_PARM != 0 && SP_PARM->_ofd >= 0) { + TR(TRACE_CHARPUT, ("ofd:%d inuse:%lu buffer:%p", + SP_PARM->_ofd, + (unsigned long) SP_PARM->out_inuse, + SP_PARM->out_buffer)); if (SP_PARM->out_inuse) { char *buf = SP_PARM->out_buffer; size_t amount = SP->out_inuse; SP->out_inuse = 0; - TR(TRACE_CHARPUT, ("flushing %ld bytes", (unsigned long) amount)); + TR(TRACE_CHARPUT, ("flushing %ld/%ld bytes", + (unsigned long) amount, _nc_outchars)); while (amount) { ssize_t res = write(SP_PARM->_ofd, buf, amount); - if (res > 0) { /* if the write was incomplete, try again */ amount -= (size_t) res; @@ -142,10 +147,15 @@ NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_DCL0) break; /* an error we can not recover from */ } } + } else if (SP_PARM->out_buffer == 0) { + TR(TRACE_CHARPUT, ("flushing stdout")); + fflush(stdout); } } else { + TR(TRACE_CHARPUT, ("flushing stdout")); fflush(stdout); } + returnVoid; } #if NCURSES_SP_FUNCS @@ -266,8 +276,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; @@ -295,32 +305,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 @@ -419,7 +427,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_ttyflags.c b/ncurses/tinfo/lib_ttyflags.c index bfcd64a..6363a80 100644 --- a/ncurses/tinfo/lib_ttyflags.c +++ b/ncurses/tinfo/lib_ttyflags.c @@ -42,7 +42,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_ttyflags.c,v 1.34 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_ttyflags.c,v 1.36 2020/09/05 22:54:47 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_get_tty_mode) (NCURSES_SP_DCLx TTY * buf) @@ -156,6 +156,8 @@ NCURSES_SP_NAME(def_shell_mode) (NCURSES_SP_DCL0) #ifdef TERMIOS if (termp->Ottyb.c_oflag & OFLAGS_TABS) tab = back_tab = NULL; +#elif defined(EXP_WIN32_DRIVER) + /* noop */ #else if (termp->Ottyb.sg_flags & XTABS) tab = back_tab = NULL; @@ -193,6 +195,8 @@ NCURSES_SP_NAME(def_prog_mode) (NCURSES_SP_DCL0) if (_nc_get_tty_mode(&termp->Nttyb) == OK) { #ifdef TERMIOS termp->Nttyb.c_oflag &= (unsigned) (~OFLAGS_TABS); +#elif defined(EXP_WIN32_DRIVER) + /* noop */ #else termp->Nttyb.sg_flags &= (unsigned) (~XTABS); #endif diff --git a/ncurses/tinfo/lib_win32con.c b/ncurses/tinfo/lib_win32con.c new file mode 100644 index 0000000..2bcea39 --- /dev/null +++ b/ncurses/tinfo/lib_win32con.c @@ -0,0 +1,1256 @@ +/**************************************************************************** + * 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 * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Juergen Pfeifer * + * and: Thomas E. Dickey * + ****************************************************************************/ + +/* + * TODO - GetMousePos(POINT * result) from ntconio.c + */ + +#include <curses.priv.h> + +MODULE_ID("$Id: lib_win32con.c,v 1.7 2021/09/04 10:54:35 tom Exp $") + +#ifdef _NC_WINDOWS + +#ifdef _NC_MINGW +#include <wchar.h> +#else +#include <tchar.h> +#endif + +#include <io.h> + +#if USE_WIDEC_SUPPORT +#define write_screen WriteConsoleOutputW +#define read_screen ReadConsoleOutputW +#else +#define write_screen WriteConsoleOutput +#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[] = +{ + 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_DELETE, 'S'), + GenMap(VK_INSERT, 'R') +}; +#define array_length(a) (sizeof(a)/sizeof(a[0])) +#define N_INI ((int)array_length(keylist)) +#define FKEYS 24 +#define MAPSIZE (FKEYS + N_INI) + +/* A process can only have a single console, so it is safe + to maintain all the information about it in a single + static structure. + */ +NCURSES_EXPORT_VAR(ConsoleInfo) _nc_CONSOLE; +static bool console_initialized = FALSE; + +#define EnsureInit() (void)(console_initialized ? TRUE : _nc_console_checkinit(TRUE, TRUE)) + +#define REQUIRED_MAX_V (DWORD)10 +#define REQUIRED_MIN_V (DWORD)0 +#define REQUIRED_BUILD (DWORD)17763 +/* + This function returns 0 if the Windows version has no support for + the modern Console interface, otherwise it returns 1 + */ +NCURSES_EXPORT(int) +_nc_console_vt_supported(void) +{ + OSVERSIONINFO osvi; + int res = 0; + + T((T_CALLED("lib_win32con::_nc_console_vt_supported"))); + ZeroMemory(&osvi, sizeof(OSVERSIONINFO)); + osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + + GetVersionEx(&osvi); + T(("GetVersionEx returnedMajor=%ld, Minor=%ld, Build=%ld", + osvi.dwMajorVersion, + 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; + } + returnCode(res); +} + +NCURSES_EXPORT(void) +_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); + } + } +} + +/* Convert a file descriptor into a HANDLE + That's not necessarily a console HANDLE +*/ +NCURSES_EXPORT(HANDLE) +_nc_console_handle(int fd) +{ + intptr_t value = _get_osfhandle(fd); + return (HANDLE) value; +} + +/* Validate that a HANDLE is actually a + console HANDLE +*/ +static BOOL +IsConsoleHandle(HANDLE hdl) +{ + DWORD dwFlag = 0; + BOOL result = FALSE; + + T((T_CALLED("lib_win32con::IsConsoleHandle(HANDLE=%p"), hdl)); + + EnsureInit(); + + if (!GetConsoleMode(hdl, &dwFlag)) { + T(("GetConsoleMode failed")); + } else { + result = TRUE; + } + + returnBool(result); +} + +/* This is used when running in terminfo mode to discover, + whether or not the "terminal" is actually a Windows + Console. It is the responsibility of the console to deal + with the terminal escape sequences that are sent by + terminfo. + */ +NCURSES_EXPORT(int) +_nc_console_test(int fd) +{ + int code = 0; + HANDLE hdl = INVALID_HANDLE_VALUE; + T((T_CALLED("lib_win32con::_nc_console_test(%d)"), fd)); + hdl = _nc_console_handle(fd); + code = (int) IsConsoleHandle(hdl); + returnCode(code); +} + +#define OutHandle() ((WINCONSOLE.isTermInfoConsole || WINCONSOLE.progMode) ? WINCONSOLE.hdl : WINCONSOLE.out) + +NCURSES_EXPORT(void) +_nc_console_selectActiveHandle(void) +{ + if (WINCONSOLE.lastOut != WINCONSOLE.hdl) { + WINCONSOLE.lastOut = WINCONSOLE.hdl; + SetConsoleActiveScreenBuffer(WINCONSOLE.lastOut); + } +} + +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)); + } else { + 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; + } + } + } + return hdl; +} + +NCURSES_EXPORT(int) +_nc_console_setmode(HANDLE hdl, const TTY *arg) +{ + DWORD dwFlag = 0; + int code = ERR; + HANDLE alt; + + if (arg) { +#ifdef TRACE + 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); + + 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; + } + return(code); +} + +NCURSES_EXPORT(int) +_nc_console_getmode(HANDLE hdl, TTY *arg) +{ + int code = ERR; + + if (arg) { + 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; + } + } + } + } + T(("lib_win32con:_nc_console_getmode %s", _nc_trace_ttymode(arg))); + return(code); +} + +NCURSES_EXPORT(int) +_nc_console_flush(HANDLE hdl) +{ + int code = OK; + + 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.")); + } + } + returnCode(code); +} + +NCURSES_EXPORT(WORD) +_nc_console_MapColor(bool fore, int color) +{ + static const int _cmap[] = + {0, 4, 2, 6, 1, 5, 3, 7}; + int a; + if (color < 0 || color > 7) + a = fore ? 7 : 0; + else + a = _cmap[color]; + if (!fore) + 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 + * restoration as if the library had allocated a console buffer. MSDN + * says that the data which can be read is limited to 64Kb (and may be + * less). + */ +static bool +save_original_screen(void) +{ + bool result = FALSE; + + WINCONSOLE.save_region.Top = 0; + WINCONSOLE.save_region.Left = 0; + WINCONSOLE.save_region.Bottom = (SHORT) (WINCONSOLE.SBI.dwSize.Y - 1); + WINCONSOLE.save_region.Right = (SHORT) (WINCONSOLE.SBI.dwSize.X - 1); + + if (read_screen_data()) { + 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.window_only = TRUE; + + if (read_screen_data()) { + result = TRUE; + } + } + + T(("... save original screen contents %s", result ? "ok" : "err")); + return result; +} + +static bool +restore_original_screen(void) +{ + COORD bufferCoord; + bool result = FALSE; + SMALL_RECT save_region = WINCONSOLE.save_region; + + T(("... restoring %s", + WINCONSOLE.window_only ? "window" : "entire buffer")); + + bufferCoord.X = (SHORT) (WINCONSOLE.window_only ? + WINCONSOLE.SBI.srWindow.Left : 0); + bufferCoord.Y = (SHORT) (WINCONSOLE.window_only ? + 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)); + } else { + T(("... restore original screen contents err")); + } + return result; +} + +static bool +read_screen_data(void) +{ + bool result = FALSE; + COORD bufferCoord; + size_t want; + + WINCONSOLE.save_size.X = (SHORT) (WINCONSOLE.save_region.Right + - WINCONSOLE.save_region.Left + 1); + WINCONSOLE.save_size.Y = (SHORT) (WINCONSOLE.save_region.Bottom + - 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); + + 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); + } + } + + return result; +} + +NCURSES_EXPORT(bool) +_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; + } else { + T(("GetConsoleScreenBufferInfo ERR")); + } + return rc; +} + +#define MIN_WIDE 80 +#define MIN_HIGH 24 + +/* + * In "normal" mode, reset the buffer- and window-sizes back to their original values. + */ +NCURSES_EXPORT(void) +_nc_console_set_scrollback(bool normal, CONSOLE_SCREEN_BUFFER_INFO * info) +{ + SMALL_RECT rect; + COORD coord; + bool changed = FALSE; + + T((T_CALLED("lib_win32con::_nc_console_set_scrollback(%s)"), + (normal + ? "normal" + : "application"))); + + T(("... SBI.srWindow %d,%d .. %d,%d", + info->srWindow.Top, + info->srWindow.Left, + info->srWindow.Bottom, + info->srWindow.Right)); + T(("... SBI.dwSize %dx%d", + info->dwSize.Y, + info->dwSize.X)); + + if (normal) { + 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; + + 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); + + 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 (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(); + } + returnVoid; +} + +static ULONGLONG +tdiff(FILETIME fstart, FILETIME fend) +{ + ULARGE_INTEGER ustart; + ULARGE_INTEGER uend; + ULONGLONG diff; + + ustart.LowPart = fstart.dwLowDateTime; + ustart.HighPart = fstart.dwHighDateTime; + uend.LowPart = fend.dwLowDateTime; + uend.HighPart = fend.dwHighDateTime; + + diff = (uend.QuadPart - ustart.QuadPart) / 10000; + return diff; +} + +static int +Adjust(int milliseconds, int diff) +{ + if (milliseconds != INFINITY) { + milliseconds -= diff; + if (milliseconds < 0) + milliseconds = 0; + } + return milliseconds; +} + +#define BUTTON_MASK (FROM_LEFT_1ST_BUTTON_PRESSED | \ + FROM_LEFT_2ND_BUTTON_PRESSED | \ + FROM_LEFT_3RD_BUTTON_PRESSED | \ + FROM_LEFT_4TH_BUTTON_PRESSED | \ + RIGHTMOST_BUTTON_PRESSED) + +static int +decode_mouse(SCREEN *sp, int mask) +{ + int result = 0; + + (void) sp; + assert(sp && console_initialized); + + if (mask & FROM_LEFT_1ST_BUTTON_PRESSED) + result |= BUTTON1_PRESSED; + if (mask & FROM_LEFT_2ND_BUTTON_PRESSED) + result |= BUTTON2_PRESSED; + if (mask & FROM_LEFT_3RD_BUTTON_PRESSED) + result |= BUTTON3_PRESSED; + if (mask & FROM_LEFT_4TH_BUTTON_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; + } + } + + return result; +} + +#define AdjustY() (WINCONSOLE.buffered ? 0 : (int) WINCONSOLE.SBI.srWindow.Top) + +static bool +handle_mouse(SCREEN *sp, MOUSE_EVENT_RECORD mer) +{ + MEVENT work; + bool result = FALSE; + + assert(sp); + + sp->_drv_mouse_old_buttons = sp->_drv_mouse_new_buttons; + sp->_drv_mouse_new_buttons = mer.dwButtonState & BUTTON_MASK; + + /* + * We're only interested if the button is pressed or released. + * FIXME: implement continuous event-tracking. + */ + if (sp->_drv_mouse_new_buttons != sp->_drv_mouse_old_buttons) { + 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; + } + + 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; + } + return result; +} + +static int +rkeycompare(const void *el1, const void *el2) +{ + WORD key1 = (LOWORD((*((const LONG *) el1)))) & 0x7fff; + WORD key2 = (LOWORD((*((const LONG *) el2)))) & 0x7fff; + + return ((key1 < key2) ? -1 : ((key1 == key2) ? 0 : 1)); +} + + +static int +keycompare(const void *el1, const void *el2) +{ + WORD key1 = HIWORD((*((const LONG *) el1))); + WORD key2 = HIWORD((*((const LONG *) el2))); + + return ((key1 < key2) ? -1 : ((key1 == key2) ? 0 : 1)); +} + +static int +MapKey(WORD vKey) +{ + int code = -1; + + if (!WINCONSOLE.isTermInfoConsole) { + 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; + } + } + return code; +} + +static int +AnsiKey(WORD vKey) +{ + int code = -1; + + if (!WINCONSOLE.isTermInfoConsole) { + 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; + } + } + return code; +} + +NCURSES_EXPORT(int) +_nc_console_keyok(int keycode, int flag) +{ + int code = ERR; + WORD nKey; + WORD vKey; + void *res; + LONG key = GenMap(0, (WORD) keycode); + + 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); + if (res) { + key = *((LONG *) res); + vKey = HIWORD(key); + nKey = (LOWORD(key)) & 0x7fff; + if (!flag) + nKey |= 0x8000; + *(LONG *) res = GenMap(vKey, nKey); + } + returnCode(code); +} + +NCURSES_EXPORT(bool) +_nc_console_keyExist(int keycode) +{ + WORD nKey; + void *res; + bool found = FALSE; + LONG key = GenMap(0, (WORD) 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); + if (res) { + 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)) +{ + INPUT_RECORD inp_rec; + BOOL b; + DWORD nRead = 0, rc = (DWORD) (-1); + int code = 0; + FILETIME fstart; + FILETIME fend; + int diff; + bool isNoDelay = (milliseconds == 0); + +#ifdef NCURSES_WGETCH_EVENTS + (void) evl; /* TODO: implement wgetch-events */ +#endif + +#define IGNORE_CTRL_KEYS (SHIFT_PRESSED|LEFT_ALT_PRESSED|RIGHT_ALT_PRESSED| \ + LEFT_CTRL_PRESSED|RIGHT_CTRL_PRESSED) +#define CONSUME() ReadConsoleInput(hdl, &inp_rec, 1, &nRead) + + assert(sp); + + TR(TRACE_IEVENT, ("start twait: hdl=%p, %d milliseconds, mode: %d", + hdl, milliseconds, mode)); + + if (milliseconds < 0) + 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 || (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: + + TR(TRACE_IEVENT, ("end twait: returned %d (%lu), remaining time %d msec", + code, GetLastError(), milliseconds)); + + if (timeleft) + *timeleft = milliseconds; + + return code; +} + +NCURSES_EXPORT(int) +_nc_console_testmouse( + 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; + } else { + 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) +{ + int rc = -1; + INPUT_RECORD inp_rec; + BOOL b; + DWORD nRead; + WORD vk; + + assert(sp); + assert(buf); + + memset(&inp_rec, 0, sizeof(inp_rec)); + + 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; + } + } + returnCode(rc); +} + +/* Our replacement for the systems _isatty to include also + a test for mintty. This is called from the NC_ISATTY macro + defined in curses.priv.h + + Return codes: + - 0 : Not a TTY + - 1 : A Windows character device detected by _isatty + - 2 : A future implementation may return 2 for mintty + */ +NCURSES_EXPORT(int) +_nc_console_isatty(int fd) +{ + int result = 0; + T((T_CALLED("lib_win32con::_nc_console_isatty(%d"), fd)); + + if (_isatty(fd)) + 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); + } + } +#endif + returnCode(result); +} + +NCURSES_EXPORT(bool) +_nc_console_checkinit(bool initFlag, bool assumeTermInfo) +{ + bool res = FALSE; + + T((T_CALLED("lib_win32con::_nc_console_checkinit(initFlag=%d, assumeTermInfo=%d)"), + initFlag, assumeTermInfo)); + + if (!initFlag) { + 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; + + 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); + + if (GetNumberOfConsoleMouseButtons(&num_buttons)) { + WINCONSOLE.numButtons = (int) num_buttons; + } else { + WINCONSOLE.numButtons = 1; + } + + a = _nc_console_MapColor(true, COLOR_WHITE) | + _nc_console_MapColor(false, COLOR_BLACK); + for (i = 0; i < CON_NUMPAIRS; i++) + WINCONSOLE.pairs[i] = a; + + WINCONSOLE.inp = GetStdHandle(STD_INPUT_HANDLE); + WINCONSOLE.out = GetStdHandle(STD_OUTPUT_HANDLE); + WINCONSOLE.hdl = WINCONSOLE.out; + + GetConsoleMode(WINCONSOLE.inp, &WINCONSOLE.originalMode.dwFlagIn); + GetConsoleMode(WINCONSOLE.out, &WINCONSOLE.originalMode.dwFlagOut); + + if (!WINCONSOLE.isTermInfoConsole) { + b = AllocConsole(); + + if (!b) + b = AttachConsole(ATTACH_PARENT_PROCESS); + + 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; + } + } + + /* 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)); + } + + WINCONSOLE.initialized = TRUE; + console_initialized = TRUE; + } + res = (WINCONSOLE.hdl != INVALID_HANDLE_VALUE); + } + returnBool(res); +} + +#endif // _NC_WINDOWS diff --git a/ncurses/tinfo/lib_win32util.c b/ncurses/tinfo/lib_win32util.c new file mode 100644 index 0000000..1482916 --- /dev/null +++ b/ncurses/tinfo/lib_win32util.c @@ -0,0 +1,134 @@ +/**************************************************************************** + * 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 * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Juergen Pfeifer * + * and: Thomas E. Dickey * + ****************************************************************************/ + +#include <curses.priv.h> + +MODULE_ID("$Id: lib_win32util.c,v 1.2 2021/09/04 10:54:35 tom Exp $") + +#ifdef _NC_WINDOWS +#include <io.h> + +#ifdef _NC_CHECK_MINTTY +#define PSAPI_VERSION 2 +#include <psapi.h> +#include <tchar.h> + +#define array_length(a) (sizeof(a)/sizeof(a[0])) + +/* 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 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 + the terminal state of mintty, this is out of scope for now and + not worth the significant effort. + */ +NCURSES_EXPORT(int) +_nc_console_checkmintty(int fd, LPHANDLE pMinTTY) +{ + HANDLE handle = _nc_console_handle(fd); + DWORD dw; + int code = 0; + + T((T_CALLED("lib_winhelper::_nc_console_checkmintty(%d, %p)"), fd, pMinTTY)); + + if (handle != INVALID_HANDLE_VALUE) { + dw = GetFileType(handle); + if (dw == FILE_TYPE_PIPE) { + if (GetNamedPipeInfo(handle, 0, 0, 0, 0)) { + ULONG pPid; + /* Requires NT6 */ + if (GetNamedPipeServerProcessId(handle, &pPid)) { + TCHAR buf[MAX_PATH]; + DWORD len = 0; + /* 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 + | PROCESS_QUERY_INFORMATION + | PROCESS_VM_OPERATION + | PROCESS_VM_WRITE + | PROCESS_VM_READ, + FALSE, + pPid); + if (pMinTTY) + *pMinTTY = INVALID_HANDLE_VALUE; + if (pHandle != INVALID_HANDLE_VALUE) { + if ((len = GetProcessImageFileName( + pHandle, + buf, + (DWORD) + array_length(buf)))) { + TCHAR *pos = _tcsrchr(buf, _T('\\')); + if (pos) { + pos++; + if (_tcsnicmp(pos, _TEXT("mintty.exe"), 10) + == 0) { + if (pMinTTY) + *pMinTTY = pHandle; + code = 1; + } + } + } + } + } + } + } + } + returnCode(code); +} +#endif /* _NC_CHECK_MINTTY */ + +#define JAN1970 116444736000000000LL /* the value for 01/01/1970 00:00 */ + +NCURSES_EXPORT(int) +_nc_gettimeofday(struct timeval *tv, void *tz GCC_UNUSED) +{ + union { + FILETIME ft; + long long since1601; /* time since 1 Jan 1601 in 100ns units */ + } data; + + GetSystemTimeAsFileTime(&data.ft); + tv->tv_usec = (long) ((data.since1601 / 10LL) % 1000000LL); + tv->tv_sec = (long) ((data.since1601 - JAN1970) / 10000000LL); + return (0); +} + +#endif // _NC_WINDOWS diff --git a/ncurses/tinfo/make_keys.c b/ncurses/tinfo/make_keys.c index 80bbf63..b8eb934 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/parse_entry.c b/ncurses/tinfo/parse_entry.c index 23574b6..a77cd0b 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-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 * @@ -48,7 +48,7 @@ #include <ctype.h> #include <tic.h> -MODULE_ID("$Id: parse_entry.c,v 1.99 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: parse_entry.c,v 1.102 2021/09/04 10:54:35 tom Exp $") #ifdef LINT static short const parametrized[] = @@ -362,7 +362,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 @@ -544,10 +544,14 @@ _nc_parse_entry(ENTRY * entryp, int literal, bool silent) case STRING: ptr = _nc_curr_token.tk_valstring; - if (_nc_syntax == SYN_TERMCAP) + if (_nc_syntax == SYN_TERMCAP) { + int n = entry_ptr->nte_index; ptr = _nc_captoinfo(_nc_curr_token.tk_name, ptr, - parametrized[entry_ptr->nte_index]); + (n < (int) SIZEOF(parametrized)) + ? parametrized[n] + : 0); + } entryp->tterm.Strings[entry_ptr->nte_index] = _nc_save_str(ptr); break; @@ -925,7 +929,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) diff --git a/ncurses/tinfo/read_entry.c b/ncurses/tinfo/read_entry.c index 5b570b0..41ef0d0 100644 --- a/ncurses/tinfo/read_entry.c +++ b/ncurses/tinfo/read_entry.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 * @@ -42,7 +42,7 @@ #include <tic.h> -MODULE_ID("$Id: read_entry.c,v 1.157 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: read_entry.c,v 1.161 2021/06/26 19:43:17 tom Exp $") #define TYPE_CALLOC(type,elts) typeCalloc(type, (unsigned)(elts)) @@ -160,11 +160,11 @@ convert_strings(char *buf, char **Strings, int count, int size, char *table) /* make sure all strings are NUL terminated */ if (VALID_STRING(Strings[i])) { - for (p = Strings[i]; p <= table + size; p++) + for (p = Strings[i]; p < table + size; p++) if (*p == '\0') break; /* if there is no NUL, ignore the string */ - if (p > table + size) + if (p >= table + size) Strings[i] = ABSENT_STRING; } } @@ -257,7 +257,6 @@ _nc_read_termtype(TERMTYPE2 *ptr, char *buffer, int limit) char buf[MAX_ENTRY_SIZE + 2]; char *string_table; unsigned want, have; - bool need_ints; size_t (*convert_numbers) (char *, NCURSES_INT2 *, int); int size_of_numbers; int max_entry_size = MAX_ENTRY_SIZE; @@ -276,7 +275,7 @@ _nc_read_termtype(TERMTYPE2 *ptr, char *buffer, int limit) returnDB(TGETENT_NO); } #if NCURSES_EXT_NUMBERS - if ((need_ints = (LOW_MSB(buf) == MAGIC2))) { + if (LOW_MSB(buf) == MAGIC2) { convert_numbers = convert_32bits; size_of_numbers = SIZEOF_INT2; } else { @@ -285,7 +284,7 @@ _nc_read_termtype(TERMTYPE2 *ptr, char *buffer, int limit) size_of_numbers = SIZEOF_SHORT; } #else - if ((need_ints = (LOW_MSB(buf) == MAGIC2))) { + if (LOW_MSB(buf) == MAGIC2) { convert_numbers = convert_32bits; size_of_numbers = SIZEOF_32BITS; } else { @@ -553,7 +552,7 @@ _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 { @@ -666,11 +665,10 @@ decode_hex(const char **source) { int result = 0; int nibble; - int ch; for (nibble = 0; nibble < 2; ++nibble) { + int ch = UChar(**source); result <<= 4; - ch = UChar(**source); *source += 1; if (ch >= '0' && ch <= '9') { ch -= '0'; @@ -776,7 +774,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. @@ -833,7 +831,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. */ diff --git a/ncurses/tinfo/read_termcap.c b/ncurses/tinfo/read_termcap.c index fcb43a4..c9696b7 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-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 * @@ -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.102 2021/09/04 10:29:15 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. */ @@ -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 @@ -1064,14 +1064,16 @@ _nc_read_termcap_entry(const char *const tn, TERMTYPE2 *const tp) } } -#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/tinfo_driver.c b/ncurses/tinfo/tinfo_driver.c index 7919a9b..fb6496f 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-2020,2021 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.67 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: tinfo_driver.c,v 1.72 2021/06/17 21:30:22 tom Exp $") /* * SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS, @@ -123,6 +123,8 @@ get_baudrate(TERMINAL *termp) if (GET_TTY(termp->Filedes, &termp->Nttyb) == OK) { #ifdef TERMIOS termp->Nttyb.c_oflag &= (unsigned) (~OFLAGS_TABS); +#elif defined(EXP_WIN32_DRIVER) + /* noop */ #else termp->Nttyb.sg_flags &= (unsigned) (~XTABS); #endif @@ -133,6 +135,9 @@ get_baudrate(TERMINAL *termp) #else /* !USE_OLD_TTY */ #ifdef TERMIOS my_ospeed = (NCURSES_OSPEED) cfgetospeed(&(termp->Nttyb)); +#elif defined(EXP_WIN32_DRIVER) + /* noop */ + my_ospeed = 0; #else my_ospeed = (NCURSES_OSPEED) termp->Nttyb.sg_ospeed; #endif @@ -356,23 +361,23 @@ drv_setcolor(TERMINAL_CONTROL_BLOCK * TCB, if (set_a_foreground) { TPUTS_TRACE("set_a_foreground"); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_1(set_a_foreground, color), 1, outc); + TIPARM_1(set_a_foreground, color), 1, outc); } else { TPUTS_TRACE("set_foreground"); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_1(set_foreground, - toggled_colors(color)), 1, outc); + TIPARM_1(set_foreground, + toggled_colors(color)), 1, outc); } } else { if (set_a_background) { TPUTS_TRACE("set_a_background"); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_1(set_a_background, color), 1, outc); + TIPARM_1(set_a_background, color), 1, outc); } else { TPUTS_TRACE("set_background"); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_1(set_background, - toggled_colors(color)), 1, outc); + TIPARM_1(set_background, + toggled_colors(color)), 1, outc); } } } @@ -427,12 +432,19 @@ drv_size(TERMINAL_CONTROL_BLOCK * TCB, int *linep, int *colp) useTioctl = _nc_prescreen.use_tioctl; } +#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 + */ + _nc_console_size(linep, colp); + T(("screen size: winconsole lines = %d columns = %d", *linep, *colp)); +#else /* figure out the size of the screen */ T(("screen size: terminfo lines = %d columns = %d", lines, columns)); *linep = (int) lines; *colp = (int) columns; - +#endif if (useEnv || useTioctl) { int value; @@ -602,6 +614,8 @@ drv_mode(TERMINAL_CONTROL_BLOCK * TCB, int progFlag, int defFlag) if ((drv_sgmode(TCB, FALSE, &(_term->Nttyb)) == OK)) { #ifdef TERMIOS _term->Nttyb.c_oflag &= (unsigned) ~OFLAGS_TABS; +#elif defined(EXP_WIN32_DRIVER) + /* noop */ #else _term->Nttyb.sg_flags &= (unsigned) ~XTABS; #endif @@ -627,6 +641,8 @@ drv_mode(TERMINAL_CONTROL_BLOCK * TCB, int progFlag, int defFlag) #ifdef TERMIOS if (_term->Ottyb.c_oflag & OFLAGS_TABS) tab = back_tab = NULL; +#elif defined(EXP_WIN32_DRIVER) + /* noop */ #else if (_term->Ottyb.sg_flags & XTABS) tab = back_tab = NULL; @@ -764,10 +780,10 @@ drv_initpair(TERMINAL_CONTROL_BLOCK * TCB, int pair, int f, int b) tp[b].red, tp[b].green, tp[b].blue)); NCURSES_PUTP2("initialize_pair", - TPARM_7(initialize_pair, - pair, - tp[f].red, tp[f].green, tp[f].blue, - tp[b].red, tp[b].green, tp[b].blue)); + TIPARM_7(initialize_pair, + pair, + tp[f].red, tp[f].green, tp[f].blue, + tp[b].red, tp[b].green, tp[b].blue)); } } @@ -800,7 +816,7 @@ drv_initcolor(TERMINAL_CONTROL_BLOCK * TCB, AssertTCB(); if (initialize_color != NULL) { NCURSES_PUTP2("initialize_color", - TPARM_4(initialize_color, color, r, g, b)); + TIPARM_4(initialize_color, color, r, g, b)); } } @@ -826,7 +842,7 @@ drv_do_color(TERMINAL_CONTROL_BLOCK * TCB, if (set_color_pair) { TPUTS_TRACE("set_color_pair"); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_1(set_color_pair, pair), 1, outc); + TIPARM_1(set_color_pair, pair), 1, outc); return; } else if (sp != 0) { _nc_pair_content(SP_PARM, pair, &fg, &bg); @@ -933,11 +949,18 @@ drv_testmouse(TERMINAL_CONTROL_BLOCK * TCB, } else #endif { +#ifdef EXP_WIN32_DRIVER + rc = _nc_console_testmouse(sp, + _nc_console_handle(sp->_ifd), + delay + EVENTLIST_2nd(evl)); +#else rc = TCBOf(sp)->drv->td_twait(TCBOf(sp), TWAIT_MASK, delay, (int *) 0 EVENTLIST_2nd(evl)); +#endif #if USE_SYSMOUSE if ((sp->_mouse_type == M_SYSMOUSE) && (sp->_sysmouse_head < sp->_sysmouse_tail) @@ -1235,16 +1258,25 @@ drv_twait(TERMINAL_CONTROL_BLOCK * TCB, AssertTCB(); SetSP(); - +#ifdef EXP_WIN32_DRIVER + return _nc_console_twait(sp, + _nc_console_handle(sp->_ifd), + mode, + milliseconds, + timeleft EVENTLIST_2nd(evl)); +#else return _nc_timed_wait(sp, mode, milliseconds, timeleft EVENTLIST_2nd(evl)); +#endif } static int drv_read(TERMINAL_CONTROL_BLOCK * TCB, int *buf) { SCREEN *sp; - unsigned char c2 = 0; int n; +#ifndef EXP_WIN32_DRIVER + unsigned char c2 = 0; +#endif AssertTCB(); assert(buf); @@ -1254,11 +1286,19 @@ drv_read(TERMINAL_CONTROL_BLOCK * TCB, int *buf) if ((pthread_self) && (pthread_kill) && (pthread_equal)) _nc_globals.read_thread = pthread_self(); # endif +#ifdef EXP_WIN32_DRIVER + n = _nc_console_read(sp, + _nc_console_handle(sp->_ifd), + buf); +#else n = (int) read(sp->_ifd, &c2, (size_t) 1); +#endif #if USE_PTHREADS_EINTR _nc_globals.read_thread = 0; #endif +#ifndef EXP_WIN32_DRIVER *buf = (int) c2; +#endif return n; } @@ -1275,6 +1315,8 @@ drv_nap(TERMINAL_CONTROL_BLOCK * TCB GCC_UNUSED, int ms) request = remaining; } } +#elif defined(EXP_WIN32_DRIVER) + Sleep((DWORD) ms); #else _nc_timed_wait(0, 0, ms, (int *) 0 EVENTLIST_2nd(0)); #endif @@ -1452,3 +1494,66 @@ NCURSES_EXPORT_VAR (TERM_DRIVER) _nc_TINFO_DRIVER = { drv_kyExist, /* kyExist */ drv_cursorSet /* cursorSet */ }; + +#ifdef EXP_WIN32_DRIVER +/* + * The terminfo driver is mandatory and must always be present. + * So this is the natural place for the driver initialisation + * logic. + */ + +typedef struct DriverEntry { + const char *name; + TERM_DRIVER *driver; +} DRIVER_ENTRY; + +static DRIVER_ENTRY DriverTable[] = +{ +#ifdef _NC_WINDOWS + {"win32console", &_nc_WIN_DRIVER}, +#endif + {"tinfo", &_nc_TINFO_DRIVER} /* must be last */ +}; + +NCURSES_EXPORT(int) +_nc_get_driver(TERMINAL_CONTROL_BLOCK * TCB, const char *name, int *errret) +{ + int code = ERR; + size_t i; + TERM_DRIVER *res = (TERM_DRIVER *) 0; + TERM_DRIVER *use = 0; + + T((T_CALLED("_nc_get_driver(%p, %s, %p)"), + (void *) TCB, NonNull(name), (void *) errret)); + + assert(TCB != 0); + + for (i = 0; i < SIZEOF(DriverTable); i++) { + res = DriverTable[i].driver; +#ifdef _NC_WINDOWS + if ((i + 1) == SIZEOF(DriverTable)) { + /* 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. + */ + if (name == 0 || *name == 0 || (strcmp(name, "unknown") == 0)) { + name = MS_TERMINAL; + T(("Set TERM=%s", name)); + } + } +#endif + if (strcmp(DriverTable[i].name, res->td_name(TCB)) == 0) { + if (res->td_CanHandle(TCB, name, errret)) { + use = res; + break; + } + } + } + if (use != 0) { + TCB->drv = use; + code = OK; + } + returnCode(code); +} +#endif /* EXP_WIN32_DRIVER */ diff --git a/ncurses/tinfo/trim_sgr0.c b/ncurses/tinfo/trim_sgr0.c index 4d10529..22bc82f 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 Thomas E. Dickey * * Copyright 2005-2012,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -37,7 +37,7 @@ #include <tic.h> -MODULE_ID("$Id: trim_sgr0.c,v 1.18 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: trim_sgr0.c,v 1.21 2021/06/17 21:20:30 tom Exp $") #undef CUR #define CUR tp-> @@ -52,7 +52,7 @@ set_attribute_9(TERMTYPE2 *tp, int flag) const char *value; char *result; - value = tparm(set_attributes, 0, 0, 0, 0, 0, 0, 0, 0, flag); + value = TIPARM_9(set_attributes, 0, 0, 0, 0, 0, 0, 0, 0, flag); if (PRESENT(value)) result = strdup(value); else @@ -222,7 +222,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 1385176..cab4757 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-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 * @@ -51,7 +51,7 @@ #define TRACE_NUM(n) /* nothing */ #endif -MODULE_ID("$Id: write_entry.c,v 1.115 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: write_entry.c,v 1.118 2021/08/15 20:07:11 tom Exp $") static int total_written; static int total_parts; @@ -71,7 +71,7 @@ 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; @@ -190,9 +190,9 @@ 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 -#if !defined(_WIN32) +#ifndef _NC_WINDOWS ,0777 #endif ); @@ -442,7 +442,7 @@ _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); diff --git a/ncurses/trace/lib_trace.c b/ncurses/trace/lib_trace.c index 2c10b51..9acbd47 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-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 * @@ -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.95 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_trace.c,v 1.99 2021/06/26 20:44:59 tom Exp $") NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0; /* always define this */ @@ -118,8 +118,9 @@ curses_trace(unsigned tracelevel) _nc_STRCAT(MyPath, ".log", sizeof(MyPath)); } } +#define SAFE_MODE (O_CREAT | O_EXCL | O_RDWR) if (_nc_access(MyPath, W_OK) < 0 - || (MyFD = open(MyPath, O_CREAT | O_EXCL | O_RDWR, 0600)) < 0 + || (MyFD = safe_open3(MyPath, SAFE_MODE, 0600)) < 0 || (MyFP = fdopen(MyFD, BIN_W)) == 0) { ; /* EMPTY */ } @@ -127,7 +128,7 @@ curses_trace(unsigned tracelevel) _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 */ @@ -213,7 +214,7 @@ _nc_va_tracef(const char *fmt, va_list ap) # if USE_WEAK_SYMBOLS if ((pthread_self)) # endif -#ifdef _WIN32 +#ifdef _NC_WINDOWS fprintf(fp, "%#lx:", (long) (intptr_t) pthread_self().p); #else fprintf(fp, "%#lx:", (long) (intptr_t) pthread_self()); @@ -349,7 +350,7 @@ _nc_fmt_funcptr(char *target, const char *source, size_t size) if (ch != 0 || (n + 1) >= size) leading = FALSE; if (!leading) { - _nc_SPRINTF(dst, _nc_SLIMIT(TR_FUNC_LEN - (dst - target)) + _nc_SPRINTF(dst, _nc_SLIMIT(TR_FUNC_LEN - (size_t) (dst - target)) "%02x", ch & 0xff); dst += 2; } diff --git a/ncurses/trace/lib_tracebits.c b/ncurses/trace/lib_tracebits.c index 14e5d90..4bc50f3 100644 --- a/ncurses/trace/lib_tracebits.c +++ b/ncurses/trace/lib_tracebits.c @@ -35,7 +35,7 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_tracebits.c,v 1.28 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_tracebits.c,v 1.31 2020/11/14 23:38:11 tom Exp $") #if HAVE_SYS_TERMIO_H #include <sys/termio.h> /* needed for ISC */ @@ -72,9 +72,15 @@ MODULE_ID("$Id: lib_tracebits.c,v 1.28 2020/02/02 23:34:34 tom Exp $") #ifdef TRACE +#if defined(EXP_WIN32_DRIVER) +#define BITNAMELEN 36 +#else +#define BITNAMELEN 8 +#endif + typedef struct { unsigned int val; - const char name[8]; + const char name[BITNAMELEN]; } BITNAMES; #define TRACE_BUF_SIZE(num) (_nc_globals.tracebuf_ptr[num].size) @@ -98,7 +104,7 @@ lookup_bits(char *buf, const BITNAMES * table, const char *label, unsigned int v } NCURSES_EXPORT(char *) -_nc_trace_ttymode(TTY * tty) +_nc_trace_ttymode(const TTY * tty) /* describe the state of the terminal control bits exactly */ { char *buf; @@ -212,6 +218,36 @@ _nc_trace_ttymode(TTY * tty) if (tty->c_lflag & ALLLOCAL) lookup_bits(buf, lflags, "lflags", tty->c_lflag); } +#elif defined(EXP_WIN32_DRIVER) +#define DATA(name) { name, { #name } } + static const BITNAMES dwFlagsOut[] = + { + DATA(ENABLE_PROCESSED_OUTPUT), + DATA(ENABLE_WRAP_AT_EOL_OUTPUT), + DATA(ENABLE_VIRTUAL_TERMINAL_PROCESSING), + DATA(DISABLE_NEWLINE_AUTO_RETURN), + DATA(ENABLE_LVB_GRID_WORLDWIDE) + }; + static const BITNAMES dwFlagsIn[] = + { + DATA(ENABLE_PROCESSED_INPUT), + DATA(ENABLE_LINE_INPUT), + DATA(ENABLE_ECHO_INPUT), + DATA(ENABLE_MOUSE_INPUT), + DATA(ENABLE_INSERT_MODE), + DATA(ENABLE_QUICK_EDIT_MODE), + DATA(ENABLE_EXTENDED_FLAGS), + DATA(ENABLE_AUTO_POSITION), + DATA(ENABLE_VIRTUAL_TERMINAL_INPUT) + }; + + buf = _nc_trace_buf(0, + 8 + sizeof(dwFlagsOut) + + 8 + sizeof(dwFlagsIn)); + if (buf != 0) { + lookup_bits(buf, dwFlagsIn, "dwIn", tty->dwFlagIn); + lookup_bits(buf, dwFlagsOut, "dwOut", tty->dwFlagOut); + } #else /* reference: ttcompat(4M) on SunOS 4.1 */ #ifndef EVENP diff --git a/ncurses/trace/visbuf.c b/ncurses/trace/visbuf.c index 5f95a6b..aca8aff 100644 --- a/ncurses/trace/visbuf.c +++ b/ncurses/trace/visbuf.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2019,2020 Thomas E. Dickey * + * Copyright 2019-2020,2021 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.53 2021/02/27 20:07:57 tom Exp $") #define NUM_VISBUFS 4 @@ -283,7 +283,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 +371,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 65c6b93..77f06f2 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.23 2021/06/17 21:26:02 tom Exp $ # # Script to generate 'expanded.c', a dummy source that contains functions # corresponding to complex macros used in this library. By making functions, @@ -81,7 +81,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/hashmap.c b/ncurses/tty/hashmap.c index 9d1e482..3f124c9 100644 --- a/ncurses/tty/hashmap.c +++ b/ncurses/tty/hashmap.c @@ -74,7 +74,7 @@ AUTHOR #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: hashmap.c,v 1.68 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: hashmap.c,v 1.69 2020/05/31 17:50:48 tom Exp $") #ifdef HASHDEBUG @@ -88,7 +88,7 @@ MODULE_ID("$Id: hashmap.c,v 1.68 2020/02/02 23:34:34 tom Exp $") # undef screen_lines # define screen_lines(sp) MAXLINES # define TEXTWIDTH(sp) 1 -int oldnums[MAXLINES], reallines[MAXLINES]; +static int oldnums[MAXLINES], reallines[MAXLINES]; static NCURSES_CH_T oldtext[MAXLINES][TEXTWIDTH(sp)]; static NCURSES_CH_T newtext[MAXLINES][TEXTWIDTH(sp)]; # define OLDNUM(sp,n) oldnums[n] diff --git a/ncurses/tty/lib_mvcur.c b/ncurses/tty/lib_mvcur.c index 5382b3b..7959227 100644 --- a/ncurses/tty/lib_mvcur.c +++ b/ncurses/tty/lib_mvcur.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 * @@ -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.151 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_mvcur.c,v 1.156 2021/09/04 10:29:15 tom Exp $") #define WANT_CHAR(sp, y, x) NewScreen(sp)->_line[y].text[x] /* desired state */ @@ -279,8 +279,8 @@ reset_scroll_region(NCURSES_SP_DCL0) { if (change_scroll_region) { NCURSES_PUTP2("change_scroll_region", - TPARM_2(change_scroll_region, - 0, screen_lines(SP_PARM) - 1)); + TIPARM_2(change_scroll_region, + 0, screen_lines(SP_PARM) - 1)); } } @@ -399,13 +399,13 @@ NCURSES_SP_NAME(_nc_mvcur_init) (NCURSES_SP_DCL0) * All these averages depend on the assumption that all parameter values * are equally probable. */ - SP_PARM->_cup_cost = CostOf(TPARM_2(SP_PARM->_address_cursor, 23, 23), 1); - SP_PARM->_cub_cost = CostOf(TPARM_1(parm_left_cursor, 23), 1); - SP_PARM->_cuf_cost = CostOf(TPARM_1(parm_right_cursor, 23), 1); - SP_PARM->_cud_cost = CostOf(TPARM_1(parm_down_cursor, 23), 1); - SP_PARM->_cuu_cost = CostOf(TPARM_1(parm_up_cursor, 23), 1); - SP_PARM->_hpa_cost = CostOf(TPARM_1(column_address, 23), 1); - SP_PARM->_vpa_cost = CostOf(TPARM_1(row_address, 23), 1); + SP_PARM->_cup_cost = CostOf(TIPARM_2(SP_PARM->_address_cursor, 23, 23), 1); + SP_PARM->_cub_cost = CostOf(TIPARM_1(parm_left_cursor, 23), 1); + SP_PARM->_cuf_cost = CostOf(TIPARM_1(parm_right_cursor, 23), 1); + SP_PARM->_cud_cost = CostOf(TIPARM_1(parm_down_cursor, 23), 1); + SP_PARM->_cuu_cost = CostOf(TIPARM_1(parm_up_cursor, 23), 1); + SP_PARM->_hpa_cost = CostOf(TIPARM_1(column_address, 23), 1); + SP_PARM->_vpa_cost = CostOf(TIPARM_1(row_address, 23), 1); /* non-parameterized screen-update strings */ SP_PARM->_ed_cost = NormalizedCost(clr_eos, 1); @@ -422,17 +422,16 @@ NCURSES_SP_NAME(_nc_mvcur_init) (NCURSES_SP_DCL0) SP_PARM->_el_cost = 0; /* parameterized screen-update strings */ - SP_PARM->_dch_cost = NormalizedCost(TPARM_1(parm_dch, 23), 1); - SP_PARM->_ich_cost = NormalizedCost(TPARM_1(parm_ich, 23), 1); - SP_PARM->_ech_cost = NormalizedCost(TPARM_1(erase_chars, 23), 1); - SP_PARM->_rep_cost = NormalizedCost(TPARM_2(repeat_char, ' ', 23), 1); - - SP_PARM->_cup_ch_cost = NormalizedCost( - TPARM_2(SP_PARM->_address_cursor, - 23, 23), - 1); - SP_PARM->_hpa_ch_cost = NormalizedCost(TPARM_1(column_address, 23), 1); - SP_PARM->_cuf_ch_cost = NormalizedCost(TPARM_1(parm_right_cursor, 23), 1); + SP_PARM->_dch_cost = NormalizedCost(TIPARM_1(parm_dch, 23), 1); + SP_PARM->_ich_cost = NormalizedCost(TIPARM_1(parm_ich, 23), 1); + SP_PARM->_ech_cost = NormalizedCost(TIPARM_1(erase_chars, 23), 1); + SP_PARM->_rep_cost = NormalizedCost(TIPARM_2(repeat_char, ' ', 23), 1); + + SP_PARM->_cup_ch_cost = NormalizedCost(TIPARM_2(SP_PARM->_address_cursor, + 23, 23), + 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->_cuf_ch_cost)); @@ -563,7 +562,7 @@ relative_move(NCURSES_SP_DCLx vcost = INFINITY; if (row_address != 0 - && _nc_safe_strcat(target, TPARM_1(row_address, to_y))) { + && _nc_safe_strcat(target, TIPARM_1(row_address, to_y))) { vcost = SP_PARM->_vpa_cost; } @@ -573,12 +572,12 @@ relative_move(NCURSES_SP_DCLx if (parm_down_cursor && SP_PARM->_cud_cost < vcost && _nc_safe_strcat(_nc_str_copy(target, &save), - TPARM_1(parm_down_cursor, n))) { + TIPARM_1(parm_down_cursor, n))) { vcost = SP_PARM->_cud_cost; } if (cursor_down - && (*cursor_down != '\n' || SP_PARM->_nl) + && (*cursor_down != '\n') && (n * SP_PARM->_cud1_cost < vcost)) { vcost = repeated_append(_nc_str_copy(target, &save), 0, SP_PARM->_cud1_cost, n, cursor_down); @@ -589,7 +588,7 @@ relative_move(NCURSES_SP_DCLx if (parm_up_cursor && SP_PARM->_cuu_cost < vcost && _nc_safe_strcat(_nc_str_copy(target, &save), - TPARM_1(parm_up_cursor, n))) { + TIPARM_1(parm_up_cursor, n))) { vcost = SP_PARM->_cuu_cost; } @@ -613,7 +612,7 @@ relative_move(NCURSES_SP_DCLx if (column_address && _nc_safe_strcat(_nc_str_copy(target, &save), - TPARM_1(column_address, to_x))) { + TIPARM_1(column_address, to_x))) { hcost = SP_PARM->_hpa_cost; } @@ -623,7 +622,7 @@ relative_move(NCURSES_SP_DCLx if (parm_right_cursor && SP_PARM->_cuf_cost < hcost && _nc_safe_strcat(_nc_str_copy(target, &save), - TPARM_1(parm_right_cursor, n))) { + TIPARM_1(parm_right_cursor, n))) { hcost = SP_PARM->_cuf_cost; } @@ -716,7 +715,7 @@ relative_move(NCURSES_SP_DCLx if (parm_left_cursor && SP_PARM->_cub_cost < hcost && _nc_safe_strcat(_nc_str_copy(target, &save), - TPARM_1(parm_left_cursor, n))) { + TIPARM_1(parm_left_cursor, n))) { hcost = SP_PARM->_cub_cost; } @@ -761,7 +760,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 @@ -793,7 +792,8 @@ onscreen_mvcur(NCURSES_SP_DCLx #define InitResult _nc_str_init(&result, buffer, sizeof(buffer)) /* tactic #0: use direct cursor addressing */ - if (_nc_safe_strcpy(InitResult, TPARM_2(SP_PARM->_address_cursor, ynew, xnew))) { + if (_nc_safe_strcpy(InitResult, TIPARM_2(SP_PARM->_address_cursor, + ynew, xnew))) { tactic = 0; usecost = SP_PARM->_cup_cost; @@ -962,7 +962,7 @@ _nc_real_mvcur(NCURSES_SP_DCLx NCURSES_CH_T oldattr; int code; - TR(TRACE_CALLS | TRACE_MOVE, (T_CALLED("_nc_tinfo_mvcur(%p,%d,%d,%d,%d)"), + TR(TRACE_CALLS | TRACE_MOVE, (T_CALLED("_nc_real_mvcur(%p,%d,%d,%d,%d)"), (void *) SP_PARM, yold, xold, ynew, xnew)); if (SP_PARM == 0) { @@ -997,37 +997,28 @@ _nc_real_mvcur(NCURSES_SP_DCLx if (xold >= screen_columns(SP_PARM)) { - if (SP_PARM->_nl) { - int l = (xold + 1) / screen_columns(SP_PARM); + int l = (xold + 1) / screen_columns(SP_PARM); - yold += l; - if (yold >= screen_lines(SP_PARM)) - l -= (yold - screen_lines(SP_PARM) - 1); + yold += l; + if (yold >= screen_lines(SP_PARM)) + l -= (yold - screen_lines(SP_PARM) - 1); - if (l > 0) { - if (carriage_return) { - NCURSES_PUTP2("carriage_return", carriage_return); - } else { - myOutCh(NCURSES_SP_ARGx '\r'); - } - xold = 0; + if (l > 0) { + if (carriage_return) { + NCURSES_PUTP2("carriage_return", carriage_return); + } else { + myOutCh(NCURSES_SP_ARGx '\r'); + } + xold = 0; - while (l > 0) { - if (newline) { - NCURSES_PUTP2("newline", newline); - } else { - myOutCh(NCURSES_SP_ARGx '\n'); - } - l--; + while (l > 0) { + if (newline) { + NCURSES_PUTP2("newline", newline); + } else { + myOutCh(NCURSES_SP_ARGx '\n'); } + l--; } - } else { - /* - * If caller set nonl(), we cannot really use newlines to - * position to the next row. - */ - xold = -1; - yold = -1; } } diff --git a/ncurses/tty/lib_tstp.c b/ncurses/tty/lib_tstp.c index 43a58e6..a20e72a 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 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.51 2021/09/04 10:54:35 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 diff --git a/ncurses/tty/lib_twait.c b/ncurses/tty/lib_twait.c index 3ab168d..a7604b3 100644 --- a/ncurses/tty/lib_twait.c +++ b/ncurses/tty/lib_twait.c @@ -71,12 +71,12 @@ # include <sys/select.h> # endif #endif -#ifdef _WIN32 +#if HAVE_SYS_TIME_H # include <sys/time.h> #endif #undef CUR -MODULE_ID("$Id: lib_twait.c,v 1.74 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_twait.c,v 1.75 2020/02/29 15:46:00 anonymous.maarten Exp $") static long _nc_gettime(TimeType * t0, int first) diff --git a/ncurses/tty/lib_vidattr.c b/ncurses/tty/lib_vidattr.c index c752919..15e7397 100644 --- a/ncurses/tty/lib_vidattr.c +++ b/ncurses/tty/lib_vidattr.c @@ -70,7 +70,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_vidattr.c,v 1.76 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_vidattr.c,v 1.78 2020/05/27 23:56:32 tom Exp $") #define doPut(mode) \ TPUTS_TRACE(#mode); \ @@ -258,16 +258,16 @@ NCURSES_SP_NAME(vidputs) (NCURSES_SP_DCLx if (turn_on || turn_off) { TPUTS_TRACE("set_attributes"); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - tparm(set_attributes, - (newmode & A_STANDOUT) != 0, - (newmode & A_UNDERLINE) != 0, - (newmode & A_REVERSE) != 0, - (newmode & A_BLINK) != 0, - (newmode & A_DIM) != 0, - (newmode & A_BOLD) != 0, - (newmode & A_INVIS) != 0, - (newmode & A_PROTECT) != 0, - (newmode & A_ALTCHARSET) != 0), + TIPARM_9(set_attributes, + (newmode & A_STANDOUT) != 0, + (newmode & A_UNDERLINE) != 0, + (newmode & A_REVERSE) != 0, + (newmode & A_BLINK) != 0, + (newmode & A_DIM) != 0, + (newmode & A_BOLD) != 0, + (newmode & A_INVIS) != 0, + (newmode & A_PROTECT) != 0, + (newmode & A_ALTCHARSET) != 0), 1, outc); PreviousAttr &= ALL_BUT_COLOR; } diff --git a/ncurses/tty/tty_update.c b/ncurses/tty/tty_update.c index 8626c79..bdd673b 100644 --- a/ncurses/tty/tty_update.c +++ b/ncurses/tty/tty_update.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 * @@ -85,7 +85,7 @@ #include <ctype.h> -MODULE_ID("$Id: tty_update.c,v 1.305 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: tty_update.c,v 1.312 2021/09/04 10:29:59 tom Exp $") /* * This define controls the line-breakout optimization. Every once in a @@ -117,14 +117,14 @@ static int ClrBottom(SCREEN *, int total); static void ClearScreen(SCREEN *, NCURSES_CH_T blank); static void ClrUpdate(SCREEN *); static void DelChar(SCREEN *, int count); -static void InsStr(SCREEN *, NCURSES_CH_T * line, int count); +static void InsStr(SCREEN *, NCURSES_CH_T *line, int count); static void TransformLine(SCREEN *, int const lineno); #else static int ClrBottom(int total); static void ClearScreen(NCURSES_CH_T blank); static void ClrUpdate(void); static void DelChar(int count); -static void InsStr(NCURSES_CH_T * line, int count); +static void InsStr(NCURSES_CH_T *line, int count); static void TransformLine(int const lineno); #endif @@ -136,7 +136,7 @@ static void TransformLine(int const lineno); ****************************************************************************/ static void -position_check(NCURSES_SP_DCLx int expected_y, int expected_x, char *legend) +position_check(NCURSES_SP_DCLx int expected_y, int expected_x, const char *legend) /* check to see if the real cursor position matches the virtual */ { char buf[20]; @@ -170,9 +170,9 @@ position_check(NCURSES_SP_DCLx int expected_y, int expected_x, char *legend) if (y - 1 != expected_y || x - 1 != expected_x) { NCURSES_SP_NAME(beep) (NCURSES_SP_ARG); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - tparm("\033[%d;%dH", - expected_y + 1, - expected_x + 1), + TIPARM_2("\033[%d;%dH", + expected_y + 1, + expected_x + 1), 1, NCURSES_SP_NAME(_nc_outch)); _tracef("position seen (%d, %d) doesn't match expected one (%d, %d) in %s", y - 1, x - 1, expected_y, expected_x, legend); @@ -429,11 +429,12 @@ PutCharLR(NCURSES_SP_DCLx const ARG_CH_T ch) /* we can put the char directly */ PutAttrChar(NCURSES_SP_ARGx ch); } else if (enter_am_mode && exit_am_mode) { + int oldcol = SP_PARM->_curscol; /* we can suppress automargin */ NCURSES_PUTP2("exit_am_mode", exit_am_mode); PutAttrChar(NCURSES_SP_ARGx ch); - SP_PARM->_curscol--; + SP_PARM->_curscol = oldcol; position_check(NCURSES_SP_ARGx SP_PARM->_cursrow, SP_PARM->_curscol, @@ -472,7 +473,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; @@ -567,7 +568,7 @@ can_clear_with(NCURSES_SP_DCLx ARG_CH_T ch) * This code is optimized using ech and rep. */ static int -EmitRange(NCURSES_SP_DCLx const NCURSES_CH_T * ntext, int num) +EmitRange(NCURSES_SP_DCLx const NCURSES_CH_T *ntext, int num) { int i; @@ -605,7 +606,7 @@ EmitRange(NCURSES_SP_DCLx const NCURSES_CH_T * ntext, int num) && runcount > SP_PARM->_ech_cost + SP_PARM->_cup_ch_cost && can_clear_with(NCURSES_SP_ARGx CHREF(ntext0))) { UpdateAttrs(SP_PARM, ntext0); - NCURSES_PUTP2("erase_chars", TPARM_1(erase_chars, runcount)); + NCURSES_PUTP2("erase_chars", TIPARM_1(erase_chars, runcount)); /* * If this is the last part of the given interval, @@ -620,6 +621,9 @@ EmitRange(NCURSES_SP_DCLx const NCURSES_CH_T * ntext, int num) return 1; /* cursor stays in the middle */ } } else if (repeat_char != 0 && +#if BSD_TPUTS + !isdigit(UChar(CharOf(ntext0))) && +#endif #if USE_WIDEC_SUPPORT (!SP_PARM->_screen_unicode && (CharOf(ntext0) < ((AttrOf(ntext0) & A_ALTCHARSET) @@ -645,9 +649,9 @@ EmitRange(NCURSES_SP_DCLx const NCURSES_CH_T * ntext, int num) AttrOf(ntext0) | A_ALTCHARSET); } NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_2(repeat_char, - CharOf(temp), - rep_count), + TIPARM_2(repeat_char, + CharOf(temp), + rep_count), 1, NCURSES_SP_NAME(_nc_outch)); SP_PARM->_curscol += rep_count; @@ -679,8 +683,8 @@ EmitRange(NCURSES_SP_DCLx const NCURSES_CH_T * ntext, int num) */ static int PutRange(NCURSES_SP_DCLx - const NCURSES_CH_T * otext, - const NCURSES_CH_T * ntext, + const NCURSES_CH_T *otext, + const NCURSES_CH_T *ntext, int row, int first, int last) { @@ -819,7 +823,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 @@ -881,7 +885,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 = @@ -1321,8 +1325,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])); @@ -1701,7 +1705,7 @@ ClearScreen(NCURSES_SP_DCLx NCURSES_CH_T blank) */ static void -InsStr(NCURSES_SP_DCLx NCURSES_CH_T * line, int count) +InsStr(NCURSES_SP_DCLx NCURSES_CH_T *line, int count) { TR(TRACE_UPDATE, ("InsStr(%p, %p,%d) called", (void *) SP_PARM, @@ -1713,7 +1717,7 @@ InsStr(NCURSES_SP_DCLx NCURSES_CH_T * line, int count) if (parm_ich) { TPUTS_TRACE("parm_ich"); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_1(parm_ich, count), + TIPARM_1(parm_ich, count), 1, NCURSES_SP_NAME(_nc_outch)); while (count > 0) { @@ -1766,7 +1770,7 @@ DelChar(NCURSES_SP_DCLx int count) if (parm_dch) { TPUTS_TRACE("parm_dch"); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_1(parm_dch, count), + TIPARM_1(parm_dch, count), 1, NCURSES_SP_NAME(_nc_outch)); } else { @@ -1835,7 +1839,7 @@ scroll_csr_forward(NCURSES_SP_DCLx UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("parm_index"); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_2(parm_index, n, 0), + TIPARM_1(parm_index, n), n, NCURSES_SP_NAME(_nc_outch)); } else if (parm_delete_line && bot == maxy) { @@ -1843,7 +1847,7 @@ scroll_csr_forward(NCURSES_SP_DCLx UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("parm_delete_line"); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_2(parm_delete_line, n, 0), + TIPARM_1(parm_delete_line, n), n, NCURSES_SP_NAME(_nc_outch)); } else if (scroll_forward && top == miny && bot == maxy) { @@ -1900,7 +1904,7 @@ scroll_csr_backward(NCURSES_SP_DCLx UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("parm_rindex"); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_2(parm_rindex, n, 0), + TIPARM_1(parm_rindex, n), n, NCURSES_SP_NAME(_nc_outch)); } else if (parm_insert_line && bot == maxy) { @@ -1908,7 +1912,7 @@ scroll_csr_backward(NCURSES_SP_DCLx UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("parm_insert_line"); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_2(parm_insert_line, n, 0), + TIPARM_1(parm_insert_line, n), n, NCURSES_SP_NAME(_nc_outch)); } else if (scroll_reverse && top == miny && bot == maxy) { @@ -1956,7 +1960,7 @@ scroll_idl(NCURSES_SP_DCLx int n, int del, int ins, NCURSES_CH_T blank) } else if (parm_delete_line) { TPUTS_TRACE("parm_delete_line"); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_2(parm_delete_line, n, 0), + TIPARM_1(parm_delete_line, n), n, NCURSES_SP_NAME(_nc_outch)); } else { /* if (delete_line) */ @@ -1972,7 +1976,7 @@ scroll_idl(NCURSES_SP_DCLx int n, int del, int ins, NCURSES_CH_T blank) } else if (parm_insert_line) { TPUTS_TRACE("parm_insert_line"); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_2(parm_insert_line, n, 0), + TIPARM_1(parm_insert_line, n), n, NCURSES_SP_NAME(_nc_outch)); } else { /* if (insert_line) */ @@ -2037,7 +2041,7 @@ NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_DCLx NCURSES_PUTP2("save_cursor", save_cursor); } NCURSES_PUTP2("change_scroll_region", - TPARM_2(change_scroll_region, top, bot)); + TIPARM_2(change_scroll_region, top, bot)); if (cursor_saved) { NCURSES_PUTP2("restore_cursor", restore_cursor); } else { @@ -2047,7 +2051,7 @@ NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_DCLx res = scroll_csr_forward(NCURSES_SP_ARGx n, top, bot, top, bot, blank); NCURSES_PUTP2("change_scroll_region", - TPARM_2(change_scroll_region, 0, maxy)); + TIPARM_2(change_scroll_region, 0, maxy)); SP_PARM->_cursrow = SP_PARM->_curscol = -1; } @@ -2083,7 +2087,7 @@ NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_DCLx NCURSES_PUTP2("save_cursor", save_cursor); } NCURSES_PUTP2("change_scroll_region", - TPARM_2(change_scroll_region, top, bot)); + TIPARM_2(change_scroll_region, top, bot)); if (cursor_saved) { NCURSES_PUTP2("restore_cursor", restore_cursor); } else { @@ -2094,7 +2098,7 @@ NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_DCLx -n, top, bot, top, bot, blank); NCURSES_PUTP2("change_scroll_region", - TPARM_2(change_scroll_region, 0, maxy)); + TIPARM_2(change_scroll_region, 0, maxy)); SP_PARM->_cursrow = SP_PARM->_curscol = -1; } diff --git a/ncurses/wcwidth.h b/ncurses/wcwidth.h index e261170..76673da 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 { @@ -119,7 +129,7 @@ static int bisearch(wchar_t ucs, const struct interval *table, int max) { * in ISO 10646. */ -int mk_wcwidth(wchar_t ucs) +NCURSES_EXPORT(int) mk_wcwidth(wchar_t ucs) { /* sorted list of non-overlapping intervals of non-spacing characters */ /* generated by "uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B c" */ @@ -187,7 +197,7 @@ 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 || @@ -207,7 +217,7 @@ int mk_wcwidth(wchar_t ucs) } -int mk_wcswidth(const wchar_t *pwcs, size_t n) +NCURSES_EXPORT(int) mk_wcswidth(const wchar_t *pwcs, size_t n) { int w, width = 0; @@ -230,7 +240,7 @@ int mk_wcswidth(const wchar_t *pwcs, size_t n) * the traditional terminal character-width behaviour. It is not * otherwise recommended for general use. */ -int mk_wcwidth_cjk(wchar_t ucs) +NCURSES_EXPORT(int) mk_wcwidth_cjk(wchar_t ucs) { /* sorted list of non-overlapping intervals of East Asian Ambiguous * characters, generated by "uniset +WIDTH-A -cat=Me -cat=Mn -cat=Cf c" */ @@ -298,7 +308,7 @@ int mk_wcwidth_cjk(wchar_t ucs) } -int mk_wcswidth_cjk(const wchar_t *pwcs, size_t n) +NCURSES_EXPORT(int) mk_wcswidth_cjk(const wchar_t *pwcs, size_t n) { int w, width = 0; @@ -310,3 +320,9 @@ 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 5d6d554..b817647 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-2020,2021 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.17 2021/06/17 21:26:02 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). */ diff --git a/ncurses/widechar/lib_cchar.c b/ncurses/widechar/lib_cchar.c index ed1d236..714be3b 100644 --- a/ncurses/widechar/lib_cchar.c +++ b/ncurses/widechar/lib_cchar.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2019,2020 Thomas E. Dickey * + * Copyright 2019-2020,2021 Thomas E. Dickey * * Copyright 2001-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -35,10 +35,11 @@ */ #include <curses.priv.h> +#include <wchar.h> -MODULE_ID("$Id: lib_cchar.c,v 1.33 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_cchar.c,v 1.37 2021/06/17 21:11:08 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 @@ -55,7 +56,7 @@ setcchar(cchar_t *wcval, int color_pair = pair_arg; unsigned len; - TR(TRACE_CCALLS, (T_CALLED("setcchar(%p,%s,%lu,%d,%p)"), + TR(TRACE_CCALLS, (T_CALLED("setcchar(%p,%s,attrs=%lu,pair=%d,%p)"), (void *) wcval, _nc_viswbuf(wch), (unsigned long) attrs, color_pair, opts)); @@ -104,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, @@ -113,7 +113,12 @@ getcchar(const cchar_t *wcval, (void *) pair_arg, opts)); - if (opts == NULL && wcval != NULL) { +#if !NCURSES_EXT_COLORS + if (opts != NULL) { + ; /* empty */ + } else +#endif + if (wcval != NULL) { wchar_t *wp; int len; @@ -130,6 +135,10 @@ 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; color_pair = GetPair(*wcval); get_extended_pair(opts, color_pair); diff --git a/ncurses/widechar/lib_erasewchar.c b/ncurses/widechar/lib_erasewchar.c index f49d641..197f80b 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 2bd4918..9f10d3b 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 695b526..83baaed 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-2020,2021 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.19 2021/09/04 10:29:59 tom Exp $") static int wadd_wint(WINDOW *win, wint_t *src) @@ -89,8 +89,8 @@ 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; + wchar_t erasec = 0; + wchar_t killc = 0; wint_t *oldstr = str; wint_t *tmpstr = str; wint_t ch; @@ -109,13 +109,12 @@ wgetn_wstr(WINDOW *win, wint_t *str, int maxlen) oldecho = sp->_echo; oldraw = sp->_raw; oldcbreak = sp->_cbreak; - nl(); - noecho(); - noraw(); - cbreak(); + NCURSES_SP_NAME(nl) (NCURSES_SP_ARG); + NCURSES_SP_NAME(noecho) (NCURSES_SP_ARG); + NCURSES_SP_NAME(raw) (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 +131,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,7 +144,7 @@ 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. */ diff --git a/ncurses/widechar/lib_ins_wch.c b/ncurses/widechar/lib_ins_wch.c index a744f5b..f753610 100644 --- a/ncurses/widechar/lib_ins_wch.c +++ b/ncurses/widechar/lib_ins_wch.c @@ -40,7 +40,7 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_ins_wch.c,v 1.24 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_ins_wch.c,v 1.25 2020/12/05 20:04:59 tom Exp $") /* * Insert the given character, updating the current location to simplify @@ -111,7 +111,7 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n) if (win != 0 && wstr != 0) { if (n < 1) - n = (int) wcslen(wstr); + n = INT_MAX; code = OK; if (n > 0) { @@ -120,7 +120,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 - wstr) < n) && *cp; cp++) { + for (cp = wstr; (*cp != L'\0') && ((cp - wstr) < n); cp++) { int len = _nc_wacs_width(*cp); if ((len >= 0 && len != 1) || !is7bits(*cp)) { diff --git a/ncurses/widechar/lib_vid_attr.c b/ncurses/widechar/lib_vid_attr.c index e167beb..2d9531f 100644 --- a/ncurses/widechar/lib_vid_attr.c +++ b/ncurses/widechar/lib_vid_attr.c @@ -37,7 +37,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_vid_attr.c,v 1.28 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_vid_attr.c,v 1.30 2020/05/27 23:54:31 tom Exp $") #define doPut(mode) \ TPUTS_TRACE(#mode); \ @@ -191,16 +191,16 @@ NCURSES_SP_NAME(vid_puts) (NCURSES_SP_DCLx if (turn_on || turn_off) { TPUTS_TRACE("set_attributes"); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_9(set_attributes, - (newmode & A_STANDOUT) != 0, - (newmode & A_UNDERLINE) != 0, - (newmode & A_REVERSE) != 0, - (newmode & A_BLINK) != 0, - (newmode & A_DIM) != 0, - (newmode & A_BOLD) != 0, - (newmode & A_INVIS) != 0, - (newmode & A_PROTECT) != 0, - (newmode & A_ALTCHARSET) != 0), + TIPARM_9(set_attributes, + (newmode & A_STANDOUT) != 0, + (newmode & A_UNDERLINE) != 0, + (newmode & A_REVERSE) != 0, + (newmode & A_BLINK) != 0, + (newmode & A_DIM) != 0, + (newmode & A_BOLD) != 0, + (newmode & A_INVIS) != 0, + (newmode & A_PROTECT) != 0, + (newmode & A_ALTCHARSET) != 0), 1, outc); previous_attr &= ALL_BUT_COLOR; previous_pair = 0; @@ -264,7 +264,6 @@ NCURSES_SP_NAME(vid_puts) (NCURSES_SP_DCLx TurnOn(A_VERTICAL, enter_vertical_hl_mode); #endif /* *INDENT-ON* */ - } if (reverse) diff --git a/ncurses/widechar/widechars.c b/ncurses/widechar/widechars.c index 3577479..d05ba98 100644 --- a/ncurses/widechar/widechars.c +++ b/ncurses/widechar/widechars.c @@ -31,9 +31,9 @@ #if USE_WIDEC_SUPPORT -MODULE_ID("$Id: widechars.c,v 1.7 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: widechars.c,v 1.9 2020/08/29 16:22:03 juergen Exp $") -#if defined(_WIN32) +#if (defined(_NC_WINDOWS)) && !defined(_NC_MSC) /* * MinGW has wide-character functions, but they do not work correctly. */ @@ -148,6 +148,6 @@ _nc_wctomb(char *s, wchar_t wc) return result; } -#endif /* _WIN32 */ +#endif /* _NC_WINDOWS */ #endif /* USE_WIDEC_SUPPORT */ diff --git a/ncurses/win32con/gettimeofday.c b/ncurses/win32con/gettimeofday.c index 8fad9a6..94be7b5 100644 --- a/ncurses/win32con/gettimeofday.c +++ b/ncurses/win32con/gettimeofday.c @@ -36,11 +36,11 @@ #include <windows.h> -MODULE_ID("$Id: gettimeofday.c,v 1.4 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: gettimeofday.c,v 1.6 2020/07/11 21:03:53 tom Exp $") #define JAN1970 116444736000000000LL /* the value for 01/01/1970 00:00 */ -int +NCURSES_EXPORT(int) gettimeofday(struct timeval *tv, void *tz GCC_UNUSED) { union { diff --git a/ncurses/win32con/wcwidth.c b/ncurses/win32con/wcwidth.c index 17ebaa6..5584366 100644 --- a/ncurses/win32con/wcwidth.c +++ b/ncurses/win32con/wcwidth.c @@ -28,7 +28,7 @@ ****************************************************************************/ #include <curses.priv.h> -MODULE_ID("$Id: wcwidth.c,v 1.3 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: wcwidth.c,v 1.4 2020/07/11 21:02:10 tom Exp $") #if USE_WIDEC_SUPPORT #define mk_wcwidth(ucs) _nc_wcwidth(ucs) @@ -36,10 +36,10 @@ MODULE_ID("$Id: wcwidth.c,v 1.3 2020/02/02 23:34:34 tom Exp $") #define mk_wcwidth_cjk(ucs) _nc_wcwidth_cjk(ucs) #define mk_wcswidth_cjk(pwcs, n) _nc_wcswidth_cjk(pwcs, n) -extern int mk_wcwidth(wchar_t); -extern int mk_wcswidth(const wchar_t *, size_t); -extern int mk_wcwidth_cjk(wchar_t); -extern int mk_wcswidth_cjk(const wchar_t *, size_t); +NCURSES_EXPORT(int) mk_wcwidth(wchar_t); +NCURSES_EXPORT(int) mk_wcswidth(const wchar_t *, size_t); +NCURSES_EXPORT(int) mk_wcwidth_cjk(wchar_t); +NCURSES_EXPORT(int) mk_wcswidth_cjk(const wchar_t *, size_t); #include <wcwidth.h> #else diff --git a/ncurses/win32con/win32_driver.c b/ncurses/win32con/win32_driver.c new file mode 100644 index 0000000..45aadf2 --- /dev/null +++ b/ncurses/win32con/win32_driver.c @@ -0,0 +1,1221 @@ +/**************************************************************************** + * Copyright 2018,2020 Thomas E. Dickey * + * Copyright 2008-2016,2017 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Juergen Pfeifer * + * and: Thomas E. Dickey * + ****************************************************************************/ + +/* + * TODO - improve screen-repainting performance, using implied wraparound to reduce write's + * TODO - make it optional whether screen is restored or not when non-buffered + */ + +#include <curses.priv.h> +#ifdef _NC_WINDOWS +#if (defined(__MINGW32__) || defined(__MINGW64__)) +#include <wchar.h> +#else +#include <tchar.h> +#endif +#include <io.h> + +#define CUR TerminalType(my_term). + +MODULE_ID("$Id: win32_driver.c,v 1.2 2020/11/21 23:35:56 tom Exp $") + +#define WINMAGIC NCDRV_MAGIC(NCDRV_WINCONSOLE) +#define EXP_OPTIMIZE 0 + +static bool console_initialized = FALSE; + +#define AssertTCB() assert(TCB != 0 && (TCB->magic == WINMAGIC)) +#define validateConsoleHandle() (AssertTCB() , console_initialized ||\ + (console_initialized=\ + _nc_console_checkinit(TRUE,FALSE))) +#define SetSP() assert(TCB->csp != 0); sp = TCB->csp; (void) sp +#define AdjustY() (WINCONSOLE.buffered ?\ + 0 : (int) WINCONSOLE.SBI.srWindow.Top) +#define RevAttr(attr) (WORD) (((attr) & 0xff00) | \ + ((((attr) & 0x07) << 4) | \ + (((attr) & 0x70) >> 4))) + +#if USE_WIDEC_SUPPORT +#define write_screen WriteConsoleOutputW +#define read_screen ReadConsoleOutputW +#else +#define write_screen WriteConsoleOutput +#define read_screen ReadConsoleOutput +#endif + +static WORD +MapAttr(WORD res, attr_t ch) +{ + if (ch & A_COLOR) { + int p; + + p = PairNumber(ch); + if (p > 0 && p < CON_NUMPAIRS) { + WORD a; + a = WINCONSOLE.pairs[p]; + res = (WORD) ((res & 0xff00) | a); + } + } + + if (ch & A_REVERSE) { + res = RevAttr(res); + } + + if (ch & A_STANDOUT) { + res = RevAttr(res) | BACKGROUND_INTENSITY; + } + + if (ch & A_BOLD) + res |= FOREGROUND_INTENSITY; + + if (ch & A_DIM) + res |= BACKGROUND_INTENSITY; + + return res; +} + +#if 0 /* def TRACE */ +static void +dump_screen(const char *fn, int ln) +{ + int max_cells = (WINCONSOLE.SBI.dwSize.Y * + (1 + WINCONSOLE.SBI.dwSize.X)) + 1; + char output[max_cells]; + CHAR_INFO save_screen[max_cells]; + COORD save_size; + SMALL_RECT save_region; + COORD bufferCoord; + + T(("dump_screen %s@%d", fn, ln)); + + save_region.Top = WINCONSOLE.SBI.srWindow.Top; + save_region.Left = WINCONSOLE.SBI.srWindow.Left; + save_region.Bottom = WINCONSOLE.SBI.srWindow.Bottom; + save_region.Right = WINCONSOLE.SBI.srWindow.Right; + + save_size.X = (SHORT) (save_region.Right - save_region.Left + 1); + save_size.Y = (SHORT) (save_region.Bottom - save_region.Top + 1); + + bufferCoord.X = bufferCoord.Y = 0; + + if (read_screen(WINCONSOLE.hdl, + save_screen, + save_size, + bufferCoord, + &save_region)) { + int i, j; + int ij = 0; + int k = 0; + + for (i = save_region.Top; i <= save_region.Bottom; ++i) { + for (j = save_region.Left; j <= save_region.Right; ++j) { + output[k++] = save_screen[ij++].Char.AsciiChar; + } + output[k++] = '\n'; + } + output[k] = 0; + + T(("DUMP: %d,%d - %d,%d", + save_region.Top, + save_region.Left, + save_region.Bottom, + save_region.Right)); + T(("%s", output)); + } +} + +#else +#define dump_screen(fn,ln) /* nothing */ +#endif + +#if USE_WIDEC_SUPPORT +/* + * TODO: support surrogate pairs + * TODO: support combining characters + * TODO: support acsc + * TODO: _nc_wacs should be part of sp. + */ +static BOOL +con_write16(TERMINAL_CONTROL_BLOCK * TCB, + int y, int x, cchar_t *str, int limit) +{ + int actual = 0; + CHAR_INFO *ci = TypeAlloca(CHAR_INFO, limit); + COORD loc, siz; + SMALL_RECT rec; + int i; + cchar_t ch; + SCREEN *sp; + + AssertTCB(); + SetSP(); + + for (i = actual = 0; i < limit; i++) { + ch = str[i]; + if (isWidecExt(ch)) + continue; + ci[actual].Char.UnicodeChar = CharOf(ch); + ci[actual].Attributes = MapAttr(WINCONSOLE.SBI.wAttributes, + AttrOf(ch)); + if (AttrOf(ch) & A_ALTCHARSET) { + if (_nc_wacs) { + int which = CharOf(ch); + if (which > 0 + && which < ACS_LEN + && CharOf(_nc_wacs[which]) != 0) { + ci[actual].Char.UnicodeChar = CharOf(_nc_wacs[which]); + } else { + ci[actual].Char.UnicodeChar = ' '; + } + } + } + ++actual; + } + + loc.X = (SHORT) 0; + loc.Y = (SHORT) 0; + siz.X = (SHORT) actual; + siz.Y = 1; + + rec.Left = (SHORT) x; + rec.Top = (SHORT) (y + AdjustY()); + rec.Right = (SHORT) (x + limit - 1); + rec.Bottom = rec.Top; + + return write_screen(WINCONSOLE.hdl, ci, siz, loc, &rec); +} +#define con_write(tcb, y, x, str, n) con_write16(tcb, y, x, str, n) +#else +static BOOL +con_write8(TERMINAL_CONTROL_BLOCK * TCB, int y, int x, chtype *str, int n) +{ + CHAR_INFO *ci = TypeAlloca(CHAR_INFO, n); + COORD loc, siz; + SMALL_RECT rec; + int i; + chtype ch; + SCREEN *sp; + + AssertTCB(); + SetSP(); + + for (i = 0; i < n; i++) { + ch = str[i]; + ci[i].Char.AsciiChar = ChCharOf(ch); + ci[i].Attributes = MapAttr(WINCONSOLE.SBI.wAttributes, + ChAttrOf(ch)); + if (ChAttrOf(ch) & A_ALTCHARSET) { + if (sp->_acs_map) + ci[i].Char.AsciiChar = + ChCharOf(NCURSES_SP_NAME(_nc_acs_char) (sp, ChCharOf(ch))); + } + } + + loc.X = (short) 0; + loc.Y = (short) 0; + siz.X = (short) n; + siz.Y = 1; + + rec.Left = (short) x; + rec.Top = (short) y; + rec.Right = (short) (x + n - 1); + rec.Bottom = rec.Top; + + return write_screen(WINCONSOLE.hdl, ci, siz, loc, &rec); +} +#define con_write(tcb, y, x, str, n) con_write8(tcb, y, x, str, n) +#endif + +#if EXP_OPTIMIZE +/* + * Comparing new/current screens, determine the last column-index for a change + * beginning on the given row,col position. Unlike a serial terminal, there is + * no cost for "moving" the "cursor" on the line as we update it. + */ +static int +find_end_of_change(SCREEN *sp, int row, int col) +{ + int result = col; + struct ldat *curdat = CurScreen(sp)->_line + row; + struct ldat *newdat = NewScreen(sp)->_line + row; + + while (col <= newdat->lastchar) { +#if USE_WIDEC_SUPPORT + if (isWidecExt(curdat->text[col]) || + isWidecExt(newdat->text[col])) { + result = col; + } else if (memcmp(&curdat->text[col], + &newdat->text[col], + sizeof(curdat->text[0]))) { + result = col; + } else { + break; + } +#else + if (curdat->text[col] != newdat->text[col]) { + result = col; + } else { + break; + } +#endif + ++col; + } + return result; +} + +/* + * Given a row,col position at the end of a change-chunk, look for the + * beginning of the next change-chunk. + */ +static int +find_next_change(SCREEN *sp, int row, int col) +{ + struct ldat *curdat = CurScreen(sp)->_line + row; + struct ldat *newdat = NewScreen(sp)->_line + row; + int result = newdat->lastchar + 1; + + while (++col <= newdat->lastchar) { +#if USE_WIDEC_SUPPORT + if (isWidecExt(curdat->text[col]) != + isWidecExt(newdat->text[col])) { + result = col; + break; + } else if (memcmp(&curdat->text[col], + &newdat->text[col], + sizeof(curdat->text[0]))) { + result = col; + break; + } +#else + if (curdat->text[col] != newdat->text[col]) { + result = col; + break; + } +#endif + } + return result; +} + +#define EndChange(first) \ + find_end_of_change(sp, y, first) +#define NextChange(last) \ + find_next_change(sp, y, last) + +#endif /* EXP_OPTIMIZE */ + +#define MARK_NOCHANGE(win,row) \ + win->_line[row].firstchar = _NOCHANGE; \ + win->_line[row].lastchar = _NOCHANGE + +static bool +restore_original_screen(void) +{ + COORD bufferCoord; + bool result = FALSE; + SMALL_RECT save_region = WINCONSOLE.save_region; + + T(("... restoring %s", WINCONSOLE.window_only ? + "window" : "entire buffer")); + + bufferCoord.X = (SHORT) (WINCONSOLE.window_only ? + WINCONSOLE.SBI.srWindow.Left : 0); + bufferCoord.Y = (SHORT) (WINCONSOLE.window_only ? + 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)); + } else { + T(("... restore original screen contents err")); + } + return result; +} + +static const char * +wcon_name(TERMINAL_CONTROL_BLOCK * TCB) +{ + (void) TCB; + return "win32console"; +} + +static int +wcon_doupdate(TERMINAL_CONTROL_BLOCK * TCB) +{ + int result = ERR; + int y, nonempty, n, x0, x1, Width, Height; + SCREEN *sp; + + T((T_CALLED("win32con::wcon_doupdate(%p)"), TCB)); + if (validateConsoleHandle()) { + SetSP(); + + Width = screen_columns(sp); + Height = screen_lines(sp); + nonempty = min(Height, NewScreen(sp)->_maxy + 1); + + T(("... %dx%d clear cur:%d new:%d", + Height, Width, + CurScreen(sp)->_clear, + NewScreen(sp)->_clear)); + + if (SP_PARM->_endwin == ewSuspend) { + + T(("coming back from shell mode")); + NCURSES_SP_NAME(reset_prog_mode) (NCURSES_SP_ARG); + + NCURSES_SP_NAME(_nc_mvcur_resume) (NCURSES_SP_ARG); + NCURSES_SP_NAME(_nc_screen_resume) (NCURSES_SP_ARG); + SP_PARM->_mouse_resume(SP_PARM); + + SP_PARM->_endwin = ewRunning; + } + + if ((CurScreen(sp)->_clear || NewScreen(sp)->_clear)) { + int x; +#if USE_WIDEC_SUPPORT + cchar_t *empty = TypeAlloca(cchar_t, Width); + wchar_t blank[2] = + { + L' ', L'\0' + }; + + for (x = 0; x < Width; x++) + setcchar(&empty[x], blank, 0, 0, 0); +#else + chtype *empty = TypeAlloca(chtype, Width); + + for (x = 0; x < Width; x++) + empty[x] = ' '; +#endif + + for (y = 0; y < nonempty; y++) { + con_write(TCB, y, 0, empty, Width); + memcpy(empty, + CurScreen(sp)->_line[y].text, + (size_t) Width * sizeof(empty[0])); + } + CurScreen(sp)->_clear = FALSE; + NewScreen(sp)->_clear = FALSE; + touchwin(NewScreen(sp)); + T(("... cleared %dx%d lines @%d of screen", nonempty, Width, + AdjustY())); + } + + for (y = 0; y < nonempty; y++) { + x0 = NewScreen(sp)->_line[y].firstchar; + if (x0 != _NOCHANGE) { +#if EXP_OPTIMIZE + int x2; + int limit = NewScreen(sp)->_line[y].lastchar; + while ((x1 = EndChange(x0)) <= limit) { + while ((x2 = NextChange(x1)) <= + limit && x2 <= (x1 + 2)) { + x1 = x2; + } + n = x1 - x0 + 1; + memcpy(&CurScreen(sp)->_line[y].text[x0], + &NewScreen(sp)->_line[y].text[x0], + n * sizeof(CurScreen(sp)->_line[y].text[x0])); + con_write(TCB, + y, + x0, + &CurScreen(sp)->_line[y].text[x0], n); + x0 = NextChange(x1); + } + + /* mark line changed successfully */ + if (y <= NewScreen(sp)->_maxy) { + MARK_NOCHANGE(NewScreen(sp), y); + } + if (y <= CurScreen(sp)->_maxy) { + MARK_NOCHANGE(CurScreen(sp), y); + } +#else + x1 = NewScreen(sp)->_line[y].lastchar; + n = x1 - x0 + 1; + if (n > 0) { + memcpy(&CurScreen(sp)->_line[y].text[x0], + &NewScreen(sp)->_line[y].text[x0], + (size_t) n * + sizeof(CurScreen(sp)->_line[y].text[x0])); + con_write(TCB, + y, + x0, + &CurScreen(sp)->_line[y].text[x0], n); + + /* mark line changed successfully */ + if (y <= NewScreen(sp)->_maxy) { + MARK_NOCHANGE(NewScreen(sp), y); + } + if (y <= CurScreen(sp)->_maxy) { + MARK_NOCHANGE(CurScreen(sp), y); + } + } +#endif + } + } + + /* put everything back in sync */ + for (y = nonempty; y <= NewScreen(sp)->_maxy; y++) { + MARK_NOCHANGE(NewScreen(sp), y); + } + for (y = nonempty; y <= CurScreen(sp)->_maxy; y++) { + MARK_NOCHANGE(CurScreen(sp), y); + } + + if (!NewScreen(sp)->_leaveok) { + CurScreen(sp)->_curx = NewScreen(sp)->_curx; + CurScreen(sp)->_cury = NewScreen(sp)->_cury; + + TCB->drv->td_hwcur(TCB, + 0, + 0, + CurScreen(sp)->_cury, + CurScreen(sp)->_curx); + } + _nc_console_selectActiveHandle(); + result = OK; + } + returnCode(result); +} + +static bool +wcon_CanHandle(TERMINAL_CONTROL_BLOCK * TCB, + const char *tname, + int *errret GCC_UNUSED) +{ + bool code = FALSE; + + T((T_CALLED("win32con::wcon_CanHandle(%p)"), TCB)); + + assert((TCB != 0) && (tname != 0)); + + TCB->magic = WINMAGIC; + + if (tname == 0 || *tname == 0) { + if (!_nc_console_vt_supported()) + code = TRUE; + } else if (tname != 0 && *tname == '#') { + /* + * Use "#" (a character which cannot begin a terminal's name) to + * select specific driver from the table. + * + * In principle, we could have more than one non-terminfo driver, + * e.g., "win32gui". + */ + size_t n = strlen(tname + 1); + if (n != 0 + && ((strncmp(tname + 1, "win32console", n) == 0) + || (strncmp(tname + 1, "win32con", n) == 0))) { + code = TRUE; + } + } else if (tname != 0 && stricmp(tname, "unknown") == 0) { + code = TRUE; + } + + /* + * This is intentional, to avoid unnecessary breakage of applications + * using <term.h> symbols. + */ + if (code && (TerminalType(&TCB->term).Booleans == 0)) { + _nc_init_termtype(&TerminalType(&TCB->term)); +#if NCURSES_EXT_NUMBERS + _nc_export_termtype2(&TCB->term.type, &TerminalType(&TCB->term)); +#endif + } + + if (!code) { + if (_nc_console_test(0)) { + T(("isTermInfoConsole=TRUE")); + WINCONSOLE.isTermInfoConsole = TRUE; + } + } + returnBool(code); +} + +static int +wcon_dobeepflash(TERMINAL_CONTROL_BLOCK * TCB, + int beepFlag) +{ + SCREEN *sp; + int res = ERR; + + int high = (WINCONSOLE.SBI.srWindow.Bottom - + WINCONSOLE.SBI.srWindow.Top + 1); + int wide = (WINCONSOLE.SBI.srWindow.Right - + WINCONSOLE.SBI.srWindow.Left + 1); + int max_cells = (high * wide); + int i; + + CHAR_INFO *this_screen = TypeAlloca(CHAR_INFO, max_cells); + CHAR_INFO *that_screen = TypeAlloca(CHAR_INFO, max_cells); + COORD this_size; + SMALL_RECT this_region; + COORD bufferCoord; + + if (validateConsoleHandle()) { + SetSP(); + this_region.Top = WINCONSOLE.SBI.srWindow.Top; + this_region.Left = WINCONSOLE.SBI.srWindow.Left; + this_region.Bottom = WINCONSOLE.SBI.srWindow.Bottom; + this_region.Right = WINCONSOLE.SBI.srWindow.Right; + + this_size.X = (SHORT) wide; + this_size.Y = (SHORT) high; + + bufferCoord.X = this_region.Left; + bufferCoord.Y = this_region.Top; + + if (!beepFlag && + read_screen(WINCONSOLE.hdl, + this_screen, + this_size, + bufferCoord, + &this_region)) { + + memcpy(that_screen, + this_screen, + sizeof(CHAR_INFO) * (size_t) max_cells); + + for (i = 0; i < max_cells; i++) { + that_screen[i].Attributes = + RevAttr(that_screen[i].Attributes); + } + + write_screen(WINCONSOLE.hdl, that_screen, this_size, + bufferCoord, &this_region); + Sleep(200); + write_screen(WINCONSOLE.hdl, this_screen, this_size, + bufferCoord, &this_region); + + } else { + MessageBeep(MB_ICONWARNING); /* MB_OK might be better */ + } + res = OK; + } + return res; +} + +static int +wcon_print(TERMINAL_CONTROL_BLOCK * TCB, + char *data GCC_UNUSED, + int len GCC_UNUSED) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); + + return ERR; +} + +static int +wcon_defaultcolors(TERMINAL_CONTROL_BLOCK * TCB, + int fg GCC_UNUSED, + int bg GCC_UNUSED) +{ + SCREEN *sp; + int code = ERR; + + AssertTCB(); + SetSP(); + + return (code); +} + +static void +wcon_setcolor(TERMINAL_CONTROL_BLOCK * TCB, + int fore, + int color, + int (*outc) (SCREEN *, int) GCC_UNUSED) +{ + (void) TCB; + if (validateConsoleHandle()) { + WORD a = _nc_console_MapColor(fore, color); + a |= (WORD) ((WINCONSOLE.SBI.wAttributes) & (fore ? 0xfff8 : 0xff8f)); + SetConsoleTextAttribute(WINCONSOLE.hdl, a); + _nc_console_get_SBI(); + } +} + +static bool +wcon_rescol(TERMINAL_CONTROL_BLOCK * TCB) +{ + bool res = FALSE; + + (void) TCB; + if (validateConsoleHandle()) { + WORD a = FOREGROUND_BLUE | FOREGROUND_RED | FOREGROUND_GREEN; + SetConsoleTextAttribute(WINCONSOLE.hdl, a); + _nc_console_get_SBI(); + res = TRUE; + } + return res; +} + +static bool +wcon_rescolors(TERMINAL_CONTROL_BLOCK * TCB) +{ + int result = FALSE; + SCREEN *sp; + + AssertTCB(); + SetSP(); + + return result; +} + +static int +wcon_size(TERMINAL_CONTROL_BLOCK * TCB, int *Lines, int *Cols) +{ + int result = ERR; + + T((T_CALLED("win32con::wcon_size(%p)"), TCB)); + + if (validateConsoleHandle() && + (Lines != NULL) && (Cols != NULL)) { + _nc_console_size(Lines, Cols); + result = OK; + } + returnCode(result); +} + +static int +wcon_setsize(TERMINAL_CONTROL_BLOCK * TCB GCC_UNUSED, + int l GCC_UNUSED, + int c GCC_UNUSED) +{ + AssertTCB(); + return ERR; +} + +static int +wcon_sgmode(TERMINAL_CONTROL_BLOCK * TCB, int setFlag, TTY * buf) +{ + int result = ERR; + + T((T_CALLED("win32con::wcon_sgmode(TCB=(%p),setFlag=%d,TTY=(%p)"), + TCB, setFlag, buf)); + if (buf != NULL && validateConsoleHandle()) { + + if (setFlag) { + _nc_console_setmode(WINCONSOLE.hdl, buf); + TCB->term.Nttyb = *buf; + } else { + _nc_console_getmode(WINCONSOLE.hdl, &(TCB->term.Nttyb)); + *buf = TCB->term.Nttyb; + } + result = OK; + } + returnCode(result); +} + +#define MIN_WIDE 80 +#define MIN_HIGH 24 + +static int +wcon_mode(TERMINAL_CONTROL_BLOCK * TCB, int progFlag, int defFlag) +{ + SCREEN *sp; + TERMINAL *_term = (TERMINAL *) TCB; + int code = ERR; + + if (validateConsoleHandle()) { + sp = TCB->csp; + + T((T_CALLED("win32con::wcon_mode(%p, progFlag=%d, defFlag=%d)"), + TCB, progFlag, defFlag)); + + WINCONSOLE.progMode = progFlag; + WINCONSOLE.lastOut = progFlag ? WINCONSOLE.hdl : WINCONSOLE.out; + SetConsoleActiveScreenBuffer(WINCONSOLE.lastOut); + + if (progFlag) /* prog mode */ { + if (defFlag) { + if ((wcon_sgmode(TCB, FALSE, &(_term->Nttyb)) == OK)) { + code = OK; + } + } else { + /* reset_prog_mode */ + if (wcon_sgmode(TCB, TRUE, &(_term->Nttyb)) == OK) { + if (sp) { + if (sp->_keypad_on) + _nc_keypad(sp, TRUE); + } + if (!WINCONSOLE.buffered) { + _nc_console_set_scrollback(FALSE, &WINCONSOLE.SBI); + } + code = OK; + } + } + T(("... buffered:%d, clear:%d", + WINCONSOLE.buffered, CurScreen(sp)->_clear)); + } else { /* shell mode */ + if (defFlag) { + /* def_shell_mode */ + if (wcon_sgmode(TCB, FALSE, &(_term->Ottyb)) == OK) { + code = OK; + } + } else { + /* reset_shell_mode */ + if (sp) { + _nc_keypad(sp, FALSE); + NCURSES_SP_NAME(_nc_flush) (sp); + } + code = wcon_sgmode(TCB, TRUE, &(_term->Ottyb)); + if (!WINCONSOLE.buffered) { + _nc_console_set_scrollback(TRUE, &WINCONSOLE.save_SBI); + if (!restore_original_screen()) + code = ERR; + } + SetConsoleCursorInfo(WINCONSOLE.hdl, &WINCONSOLE.save_CI); + } + } + + } + returnCode(code); +} + +static void +wcon_screen_init(SCREEN *sp GCC_UNUSED) +{ +} + +static void +wcon_wrap(SCREEN *sp GCC_UNUSED) +{ +} + +static void +wcon_release(TERMINAL_CONTROL_BLOCK * TCB) +{ + T((T_CALLED("win32con::wcon_release(%p)"), TCB)); + + AssertTCB(); + if (TCB->prop) + free(TCB->prop); + + returnVoid; +} + +static void +wcon_init(TERMINAL_CONTROL_BLOCK * TCB) +{ + T((T_CALLED("win32con::wcon_init(%p)"), TCB)); + + AssertTCB(); + + if (!(console_initialized = _nc_console_checkinit(TRUE, FALSE))) { + returnVoid; + } + + if (TCB) { + TCB->info.initcolor = TRUE; + TCB->info.canchange = FALSE; + TCB->info.hascolor = TRUE; + TCB->info.caninit = TRUE; + + TCB->info.maxpairs = CON_NUMPAIRS; + TCB->info.maxcolors = 8; + TCB->info.numlabels = 0; + TCB->info.labelwidth = 0; + TCB->info.labelheight = 0; + TCB->info.nocolorvideo = 1; + TCB->info.tabsize = 8; + + TCB->info.numbuttons = WINCONSOLE.numButtons; + TCB->info.defaultPalette = _nc_cga_palette; + + } + returnVoid; +} + +static void +wcon_initpair(TERMINAL_CONTROL_BLOCK * TCB, + int pair, + int f, + int b) +{ + SCREEN *sp; + + if (validateConsoleHandle()) { + SetSP(); + + if ((pair > 0) && (pair < CON_NUMPAIRS) && (f >= 0) && (f < 8) + && (b >= 0) && (b < 8)) { + WINCONSOLE.pairs[pair] = + _nc_console_MapColor(true, f) | + _nc_console_MapColor(false, b); + } + } +} + +static void +wcon_initcolor(TERMINAL_CONTROL_BLOCK * TCB, + int color GCC_UNUSED, + int r GCC_UNUSED, + int g GCC_UNUSED, + int b GCC_UNUSED) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); +} + +static void +wcon_do_color(TERMINAL_CONTROL_BLOCK * TCB, + int old_pair GCC_UNUSED, + int pair GCC_UNUSED, + int reverse GCC_UNUSED, + int (*outc) (SCREEN *, int) GCC_UNUSED +) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); +} + +static void +wcon_initmouse(TERMINAL_CONTROL_BLOCK * TCB) +{ + SCREEN *sp; + + if (validateConsoleHandle()) { + SetSP(); + + sp->_mouse_type = M_TERM_DRIVER; + } +} + +static int +wcon_testmouse(TERMINAL_CONTROL_BLOCK * TCB, + int delay + EVENTLIST_2nd(_nc_eventlist * evl)) +{ + int rc = 0; + SCREEN *sp; + + if (validateConsoleHandle()) { + SetSP(); + + if (sp->_drv_mouse_head < sp->_drv_mouse_tail) { + rc = TW_MOUSE; + } else { + rc = TCBOf(sp)->drv->td_twait(TCBOf(sp), + TWAIT_MASK, + delay, + (int *) 0 + EVENTLIST_2nd(evl)); + } + } + + return rc; +} + +static int +wcon_mvcur(TERMINAL_CONTROL_BLOCK * TCB, + int yold GCC_UNUSED, int xold GCC_UNUSED, + int y, int x) +{ + int ret = ERR; + + (void) TCB; + if (validateConsoleHandle()) { + COORD loc; + loc.X = (short) x; + loc.Y = (short) (y + AdjustY()); + SetConsoleCursorPosition(WINCONSOLE.hdl, loc); + ret = OK; + } + return ret; +} + +static void +wcon_hwlabel(TERMINAL_CONTROL_BLOCK * TCB, + int labnum GCC_UNUSED, + char *text GCC_UNUSED) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); +} + +static void +wcon_hwlabelOnOff(TERMINAL_CONTROL_BLOCK * TCB, + int OnFlag GCC_UNUSED) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); +} + +static chtype +wcon_conattr(TERMINAL_CONTROL_BLOCK * TCB GCC_UNUSED) +{ + chtype res = A_NORMAL; + res |= (A_BOLD | A_DIM | A_REVERSE | A_STANDOUT | A_COLOR); + return res; +} + +static void +wcon_setfilter(TERMINAL_CONTROL_BLOCK * TCB) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); +} + +static void +wcon_initacs(TERMINAL_CONTROL_BLOCK * TCB, + chtype *real_map GCC_UNUSED, + chtype *fake_map GCC_UNUSED) +{ +#define DATA(a,b) { a, b } + static struct { + int acs_code; + int use_code; + } table[] = { + DATA('a', 0xb1), /* ACS_CKBOARD */ + DATA('f', 0xf8), /* ACS_DEGREE */ + DATA('g', 0xf1), /* ACS_PLMINUS */ + DATA('j', 0xd9), /* ACS_LRCORNER */ + DATA('l', 0xda), /* ACS_ULCORNER */ + DATA('k', 0xbf), /* ACS_URCORNER */ + DATA('m', 0xc0), /* ACS_LLCORNER */ + DATA('n', 0xc5), /* ACS_PLUS */ + DATA('q', 0xc4), /* ACS_HLINE */ + DATA('t', 0xc3), /* ACS_LTEE */ + DATA('u', 0xb4), /* ACS_RTEE */ + DATA('v', 0xc1), /* ACS_BTEE */ + DATA('w', 0xc2), /* ACS_TTEE */ + DATA('x', 0xb3), /* ACS_VLINE */ + DATA('y', 0xf3), /* ACS_LEQUAL */ + DATA('z', 0xf2), /* ACS_GEQUAL */ + DATA('0', 0xdb), /* ACS_BLOCK */ + DATA('{', 0xe3), /* ACS_PI */ + DATA('}', 0x9c), /* ACS_STERLING */ + DATA(',', 0xae), /* ACS_LARROW */ + DATA('+', 0xaf), /* ACS_RARROW */ + DATA('~', 0xf9), /* ACS_BULLET */ + }; +#undef DATA + unsigned n; + + SCREEN *sp; + if (validateConsoleHandle()) { + SetSP(); + + for (n = 0; n < SIZEOF(table); ++n) { + real_map[table[n].acs_code] = + (chtype) table[n].use_code | A_ALTCHARSET; + if (sp != 0) + sp->_screen_acs_map[table[n].acs_code] = TRUE; + } + } +} + +static int +wcon_twait(TERMINAL_CONTROL_BLOCK * TCB, + int mode, + int milliseconds, + int *timeleft + EVENTLIST_2nd(_nc_eventlist * evl)) +{ + SCREEN *sp; + int code = 0; + + if (validateConsoleHandle()) { + SetSP(); + + code = _nc_console_twait(sp, + WINCONSOLE.inp, + mode, + milliseconds, + timeleft EVENTLIST_2nd(evl)); + } + return code; +} + +static int +wcon_read(TERMINAL_CONTROL_BLOCK * TCB, int *buf) +{ + SCREEN *sp; + int n = -1; + + T((T_CALLED("win32con::wcon_read(%p)"), TCB)); + + assert(buf); + if (validateConsoleHandle()) { + SetSP(); + + n = _nc_console_read(sp, WINCONSOLE.inp, buf); + } + returnCode(n); +} + +static int +wcon_nap(TERMINAL_CONTROL_BLOCK * TCB GCC_UNUSED, int ms) +{ + T((T_CALLED("win32con::wcon_nap(%p, %d)"), TCB, ms)); + Sleep((DWORD) ms); + returnCode(OK); +} + +static int +wcon_cursorSet(TERMINAL_CONTROL_BLOCK * TCB GCC_UNUSED, int mode) +{ + int res = -1; + + T((T_CALLED("win32con:wcon_cursorSet(%d)"), mode)); + if (validateConsoleHandle()) { + CONSOLE_CURSOR_INFO this_CI = WINCONSOLE.save_CI; + switch (mode) { + case 0: + this_CI.bVisible = FALSE; + break; + case 1: + break; + case 2: + this_CI.dwSize = 100; + break; + } + SetConsoleCursorInfo(WINCONSOLE.hdl, &this_CI); + } + returnCode(res); +} + +static bool +wcon_kyExist(TERMINAL_CONTROL_BLOCK * TCB GCC_UNUSED, int keycode) +{ + bool found = FALSE; + + T((T_CALLED("win32con::wcon_kyExist(%d)"), keycode)); + found = _nc_console_keyExist(keycode); + returnBool(found); +} + +static int +wcon_kpad(TERMINAL_CONTROL_BLOCK * TCB, int flag GCC_UNUSED) +{ + SCREEN *sp; + int code = ERR; + + T((T_CALLED("win32con::wcon_kpad(%p, %d)"), TCB, flag)); + + if (validateConsoleHandle()) { + SetSP(); + + if (sp) { + code = OK; + } + } + returnCode(code); +} + +static int +wcon_keyok(TERMINAL_CONTROL_BLOCK * TCB, + int keycode, + int flag) +{ + int code = ERR; + SCREEN *sp; + + T((T_CALLED("win32con::wcon_keyok(%p, %d, %d)"), TCB, keycode, flag)); + + if (validateConsoleHandle()) { + SetSP(); + if (sp) { + code = _nc_console_keyok(keycode, flag); + } + } + returnCode(code); +} + +NCURSES_EXPORT_VAR (TERM_DRIVER) _nc_WIN_DRIVER = { + FALSE, + wcon_name, /* Name */ + wcon_CanHandle, /* CanHandle */ + wcon_init, /* init */ + wcon_release, /* release */ + wcon_size, /* size */ + wcon_sgmode, /* sgmode */ + wcon_conattr, /* conattr */ + wcon_mvcur, /* hwcur */ + wcon_mode, /* mode */ + wcon_rescol, /* rescol */ + wcon_rescolors, /* rescolors */ + wcon_setcolor, /* color */ + wcon_dobeepflash, /* DoBeepFlash */ + wcon_initpair, /* initpair */ + wcon_initcolor, /* initcolor */ + wcon_do_color, /* docolor */ + wcon_initmouse, /* initmouse */ + wcon_testmouse, /* testmouse */ + wcon_setfilter, /* setfilter */ + wcon_hwlabel, /* hwlabel */ + wcon_hwlabelOnOff, /* hwlabelOnOff */ + wcon_doupdate, /* update */ + wcon_defaultcolors, /* defaultcolors */ + wcon_print, /* print */ + wcon_size, /* getsize */ + wcon_setsize, /* setsize */ + wcon_initacs, /* initacs */ + wcon_screen_init, /* scinit */ + wcon_wrap, /* scexit */ + wcon_twait, /* twait */ + wcon_read, /* read */ + wcon_nap, /* nap */ + wcon_kpad, /* kpad */ + wcon_keyok, /* kyOk */ + wcon_kyExist, /* kyExist */ + wcon_cursorSet /* cursorSet */ +}; + +#endif /* _NC_WINDOWS */ diff --git a/ncurses/win32con/win_driver.c b/ncurses/win32con/win_driver.c index 280aa6d..ad9e629 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-2020,2021 Thomas E. Dickey * * Copyright 2008-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -55,11 +55,9 @@ #define CUR TerminalType(my_term). -MODULE_ID("$Id: win_driver.c,v 1.63 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: win_driver.c,v 1.67 2021/09/04 10:54:35 tom Exp $") -#ifndef __GNUC__ -# error We need GCC to compile for MinGW -#endif +#define TypeAlloca(type,count) (type*) _alloca(sizeof(type) * (size_t) (count)) #define WINMAGIC NCDRV_MAGIC(NCDRV_WINCONSOLE) @@ -116,7 +114,7 @@ static const LONG ansi_keys[] = #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. */ @@ -262,7 +260,7 @@ static BOOL con_write16(TERMINAL_CONTROL_BLOCK * TCB, int y, int x, cchar_t *str, int limit) { int actual = 0; - CHAR_INFO ci[limit]; + CHAR_INFO *ci = TypeAlloca(CHAR_INFO, limit); COORD loc, siz; SMALL_RECT rec; int i; @@ -311,7 +309,7 @@ con_write16(TERMINAL_CONTROL_BLOCK * TCB, int y, int x, cchar_t *str, int limit) static BOOL con_write8(TERMINAL_CONTROL_BLOCK * TCB, int y, int x, chtype *str, int n) { - CHAR_INFO ci[n]; + CHAR_INFO *ci = TypeAlloca(CHAR_INFO, n); COORD loc, siz; SMALL_RECT rec; int i; @@ -510,7 +508,7 @@ wcon_doupdate(TERMINAL_CONTROL_BLOCK * TCB) if ((CurScreen(sp)->_clear || NewScreen(sp)->_clear)) { int x; #if USE_WIDEC_SUPPORT - cchar_t empty[Width]; + cchar_t *empty = TypeAlloca(cchar_t, Width); wchar_t blank[2] = { L' ', L'\0' @@ -519,7 +517,7 @@ wcon_doupdate(TERMINAL_CONTROL_BLOCK * TCB) for (x = 0; x < Width; x++) setcchar(&empty[x], blank, 0, 0, 0); #else - chtype empty[Width]; + chtype *empty = TypeAlloca(chtype, Width); for (x = 0; x < Width; x++) empty[x] = ' '; @@ -675,8 +673,8 @@ wcon_dobeepflash(TERMINAL_CONTROL_BLOCK * TCB, int max_cells = (high * wide); int i; - CHAR_INFO this_screen[max_cells]; - CHAR_INFO that_screen[max_cells]; + CHAR_INFO *this_screen = TypeAlloca(CHAR_INFO, max_cells); + CHAR_INFO *that_screen = TypeAlloca(CHAR_INFO, max_cells); COORD this_size; SMALL_RECT this_region; COORD bufferCoord; @@ -701,7 +699,9 @@ wcon_dobeepflash(TERMINAL_CONTROL_BLOCK * TCB, bufferCoord, &this_region)) { - memcpy(that_screen, this_screen, sizeof(that_screen)); + memcpy(that_screen, + this_screen, + sizeof(CHAR_INFO) * (size_t) max_cells); for (i = 0; i < max_cells; i++) { that_screen[i].Attributes = RevAttr(that_screen[i].Attributes); @@ -1867,7 +1867,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 @@ -1974,7 +1974,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. */ |