Regenerate headers and source files

Commands used:
  ./configure --with-terminfo-dirs=/system_ext/etc/terminfo --with-default-terminfo-dir=$PWD/lib/terminfo
  pushd misc ; sh run_tic.sh ; popd
  ./configure --enable-tcap-names --with-terminfo-dirs=/system_ext/etc/terminfo --with-default-terminfo-dir=/system_ext/etc/terminfo
  make -j
  for f in `find lib/terminfo -type l`; do cp $f $f.tmp; mv $f.tmp $f; done

Change-Id: I3f94b3a76ab18184638f52fbb5bd760996794f9a
Signed-off-by: micky387 <mickaelsaibi@free.fr>
diff --git a/include/MKterm.h.awk b/include/MKterm.h.awk
new file mode 100644
index 0000000..1fbe883
--- /dev/null
+++ b/include/MKterm.h.awk
@@ -0,0 +1,413 @@
+# vile:awkmode
+function declare_termtype(number,suffix) {
+	printf "typedef struct termtype%s {	/* in-core form of terminfo data */\n", suffix;
+	print  "    char  *term_names;		/* str_table offset of term names */"
+	print  "    char  *str_table;		/* pointer to string table */"
+	print  "    NCURSES_SBOOL  *Booleans;	/* array of boolean values */"
+	printf "    %-5s *Numbers;		/* array of integer values */\n", number;
+	print  "    char  **Strings;		/* array of string offsets */"
+	print  ""
+	print  "#if NCURSES_XNAMES"
+	print  "    char  *ext_str_table;	/* pointer to extended string table */"
+	print  "    char  **ext_Names;		/* corresponding names */"
+	print  ""
+	print  "    unsigned short num_Booleans;/* count total Booleans */";
+	print  "    unsigned short num_Numbers;	/* count total Numbers */";
+	print  "    unsigned short num_Strings;	/* count total Strings */";
+	print  ""
+	print  "    unsigned short ext_Booleans;/* count extensions to Booleans */";
+	print  "    unsigned short ext_Numbers;	/* count extensions to Numbers */";
+	print  "    unsigned short ext_Strings;	/* count extensions to Strings */";
+	print  "#endif /* NCURSES_XNAMES */"
+	print  ""
+	printf "} TERMTYPE%s;\n", suffix;
+}
+BEGIN {
+	lcurl = "{";
+	rcurl = "}";
+	print  "/****************************************************************************"
+	print  " * Copyright 2018-2021,2023 Thomas E. Dickey                                *"
+	print  " * Copyright 1998-2013,2017 Free Software Foundation, Inc.                  *"
+	print  " *                                                                          *"
+	print  " * Permission is hereby granted, free of charge, to any person obtaining a  *"
+	print  " * copy of this software and associated documentation files (the            *"
+	print  " * \"Software\"), to deal in the Software without restriction, including      *"
+	print  " * without limitation the rights to use, copy, modify, merge, publish,      *"
+	print  " * distribute, distribute with modifications, sublicense, and/or sell       *"
+	print  " * copies of the Software, and to permit persons to whom the Software is    *"
+	print  " * furnished to do so, subject to the following conditions:                 *"
+	print  " *                                                                          *"
+	print  " * The above copyright notice and this permission notice shall be included  *"
+	print  " * in all copies or substantial portions of the Software.                   *"
+	print  " *                                                                          *"
+	print  " * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *"
+	print  " * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *"
+	print  " * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *"
+	print  " * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *"
+	print  " * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *"
+	print  " * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *"
+	print  " * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *"
+	print  " *                                                                          *"
+	print  " * Except as contained in this notice, the name(s) of the above copyright   *"
+	print  " * holders shall not be used in advertising or otherwise to promote the     *"
+	print  " * sale, use or other dealings in this Software without prior written       *"
+	print  " * authorization.                                                           *"
+	print  " ****************************************************************************/"
+	print  ""
+	print  "/****************************************************************************/"
+	print  "/* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995                */"
+	print  "/*    and: Eric S. Raymond <esr@snark.thyrsus.com>                          */"
+	print  "/*    and: Thomas E. Dickey                        1995-on                  */"
+	print  "/****************************************************************************/"
+	print  ""
+	print  "/* $Id: MKterm.h.awk.in,v 1.85 2023/04/23 19:15:36 tom Exp $ */"
+	print  ""
+	print  "/*"
+	print  "**	term.h -- Definition of struct term"
+	print  "*/"
+	print  ""
+	print  "#ifndef NCURSES_TERM_H_incl"
+	print  "#define NCURSES_TERM_H_incl 1"
+	print  ""
+	print  "#undef  NCURSES_VERSION"
+	print  "#define NCURSES_VERSION \"6.5\""
+	print  ""
+	print  "#include <ncurses_dll.h>"
+	print  ""
+	print  "#ifdef __cplusplus"
+	printf "extern \"C\" %s\n", lcurl;
+	print  "#endif"
+	print  ""
+	print  "/* Make this file self-contained by providing defaults for the HAVE_TERMIO[S]_H"
+	print  " * definition (based on the system for which this was configured)."
+	print  " */"
+	print  ""
+	print  "#ifndef __NCURSES_H"
+	print  ""
+	print  "typedef struct screen  SCREEN;"
+	print  ""
+	print  "#if 1"
+	print  "#undef  NCURSES_SP_FUNCS"
+	print  "#define NCURSES_SP_FUNCS 20240427"
+	print  "#undef  NCURSES_SP_NAME"
+	print  "#define NCURSES_SP_NAME(name) name##_sp"
+	print  ""
+	print  "/* Define the sp-funcs helper function */"
+	print  "#undef  NCURSES_SP_OUTC"
+	print  "#define NCURSES_SP_OUTC NCURSES_SP_NAME(NCURSES_OUTC)"
+	print  "typedef int (*NCURSES_SP_OUTC)(SCREEN*, int);"
+	print  "#endif"
+	print  ""
+	print  "#endif /* __NCURSES_H */"
+	print  ""
+	print  "#undef  NCURSES_CONST"
+	print  "#define NCURSES_CONST const"
+	print  ""
+	print  "#undef  NCURSES_SBOOL"
+	print  "#define NCURSES_SBOOL char"
+	print  ""
+	print  "#undef  NCURSES_USE_DATABASE"
+	print  "#define NCURSES_USE_DATABASE 1"
+	print  ""
+	print  "#undef  NCURSES_USE_TERMCAP"
+	print  "#define NCURSES_USE_TERMCAP 0"
+	print  ""
+	print  "#undef  NCURSES_XNAMES"
+	print  "#define NCURSES_XNAMES 1"
+	print  ""
+	print  "/* We will use these symbols to hide differences between"
+	print  " * termios/termio/sgttyb interfaces."
+	print  " */"
+	print  "#undef  TTY"
+	print  "#undef  SET_TTY"
+	print  "#undef  GET_TTY"
+	print  ""
+	print  "/* Assume POSIX termio if we have the header and function */"
+	print  "/* #if HAVE_TERMIOS_H && HAVE_TCGETATTR */"
+	print  "#if 1 && 1"
+	print  ""
+	print  "#undef  TERMIOS"
+	print  "#define TERMIOS 1"
+	print  ""
+	print  "#include <termios.h>"
+	print  "#define TTY struct termios"
+	print  ""
+	print  "#else /* !HAVE_TERMIOS_H */"
+	print  ""
+	print  "/* #if HAVE_TERMIO_H */"
+	print  "#if 1"
+	print  ""
+	print  "#undef  TERMIOS"
+	print  "#define TERMIOS 1"
+	print  ""
+	print  "#include <termio.h>"
+	print  "#define TTY struct termio"
+	print  ""
+	print  "#else /* !HAVE_TERMIO_H */"
+	print  ""
+	print  "#if (defined(_WIN32) || defined(_WIN64))"
+	print  "#if 0"
+	print  "#include <win32_curses.h>"
+	print  "#define TTY struct winconmode"
+	print  "#else"
+	print  "#include <ncurses_mingw.h>"
+	print  "#define TTY struct termios"
+	print  "#endif"
+	print  "#else"
+	print  "#undef TERMIOS"
+	print  "#include <sgtty.h>"
+	print  "#include <sys/ioctl.h>"
+	print  "#define TTY struct sgttyb"
+	print  "#endif /* MINGW32 */"
+	print  "#endif /* HAVE_TERMIO_H */"
+	print  ""
+	print  "#endif /* HAVE_TERMIOS_H */"
+	print  ""
+	print  "#ifdef TERMIOS"
+	print  "#define GET_TTY(fd, buf) tcgetattr(fd, buf)"
+	print  "#define SET_TTY(fd, buf) tcsetattr(fd, TCSADRAIN, buf)"
+	print  "#elif 0 && (defined(_WIN32) || defined(_WIN64))"
+	print  "#define GET_TTY(fd, buf) _nc_console_getmode(_nc_console_fd2handle(fd),buf)"
+	print  "#define SET_TTY(fd, buf) _nc_console_setmode(_nc_console_fd2handle(fd),buf)"
+	print  "#else"
+	print  "#define GET_TTY(fd, buf) gtty(fd, buf)"
+	print  "#define SET_TTY(fd, buf) stty(fd, buf)"
+	print  "#endif"
+	print  ""
+	print  "#ifndef	GCC_NORETURN"
+	print  "#define	GCC_NORETURN /* nothing */"
+	print  "#endif"
+	print  ""
+	print  "#define NAMESIZE 256"
+	print  ""
+	print  "/* The cast works because TERMTYPE is the first data in TERMINAL */"
+	print  "#define CUR ((TERMTYPE *)(cur_term))->"
+	print  ""
+}
+
+$2 == "%%-STOP-HERE-%%" {
+	print  ""
+	printf "#define BOOLWRITE %d\n", BoolCount
+	printf "#define NUMWRITE  %d\n", NumberCount
+	printf "#define STRWRITE  %d\n", StringCount
+	print  ""
+	print  "/* older synonyms for some capabilities */"
+	print  "#define beehive_glitch	no_esc_ctlc"
+	print  "#define teleray_glitch	dest_tabs_magic_smso"
+	print  ""
+	print  "/* HPUX-11 uses this name rather than the standard one */"
+	print  "#ifndef micro_char_size"
+	print  "#define micro_char_size micro_col_size"
+	print  "#endif"
+	print  ""
+	print  "#ifdef __INTERNAL_CAPS_VISIBLE"
+}
+
+/^#/ { next; }
+
+/^used_by/ { next ; }
+/^userdef/ { next ; }
+
+$1 == "acs_chars" {
+	acsindex = StringCount;
+}
+
+$3 == "bool" {
+	printf "#define %-30s CUR Booleans[%d]\n", $1, BoolCount++
+}
+
+$3 == "num" {
+	printf "#define %-30s CUR Numbers[%d]\n", $1, NumberCount++
+}
+
+$3 == "str" {
+	printf "#define %-30s CUR Strings[%d]\n", $1, StringCount++
+}
+
+END {
+	print  "#endif /* __INTERNAL_CAPS_VISIBLE */"
+	print  ""
+	print  ""
+	print  "/*"
+	print  " * Predefined terminfo array sizes"
+	print  " */"
+	printf "#define BOOLCOUNT %d\n", BoolCount
+	printf "#define NUMCOUNT  %d\n", NumberCount
+	printf "#define STRCOUNT  %d\n", StringCount
+	print  ""
+	print  "/* used by code for comparing entries */"
+	print  "#define acs_chars_index	", acsindex
+	print  ""
+	declare_termtype("short","");
+	print  ""
+	print  "/*"
+	print  " * The only reason these structures are visible is for read-only use."
+	print  " * Programs which modify the data are not, never were, portable across"
+	print  " * curses implementations."
+	print  " *"
+	print  " * The first field in TERMINAL is used in macros."
+	print  " * The remaining fields are private."
+	print  " */"
+	print  "#ifdef NCURSES_INTERNALS"
+	print  ""
+	print  "#undef TERMINAL"
+	print  "#define TERMINAL struct term"
+	print  "TERMINAL;"
+	print  ""
+	if (1) {
+	declare_termtype("int","2");
+	} else {
+	print  "#undef TERMTYPE2"
+	print  "#define TERMTYPE2 TERMTYPE"
+	}
+	print  "#else"
+	print  ""
+	print  "typedef struct term {		/* describe an actual terminal */"
+	print  "    TERMTYPE	type;		/* terminal type description */"
+	print  "} TERMINAL;"
+	print  ""
+	print  "#endif /* NCURSES_INTERNALS */"
+	print  ""
+	print  ""
+	print  "#if 0 && !0"
+	print  "extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;"
+	print  "#elif 0"
+	print  "NCURSES_WRAPPED_VAR(TERMINAL *, cur_term);"
+	print  "#define cur_term   NCURSES_PUBLIC_VAR(cur_term())"
+	print  "#else"
+	print  "extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;"
+	print  "#endif"
+	print  ""
+	print  "#if 0 || 0"
+	print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolnames);"
+	print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolcodes);"
+	print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolfnames);"
+	print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, numnames);"
+	print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, numcodes);"
+	print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, numfnames);"
+	print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strnames);"
+	print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strcodes);"
+	print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strfnames);"
+	print  ""
+	print  "#define boolnames  NCURSES_PUBLIC_VAR(boolnames())"
+	print  "#define boolcodes  NCURSES_PUBLIC_VAR(boolcodes())"
+	print  "#define boolfnames NCURSES_PUBLIC_VAR(boolfnames())"
+	print  "#define numnames   NCURSES_PUBLIC_VAR(numnames())"
+	print  "#define numcodes   NCURSES_PUBLIC_VAR(numcodes())"
+	print  "#define numfnames  NCURSES_PUBLIC_VAR(numfnames())"
+	print  "#define strnames   NCURSES_PUBLIC_VAR(strnames())"
+	print  "#define strcodes   NCURSES_PUBLIC_VAR(strcodes())"
+	print  "#define strfnames  NCURSES_PUBLIC_VAR(strfnames())"
+	print  ""
+	print  "#else"
+	print  ""
+	print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolnames[];"
+	print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolcodes[];"
+	print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolfnames[];"
+	print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numnames[];"
+	print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numcodes[];"
+	print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numfnames[];"
+	print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strnames[];"
+	print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strcodes[];"
+	print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strfnames[];"
+	print  ""
+	print  "#endif"
+	print  ""
+	print  "/*"
+	print  " * These entrypoints are used only by the ncurses utilities such as tic."
+	print  " */"
+	print  "#ifdef NCURSES_INTERNALS"
+	print  ""
+	print  "extern NCURSES_EXPORT(int) _nc_set_tty_mode (TTY *buf);"
+	print  "extern NCURSES_EXPORT(int) _nc_read_entry2 (const char * const, char * const, TERMTYPE2 *const);"
+	print  "extern NCURSES_EXPORT(int) _nc_read_file_entry (const char *const, TERMTYPE2 *);"
+	print  "extern NCURSES_EXPORT(int) _nc_read_termtype (TERMTYPE2 *, char *, int);"
+	print  "extern NCURSES_EXPORT(char *) _nc_first_name (const char *const);"
+	print  "extern NCURSES_EXPORT(int) _nc_name_match (const char *const, const char *const, const char *const);"
+	print  "extern NCURSES_EXPORT(char *) _nc_tiparm(int, const char *, ...);"
+	print  "extern NCURSES_EXPORT(const TERMTYPE *) _nc_fallback (const char *);"
+	print  "extern NCURSES_EXPORT(int) _nc_read_entry (const char * const, char * const, TERMTYPE *const);"
+	print  ""
+	print  "#endif /* NCURSES_INTERNALS */"
+	print  ""
+	print  "/*"
+	print  " * Normal entry points"
+	print  " */"
+	print  "extern NCURSES_EXPORT(TERMINAL *) set_curterm (TERMINAL *);"
+	print  "extern NCURSES_EXPORT(int) del_curterm (TERMINAL *);"
+	print  ""
+	print  "/* miscellaneous entry points */"
+	print  "extern NCURSES_EXPORT(int) restartterm (NCURSES_CONST char *, int, int *);"
+	print  "extern NCURSES_EXPORT(int) setupterm (const char *,int,int *);"
+	print  ""
+	print  "/* terminfo entry points, also declared in curses.h */"
+	print  "#if !defined(__NCURSES_H)"
+	print  "extern NCURSES_EXPORT(char *) tigetstr (const char *);"
+	print  "extern NCURSES_EXPORT_VAR(char) ttytype[];"
+	print  "extern NCURSES_EXPORT(int) putp (const char *);"
+	print  "extern NCURSES_EXPORT(int) tigetflag (const char *);"
+	print  "extern NCURSES_EXPORT(int) tigetnum (const char *);"
+	print  ""
+	print  "#if 1 /* NCURSES_TPARM_VARARGS */"
+	print  "extern NCURSES_EXPORT(char *) tparm (const char *, ...);	/* special */"
+	print  "#else"
+	print  "extern NCURSES_EXPORT(char *) tparm (const char *, long,long,long,long,long,long,long,long,long);	/* special */"
+	print  "#endif"
+	print  ""
+	print  "extern NCURSES_EXPORT(char *) tiparm (const char *, ...);		/* special */"
+	print  "extern NCURSES_EXPORT(char *) tiparm_s (int, int, const char *, ...);	/* special */"
+	print  "extern NCURSES_EXPORT(int) tiscan_s (int *, int *, const char *);	/* special */"
+	print  ""
+	print  "#endif /* __NCURSES_H */"
+	print  ""
+	print  "/* termcap database emulation (XPG4 uses const only for 2nd param of tgetent) */"
+	print  "#if !defined(NCURSES_TERMCAP_H_incl)"
+	print  "extern NCURSES_EXPORT(char *) tgetstr (const char *, char **);"
+	print  "extern NCURSES_EXPORT(char *) tgoto (const char *, int, int);"
+	print  "extern NCURSES_EXPORT(int) tgetent (char *, const char *);"
+	print  "extern NCURSES_EXPORT(int) tgetflag (const char *);"
+	print  "extern NCURSES_EXPORT(int) tgetnum (const char *);"
+	print  "extern NCURSES_EXPORT(int) tputs (const char *, int, int (*)(int));"
+	print  "#endif /* NCURSES_TERMCAP_H_incl */"
+	print  ""
+	print  "/*"
+	print  " * Include curses.h before term.h to enable these extensions."
+	print  " */"
+	print  "#if defined(NCURSES_SP_FUNCS) && (NCURSES_SP_FUNCS != 0)"
+	print  ""
+	print  "extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tigetstr) (SCREEN*, const char *);"
+	print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(putp) (SCREEN*, const char *);"
+	print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tigetflag) (SCREEN*, const char *);"
+	print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tigetnum) (SCREEN*, const char *);"
+	print  ""
+	print  "#if 1 /* NCURSES_TPARM_VARARGS */"
+	print  "extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tparm) (SCREEN*, const char *, ...);	/* special */"
+	print  "#else"
+	print  "extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tparm) (SCREEN*, const char *, long,long,long,long,long,long,long,long,long);	/* special */"
+	print  "#endif"
+	print  ""
+	print  "/* termcap database emulation (XPG4 uses const only for 2nd param of tgetent) */"
+	print  "extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tgetstr) (SCREEN*, const char *, char **);"
+	print  "extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tgoto) (SCREEN*, const char *, int, int);"
+	print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tgetent) (SCREEN*, char *, const char *);"
+	print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tgetflag) (SCREEN*, const char *);"
+	print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tgetnum) (SCREEN*, const char *);"
+	print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tputs) (SCREEN*, const char *, int, NCURSES_SP_OUTC);"
+	print  ""
+	print  "extern NCURSES_EXPORT(TERMINAL *) NCURSES_SP_NAME(set_curterm) (SCREEN*, TERMINAL *);"
+	print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(del_curterm) (SCREEN*, TERMINAL *);"
+	print  ""
+	print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(restartterm) (SCREEN*, NCURSES_CONST char *, int, int *);"
+	print  "#endif /* NCURSES_SP_FUNCS */"
+	print  ""
+	print  "/*"
+	print  " * Debugging features."
+	print  " */"
+	print  "extern GCC_NORETURN NCURSES_EXPORT(void)    exit_terminfo(int);"
+	print  ""
+	print  "#ifdef __cplusplus"
+	printf "%s\n", rcurl;
+	print  "#endif"
+	print  ""
+	print  "#endif /* NCURSES_TERM_H_incl */"
+}
diff --git a/include/Makefile b/include/Makefile
new file mode 100644
index 0000000..c123e5c
--- /dev/null
+++ b/include/Makefile
@@ -0,0 +1,212 @@
+# $Id: Makefile.in,v 1.53 2021/07/03 18:56:51 tom Exp $
+##############################################################################
+# Copyright 2019-2020,2021 Thomas E. Dickey                                  #
+# Copyright 1998-2013,2015 Free Software Foundation, Inc.                    #
+#                                                                            #
+# Permission is hereby granted, free of charge, to any person obtaining a    #
+# copy of this software and associated documentation files (the "Software"), #
+# to deal in the Software without restriction, including without limitation  #
+# the rights to use, copy, modify, merge, publish, distribute, distribute    #
+# with modifications, sublicense, and/or sell copies of the Software, and to #
+# permit persons to whom the Software is furnished to do so, subject to the  #
+# following conditions:                                                      #
+#                                                                            #
+# The above copyright notice and this permission notice shall be included in #
+# all copies or substantial portions of the Software.                        #
+#                                                                            #
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   #
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    #
+# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      #
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    #
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        #
+# DEALINGS IN THE SOFTWARE.                                                  #
+#                                                                            #
+# Except as contained in this notice, the name(s) of the above copyright     #
+# holders shall not be used in advertising or otherwise to promote the sale, #
+# use or other dealings in this Software without prior written               #
+# authorization.                                                             #
+##############################################################################
+#
+# Author: Thomas E. Dickey 1996-on
+#
+# Makefile for ncurses source code.
+#
+# This makes/installs ncurses include-files
+#
+# The variable 'srcdir' refers to the source-distribution, and can be set with
+# the configure script by "--srcdir=DIR".
+
+# turn off _all_ suffix rules; we'll generate our own
+.SUFFIXES:
+
+SHELL		= /bin/sh
+
+THIS		= Makefile
+
+DESTDIR		= 
+srcdir		= .
+prefix		= /usr
+exec_prefix	= ${prefix}
+includedir	= ${prefix}/include
+includesubdir	= 
+
+INCLUDEDIR	= $(DESTDIR)$(includedir)$(includesubdir)
+
+INSTALL		= /usr/bin/install -c
+INSTALL_DATA	= ${INSTALL} -m 644
+
+AWK		= mawk
+LN_S		= ln -s -f
+
+CC		= gcc
+CFLAGS		= -O2 --param max-inline-insns-single=1200 
+CPPFLAGS	= -DHAVE_CONFIG_H -I. -I. -I../include -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DNDEBUG
+
+CTAGS		= ctags
+ETAGS		= etags
+
+VERSION		= 6.5
+
+# The "Caps" file specifies the terminfo database format, as well as the list
+# of function keys.
+TERMINFO_CAPS	= $(srcdir)/Caps
+CAPLIST	=	$(TERMINFO_CAPS) \
+		$(srcdir)/Caps-ncurses
+
+# These files are generated by the configure script
+CONFIG_SRC = \
+	MKterm.h.awk \
+	curses.head \
+	ncurses_dll.h \
+	termcap.h \
+	unctrl.h
+
+# These files are generated by this makefile
+AUTO_SRC = \
+	curses.h \
+	hashsize.h \
+	ncurses_def.h \
+	parametrized.h \
+	config.h \
+	term.h
+
+################################################################################
+
+.PHONY :	all
+.PHONY :	check
+.PHONY :	clean
+.PHONY :	depend
+.PHONY :	distclean
+.PHONY :	install
+.PHONY :	install.libs
+.PHONY :	libs
+.PHONY :	mostlyclean
+.PHONY :	realclean
+.PHONY :	sources
+.PHONY :	uninstall
+.PHONY :	uninstall.libs
+
+all \
+libs \
+depend \
+sources \
+install ::	$(AUTO_SRC)
+
+curses.h :	$(CAPLIST) \
+		curses.head \
+		$(srcdir)/curses.tail \
+		$(srcdir)/MKkey_defs.sh
+	cat curses.head >$@
+	AWK=$(AWK) $(SHELL) $(srcdir)/MKkey_defs.sh $(CAPLIST) >>$@
+	$(SHELL) -c 'if test "0" = "1" ; then cat $(srcdir)/curses.events >>$@ ; fi'
+	$(SHELL) -c 'if test "cchar_t" = "cchar_t" ; then cat $(srcdir)/curses.wide >>$@ ; fi'
+	cat $(srcdir)/curses.tail >>$@
+
+term.h: 	$(CAPLIST) \
+		MKterm.h.awk
+	$(AWK) -f MKterm.h.awk $(CAPLIST) > $@
+	$(SHELL) $(srcdir)/edit_cfg.sh ../include/ncurses_cfg.h $@
+
+hashsize.h:	$(CAPLIST) \
+		$(srcdir)/MKhashsize.sh
+	$(SHELL) $(srcdir)/MKhashsize.sh $(CAPLIST) >$@
+
+ncurses_def.h: $(srcdir)/ncurses_defs $(srcdir)/MKncurses_def.sh
+	AWK=$(AWK) $(SHELL) $(srcdir)/MKncurses_def.sh $(srcdir)/ncurses_defs >$@
+
+parametrized.h: $(CAPLIST) \
+		$(srcdir)/MKparametrized.sh
+	AWK=$(AWK) $(SHELL) $(srcdir)/MKparametrized.sh $(CAPLIST) >$@
+
+# This is required by pthread.h on MinGW
+config.h:
+	touch $@
+
+tags:
+	$(CTAGS) *.[ch]
+
+TAGS:
+	$(ETAGS) *.[ch]
+
+mostlyclean ::
+	-rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace
+
+clean :: mostlyclean
+	-rm -f $(AUTO_SRC)
+	-rm -rf *.dSYM
+
+distclean :: clean
+	-rm -f Makefile $(CONFIG_SRC) config.h
+
+realclean :: distclean
+
+# Verify that each header-file can be compiled without including another.
+check:
+	@$(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.*
+
+###############################################################################
+# The remainder of this file is automatically generated during configuration
+###############################################################################
+
+# generated by mk-hdr.awk
+#  subset:     ticlib+termlib+ext_tinfo+base+widechar+ext_funcs
+#  compat:     yes
+
+${INCLUDEDIR} :
+	mkdir -p $@
+
+install \
+install.libs \
+install.includes :: ${AUTO_SRC} ${INCLUDEDIR} \
+		curses.h \
+		unctrl.h \
+		ncurses_dll.h \
+		term.h \
+		termcap.h \
+		$(srcdir)/term_entry.h
+	@ (cd ${INCLUDEDIR} && rm -f curses.h) ; ../headers.sh ${INSTALL_DATA} ${INCLUDEDIR} ${srcdir} curses.h
+	@ (cd ${INCLUDEDIR} && rm -f ncurses.h && ${LN_S} curses.h ncurses.h)
+	@ (cd ${INCLUDEDIR} && rm -f unctrl.h) ; ../headers.sh ${INSTALL_DATA} ${INCLUDEDIR} ${srcdir} unctrl.h
+	@ (cd ${INCLUDEDIR} && rm -f ncurses_dll.h) ; ../headers.sh ${INSTALL_DATA} ${INCLUDEDIR} ${srcdir} ncurses_dll.h
+	@ (cd ${INCLUDEDIR} && rm -f term.h) ; ../headers.sh ${INSTALL_DATA} ${INCLUDEDIR} ${srcdir} term.h
+	@ (cd ${INCLUDEDIR} && rm -f termcap.h) ; ../headers.sh ${INSTALL_DATA} ${INCLUDEDIR} ${srcdir} termcap.h
+	@ (cd ${INCLUDEDIR} && rm -f term_entry.h) ; ../headers.sh ${INSTALL_DATA} ${INCLUDEDIR} ${srcdir} $(srcdir)/term_entry.h
+
+uninstall \
+uninstall.libs \
+uninstall.includes ::
+	-@ (cd ${INCLUDEDIR} && rm -f curses.h)
+	-@ (cd ${INCLUDEDIR} && rm -f ncurses.h)
+	-@ (cd ${INCLUDEDIR} && rm -f unctrl.h)
+	-@ (cd ${INCLUDEDIR} && rm -f ncurses_dll.h)
+	-@ (cd ${INCLUDEDIR} && rm -f term.h)
+	-@ (cd ${INCLUDEDIR} && rm -f termcap.h)
+	-@ (cd ${INCLUDEDIR} && rm -f term_entry.h)
diff --git a/include/config.h b/include/config.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/include/config.h
diff --git a/include/curses.h b/include/curses.h
new file mode 100644
index 0000000..cbe1bc4
--- /dev/null
+++ b/include/curses.h
@@ -0,0 +1,2143 @@
+/****************************************************************************
+ * Copyright 2018-2023,2024 Thomas E. Dickey                                *
+ * Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
+ *                                                                          *
+ * Permission is hereby granted, free of charge, to any person obtaining a  *
+ * 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: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
+ *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Thomas E. Dickey                        1996-on                 *
+ ****************************************************************************/
+
+/* $Id: curses.h.in,v 1.282 2024/01/19 11:50:07 tom Exp $ */
+
+#ifndef __NCURSES_H
+#define __NCURSES_H
+
+/*
+ The symbols beginning NCURSES_ or USE_ are configuration choices.
+ A few of the former can be overridden by applications at compile-time.
+ Most of the others correspond to configure-script options (or checks
+ by the configure-script for features of the system on which it is built).
+
+ These symbols can be overridden by applications at compile-time:
+ NCURSES_NOMACROS suppresses macro definitions in favor of functions
+ NCURSES_WATTR_MACROS suppresses wattr_* macro definitions
+ NCURSES_WIDECHAR is an alternative for declaring wide-character functions.
+
+ These symbols are used only when building ncurses:
+ NCURSES_ATTR_T
+ NCURSES_FIELD_INTERNALS
+ NCURSES_INTERNALS
+
+ These symbols are set by the configure script:
+ NCURSES_ENABLE_STDBOOL_H
+ NCURSES_EXPANDED
+ NCURSES_EXT_COLORS
+ NCURSES_EXT_FUNCS
+ NCURSES_EXT_PUTWIN
+ NCURSES_NO_PADDING
+ NCURSES_OSPEED_COMPAT
+ NCURSES_PATHSEP
+ NCURSES_REENTRANT
+ NCURSES_SIGWINCH
+ */
+
+#define CURSES 1
+#define CURSES_H 1
+
+/* These are defined only in curses.h, and are used for conditional compiles */
+#define NCURSES_VERSION_MAJOR 6
+#define NCURSES_VERSION_MINOR 5
+#define NCURSES_VERSION_PATCH 20240427
+
+/* This is defined in more than one ncurses header, for identification */
+#undef  NCURSES_VERSION
+#define NCURSES_VERSION "6.5"
+
+/*
+ * Identify the mouse encoding version.
+ */
+#define NCURSES_MOUSE_VERSION 2
+
+/*
+ * Definitions to facilitate DLL's.
+ */
+#include <ncurses_dll.h>
+
+/*
+ * Extra headers.
+ */
+#if 1
+#include <stdint.h>
+#endif
+
+#ifdef __cplusplus
+#else
+#if 0
+#include <stdnoreturn.h>
+#undef GCC_NORETURN
+#define GCC_NORETURN _Noreturn
+#endif
+#endif
+
+/*
+ * User-definable tweak to disable the include of <stdbool.h>.
+ */
+#ifndef NCURSES_ENABLE_STDBOOL_H
+#define NCURSES_ENABLE_STDBOOL_H 1
+#endif
+
+/*
+ * NCURSES_ATTR_T is used to quiet compiler warnings when building ncurses
+ * configured using --disable-macros.
+ */
+#ifndef NCURSES_ATTR_T
+#define NCURSES_ATTR_T int
+#endif
+
+/*
+ * Expands to 'const' if ncurses is configured using --enable-const.  Note that
+ * doing so makes it incompatible with other implementations of X/Open Curses.
+ */
+#undef  NCURSES_CONST
+#define NCURSES_CONST const
+
+#undef NCURSES_INLINE
+#define NCURSES_INLINE inline
+
+/*
+ * The standard type used for color values, and for color-pairs.  The latter
+ * allows the curses library to enumerate the combinations of foreground and
+ * background colors used by an application, and is normally the product of the
+ * total foreground and background colors.
+ *
+ * X/Open uses "short" for both of these types, ultimately because they are
+ * numbers from the SVr4 terminal database, which uses 16-bit signed values.
+ */
+#undef	NCURSES_COLOR_T
+#define	NCURSES_COLOR_T short
+
+#undef	NCURSES_PAIRS_T
+#define	NCURSES_PAIRS_T short
+
+/*
+ * Definitions used to make WINDOW and similar structs opaque.
+ */
+#ifndef NCURSES_INTERNALS
+#define NCURSES_OPAQUE       1
+#define NCURSES_OPAQUE_FORM  1
+#define NCURSES_OPAQUE_MENU  1
+#define NCURSES_OPAQUE_PANEL 1
+#endif
+
+/*
+ * Definition used to optionally suppress wattr* macros to help with the
+ * transition from ncurses5 to ncurses6 by allowing the header files to
+ * be shared across development packages for ncursesw in both ABIs.
+ */
+#ifndef NCURSES_WATTR_MACROS
+#define NCURSES_WATTR_MACROS 0
+#endif
+
+/*
+ * The reentrant code relies on the opaque setting, but adds features.
+ */
+#ifndef NCURSES_REENTRANT
+#define NCURSES_REENTRANT 0
+#endif
+
+/*
+ * KEY_RESIZE is an extended feature that relies upon the SIGWINCH handler
+ * in ncurses.
+ */
+#if 1
+#ifndef NCURSES_SIGWINCH
+#define NCURSES_SIGWINCH 1
+#endif
+#else
+#undef NCURSES_SIGWINCH
+#define NCURSES_SIGWINCH 0
+#endif
+
+/*
+ * In certain environments, we must work around linker problems for data
+ */
+#undef NCURSES_BROKEN_LINKER
+#if 0
+#define NCURSES_BROKEN_LINKER 1
+#endif
+
+/*
+ * Control whether bindings for interop support are added.
+ */
+#undef	NCURSES_INTEROP_FUNCS
+#define	NCURSES_INTEROP_FUNCS 1
+
+/*
+ * The internal type used for window dimensions.
+ */
+#undef	NCURSES_SIZE_T
+#define	NCURSES_SIZE_T short
+
+/*
+ * Control whether tparm() supports varargs or fixed-parameter list.
+ */
+#undef NCURSES_TPARM_VARARGS
+#define NCURSES_TPARM_VARARGS 1
+
+/*
+ * Control type used for tparm's arguments.  While X/Open equates long and
+ * char* values, this is not always workable for 64-bit platforms.
+ */
+#undef NCURSES_TPARM_ARG
+#define NCURSES_TPARM_ARG intptr_t
+
+/*
+ * Control whether ncurses uses wcwidth() for checking width of line-drawing
+ * characters.
+ */
+#undef NCURSES_WCWIDTH_GRAPHICS
+#define NCURSES_WCWIDTH_GRAPHICS 1
+
+/*
+ * NCURSES_CH_T is used in building the library, but not used otherwise in
+ * this header file, since that would make the normal/wide-character versions
+ * of the header incompatible.
+ */
+#undef	NCURSES_CH_T
+#define NCURSES_CH_T cchar_t
+
+#if 1 && defined(_LP64)
+typedef unsigned chtype;
+typedef unsigned mmask_t;
+#else
+typedef uint32_t chtype;
+typedef uint32_t mmask_t;
+#endif
+
+/*
+ * We need FILE, etc.  Include this before checking any feature symbols.
+ */
+#include <stdio.h>
+
+/*
+ * With XPG4, you must define _XOPEN_SOURCE_EXTENDED, it is redundant (or
+ * conflicting) when _XOPEN_SOURCE is 500 or greater.  If NCURSES_WIDECHAR is
+ * not already defined, e.g., if the platform relies upon nonstandard feature
+ * test macros, define it at this point if the standard feature test macros
+ * indicate that it should be defined.
+ */
+#ifndef NCURSES_WIDECHAR
+#if defined(_XOPEN_SOURCE_EXTENDED) || (defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE - 0 >= 500))
+#define NCURSES_WIDECHAR 1
+#else
+#define NCURSES_WIDECHAR 0
+#endif
+#endif /* NCURSES_WIDECHAR */
+
+#include <stdarg.h>	/* we need va_list */
+#if NCURSES_WIDECHAR
+#include <stddef.h>	/* we want wchar_t */
+#endif
+
+/* X/Open and SVr4 specify that curses implements 'bool'.  However, C++ may also
+ * implement it.  If so, we must use the C++ compiler's type to avoid conflict
+ * with other interfaces.
+ *
+ * A further complication is that <stdbool.h> may declare 'bool' to be a
+ * different type, such as an enum which is not necessarily compatible with
+ * C++.  If we have <stdbool.h>, make 'bool' a macro, so users may #undef it.
+ * Otherwise, let it remain a typedef to avoid conflicts with other #define's.
+ * In either case, make a typedef for NCURSES_BOOL which can be used if needed
+ * from either C or C++.
+ */
+
+#undef TRUE
+#define TRUE    1
+
+#undef FALSE
+#define FALSE   0
+
+typedef unsigned char NCURSES_BOOL;
+
+#if defined(__cplusplus)	/* __cplusplus, etc. */
+
+/* use the C++ compiler's bool type */
+#define NCURSES_BOOL bool
+
+#else			/* c89, c99, etc. */
+
+#if NCURSES_ENABLE_STDBOOL_H
+#include <stdbool.h>
+/* use whatever the C compiler decides bool really is */
+#define NCURSES_BOOL bool
+#else
+/* there is no predefined bool - use our own */
+#undef bool
+#define bool NCURSES_BOOL
+#endif
+
+#endif /* !__cplusplus, etc. */
+
+#ifdef __cplusplus
+extern "C" {
+#define NCURSES_CAST(type,value) static_cast<type>(value)
+#else
+#define NCURSES_CAST(type,value) (type)(value)
+#endif
+
+#define NCURSES_OK_ADDR(p) (0 != NCURSES_CAST(const void *, (p)))
+
+/*
+ * X/Open attributes.  In the ncurses implementation, they are identical to the
+ * A_ attributes.
+ */
+#define WA_ATTRIBUTES	A_ATTRIBUTES
+#define WA_NORMAL	A_NORMAL
+#define WA_STANDOUT	A_STANDOUT
+#define WA_UNDERLINE	A_UNDERLINE
+#define WA_REVERSE	A_REVERSE
+#define WA_BLINK	A_BLINK
+#define WA_DIM		A_DIM
+#define WA_BOLD		A_BOLD
+#define WA_ALTCHARSET	A_ALTCHARSET
+#define WA_INVIS	A_INVIS
+#define WA_PROTECT	A_PROTECT
+#define WA_HORIZONTAL	A_HORIZONTAL
+#define WA_LEFT		A_LEFT
+#define WA_LOW		A_LOW
+#define WA_RIGHT	A_RIGHT
+#define WA_TOP		A_TOP
+#define WA_VERTICAL	A_VERTICAL
+
+#if 1
+#define WA_ITALIC	A_ITALIC	/* ncurses extension */
+#endif
+
+/* colors */
+#define COLOR_BLACK	0
+#define COLOR_RED	1
+#define COLOR_GREEN	2
+#define COLOR_YELLOW	3
+#define COLOR_BLUE	4
+#define COLOR_MAGENTA	5
+#define COLOR_CYAN	6
+#define COLOR_WHITE	7
+
+/* line graphics */
+
+#if 0 || NCURSES_REENTRANT
+NCURSES_WRAPPED_VAR(chtype*, acs_map);
+#define acs_map NCURSES_PUBLIC_VAR(acs_map())
+#else
+extern NCURSES_EXPORT_VAR(chtype) acs_map[];
+#endif
+
+#define NCURSES_ACS(c)	(acs_map[NCURSES_CAST(unsigned char,(c))])
+
+/* VT100 symbols begin here */
+#define ACS_ULCORNER	NCURSES_ACS('l') /* upper left corner */
+#define ACS_LLCORNER	NCURSES_ACS('m') /* lower left corner */
+#define ACS_URCORNER	NCURSES_ACS('k') /* upper right corner */
+#define ACS_LRCORNER	NCURSES_ACS('j') /* lower right corner */
+#define ACS_LTEE	NCURSES_ACS('t') /* tee pointing right */
+#define ACS_RTEE	NCURSES_ACS('u') /* tee pointing left */
+#define ACS_BTEE	NCURSES_ACS('v') /* tee pointing up */
+#define ACS_TTEE	NCURSES_ACS('w') /* tee pointing down */
+#define ACS_HLINE	NCURSES_ACS('q') /* horizontal line */
+#define ACS_VLINE	NCURSES_ACS('x') /* vertical line */
+#define ACS_PLUS	NCURSES_ACS('n') /* large plus or crossover */
+#define ACS_S1		NCURSES_ACS('o') /* scan line 1 */
+#define ACS_S9		NCURSES_ACS('s') /* scan line 9 */
+#define ACS_DIAMOND	NCURSES_ACS('`') /* diamond */
+#define ACS_CKBOARD	NCURSES_ACS('a') /* checker board (stipple) */
+#define ACS_DEGREE	NCURSES_ACS('f') /* degree symbol */
+#define ACS_PLMINUS	NCURSES_ACS('g') /* plus/minus */
+#define ACS_BULLET	NCURSES_ACS('~') /* bullet */
+/* Teletype 5410v1 symbols begin here */
+#define ACS_LARROW	NCURSES_ACS(',') /* arrow pointing left */
+#define ACS_RARROW	NCURSES_ACS('+') /* arrow pointing right */
+#define ACS_DARROW	NCURSES_ACS('.') /* arrow pointing down */
+#define ACS_UARROW	NCURSES_ACS('-') /* arrow pointing up */
+#define ACS_BOARD	NCURSES_ACS('h') /* board of squares */
+#define ACS_LANTERN	NCURSES_ACS('i') /* lantern symbol */
+#define ACS_BLOCK	NCURSES_ACS('0') /* solid square block */
+/*
+ * These aren't documented, but a lot of System Vs have them anyway
+ * (you can spot pprryyzz{{||}} in a lot of AT&T terminfo strings).
+ * The ACS_names may not match AT&T's, our source didn't know them.
+ */
+#define ACS_S3		NCURSES_ACS('p') /* scan line 3 */
+#define ACS_S7		NCURSES_ACS('r') /* scan line 7 */
+#define ACS_LEQUAL	NCURSES_ACS('y') /* less/equal */
+#define ACS_GEQUAL	NCURSES_ACS('z') /* greater/equal */
+#define ACS_PI		NCURSES_ACS('{') /* Pi */
+#define ACS_NEQUAL	NCURSES_ACS('|') /* not equal */
+#define ACS_STERLING	NCURSES_ACS('}') /* UK pound sign */
+
+/*
+ * Line drawing ACS names are of the form ACS_trbl, where t is the top, r
+ * is the right, b is the bottom, and l is the left.  t, r, b, and l might
+ * be B (blank), S (single), D (double), or T (thick).  The subset defined
+ * here only uses B and S.
+ */
+#define ACS_BSSB	ACS_ULCORNER
+#define ACS_SSBB	ACS_LLCORNER
+#define ACS_BBSS	ACS_URCORNER
+#define ACS_SBBS	ACS_LRCORNER
+#define ACS_SBSS	ACS_RTEE
+#define ACS_SSSB	ACS_LTEE
+#define ACS_SSBS	ACS_BTEE
+#define ACS_BSSS	ACS_TTEE
+#define ACS_BSBS	ACS_HLINE
+#define ACS_SBSB	ACS_VLINE
+#define ACS_SSSS	ACS_PLUS
+
+#undef	ERR
+#define ERR     (-1)
+
+#undef	OK
+#define OK      (0)
+
+/* values for the _flags member */
+#define _SUBWIN         0x01	/* is this a sub-window? */
+#define _ENDLINE        0x02	/* is the window flush right? */
+#define _FULLWIN        0x04	/* is the window full-screen? */
+#define _SCROLLWIN      0x08	/* bottom edge is at screen bottom? */
+#define _ISPAD	        0x10	/* is this window a pad? */
+#define _HASMOVED       0x20	/* has cursor moved since last refresh? */
+#define _WRAPPED        0x40	/* cursor was just wrappped */
+
+/*
+ * this value is used in the firstchar and lastchar fields to mark
+ * unchanged lines
+ */
+#define _NOCHANGE       -1
+
+/*
+ * this value is used in the oldindex field to mark lines created by insertions
+ * and scrolls.
+ */
+#define _NEWINDEX	-1
+
+#ifdef NCURSES_INTERNALS
+#undef SCREEN
+#define SCREEN struct screen
+SCREEN;
+#else
+typedef struct screen  SCREEN;
+#endif
+
+typedef struct _win_st WINDOW;
+
+typedef	chtype	attr_t;		/* ...must be at least as wide as chtype */
+
+#if NCURSES_WIDECHAR
+
+#if 0
+#ifdef mblen			/* libutf8.h defines it w/o undefining first */
+#undef mblen
+#endif
+#include <libutf8.h>
+#endif
+
+#if 1
+#include <wchar.h>		/* ...to get mbstate_t, etc. */
+#endif
+
+#if 0
+typedef unsigned short wchar_t1;
+#endif
+
+#if 0
+typedef unsigned int wint_t1;
+#endif
+
+/*
+ * cchar_t stores an array of CCHARW_MAX wide characters.  The first is
+ * normally a spacing character.  The others are non-spacing.  If those
+ * (spacing and nonspacing) do not fill the array, a null L'\0' follows.
+ * Otherwise, a null is assumed to follow when extracting via getcchar().
+ */
+#define CCHARW_MAX	5
+typedef struct
+{
+    attr_t	attr;
+    wchar_t	chars[CCHARW_MAX];
+#if 1
+#undef NCURSES_EXT_COLORS
+#define NCURSES_EXT_COLORS 20240427
+    int		ext_color;	/* color pair, must be more than 16-bits */
+#endif
+}
+cchar_t;
+
+#endif /* NCURSES_WIDECHAR */
+
+#if !NCURSES_OPAQUE
+struct ldat;
+
+struct _win_st
+{
+	NCURSES_SIZE_T _cury, _curx; /* current cursor position */
+
+	/* window location and size */
+	NCURSES_SIZE_T _maxy, _maxx; /* maximums of x and y, NOT window size */
+	NCURSES_SIZE_T _begy, _begx; /* screen coords of upper-left-hand corner */
+
+	short   _flags;		/* window state flags */
+
+	/* attribute tracking */
+	attr_t  _attrs;		/* current attribute for non-space character */
+	chtype  _bkgd;		/* current background char/attribute pair */
+
+	/* option values set by user */
+	bool	_notimeout;	/* no time out on function-key entry? */
+	bool	_clear;		/* consider all data in the window invalid? */
+	bool	_leaveok;	/* OK to not reset cursor on exit? */
+	bool	_scroll;	/* OK to scroll this window? */
+	bool	_idlok;		/* OK to use insert/delete line? */
+	bool	_idcok;		/* OK to use insert/delete char? */
+	bool	_immed;		/* window in immed mode? (not yet used) */
+	bool	_sync;		/* window in sync mode? */
+	bool	_use_keypad;	/* process function keys into KEY_ symbols? */
+	int	_delay;		/* 0 = nodelay, <0 = blocking, >0 = delay */
+
+	struct ldat *_line;	/* the actual line data */
+
+	/* global screen state */
+	NCURSES_SIZE_T _regtop;	/* top line of scrolling region */
+	NCURSES_SIZE_T _regbottom; /* bottom line of scrolling region */
+
+	/* these are used only if this is a sub-window */
+	int	_parx;		/* x coordinate of this window in parent */
+	int	_pary;		/* y coordinate of this window in parent */
+	WINDOW	*_parent;	/* pointer to parent if a sub-window */
+
+	/* these are used only if this is a pad */
+	struct pdat
+	{
+	    NCURSES_SIZE_T _pad_y,      _pad_x;
+	    NCURSES_SIZE_T _pad_top,    _pad_left;
+	    NCURSES_SIZE_T _pad_bottom, _pad_right;
+	} _pad;
+
+	NCURSES_SIZE_T _yoffset; /* real begy is _begy + _yoffset */
+
+#if NCURSES_WIDECHAR
+	cchar_t  _bkgrnd;	/* current background char/attribute pair */
+#if 1
+	int	_color;		/* current color-pair for non-space character */
+#endif
+#endif
+};
+#endif /* NCURSES_OPAQUE */
+
+/*
+ * GCC (and some other compilers) define '__attribute__'; we're using this
+ * macro to alert the compiler to flag inconsistencies in printf/scanf-like
+ * function calls.  Just in case '__attribute__' isn't defined, make a dummy.
+ * Old versions of G++ do not accept it anyway, at least not consistently with
+ * GCC.
+ */
+#if !(defined(__GNUC__) || defined(__GNUG__) || defined(__attribute__))
+#define __attribute__(p) /* nothing */
+#endif
+
+/*
+ * We cannot define these in ncurses_cfg.h, since they require parameters to be
+ * passed (that is non-portable).
+ */
+#ifndef GCC_PRINTFLIKE
+#ifndef printf
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+#else
+#define GCC_PRINTFLIKE(fmt,var) /*nothing*/
+#endif
+#endif
+
+#ifndef GCC_SCANFLIKE
+#ifndef scanf
+#define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
+#else
+#define GCC_SCANFLIKE(fmt,var)  /*nothing*/
+#endif
+#endif
+
+#ifndef	GCC_NORETURN
+#define	GCC_NORETURN /* nothing */
+#endif
+
+#ifndef	GCC_UNUSED
+#define	GCC_UNUSED /* nothing */
+#endif
+
+#undef  GCC_DEPRECATED
+#if (__GNUC__ - 0 > 3 || (__GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 >= 2)) && !defined(NCURSES_INTERNALS)
+#define GCC_DEPRECATED(msg) __attribute__((deprecated))
+#else
+#define GCC_DEPRECATED(msg) /* nothing */
+#endif
+
+/*
+ * Curses uses a helper function.  Define our type for this to simplify
+ * extending it for the sp-funcs feature.
+ */
+typedef int (*NCURSES_OUTC)(int);
+
+/*
+ * Function prototypes.  This is the complete X/Open Curses list of required
+ * functions.  Those marked `generated' will have sources generated from the
+ * macro definitions later in this file, in order to satisfy XPG4.2
+ * requirements.
+ */
+
+extern NCURSES_EXPORT(int) addch (const chtype);			/* generated */
+extern NCURSES_EXPORT(int) addchnstr (const chtype *, int);		/* generated */
+extern NCURSES_EXPORT(int) addchstr (const chtype *);			/* generated */
+extern NCURSES_EXPORT(int) addnstr (const char *, int);			/* generated */
+extern NCURSES_EXPORT(int) addstr (const char *);			/* generated */
+extern NCURSES_EXPORT(int) attroff (NCURSES_ATTR_T);			/* generated */
+extern NCURSES_EXPORT(int) attron (NCURSES_ATTR_T);			/* generated */
+extern NCURSES_EXPORT(int) attrset (NCURSES_ATTR_T);			/* generated */
+extern NCURSES_EXPORT(int) attr_get (attr_t *, NCURSES_PAIRS_T *, void *);	/* generated */
+extern NCURSES_EXPORT(int) attr_off (attr_t, void *);			/* generated */
+extern NCURSES_EXPORT(int) attr_on (attr_t, void *);			/* generated */
+extern NCURSES_EXPORT(int) attr_set (attr_t, NCURSES_PAIRS_T, void *);		/* generated */
+extern NCURSES_EXPORT(int) baudrate (void);				/* implemented */
+extern NCURSES_EXPORT(int) beep  (void);				/* implemented */
+extern NCURSES_EXPORT(int) bkgd (chtype);				/* generated */
+extern NCURSES_EXPORT(void) bkgdset (chtype);				/* generated */
+extern NCURSES_EXPORT(int) border (chtype,chtype,chtype,chtype,chtype,chtype,chtype,chtype);	/* generated */
+extern NCURSES_EXPORT(int) box (WINDOW *, chtype, chtype);		/* generated */
+extern NCURSES_EXPORT(bool) can_change_color (void);			/* implemented */
+extern NCURSES_EXPORT(int) cbreak (void);				/* implemented */
+extern NCURSES_EXPORT(int) chgat (int, attr_t, NCURSES_PAIRS_T, const void *);	/* generated */
+extern NCURSES_EXPORT(int) clear (void);				/* generated */
+extern NCURSES_EXPORT(int) clearok (WINDOW *,bool);			/* implemented */
+extern NCURSES_EXPORT(int) clrtobot (void);				/* generated */
+extern NCURSES_EXPORT(int) clrtoeol (void);				/* generated */
+extern NCURSES_EXPORT(int) color_content (NCURSES_COLOR_T,NCURSES_COLOR_T*,NCURSES_COLOR_T*,NCURSES_COLOR_T*);	/* implemented */
+extern NCURSES_EXPORT(int) color_set (NCURSES_PAIRS_T,void*);			/* generated */
+extern NCURSES_EXPORT(int) COLOR_PAIR (int);				/* generated */
+extern NCURSES_EXPORT(int) copywin (const WINDOW*,WINDOW*,int,int,int,int,int,int,int);	/* implemented */
+extern NCURSES_EXPORT(int) curs_set (int);				/* implemented */
+extern NCURSES_EXPORT(int) def_prog_mode (void);			/* implemented */
+extern NCURSES_EXPORT(int) def_shell_mode (void);			/* implemented */
+extern NCURSES_EXPORT(int) delay_output (int);				/* implemented */
+extern NCURSES_EXPORT(int) delch (void);				/* generated */
+extern NCURSES_EXPORT(void) delscreen (SCREEN *);			/* implemented */
+extern NCURSES_EXPORT(int) delwin (WINDOW *);				/* implemented */
+extern NCURSES_EXPORT(int) deleteln (void);				/* generated */
+extern NCURSES_EXPORT(WINDOW *) derwin (WINDOW *,int,int,int,int);	/* implemented */
+extern NCURSES_EXPORT(int) doupdate (void);				/* implemented */
+extern NCURSES_EXPORT(WINDOW *) dupwin (WINDOW *);			/* implemented */
+extern NCURSES_EXPORT(int) echo (void);					/* implemented */
+extern NCURSES_EXPORT(int) echochar (const chtype);			/* generated */
+extern NCURSES_EXPORT(int) erase (void);				/* generated */
+extern NCURSES_EXPORT(int) endwin (void);				/* implemented */
+extern NCURSES_EXPORT(char) erasechar (void);				/* implemented */
+extern NCURSES_EXPORT(void) filter (void);				/* implemented */
+extern NCURSES_EXPORT(int) flash (void);				/* implemented */
+extern NCURSES_EXPORT(int) flushinp (void);				/* implemented */
+extern NCURSES_EXPORT(chtype) getbkgd (WINDOW *);			/* generated */
+extern NCURSES_EXPORT(int) getch (void);				/* generated */
+extern NCURSES_EXPORT(int) getnstr (char *, int);			/* generated */
+extern NCURSES_EXPORT(int) getstr (char *);				/* generated */
+extern NCURSES_EXPORT(WINDOW *) getwin (FILE *);			/* implemented */
+extern NCURSES_EXPORT(int) halfdelay (int);				/* implemented */
+extern NCURSES_EXPORT(bool) has_colors (void);				/* implemented */
+extern NCURSES_EXPORT(bool) has_ic (void);				/* implemented */
+extern NCURSES_EXPORT(bool) has_il (void);				/* implemented */
+extern NCURSES_EXPORT(int) hline (chtype, int);				/* generated */
+extern NCURSES_EXPORT(void) idcok (WINDOW *, bool);			/* implemented */
+extern NCURSES_EXPORT(int) idlok (WINDOW *, bool);			/* implemented */
+extern NCURSES_EXPORT(void) immedok (WINDOW *, bool);			/* implemented */
+extern NCURSES_EXPORT(chtype) inch (void);				/* generated */
+extern NCURSES_EXPORT(int) inchnstr (chtype *, int);			/* generated */
+extern NCURSES_EXPORT(int) inchstr (chtype *);				/* generated */
+extern NCURSES_EXPORT(WINDOW *) initscr (void);				/* implemented */
+extern NCURSES_EXPORT(int) init_color (NCURSES_COLOR_T,NCURSES_COLOR_T,NCURSES_COLOR_T,NCURSES_COLOR_T);	/* implemented */
+extern NCURSES_EXPORT(int) init_pair (NCURSES_PAIRS_T,NCURSES_COLOR_T,NCURSES_COLOR_T);		/* implemented */
+extern NCURSES_EXPORT(int) innstr (char *, int);			/* generated */
+extern NCURSES_EXPORT(int) insch (chtype);				/* generated */
+extern NCURSES_EXPORT(int) insdelln (int);				/* generated */
+extern NCURSES_EXPORT(int) insertln (void);				/* generated */
+extern NCURSES_EXPORT(int) insnstr (const char *, int);			/* generated */
+extern NCURSES_EXPORT(int) insstr (const char *);			/* generated */
+extern NCURSES_EXPORT(int) instr (char *);				/* generated */
+extern NCURSES_EXPORT(int) intrflush (WINDOW *,bool);			/* implemented */
+extern NCURSES_EXPORT(bool) isendwin (void);				/* implemented */
+extern NCURSES_EXPORT(bool) is_linetouched (WINDOW *,int);		/* implemented */
+extern NCURSES_EXPORT(bool) is_wintouched (WINDOW *);			/* implemented */
+extern NCURSES_EXPORT(NCURSES_CONST char *) keyname (int);		/* implemented */
+extern NCURSES_EXPORT(int) keypad (WINDOW *,bool);			/* implemented */
+extern NCURSES_EXPORT(char) killchar (void);				/* implemented */
+extern NCURSES_EXPORT(int) leaveok (WINDOW *,bool);			/* implemented */
+extern NCURSES_EXPORT(char *) longname (void);				/* implemented */
+extern NCURSES_EXPORT(int) meta (WINDOW *,bool);			/* implemented */
+extern NCURSES_EXPORT(int) move (int, int);				/* generated */
+extern NCURSES_EXPORT(int) mvaddch (int, int, const chtype);		/* generated */
+extern NCURSES_EXPORT(int) mvaddchnstr (int, int, const chtype *, int);	/* generated */
+extern NCURSES_EXPORT(int) mvaddchstr (int, int, const chtype *);	/* generated */
+extern NCURSES_EXPORT(int) mvaddnstr (int, int, const char *, int);	/* generated */
+extern NCURSES_EXPORT(int) mvaddstr (int, int, const char *);		/* generated */
+extern NCURSES_EXPORT(int) mvchgat (int, int, int, attr_t, NCURSES_PAIRS_T, const void *);	/* generated */
+extern NCURSES_EXPORT(int) mvcur (int,int,int,int);			/* implemented */
+extern NCURSES_EXPORT(int) mvdelch (int, int);				/* generated */
+extern NCURSES_EXPORT(int) mvderwin (WINDOW *, int, int);		/* implemented */
+extern NCURSES_EXPORT(int) mvgetch (int, int);				/* generated */
+extern NCURSES_EXPORT(int) mvgetnstr (int, int, char *, int);		/* generated */
+extern NCURSES_EXPORT(int) mvgetstr (int, int, char *);			/* generated */
+extern NCURSES_EXPORT(int) mvhline (int, int, chtype, int);		/* generated */
+extern NCURSES_EXPORT(chtype) mvinch (int, int);			/* generated */
+extern NCURSES_EXPORT(int) mvinchnstr (int, int, chtype *, int);	/* generated */
+extern NCURSES_EXPORT(int) mvinchstr (int, int, chtype *);		/* generated */
+extern NCURSES_EXPORT(int) mvinnstr (int, int, char *, int);		/* generated */
+extern NCURSES_EXPORT(int) mvinsch (int, int, chtype);			/* generated */
+extern NCURSES_EXPORT(int) mvinsnstr (int, int, const char *, int);	/* generated */
+extern NCURSES_EXPORT(int) mvinsstr (int, int, const char *);		/* generated */
+extern NCURSES_EXPORT(int) mvinstr (int, int, char *);			/* generated */
+extern NCURSES_EXPORT(int) mvprintw (int,int, const char *,...)		/* implemented */
+		GCC_PRINTFLIKE(3,4);
+extern NCURSES_EXPORT(int) mvscanw (int,int, const char *,...)		/* implemented */
+		GCC_SCANFLIKE(3,4);
+extern NCURSES_EXPORT(int) mvvline (int, int, chtype, int);		/* generated */
+extern NCURSES_EXPORT(int) mvwaddch (WINDOW *, int, int, const chtype);	/* generated */
+extern NCURSES_EXPORT(int) mvwaddchnstr (WINDOW *, int, int, const chtype *, int);/* generated */
+extern NCURSES_EXPORT(int) mvwaddchstr (WINDOW *, int, int, const chtype *);	/* generated */
+extern NCURSES_EXPORT(int) mvwaddnstr (WINDOW *, int, int, const char *, int);	/* generated */
+extern NCURSES_EXPORT(int) mvwaddstr (WINDOW *, int, int, const char *);	/* generated */
+extern NCURSES_EXPORT(int) mvwchgat (WINDOW *, int, int, int, attr_t, NCURSES_PAIRS_T, const void *);/* generated */
+extern NCURSES_EXPORT(int) mvwdelch (WINDOW *, int, int);		/* generated */
+extern NCURSES_EXPORT(int) mvwgetch (WINDOW *, int, int);		/* generated */
+extern NCURSES_EXPORT(int) mvwgetnstr (WINDOW *, int, int, char *, int);	/* generated */
+extern NCURSES_EXPORT(int) mvwgetstr (WINDOW *, int, int, char *);	/* generated */
+extern NCURSES_EXPORT(int) mvwhline (WINDOW *, int, int, chtype, int);	/* generated */
+extern NCURSES_EXPORT(int) mvwin (WINDOW *,int,int);			/* implemented */
+extern NCURSES_EXPORT(chtype) mvwinch (WINDOW *, int, int);			/* generated */
+extern NCURSES_EXPORT(int) mvwinchnstr (WINDOW *, int, int, chtype *, int);	/* generated */
+extern NCURSES_EXPORT(int) mvwinchstr (WINDOW *, int, int, chtype *);		/* generated */
+extern NCURSES_EXPORT(int) mvwinnstr (WINDOW *, int, int, char *, int);		/* generated */
+extern NCURSES_EXPORT(int) mvwinsch (WINDOW *, int, int, chtype);		/* generated */
+extern NCURSES_EXPORT(int) mvwinsnstr (WINDOW *, int, int, const char *, int);	/* generated */
+extern NCURSES_EXPORT(int) mvwinsstr (WINDOW *, int, int, const char *);	/* generated */
+extern NCURSES_EXPORT(int) mvwinstr (WINDOW *, int, int, char *);		/* generated */
+extern NCURSES_EXPORT(int) mvwprintw (WINDOW*,int,int, const char *,...)	/* implemented */
+		GCC_PRINTFLIKE(4,5);
+extern NCURSES_EXPORT(int) mvwscanw (WINDOW *,int,int, const char *,...)	/* implemented */
+		GCC_SCANFLIKE(4,5);
+extern NCURSES_EXPORT(int) mvwvline (WINDOW *,int, int, chtype, int);	/* generated */
+extern NCURSES_EXPORT(int) napms (int);					/* implemented */
+extern NCURSES_EXPORT(WINDOW *) newpad (int,int);			/* implemented */
+extern NCURSES_EXPORT(SCREEN *) newterm (const char *,FILE *,FILE *);	/* implemented */
+extern NCURSES_EXPORT(WINDOW *) newwin (int,int,int,int);		/* implemented */
+extern NCURSES_EXPORT(int) nl (void);					/* implemented */
+extern NCURSES_EXPORT(int) nocbreak (void);				/* implemented */
+extern NCURSES_EXPORT(int) nodelay (WINDOW *,bool);			/* implemented */
+extern NCURSES_EXPORT(int) noecho (void);				/* implemented */
+extern NCURSES_EXPORT(int) nonl (void);					/* implemented */
+extern NCURSES_EXPORT(void) noqiflush (void);				/* implemented */
+extern NCURSES_EXPORT(int) noraw (void);				/* implemented */
+extern NCURSES_EXPORT(int) notimeout (WINDOW *,bool);			/* implemented */
+extern NCURSES_EXPORT(int) overlay (const WINDOW*,WINDOW *);		/* implemented */
+extern NCURSES_EXPORT(int) overwrite (const WINDOW*,WINDOW *);		/* implemented */
+extern NCURSES_EXPORT(int) pair_content (NCURSES_PAIRS_T,NCURSES_COLOR_T*,NCURSES_COLOR_T*);		/* implemented */
+extern NCURSES_EXPORT(int) PAIR_NUMBER (int);				/* generated */
+extern NCURSES_EXPORT(int) pechochar (WINDOW *, const chtype);		/* implemented */
+extern NCURSES_EXPORT(int) pnoutrefresh (WINDOW*,int,int,int,int,int,int);/* implemented */
+extern NCURSES_EXPORT(int) prefresh (WINDOW *,int,int,int,int,int,int);	/* implemented */
+extern NCURSES_EXPORT(int) printw (const char *,...)			/* implemented */
+		GCC_PRINTFLIKE(1,2);
+extern NCURSES_EXPORT(int) putwin (WINDOW *, FILE *);			/* implemented */
+extern NCURSES_EXPORT(void) qiflush (void);				/* implemented */
+extern NCURSES_EXPORT(int) raw (void);					/* implemented */
+extern NCURSES_EXPORT(int) redrawwin (WINDOW *);			/* generated */
+extern NCURSES_EXPORT(int) refresh (void);				/* generated */
+extern NCURSES_EXPORT(int) resetty (void);				/* implemented */
+extern NCURSES_EXPORT(int) reset_prog_mode (void);			/* implemented */
+extern NCURSES_EXPORT(int) reset_shell_mode (void);			/* implemented */
+extern NCURSES_EXPORT(int) ripoffline (int, int (*)(WINDOW *, int));	/* implemented */
+extern NCURSES_EXPORT(int) savetty (void);				/* implemented */
+extern NCURSES_EXPORT(int) scanw (const char *,...)			/* implemented */
+		GCC_SCANFLIKE(1,2);
+extern NCURSES_EXPORT(int) scr_dump (const char *);			/* implemented */
+extern NCURSES_EXPORT(int) scr_init (const char *);			/* implemented */
+extern NCURSES_EXPORT(int) scrl (int);					/* generated */
+extern NCURSES_EXPORT(int) scroll (WINDOW *);				/* generated */
+extern NCURSES_EXPORT(int) scrollok (WINDOW *,bool);			/* implemented */
+extern NCURSES_EXPORT(int) scr_restore (const char *);			/* implemented */
+extern NCURSES_EXPORT(int) scr_set (const char *);			/* implemented */
+extern NCURSES_EXPORT(int) setscrreg (int,int);				/* generated */
+extern NCURSES_EXPORT(SCREEN *) set_term (SCREEN *);			/* implemented */
+extern NCURSES_EXPORT(int) slk_attroff (const chtype);			/* implemented */
+extern NCURSES_EXPORT(int) slk_attr_off (const attr_t, void *);		/* generated:WIDEC */
+extern NCURSES_EXPORT(int) slk_attron (const chtype);			/* implemented */
+extern NCURSES_EXPORT(int) slk_attr_on (attr_t,void*);			/* generated:WIDEC */
+extern NCURSES_EXPORT(int) slk_attrset (const chtype);			/* implemented */
+extern NCURSES_EXPORT(attr_t) slk_attr (void);				/* implemented */
+extern NCURSES_EXPORT(int) slk_attr_set (const attr_t,NCURSES_PAIRS_T,void*);	/* implemented */
+extern NCURSES_EXPORT(int) slk_clear (void);				/* implemented */
+extern NCURSES_EXPORT(int) slk_color (NCURSES_PAIRS_T);				/* implemented */
+extern NCURSES_EXPORT(int) slk_init (int);				/* implemented */
+extern NCURSES_EXPORT(char *) slk_label (int);				/* implemented */
+extern NCURSES_EXPORT(int) slk_noutrefresh (void);			/* implemented */
+extern NCURSES_EXPORT(int) slk_refresh (void);				/* implemented */
+extern NCURSES_EXPORT(int) slk_restore (void);				/* implemented */
+extern NCURSES_EXPORT(int) slk_set (int,const char *,int);		/* implemented */
+extern NCURSES_EXPORT(int) slk_touch (void);				/* implemented */
+extern NCURSES_EXPORT(int) standout (void);				/* generated */
+extern NCURSES_EXPORT(int) standend (void);				/* generated */
+extern NCURSES_EXPORT(int) start_color (void);				/* implemented */
+extern NCURSES_EXPORT(WINDOW *) subpad (WINDOW *, int, int, int, int);	/* implemented */
+extern NCURSES_EXPORT(WINDOW *) subwin (WINDOW *, int, int, int, int);	/* implemented */
+extern NCURSES_EXPORT(int) syncok (WINDOW *, bool);			/* implemented */
+extern NCURSES_EXPORT(chtype) termattrs (void);				/* implemented */
+extern NCURSES_EXPORT(char *) termname (void);				/* implemented */
+extern NCURSES_EXPORT(void) timeout (int);				/* generated */
+extern NCURSES_EXPORT(int) touchline (WINDOW *, int, int);		/* generated */
+extern NCURSES_EXPORT(int) touchwin (WINDOW *);				/* generated */
+extern NCURSES_EXPORT(int) typeahead (int);				/* implemented */
+extern NCURSES_EXPORT(int) ungetch (int);				/* implemented */
+extern NCURSES_EXPORT(int) untouchwin (WINDOW *);			/* generated */
+extern NCURSES_EXPORT(void) use_env (bool);				/* implemented */
+extern NCURSES_EXPORT(void) use_tioctl (bool);				/* implemented */
+extern NCURSES_EXPORT(int) vidattr (chtype);				/* implemented */
+extern NCURSES_EXPORT(int) vidputs (chtype, NCURSES_OUTC);		/* implemented */
+extern NCURSES_EXPORT(int) vline (chtype, int);				/* generated */
+extern NCURSES_EXPORT(int) vwprintw (WINDOW *, const char *, va_list) GCC_DEPRECATED(use vw_printw)	/* implemented */
+		GCC_PRINTFLIKE(2,0);
+extern NCURSES_EXPORT(int) vw_printw (WINDOW *, const char *, va_list)	/* implemented */
+		GCC_PRINTFLIKE(2,0);	
+extern NCURSES_EXPORT(int) vwscanw (WINDOW *, const char *, va_list) GCC_DEPRECATED(use vw_scanw)	/* implemented */
+		GCC_SCANFLIKE(2,0);
+extern NCURSES_EXPORT(int) vw_scanw (WINDOW *, const char *, va_list)	/* implemented */
+		GCC_SCANFLIKE(2,0);
+extern NCURSES_EXPORT(int) waddch (WINDOW *, const chtype);		/* implemented */
+extern NCURSES_EXPORT(int) waddchnstr (WINDOW *,const chtype *,int);	/* implemented */
+extern NCURSES_EXPORT(int) waddchstr (WINDOW *,const chtype *);		/* generated */
+extern NCURSES_EXPORT(int) waddnstr (WINDOW *,const char *,int);	/* implemented */
+extern NCURSES_EXPORT(int) waddstr (WINDOW *,const char *);		/* generated */
+extern NCURSES_EXPORT(int) wattron (WINDOW *, int);			/* generated */
+extern NCURSES_EXPORT(int) wattroff (WINDOW *, int);			/* generated */
+extern NCURSES_EXPORT(int) wattrset (WINDOW *, int);			/* generated */
+extern NCURSES_EXPORT(int) wattr_get (WINDOW *, attr_t *, NCURSES_PAIRS_T *, void *);	/* generated */
+extern NCURSES_EXPORT(int) wattr_on (WINDOW *, attr_t, void *);		/* implemented */
+extern NCURSES_EXPORT(int) wattr_off (WINDOW *, attr_t, void *);	/* implemented */
+extern NCURSES_EXPORT(int) wattr_set (WINDOW *, attr_t, NCURSES_PAIRS_T, void *);	/* generated */
+extern NCURSES_EXPORT(int) wbkgd (WINDOW *, chtype);			/* implemented */
+extern NCURSES_EXPORT(void) wbkgdset (WINDOW *,chtype);			/* implemented */
+extern NCURSES_EXPORT(int) wborder (WINDOW *,chtype,chtype,chtype,chtype,chtype,chtype,chtype,chtype);	/* implemented */
+extern NCURSES_EXPORT(int) wchgat (WINDOW *, int, attr_t, NCURSES_PAIRS_T, const void *);/* implemented */
+extern NCURSES_EXPORT(int) wclear (WINDOW *);				/* implemented */
+extern NCURSES_EXPORT(int) wclrtobot (WINDOW *);			/* implemented */
+extern NCURSES_EXPORT(int) wclrtoeol (WINDOW *);			/* implemented */
+extern NCURSES_EXPORT(int) wcolor_set (WINDOW*,NCURSES_PAIRS_T,void*);		/* implemented */
+extern NCURSES_EXPORT(void) wcursyncup (WINDOW *);			/* implemented */
+extern NCURSES_EXPORT(int) wdelch (WINDOW *);				/* implemented */
+extern NCURSES_EXPORT(int) wdeleteln (WINDOW *);			/* generated */
+extern NCURSES_EXPORT(int) wechochar (WINDOW *, const chtype);		/* implemented */
+extern NCURSES_EXPORT(int) werase (WINDOW *);				/* implemented */
+extern NCURSES_EXPORT(int) wgetch (WINDOW *);				/* implemented */
+extern NCURSES_EXPORT(int) wgetnstr (WINDOW *,char *,int);		/* implemented */
+extern NCURSES_EXPORT(int) wgetstr (WINDOW *, char *);			/* generated */
+extern NCURSES_EXPORT(int) whline (WINDOW *, chtype, int);		/* implemented */
+extern NCURSES_EXPORT(chtype) winch (WINDOW *);				/* implemented */
+extern NCURSES_EXPORT(int) winchnstr (WINDOW *, chtype *, int);		/* implemented */
+extern NCURSES_EXPORT(int) winchstr (WINDOW *, chtype *);		/* generated */
+extern NCURSES_EXPORT(int) winnstr (WINDOW *, char *, int);		/* implemented */
+extern NCURSES_EXPORT(int) winsch (WINDOW *, chtype);			/* implemented */
+extern NCURSES_EXPORT(int) winsdelln (WINDOW *,int);			/* implemented */
+extern NCURSES_EXPORT(int) winsertln (WINDOW *);			/* generated */
+extern NCURSES_EXPORT(int) winsnstr (WINDOW *, const char *,int);	/* implemented */
+extern NCURSES_EXPORT(int) winsstr (WINDOW *, const char *);		/* generated */
+extern NCURSES_EXPORT(int) winstr (WINDOW *, char *);			/* generated */
+extern NCURSES_EXPORT(int) wmove (WINDOW *,int,int);			/* implemented */
+extern NCURSES_EXPORT(int) wnoutrefresh (WINDOW *);			/* implemented */
+extern NCURSES_EXPORT(int) wprintw (WINDOW *, const char *,...)		/* implemented */
+		GCC_PRINTFLIKE(2,3);
+extern NCURSES_EXPORT(int) wredrawln (WINDOW *,int,int);		/* implemented */
+extern NCURSES_EXPORT(int) wrefresh (WINDOW *);				/* implemented */
+extern NCURSES_EXPORT(int) wscanw (WINDOW *, const char *,...)		/* implemented */
+		GCC_SCANFLIKE(2,3);
+extern NCURSES_EXPORT(int) wscrl (WINDOW *,int);			/* implemented */
+extern NCURSES_EXPORT(int) wsetscrreg (WINDOW *,int,int);		/* implemented */
+extern NCURSES_EXPORT(int) wstandout (WINDOW *);			/* generated */
+extern NCURSES_EXPORT(int) wstandend (WINDOW *);			/* generated */
+extern NCURSES_EXPORT(void) wsyncdown (WINDOW *);			/* implemented */
+extern NCURSES_EXPORT(void) wsyncup (WINDOW *);				/* implemented */
+extern NCURSES_EXPORT(void) wtimeout (WINDOW *,int);			/* implemented */
+extern NCURSES_EXPORT(int) wtouchln (WINDOW *,int,int,int);		/* implemented */
+extern NCURSES_EXPORT(int) wvline (WINDOW *,chtype,int);		/* implemented */
+
+/*
+ * These are also declared in <term.h>:
+ */
+extern NCURSES_EXPORT(int) tigetflag (const char *);			/* implemented */
+extern NCURSES_EXPORT(int) tigetnum (const char *);			/* implemented */
+extern NCURSES_EXPORT(char *) tigetstr (const char *);			/* implemented */
+extern NCURSES_EXPORT(int) putp (const char *);				/* implemented */
+
+#if NCURSES_TPARM_VARARGS
+extern NCURSES_EXPORT(char *) tparm (const char *, ...);		/* special */
+#else
+extern NCURSES_EXPORT(char *) tparm (const char *, NCURSES_TPARM_ARG,NCURSES_TPARM_ARG,NCURSES_TPARM_ARG,NCURSES_TPARM_ARG,NCURSES_TPARM_ARG,NCURSES_TPARM_ARG,NCURSES_TPARM_ARG,NCURSES_TPARM_ARG,NCURSES_TPARM_ARG);	/* special */
+#endif
+
+extern NCURSES_EXPORT(char *) tiparm (const char *, ...);		/* special */
+extern NCURSES_EXPORT(char *) tiparm_s (int, int, const char *, ...);	/* special */
+extern NCURSES_EXPORT(int) tiscan_s (int *, int *, const char *);	/* special */
+
+/*
+ * These functions are not in X/Open, but we use them in macro definitions:
+ */
+extern NCURSES_EXPORT(int) getattrs (const WINDOW *);			/* generated */
+extern NCURSES_EXPORT(int) getcurx (const WINDOW *);			/* generated */
+extern NCURSES_EXPORT(int) getcury (const WINDOW *);			/* generated */
+extern NCURSES_EXPORT(int) getbegx (const WINDOW *);			/* generated */
+extern NCURSES_EXPORT(int) getbegy (const WINDOW *);			/* generated */
+extern NCURSES_EXPORT(int) getmaxx (const WINDOW *);			/* generated */
+extern NCURSES_EXPORT(int) getmaxy (const WINDOW *);			/* generated */
+extern NCURSES_EXPORT(int) getparx (const WINDOW *);			/* generated */
+extern NCURSES_EXPORT(int) getpary (const WINDOW *);			/* generated */
+
+/*
+ * vid_attr() was implemented originally based on a draft of X/Open curses.
+ */
+#if !NCURSES_WIDECHAR
+#define vid_attr(a,pair,opts) vidattr(a)
+#endif
+
+/*
+ * These functions are extensions - not in X/Open Curses.
+ */
+#if 1
+#undef  NCURSES_EXT_FUNCS
+#define NCURSES_EXT_FUNCS 20240427
+typedef int (*NCURSES_WINDOW_CB)(WINDOW *, void *);
+typedef int (*NCURSES_SCREEN_CB)(SCREEN *, void *);
+extern NCURSES_EXPORT(int) alloc_pair (int, int);
+extern NCURSES_EXPORT(int) assume_default_colors (int, int);
+extern NCURSES_EXPORT(const char *) curses_version (void);
+extern NCURSES_EXPORT(int) define_key (const char *, int);
+extern NCURSES_EXPORT(int) extended_color_content(int, int *, int *, int *);
+extern NCURSES_EXPORT(int) extended_pair_content(int, int *, int *);
+extern NCURSES_EXPORT(int) extended_slk_color(int);
+extern NCURSES_EXPORT(int) find_pair (int, int);
+extern NCURSES_EXPORT(int) free_pair (int);
+extern NCURSES_EXPORT(int) get_escdelay (void);
+extern NCURSES_EXPORT(int) init_extended_color(int, int, int, int);
+extern NCURSES_EXPORT(int) init_extended_pair(int, int, int);
+extern NCURSES_EXPORT(int) is_cbreak(void);
+extern NCURSES_EXPORT(int) is_echo(void);
+extern NCURSES_EXPORT(int) is_nl(void);
+extern NCURSES_EXPORT(int) is_raw(void);
+extern NCURSES_EXPORT(bool) is_term_resized (int, int);
+extern NCURSES_EXPORT(int) key_defined (const char *);
+extern NCURSES_EXPORT(char *) keybound (int, int);
+extern NCURSES_EXPORT(int) keyok (int, bool);
+extern NCURSES_EXPORT(void) nofilter(void);
+extern NCURSES_EXPORT(void) reset_color_pairs (void);
+extern NCURSES_EXPORT(int) resize_term (int, int);
+extern NCURSES_EXPORT(int) resizeterm (int, int);
+extern NCURSES_EXPORT(int) set_escdelay (int);
+extern NCURSES_EXPORT(int) set_tabsize (int);
+extern NCURSES_EXPORT(int) use_default_colors (void);
+extern NCURSES_EXPORT(int) use_legacy_coding (int);
+extern NCURSES_EXPORT(int) use_screen (SCREEN *, NCURSES_SCREEN_CB, void *);
+extern NCURSES_EXPORT(int) use_window (WINDOW *, NCURSES_WINDOW_CB, void *);
+extern NCURSES_EXPORT(int) wresize (WINDOW *, int, int);
+
+#if 1
+#undef  NCURSES_XNAMES
+#define NCURSES_XNAMES 1
+extern NCURSES_EXPORT(int) use_extended_names (bool);
+#endif
+
+/*
+ * These extensions provide access to information stored in the WINDOW even
+ * when NCURSES_OPAQUE is set:
+ */
+extern NCURSES_EXPORT(WINDOW *) wgetparent (const WINDOW *);	/* generated */
+extern NCURSES_EXPORT(bool) is_cleared (const WINDOW *);	/* generated */
+extern NCURSES_EXPORT(bool) is_idcok (const WINDOW *);		/* generated */
+extern NCURSES_EXPORT(bool) is_idlok (const WINDOW *);		/* generated */
+extern NCURSES_EXPORT(bool) is_immedok (const WINDOW *);	/* generated */
+extern NCURSES_EXPORT(bool) is_keypad (const WINDOW *);		/* generated */
+extern NCURSES_EXPORT(bool) is_leaveok (const WINDOW *);	/* generated */
+extern NCURSES_EXPORT(bool) is_nodelay (const WINDOW *);	/* generated */
+extern NCURSES_EXPORT(bool) is_notimeout (const WINDOW *);	/* generated */
+extern NCURSES_EXPORT(bool) is_pad (const WINDOW *);		/* generated */
+extern NCURSES_EXPORT(bool) is_scrollok (const WINDOW *);	/* generated */
+extern NCURSES_EXPORT(bool) is_subwin (const WINDOW *);		/* generated */
+extern NCURSES_EXPORT(bool) is_syncok (const WINDOW *);		/* generated */
+extern NCURSES_EXPORT(int) wgetdelay (const WINDOW *);		/* generated */
+extern NCURSES_EXPORT(int) wgetscrreg (const WINDOW *, int *, int *); /* generated */
+
+#else
+#define curses_version() NCURSES_VERSION
+#endif
+
+/*
+ * Extra extension-functions, which pass a SCREEN pointer rather than using
+ * a global variable SP.
+ */
+#if 1
+#undef  NCURSES_SP_FUNCS
+#define NCURSES_SP_FUNCS 20240427
+#define NCURSES_SP_NAME(name) name##_sp
+
+/* Define the sp-funcs helper function */
+#define NCURSES_SP_OUTC NCURSES_SP_NAME(NCURSES_OUTC)
+typedef int (*NCURSES_SP_OUTC)(SCREEN*, int);
+
+extern NCURSES_EXPORT(SCREEN *) new_prescr (void); /* implemented:SP_FUNC */
+
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(baudrate) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(beep) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(can_change_color) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(cbreak) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(curs_set) (SCREEN*, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(color_content) (SCREEN*, NCURSES_PAIRS_T, NCURSES_COLOR_T*, NCURSES_COLOR_T*, NCURSES_COLOR_T*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(def_prog_mode) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(def_shell_mode) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(delay_output) (SCREEN*, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(doupdate) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(echo) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(endwin) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(char) NCURSES_SP_NAME(erasechar) (SCREEN*);/* implemented:SP_FUNC */
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(filter) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(flash) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(flushinp) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(WINDOW *) NCURSES_SP_NAME(getwin) (SCREEN*, FILE *);			/* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(halfdelay) (SCREEN*, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_colors) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_ic) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_il) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(init_color) (SCREEN*, NCURSES_COLOR_T, NCURSES_COLOR_T, NCURSES_COLOR_T, NCURSES_COLOR_T); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(init_pair) (SCREEN*, NCURSES_PAIRS_T, NCURSES_COLOR_T, NCURSES_COLOR_T); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(intrflush) (SCREEN*, WINDOW*, bool);	/* implemented:SP_FUNC */
+extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(isendwin) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(NCURSES_CONST char *) NCURSES_SP_NAME(keyname) (SCREEN*, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(char) NCURSES_SP_NAME(killchar) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(longname) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(mvcur) (SCREEN*, int, int, int, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(napms) (SCREEN*, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(WINDOW *) NCURSES_SP_NAME(newpad) (SCREEN*, int, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(SCREEN *) NCURSES_SP_NAME(newterm) (SCREEN*, const char *, FILE *, FILE *); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(WINDOW *) NCURSES_SP_NAME(newwin) (SCREEN*, int, int, int, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(nl) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(nocbreak) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(noecho) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(nonl) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(noqiflush) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(noraw) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(pair_content) (SCREEN*, NCURSES_PAIRS_T, NCURSES_COLOR_T*, NCURSES_COLOR_T*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(qiflush) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(raw) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(reset_prog_mode) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(reset_shell_mode) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(resetty) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(ripoffline) (SCREEN*, int, int (*)(WINDOW *, int));	/* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(savetty) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(scr_init) (SCREEN*, const char *); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(scr_restore) (SCREEN*, const char *); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(scr_set) (SCREEN*, const char *); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attroff) (SCREEN*, const chtype); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attron) (SCREEN*, const chtype); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attrset) (SCREEN*, const chtype); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(attr_t) NCURSES_SP_NAME(slk_attr) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attr_set) (SCREEN*, const attr_t, NCURSES_PAIRS_T, void*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_clear) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_color) (SCREEN*, NCURSES_PAIRS_T); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_init) (SCREEN*, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(slk_label) (SCREEN*, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_noutrefresh) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_refresh) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_restore) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_set) (SCREEN*, int, const char *, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_touch) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(start_color) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(chtype) NCURSES_SP_NAME(termattrs) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(termname) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(typeahead) (SCREEN*, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(ungetch) (SCREEN*, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(use_env) (SCREEN*, bool); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(use_tioctl) (SCREEN*, bool); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vidattr) (SCREEN*, chtype);	/* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vidputs) (SCREEN*, chtype, NCURSES_SP_OUTC); /* implemented:SP_FUNC */
+#if 1
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(alloc_pair) (SCREEN*, int, int); /* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(assume_default_colors) (SCREEN*, int, int);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(define_key) (SCREEN*, const char *, int);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(extended_color_content) (SCREEN*, int, int *, int *, int *);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(extended_pair_content) (SCREEN*, int, int *, int *);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(extended_slk_color) (SCREEN*, int);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(find_pair) (SCREEN*, int, int); /* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(free_pair) (SCREEN*, int); /* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(get_escdelay) (SCREEN*);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(init_extended_color) (SCREEN*, int, int, int, int);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(init_extended_pair) (SCREEN*, int, int, int);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(is_cbreak) (SCREEN*);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(is_echo) (SCREEN*);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(is_nl) (SCREEN*);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(is_raw) (SCREEN*);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(is_term_resized) (SCREEN*, int, int);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(key_defined) (SCREEN*, const char *);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(keybound) (SCREEN*, int, int);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(keyok) (SCREEN*, int, bool);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(nofilter) (SCREEN*); /* implemented */	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(reset_color_pairs) (SCREEN*); /* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(resize_term) (SCREEN*, int, int);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(resizeterm) (SCREEN*, int, int);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(set_escdelay) (SCREEN*, int);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(set_tabsize) (SCREEN*, int);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_default_colors) (SCREEN*);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int);	/* implemented:EXT_SP_FUNC */
+#endif
+#else
+#undef  NCURSES_SP_FUNCS
+#define NCURSES_SP_FUNCS 0
+#define NCURSES_SP_NAME(name) name
+#define NCURSES_SP_OUTC NCURSES_OUTC
+#endif
+
+/* attributes */
+
+#define NCURSES_ATTR_SHIFT       8
+#define NCURSES_BITS(mask,shift) (NCURSES_CAST(chtype,(mask)) << ((shift) + NCURSES_ATTR_SHIFT))
+
+#define A_NORMAL	(1U - 1U)
+#define A_ATTRIBUTES	NCURSES_BITS(~(1U - 1U),0)
+#define A_CHARTEXT	(NCURSES_BITS(1U,0) - 1U)
+#define A_COLOR		NCURSES_BITS(((1U) << 8) - 1U,0)
+#define A_STANDOUT	NCURSES_BITS(1U,8)
+#define A_UNDERLINE	NCURSES_BITS(1U,9)
+#define A_REVERSE	NCURSES_BITS(1U,10)
+#define A_BLINK		NCURSES_BITS(1U,11)
+#define A_DIM		NCURSES_BITS(1U,12)
+#define A_BOLD		NCURSES_BITS(1U,13)
+#define A_ALTCHARSET	NCURSES_BITS(1U,14)
+#define A_INVIS		NCURSES_BITS(1U,15)
+#define A_PROTECT	NCURSES_BITS(1U,16)
+#define A_HORIZONTAL	NCURSES_BITS(1U,17)
+#define A_LEFT		NCURSES_BITS(1U,18)
+#define A_LOW		NCURSES_BITS(1U,19)
+#define A_RIGHT		NCURSES_BITS(1U,20)
+#define A_TOP		NCURSES_BITS(1U,21)
+#define A_VERTICAL	NCURSES_BITS(1U,22)
+
+#if 1
+#define A_ITALIC	NCURSES_BITS(1U,23)	/* ncurses extension */
+#endif
+
+/*
+ * Most of the pseudo functions are macros that either provide compatibility
+ * with older versions of curses, or provide inline functionality to improve
+ * performance.
+ */
+
+/*
+ * These pseudo functions are always implemented as macros:
+ */
+
+#define getyx(win,y,x)		(y = getcury(win), x = getcurx(win))
+#define getbegyx(win,y,x)	(y = getbegy(win), x = getbegx(win))
+#define getmaxyx(win,y,x)	(y = getmaxy(win), x = getmaxx(win))
+#define getparyx(win,y,x)	(y = getpary(win), x = getparx(win))
+
+#define getsyx(y,x) do { if (newscr) { \
+			     if (is_leaveok(newscr)) \
+				(y) = (x) = -1; \
+			     else \
+				 getyx(newscr,(y), (x)); \
+			} \
+		    } while(0)
+
+#define setsyx(y,x) do { if (newscr) { \
+			    if ((y) == -1 && (x) == -1) \
+				leaveok(newscr, TRUE); \
+			    else { \
+				leaveok(newscr, FALSE); \
+				wmove(newscr, (y), (x)); \
+			    } \
+			} \
+		    } while(0)
+
+#ifndef NCURSES_NOMACROS
+
+/*
+ * These miscellaneous pseudo functions are provided for compatibility:
+ */
+
+#define wgetstr(w, s)		wgetnstr(w, s, -1)
+#define getnstr(s, n)		wgetnstr(stdscr, s, (n))
+
+#define setterm(term)		setupterm(term, 1, (int *)0)
+
+#define fixterm()		reset_prog_mode()
+#define resetterm()		reset_shell_mode()
+#define saveterm()		def_prog_mode()
+#define crmode()		cbreak()
+#define nocrmode()		nocbreak()
+#define gettmode()
+
+/* It seems older SYSV curses versions define these */
+#if !NCURSES_OPAQUE
+#define getattrs(win)		NCURSES_CAST(int, NCURSES_OK_ADDR(win) ? (win)->_attrs : A_NORMAL)
+#define getcurx(win)		(NCURSES_OK_ADDR(win) ? (win)->_curx : ERR)
+#define getcury(win)		(NCURSES_OK_ADDR(win) ? (win)->_cury : ERR)
+#define getbegx(win)		(NCURSES_OK_ADDR(win) ? (win)->_begx : ERR)
+#define getbegy(win)		(NCURSES_OK_ADDR(win) ? (win)->_begy : ERR)
+#define getmaxx(win)		(NCURSES_OK_ADDR(win) ? ((win)->_maxx + 1) : ERR)
+#define getmaxy(win)		(NCURSES_OK_ADDR(win) ? ((win)->_maxy + 1) : ERR)
+#define getparx(win)		(NCURSES_OK_ADDR(win) ? (win)->_parx : ERR)
+#define getpary(win)		(NCURSES_OK_ADDR(win) ? (win)->_pary : ERR)
+#endif /* NCURSES_OPAQUE */
+
+#define wstandout(win)		(wattrset(win,A_STANDOUT))
+#define wstandend(win)		(wattrset(win,A_NORMAL))
+
+#define wattron(win,at)		wattr_on(win, NCURSES_CAST(attr_t, at), NULL)
+#define wattroff(win,at)	wattr_off(win, NCURSES_CAST(attr_t, at), NULL)
+
+#if !NCURSES_OPAQUE
+#if NCURSES_WATTR_MACROS
+#if NCURSES_WIDECHAR && 1
+#define wattrset(win,at) \
+	(NCURSES_OK_ADDR(win) \
+	  ? ((win)->_color = NCURSES_CAST(int, PAIR_NUMBER(at)), \
+	     (win)->_attrs = NCURSES_CAST(attr_t, at), \
+	     OK) \
+	  : ERR)
+#else
+#define wattrset(win,at) \
+	(NCURSES_OK_ADDR(win) \
+	  ? ((win)->_attrs = NCURSES_CAST(attr_t, at), \
+	     OK) \
+	  : ERR)
+#endif
+#endif /* NCURSES_WATTR_MACROS */
+#endif /* NCURSES_OPAQUE */
+
+#define scroll(win)		wscrl(win,1)
+
+#define touchwin(win)		wtouchln((win), 0, getmaxy(win), 1)
+#define touchline(win, s, c)	wtouchln((win), s, c, 1)
+#define untouchwin(win)		wtouchln((win), 0, getmaxy(win), 0)
+
+#define box(win, v, h)		wborder(win, v, v, h, h, 0, 0, 0, 0)
+#define border(ls, rs, ts, bs, tl, tr, bl, br)	wborder(stdscr, ls, rs, ts, bs, tl, tr, bl, br)
+#define hline(ch, n)		whline(stdscr, ch, (n))
+#define vline(ch, n)		wvline(stdscr, ch, (n))
+
+#define winstr(w, s)		winnstr(w, s, -1)
+#define winchstr(w, s)		winchnstr(w, s, -1)
+#define winsstr(w, s)		winsnstr(w, s, -1)
+
+#if !NCURSES_OPAQUE
+#define redrawwin(win)		wredrawln(win, 0, (NCURSES_OK_ADDR(win) ? (win)->_maxy+1 : -1))
+#endif /* NCURSES_OPAQUE */
+
+#define waddstr(win,str)	waddnstr(win,str,-1)
+#define waddchstr(win,str)	waddchnstr(win,str,-1)
+
+/*
+ * These apply to the first 256 color pairs.
+ */
+#define COLOR_PAIR(n)	(NCURSES_BITS((n), 0) & A_COLOR)
+#define PAIR_NUMBER(a)	(NCURSES_CAST(int,((NCURSES_CAST(unsigned long,(a)) & A_COLOR) >> NCURSES_ATTR_SHIFT)))
+
+/*
+ * pseudo functions for standard screen
+ */
+
+#define addch(ch)		waddch(stdscr,(ch))
+#define addchnstr(str,n)	waddchnstr(stdscr,(str),(n))
+#define addchstr(str)		waddchstr(stdscr,(str))
+#define addnstr(str,n)		waddnstr(stdscr,(str),(n))
+#define addstr(str)		waddnstr(stdscr,(str),-1)
+#define attr_get(ap,cp,o)	wattr_get(stdscr,(ap),(cp),(o))
+#define attr_off(a,o)		wattr_off(stdscr,(a),(o))
+#define attr_on(a,o)		wattr_on(stdscr,(a),(o))
+#define attr_set(a,c,o)		wattr_set(stdscr,(a),(c),(o))
+#define attroff(at)		wattroff(stdscr,(at))
+#define attron(at)		wattron(stdscr,(at))
+#define attrset(at)		wattrset(stdscr,(at))
+#define bkgd(ch)		wbkgd(stdscr,(ch))
+#define bkgdset(ch)		wbkgdset(stdscr,(ch))
+#define chgat(n,a,c,o)		wchgat(stdscr,(n),(a),(c),(o))
+#define clear()			wclear(stdscr)
+#define clrtobot()		wclrtobot(stdscr)
+#define clrtoeol()		wclrtoeol(stdscr)
+#define color_set(c,o)		wcolor_set(stdscr,(c),(o))
+#define delch()			wdelch(stdscr)
+#define deleteln()		winsdelln(stdscr,-1)
+#define echochar(c)		wechochar(stdscr,(c))
+#define erase()			werase(stdscr)
+#define getch()			wgetch(stdscr)
+#define getstr(str)		wgetstr(stdscr,(str))
+#define inch()			winch(stdscr)
+#define inchnstr(s,n)		winchnstr(stdscr,(s),(n))
+#define inchstr(s)		winchstr(stdscr,(s))
+#define innstr(s,n)		winnstr(stdscr,(s),(n))
+#define insch(c)		winsch(stdscr,(c))
+#define insdelln(n)		winsdelln(stdscr,(n))
+#define insertln()		winsdelln(stdscr,1)
+#define insnstr(s,n)		winsnstr(stdscr,(s),(n))
+#define insstr(s)		winsstr(stdscr,(s))
+#define instr(s)		winstr(stdscr,(s))
+#define move(y,x)		wmove(stdscr,(y),(x))
+#define refresh()		wrefresh(stdscr)
+#define scrl(n)			wscrl(stdscr,(n))
+#define setscrreg(t,b)		wsetscrreg(stdscr,(t),(b))
+#define standend()		wstandend(stdscr)
+#define standout()		wstandout(stdscr)
+#define timeout(delay)		wtimeout(stdscr,(delay))
+#define wdeleteln(win)		winsdelln(win,-1)
+#define winsertln(win)		winsdelln(win,1)
+
+/*
+ * mv functions
+ */
+
+#define mvwaddch(win,y,x,ch)		(wmove((win),(y),(x)) == ERR ? ERR : waddch((win),(ch)))
+#define mvwaddchnstr(win,y,x,str,n)	(wmove((win),(y),(x)) == ERR ? ERR : waddchnstr((win),(str),(n)))
+#define mvwaddchstr(win,y,x,str)	(wmove((win),(y),(x)) == ERR ? ERR : waddchnstr((win),(str),-1))
+#define mvwaddnstr(win,y,x,str,n)	(wmove((win),(y),(x)) == ERR ? ERR : waddnstr((win),(str),(n)))
+#define mvwaddstr(win,y,x,str)		(wmove((win),(y),(x)) == ERR ? ERR : waddnstr((win),(str),-1))
+#define mvwchgat(win,y,x,n,a,c,o)	(wmove((win),(y),(x)) == ERR ? ERR : wchgat((win),(n),(a),(c),(o)))
+#define mvwdelch(win,y,x)		(wmove((win),(y),(x)) == ERR ? ERR : wdelch(win))
+#define mvwgetch(win,y,x)		(wmove((win),(y),(x)) == ERR ? ERR : wgetch(win))
+#define mvwgetnstr(win,y,x,str,n)	(wmove((win),(y),(x)) == ERR ? ERR : wgetnstr((win),(str),(n)))
+#define mvwgetstr(win,y,x,str)		(wmove((win),(y),(x)) == ERR ? ERR : wgetstr((win),(str)))
+#define mvwhline(win,y,x,c,n)		(wmove((win),(y),(x)) == ERR ? ERR : whline((win),(c),(n)))
+#define mvwinch(win,y,x)		(wmove((win),(y),(x)) == ERR ? NCURSES_CAST(chtype, ERR) : winch(win))
+#define mvwinchnstr(win,y,x,s,n)	(wmove((win),(y),(x)) == ERR ? ERR : winchnstr((win),(s),(n)))
+#define mvwinchstr(win,y,x,s)		(wmove((win),(y),(x)) == ERR ? ERR : winchstr((win),(s)))
+#define mvwinnstr(win,y,x,s,n)		(wmove((win),(y),(x)) == ERR ? ERR : winnstr((win),(s),(n)))
+#define mvwinsch(win,y,x,c)		(wmove((win),(y),(x)) == ERR ? ERR : winsch((win),(c)))
+#define mvwinsnstr(win,y,x,s,n)		(wmove((win),(y),(x)) == ERR ? ERR : winsnstr((win),(s),(n)))
+#define mvwinsstr(win,y,x,s)		(wmove((win),(y),(x)) == ERR ? ERR : winsstr((win),(s)))
+#define mvwinstr(win,y,x,s)		(wmove((win),(y),(x)) == ERR ? ERR : winstr((win),(s)))
+#define mvwvline(win,y,x,c,n)		(wmove((win),(y),(x)) == ERR ? ERR : wvline((win),(c),(n)))
+
+#define mvaddch(y,x,ch)			mvwaddch(stdscr,(y),(x),(ch))
+#define mvaddchnstr(y,x,str,n)		mvwaddchnstr(stdscr,(y),(x),(str),(n))
+#define mvaddchstr(y,x,str)		mvwaddchstr(stdscr,(y),(x),(str))
+#define mvaddnstr(y,x,str,n)		mvwaddnstr(stdscr,(y),(x),(str),(n))
+#define mvaddstr(y,x,str)		mvwaddstr(stdscr,(y),(x),(str))
+#define mvchgat(y,x,n,a,c,o)		mvwchgat(stdscr,(y),(x),(n),(a),(c),(o))
+#define mvdelch(y,x)			mvwdelch(stdscr,(y),(x))
+#define mvgetch(y,x)			mvwgetch(stdscr,(y),(x))
+#define mvgetnstr(y,x,str,n)		mvwgetnstr(stdscr,(y),(x),(str),(n))
+#define mvgetstr(y,x,str)		mvwgetstr(stdscr,(y),(x),(str))
+#define mvhline(y,x,c,n)		mvwhline(stdscr,(y),(x),(c),(n))
+#define mvinch(y,x)			mvwinch(stdscr,(y),(x))
+#define mvinchnstr(y,x,s,n)		mvwinchnstr(stdscr,(y),(x),(s),(n))
+#define mvinchstr(y,x,s)		mvwinchstr(stdscr,(y),(x),(s))
+#define mvinnstr(y,x,s,n)		mvwinnstr(stdscr,(y),(x),(s),(n))
+#define mvinsch(y,x,c)			mvwinsch(stdscr,(y),(x),(c))
+#define mvinsnstr(y,x,s,n)		mvwinsnstr(stdscr,(y),(x),(s),(n))
+#define mvinsstr(y,x,s)			mvwinsstr(stdscr,(y),(x),(s))
+#define mvinstr(y,x,s)			mvwinstr(stdscr,(y),(x),(s))
+#define mvvline(y,x,c,n)		mvwvline(stdscr,(y),(x),(c),(n))
+
+/*
+ * Some wide-character functions can be implemented without the extensions.
+ */
+#if !NCURSES_OPAQUE
+#define getbkgd(win)                    (NCURSES_OK_ADDR(win) ? ((win)->_bkgd) : 0)
+#endif /* NCURSES_OPAQUE */
+
+#define slk_attr_off(a,v)		((v) ? ERR : slk_attroff(a))
+#define slk_attr_on(a,v)		((v) ? ERR : slk_attron(a))
+
+#if !NCURSES_OPAQUE
+#if NCURSES_WATTR_MACROS
+#if NCURSES_WIDECHAR && 1
+#define wattr_set(win,a,p,opts) \
+	(NCURSES_OK_ADDR(win) \
+	 ? ((void)((win)->_attrs = ((a) & ~A_COLOR), \
+		   (win)->_color = (opts) ? *(int *)(opts) : (p)), \
+	    OK) \
+	 : ERR)
+#define wattr_get(win,a,p,opts) \
+	(NCURSES_OK_ADDR(win) \
+	 ? ((void)(NCURSES_OK_ADDR(a) \
+		   ? (*(a) = (win)->_attrs) \
+		   : OK), \
+	    (void)(NCURSES_OK_ADDR(p) \
+		   ? (*(p) = (NCURSES_PAIRS_T) (win)->_color) \
+		   : OK), \
+	    (void)(NCURSES_OK_ADDR(opts) \
+		   ? (*(int *)(opts) = (win)->_color) \
+		   : OK), \
+	    OK) \
+	 : ERR)
+#else /* !(NCURSES_WIDECHAR && NCURSES_EXE_COLORS) */
+#define wattr_set(win,a,p,opts) \
+	 (NCURSES_OK_ADDR(win) \
+	  ? ((void)((win)->_attrs = (((a) & ~A_COLOR) | \
+				     (attr_t)COLOR_PAIR(p))), \
+	     OK) \
+	  : ERR)
+#define wattr_get(win,a,p,opts) \
+	(NCURSES_OK_ADDR(win) \
+	 ? ((void)(NCURSES_OK_ADDR(a) \
+		   ? (*(a) = (win)->_attrs) \
+		   : OK), \
+	    (void)(NCURSES_OK_ADDR(p) \
+		   ? (*(p) = (NCURSES_PAIRS_T) PAIR_NUMBER((win)->_attrs)) \
+		   : OK), \
+	    OK) \
+	 : ERR)
+#endif /* (NCURSES_WIDECHAR && NCURSES_EXE_COLORS) */
+#endif /* NCURSES_WATTR_MACROS */
+#endif /* NCURSES_OPAQUE */
+
+/*
+ * X/Open curses deprecates SVr4 vwprintw/vwscanw, which are supposed to use
+ * varargs.h.  It adds new calls vw_printw/vw_scanw, which are supposed to
+ * use POSIX stdarg.h.  The ncurses versions of vwprintw/vwscanw already
+ * use stdarg.h, so...
+ */
+/* define vw_printw		vwprintw */
+/* define vw_scanw		vwscanw */
+
+/*
+ * Export fallback function for use in C++ binding.
+ */
+#if !1
+#define vsscanf(a,b,c) _nc_vsscanf(a,b,c)
+NCURSES_EXPORT(int) vsscanf(const char *, const char *, va_list);
+#endif
+
+/*
+ * These macros are extensions - not in X/Open Curses.
+ */
+#if 1
+#if !NCURSES_OPAQUE
+#define is_cleared(win)		(NCURSES_OK_ADDR(win) ? (win)->_clear : FALSE)
+#define is_idcok(win)		(NCURSES_OK_ADDR(win) ? (win)->_idcok : FALSE)
+#define is_idlok(win)		(NCURSES_OK_ADDR(win) ? (win)->_idlok : FALSE)
+#define is_immedok(win)		(NCURSES_OK_ADDR(win) ? (win)->_immed : FALSE)
+#define is_keypad(win)		(NCURSES_OK_ADDR(win) ? (win)->_use_keypad : FALSE)
+#define is_leaveok(win)		(NCURSES_OK_ADDR(win) ? (win)->_leaveok : FALSE)
+#define is_nodelay(win)		(NCURSES_OK_ADDR(win) ? ((win)->_delay == 0) : FALSE)
+#define is_notimeout(win)	(NCURSES_OK_ADDR(win) ? (win)->_notimeout : FALSE)
+#define is_pad(win)		(NCURSES_OK_ADDR(win) ? ((win)->_flags & _ISPAD) != 0 : FALSE)
+#define is_scrollok(win)	(NCURSES_OK_ADDR(win) ? (win)->_scroll : FALSE)
+#define is_subwin(win)		(NCURSES_OK_ADDR(win) ? ((win)->_flags & _SUBWIN) != 0 : FALSE)
+#define is_syncok(win)		(NCURSES_OK_ADDR(win) ? (win)->_sync : FALSE)
+#define wgetdelay(win)		(NCURSES_OK_ADDR(win) ? (win)->_delay : 0)
+#define wgetparent(win)		(NCURSES_OK_ADDR(win) ? (win)->_parent : 0)
+#define wgetscrreg(win,t,b)	(NCURSES_OK_ADDR(win) ? (*(t) = (win)->_regtop, *(b) = (win)->_regbottom, OK) : ERR)
+#endif
+#endif
+
+/*
+ * X/Open says this returns a bool; SVr4 also checked for out-of-range line.
+ * The macro provides compatibility:
+ */
+#define is_linetouched(w,l) ((!(w) || ((l) > getmaxy(w)) || ((l) < 0)) ? ERR : (is_linetouched)((w),(l)))
+
+#endif /* NCURSES_NOMACROS */
+
+/*
+ * Public variables.
+ *
+ * Notes:
+ *	a. ESCDELAY was an undocumented feature under AIX curses.
+ *	   It gives the ESC expire time in milliseconds.
+ *	b. ttytype is needed for backward compatibility
+ */
+#if NCURSES_REENTRANT
+
+NCURSES_WRAPPED_VAR(WINDOW *, curscr);
+NCURSES_WRAPPED_VAR(WINDOW *, newscr);
+NCURSES_WRAPPED_VAR(WINDOW *, stdscr);
+NCURSES_WRAPPED_VAR(char *, ttytype);
+NCURSES_WRAPPED_VAR(int, COLORS);
+NCURSES_WRAPPED_VAR(int, COLOR_PAIRS);
+NCURSES_WRAPPED_VAR(int, COLS);
+NCURSES_WRAPPED_VAR(int, ESCDELAY);
+NCURSES_WRAPPED_VAR(int, LINES);
+NCURSES_WRAPPED_VAR(int, TABSIZE);
+
+#define curscr      NCURSES_PUBLIC_VAR(curscr())
+#define newscr      NCURSES_PUBLIC_VAR(newscr())
+#define stdscr      NCURSES_PUBLIC_VAR(stdscr())
+#define ttytype     NCURSES_PUBLIC_VAR(ttytype())
+#define COLORS      NCURSES_PUBLIC_VAR(COLORS())
+#define COLOR_PAIRS NCURSES_PUBLIC_VAR(COLOR_PAIRS())
+#define COLS        NCURSES_PUBLIC_VAR(COLS())
+#define ESCDELAY    NCURSES_PUBLIC_VAR(ESCDELAY())
+#define LINES       NCURSES_PUBLIC_VAR(LINES())
+#define TABSIZE     NCURSES_PUBLIC_VAR(TABSIZE())
+
+#else
+
+extern NCURSES_EXPORT_VAR(WINDOW *) curscr;
+extern NCURSES_EXPORT_VAR(WINDOW *) newscr;
+extern NCURSES_EXPORT_VAR(WINDOW *) stdscr;
+extern NCURSES_EXPORT_VAR(char) ttytype[];
+extern NCURSES_EXPORT_VAR(int) COLORS;
+extern NCURSES_EXPORT_VAR(int) COLOR_PAIRS;
+extern NCURSES_EXPORT_VAR(int) COLS;
+extern NCURSES_EXPORT_VAR(int) ESCDELAY;
+extern NCURSES_EXPORT_VAR(int) LINES;
+extern NCURSES_EXPORT_VAR(int) TABSIZE;
+
+#endif
+
+/*
+ * Pseudo-character tokens outside ASCII range.  The curses wgetch() function
+ * will return any given one of these only if the corresponding k- capability
+ * is defined in your terminal's terminfo entry.
+ *
+ * Some keys (KEY_A1, etc) are arranged like this:
+ *	a1     up    a3
+ *	left   b2    right
+ *	c1     down  c3
+ *
+ * A few key codes do not depend upon the terminfo entry.
+ */
+#define KEY_CODE_YES	0400		/* A wchar_t contains a key code */
+#define KEY_MIN		0401		/* Minimum curses key */
+#define KEY_BREAK	0401		/* Break key (unreliable) */
+#define KEY_SRESET	0530		/* Soft (partial) reset (unreliable) */
+#define KEY_RESET	0531		/* Reset or hard reset (unreliable) */
+/*
+ * These definitions were generated by ./MKkey_defs.sh ./Caps ./Caps-ncurses
+ */
+#define KEY_DOWN	0402		/* down-arrow key */
+#define KEY_UP		0403		/* up-arrow key */
+#define KEY_LEFT	0404		/* left-arrow key */
+#define KEY_RIGHT	0405		/* right-arrow key */
+#define KEY_HOME	0406		/* home key */
+#define KEY_BACKSPACE	0407		/* backspace key */
+#define KEY_F0		0410		/* Function keys.  Space for 64 */
+#define KEY_F(n)	(KEY_F0+(n))	/* Value of function key n */
+#define KEY_DL		0510		/* delete-line key */
+#define KEY_IL		0511		/* insert-line key */
+#define KEY_DC		0512		/* delete-character key */
+#define KEY_IC		0513		/* insert-character key */
+#define KEY_EIC		0514		/* sent by rmir or smir in insert mode */
+#define KEY_CLEAR	0515		/* clear-screen or erase key */
+#define KEY_EOS		0516		/* clear-to-end-of-screen key */
+#define KEY_EOL		0517		/* clear-to-end-of-line key */
+#define KEY_SF		0520		/* scroll-forward key */
+#define KEY_SR		0521		/* scroll-backward key */
+#define KEY_NPAGE	0522		/* next-page key */
+#define KEY_PPAGE	0523		/* previous-page key */
+#define KEY_STAB	0524		/* set-tab key */
+#define KEY_CTAB	0525		/* clear-tab key */
+#define KEY_CATAB	0526		/* clear-all-tabs key */
+#define KEY_ENTER	0527		/* enter/send key */
+#define KEY_PRINT	0532		/* print key */
+#define KEY_LL		0533		/* lower-left key (home down) */
+#define KEY_A1		0534		/* upper left of keypad */
+#define KEY_A3		0535		/* upper right of keypad */
+#define KEY_B2		0536		/* center of keypad */
+#define KEY_C1		0537		/* lower left of keypad */
+#define KEY_C3		0540		/* lower right of keypad */
+#define KEY_BTAB	0541		/* back-tab key */
+#define KEY_BEG		0542		/* begin key */
+#define KEY_CANCEL	0543		/* cancel key */
+#define KEY_CLOSE	0544		/* close key */
+#define KEY_COMMAND	0545		/* command key */
+#define KEY_COPY	0546		/* copy key */
+#define KEY_CREATE	0547		/* create key */
+#define KEY_END		0550		/* end key */
+#define KEY_EXIT	0551		/* exit key */
+#define KEY_FIND	0552		/* find key */
+#define KEY_HELP	0553		/* help key */
+#define KEY_MARK	0554		/* mark key */
+#define KEY_MESSAGE	0555		/* message key */
+#define KEY_MOVE	0556		/* move key */
+#define KEY_NEXT	0557		/* next key */
+#define KEY_OPEN	0560		/* open key */
+#define KEY_OPTIONS	0561		/* options key */
+#define KEY_PREVIOUS	0562		/* previous key */
+#define KEY_REDO	0563		/* redo key */
+#define KEY_REFERENCE	0564		/* reference key */
+#define KEY_REFRESH	0565		/* refresh key */
+#define KEY_REPLACE	0566		/* replace key */
+#define KEY_RESTART	0567		/* restart key */
+#define KEY_RESUME	0570		/* resume key */
+#define KEY_SAVE	0571		/* save key */
+#define KEY_SBEG	0572		/* shifted begin key */
+#define KEY_SCANCEL	0573		/* shifted cancel key */
+#define KEY_SCOMMAND	0574		/* shifted command key */
+#define KEY_SCOPY	0575		/* shifted copy key */
+#define KEY_SCREATE	0576		/* shifted create key */
+#define KEY_SDC		0577		/* shifted delete-character key */
+#define KEY_SDL		0600		/* shifted delete-line key */
+#define KEY_SELECT	0601		/* select key */
+#define KEY_SEND	0602		/* shifted end key */
+#define KEY_SEOL	0603		/* shifted clear-to-end-of-line key */
+#define KEY_SEXIT	0604		/* shifted exit key */
+#define KEY_SFIND	0605		/* shifted find key */
+#define KEY_SHELP	0606		/* shifted help key */
+#define KEY_SHOME	0607		/* shifted home key */
+#define KEY_SIC		0610		/* shifted insert-character key */
+#define KEY_SLEFT	0611		/* shifted left-arrow key */
+#define KEY_SMESSAGE	0612		/* shifted message key */
+#define KEY_SMOVE	0613		/* shifted move key */
+#define KEY_SNEXT	0614		/* shifted next key */
+#define KEY_SOPTIONS	0615		/* shifted options key */
+#define KEY_SPREVIOUS	0616		/* shifted previous key */
+#define KEY_SPRINT	0617		/* shifted print key */
+#define KEY_SREDO	0620		/* shifted redo key */
+#define KEY_SREPLACE	0621		/* shifted replace key */
+#define KEY_SRIGHT	0622		/* shifted right-arrow key */
+#define KEY_SRSUME	0623		/* shifted resume key */
+#define KEY_SSAVE	0624		/* shifted save key */
+#define KEY_SSUSPEND	0625		/* shifted suspend key */
+#define KEY_SUNDO	0626		/* shifted undo key */
+#define KEY_SUSPEND	0627		/* suspend key */
+#define KEY_UNDO	0630		/* undo key */
+#define KEY_MOUSE	0631		/* Mouse event has occurred */
+
+#if NCURSES_SIGWINCH
+#define KEY_RESIZE	0632		/* Terminal resize event */
+#endif
+
+#define KEY_MAX		0777		/* Maximum key value is 0632 */
+/* $Id: curses.wide,v 1.51 2021/05/22 20:28:29 tom Exp $ */
+/*
+ * vile:cmode:
+ * This file is part of ncurses, designed to be appended after curses.h.in
+ * (see that file for the relevant copyright).
+ */
+#define _XOPEN_CURSES 1
+
+#if NCURSES_WIDECHAR
+
+extern NCURSES_EXPORT_VAR(cchar_t *) _nc_wacs;
+
+#define NCURSES_WACS(c)	(&_nc_wacs[NCURSES_CAST(unsigned char,(c))])
+
+#define WACS_BSSB	NCURSES_WACS('l')
+#define WACS_SSBB	NCURSES_WACS('m')
+#define WACS_BBSS	NCURSES_WACS('k')
+#define WACS_SBBS	NCURSES_WACS('j')
+#define WACS_SBSS	NCURSES_WACS('u')
+#define WACS_SSSB	NCURSES_WACS('t')
+#define WACS_SSBS	NCURSES_WACS('v')
+#define WACS_BSSS	NCURSES_WACS('w')
+#define WACS_BSBS	NCURSES_WACS('q')
+#define WACS_SBSB	NCURSES_WACS('x')
+#define WACS_SSSS	NCURSES_WACS('n')
+
+#define WACS_ULCORNER	WACS_BSSB
+#define WACS_LLCORNER	WACS_SSBB
+#define WACS_URCORNER	WACS_BBSS
+#define WACS_LRCORNER	WACS_SBBS
+#define WACS_RTEE	WACS_SBSS
+#define WACS_LTEE	WACS_SSSB
+#define WACS_BTEE	WACS_SSBS
+#define WACS_TTEE	WACS_BSSS
+#define WACS_HLINE	WACS_BSBS
+#define WACS_VLINE	WACS_SBSB
+#define WACS_PLUS	WACS_SSSS
+
+#define WACS_S1		NCURSES_WACS('o') /* scan line 1 */
+#define WACS_S9 	NCURSES_WACS('s') /* scan line 9 */
+#define WACS_DIAMOND	NCURSES_WACS('`') /* diamond */
+#define WACS_CKBOARD	NCURSES_WACS('a') /* checker board */
+#define WACS_DEGREE	NCURSES_WACS('f') /* degree symbol */
+#define WACS_PLMINUS	NCURSES_WACS('g') /* plus/minus */
+#define WACS_BULLET	NCURSES_WACS('~') /* bullet */
+
+	/* Teletype 5410v1 symbols */
+#define WACS_LARROW	NCURSES_WACS(',') /* arrow left */
+#define WACS_RARROW	NCURSES_WACS('+') /* arrow right */
+#define WACS_DARROW	NCURSES_WACS('.') /* arrow down */
+#define WACS_UARROW	NCURSES_WACS('-') /* arrow up */
+#define WACS_BOARD	NCURSES_WACS('h') /* board of squares */
+#define WACS_LANTERN	NCURSES_WACS('i') /* lantern symbol */
+#define WACS_BLOCK	NCURSES_WACS('0') /* solid square block */
+
+	/* ncurses extensions */
+#define WACS_S3		NCURSES_WACS('p') /* scan line 3 */
+#define WACS_S7		NCURSES_WACS('r') /* scan line 7 */
+#define WACS_LEQUAL	NCURSES_WACS('y') /* less/equal */
+#define WACS_GEQUAL	NCURSES_WACS('z') /* greater/equal */
+#define WACS_PI		NCURSES_WACS('{') /* Pi */
+#define WACS_NEQUAL	NCURSES_WACS('|') /* not equal */
+#define WACS_STERLING	NCURSES_WACS('}') /* UK pound sign */
+
+	/* double lines */
+#define WACS_BDDB	NCURSES_WACS('C')
+#define WACS_DDBB	NCURSES_WACS('D')
+#define WACS_BBDD	NCURSES_WACS('B')
+#define WACS_DBBD	NCURSES_WACS('A')
+#define WACS_DBDD	NCURSES_WACS('G')
+#define WACS_DDDB	NCURSES_WACS('F')
+#define WACS_DDBD	NCURSES_WACS('H')
+#define WACS_BDDD	NCURSES_WACS('I')
+#define WACS_BDBD	NCURSES_WACS('R')
+#define WACS_DBDB	NCURSES_WACS('Y')
+#define WACS_DDDD	NCURSES_WACS('E')
+
+#define WACS_D_ULCORNER	WACS_BDDB
+#define WACS_D_LLCORNER	WACS_DDBB
+#define WACS_D_URCORNER	WACS_BBDD
+#define WACS_D_LRCORNER	WACS_DBBD
+#define WACS_D_RTEE	WACS_DBDD
+#define WACS_D_LTEE	WACS_DDDB
+#define WACS_D_BTEE	WACS_DDBD
+#define WACS_D_TTEE	WACS_BDDD
+#define WACS_D_HLINE	WACS_BDBD
+#define WACS_D_VLINE	WACS_DBDB
+#define WACS_D_PLUS	WACS_DDDD
+
+	/* thick lines */
+#define WACS_BTTB	NCURSES_WACS('L')
+#define WACS_TTBB	NCURSES_WACS('M')
+#define WACS_BBTT	NCURSES_WACS('K')
+#define WACS_TBBT	NCURSES_WACS('J')
+#define WACS_TBTT	NCURSES_WACS('U')
+#define WACS_TTTB	NCURSES_WACS('T')
+#define WACS_TTBT	NCURSES_WACS('V')
+#define WACS_BTTT	NCURSES_WACS('W')
+#define WACS_BTBT	NCURSES_WACS('Q')
+#define WACS_TBTB	NCURSES_WACS('X')
+#define WACS_TTTT	NCURSES_WACS('N')
+
+#define WACS_T_ULCORNER	WACS_BTTB
+#define WACS_T_LLCORNER	WACS_TTBB
+#define WACS_T_URCORNER	WACS_BBTT
+#define WACS_T_LRCORNER	WACS_TBBT
+#define WACS_T_RTEE	WACS_TBTT
+#define WACS_T_LTEE	WACS_TTTB
+#define WACS_T_BTEE	WACS_TTBT
+#define WACS_T_TTEE	WACS_BTTT
+#define WACS_T_HLINE	WACS_BTBT
+#define WACS_T_VLINE	WACS_TBTB
+#define WACS_T_PLUS	WACS_TTTT
+
+/*
+ * Function prototypes for wide-character operations.
+ *
+ * "generated" comments should include ":WIDEC" to make the corresponding
+ * functions ifdef'd in lib_gen.c
+ *
+ * "implemented" comments do not need this marker.
+ */
+
+extern NCURSES_EXPORT(int) add_wch (const cchar_t *);			/* generated:WIDEC */
+extern NCURSES_EXPORT(int) add_wchnstr (const cchar_t *, int);		/* generated:WIDEC */
+extern NCURSES_EXPORT(int) add_wchstr (const cchar_t *);		/* generated:WIDEC */
+extern NCURSES_EXPORT(int) addnwstr (const wchar_t *, int);		/* generated:WIDEC */
+extern NCURSES_EXPORT(int) addwstr (const wchar_t *);			/* generated:WIDEC */
+extern NCURSES_EXPORT(int) bkgrnd (const cchar_t *);			/* generated:WIDEC */
+extern NCURSES_EXPORT(void) bkgrndset (const cchar_t *);		/* generated:WIDEC */
+extern NCURSES_EXPORT(int) border_set (const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*); /* generated:WIDEC */
+extern NCURSES_EXPORT(int) box_set (WINDOW *, const cchar_t *, const cchar_t *);	/* generated:WIDEC */
+extern NCURSES_EXPORT(int) echo_wchar (const cchar_t *);		/* generated:WIDEC */
+extern NCURSES_EXPORT(int) erasewchar (wchar_t*);			/* implemented */
+extern NCURSES_EXPORT(int) get_wch (wint_t *);				/* generated:WIDEC */
+extern NCURSES_EXPORT(int) get_wstr (wint_t *);				/* generated:WIDEC */
+extern NCURSES_EXPORT(int) getbkgrnd (cchar_t *);			/* generated:WIDEC */
+extern NCURSES_EXPORT(int) getcchar (const cchar_t *, wchar_t*, attr_t*, NCURSES_PAIRS_T*, void*);	/* implemented */
+extern NCURSES_EXPORT(int) getn_wstr (wint_t *, int);			/* generated:WIDEC */
+extern NCURSES_EXPORT(int) hline_set (const cchar_t *, int);		/* generated:WIDEC */
+extern NCURSES_EXPORT(int) in_wch (cchar_t *);				/* generated:WIDEC */
+extern NCURSES_EXPORT(int) in_wchnstr (cchar_t *, int);			/* generated:WIDEC */
+extern NCURSES_EXPORT(int) in_wchstr (cchar_t *);			/* generated:WIDEC */
+extern NCURSES_EXPORT(int) innwstr (wchar_t *, int);			/* generated:WIDEC */
+extern NCURSES_EXPORT(int) ins_nwstr (const wchar_t *, int);		/* generated:WIDEC */
+extern NCURSES_EXPORT(int) ins_wch (const cchar_t *);			/* generated:WIDEC */
+extern NCURSES_EXPORT(int) ins_wstr (const wchar_t *);			/* generated:WIDEC */
+extern NCURSES_EXPORT(int) inwstr (wchar_t *);				/* generated:WIDEC */
+extern NCURSES_EXPORT(NCURSES_CONST char*) key_name (wchar_t);		/* implemented */
+extern NCURSES_EXPORT(int) killwchar (wchar_t *);			/* implemented */
+extern NCURSES_EXPORT(int) mvadd_wch (int, int, const cchar_t *);	/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvadd_wchnstr (int, int, const cchar_t *, int);/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvadd_wchstr (int, int, const cchar_t *);	/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvaddnwstr (int, int, const wchar_t *, int);	/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvaddwstr (int, int, const wchar_t *);	/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvget_wch (int, int, wint_t *);		/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvget_wstr (int, int, wint_t *);		/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvgetn_wstr (int, int, wint_t *, int);	/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvhline_set (int, int, const cchar_t *, int);	/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvin_wch (int, int, cchar_t *);		/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvin_wchnstr (int, int, cchar_t *, int);	/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvin_wchstr (int, int, cchar_t *);		/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvinnwstr (int, int, wchar_t *, int);	/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvins_nwstr (int, int, const wchar_t *, int);	/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvins_wch (int, int, const cchar_t *);	/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvins_wstr (int, int, const wchar_t *);	/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvinwstr (int, int, wchar_t *);		/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvvline_set (int, int, const cchar_t *, int);	/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvwadd_wch (WINDOW *, int, int, const cchar_t *);	/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvwadd_wchnstr (WINDOW *, int, int, const cchar_t *, int); /* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvwadd_wchstr (WINDOW *, int, int, const cchar_t *);	/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvwaddnwstr (WINDOW *, int, int, const wchar_t *, int);/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvwaddwstr (WINDOW *, int, int, const wchar_t *);	/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvwget_wch (WINDOW *, int, int, wint_t *);	/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvwget_wstr (WINDOW *, int, int, wint_t *);	/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvwgetn_wstr (WINDOW *, int, int, wint_t *, int);/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvwhline_set (WINDOW *, int, int, const cchar_t *, int);/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvwin_wch (WINDOW *, int, int, cchar_t *);	/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvwin_wchnstr (WINDOW *, int,int, cchar_t *,int);	/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvwin_wchstr (WINDOW *, int, int, cchar_t *);	/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvwinnwstr (WINDOW *, int, int, wchar_t *, int);	/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvwins_nwstr (WINDOW *, int,int, const wchar_t *,int); /* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvwins_wch (WINDOW *, int, int, const cchar_t *);	/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvwins_wstr (WINDOW *, int, int, const wchar_t *);	/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvwinwstr (WINDOW *, int, int, wchar_t *);		/* generated:WIDEC */
+extern NCURSES_EXPORT(int) mvwvline_set (WINDOW *, int,int, const cchar_t *,int); /* generated:WIDEC */
+extern NCURSES_EXPORT(int) pecho_wchar (WINDOW *, const cchar_t *);	/* implemented */
+extern NCURSES_EXPORT(int) setcchar (cchar_t *, const wchar_t *, const attr_t, NCURSES_PAIRS_T, const void *);	/* implemented */
+extern NCURSES_EXPORT(int) slk_wset (int, const wchar_t *, int);	/* implemented */
+extern NCURSES_EXPORT(attr_t) term_attrs (void);			/* implemented */
+extern NCURSES_EXPORT(int) unget_wch (const wchar_t);			/* implemented */
+extern NCURSES_EXPORT(int) vid_attr (attr_t, NCURSES_PAIRS_T, void *);		/* implemented */
+extern NCURSES_EXPORT(int) vid_puts (attr_t, NCURSES_PAIRS_T, void *, NCURSES_OUTC); /* implemented */
+extern NCURSES_EXPORT(int) vline_set (const cchar_t *, int);		/* generated:WIDEC */
+extern NCURSES_EXPORT(int) wadd_wch (WINDOW *,const cchar_t *);		/* implemented */
+extern NCURSES_EXPORT(int) wadd_wchnstr (WINDOW *,const cchar_t *,int);	/* implemented */
+extern NCURSES_EXPORT(int) wadd_wchstr (WINDOW *,const cchar_t *);	/* generated:WIDEC */
+extern NCURSES_EXPORT(int) waddnwstr (WINDOW *,const wchar_t *,int);	/* implemented */
+extern NCURSES_EXPORT(int) waddwstr (WINDOW *,const wchar_t *);		/* generated:WIDEC */
+extern NCURSES_EXPORT(int) wbkgrnd (WINDOW *,const cchar_t *);		/* implemented */
+extern NCURSES_EXPORT(void) wbkgrndset (WINDOW *,const cchar_t *);	/* implemented */
+extern NCURSES_EXPORT(int) wborder_set (WINDOW *,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*);	/* implemented */
+extern NCURSES_EXPORT(int) wecho_wchar (WINDOW *, const cchar_t *);	/* implemented */
+extern NCURSES_EXPORT(int) wget_wch (WINDOW *, wint_t *);		/* implemented */
+extern NCURSES_EXPORT(int) wget_wstr (WINDOW *, wint_t *);		/* generated:WIDEC */
+extern NCURSES_EXPORT(int) wgetbkgrnd (WINDOW *, cchar_t *);		/* generated:WIDEC */
+extern NCURSES_EXPORT(int) wgetn_wstr (WINDOW *, wint_t *, int);	/* implemented */
+extern NCURSES_EXPORT(int) whline_set (WINDOW *, const cchar_t *, int);	/* implemented */
+extern NCURSES_EXPORT(int) win_wch (WINDOW *, cchar_t *);		/* implemented */
+extern NCURSES_EXPORT(int) win_wchnstr (WINDOW *, cchar_t *, int);	/* implemented */
+extern NCURSES_EXPORT(int) win_wchstr (WINDOW *, cchar_t *);		/* generated:WIDEC */
+extern NCURSES_EXPORT(int) winnwstr (WINDOW *, wchar_t *, int);		/* implemented */
+extern NCURSES_EXPORT(int) wins_nwstr (WINDOW *, const wchar_t *, int);	/* implemented */
+extern NCURSES_EXPORT(int) wins_wch (WINDOW *, const cchar_t *);	/* implemented */
+extern NCURSES_EXPORT(int) wins_wstr (WINDOW *, const wchar_t *);	/* generated:WIDEC */
+extern NCURSES_EXPORT(int) winwstr (WINDOW *, wchar_t *);		/* implemented */
+extern NCURSES_EXPORT(wchar_t*) wunctrl (cchar_t *);			/* implemented */
+extern NCURSES_EXPORT(int) wvline_set (WINDOW *, const cchar_t *, int);	/* implemented */
+
+#if NCURSES_SP_FUNCS
+extern NCURSES_EXPORT(attr_t) NCURSES_SP_NAME(term_attrs) (SCREEN*);		/* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(erasewchar) (SCREEN*, wchar_t *);	/* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(killwchar) (SCREEN*, wchar_t *);	/* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(unget_wch) (SCREEN*, const wchar_t);	/* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vid_attr) (SCREEN*, attr_t, NCURSES_PAIRS_T, void *);	/* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vid_puts) (SCREEN*, attr_t, NCURSES_PAIRS_T, void *, NCURSES_SP_OUTC);	/* implemented:SP_FUNC */
+extern NCURSES_EXPORT(wchar_t*) NCURSES_SP_NAME(wunctrl) (SCREEN*, cchar_t *);	/* implemented:SP_FUNC */
+#endif
+
+#ifndef NCURSES_NOMACROS
+
+/*
+ * XSI curses macros for XPG4 conformance.
+ */
+#define add_wch(c)			wadd_wch(stdscr,(c))
+#define add_wchnstr(str,n)		wadd_wchnstr(stdscr,(str),(n))
+#define add_wchstr(str)			wadd_wchstr(stdscr,(str))
+#define addnwstr(wstr,n)		waddnwstr(stdscr,(wstr),(n))
+#define addwstr(wstr)			waddwstr(stdscr,(wstr))
+#define bkgrnd(c)			wbkgrnd(stdscr,(c))
+#define bkgrndset(c)			wbkgrndset(stdscr,(c))
+#define border_set(l,r,t,b,tl,tr,bl,br) wborder_set(stdscr,(l),(r),(t),(b),tl,tr,bl,br)
+#define box_set(w,v,h)			wborder_set((w),(v),(v),(h),(h),0,0,0,0)
+#define echo_wchar(c)			wecho_wchar(stdscr,(c))
+#define get_wch(c)			wget_wch(stdscr,(c))
+#define get_wstr(t)			wget_wstr(stdscr,(t))
+#define getbkgrnd(wch)			wgetbkgrnd(stdscr,(wch))
+#define getn_wstr(t,n)			wgetn_wstr(stdscr,(t),(n))
+#define hline_set(c,n)			whline_set(stdscr,(c),(n))
+#define in_wch(c)			win_wch(stdscr,(c))
+#define in_wchnstr(c,n)			win_wchnstr(stdscr,(c),(n))
+#define in_wchstr(c)			win_wchstr(stdscr,(c))
+#define innwstr(c,n)			winnwstr(stdscr,(c),(n))
+#define ins_nwstr(t,n)			wins_nwstr(stdscr,(t),(n))
+#define ins_wch(c)			wins_wch(stdscr,(c))
+#define ins_wstr(t)			wins_wstr(stdscr,(t))
+#define inwstr(c)			winwstr(stdscr,(c))
+#define vline_set(c,n)			wvline_set(stdscr,(c),(n))
+#define wadd_wchstr(win,str)		wadd_wchnstr((win),(str),-1)
+#define waddwstr(win,wstr)		waddnwstr((win),(wstr),-1)
+#define wget_wstr(w,t)			wgetn_wstr((w),(t),-1)
+#define win_wchstr(w,c)			win_wchnstr((w),(c),-1)
+#define wins_wstr(w,t)			wins_nwstr((w),(t),-1)
+
+#if !NCURSES_OPAQUE
+#define wgetbkgrnd(win,wch)		(NCURSES_OK_ADDR(wch) ? ((win) ? (*(wch) = (win)->_bkgrnd) : *(wch), OK) : ERR)
+#endif
+
+#define mvadd_wch(y,x,c)		mvwadd_wch(stdscr,(y),(x),(c))
+#define mvadd_wchnstr(y,x,s,n)		mvwadd_wchnstr(stdscr,(y),(x),(s),(n))
+#define mvadd_wchstr(y,x,s)		mvwadd_wchstr(stdscr,(y),(x),(s))
+#define mvaddnwstr(y,x,wstr,n)		mvwaddnwstr(stdscr,(y),(x),(wstr),(n))
+#define mvaddwstr(y,x,wstr)		mvwaddwstr(stdscr,(y),(x),(wstr))
+#define mvget_wch(y,x,c)		mvwget_wch(stdscr,(y),(x),(c))
+#define mvget_wstr(y,x,t)		mvwget_wstr(stdscr,(y),(x),(t))
+#define mvgetn_wstr(y,x,t,n)		mvwgetn_wstr(stdscr,(y),(x),(t),(n))
+#define mvhline_set(y,x,c,n)		mvwhline_set(stdscr,(y),(x),(c),(n))
+#define mvin_wch(y,x,c)			mvwin_wch(stdscr,(y),(x),(c))
+#define mvin_wchnstr(y,x,c,n)		mvwin_wchnstr(stdscr,(y),(x),(c),(n))
+#define mvin_wchstr(y,x,c)		mvwin_wchstr(stdscr,(y),(x),(c))
+#define mvinnwstr(y,x,c,n)		mvwinnwstr(stdscr,(y),(x),(c),(n))
+#define mvins_nwstr(y,x,t,n)		mvwins_nwstr(stdscr,(y),(x),(t),(n))
+#define mvins_wch(y,x,c)		mvwins_wch(stdscr,(y),(x),(c))
+#define mvins_wstr(y,x,t)		mvwins_wstr(stdscr,(y),(x),(t))
+#define mvinwstr(y,x,c)			mvwinwstr(stdscr,(y),(x),(c))
+#define mvvline_set(y,x,c,n)		mvwvline_set(stdscr,(y),(x),(c),(n))
+
+#define mvwadd_wch(win,y,x,c)		(wmove(win,(y),(x)) == ERR ? ERR : wadd_wch((win),(c)))
+#define mvwadd_wchnstr(win,y,x,s,n)	(wmove(win,(y),(x)) == ERR ? ERR : wadd_wchnstr((win),(s),(n)))
+#define mvwadd_wchstr(win,y,x,s)	(wmove(win,(y),(x)) == ERR ? ERR : wadd_wchstr((win),(s)))
+#define mvwaddnwstr(win,y,x,wstr,n)	(wmove(win,(y),(x)) == ERR ? ERR : waddnwstr((win),(wstr),(n)))
+#define mvwaddwstr(win,y,x,wstr)	(wmove(win,(y),(x)) == ERR ? ERR : waddwstr((win),(wstr)))
+#define mvwget_wch(win,y,x,c)		(wmove(win,(y),(x)) == ERR ? ERR : wget_wch((win),(c)))
+#define mvwget_wstr(win,y,x,t)		(wmove(win,(y),(x)) == ERR ? ERR : wget_wstr((win),(t)))
+#define mvwgetn_wstr(win,y,x,t,n)	(wmove(win,(y),(x)) == ERR ? ERR : wgetn_wstr((win),(t),(n)))
+#define mvwhline_set(win,y,x,c,n)	(wmove(win,(y),(x)) == ERR ? ERR : whline_set((win),(c),(n)))
+#define mvwin_wch(win,y,x,c)		(wmove(win,(y),(x)) == ERR ? ERR : win_wch((win),(c)))
+#define mvwin_wchnstr(win,y,x,c,n)	(wmove(win,(y),(x)) == ERR ? ERR : win_wchnstr((win),(c),(n)))
+#define mvwin_wchstr(win,y,x,c)		(wmove(win,(y),(x)) == ERR ? ERR : win_wchstr((win),(c)))
+#define mvwinnwstr(win,y,x,c,n)		(wmove(win,(y),(x)) == ERR ? ERR : winnwstr((win),(c),(n)))
+#define mvwins_nwstr(win,y,x,t,n)	(wmove(win,(y),(x)) == ERR ? ERR : wins_nwstr((win),(t),(n)))
+#define mvwins_wch(win,y,x,c)		(wmove(win,(y),(x)) == ERR ? ERR : wins_wch((win),(c)))
+#define mvwins_wstr(win,y,x,t)		(wmove(win,(y),(x)) == ERR ? ERR : wins_wstr((win),(t)))
+#define mvwinwstr(win,y,x,c)		(wmove(win,(y),(x)) == ERR ? ERR : winwstr((win),(c)))
+#define mvwvline_set(win,y,x,c,n)	(wmove(win,(y),(x)) == ERR ? ERR : wvline_set((win),(c),(n)))
+
+#endif /* NCURSES_NOMACROS */
+
+#if defined(TRACE) || defined(NCURSES_TEST)
+extern NCURSES_EXPORT(const char *) _nc_viswbuf(const wchar_t *);
+extern NCURSES_EXPORT(const char *) _nc_viswibuf(const wint_t *);
+#endif
+
+#endif /* NCURSES_WIDECHAR */
+/* $Id: curses.tail,v 1.27 2023/08/05 19:43:46 tom Exp $ */
+/*
+ * vile:cmode:
+ * This file is part of ncurses, designed to be appended after curses.h.in
+ * (see that file for the relevant copyright).
+ */
+
+/* mouse interface */
+
+#if NCURSES_MOUSE_VERSION > 1
+#define NCURSES_MOUSE_MASK(b,m) ((m) << (((b) - 1) * 5))
+#else
+#define NCURSES_MOUSE_MASK(b,m) ((m) << (((b) - 1) * 6))
+#endif
+
+#define	NCURSES_BUTTON_RELEASED	001UL
+#define	NCURSES_BUTTON_PRESSED	002UL
+#define	NCURSES_BUTTON_CLICKED	004UL
+#define	NCURSES_DOUBLE_CLICKED	010UL
+#define	NCURSES_TRIPLE_CLICKED	020UL
+#define	NCURSES_RESERVED_EVENT	040UL
+
+/* event masks */
+#define	BUTTON1_RELEASED	NCURSES_MOUSE_MASK(1, NCURSES_BUTTON_RELEASED)
+#define	BUTTON1_PRESSED		NCURSES_MOUSE_MASK(1, NCURSES_BUTTON_PRESSED)
+#define	BUTTON1_CLICKED		NCURSES_MOUSE_MASK(1, NCURSES_BUTTON_CLICKED)
+#define	BUTTON1_DOUBLE_CLICKED	NCURSES_MOUSE_MASK(1, NCURSES_DOUBLE_CLICKED)
+#define	BUTTON1_TRIPLE_CLICKED	NCURSES_MOUSE_MASK(1, NCURSES_TRIPLE_CLICKED)
+
+#define	BUTTON2_RELEASED	NCURSES_MOUSE_MASK(2, NCURSES_BUTTON_RELEASED)
+#define	BUTTON2_PRESSED		NCURSES_MOUSE_MASK(2, NCURSES_BUTTON_PRESSED)
+#define	BUTTON2_CLICKED		NCURSES_MOUSE_MASK(2, NCURSES_BUTTON_CLICKED)
+#define	BUTTON2_DOUBLE_CLICKED	NCURSES_MOUSE_MASK(2, NCURSES_DOUBLE_CLICKED)
+#define	BUTTON2_TRIPLE_CLICKED	NCURSES_MOUSE_MASK(2, NCURSES_TRIPLE_CLICKED)
+
+#define	BUTTON3_RELEASED	NCURSES_MOUSE_MASK(3, NCURSES_BUTTON_RELEASED)
+#define	BUTTON3_PRESSED		NCURSES_MOUSE_MASK(3, NCURSES_BUTTON_PRESSED)
+#define	BUTTON3_CLICKED		NCURSES_MOUSE_MASK(3, NCURSES_BUTTON_CLICKED)
+#define	BUTTON3_DOUBLE_CLICKED	NCURSES_MOUSE_MASK(3, NCURSES_DOUBLE_CLICKED)
+#define	BUTTON3_TRIPLE_CLICKED	NCURSES_MOUSE_MASK(3, NCURSES_TRIPLE_CLICKED)
+
+#define	BUTTON4_RELEASED	NCURSES_MOUSE_MASK(4, NCURSES_BUTTON_RELEASED)
+#define	BUTTON4_PRESSED		NCURSES_MOUSE_MASK(4, NCURSES_BUTTON_PRESSED)
+#define	BUTTON4_CLICKED		NCURSES_MOUSE_MASK(4, NCURSES_BUTTON_CLICKED)
+#define	BUTTON4_DOUBLE_CLICKED	NCURSES_MOUSE_MASK(4, NCURSES_DOUBLE_CLICKED)
+#define	BUTTON4_TRIPLE_CLICKED	NCURSES_MOUSE_MASK(4, NCURSES_TRIPLE_CLICKED)
+
+/*
+ * In 32 bits the version-1 scheme does not provide enough space for a 5th
+ * button, unless we choose to change the ABI by omitting the reserved-events.
+ */
+#if NCURSES_MOUSE_VERSION > 1
+
+#define	BUTTON5_RELEASED	NCURSES_MOUSE_MASK(5, NCURSES_BUTTON_RELEASED)
+#define	BUTTON5_PRESSED		NCURSES_MOUSE_MASK(5, NCURSES_BUTTON_PRESSED)
+#define	BUTTON5_CLICKED		NCURSES_MOUSE_MASK(5, NCURSES_BUTTON_CLICKED)
+#define	BUTTON5_DOUBLE_CLICKED	NCURSES_MOUSE_MASK(5, NCURSES_DOUBLE_CLICKED)
+#define	BUTTON5_TRIPLE_CLICKED	NCURSES_MOUSE_MASK(5, NCURSES_TRIPLE_CLICKED)
+
+#define	BUTTON_CTRL		NCURSES_MOUSE_MASK(6, 0001L)
+#define	BUTTON_SHIFT		NCURSES_MOUSE_MASK(6, 0002L)
+#define	BUTTON_ALT		NCURSES_MOUSE_MASK(6, 0004L)
+#define	REPORT_MOUSE_POSITION	NCURSES_MOUSE_MASK(6, 0010L)
+
+#else
+
+#define	BUTTON1_RESERVED_EVENT	NCURSES_MOUSE_MASK(1, NCURSES_RESERVED_EVENT)
+#define	BUTTON2_RESERVED_EVENT	NCURSES_MOUSE_MASK(2, NCURSES_RESERVED_EVENT)
+#define	BUTTON3_RESERVED_EVENT	NCURSES_MOUSE_MASK(3, NCURSES_RESERVED_EVENT)
+#define	BUTTON4_RESERVED_EVENT	NCURSES_MOUSE_MASK(4, NCURSES_RESERVED_EVENT)
+
+#define	BUTTON_CTRL		NCURSES_MOUSE_MASK(5, 0001L)
+#define	BUTTON_SHIFT		NCURSES_MOUSE_MASK(5, 0002L)
+#define	BUTTON_ALT		NCURSES_MOUSE_MASK(5, 0004L)
+#define	REPORT_MOUSE_POSITION	NCURSES_MOUSE_MASK(5, 0010L)
+
+#endif
+
+#define	ALL_MOUSE_EVENTS	(REPORT_MOUSE_POSITION - 1)
+
+/* macros to extract single event-bits from masks */
+#define	BUTTON_RELEASE(e, x)		((e) & NCURSES_MOUSE_MASK(x, 001))
+#define	BUTTON_PRESS(e, x)		((e) & NCURSES_MOUSE_MASK(x, 002))
+#define	BUTTON_CLICK(e, x)		((e) & NCURSES_MOUSE_MASK(x, 004))
+#define	BUTTON_DOUBLE_CLICK(e, x)	((e) & NCURSES_MOUSE_MASK(x, 010))
+#define	BUTTON_TRIPLE_CLICK(e, x)	((e) & NCURSES_MOUSE_MASK(x, 020))
+#define	BUTTON_RESERVED_EVENT(e, x)	((e) & NCURSES_MOUSE_MASK(x, 040))
+
+typedef struct
+{
+    short id;		/* ID to distinguish multiple devices */
+    int x, y, z;	/* event coordinates (character-cell) */
+    mmask_t bstate;	/* button state bits */
+}
+MEVENT;
+
+extern NCURSES_EXPORT(bool)    has_mouse(void);
+extern NCURSES_EXPORT(int)     getmouse (MEVENT *);
+extern NCURSES_EXPORT(int)     ungetmouse (MEVENT *);
+extern NCURSES_EXPORT(mmask_t) mousemask (mmask_t, mmask_t *);
+extern NCURSES_EXPORT(bool)    wenclose (const WINDOW *, int, int);
+extern NCURSES_EXPORT(int)     mouseinterval (int);
+extern NCURSES_EXPORT(bool)    wmouse_trafo (const WINDOW*, int*, int*, bool);
+extern NCURSES_EXPORT(bool)    mouse_trafo (int*, int*, bool);              /* generated */
+
+#if NCURSES_SP_FUNCS
+extern NCURSES_EXPORT(bool)    NCURSES_SP_NAME(has_mouse) (SCREEN*);
+extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(getmouse) (SCREEN*, MEVENT *);
+extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(ungetmouse) (SCREEN*,MEVENT *);
+extern NCURSES_EXPORT(mmask_t) NCURSES_SP_NAME(mousemask) (SCREEN*, mmask_t, mmask_t *);
+extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(mouseinterval) (SCREEN*, int);
+#endif
+
+#ifndef NCURSES_NOMACROS
+#define mouse_trafo(y,x,to_screen) wmouse_trafo(stdscr,y,x,to_screen)
+#endif
+
+/* other non-XSI functions */
+
+extern NCURSES_EXPORT(int) mcprint (char *, int);	/* direct data to printer */
+extern NCURSES_EXPORT(int) has_key (int);		/* do we have given key? */
+
+#if NCURSES_SP_FUNCS
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(has_key) (SCREEN*, int);    /* do we have given key? */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(mcprint) (SCREEN*, char *, int);	/* direct data to printer */
+#endif
+
+/* Debugging : use with libncurses_g.a */
+
+extern NCURSES_EXPORT(void) _tracef (const char *, ...) GCC_PRINTFLIKE(1,2);
+extern NCURSES_EXPORT(char *) _traceattr (attr_t);
+extern NCURSES_EXPORT(char *) _traceattr2 (int, chtype);
+extern NCURSES_EXPORT(char *) _tracechar (int);
+extern NCURSES_EXPORT(char *) _tracechtype (chtype);
+extern NCURSES_EXPORT(char *) _tracechtype2 (int, chtype);
+#if NCURSES_WIDECHAR
+#define _tracech_t		_tracecchar_t
+extern NCURSES_EXPORT(char *) _tracecchar_t (const cchar_t *);
+#define _tracech_t2		_tracecchar_t2
+extern NCURSES_EXPORT(char *) _tracecchar_t2 (int, const cchar_t *);
+#else
+#define _tracech_t		_tracechtype
+#define _tracech_t2		_tracechtype2
+#endif
+extern NCURSES_EXPORT(void) trace (const unsigned) GCC_DEPRECATED("use curses_trace");
+extern NCURSES_EXPORT(unsigned) curses_trace (const unsigned);
+
+/* trace masks */
+#define TRACE_DISABLE	0x0000	/* turn off tracing */
+#define TRACE_TIMES	0x0001	/* trace user and system times of updates */
+#define TRACE_TPUTS	0x0002	/* trace tputs calls */
+#define TRACE_UPDATE	0x0004	/* trace update actions, old & new screens */
+#define TRACE_MOVE	0x0008	/* trace cursor moves and scrolls */
+#define TRACE_CHARPUT	0x0010	/* trace all character outputs */
+#define TRACE_ORDINARY	0x001F	/* trace all update actions */
+#define TRACE_CALLS	0x0020	/* trace all curses calls */
+#define TRACE_VIRTPUT	0x0040	/* trace virtual character puts */
+#define TRACE_IEVENT	0x0080	/* trace low-level input processing */
+#define TRACE_BITS	0x0100	/* trace state of TTY control bits */
+#define TRACE_ICALLS	0x0200	/* trace internal/nested calls */
+#define TRACE_CCALLS	0x0400	/* trace per-character calls */
+#define TRACE_DATABASE	0x0800	/* trace read/write of terminfo/termcap data */
+#define TRACE_ATTRS	0x1000	/* trace attribute updates */
+
+#define TRACE_SHIFT	13	/* number of bits in the trace masks */
+#define TRACE_MAXIMUM	((1 << TRACE_SHIFT) - 1) /* maximum trace level */
+
+#if defined(TRACE) || defined(NCURSES_TEST)
+extern NCURSES_EXPORT_VAR(int) _nc_optimize_enable;		/* enable optimizations */
+extern NCURSES_EXPORT(const char *) _nc_visbuf (const char *);
+#define OPTIMIZE_MVCUR		0x01	/* cursor movement optimization */
+#define OPTIMIZE_HASHMAP	0x02	/* diff hashing to detect scrolls */
+#define OPTIMIZE_SCROLL		0x04	/* scroll optimization */
+#define OPTIMIZE_ALL		0xff	/* enable all optimizations (dflt) */
+#endif
+
+extern GCC_NORETURN NCURSES_EXPORT(void) exit_curses (int);
+
+#include <unctrl.h>
+
+#ifdef __cplusplus
+
+#ifndef NCURSES_NOMACROS
+
+/* these names conflict with STL */
+#undef box
+#undef clear
+#undef erase
+#undef move
+#undef refresh
+
+#endif /* NCURSES_NOMACROS */
+
+}
+#endif
+
+#endif /* __NCURSES_H */
diff --git a/include/curses.head b/include/curses.head
new file mode 100644
index 0000000..49950c9
--- /dev/null
+++ b/include/curses.head
@@ -0,0 +1,1535 @@
+/****************************************************************************
+ * Copyright 2018-2023,2024 Thomas E. Dickey                                *
+ * Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
+ *                                                                          *
+ * Permission is hereby granted, free of charge, to any person obtaining a  *
+ * 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: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
+ *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Thomas E. Dickey                        1996-on                 *
+ ****************************************************************************/
+
+/* $Id: curses.h.in,v 1.282 2024/01/19 11:50:07 tom Exp $ */
+
+#ifndef __NCURSES_H
+#define __NCURSES_H
+
+/*
+ The symbols beginning NCURSES_ or USE_ are configuration choices.
+ A few of the former can be overridden by applications at compile-time.
+ Most of the others correspond to configure-script options (or checks
+ by the configure-script for features of the system on which it is built).
+
+ These symbols can be overridden by applications at compile-time:
+ NCURSES_NOMACROS suppresses macro definitions in favor of functions
+ NCURSES_WATTR_MACROS suppresses wattr_* macro definitions
+ NCURSES_WIDECHAR is an alternative for declaring wide-character functions.
+
+ These symbols are used only when building ncurses:
+ NCURSES_ATTR_T
+ NCURSES_FIELD_INTERNALS
+ NCURSES_INTERNALS
+
+ These symbols are set by the configure script:
+ NCURSES_ENABLE_STDBOOL_H
+ NCURSES_EXPANDED
+ NCURSES_EXT_COLORS
+ NCURSES_EXT_FUNCS
+ NCURSES_EXT_PUTWIN
+ NCURSES_NO_PADDING
+ NCURSES_OSPEED_COMPAT
+ NCURSES_PATHSEP
+ NCURSES_REENTRANT
+ NCURSES_SIGWINCH
+ */
+
+#define CURSES 1
+#define CURSES_H 1
+
+/* These are defined only in curses.h, and are used for conditional compiles */
+#define NCURSES_VERSION_MAJOR 6
+#define NCURSES_VERSION_MINOR 5
+#define NCURSES_VERSION_PATCH 20240427
+
+/* This is defined in more than one ncurses header, for identification */
+#undef  NCURSES_VERSION
+#define NCURSES_VERSION "6.5"
+
+/*
+ * Identify the mouse encoding version.
+ */
+#define NCURSES_MOUSE_VERSION 2
+
+/*
+ * Definitions to facilitate DLL's.
+ */
+#include <ncurses_dll.h>
+
+/*
+ * Extra headers.
+ */
+#if 1
+#include <stdint.h>
+#endif
+
+#ifdef __cplusplus
+#else
+#if 0
+#include <stdnoreturn.h>
+#undef GCC_NORETURN
+#define GCC_NORETURN _Noreturn
+#endif
+#endif
+
+/*
+ * User-definable tweak to disable the include of <stdbool.h>.
+ */
+#ifndef NCURSES_ENABLE_STDBOOL_H
+#define NCURSES_ENABLE_STDBOOL_H 1
+#endif
+
+/*
+ * NCURSES_ATTR_T is used to quiet compiler warnings when building ncurses
+ * configured using --disable-macros.
+ */
+#ifndef NCURSES_ATTR_T
+#define NCURSES_ATTR_T int
+#endif
+
+/*
+ * Expands to 'const' if ncurses is configured using --enable-const.  Note that
+ * doing so makes it incompatible with other implementations of X/Open Curses.
+ */
+#undef  NCURSES_CONST
+#define NCURSES_CONST const
+
+#undef NCURSES_INLINE
+#define NCURSES_INLINE inline
+
+/*
+ * The standard type used for color values, and for color-pairs.  The latter
+ * allows the curses library to enumerate the combinations of foreground and
+ * background colors used by an application, and is normally the product of the
+ * total foreground and background colors.
+ *
+ * X/Open uses "short" for both of these types, ultimately because they are
+ * numbers from the SVr4 terminal database, which uses 16-bit signed values.
+ */
+#undef	NCURSES_COLOR_T
+#define	NCURSES_COLOR_T short
+
+#undef	NCURSES_PAIRS_T
+#define	NCURSES_PAIRS_T short
+
+/*
+ * Definitions used to make WINDOW and similar structs opaque.
+ */
+#ifndef NCURSES_INTERNALS
+#define NCURSES_OPAQUE       1
+#define NCURSES_OPAQUE_FORM  1
+#define NCURSES_OPAQUE_MENU  1
+#define NCURSES_OPAQUE_PANEL 1
+#endif
+
+/*
+ * Definition used to optionally suppress wattr* macros to help with the
+ * transition from ncurses5 to ncurses6 by allowing the header files to
+ * be shared across development packages for ncursesw in both ABIs.
+ */
+#ifndef NCURSES_WATTR_MACROS
+#define NCURSES_WATTR_MACROS 0
+#endif
+
+/*
+ * The reentrant code relies on the opaque setting, but adds features.
+ */
+#ifndef NCURSES_REENTRANT
+#define NCURSES_REENTRANT 0
+#endif
+
+/*
+ * KEY_RESIZE is an extended feature that relies upon the SIGWINCH handler
+ * in ncurses.
+ */
+#if 1
+#ifndef NCURSES_SIGWINCH
+#define NCURSES_SIGWINCH 1
+#endif
+#else
+#undef NCURSES_SIGWINCH
+#define NCURSES_SIGWINCH 0
+#endif
+
+/*
+ * In certain environments, we must work around linker problems for data
+ */
+#undef NCURSES_BROKEN_LINKER
+#if 0
+#define NCURSES_BROKEN_LINKER 1
+#endif
+
+/*
+ * Control whether bindings for interop support are added.
+ */
+#undef	NCURSES_INTEROP_FUNCS
+#define	NCURSES_INTEROP_FUNCS 1
+
+/*
+ * The internal type used for window dimensions.
+ */
+#undef	NCURSES_SIZE_T
+#define	NCURSES_SIZE_T short
+
+/*
+ * Control whether tparm() supports varargs or fixed-parameter list.
+ */
+#undef NCURSES_TPARM_VARARGS
+#define NCURSES_TPARM_VARARGS 1
+
+/*
+ * Control type used for tparm's arguments.  While X/Open equates long and
+ * char* values, this is not always workable for 64-bit platforms.
+ */
+#undef NCURSES_TPARM_ARG
+#define NCURSES_TPARM_ARG intptr_t
+
+/*
+ * Control whether ncurses uses wcwidth() for checking width of line-drawing
+ * characters.
+ */
+#undef NCURSES_WCWIDTH_GRAPHICS
+#define NCURSES_WCWIDTH_GRAPHICS 1
+
+/*
+ * NCURSES_CH_T is used in building the library, but not used otherwise in
+ * this header file, since that would make the normal/wide-character versions
+ * of the header incompatible.
+ */
+#undef	NCURSES_CH_T
+#define NCURSES_CH_T cchar_t
+
+#if 1 && defined(_LP64)
+typedef unsigned chtype;
+typedef unsigned mmask_t;
+#else
+typedef uint32_t chtype;
+typedef uint32_t mmask_t;
+#endif
+
+/*
+ * We need FILE, etc.  Include this before checking any feature symbols.
+ */
+#include <stdio.h>
+
+/*
+ * With XPG4, you must define _XOPEN_SOURCE_EXTENDED, it is redundant (or
+ * conflicting) when _XOPEN_SOURCE is 500 or greater.  If NCURSES_WIDECHAR is
+ * not already defined, e.g., if the platform relies upon nonstandard feature
+ * test macros, define it at this point if the standard feature test macros
+ * indicate that it should be defined.
+ */
+#ifndef NCURSES_WIDECHAR
+#if defined(_XOPEN_SOURCE_EXTENDED) || (defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE - 0 >= 500))
+#define NCURSES_WIDECHAR 1
+#else
+#define NCURSES_WIDECHAR 0
+#endif
+#endif /* NCURSES_WIDECHAR */
+
+#include <stdarg.h>	/* we need va_list */
+#if NCURSES_WIDECHAR
+#include <stddef.h>	/* we want wchar_t */
+#endif
+
+/* X/Open and SVr4 specify that curses implements 'bool'.  However, C++ may also
+ * implement it.  If so, we must use the C++ compiler's type to avoid conflict
+ * with other interfaces.
+ *
+ * A further complication is that <stdbool.h> may declare 'bool' to be a
+ * different type, such as an enum which is not necessarily compatible with
+ * C++.  If we have <stdbool.h>, make 'bool' a macro, so users may #undef it.
+ * Otherwise, let it remain a typedef to avoid conflicts with other #define's.
+ * In either case, make a typedef for NCURSES_BOOL which can be used if needed
+ * from either C or C++.
+ */
+
+#undef TRUE
+#define TRUE    1
+
+#undef FALSE
+#define FALSE   0
+
+typedef unsigned char NCURSES_BOOL;
+
+#if defined(__cplusplus)	/* __cplusplus, etc. */
+
+/* use the C++ compiler's bool type */
+#define NCURSES_BOOL bool
+
+#else			/* c89, c99, etc. */
+
+#if NCURSES_ENABLE_STDBOOL_H
+#include <stdbool.h>
+/* use whatever the C compiler decides bool really is */
+#define NCURSES_BOOL bool
+#else
+/* there is no predefined bool - use our own */
+#undef bool
+#define bool NCURSES_BOOL
+#endif
+
+#endif /* !__cplusplus, etc. */
+
+#ifdef __cplusplus
+extern "C" {
+#define NCURSES_CAST(type,value) static_cast<type>(value)
+#else
+#define NCURSES_CAST(type,value) (type)(value)
+#endif
+
+#define NCURSES_OK_ADDR(p) (0 != NCURSES_CAST(const void *, (p)))
+
+/*
+ * X/Open attributes.  In the ncurses implementation, they are identical to the
+ * A_ attributes.
+ */
+#define WA_ATTRIBUTES	A_ATTRIBUTES
+#define WA_NORMAL	A_NORMAL
+#define WA_STANDOUT	A_STANDOUT
+#define WA_UNDERLINE	A_UNDERLINE
+#define WA_REVERSE	A_REVERSE
+#define WA_BLINK	A_BLINK
+#define WA_DIM		A_DIM
+#define WA_BOLD		A_BOLD
+#define WA_ALTCHARSET	A_ALTCHARSET
+#define WA_INVIS	A_INVIS
+#define WA_PROTECT	A_PROTECT
+#define WA_HORIZONTAL	A_HORIZONTAL
+#define WA_LEFT		A_LEFT
+#define WA_LOW		A_LOW
+#define WA_RIGHT	A_RIGHT
+#define WA_TOP		A_TOP
+#define WA_VERTICAL	A_VERTICAL
+
+#if 1
+#define WA_ITALIC	A_ITALIC	/* ncurses extension */
+#endif
+
+/* colors */
+#define COLOR_BLACK	0
+#define COLOR_RED	1
+#define COLOR_GREEN	2
+#define COLOR_YELLOW	3
+#define COLOR_BLUE	4
+#define COLOR_MAGENTA	5
+#define COLOR_CYAN	6
+#define COLOR_WHITE	7
+
+/* line graphics */
+
+#if 0 || NCURSES_REENTRANT
+NCURSES_WRAPPED_VAR(chtype*, acs_map);
+#define acs_map NCURSES_PUBLIC_VAR(acs_map())
+#else
+extern NCURSES_EXPORT_VAR(chtype) acs_map[];
+#endif
+
+#define NCURSES_ACS(c)	(acs_map[NCURSES_CAST(unsigned char,(c))])
+
+/* VT100 symbols begin here */
+#define ACS_ULCORNER	NCURSES_ACS('l') /* upper left corner */
+#define ACS_LLCORNER	NCURSES_ACS('m') /* lower left corner */
+#define ACS_URCORNER	NCURSES_ACS('k') /* upper right corner */
+#define ACS_LRCORNER	NCURSES_ACS('j') /* lower right corner */
+#define ACS_LTEE	NCURSES_ACS('t') /* tee pointing right */
+#define ACS_RTEE	NCURSES_ACS('u') /* tee pointing left */
+#define ACS_BTEE	NCURSES_ACS('v') /* tee pointing up */
+#define ACS_TTEE	NCURSES_ACS('w') /* tee pointing down */
+#define ACS_HLINE	NCURSES_ACS('q') /* horizontal line */
+#define ACS_VLINE	NCURSES_ACS('x') /* vertical line */
+#define ACS_PLUS	NCURSES_ACS('n') /* large plus or crossover */
+#define ACS_S1		NCURSES_ACS('o') /* scan line 1 */
+#define ACS_S9		NCURSES_ACS('s') /* scan line 9 */
+#define ACS_DIAMOND	NCURSES_ACS('`') /* diamond */
+#define ACS_CKBOARD	NCURSES_ACS('a') /* checker board (stipple) */
+#define ACS_DEGREE	NCURSES_ACS('f') /* degree symbol */
+#define ACS_PLMINUS	NCURSES_ACS('g') /* plus/minus */
+#define ACS_BULLET	NCURSES_ACS('~') /* bullet */
+/* Teletype 5410v1 symbols begin here */
+#define ACS_LARROW	NCURSES_ACS(',') /* arrow pointing left */
+#define ACS_RARROW	NCURSES_ACS('+') /* arrow pointing right */
+#define ACS_DARROW	NCURSES_ACS('.') /* arrow pointing down */
+#define ACS_UARROW	NCURSES_ACS('-') /* arrow pointing up */
+#define ACS_BOARD	NCURSES_ACS('h') /* board of squares */
+#define ACS_LANTERN	NCURSES_ACS('i') /* lantern symbol */
+#define ACS_BLOCK	NCURSES_ACS('0') /* solid square block */
+/*
+ * These aren't documented, but a lot of System Vs have them anyway
+ * (you can spot pprryyzz{{||}} in a lot of AT&T terminfo strings).
+ * The ACS_names may not match AT&T's, our source didn't know them.
+ */
+#define ACS_S3		NCURSES_ACS('p') /* scan line 3 */
+#define ACS_S7		NCURSES_ACS('r') /* scan line 7 */
+#define ACS_LEQUAL	NCURSES_ACS('y') /* less/equal */
+#define ACS_GEQUAL	NCURSES_ACS('z') /* greater/equal */
+#define ACS_PI		NCURSES_ACS('{') /* Pi */
+#define ACS_NEQUAL	NCURSES_ACS('|') /* not equal */
+#define ACS_STERLING	NCURSES_ACS('}') /* UK pound sign */
+
+/*
+ * Line drawing ACS names are of the form ACS_trbl, where t is the top, r
+ * is the right, b is the bottom, and l is the left.  t, r, b, and l might
+ * be B (blank), S (single), D (double), or T (thick).  The subset defined
+ * here only uses B and S.
+ */
+#define ACS_BSSB	ACS_ULCORNER
+#define ACS_SSBB	ACS_LLCORNER
+#define ACS_BBSS	ACS_URCORNER
+#define ACS_SBBS	ACS_LRCORNER
+#define ACS_SBSS	ACS_RTEE
+#define ACS_SSSB	ACS_LTEE
+#define ACS_SSBS	ACS_BTEE
+#define ACS_BSSS	ACS_TTEE
+#define ACS_BSBS	ACS_HLINE
+#define ACS_SBSB	ACS_VLINE
+#define ACS_SSSS	ACS_PLUS
+
+#undef	ERR
+#define ERR     (-1)
+
+#undef	OK
+#define OK      (0)
+
+/* values for the _flags member */
+#define _SUBWIN         0x01	/* is this a sub-window? */
+#define _ENDLINE        0x02	/* is the window flush right? */
+#define _FULLWIN        0x04	/* is the window full-screen? */
+#define _SCROLLWIN      0x08	/* bottom edge is at screen bottom? */
+#define _ISPAD	        0x10	/* is this window a pad? */
+#define _HASMOVED       0x20	/* has cursor moved since last refresh? */
+#define _WRAPPED        0x40	/* cursor was just wrappped */
+
+/*
+ * this value is used in the firstchar and lastchar fields to mark
+ * unchanged lines
+ */
+#define _NOCHANGE       -1
+
+/*
+ * this value is used in the oldindex field to mark lines created by insertions
+ * and scrolls.
+ */
+#define _NEWINDEX	-1
+
+#ifdef NCURSES_INTERNALS
+#undef SCREEN
+#define SCREEN struct screen
+SCREEN;
+#else
+typedef struct screen  SCREEN;
+#endif
+
+typedef struct _win_st WINDOW;
+
+typedef	chtype	attr_t;		/* ...must be at least as wide as chtype */
+
+#if NCURSES_WIDECHAR
+
+#if 0
+#ifdef mblen			/* libutf8.h defines it w/o undefining first */
+#undef mblen
+#endif
+#include <libutf8.h>
+#endif
+
+#if 1
+#include <wchar.h>		/* ...to get mbstate_t, etc. */
+#endif
+
+#if 0
+typedef unsigned short wchar_t1;
+#endif
+
+#if 0
+typedef unsigned int wint_t1;
+#endif
+
+/*
+ * cchar_t stores an array of CCHARW_MAX wide characters.  The first is
+ * normally a spacing character.  The others are non-spacing.  If those
+ * (spacing and nonspacing) do not fill the array, a null L'\0' follows.
+ * Otherwise, a null is assumed to follow when extracting via getcchar().
+ */
+#define CCHARW_MAX	5
+typedef struct
+{
+    attr_t	attr;
+    wchar_t	chars[CCHARW_MAX];
+#if 1
+#undef NCURSES_EXT_COLORS
+#define NCURSES_EXT_COLORS 20240427
+    int		ext_color;	/* color pair, must be more than 16-bits */
+#endif
+}
+cchar_t;
+
+#endif /* NCURSES_WIDECHAR */
+
+#if !NCURSES_OPAQUE
+struct ldat;
+
+struct _win_st
+{
+	NCURSES_SIZE_T _cury, _curx; /* current cursor position */
+
+	/* window location and size */
+	NCURSES_SIZE_T _maxy, _maxx; /* maximums of x and y, NOT window size */
+	NCURSES_SIZE_T _begy, _begx; /* screen coords of upper-left-hand corner */
+
+	short   _flags;		/* window state flags */
+
+	/* attribute tracking */
+	attr_t  _attrs;		/* current attribute for non-space character */
+	chtype  _bkgd;		/* current background char/attribute pair */
+
+	/* option values set by user */
+	bool	_notimeout;	/* no time out on function-key entry? */
+	bool	_clear;		/* consider all data in the window invalid? */
+	bool	_leaveok;	/* OK to not reset cursor on exit? */
+	bool	_scroll;	/* OK to scroll this window? */
+	bool	_idlok;		/* OK to use insert/delete line? */
+	bool	_idcok;		/* OK to use insert/delete char? */
+	bool	_immed;		/* window in immed mode? (not yet used) */
+	bool	_sync;		/* window in sync mode? */
+	bool	_use_keypad;	/* process function keys into KEY_ symbols? */
+	int	_delay;		/* 0 = nodelay, <0 = blocking, >0 = delay */
+
+	struct ldat *_line;	/* the actual line data */
+
+	/* global screen state */
+	NCURSES_SIZE_T _regtop;	/* top line of scrolling region */
+	NCURSES_SIZE_T _regbottom; /* bottom line of scrolling region */
+
+	/* these are used only if this is a sub-window */
+	int	_parx;		/* x coordinate of this window in parent */
+	int	_pary;		/* y coordinate of this window in parent */
+	WINDOW	*_parent;	/* pointer to parent if a sub-window */
+
+	/* these are used only if this is a pad */
+	struct pdat
+	{
+	    NCURSES_SIZE_T _pad_y,      _pad_x;
+	    NCURSES_SIZE_T _pad_top,    _pad_left;
+	    NCURSES_SIZE_T _pad_bottom, _pad_right;
+	} _pad;
+
+	NCURSES_SIZE_T _yoffset; /* real begy is _begy + _yoffset */
+
+#if NCURSES_WIDECHAR
+	cchar_t  _bkgrnd;	/* current background char/attribute pair */
+#if 1
+	int	_color;		/* current color-pair for non-space character */
+#endif
+#endif
+};
+#endif /* NCURSES_OPAQUE */
+
+/*
+ * GCC (and some other compilers) define '__attribute__'; we're using this
+ * macro to alert the compiler to flag inconsistencies in printf/scanf-like
+ * function calls.  Just in case '__attribute__' isn't defined, make a dummy.
+ * Old versions of G++ do not accept it anyway, at least not consistently with
+ * GCC.
+ */
+#if !(defined(__GNUC__) || defined(__GNUG__) || defined(__attribute__))
+#define __attribute__(p) /* nothing */
+#endif
+
+/*
+ * We cannot define these in ncurses_cfg.h, since they require parameters to be
+ * passed (that is non-portable).
+ */
+#ifndef GCC_PRINTFLIKE
+#ifndef printf
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+#else
+#define GCC_PRINTFLIKE(fmt,var) /*nothing*/
+#endif
+#endif
+
+#ifndef GCC_SCANFLIKE
+#ifndef scanf
+#define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
+#else
+#define GCC_SCANFLIKE(fmt,var)  /*nothing*/
+#endif
+#endif
+
+#ifndef	GCC_NORETURN
+#define	GCC_NORETURN /* nothing */
+#endif
+
+#ifndef	GCC_UNUSED
+#define	GCC_UNUSED /* nothing */
+#endif
+
+#undef  GCC_DEPRECATED
+#if (__GNUC__ - 0 > 3 || (__GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 >= 2)) && !defined(NCURSES_INTERNALS)
+#define GCC_DEPRECATED(msg) __attribute__((deprecated))
+#else
+#define GCC_DEPRECATED(msg) /* nothing */
+#endif
+
+/*
+ * Curses uses a helper function.  Define our type for this to simplify
+ * extending it for the sp-funcs feature.
+ */
+typedef int (*NCURSES_OUTC)(int);
+
+/*
+ * Function prototypes.  This is the complete X/Open Curses list of required
+ * functions.  Those marked `generated' will have sources generated from the
+ * macro definitions later in this file, in order to satisfy XPG4.2
+ * requirements.
+ */
+
+extern NCURSES_EXPORT(int) addch (const chtype);			/* generated */
+extern NCURSES_EXPORT(int) addchnstr (const chtype *, int);		/* generated */
+extern NCURSES_EXPORT(int) addchstr (const chtype *);			/* generated */
+extern NCURSES_EXPORT(int) addnstr (const char *, int);			/* generated */
+extern NCURSES_EXPORT(int) addstr (const char *);			/* generated */
+extern NCURSES_EXPORT(int) attroff (NCURSES_ATTR_T);			/* generated */
+extern NCURSES_EXPORT(int) attron (NCURSES_ATTR_T);			/* generated */
+extern NCURSES_EXPORT(int) attrset (NCURSES_ATTR_T);			/* generated */
+extern NCURSES_EXPORT(int) attr_get (attr_t *, NCURSES_PAIRS_T *, void *);	/* generated */
+extern NCURSES_EXPORT(int) attr_off (attr_t, void *);			/* generated */
+extern NCURSES_EXPORT(int) attr_on (attr_t, void *);			/* generated */
+extern NCURSES_EXPORT(int) attr_set (attr_t, NCURSES_PAIRS_T, void *);		/* generated */
+extern NCURSES_EXPORT(int) baudrate (void);				/* implemented */
+extern NCURSES_EXPORT(int) beep  (void);				/* implemented */
+extern NCURSES_EXPORT(int) bkgd (chtype);				/* generated */
+extern NCURSES_EXPORT(void) bkgdset (chtype);				/* generated */
+extern NCURSES_EXPORT(int) border (chtype,chtype,chtype,chtype,chtype,chtype,chtype,chtype);	/* generated */
+extern NCURSES_EXPORT(int) box (WINDOW *, chtype, chtype);		/* generated */
+extern NCURSES_EXPORT(bool) can_change_color (void);			/* implemented */
+extern NCURSES_EXPORT(int) cbreak (void);				/* implemented */
+extern NCURSES_EXPORT(int) chgat (int, attr_t, NCURSES_PAIRS_T, const void *);	/* generated */
+extern NCURSES_EXPORT(int) clear (void);				/* generated */
+extern NCURSES_EXPORT(int) clearok (WINDOW *,bool);			/* implemented */
+extern NCURSES_EXPORT(int) clrtobot (void);				/* generated */
+extern NCURSES_EXPORT(int) clrtoeol (void);				/* generated */
+extern NCURSES_EXPORT(int) color_content (NCURSES_COLOR_T,NCURSES_COLOR_T*,NCURSES_COLOR_T*,NCURSES_COLOR_T*);	/* implemented */
+extern NCURSES_EXPORT(int) color_set (NCURSES_PAIRS_T,void*);			/* generated */
+extern NCURSES_EXPORT(int) COLOR_PAIR (int);				/* generated */
+extern NCURSES_EXPORT(int) copywin (const WINDOW*,WINDOW*,int,int,int,int,int,int,int);	/* implemented */
+extern NCURSES_EXPORT(int) curs_set (int);				/* implemented */
+extern NCURSES_EXPORT(int) def_prog_mode (void);			/* implemented */
+extern NCURSES_EXPORT(int) def_shell_mode (void);			/* implemented */
+extern NCURSES_EXPORT(int) delay_output (int);				/* implemented */
+extern NCURSES_EXPORT(int) delch (void);				/* generated */
+extern NCURSES_EXPORT(void) delscreen (SCREEN *);			/* implemented */
+extern NCURSES_EXPORT(int) delwin (WINDOW *);				/* implemented */
+extern NCURSES_EXPORT(int) deleteln (void);				/* generated */
+extern NCURSES_EXPORT(WINDOW *) derwin (WINDOW *,int,int,int,int);	/* implemented */
+extern NCURSES_EXPORT(int) doupdate (void);				/* implemented */
+extern NCURSES_EXPORT(WINDOW *) dupwin (WINDOW *);			/* implemented */
+extern NCURSES_EXPORT(int) echo (void);					/* implemented */
+extern NCURSES_EXPORT(int) echochar (const chtype);			/* generated */
+extern NCURSES_EXPORT(int) erase (void);				/* generated */
+extern NCURSES_EXPORT(int) endwin (void);				/* implemented */
+extern NCURSES_EXPORT(char) erasechar (void);				/* implemented */
+extern NCURSES_EXPORT(void) filter (void);				/* implemented */
+extern NCURSES_EXPORT(int) flash (void);				/* implemented */
+extern NCURSES_EXPORT(int) flushinp (void);				/* implemented */
+extern NCURSES_EXPORT(chtype) getbkgd (WINDOW *);			/* generated */
+extern NCURSES_EXPORT(int) getch (void);				/* generated */
+extern NCURSES_EXPORT(int) getnstr (char *, int);			/* generated */
+extern NCURSES_EXPORT(int) getstr (char *);				/* generated */
+extern NCURSES_EXPORT(WINDOW *) getwin (FILE *);			/* implemented */
+extern NCURSES_EXPORT(int) halfdelay (int);				/* implemented */
+extern NCURSES_EXPORT(bool) has_colors (void);				/* implemented */
+extern NCURSES_EXPORT(bool) has_ic (void);				/* implemented */
+extern NCURSES_EXPORT(bool) has_il (void);				/* implemented */
+extern NCURSES_EXPORT(int) hline (chtype, int);				/* generated */
+extern NCURSES_EXPORT(void) idcok (WINDOW *, bool);			/* implemented */
+extern NCURSES_EXPORT(int) idlok (WINDOW *, bool);			/* implemented */
+extern NCURSES_EXPORT(void) immedok (WINDOW *, bool);			/* implemented */
+extern NCURSES_EXPORT(chtype) inch (void);				/* generated */
+extern NCURSES_EXPORT(int) inchnstr (chtype *, int);			/* generated */
+extern NCURSES_EXPORT(int) inchstr (chtype *);				/* generated */
+extern NCURSES_EXPORT(WINDOW *) initscr (void);				/* implemented */
+extern NCURSES_EXPORT(int) init_color (NCURSES_COLOR_T,NCURSES_COLOR_T,NCURSES_COLOR_T,NCURSES_COLOR_T);	/* implemented */
+extern NCURSES_EXPORT(int) init_pair (NCURSES_PAIRS_T,NCURSES_COLOR_T,NCURSES_COLOR_T);		/* implemented */
+extern NCURSES_EXPORT(int) innstr (char *, int);			/* generated */
+extern NCURSES_EXPORT(int) insch (chtype);				/* generated */
+extern NCURSES_EXPORT(int) insdelln (int);				/* generated */
+extern NCURSES_EXPORT(int) insertln (void);				/* generated */
+extern NCURSES_EXPORT(int) insnstr (const char *, int);			/* generated */
+extern NCURSES_EXPORT(int) insstr (const char *);			/* generated */
+extern NCURSES_EXPORT(int) instr (char *);				/* generated */
+extern NCURSES_EXPORT(int) intrflush (WINDOW *,bool);			/* implemented */
+extern NCURSES_EXPORT(bool) isendwin (void);				/* implemented */
+extern NCURSES_EXPORT(bool) is_linetouched (WINDOW *,int);		/* implemented */
+extern NCURSES_EXPORT(bool) is_wintouched (WINDOW *);			/* implemented */
+extern NCURSES_EXPORT(NCURSES_CONST char *) keyname (int);		/* implemented */
+extern NCURSES_EXPORT(int) keypad (WINDOW *,bool);			/* implemented */
+extern NCURSES_EXPORT(char) killchar (void);				/* implemented */
+extern NCURSES_EXPORT(int) leaveok (WINDOW *,bool);			/* implemented */
+extern NCURSES_EXPORT(char *) longname (void);				/* implemented */
+extern NCURSES_EXPORT(int) meta (WINDOW *,bool);			/* implemented */
+extern NCURSES_EXPORT(int) move (int, int);				/* generated */
+extern NCURSES_EXPORT(int) mvaddch (int, int, const chtype);		/* generated */
+extern NCURSES_EXPORT(int) mvaddchnstr (int, int, const chtype *, int);	/* generated */
+extern NCURSES_EXPORT(int) mvaddchstr (int, int, const chtype *);	/* generated */
+extern NCURSES_EXPORT(int) mvaddnstr (int, int, const char *, int);	/* generated */
+extern NCURSES_EXPORT(int) mvaddstr (int, int, const char *);		/* generated */
+extern NCURSES_EXPORT(int) mvchgat (int, int, int, attr_t, NCURSES_PAIRS_T, const void *);	/* generated */
+extern NCURSES_EXPORT(int) mvcur (int,int,int,int);			/* implemented */
+extern NCURSES_EXPORT(int) mvdelch (int, int);				/* generated */
+extern NCURSES_EXPORT(int) mvderwin (WINDOW *, int, int);		/* implemented */
+extern NCURSES_EXPORT(int) mvgetch (int, int);				/* generated */
+extern NCURSES_EXPORT(int) mvgetnstr (int, int, char *, int);		/* generated */
+extern NCURSES_EXPORT(int) mvgetstr (int, int, char *);			/* generated */
+extern NCURSES_EXPORT(int) mvhline (int, int, chtype, int);		/* generated */
+extern NCURSES_EXPORT(chtype) mvinch (int, int);			/* generated */
+extern NCURSES_EXPORT(int) mvinchnstr (int, int, chtype *, int);	/* generated */
+extern NCURSES_EXPORT(int) mvinchstr (int, int, chtype *);		/* generated */
+extern NCURSES_EXPORT(int) mvinnstr (int, int, char *, int);		/* generated */
+extern NCURSES_EXPORT(int) mvinsch (int, int, chtype);			/* generated */
+extern NCURSES_EXPORT(int) mvinsnstr (int, int, const char *, int);	/* generated */
+extern NCURSES_EXPORT(int) mvinsstr (int, int, const char *);		/* generated */
+extern NCURSES_EXPORT(int) mvinstr (int, int, char *);			/* generated */
+extern NCURSES_EXPORT(int) mvprintw (int,int, const char *,...)		/* implemented */
+		GCC_PRINTFLIKE(3,4);
+extern NCURSES_EXPORT(int) mvscanw (int,int, const char *,...)		/* implemented */
+		GCC_SCANFLIKE(3,4);
+extern NCURSES_EXPORT(int) mvvline (int, int, chtype, int);		/* generated */
+extern NCURSES_EXPORT(int) mvwaddch (WINDOW *, int, int, const chtype);	/* generated */
+extern NCURSES_EXPORT(int) mvwaddchnstr (WINDOW *, int, int, const chtype *, int);/* generated */
+extern NCURSES_EXPORT(int) mvwaddchstr (WINDOW *, int, int, const chtype *);	/* generated */
+extern NCURSES_EXPORT(int) mvwaddnstr (WINDOW *, int, int, const char *, int);	/* generated */
+extern NCURSES_EXPORT(int) mvwaddstr (WINDOW *, int, int, const char *);	/* generated */
+extern NCURSES_EXPORT(int) mvwchgat (WINDOW *, int, int, int, attr_t, NCURSES_PAIRS_T, const void *);/* generated */
+extern NCURSES_EXPORT(int) mvwdelch (WINDOW *, int, int);		/* generated */
+extern NCURSES_EXPORT(int) mvwgetch (WINDOW *, int, int);		/* generated */
+extern NCURSES_EXPORT(int) mvwgetnstr (WINDOW *, int, int, char *, int);	/* generated */
+extern NCURSES_EXPORT(int) mvwgetstr (WINDOW *, int, int, char *);	/* generated */
+extern NCURSES_EXPORT(int) mvwhline (WINDOW *, int, int, chtype, int);	/* generated */
+extern NCURSES_EXPORT(int) mvwin (WINDOW *,int,int);			/* implemented */
+extern NCURSES_EXPORT(chtype) mvwinch (WINDOW *, int, int);			/* generated */
+extern NCURSES_EXPORT(int) mvwinchnstr (WINDOW *, int, int, chtype *, int);	/* generated */
+extern NCURSES_EXPORT(int) mvwinchstr (WINDOW *, int, int, chtype *);		/* generated */
+extern NCURSES_EXPORT(int) mvwinnstr (WINDOW *, int, int, char *, int);		/* generated */
+extern NCURSES_EXPORT(int) mvwinsch (WINDOW *, int, int, chtype);		/* generated */
+extern NCURSES_EXPORT(int) mvwinsnstr (WINDOW *, int, int, const char *, int);	/* generated */
+extern NCURSES_EXPORT(int) mvwinsstr (WINDOW *, int, int, const char *);	/* generated */
+extern NCURSES_EXPORT(int) mvwinstr (WINDOW *, int, int, char *);		/* generated */
+extern NCURSES_EXPORT(int) mvwprintw (WINDOW*,int,int, const char *,...)	/* implemented */
+		GCC_PRINTFLIKE(4,5);
+extern NCURSES_EXPORT(int) mvwscanw (WINDOW *,int,int, const char *,...)	/* implemented */
+		GCC_SCANFLIKE(4,5);
+extern NCURSES_EXPORT(int) mvwvline (WINDOW *,int, int, chtype, int);	/* generated */
+extern NCURSES_EXPORT(int) napms (int);					/* implemented */
+extern NCURSES_EXPORT(WINDOW *) newpad (int,int);			/* implemented */
+extern NCURSES_EXPORT(SCREEN *) newterm (const char *,FILE *,FILE *);	/* implemented */
+extern NCURSES_EXPORT(WINDOW *) newwin (int,int,int,int);		/* implemented */
+extern NCURSES_EXPORT(int) nl (void);					/* implemented */
+extern NCURSES_EXPORT(int) nocbreak (void);				/* implemented */
+extern NCURSES_EXPORT(int) nodelay (WINDOW *,bool);			/* implemented */
+extern NCURSES_EXPORT(int) noecho (void);				/* implemented */
+extern NCURSES_EXPORT(int) nonl (void);					/* implemented */
+extern NCURSES_EXPORT(void) noqiflush (void);				/* implemented */
+extern NCURSES_EXPORT(int) noraw (void);				/* implemented */
+extern NCURSES_EXPORT(int) notimeout (WINDOW *,bool);			/* implemented */
+extern NCURSES_EXPORT(int) overlay (const WINDOW*,WINDOW *);		/* implemented */
+extern NCURSES_EXPORT(int) overwrite (const WINDOW*,WINDOW *);		/* implemented */
+extern NCURSES_EXPORT(int) pair_content (NCURSES_PAIRS_T,NCURSES_COLOR_T*,NCURSES_COLOR_T*);		/* implemented */
+extern NCURSES_EXPORT(int) PAIR_NUMBER (int);				/* generated */
+extern NCURSES_EXPORT(int) pechochar (WINDOW *, const chtype);		/* implemented */
+extern NCURSES_EXPORT(int) pnoutrefresh (WINDOW*,int,int,int,int,int,int);/* implemented */
+extern NCURSES_EXPORT(int) prefresh (WINDOW *,int,int,int,int,int,int);	/* implemented */
+extern NCURSES_EXPORT(int) printw (const char *,...)			/* implemented */
+		GCC_PRINTFLIKE(1,2);
+extern NCURSES_EXPORT(int) putwin (WINDOW *, FILE *);			/* implemented */
+extern NCURSES_EXPORT(void) qiflush (void);				/* implemented */
+extern NCURSES_EXPORT(int) raw (void);					/* implemented */
+extern NCURSES_EXPORT(int) redrawwin (WINDOW *);			/* generated */
+extern NCURSES_EXPORT(int) refresh (void);				/* generated */
+extern NCURSES_EXPORT(int) resetty (void);				/* implemented */
+extern NCURSES_EXPORT(int) reset_prog_mode (void);			/* implemented */
+extern NCURSES_EXPORT(int) reset_shell_mode (void);			/* implemented */
+extern NCURSES_EXPORT(int) ripoffline (int, int (*)(WINDOW *, int));	/* implemented */
+extern NCURSES_EXPORT(int) savetty (void);				/* implemented */
+extern NCURSES_EXPORT(int) scanw (const char *,...)			/* implemented */
+		GCC_SCANFLIKE(1,2);
+extern NCURSES_EXPORT(int) scr_dump (const char *);			/* implemented */
+extern NCURSES_EXPORT(int) scr_init (const char *);			/* implemented */
+extern NCURSES_EXPORT(int) scrl (int);					/* generated */
+extern NCURSES_EXPORT(int) scroll (WINDOW *);				/* generated */
+extern NCURSES_EXPORT(int) scrollok (WINDOW *,bool);			/* implemented */
+extern NCURSES_EXPORT(int) scr_restore (const char *);			/* implemented */
+extern NCURSES_EXPORT(int) scr_set (const char *);			/* implemented */
+extern NCURSES_EXPORT(int) setscrreg (int,int);				/* generated */
+extern NCURSES_EXPORT(SCREEN *) set_term (SCREEN *);			/* implemented */
+extern NCURSES_EXPORT(int) slk_attroff (const chtype);			/* implemented */
+extern NCURSES_EXPORT(int) slk_attr_off (const attr_t, void *);		/* generated:WIDEC */
+extern NCURSES_EXPORT(int) slk_attron (const chtype);			/* implemented */
+extern NCURSES_EXPORT(int) slk_attr_on (attr_t,void*);			/* generated:WIDEC */
+extern NCURSES_EXPORT(int) slk_attrset (const chtype);			/* implemented */
+extern NCURSES_EXPORT(attr_t) slk_attr (void);				/* implemented */
+extern NCURSES_EXPORT(int) slk_attr_set (const attr_t,NCURSES_PAIRS_T,void*);	/* implemented */
+extern NCURSES_EXPORT(int) slk_clear (void);				/* implemented */
+extern NCURSES_EXPORT(int) slk_color (NCURSES_PAIRS_T);				/* implemented */
+extern NCURSES_EXPORT(int) slk_init (int);				/* implemented */
+extern NCURSES_EXPORT(char *) slk_label (int);				/* implemented */
+extern NCURSES_EXPORT(int) slk_noutrefresh (void);			/* implemented */
+extern NCURSES_EXPORT(int) slk_refresh (void);				/* implemented */
+extern NCURSES_EXPORT(int) slk_restore (void);				/* implemented */
+extern NCURSES_EXPORT(int) slk_set (int,const char *,int);		/* implemented */
+extern NCURSES_EXPORT(int) slk_touch (void);				/* implemented */
+extern NCURSES_EXPORT(int) standout (void);				/* generated */
+extern NCURSES_EXPORT(int) standend (void);				/* generated */
+extern NCURSES_EXPORT(int) start_color (void);				/* implemented */
+extern NCURSES_EXPORT(WINDOW *) subpad (WINDOW *, int, int, int, int);	/* implemented */
+extern NCURSES_EXPORT(WINDOW *) subwin (WINDOW *, int, int, int, int);	/* implemented */
+extern NCURSES_EXPORT(int) syncok (WINDOW *, bool);			/* implemented */
+extern NCURSES_EXPORT(chtype) termattrs (void);				/* implemented */
+extern NCURSES_EXPORT(char *) termname (void);				/* implemented */
+extern NCURSES_EXPORT(void) timeout (int);				/* generated */
+extern NCURSES_EXPORT(int) touchline (WINDOW *, int, int);		/* generated */
+extern NCURSES_EXPORT(int) touchwin (WINDOW *);				/* generated */
+extern NCURSES_EXPORT(int) typeahead (int);				/* implemented */
+extern NCURSES_EXPORT(int) ungetch (int);				/* implemented */
+extern NCURSES_EXPORT(int) untouchwin (WINDOW *);			/* generated */
+extern NCURSES_EXPORT(void) use_env (bool);				/* implemented */
+extern NCURSES_EXPORT(void) use_tioctl (bool);				/* implemented */
+extern NCURSES_EXPORT(int) vidattr (chtype);				/* implemented */
+extern NCURSES_EXPORT(int) vidputs (chtype, NCURSES_OUTC);		/* implemented */
+extern NCURSES_EXPORT(int) vline (chtype, int);				/* generated */
+extern NCURSES_EXPORT(int) vwprintw (WINDOW *, const char *, va_list) GCC_DEPRECATED(use vw_printw)	/* implemented */
+		GCC_PRINTFLIKE(2,0);
+extern NCURSES_EXPORT(int) vw_printw (WINDOW *, const char *, va_list)	/* implemented */
+		GCC_PRINTFLIKE(2,0);	
+extern NCURSES_EXPORT(int) vwscanw (WINDOW *, const char *, va_list) GCC_DEPRECATED(use vw_scanw)	/* implemented */
+		GCC_SCANFLIKE(2,0);
+extern NCURSES_EXPORT(int) vw_scanw (WINDOW *, const char *, va_list)	/* implemented */
+		GCC_SCANFLIKE(2,0);
+extern NCURSES_EXPORT(int) waddch (WINDOW *, const chtype);		/* implemented */
+extern NCURSES_EXPORT(int) waddchnstr (WINDOW *,const chtype *,int);	/* implemented */
+extern NCURSES_EXPORT(int) waddchstr (WINDOW *,const chtype *);		/* generated */
+extern NCURSES_EXPORT(int) waddnstr (WINDOW *,const char *,int);	/* implemented */
+extern NCURSES_EXPORT(int) waddstr (WINDOW *,const char *);		/* generated */
+extern NCURSES_EXPORT(int) wattron (WINDOW *, int);			/* generated */
+extern NCURSES_EXPORT(int) wattroff (WINDOW *, int);			/* generated */
+extern NCURSES_EXPORT(int) wattrset (WINDOW *, int);			/* generated */
+extern NCURSES_EXPORT(int) wattr_get (WINDOW *, attr_t *, NCURSES_PAIRS_T *, void *);	/* generated */
+extern NCURSES_EXPORT(int) wattr_on (WINDOW *, attr_t, void *);		/* implemented */
+extern NCURSES_EXPORT(int) wattr_off (WINDOW *, attr_t, void *);	/* implemented */
+extern NCURSES_EXPORT(int) wattr_set (WINDOW *, attr_t, NCURSES_PAIRS_T, void *);	/* generated */
+extern NCURSES_EXPORT(int) wbkgd (WINDOW *, chtype);			/* implemented */
+extern NCURSES_EXPORT(void) wbkgdset (WINDOW *,chtype);			/* implemented */
+extern NCURSES_EXPORT(int) wborder (WINDOW *,chtype,chtype,chtype,chtype,chtype,chtype,chtype,chtype);	/* implemented */
+extern NCURSES_EXPORT(int) wchgat (WINDOW *, int, attr_t, NCURSES_PAIRS_T, const void *);/* implemented */
+extern NCURSES_EXPORT(int) wclear (WINDOW *);				/* implemented */
+extern NCURSES_EXPORT(int) wclrtobot (WINDOW *);			/* implemented */
+extern NCURSES_EXPORT(int) wclrtoeol (WINDOW *);			/* implemented */
+extern NCURSES_EXPORT(int) wcolor_set (WINDOW*,NCURSES_PAIRS_T,void*);		/* implemented */
+extern NCURSES_EXPORT(void) wcursyncup (WINDOW *);			/* implemented */
+extern NCURSES_EXPORT(int) wdelch (WINDOW *);				/* implemented */
+extern NCURSES_EXPORT(int) wdeleteln (WINDOW *);			/* generated */
+extern NCURSES_EXPORT(int) wechochar (WINDOW *, const chtype);		/* implemented */
+extern NCURSES_EXPORT(int) werase (WINDOW *);				/* implemented */
+extern NCURSES_EXPORT(int) wgetch (WINDOW *);				/* implemented */
+extern NCURSES_EXPORT(int) wgetnstr (WINDOW *,char *,int);		/* implemented */
+extern NCURSES_EXPORT(int) wgetstr (WINDOW *, char *);			/* generated */
+extern NCURSES_EXPORT(int) whline (WINDOW *, chtype, int);		/* implemented */
+extern NCURSES_EXPORT(chtype) winch (WINDOW *);				/* implemented */
+extern NCURSES_EXPORT(int) winchnstr (WINDOW *, chtype *, int);		/* implemented */
+extern NCURSES_EXPORT(int) winchstr (WINDOW *, chtype *);		/* generated */
+extern NCURSES_EXPORT(int) winnstr (WINDOW *, char *, int);		/* implemented */
+extern NCURSES_EXPORT(int) winsch (WINDOW *, chtype);			/* implemented */
+extern NCURSES_EXPORT(int) winsdelln (WINDOW *,int);			/* implemented */
+extern NCURSES_EXPORT(int) winsertln (WINDOW *);			/* generated */
+extern NCURSES_EXPORT(int) winsnstr (WINDOW *, const char *,int);	/* implemented */
+extern NCURSES_EXPORT(int) winsstr (WINDOW *, const char *);		/* generated */
+extern NCURSES_EXPORT(int) winstr (WINDOW *, char *);			/* generated */
+extern NCURSES_EXPORT(int) wmove (WINDOW *,int,int);			/* implemented */
+extern NCURSES_EXPORT(int) wnoutrefresh (WINDOW *);			/* implemented */
+extern NCURSES_EXPORT(int) wprintw (WINDOW *, const char *,...)		/* implemented */
+		GCC_PRINTFLIKE(2,3);
+extern NCURSES_EXPORT(int) wredrawln (WINDOW *,int,int);		/* implemented */
+extern NCURSES_EXPORT(int) wrefresh (WINDOW *);				/* implemented */
+extern NCURSES_EXPORT(int) wscanw (WINDOW *, const char *,...)		/* implemented */
+		GCC_SCANFLIKE(2,3);
+extern NCURSES_EXPORT(int) wscrl (WINDOW *,int);			/* implemented */
+extern NCURSES_EXPORT(int) wsetscrreg (WINDOW *,int,int);		/* implemented */
+extern NCURSES_EXPORT(int) wstandout (WINDOW *);			/* generated */
+extern NCURSES_EXPORT(int) wstandend (WINDOW *);			/* generated */
+extern NCURSES_EXPORT(void) wsyncdown (WINDOW *);			/* implemented */
+extern NCURSES_EXPORT(void) wsyncup (WINDOW *);				/* implemented */
+extern NCURSES_EXPORT(void) wtimeout (WINDOW *,int);			/* implemented */
+extern NCURSES_EXPORT(int) wtouchln (WINDOW *,int,int,int);		/* implemented */
+extern NCURSES_EXPORT(int) wvline (WINDOW *,chtype,int);		/* implemented */
+
+/*
+ * These are also declared in <term.h>:
+ */
+extern NCURSES_EXPORT(int) tigetflag (const char *);			/* implemented */
+extern NCURSES_EXPORT(int) tigetnum (const char *);			/* implemented */
+extern NCURSES_EXPORT(char *) tigetstr (const char *);			/* implemented */
+extern NCURSES_EXPORT(int) putp (const char *);				/* implemented */
+
+#if NCURSES_TPARM_VARARGS
+extern NCURSES_EXPORT(char *) tparm (const char *, ...);		/* special */
+#else
+extern NCURSES_EXPORT(char *) tparm (const char *, NCURSES_TPARM_ARG,NCURSES_TPARM_ARG,NCURSES_TPARM_ARG,NCURSES_TPARM_ARG,NCURSES_TPARM_ARG,NCURSES_TPARM_ARG,NCURSES_TPARM_ARG,NCURSES_TPARM_ARG,NCURSES_TPARM_ARG);	/* special */
+#endif
+
+extern NCURSES_EXPORT(char *) tiparm (const char *, ...);		/* special */
+extern NCURSES_EXPORT(char *) tiparm_s (int, int, const char *, ...);	/* special */
+extern NCURSES_EXPORT(int) tiscan_s (int *, int *, const char *);	/* special */
+
+/*
+ * These functions are not in X/Open, but we use them in macro definitions:
+ */
+extern NCURSES_EXPORT(int) getattrs (const WINDOW *);			/* generated */
+extern NCURSES_EXPORT(int) getcurx (const WINDOW *);			/* generated */
+extern NCURSES_EXPORT(int) getcury (const WINDOW *);			/* generated */
+extern NCURSES_EXPORT(int) getbegx (const WINDOW *);			/* generated */
+extern NCURSES_EXPORT(int) getbegy (const WINDOW *);			/* generated */
+extern NCURSES_EXPORT(int) getmaxx (const WINDOW *);			/* generated */
+extern NCURSES_EXPORT(int) getmaxy (const WINDOW *);			/* generated */
+extern NCURSES_EXPORT(int) getparx (const WINDOW *);			/* generated */
+extern NCURSES_EXPORT(int) getpary (const WINDOW *);			/* generated */
+
+/*
+ * vid_attr() was implemented originally based on a draft of X/Open curses.
+ */
+#if !NCURSES_WIDECHAR
+#define vid_attr(a,pair,opts) vidattr(a)
+#endif
+
+/*
+ * These functions are extensions - not in X/Open Curses.
+ */
+#if 1
+#undef  NCURSES_EXT_FUNCS
+#define NCURSES_EXT_FUNCS 20240427
+typedef int (*NCURSES_WINDOW_CB)(WINDOW *, void *);
+typedef int (*NCURSES_SCREEN_CB)(SCREEN *, void *);
+extern NCURSES_EXPORT(int) alloc_pair (int, int);
+extern NCURSES_EXPORT(int) assume_default_colors (int, int);
+extern NCURSES_EXPORT(const char *) curses_version (void);
+extern NCURSES_EXPORT(int) define_key (const char *, int);
+extern NCURSES_EXPORT(int) extended_color_content(int, int *, int *, int *);
+extern NCURSES_EXPORT(int) extended_pair_content(int, int *, int *);
+extern NCURSES_EXPORT(int) extended_slk_color(int);
+extern NCURSES_EXPORT(int) find_pair (int, int);
+extern NCURSES_EXPORT(int) free_pair (int);
+extern NCURSES_EXPORT(int) get_escdelay (void);
+extern NCURSES_EXPORT(int) init_extended_color(int, int, int, int);
+extern NCURSES_EXPORT(int) init_extended_pair(int, int, int);
+extern NCURSES_EXPORT(int) is_cbreak(void);
+extern NCURSES_EXPORT(int) is_echo(void);
+extern NCURSES_EXPORT(int) is_nl(void);
+extern NCURSES_EXPORT(int) is_raw(void);
+extern NCURSES_EXPORT(bool) is_term_resized (int, int);
+extern NCURSES_EXPORT(int) key_defined (const char *);
+extern NCURSES_EXPORT(char *) keybound (int, int);
+extern NCURSES_EXPORT(int) keyok (int, bool);
+extern NCURSES_EXPORT(void) nofilter(void);
+extern NCURSES_EXPORT(void) reset_color_pairs (void);
+extern NCURSES_EXPORT(int) resize_term (int, int);
+extern NCURSES_EXPORT(int) resizeterm (int, int);
+extern NCURSES_EXPORT(int) set_escdelay (int);
+extern NCURSES_EXPORT(int) set_tabsize (int);
+extern NCURSES_EXPORT(int) use_default_colors (void);
+extern NCURSES_EXPORT(int) use_legacy_coding (int);
+extern NCURSES_EXPORT(int) use_screen (SCREEN *, NCURSES_SCREEN_CB, void *);
+extern NCURSES_EXPORT(int) use_window (WINDOW *, NCURSES_WINDOW_CB, void *);
+extern NCURSES_EXPORT(int) wresize (WINDOW *, int, int);
+
+#if 1
+#undef  NCURSES_XNAMES
+#define NCURSES_XNAMES 1
+extern NCURSES_EXPORT(int) use_extended_names (bool);
+#endif
+
+/*
+ * These extensions provide access to information stored in the WINDOW even
+ * when NCURSES_OPAQUE is set:
+ */
+extern NCURSES_EXPORT(WINDOW *) wgetparent (const WINDOW *);	/* generated */
+extern NCURSES_EXPORT(bool) is_cleared (const WINDOW *);	/* generated */
+extern NCURSES_EXPORT(bool) is_idcok (const WINDOW *);		/* generated */
+extern NCURSES_EXPORT(bool) is_idlok (const WINDOW *);		/* generated */
+extern NCURSES_EXPORT(bool) is_immedok (const WINDOW *);	/* generated */
+extern NCURSES_EXPORT(bool) is_keypad (const WINDOW *);		/* generated */
+extern NCURSES_EXPORT(bool) is_leaveok (const WINDOW *);	/* generated */
+extern NCURSES_EXPORT(bool) is_nodelay (const WINDOW *);	/* generated */
+extern NCURSES_EXPORT(bool) is_notimeout (const WINDOW *);	/* generated */
+extern NCURSES_EXPORT(bool) is_pad (const WINDOW *);		/* generated */
+extern NCURSES_EXPORT(bool) is_scrollok (const WINDOW *);	/* generated */
+extern NCURSES_EXPORT(bool) is_subwin (const WINDOW *);		/* generated */
+extern NCURSES_EXPORT(bool) is_syncok (const WINDOW *);		/* generated */
+extern NCURSES_EXPORT(int) wgetdelay (const WINDOW *);		/* generated */
+extern NCURSES_EXPORT(int) wgetscrreg (const WINDOW *, int *, int *); /* generated */
+
+#else
+#define curses_version() NCURSES_VERSION
+#endif
+
+/*
+ * Extra extension-functions, which pass a SCREEN pointer rather than using
+ * a global variable SP.
+ */
+#if 1
+#undef  NCURSES_SP_FUNCS
+#define NCURSES_SP_FUNCS 20240427
+#define NCURSES_SP_NAME(name) name##_sp
+
+/* Define the sp-funcs helper function */
+#define NCURSES_SP_OUTC NCURSES_SP_NAME(NCURSES_OUTC)
+typedef int (*NCURSES_SP_OUTC)(SCREEN*, int);
+
+extern NCURSES_EXPORT(SCREEN *) new_prescr (void); /* implemented:SP_FUNC */
+
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(baudrate) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(beep) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(can_change_color) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(cbreak) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(curs_set) (SCREEN*, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(color_content) (SCREEN*, NCURSES_PAIRS_T, NCURSES_COLOR_T*, NCURSES_COLOR_T*, NCURSES_COLOR_T*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(def_prog_mode) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(def_shell_mode) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(delay_output) (SCREEN*, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(doupdate) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(echo) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(endwin) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(char) NCURSES_SP_NAME(erasechar) (SCREEN*);/* implemented:SP_FUNC */
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(filter) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(flash) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(flushinp) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(WINDOW *) NCURSES_SP_NAME(getwin) (SCREEN*, FILE *);			/* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(halfdelay) (SCREEN*, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_colors) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_ic) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_il) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(init_color) (SCREEN*, NCURSES_COLOR_T, NCURSES_COLOR_T, NCURSES_COLOR_T, NCURSES_COLOR_T); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(init_pair) (SCREEN*, NCURSES_PAIRS_T, NCURSES_COLOR_T, NCURSES_COLOR_T); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(intrflush) (SCREEN*, WINDOW*, bool);	/* implemented:SP_FUNC */
+extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(isendwin) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(NCURSES_CONST char *) NCURSES_SP_NAME(keyname) (SCREEN*, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(char) NCURSES_SP_NAME(killchar) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(longname) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(mvcur) (SCREEN*, int, int, int, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(napms) (SCREEN*, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(WINDOW *) NCURSES_SP_NAME(newpad) (SCREEN*, int, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(SCREEN *) NCURSES_SP_NAME(newterm) (SCREEN*, const char *, FILE *, FILE *); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(WINDOW *) NCURSES_SP_NAME(newwin) (SCREEN*, int, int, int, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(nl) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(nocbreak) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(noecho) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(nonl) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(noqiflush) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(noraw) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(pair_content) (SCREEN*, NCURSES_PAIRS_T, NCURSES_COLOR_T*, NCURSES_COLOR_T*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(qiflush) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(raw) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(reset_prog_mode) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(reset_shell_mode) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(resetty) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(ripoffline) (SCREEN*, int, int (*)(WINDOW *, int));	/* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(savetty) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(scr_init) (SCREEN*, const char *); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(scr_restore) (SCREEN*, const char *); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(scr_set) (SCREEN*, const char *); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attroff) (SCREEN*, const chtype); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attron) (SCREEN*, const chtype); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attrset) (SCREEN*, const chtype); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(attr_t) NCURSES_SP_NAME(slk_attr) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attr_set) (SCREEN*, const attr_t, NCURSES_PAIRS_T, void*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_clear) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_color) (SCREEN*, NCURSES_PAIRS_T); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_init) (SCREEN*, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(slk_label) (SCREEN*, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_noutrefresh) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_refresh) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_restore) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_set) (SCREEN*, int, const char *, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_touch) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(start_color) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(chtype) NCURSES_SP_NAME(termattrs) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(termname) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(typeahead) (SCREEN*, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(ungetch) (SCREEN*, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(use_env) (SCREEN*, bool); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(use_tioctl) (SCREEN*, bool); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vidattr) (SCREEN*, chtype);	/* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vidputs) (SCREEN*, chtype, NCURSES_SP_OUTC); /* implemented:SP_FUNC */
+#if 1
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(alloc_pair) (SCREEN*, int, int); /* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(assume_default_colors) (SCREEN*, int, int);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(define_key) (SCREEN*, const char *, int);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(extended_color_content) (SCREEN*, int, int *, int *, int *);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(extended_pair_content) (SCREEN*, int, int *, int *);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(extended_slk_color) (SCREEN*, int);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(find_pair) (SCREEN*, int, int); /* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(free_pair) (SCREEN*, int); /* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(get_escdelay) (SCREEN*);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(init_extended_color) (SCREEN*, int, int, int, int);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(init_extended_pair) (SCREEN*, int, int, int);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(is_cbreak) (SCREEN*);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(is_echo) (SCREEN*);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(is_nl) (SCREEN*);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(is_raw) (SCREEN*);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(is_term_resized) (SCREEN*, int, int);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(key_defined) (SCREEN*, const char *);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(keybound) (SCREEN*, int, int);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(keyok) (SCREEN*, int, bool);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(nofilter) (SCREEN*); /* implemented */	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(reset_color_pairs) (SCREEN*); /* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(resize_term) (SCREEN*, int, int);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(resizeterm) (SCREEN*, int, int);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(set_escdelay) (SCREEN*, int);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(set_tabsize) (SCREEN*, int);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_default_colors) (SCREEN*);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int);	/* implemented:EXT_SP_FUNC */
+#endif
+#else
+#undef  NCURSES_SP_FUNCS
+#define NCURSES_SP_FUNCS 0
+#define NCURSES_SP_NAME(name) name
+#define NCURSES_SP_OUTC NCURSES_OUTC
+#endif
+
+/* attributes */
+
+#define NCURSES_ATTR_SHIFT       8
+#define NCURSES_BITS(mask,shift) (NCURSES_CAST(chtype,(mask)) << ((shift) + NCURSES_ATTR_SHIFT))
+
+#define A_NORMAL	(1U - 1U)
+#define A_ATTRIBUTES	NCURSES_BITS(~(1U - 1U),0)
+#define A_CHARTEXT	(NCURSES_BITS(1U,0) - 1U)
+#define A_COLOR		NCURSES_BITS(((1U) << 8) - 1U,0)
+#define A_STANDOUT	NCURSES_BITS(1U,8)
+#define A_UNDERLINE	NCURSES_BITS(1U,9)
+#define A_REVERSE	NCURSES_BITS(1U,10)
+#define A_BLINK		NCURSES_BITS(1U,11)
+#define A_DIM		NCURSES_BITS(1U,12)
+#define A_BOLD		NCURSES_BITS(1U,13)
+#define A_ALTCHARSET	NCURSES_BITS(1U,14)
+#define A_INVIS		NCURSES_BITS(1U,15)
+#define A_PROTECT	NCURSES_BITS(1U,16)
+#define A_HORIZONTAL	NCURSES_BITS(1U,17)
+#define A_LEFT		NCURSES_BITS(1U,18)
+#define A_LOW		NCURSES_BITS(1U,19)
+#define A_RIGHT		NCURSES_BITS(1U,20)
+#define A_TOP		NCURSES_BITS(1U,21)
+#define A_VERTICAL	NCURSES_BITS(1U,22)
+
+#if 1
+#define A_ITALIC	NCURSES_BITS(1U,23)	/* ncurses extension */
+#endif
+
+/*
+ * Most of the pseudo functions are macros that either provide compatibility
+ * with older versions of curses, or provide inline functionality to improve
+ * performance.
+ */
+
+/*
+ * These pseudo functions are always implemented as macros:
+ */
+
+#define getyx(win,y,x)		(y = getcury(win), x = getcurx(win))
+#define getbegyx(win,y,x)	(y = getbegy(win), x = getbegx(win))
+#define getmaxyx(win,y,x)	(y = getmaxy(win), x = getmaxx(win))
+#define getparyx(win,y,x)	(y = getpary(win), x = getparx(win))
+
+#define getsyx(y,x) do { if (newscr) { \
+			     if (is_leaveok(newscr)) \
+				(y) = (x) = -1; \
+			     else \
+				 getyx(newscr,(y), (x)); \
+			} \
+		    } while(0)
+
+#define setsyx(y,x) do { if (newscr) { \
+			    if ((y) == -1 && (x) == -1) \
+				leaveok(newscr, TRUE); \
+			    else { \
+				leaveok(newscr, FALSE); \
+				wmove(newscr, (y), (x)); \
+			    } \
+			} \
+		    } while(0)
+
+#ifndef NCURSES_NOMACROS
+
+/*
+ * These miscellaneous pseudo functions are provided for compatibility:
+ */
+
+#define wgetstr(w, s)		wgetnstr(w, s, -1)
+#define getnstr(s, n)		wgetnstr(stdscr, s, (n))
+
+#define setterm(term)		setupterm(term, 1, (int *)0)
+
+#define fixterm()		reset_prog_mode()
+#define resetterm()		reset_shell_mode()
+#define saveterm()		def_prog_mode()
+#define crmode()		cbreak()
+#define nocrmode()		nocbreak()
+#define gettmode()
+
+/* It seems older SYSV curses versions define these */
+#if !NCURSES_OPAQUE
+#define getattrs(win)		NCURSES_CAST(int, NCURSES_OK_ADDR(win) ? (win)->_attrs : A_NORMAL)
+#define getcurx(win)		(NCURSES_OK_ADDR(win) ? (win)->_curx : ERR)
+#define getcury(win)		(NCURSES_OK_ADDR(win) ? (win)->_cury : ERR)
+#define getbegx(win)		(NCURSES_OK_ADDR(win) ? (win)->_begx : ERR)
+#define getbegy(win)		(NCURSES_OK_ADDR(win) ? (win)->_begy : ERR)
+#define getmaxx(win)		(NCURSES_OK_ADDR(win) ? ((win)->_maxx + 1) : ERR)
+#define getmaxy(win)		(NCURSES_OK_ADDR(win) ? ((win)->_maxy + 1) : ERR)
+#define getparx(win)		(NCURSES_OK_ADDR(win) ? (win)->_parx : ERR)
+#define getpary(win)		(NCURSES_OK_ADDR(win) ? (win)->_pary : ERR)
+#endif /* NCURSES_OPAQUE */
+
+#define wstandout(win)		(wattrset(win,A_STANDOUT))
+#define wstandend(win)		(wattrset(win,A_NORMAL))
+
+#define wattron(win,at)		wattr_on(win, NCURSES_CAST(attr_t, at), NULL)
+#define wattroff(win,at)	wattr_off(win, NCURSES_CAST(attr_t, at), NULL)
+
+#if !NCURSES_OPAQUE
+#if NCURSES_WATTR_MACROS
+#if NCURSES_WIDECHAR && 1
+#define wattrset(win,at) \
+	(NCURSES_OK_ADDR(win) \
+	  ? ((win)->_color = NCURSES_CAST(int, PAIR_NUMBER(at)), \
+	     (win)->_attrs = NCURSES_CAST(attr_t, at), \
+	     OK) \
+	  : ERR)
+#else
+#define wattrset(win,at) \
+	(NCURSES_OK_ADDR(win) \
+	  ? ((win)->_attrs = NCURSES_CAST(attr_t, at), \
+	     OK) \
+	  : ERR)
+#endif
+#endif /* NCURSES_WATTR_MACROS */
+#endif /* NCURSES_OPAQUE */
+
+#define scroll(win)		wscrl(win,1)
+
+#define touchwin(win)		wtouchln((win), 0, getmaxy(win), 1)
+#define touchline(win, s, c)	wtouchln((win), s, c, 1)
+#define untouchwin(win)		wtouchln((win), 0, getmaxy(win), 0)
+
+#define box(win, v, h)		wborder(win, v, v, h, h, 0, 0, 0, 0)
+#define border(ls, rs, ts, bs, tl, tr, bl, br)	wborder(stdscr, ls, rs, ts, bs, tl, tr, bl, br)
+#define hline(ch, n)		whline(stdscr, ch, (n))
+#define vline(ch, n)		wvline(stdscr, ch, (n))
+
+#define winstr(w, s)		winnstr(w, s, -1)
+#define winchstr(w, s)		winchnstr(w, s, -1)
+#define winsstr(w, s)		winsnstr(w, s, -1)
+
+#if !NCURSES_OPAQUE
+#define redrawwin(win)		wredrawln(win, 0, (NCURSES_OK_ADDR(win) ? (win)->_maxy+1 : -1))
+#endif /* NCURSES_OPAQUE */
+
+#define waddstr(win,str)	waddnstr(win,str,-1)
+#define waddchstr(win,str)	waddchnstr(win,str,-1)
+
+/*
+ * These apply to the first 256 color pairs.
+ */
+#define COLOR_PAIR(n)	(NCURSES_BITS((n), 0) & A_COLOR)
+#define PAIR_NUMBER(a)	(NCURSES_CAST(int,((NCURSES_CAST(unsigned long,(a)) & A_COLOR) >> NCURSES_ATTR_SHIFT)))
+
+/*
+ * pseudo functions for standard screen
+ */
+
+#define addch(ch)		waddch(stdscr,(ch))
+#define addchnstr(str,n)	waddchnstr(stdscr,(str),(n))
+#define addchstr(str)		waddchstr(stdscr,(str))
+#define addnstr(str,n)		waddnstr(stdscr,(str),(n))
+#define addstr(str)		waddnstr(stdscr,(str),-1)
+#define attr_get(ap,cp,o)	wattr_get(stdscr,(ap),(cp),(o))
+#define attr_off(a,o)		wattr_off(stdscr,(a),(o))
+#define attr_on(a,o)		wattr_on(stdscr,(a),(o))
+#define attr_set(a,c,o)		wattr_set(stdscr,(a),(c),(o))
+#define attroff(at)		wattroff(stdscr,(at))
+#define attron(at)		wattron(stdscr,(at))
+#define attrset(at)		wattrset(stdscr,(at))
+#define bkgd(ch)		wbkgd(stdscr,(ch))
+#define bkgdset(ch)		wbkgdset(stdscr,(ch))
+#define chgat(n,a,c,o)		wchgat(stdscr,(n),(a),(c),(o))
+#define clear()			wclear(stdscr)
+#define clrtobot()		wclrtobot(stdscr)
+#define clrtoeol()		wclrtoeol(stdscr)
+#define color_set(c,o)		wcolor_set(stdscr,(c),(o))
+#define delch()			wdelch(stdscr)
+#define deleteln()		winsdelln(stdscr,-1)
+#define echochar(c)		wechochar(stdscr,(c))
+#define erase()			werase(stdscr)
+#define getch()			wgetch(stdscr)
+#define getstr(str)		wgetstr(stdscr,(str))
+#define inch()			winch(stdscr)
+#define inchnstr(s,n)		winchnstr(stdscr,(s),(n))
+#define inchstr(s)		winchstr(stdscr,(s))
+#define innstr(s,n)		winnstr(stdscr,(s),(n))
+#define insch(c)		winsch(stdscr,(c))
+#define insdelln(n)		winsdelln(stdscr,(n))
+#define insertln()		winsdelln(stdscr,1)
+#define insnstr(s,n)		winsnstr(stdscr,(s),(n))
+#define insstr(s)		winsstr(stdscr,(s))
+#define instr(s)		winstr(stdscr,(s))
+#define move(y,x)		wmove(stdscr,(y),(x))
+#define refresh()		wrefresh(stdscr)
+#define scrl(n)			wscrl(stdscr,(n))
+#define setscrreg(t,b)		wsetscrreg(stdscr,(t),(b))
+#define standend()		wstandend(stdscr)
+#define standout()		wstandout(stdscr)
+#define timeout(delay)		wtimeout(stdscr,(delay))
+#define wdeleteln(win)		winsdelln(win,-1)
+#define winsertln(win)		winsdelln(win,1)
+
+/*
+ * mv functions
+ */
+
+#define mvwaddch(win,y,x,ch)		(wmove((win),(y),(x)) == ERR ? ERR : waddch((win),(ch)))
+#define mvwaddchnstr(win,y,x,str,n)	(wmove((win),(y),(x)) == ERR ? ERR : waddchnstr((win),(str),(n)))
+#define mvwaddchstr(win,y,x,str)	(wmove((win),(y),(x)) == ERR ? ERR : waddchnstr((win),(str),-1))
+#define mvwaddnstr(win,y,x,str,n)	(wmove((win),(y),(x)) == ERR ? ERR : waddnstr((win),(str),(n)))
+#define mvwaddstr(win,y,x,str)		(wmove((win),(y),(x)) == ERR ? ERR : waddnstr((win),(str),-1))
+#define mvwchgat(win,y,x,n,a,c,o)	(wmove((win),(y),(x)) == ERR ? ERR : wchgat((win),(n),(a),(c),(o)))
+#define mvwdelch(win,y,x)		(wmove((win),(y),(x)) == ERR ? ERR : wdelch(win))
+#define mvwgetch(win,y,x)		(wmove((win),(y),(x)) == ERR ? ERR : wgetch(win))
+#define mvwgetnstr(win,y,x,str,n)	(wmove((win),(y),(x)) == ERR ? ERR : wgetnstr((win),(str),(n)))
+#define mvwgetstr(win,y,x,str)		(wmove((win),(y),(x)) == ERR ? ERR : wgetstr((win),(str)))
+#define mvwhline(win,y,x,c,n)		(wmove((win),(y),(x)) == ERR ? ERR : whline((win),(c),(n)))
+#define mvwinch(win,y,x)		(wmove((win),(y),(x)) == ERR ? NCURSES_CAST(chtype, ERR) : winch(win))
+#define mvwinchnstr(win,y,x,s,n)	(wmove((win),(y),(x)) == ERR ? ERR : winchnstr((win),(s),(n)))
+#define mvwinchstr(win,y,x,s)		(wmove((win),(y),(x)) == ERR ? ERR : winchstr((win),(s)))
+#define mvwinnstr(win,y,x,s,n)		(wmove((win),(y),(x)) == ERR ? ERR : winnstr((win),(s),(n)))
+#define mvwinsch(win,y,x,c)		(wmove((win),(y),(x)) == ERR ? ERR : winsch((win),(c)))
+#define mvwinsnstr(win,y,x,s,n)		(wmove((win),(y),(x)) == ERR ? ERR : winsnstr((win),(s),(n)))
+#define mvwinsstr(win,y,x,s)		(wmove((win),(y),(x)) == ERR ? ERR : winsstr((win),(s)))
+#define mvwinstr(win,y,x,s)		(wmove((win),(y),(x)) == ERR ? ERR : winstr((win),(s)))
+#define mvwvline(win,y,x,c,n)		(wmove((win),(y),(x)) == ERR ? ERR : wvline((win),(c),(n)))
+
+#define mvaddch(y,x,ch)			mvwaddch(stdscr,(y),(x),(ch))
+#define mvaddchnstr(y,x,str,n)		mvwaddchnstr(stdscr,(y),(x),(str),(n))
+#define mvaddchstr(y,x,str)		mvwaddchstr(stdscr,(y),(x),(str))
+#define mvaddnstr(y,x,str,n)		mvwaddnstr(stdscr,(y),(x),(str),(n))
+#define mvaddstr(y,x,str)		mvwaddstr(stdscr,(y),(x),(str))
+#define mvchgat(y,x,n,a,c,o)		mvwchgat(stdscr,(y),(x),(n),(a),(c),(o))
+#define mvdelch(y,x)			mvwdelch(stdscr,(y),(x))
+#define mvgetch(y,x)			mvwgetch(stdscr,(y),(x))
+#define mvgetnstr(y,x,str,n)		mvwgetnstr(stdscr,(y),(x),(str),(n))
+#define mvgetstr(y,x,str)		mvwgetstr(stdscr,(y),(x),(str))
+#define mvhline(y,x,c,n)		mvwhline(stdscr,(y),(x),(c),(n))
+#define mvinch(y,x)			mvwinch(stdscr,(y),(x))
+#define mvinchnstr(y,x,s,n)		mvwinchnstr(stdscr,(y),(x),(s),(n))
+#define mvinchstr(y,x,s)		mvwinchstr(stdscr,(y),(x),(s))
+#define mvinnstr(y,x,s,n)		mvwinnstr(stdscr,(y),(x),(s),(n))
+#define mvinsch(y,x,c)			mvwinsch(stdscr,(y),(x),(c))
+#define mvinsnstr(y,x,s,n)		mvwinsnstr(stdscr,(y),(x),(s),(n))
+#define mvinsstr(y,x,s)			mvwinsstr(stdscr,(y),(x),(s))
+#define mvinstr(y,x,s)			mvwinstr(stdscr,(y),(x),(s))
+#define mvvline(y,x,c,n)		mvwvline(stdscr,(y),(x),(c),(n))
+
+/*
+ * Some wide-character functions can be implemented without the extensions.
+ */
+#if !NCURSES_OPAQUE
+#define getbkgd(win)                    (NCURSES_OK_ADDR(win) ? ((win)->_bkgd) : 0)
+#endif /* NCURSES_OPAQUE */
+
+#define slk_attr_off(a,v)		((v) ? ERR : slk_attroff(a))
+#define slk_attr_on(a,v)		((v) ? ERR : slk_attron(a))
+
+#if !NCURSES_OPAQUE
+#if NCURSES_WATTR_MACROS
+#if NCURSES_WIDECHAR && 1
+#define wattr_set(win,a,p,opts) \
+	(NCURSES_OK_ADDR(win) \
+	 ? ((void)((win)->_attrs = ((a) & ~A_COLOR), \
+		   (win)->_color = (opts) ? *(int *)(opts) : (p)), \
+	    OK) \
+	 : ERR)
+#define wattr_get(win,a,p,opts) \
+	(NCURSES_OK_ADDR(win) \
+	 ? ((void)(NCURSES_OK_ADDR(a) \
+		   ? (*(a) = (win)->_attrs) \
+		   : OK), \
+	    (void)(NCURSES_OK_ADDR(p) \
+		   ? (*(p) = (NCURSES_PAIRS_T) (win)->_color) \
+		   : OK), \
+	    (void)(NCURSES_OK_ADDR(opts) \
+		   ? (*(int *)(opts) = (win)->_color) \
+		   : OK), \
+	    OK) \
+	 : ERR)
+#else /* !(NCURSES_WIDECHAR && NCURSES_EXE_COLORS) */
+#define wattr_set(win,a,p,opts) \
+	 (NCURSES_OK_ADDR(win) \
+	  ? ((void)((win)->_attrs = (((a) & ~A_COLOR) | \
+				     (attr_t)COLOR_PAIR(p))), \
+	     OK) \
+	  : ERR)
+#define wattr_get(win,a,p,opts) \
+	(NCURSES_OK_ADDR(win) \
+	 ? ((void)(NCURSES_OK_ADDR(a) \
+		   ? (*(a) = (win)->_attrs) \
+		   : OK), \
+	    (void)(NCURSES_OK_ADDR(p) \
+		   ? (*(p) = (NCURSES_PAIRS_T) PAIR_NUMBER((win)->_attrs)) \
+		   : OK), \
+	    OK) \
+	 : ERR)
+#endif /* (NCURSES_WIDECHAR && NCURSES_EXE_COLORS) */
+#endif /* NCURSES_WATTR_MACROS */
+#endif /* NCURSES_OPAQUE */
+
+/*
+ * X/Open curses deprecates SVr4 vwprintw/vwscanw, which are supposed to use
+ * varargs.h.  It adds new calls vw_printw/vw_scanw, which are supposed to
+ * use POSIX stdarg.h.  The ncurses versions of vwprintw/vwscanw already
+ * use stdarg.h, so...
+ */
+/* define vw_printw		vwprintw */
+/* define vw_scanw		vwscanw */
+
+/*
+ * Export fallback function for use in C++ binding.
+ */
+#if !1
+#define vsscanf(a,b,c) _nc_vsscanf(a,b,c)
+NCURSES_EXPORT(int) vsscanf(const char *, const char *, va_list);
+#endif
+
+/*
+ * These macros are extensions - not in X/Open Curses.
+ */
+#if 1
+#if !NCURSES_OPAQUE
+#define is_cleared(win)		(NCURSES_OK_ADDR(win) ? (win)->_clear : FALSE)
+#define is_idcok(win)		(NCURSES_OK_ADDR(win) ? (win)->_idcok : FALSE)
+#define is_idlok(win)		(NCURSES_OK_ADDR(win) ? (win)->_idlok : FALSE)
+#define is_immedok(win)		(NCURSES_OK_ADDR(win) ? (win)->_immed : FALSE)
+#define is_keypad(win)		(NCURSES_OK_ADDR(win) ? (win)->_use_keypad : FALSE)
+#define is_leaveok(win)		(NCURSES_OK_ADDR(win) ? (win)->_leaveok : FALSE)
+#define is_nodelay(win)		(NCURSES_OK_ADDR(win) ? ((win)->_delay == 0) : FALSE)
+#define is_notimeout(win)	(NCURSES_OK_ADDR(win) ? (win)->_notimeout : FALSE)
+#define is_pad(win)		(NCURSES_OK_ADDR(win) ? ((win)->_flags & _ISPAD) != 0 : FALSE)
+#define is_scrollok(win)	(NCURSES_OK_ADDR(win) ? (win)->_scroll : FALSE)
+#define is_subwin(win)		(NCURSES_OK_ADDR(win) ? ((win)->_flags & _SUBWIN) != 0 : FALSE)
+#define is_syncok(win)		(NCURSES_OK_ADDR(win) ? (win)->_sync : FALSE)
+#define wgetdelay(win)		(NCURSES_OK_ADDR(win) ? (win)->_delay : 0)
+#define wgetparent(win)		(NCURSES_OK_ADDR(win) ? (win)->_parent : 0)
+#define wgetscrreg(win,t,b)	(NCURSES_OK_ADDR(win) ? (*(t) = (win)->_regtop, *(b) = (win)->_regbottom, OK) : ERR)
+#endif
+#endif
+
+/*
+ * X/Open says this returns a bool; SVr4 also checked for out-of-range line.
+ * The macro provides compatibility:
+ */
+#define is_linetouched(w,l) ((!(w) || ((l) > getmaxy(w)) || ((l) < 0)) ? ERR : (is_linetouched)((w),(l)))
+
+#endif /* NCURSES_NOMACROS */
+
+/*
+ * Public variables.
+ *
+ * Notes:
+ *	a. ESCDELAY was an undocumented feature under AIX curses.
+ *	   It gives the ESC expire time in milliseconds.
+ *	b. ttytype is needed for backward compatibility
+ */
+#if NCURSES_REENTRANT
+
+NCURSES_WRAPPED_VAR(WINDOW *, curscr);
+NCURSES_WRAPPED_VAR(WINDOW *, newscr);
+NCURSES_WRAPPED_VAR(WINDOW *, stdscr);
+NCURSES_WRAPPED_VAR(char *, ttytype);
+NCURSES_WRAPPED_VAR(int, COLORS);
+NCURSES_WRAPPED_VAR(int, COLOR_PAIRS);
+NCURSES_WRAPPED_VAR(int, COLS);
+NCURSES_WRAPPED_VAR(int, ESCDELAY);
+NCURSES_WRAPPED_VAR(int, LINES);
+NCURSES_WRAPPED_VAR(int, TABSIZE);
+
+#define curscr      NCURSES_PUBLIC_VAR(curscr())
+#define newscr      NCURSES_PUBLIC_VAR(newscr())
+#define stdscr      NCURSES_PUBLIC_VAR(stdscr())
+#define ttytype     NCURSES_PUBLIC_VAR(ttytype())
+#define COLORS      NCURSES_PUBLIC_VAR(COLORS())
+#define COLOR_PAIRS NCURSES_PUBLIC_VAR(COLOR_PAIRS())
+#define COLS        NCURSES_PUBLIC_VAR(COLS())
+#define ESCDELAY    NCURSES_PUBLIC_VAR(ESCDELAY())
+#define LINES       NCURSES_PUBLIC_VAR(LINES())
+#define TABSIZE     NCURSES_PUBLIC_VAR(TABSIZE())
+
+#else
+
+extern NCURSES_EXPORT_VAR(WINDOW *) curscr;
+extern NCURSES_EXPORT_VAR(WINDOW *) newscr;
+extern NCURSES_EXPORT_VAR(WINDOW *) stdscr;
+extern NCURSES_EXPORT_VAR(char) ttytype[];
+extern NCURSES_EXPORT_VAR(int) COLORS;
+extern NCURSES_EXPORT_VAR(int) COLOR_PAIRS;
+extern NCURSES_EXPORT_VAR(int) COLS;
+extern NCURSES_EXPORT_VAR(int) ESCDELAY;
+extern NCURSES_EXPORT_VAR(int) LINES;
+extern NCURSES_EXPORT_VAR(int) TABSIZE;
+
+#endif
+
+/*
+ * Pseudo-character tokens outside ASCII range.  The curses wgetch() function
+ * will return any given one of these only if the corresponding k- capability
+ * is defined in your terminal's terminfo entry.
+ *
+ * Some keys (KEY_A1, etc) are arranged like this:
+ *	a1     up    a3
+ *	left   b2    right
+ *	c1     down  c3
+ *
+ * A few key codes do not depend upon the terminfo entry.
+ */
+#define KEY_CODE_YES	0400		/* A wchar_t contains a key code */
+#define KEY_MIN		0401		/* Minimum curses key */
+#define KEY_BREAK	0401		/* Break key (unreliable) */
+#define KEY_SRESET	0530		/* Soft (partial) reset (unreliable) */
+#define KEY_RESET	0531		/* Reset or hard reset (unreliable) */
diff --git a/include/eti.h b/include/eti.h
new file mode 100644
index 0000000..3c3302d
--- /dev/null
+++ b/include/eti.h
@@ -0,0 +1,55 @@
+/****************************************************************************
+ * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 1998-2002,2003 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, 1995,1997                                    *
+ ****************************************************************************/
+
+/* $Id: eti.h,v 1.9 2020/02/02 23:34:34 tom Exp $ */
+
+#ifndef NCURSES_ETI_H_incl
+#define NCURSES_ETI_H_incl 1
+
+#define	E_OK			(0)
+#define	E_SYSTEM_ERROR	 	(-1)
+#define	E_BAD_ARGUMENT	 	(-2)
+#define	E_POSTED	 	(-3)
+#define	E_CONNECTED	 	(-4)
+#define	E_BAD_STATE	 	(-5)
+#define	E_NO_ROOM	 	(-6)
+#define	E_NOT_POSTED		(-7)
+#define	E_UNKNOWN_COMMAND	(-8)
+#define	E_NO_MATCH		(-9)
+#define	E_NOT_SELECTABLE	(-10)
+#define	E_NOT_CONNECTED	        (-11)
+#define	E_REQUEST_DENIED	(-12)
+#define	E_INVALID_FIELD	        (-13)
+#define	E_CURRENT		(-14)
+
+#endif
diff --git a/include/form.h b/include/form.h
new file mode 100644
index 0000000..3b62e39
--- /dev/null
+++ b/include/form.h
@@ -0,0 +1,460 @@
+/****************************************************************************
+ * Copyright 2018-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  *
+ * 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, 1995,1997                                    *
+ ****************************************************************************/
+
+/* $Id: form.h,v 0.32 2021/06/17 21:26:02 tom Exp $ */
+
+#ifndef FORM_H
+#define FORM_H
+/* *INDENT-OFF*/
+
+#include <curses.h>
+#include <eti.h>
+
+#ifdef __cplusplus
+  extern "C" {
+#endif
+
+#if defined(BUILDING_FORM)
+# define FORM_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT
+#else
+# define FORM_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT
+#endif
+
+#define FORM_WRAPPED_VAR(type,name) extern FORM_IMPEXP type NCURSES_PUBLIC_VAR(name)(void)
+
+#define FORM_EXPORT(type) FORM_IMPEXP type NCURSES_API
+#define FORM_EXPORT_VAR(type) FORM_IMPEXP type
+
+#ifndef FORM_PRIV_H
+typedef void *FIELD_CELL;
+#endif
+
+#ifndef NCURSES_FIELD_INTERNALS
+#define NCURSES_FIELD_INTERNALS /* nothing */
+#endif
+
+typedef int Form_Options;
+typedef int Field_Options;
+
+	/**********
+	*  _PAGE  *
+	**********/
+
+typedef struct pagenode
+#if !NCURSES_OPAQUE_FORM
+{
+  short pmin;		/* index of first field on page			*/
+  short pmax;		/* index of last field on page			*/
+  short smin;		/* index of top leftmost field on page		*/
+  short smax;		/* index of bottom rightmost field on page	*/
+}
+#endif /* !NCURSES_OPAQUE_FORM */
+_PAGE;
+
+	/**********
+	*  FIELD  *
+	**********/
+
+typedef struct fieldnode
+#if 1			/* not yet: !NCURSES_OPAQUE_FORM */
+{
+  unsigned short	status;		/* flags			*/
+  short			rows;		/* size in rows			*/
+  short			cols;		/* size in cols			*/
+  short			frow;		/* first row			*/
+  short			fcol;		/* first col			*/
+  int			drows;		/* dynamic rows			*/
+  int			dcols;		/* dynamic cols			*/
+  int			maxgrow;	/* maximum field growth		*/
+  int			nrow;		/* off-screen rows		*/
+  short			nbuf;		/* additional buffers		*/
+  short			just;		/* justification		*/
+  short			page;		/* page on form			*/
+  short			index;		/* into form -> field		*/
+  int			pad;		/* pad character		*/
+  chtype		fore;		/* foreground attribute		*/
+  chtype		back;		/* background attribute		*/
+  Field_Options		opts;		/* options			*/
+  struct fieldnode *	snext;		/* sorted order pointer		*/
+  struct fieldnode *	sprev;		/* sorted order pointer		*/
+  struct fieldnode *	link;		/* linked field chain		*/
+  struct formnode *	form;		/* containing form		*/
+  struct typenode *	type;		/* field type			*/
+  void *		arg;		/* argument for type		*/
+  FIELD_CELL *		buf;		/* field buffers		*/
+  void *		usrptr;		/* user pointer			*/
+  /*
+   * The wide-character configuration requires extra information.  Because
+   * there are existing applications that manipulate the members of FIELD
+   * directly, we cannot make the struct opaque, except by changing the ABI.
+   * Offsets of members up to this point are the same in the narrow- and
+   * wide-character configuration.  But note that the type of buf depends on
+   * the configuration, and is made opaque for that reason.
+   */
+  NCURSES_FIELD_INTERNALS
+}
+#endif /* NCURSES_OPAQUE_FORM */
+FIELD;
+
+
+	/*********
+	*  FORM  *
+	*********/
+
+typedef struct formnode
+#if 1			/* not yet: !NCURSES_OPAQUE_FORM */
+{
+  unsigned short	status;	  	/* flags			*/
+  short			rows;		/* size in rows			*/
+  short			cols;		/* size in cols			*/
+  int			currow;		/* current row in field window	*/
+  int			curcol;		/* current col in field window	*/
+  int			toprow;		/* in scrollable field window	*/
+  int			begincol;	/* in horiz. scrollable field	*/
+  short			maxfield;	/* number of fields		*/
+  short			maxpage;	/* number of pages		*/
+  short			curpage;	/* index into page		*/
+  Form_Options		opts;		/* options			*/
+  WINDOW *		win;		/* window			*/
+  WINDOW *		sub;		/* subwindow			*/
+  WINDOW *		w;		/* window for current field	*/
+  FIELD **		field;		/* field [maxfield]		*/
+  FIELD *		current;	/* current field		*/
+  _PAGE *		page;		/* page [maxpage]		*/
+  void *		usrptr;		/* user pointer			*/
+
+  void			(*forminit)(struct formnode *);
+  void			(*formterm)(struct formnode *);
+  void			(*fieldinit)(struct formnode *);
+  void			(*fieldterm)(struct formnode *);
+
+}
+#endif /* !NCURSES_OPAQUE_FORM */
+FORM;
+
+
+	/**************
+	*  FIELDTYPE  *
+	**************/
+
+typedef struct typenode
+#if !NCURSES_OPAQUE_FORM
+{
+  unsigned short	status;			/* flags		    */
+  long			ref;			/* reference count	    */
+  struct typenode *	left;			/* ptr to operand for |     */
+  struct typenode *	right;			/* ptr to operand for |     */
+
+  void* (*makearg)(va_list *);			/* make fieldtype arg	    */
+  void* (*copyarg)(const void *);		/* copy fieldtype arg 	    */
+  void	(*freearg)(void *);			/* free fieldtype arg	    */
+
+#if NCURSES_INTEROP_FUNCS
+  union {
+    bool (*ofcheck)(FIELD *,const void *);	/* field validation	    */
+    bool (*gfcheck)(FORM*,FIELD *,const void*);	/* generic field validation */
+  } fieldcheck;
+  union {
+    bool (*occheck)(int,const void *);		/* character validation     */
+    bool (*gccheck)(int,FORM*,
+		    FIELD*,const void*);        /* generic char validation  */
+  } charcheck;
+  union {
+    bool (*onext)(FIELD *,const void *);        /* enumerate next value     */
+    bool (*gnext)(FORM*,FIELD*,const void*);    /* generic enumerate next   */
+  } enum_next;
+  union {
+    bool (*oprev)(FIELD *,const void *);	/* enumerate prev value     */
+    bool (*gprev)(FORM*,FIELD*,const void*);    /* generic enumerate prev   */
+  } enum_prev;
+  void* (*genericarg)(void*);                   /* Alternate Arg method     */
+#else
+  bool	(*fcheck)(FIELD *,const void *);	/* field validation	*/
+  bool	(*ccheck)(int,const void *);		/* character validation */
+
+  bool	(*next)(FIELD *,const void *);		/* enumerate next value */
+  bool	(*prev)(FIELD *,const void *);		/* enumerate prev value */
+#endif
+}
+#endif /* !NCURSES_OPAQUE_FORM */
+FIELDTYPE;
+
+typedef void (*Form_Hook)(FORM *);
+
+	/***************************
+	*  miscellaneous #defines  *
+	***************************/
+
+/* field justification */
+#define NO_JUSTIFICATION	(0)
+#define JUSTIFY_LEFT		(1)
+#define JUSTIFY_CENTER		(2)
+#define JUSTIFY_RIGHT		(3)
+
+/* field options */
+#define O_VISIBLE		(0x0001U)
+#define O_ACTIVE		(0x0002U)
+#define O_PUBLIC		(0x0004U)
+#define O_EDIT			(0x0008U)
+#define O_WRAP			(0x0010U)
+#define O_BLANK			(0x0020U)
+#define O_AUTOSKIP		(0x0040U)
+#define O_NULLOK		(0x0080U)
+#define O_PASSOK		(0x0100U)
+#define O_STATIC		(0x0200U)
+#define O_DYNAMIC_JUSTIFY	(0x0400U)	/* ncurses extension	*/
+#define O_NO_LEFT_STRIP		(0x0800U)	/* ncurses extension	*/
+#define O_EDGE_INSERT_STAY      (0x1000U)	/* ncurses extension	*/
+#define O_INPUT_LIMIT           (0x2000U)	/* ncurses extension	*/
+
+/* form options */
+#define O_NL_OVERLOAD		(0x0001U)
+#define O_BS_OVERLOAD		(0x0002U)
+
+/* form driver commands */
+#define REQ_NEXT_PAGE	 (KEY_MAX + 1)	/* move to next page		*/
+#define REQ_PREV_PAGE	 (KEY_MAX + 2)	/* move to previous page	*/
+#define REQ_FIRST_PAGE	 (KEY_MAX + 3)	/* move to first page		*/
+#define REQ_LAST_PAGE	 (KEY_MAX + 4)	/* move to last page		*/
+
+#define REQ_NEXT_FIELD	 (KEY_MAX + 5)	/* move to next field		*/
+#define REQ_PREV_FIELD	 (KEY_MAX + 6)	/* move to previous field	*/
+#define REQ_FIRST_FIELD	 (KEY_MAX + 7)	/* move to first field		*/
+#define REQ_LAST_FIELD	 (KEY_MAX + 8)	/* move to last field		*/
+#define REQ_SNEXT_FIELD	 (KEY_MAX + 9)	/* move to sorted next field	*/
+#define REQ_SPREV_FIELD	 (KEY_MAX + 10)	/* move to sorted prev field	*/
+#define REQ_SFIRST_FIELD (KEY_MAX + 11)	/* move to sorted first field	*/
+#define REQ_SLAST_FIELD	 (KEY_MAX + 12)	/* move to sorted last field	*/
+#define REQ_LEFT_FIELD	 (KEY_MAX + 13)	/* move to left to field	*/
+#define REQ_RIGHT_FIELD	 (KEY_MAX + 14)	/* move to right to field	*/
+#define REQ_UP_FIELD	 (KEY_MAX + 15)	/* move to up to field		*/
+#define REQ_DOWN_FIELD	 (KEY_MAX + 16)	/* move to down to field	*/
+
+#define REQ_NEXT_CHAR	 (KEY_MAX + 17)	/* move to next char in field	*/
+#define REQ_PREV_CHAR	 (KEY_MAX + 18)	/* move to prev char in field	*/
+#define REQ_NEXT_LINE	 (KEY_MAX + 19)	/* move to next line in field	*/
+#define REQ_PREV_LINE	 (KEY_MAX + 20)	/* move to prev line in field	*/
+#define REQ_NEXT_WORD	 (KEY_MAX + 21)	/* move to next word in field	*/
+#define REQ_PREV_WORD	 (KEY_MAX + 22)	/* move to prev word in field	*/
+#define REQ_BEG_FIELD	 (KEY_MAX + 23)	/* move to first char in field	*/
+#define REQ_END_FIELD	 (KEY_MAX + 24)	/* move after last char in fld	*/
+#define REQ_BEG_LINE	 (KEY_MAX + 25)	/* move to beginning of line	*/
+#define REQ_END_LINE	 (KEY_MAX + 26)	/* move after last char in line	*/
+#define REQ_LEFT_CHAR	 (KEY_MAX + 27)	/* move left in field		*/
+#define REQ_RIGHT_CHAR	 (KEY_MAX + 28)	/* move right in field		*/
+#define REQ_UP_CHAR	 (KEY_MAX + 29)	/* move up in field		*/
+#define REQ_DOWN_CHAR	 (KEY_MAX + 30)	/* move down in field		*/
+
+#define REQ_NEW_LINE	 (KEY_MAX + 31)	/* insert/overlay new line	*/
+#define REQ_INS_CHAR	 (KEY_MAX + 32)	/* insert blank char at cursor	*/
+#define REQ_INS_LINE	 (KEY_MAX + 33)	/* insert blank line at cursor	*/
+#define REQ_DEL_CHAR	 (KEY_MAX + 34)	/* delete char at cursor	*/
+#define REQ_DEL_PREV	 (KEY_MAX + 35)	/* delete char before cursor	*/
+#define REQ_DEL_LINE	 (KEY_MAX + 36)	/* delete line at cursor	*/
+#define REQ_DEL_WORD	 (KEY_MAX + 37)	/* delete word at cursor	*/
+#define REQ_CLR_EOL	 (KEY_MAX + 38)	/* clear to end of line		*/
+#define REQ_CLR_EOF	 (KEY_MAX + 39)	/* clear to end of field	*/
+#define REQ_CLR_FIELD	 (KEY_MAX + 40)	/* clear entire field		*/
+#define REQ_OVL_MODE	 (KEY_MAX + 41)	/* begin overlay mode		*/
+#define REQ_INS_MODE	 (KEY_MAX + 42)	/* begin insert mode		*/
+#define REQ_SCR_FLINE	 (KEY_MAX + 43)	/* scroll field forward a line	*/
+#define REQ_SCR_BLINE	 (KEY_MAX + 44)	/* scroll field backward a line	*/
+#define REQ_SCR_FPAGE	 (KEY_MAX + 45)	/* scroll field forward a page	*/
+#define REQ_SCR_BPAGE	 (KEY_MAX + 46)	/* scroll field backward a page	*/
+#define REQ_SCR_FHPAGE	 (KEY_MAX + 47) /* scroll field forward	 half page */
+#define REQ_SCR_BHPAGE	 (KEY_MAX + 48) /* scroll field backward half page */
+#define REQ_SCR_FCHAR	 (KEY_MAX + 49) /* horizontal scroll char	*/
+#define REQ_SCR_BCHAR	 (KEY_MAX + 50) /* horizontal scroll char	*/
+#define REQ_SCR_HFLINE	 (KEY_MAX + 51) /* horizontal scroll line	*/
+#define REQ_SCR_HBLINE	 (KEY_MAX + 52) /* horizontal scroll line	*/
+#define REQ_SCR_HFHALF	 (KEY_MAX + 53) /* horizontal scroll half line	*/
+#define REQ_SCR_HBHALF	 (KEY_MAX + 54) /* horizontal scroll half line	*/
+
+#define REQ_VALIDATION	 (KEY_MAX + 55)	/* validate field		*/
+#define REQ_NEXT_CHOICE	 (KEY_MAX + 56)	/* display next field choice	*/
+#define REQ_PREV_CHOICE	 (KEY_MAX + 57)	/* display prev field choice	*/
+
+#define MIN_FORM_COMMAND (KEY_MAX + 1)	/* used by form_driver		*/
+#define MAX_FORM_COMMAND (KEY_MAX + 57)	/* used by form_driver		*/
+
+#if defined(MAX_COMMAND)
+#  if (MAX_FORM_COMMAND > MAX_COMMAND)
+#    error Something is wrong -- MAX_FORM_COMMAND is greater than MAX_COMMAND
+#  elif (MAX_COMMAND != (KEY_MAX + 128))
+#    error Something is wrong -- MAX_COMMAND is already inconsistently defined.
+#  endif
+#else
+#  define MAX_COMMAND (KEY_MAX + 128)
+#endif
+
+	/*************************
+	*  standard field types  *
+	*************************/
+extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_ALPHA;
+extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_ALNUM;
+extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_ENUM;
+extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_INTEGER;
+extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_NUMERIC;
+extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_REGEXP;
+
+	/************************************
+	*  built-in additional field types  *
+	*  They are not defined in SVr4     *
+	************************************/
+extern FORM_EXPORT_VAR(FIELDTYPE *) TYPE_IPV4;      /* Internet IP Version 4 address */
+
+	/***********************
+	*  FIELDTYPE routines  *
+	***********************/
+extern FORM_EXPORT(FIELDTYPE *) new_fieldtype (
+		    bool (* const field_check)(FIELD *,const void *),
+		    bool (* const char_check)(int,const void *));
+extern FORM_EXPORT(FIELDTYPE *) link_fieldtype(
+		    FIELDTYPE *, FIELDTYPE *);
+
+extern FORM_EXPORT(int)	free_fieldtype (FIELDTYPE *);
+extern FORM_EXPORT(int)	set_fieldtype_arg (FIELDTYPE *,
+		    void * (* const make_arg)(va_list *),
+		    void * (* const copy_arg)(const void *),
+		    void (* const free_arg)(void *));
+extern FORM_EXPORT(int)	 set_fieldtype_choice (FIELDTYPE *,
+		    bool (* const next_choice)(FIELD *,const void *),
+	      	    bool (* const prev_choice)(FIELD *,const void *));
+
+	/*******************
+	*  FIELD routines  *
+	*******************/
+extern FORM_EXPORT(FIELD *)	new_field (int,int,int,int,int,int);
+extern FORM_EXPORT(FIELD *)	dup_field (FIELD *,int,int);
+extern FORM_EXPORT(FIELD *)	link_field (FIELD *,int,int);
+
+extern FORM_EXPORT(int)	free_field (FIELD *);
+extern FORM_EXPORT(int)	field_info (const FIELD *,int *,int *,int *,int *,int *,int *);
+extern FORM_EXPORT(int)	dynamic_field_info (const FIELD *,int *,int *,int *);
+extern FORM_EXPORT(int)	set_max_field ( FIELD *,int);
+extern FORM_EXPORT(int)	move_field (FIELD *,int,int);
+extern FORM_EXPORT(int)	set_field_type (FIELD *,FIELDTYPE *,...);
+extern FORM_EXPORT(int)	set_new_page (FIELD *,bool);
+extern FORM_EXPORT(int)	set_field_just (FIELD *,int);
+extern FORM_EXPORT(int)	field_just (const FIELD *);
+extern FORM_EXPORT(int)	set_field_fore (FIELD *,chtype);
+extern FORM_EXPORT(int)	set_field_back (FIELD *,chtype);
+extern FORM_EXPORT(int)	set_field_pad (FIELD *,int);
+extern FORM_EXPORT(int)	field_pad (const FIELD *);
+extern FORM_EXPORT(int)	set_field_buffer (FIELD *,int,const char *);
+extern FORM_EXPORT(int)	set_field_status (FIELD *,bool);
+extern FORM_EXPORT(int)	set_field_userptr (FIELD *, void *);
+extern FORM_EXPORT(int)	set_field_opts (FIELD *,Field_Options);
+extern FORM_EXPORT(int)	field_opts_on (FIELD *,Field_Options);
+extern FORM_EXPORT(int)	field_opts_off (FIELD *,Field_Options);
+
+extern FORM_EXPORT(chtype)	field_fore (const FIELD *);
+extern FORM_EXPORT(chtype)	field_back (const FIELD *);
+
+extern FORM_EXPORT(bool)	new_page (const FIELD *);
+extern FORM_EXPORT(bool)	field_status (const FIELD *);
+
+extern FORM_EXPORT(void *)	field_arg (const FIELD *);
+
+extern FORM_EXPORT(void *)	field_userptr (const FIELD *);
+
+extern FORM_EXPORT(FIELDTYPE *)	field_type (const FIELD *);
+
+extern FORM_EXPORT(char *)	field_buffer (const FIELD *,int);
+
+extern FORM_EXPORT(Field_Options)	field_opts (const FIELD *);
+
+	/******************
+	*  FORM routines  *
+	******************/
+
+extern FORM_EXPORT(FORM *)	new_form (FIELD **);
+
+extern FORM_EXPORT(FIELD **)	form_fields (const FORM *);
+extern FORM_EXPORT(FIELD *)	current_field (const FORM *);
+
+extern FORM_EXPORT(WINDOW *)	form_win (const FORM *);
+extern FORM_EXPORT(WINDOW *)	form_sub (const FORM *);
+
+extern FORM_EXPORT(Form_Hook)	form_init (const FORM *);
+extern FORM_EXPORT(Form_Hook)	form_term (const FORM *);
+extern FORM_EXPORT(Form_Hook)	field_init (const FORM *);
+extern FORM_EXPORT(Form_Hook)	field_term (const FORM *);
+
+extern FORM_EXPORT(int)	free_form (FORM *);
+extern FORM_EXPORT(int)	set_form_fields (FORM *,FIELD **);
+extern FORM_EXPORT(int)	field_count (const FORM *);
+extern FORM_EXPORT(int)	set_form_win (FORM *,WINDOW *);
+extern FORM_EXPORT(int)	set_form_sub (FORM *,WINDOW *);
+extern FORM_EXPORT(int)	set_current_field (FORM *,FIELD *);
+extern FORM_EXPORT(int)	unfocus_current_field (FORM *);
+extern FORM_EXPORT(int)	field_index (const FIELD *);
+extern FORM_EXPORT(int)	set_form_page (FORM *,int);
+extern FORM_EXPORT(int)	form_page (const FORM *);
+extern FORM_EXPORT(int)	scale_form (const FORM *,int *,int *);
+extern FORM_EXPORT(int)	set_form_init (FORM *,Form_Hook);
+extern FORM_EXPORT(int)	set_form_term (FORM *,Form_Hook);
+extern FORM_EXPORT(int)	set_field_init (FORM *,Form_Hook);
+extern FORM_EXPORT(int)	set_field_term (FORM *,Form_Hook);
+extern FORM_EXPORT(int)	post_form (FORM *);
+extern FORM_EXPORT(int)	unpost_form (FORM *);
+extern FORM_EXPORT(int)	pos_form_cursor (FORM *);
+extern FORM_EXPORT(int)	form_driver (FORM *,int);
+# if NCURSES_WIDECHAR
+extern FORM_EXPORT(int)	form_driver_w (FORM *,int,wchar_t);
+# endif
+extern FORM_EXPORT(int)	set_form_userptr (FORM *,void *);
+extern FORM_EXPORT(int)	set_form_opts (FORM *,Form_Options);
+extern FORM_EXPORT(int)	form_opts_on (FORM *,Form_Options);
+extern FORM_EXPORT(int)	form_opts_off (FORM *,Form_Options);
+extern FORM_EXPORT(int)	form_request_by_name (const char *);
+
+extern FORM_EXPORT(const char *)	form_request_name (int);
+
+extern FORM_EXPORT(void *)	form_userptr (const FORM *);
+
+extern FORM_EXPORT(Form_Options)	form_opts (const FORM *);
+
+extern FORM_EXPORT(bool)	data_ahead (const FORM *);
+extern FORM_EXPORT(bool)	data_behind (const FORM *);
+
+#if NCURSES_SP_FUNCS
+extern FORM_EXPORT(FORM *)	NCURSES_SP_NAME(new_form) (SCREEN*, FIELD **);
+#endif
+
+#ifdef __cplusplus
+  }
+#endif
+/* *INDENT-ON*/
+
+#endif /* FORM_H */
diff --git a/include/hashsize.h b/include/hashsize.h
new file mode 100644
index 0000000..478fd59
--- /dev/null
+++ b/include/hashsize.h
@@ -0,0 +1,6 @@
+/*
+ * hashsize.h -- hash and token table constants
+ */
+
+#define CAPTABSIZE	497
+#define HASHTABSIZE	(497 * 2)
diff --git a/include/menu.h b/include/menu.h
new file mode 100644
index 0000000..e5a5372
--- /dev/null
+++ b/include/menu.h
@@ -0,0 +1,281 @@
+/****************************************************************************
+ * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 1998-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, 1995,1997                                    *
+ ****************************************************************************/
+
+/* $Id: menu.h,v 1.26 2020/12/12 00:38:02 tom Exp $ */
+
+#ifndef ETI_MENU
+#define ETI_MENU
+
+#ifdef AMIGA
+#define TEXT TEXT_ncurses
+#endif
+
+#include <curses.h>
+#include <eti.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#if defined(BUILDING_MENU)
+# define MENU_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT
+#else
+# define MENU_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT
+#endif
+
+#define MENU_WRAPPED_VAR(type,name) extern MENU_IMPEXP type NCURSES_PUBLIC_VAR(name)(void)
+
+#define MENU_EXPORT(type) MENU_IMPEXP type NCURSES_API
+#define MENU_EXPORT_VAR(type) MENU_IMPEXP type
+
+  typedef int Menu_Options;
+  typedef int Item_Options;
+
+/* Menu options: */
+#define O_ONEVALUE      (0x01)
+#define O_SHOWDESC      (0x02)
+#define O_ROWMAJOR      (0x04)
+#define O_IGNORECASE    (0x08)
+#define O_SHOWMATCH     (0x10)
+#define O_NONCYCLIC     (0x20)
+#define O_MOUSE_MENU    (0x40)
+
+/* Item options: */
+#define O_SELECTABLE    (0x01)
+
+#if !NCURSES_OPAQUE_MENU
+  typedef struct
+    {
+      const char *str;
+      unsigned short length;
+    }
+  TEXT;
+#endif				/* !NCURSES_OPAQUE_MENU */
+
+  struct tagMENU;
+
+  typedef struct tagITEM
+#if !NCURSES_OPAQUE_MENU
+    {
+      TEXT name;		/* name of menu item                         */
+      TEXT description;		/* description of item, optional in display  */
+      struct tagMENU *imenu;	/* Pointer to parent menu                    */
+      void *userptr;		/* Pointer to user defined per item data     */
+      Item_Options opt;		/* Item options                              */
+      short index;		/* Item number if connected to a menu        */
+      short y;			/* y and x location of item in menu          */
+      short x;
+      bool value;		/* Selection value                           */
+
+      struct tagITEM *left;	/* neighbor items                            */
+      struct tagITEM *right;
+      struct tagITEM *up;
+      struct tagITEM *down;
+
+    }
+#endif				/* !NCURSES_OPAQUE_MENU */
+  ITEM;
+
+  typedef void (*Menu_Hook) (struct tagMENU *);
+
+  typedef struct tagMENU
+#if 1				/* not yet: !NCURSES_OPAQUE_MENU   */
+    {
+      short height;		/* Nr. of chars high               */
+      short width;		/* Nr. of chars wide               */
+      short rows;		/* Nr. of items high               */
+      short cols;		/* Nr. of items wide               */
+      short frows;		/* Nr. of formatted items high     */
+      short fcols;		/* Nr. of formatted items wide     */
+      short arows;		/* Nr. of items high (actual)      */
+      short namelen;		/* Max. name length                */
+      short desclen;		/* Max. description length         */
+      short marklen;		/* Length of mark, if any          */
+      short itemlen;		/* Length of one item              */
+      short spc_desc;		/* Spacing for descriptor          */
+      short spc_cols;		/* Spacing for columns             */
+      short spc_rows;		/* Spacing for rows                */
+      char *pattern;		/* Buffer to store match chars     */
+      short pindex;		/* Index into pattern buffer       */
+      WINDOW *win;		/* Window containing menu          */
+      WINDOW *sub;		/* Subwindow for menu display      */
+      WINDOW *userwin;		/* User's window                   */
+      WINDOW *usersub;		/* User's subwindow                */
+      ITEM **items;		/* array of items                  */
+      short nitems;		/* Nr. of items in menu            */
+      ITEM *curitem;		/* Current item                    */
+      short toprow;		/* Top row of menu                 */
+      chtype fore;		/* Selection attribute             */
+      chtype back;		/* Nonselection attribute          */
+      chtype grey;		/* Inactive attribute              */
+      unsigned char pad;	/* Pad character                   */
+
+      Menu_Hook menuinit;	/* User hooks                      */
+      Menu_Hook menuterm;
+      Menu_Hook iteminit;
+      Menu_Hook itemterm;
+
+      void *userptr;		/* Pointer to menus user data      */
+      char *mark;		/* Pointer to marker string        */
+
+      Menu_Options opt;		/* Menu options                    */
+      unsigned short status;	/* Internal state of menu          */
+    }
+#endif				/* !NCURSES_OPAQUE_MENU */
+  MENU;
+
+/* Define keys */
+
+#define REQ_LEFT_ITEM           (KEY_MAX + 1)
+#define REQ_RIGHT_ITEM          (KEY_MAX + 2)
+#define REQ_UP_ITEM             (KEY_MAX + 3)
+#define REQ_DOWN_ITEM           (KEY_MAX + 4)
+#define REQ_SCR_ULINE           (KEY_MAX + 5)
+#define REQ_SCR_DLINE           (KEY_MAX + 6)
+#define REQ_SCR_DPAGE           (KEY_MAX + 7)
+#define REQ_SCR_UPAGE           (KEY_MAX + 8)
+#define REQ_FIRST_ITEM          (KEY_MAX + 9)
+#define REQ_LAST_ITEM           (KEY_MAX + 10)
+#define REQ_NEXT_ITEM           (KEY_MAX + 11)
+#define REQ_PREV_ITEM           (KEY_MAX + 12)
+#define REQ_TOGGLE_ITEM         (KEY_MAX + 13)
+#define REQ_CLEAR_PATTERN       (KEY_MAX + 14)
+#define REQ_BACK_PATTERN        (KEY_MAX + 15)
+#define REQ_NEXT_MATCH          (KEY_MAX + 16)
+#define REQ_PREV_MATCH          (KEY_MAX + 17)
+
+#define MIN_MENU_COMMAND        (KEY_MAX + 1)
+#define MAX_MENU_COMMAND        (KEY_MAX + 17)
+
+/*
+ * Some AT&T code expects MAX_COMMAND to be out-of-band not
+ * just for menu commands but for forms ones as well.
+ */
+#if defined(MAX_COMMAND)
+#  if (MAX_MENU_COMMAND > MAX_COMMAND)
+#    error Something is wrong -- MAX_MENU_COMMAND is greater than MAX_COMMAND
+#  elif (MAX_COMMAND != (KEY_MAX + 128))
+#    error Something is wrong -- MAX_COMMAND is already inconsistently defined.
+#  endif
+#else
+#  define MAX_COMMAND (KEY_MAX + 128)
+#endif
+
+/* --------- prototypes for libmenu functions ----------------------------- */
+
+  extern MENU_EXPORT(ITEM **) menu_items(const MENU *);
+  extern MENU_EXPORT(ITEM *) current_item(const MENU *);
+  extern MENU_EXPORT(ITEM *) new_item(const char *, const char *);
+
+  extern MENU_EXPORT(MENU *) new_menu(ITEM **);
+
+  extern MENU_EXPORT(Item_Options) item_opts(const ITEM *);
+  extern MENU_EXPORT(Menu_Options) menu_opts(const MENU *);
+
+  extern MENU_EXPORT(Menu_Hook) item_init(const MENU *);
+  extern MENU_EXPORT(Menu_Hook) item_term(const MENU *);
+  extern MENU_EXPORT(Menu_Hook) menu_init(const MENU *);
+  extern MENU_EXPORT(Menu_Hook) menu_term(const MENU *);
+
+  extern MENU_EXPORT(WINDOW *) menu_sub(const MENU *);
+  extern MENU_EXPORT(WINDOW *) menu_win(const MENU *);
+
+  extern MENU_EXPORT(const char *) item_description(const ITEM *);
+  extern MENU_EXPORT(const char *) item_name(const ITEM *);
+  extern MENU_EXPORT(const char *) menu_mark(const MENU *);
+  extern MENU_EXPORT(const char *) menu_request_name(int);
+
+  extern MENU_EXPORT(char *) menu_pattern(const MENU *);
+
+  extern MENU_EXPORT(void *) menu_userptr(const MENU *);
+  extern MENU_EXPORT(void *) item_userptr(const ITEM *);
+
+  extern MENU_EXPORT(chtype) menu_back(const MENU *);
+  extern MENU_EXPORT(chtype) menu_fore(const MENU *);
+  extern MENU_EXPORT(chtype) menu_grey(const MENU *);
+
+  extern MENU_EXPORT(int) free_item(ITEM *);
+  extern MENU_EXPORT(int) free_menu(MENU *);
+  extern MENU_EXPORT(int) item_count(const MENU *);
+  extern MENU_EXPORT(int) item_index(const ITEM *);
+  extern MENU_EXPORT(int) item_opts_off(ITEM *, Item_Options);
+  extern MENU_EXPORT(int) item_opts_on(ITEM *, Item_Options);
+  extern MENU_EXPORT(int) menu_driver(MENU *, int);
+  extern MENU_EXPORT(int) menu_opts_off(MENU *, Menu_Options);
+  extern MENU_EXPORT(int) menu_opts_on(MENU *, Menu_Options);
+  extern MENU_EXPORT(int) menu_pad(const MENU *);
+  extern MENU_EXPORT(int) pos_menu_cursor(const MENU *);
+  extern MENU_EXPORT(int) post_menu(MENU *);
+  extern MENU_EXPORT(int) scale_menu(const MENU *, int *, int *);
+  extern MENU_EXPORT(int) set_current_item(MENU *menu, ITEM *item);
+  extern MENU_EXPORT(int) set_item_init(MENU *, Menu_Hook);
+  extern MENU_EXPORT(int) set_item_opts(ITEM *, Item_Options);
+  extern MENU_EXPORT(int) set_item_term(MENU *, Menu_Hook);
+  extern MENU_EXPORT(int) set_item_userptr(ITEM *, void *);
+  extern MENU_EXPORT(int) set_item_value(ITEM *, bool);
+  extern MENU_EXPORT(int) set_menu_back(MENU *, chtype);
+  extern MENU_EXPORT(int) set_menu_fore(MENU *, chtype);
+  extern MENU_EXPORT(int) set_menu_format(MENU *, int, int);
+  extern MENU_EXPORT(int) set_menu_grey(MENU *, chtype);
+  extern MENU_EXPORT(int) set_menu_init(MENU *, Menu_Hook);
+  extern MENU_EXPORT(int) set_menu_items(MENU *, ITEM **);
+  extern MENU_EXPORT(int) set_menu_mark(MENU *, const char *);
+  extern MENU_EXPORT(int) set_menu_opts(MENU *, Menu_Options);
+  extern MENU_EXPORT(int) set_menu_pad(MENU *, int);
+  extern MENU_EXPORT(int) set_menu_pattern(MENU *, const char *);
+  extern MENU_EXPORT(int) set_menu_sub(MENU *, WINDOW *);
+  extern MENU_EXPORT(int) set_menu_term(MENU *, Menu_Hook);
+  extern MENU_EXPORT(int) set_menu_userptr(MENU *, void *);
+  extern MENU_EXPORT(int) set_menu_win(MENU *, WINDOW *);
+  extern MENU_EXPORT(int) set_top_row(MENU *, int);
+  extern MENU_EXPORT(int) top_row(const MENU *);
+  extern MENU_EXPORT(int) unpost_menu(MENU *);
+  extern MENU_EXPORT(int) menu_request_by_name(const char *);
+  extern MENU_EXPORT(int) set_menu_spacing(MENU *, int, int, int);
+  extern MENU_EXPORT(int) menu_spacing(const MENU *, int *, int *, int *);
+
+  extern MENU_EXPORT(bool) item_value(const ITEM *);
+  extern MENU_EXPORT(bool) item_visible(const ITEM *);
+
+  extern MENU_EXPORT(void) menu_format(const MENU *, int *, int *);
+
+#if NCURSES_SP_FUNCS
+  extern MENU_EXPORT(MENU *) NCURSES_SP_NAME(new_menu) (SCREEN *, ITEM **);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif				/* ETI_MENU */
diff --git a/include/mf_common.h b/include/mf_common.h
new file mode 100644
index 0000000..fcbd565
--- /dev/null
+++ b/include/mf_common.h
@@ -0,0 +1,98 @@
+/****************************************************************************
+ * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 1998-2005,2012 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, 1995,1997                                    *
+ ****************************************************************************/
+
+/* $Id: mf_common.h,v 0.25 2020/02/02 23:34:34 tom Exp $ */
+
+/* Common internal header for menu and form library */
+
+#ifndef MF_COMMON_H_incl
+#define MF_COMMON_H_incl 1
+
+#include <ncurses_cfg.h>
+#include <curses.h>
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+
+#if DECL_ERRNO
+extern int errno;
+#endif
+
+/* in case of debug version we ignore the suppression of assertions */
+#ifdef TRACE
+#  ifdef NDEBUG
+#    undef NDEBUG
+#  endif
+#endif
+
+#include <nc_alloc.h>
+
+#if USE_RCS_IDS
+#define MODULE_ID(id) static const char Ident[] = id;
+#else
+#define MODULE_ID(id)		/*nothing */
+#endif
+
+/* Maximum regular 8-bit character code */
+#define MAX_REGULAR_CHARACTER (0xff)
+
+#define SET_ERROR(code) (errno=(code))
+#define GET_ERROR()     (errno)
+
+#ifdef TRACE
+#define RETURN(code)    returnCode( SET_ERROR(code) )
+#else
+#define RETURN(code)    return( SET_ERROR(code) )
+#endif
+
+/* The few common values in the status fields for menus and forms */
+#define _POSTED         (0x01U)	/* menu or form is posted                  */
+#define _IN_DRIVER      (0x02U)	/* menu or form is processing hook routine */
+
+#define SetStatus(target,mask) (target)->status |= (unsigned short) (mask)
+#define ClrStatus(target,mask) (target)->status = (unsigned short) (target->status & (~mask))
+
+/* Call object hook */
+#define Call_Hook( object, handler ) \
+   if ( (object) != 0 && ((object)->handler) != (void *) 0 )\
+   {\
+	SetStatus(object, _IN_DRIVER);\
+	(object)->handler(object);\
+	ClrStatus(object, _IN_DRIVER);\
+   }
+
+#endif /* MF_COMMON_H_incl */
diff --git a/include/ncurses_cfg.h b/include/ncurses_cfg.h
new file mode 100644
index 0000000..6c5fd05
--- /dev/null
+++ b/include/ncurses_cfg.h
@@ -0,0 +1,254 @@
+/* include/ncurses_cfg.h.  Generated automatically by configure.  */
+/****************************************************************************
+ * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 1998-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: Thomas E. Dickey      1997-on                                   *
+ ****************************************************************************/
+/*
+ * $Id: ncurses_cfg.hin,v 1.13 2020/03/08 12:37:59 tom Exp $
+ *
+ * Both ncurses_cfg.h and ncurses_def.h are internal header-files used when
+ * building ncurses.
+ *
+ * This is a template-file used to generate the "ncurses_cfg.h" file.
+ *
+ * Rather than list every definition, the configuration script substitutes the
+ * definitions that it finds using 'sed'.  You need a patch (original date
+ * 971222) to autoconf 2.12 or 2.13 to do this.
+ *
+ * See:
+ *	https://invisible-island.net/autoconf/
+ *	ftp://ftp.invisible-island.net/autoconf/
+ */
+#ifndef NC_CONFIG_H
+#define NC_CONFIG_H
+
+#define PACKAGE "ncurses"
+#define NCURSES_VERSION "6.5"
+#define NCURSES_PATCHDATE 20240427
+#define SYSTEM_NAME "linux-gnu"
+#if 0
+#include <stdlib.h>
+#endif
+#define HAVE_LONG_FILE_NAMES 1
+#define MIXEDCASE_FILENAMES 1
+#define STDC_HEADERS 1
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_SYS_STAT_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STRING_H 1
+#define HAVE_MEMORY_H 1
+#define HAVE_STRINGS_H 1
+#define HAVE_INTTYPES_H 1
+#define HAVE_STDINT_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_DIRENT_H 1
+#define TERMINFO_DIRS "/system_ext/etc/terminfo"
+#define TERMINFO "/system_ext/etc/terminfo"
+#define HAVE_BIG_CORE 1
+#define PURE_TERMINFO 1
+#define USE_HOME_TERMINFO 1
+#define USE_ROOT_ENVIRON 1
+#define USE_ROOT_ACCESS 1
+#define USE_SETUID_ENVIRON 1
+#define HAVE_UNISTD_H 1
+#define HAVE_REMOVE 1
+#define HAVE_UNLINK 1
+#define HAVE_LINK 1
+#define HAVE_SYMLINK 1
+#define USE_LINKS 1
+#define HAVE_LANGINFO_CODESET 1
+#define USE_WIDEC_SUPPORT 1
+#define NCURSES_WIDECHAR 1
+#define HAVE_WCHAR_H 1
+#define HAVE_WCTYPE_H 1
+#define HAVE_PUTWC 1
+#define HAVE_BTOWC 1
+#define HAVE_WCTOB 1
+#define HAVE_WMEMCHR 1
+#define HAVE_MBTOWC 1
+#define HAVE_WCTOMB 1
+#define HAVE_MBLEN 1
+#define HAVE_MBRLEN 1
+#define HAVE_MBRTOWC 1
+#define HAVE_WCSRTOMBS 1
+#define HAVE_MBSRTOWCS 1
+#define HAVE_WCSTOMBS 1
+#define HAVE_MBSTOWCS 1
+#define NEED_WCHAR_H 1
+#define HAVE_FSEEKO 1
+#define RGB_PATH "/usr/share/X11/rgb.txt"
+#define SIZEOF_SIGNED_CHAR 1
+#define NCURSES_EXT_FUNCS 1
+#define HAVE_ASSUME_DEFAULT_COLORS 1
+#define HAVE_CURSES_VERSION 1
+#define HAVE_HAS_KEY 1
+#define HAVE_RESIZETERM 1
+#define HAVE_RESIZE_TERM 1
+#define HAVE_TERM_ENTRY_H 1
+#define HAVE_USE_DEFAULT_COLORS 1
+#define HAVE_USE_SCREEN 1
+#define HAVE_USE_WINDOW 1
+#define HAVE_WRESIZE 1
+#define NCURSES_SP_FUNCS 1
+#define HAVE_TPUTS_SP 1
+#define NCURSES_EXT_COLORS 1
+#define HAVE_ALLOC_PAIR 1
+#define HAVE_INIT_EXTENDED_COLOR 1
+#define HAVE_RESET_COLOR_PAIRS 1
+#define NCURSES_EXT_PUTWIN 1
+#define NCURSES_NO_PADDING 1
+#define USE_SIGWINCH 1
+#define NCURSES_XNAMES 1
+#define NCURSES_WRAP_PREFIX "_nc_"
+#define USE_ASSUMED_COLOR 1
+#define USE_HASHMAP 1
+#define GCC_SCANF 1
+#define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var)))
+#define GCC_PRINTF 1
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+#define GCC_UNUSED __attribute__((unused))
+#define GCC_NORETURN __attribute__((noreturn))
+#define HAVE_NC_ALLOC_H 1
+#define HAVE_MATH_FUNCS 1
+#define TIME_WITH_SYS_TIME 1
+#define HAVE_REGEX_H_FUNCS 1
+#define HAVE_FCNTL_H 1
+#define HAVE_GETOPT_H 1
+#define HAVE_LIMITS_H 1
+#define HAVE_LOCALE_H 1
+#define HAVE_MATH_H 1
+#define HAVE_POLL_H 1
+#define HAVE_SYS_AUXV_H 1
+#define HAVE_SYS_IOCTL_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_POLL_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_TIMES_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_WCTYPE_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_GETOPT_H 1
+#define HAVE_GETOPT_HEADER 1
+#define DECL_ENVIRON 1
+#define HAVE_ENVIRON 1
+#define HAVE_PUTENV 1
+#define HAVE_SETENV 1
+#define HAVE_STRDUP 1
+#define HAVE_SYS_TIME_SELECT 1
+#define SIG_ATOMIC_T volatile sig_atomic_t
+#define HAVE_CLOCK_GETTIME 1
+#define HAVE_FPATHCONF 1
+#define HAVE_GETCWD 1
+#define HAVE_GETAUXVAL 1
+#define HAVE_GETEGID 1
+#define HAVE_GETEUID 1
+#define HAVE_GETOPT 1
+#define HAVE_GETUID 1
+#define HAVE_LOCALECONV 1
+#define HAVE_POLL 1
+#define HAVE_REMOVE 1
+#define HAVE_SELECT 1
+#define HAVE_SETBUF 1
+#define HAVE_SETBUFFER 1
+#define HAVE_SETFSUID 1
+#define HAVE_SETVBUF 1
+#define HAVE_SIGACTION 1
+#define HAVE_SNPRINTF 1
+#define HAVE_STRDUP 1
+#define HAVE_STRSTR 1
+#define HAVE_SYSCONF 1
+#define HAVE_TCGETPGRP 1
+#define HAVE_TIMES 1
+#define HAVE_TSEARCH 1
+#define HAVE_VSNPRINTF 1
+#define HAVE_ISASCII 1
+#define HAVE_NANOSLEEP 1
+#define HAVE_TERMIO_H 1
+#define HAVE_TERMIOS_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_SYS_IOCTL_H 1
+#define HAVE_TCGETATTR 1
+#define HAVE_VSSCANF 1
+#define HAVE_UNISTD_H 1
+#define HAVE_MKSTEMP 1
+#define HAVE_SIZECHANGE 1
+#define HAVE_WORKING_POLL 1
+#define HAVE_CONSISTENT_MB_LEN_MAX 1
+#define HAVE_VA_COPY 1
+#define HAVE_UNISTD_H 1
+#define HAVE_FORK 1
+#define HAVE_VFORK 1
+#define HAVE_WORKING_VFORK 1
+#define HAVE_WORKING_FORK 1
+#define USE_FOPEN_BIN_R 1
+#define USE_OPENPTY_HEADER <pty.h>
+#define USE_XTERM_PTY 1
+#define HAVE_TYPEINFO 1
+#define HAVE_IOSTREAM 1
+#define IOSTREAM_NAMESPACE 1
+#define SIZEOF_BOOL 1
+#define CPP_HAS_OVERRIDE 1
+#define CPP_HAS_STATIC_CAST 1
+#define SIZEOF_WCHAR_T 4
+#define HAVE_SLK_COLOR 1
+#define HAVE_PANEL_H 1
+#define HAVE_LIBPANEL 1
+#define HAVE_MENU_H 1
+#define HAVE_LIBMENU 1
+#define HAVE_FORM_H 1
+#define HAVE_LIBFORM 1
+#define NCURSES_PATHSEP ':'
+#define NCURSES_VERSION_STRING "6.5.20240427"
+#define NCURSES_OSPEED_COMPAT 1
+
+#include <ncurses_def.h>
+
+	/* The C compiler may not treat these properly but C++ has to */
+#ifdef __cplusplus
+#undef const
+#undef inline
+#endif
+
+	/* On HP-UX, the C compiler doesn't grok mbstate_t without
+	   -D_XOPEN_SOURCE=500. However, this causes problems on
+	   IRIX. So, we #define mbstate_t to int in configure.in
+	   only for the C compiler if needed. */
+#ifndef __cplusplus
+#ifdef NEED_MBSTATE_T_DEF
+#define mbstate_t int
+#endif
+#endif
+
+/*
+ * vile:cmode
+ */
+#endif /* NC_CONFIG_H */
diff --git a/include/ncurses_def.h b/include/ncurses_def.h
new file mode 100644
index 0000000..321ef72
--- /dev/null
+++ b/include/ncurses_def.h
@@ -0,0 +1,988 @@
+/*
+ * This file is generated by ./MKncurses_def.sh
+ */
+
+#ifndef NC_DEFINE_H
+#define NC_DEFINE_H 1
+
+#ifndef BROKEN_LINKER
+#define BROKEN_LINKER 0
+#endif
+
+#ifndef BSD_TPUTS
+#define BSD_TPUTS 0
+#endif
+
+#ifndef CGETENT_CONST
+#define CGETENT_CONST /* nothing */
+#endif
+
+#ifndef CPP_HAS_PARAM_INIT
+#define CPP_HAS_PARAM_INIT 0
+#endif
+
+#ifndef CURSES_ACS_ARRAY
+#define CURSES_ACS_ARRAY acs_map
+#endif
+
+#ifndef CURSES_WACS_ARRAY
+#define CURSES_WACS_ARRAY _nc_wacs
+#endif
+
+#ifndef DECL_ERRNO
+#define DECL_ERRNO 0
+#endif
+
+#ifndef ETIP_NEEDS_MATH_H
+#define ETIP_NEEDS_MATH_H 0
+#endif
+
+#ifndef GCC_NORETURN
+#define GCC_NORETURN /* nothing */
+#endif
+
+#ifndef GCC_UNUSED
+#define GCC_UNUSED /* nothing */
+#endif
+
+#ifndef HAVE_ALLOC_PAIR
+#define HAVE_ALLOC_PAIR 0
+#endif
+
+#ifndef HAVE_ASSUME_DEFAULT_COLORS
+#define HAVE_ASSUME_DEFAULT_COLORS 0
+#endif
+
+#ifndef HAVE_BIG_CORE
+#define HAVE_BIG_CORE 0
+#endif
+
+#ifndef HAVE_BSD_CGETENT
+#define HAVE_BSD_CGETENT 0
+#endif
+
+#ifndef HAVE_BSD_SIGNAL_H
+#define HAVE_BSD_SIGNAL_H 0
+#endif
+
+#ifndef HAVE_BSD_STRING_H
+#define HAVE_BSD_STRING_H 0
+#endif
+
+#ifndef HAVE_BTOWC
+#define HAVE_BTOWC 0
+#endif
+
+#ifndef HAVE_BUILTIN_H
+#define HAVE_BUILTIN_H 0
+#endif
+
+#ifndef HAVE_CHGAT
+#define HAVE_CHGAT 1
+#endif
+
+#ifndef HAVE_CLOCK_GETTIME
+#define HAVE_CLOCK_GETTIME 0
+#endif
+
+#ifndef HAVE_COLOR_CONTENT
+#define HAVE_COLOR_CONTENT 1
+#endif
+
+#ifndef HAVE_COLOR_SET
+#define HAVE_COLOR_SET 1
+#endif
+
+#ifndef HAVE_CONSISTENT_GETENV
+#define HAVE_CONSISTENT_GETENV 0
+#endif
+
+#ifndef HAVE_CONSISTENT_MB_LEN_MAX
+#define HAVE_CONSISTENT_MB_LEN_MAX 0
+#endif
+
+#ifndef HAVE_COPYWIN
+#define HAVE_COPYWIN 1
+#endif
+
+#ifndef HAVE_CURSCR
+#define HAVE_CURSCR 1
+#endif
+
+#ifndef HAVE_CURSES_DATA_TABSIZE
+#define HAVE_CURSES_DATA_TABSIZE 1
+#endif
+
+#ifndef HAVE_CURSES_DATA_TTYTYPE
+#define HAVE_CURSES_DATA_TTYTYPE 1
+#endif
+
+#ifndef HAVE_CURSES_TRACE
+#define HAVE_CURSES_TRACE 1
+#endif
+
+#ifndef HAVE_DELSCREEN
+#define HAVE_DELSCREEN 1
+#endif
+
+#ifndef HAVE_DERWIN
+#define HAVE_DERWIN 1
+#endif
+
+#ifndef HAVE_DIRENT_H
+#define HAVE_DIRENT_H 0
+#endif
+
+#ifndef HAVE_DUPWIN
+#define HAVE_DUPWIN 1
+#endif
+
+#ifndef HAVE_ERRNO
+#define HAVE_ERRNO 0
+#endif
+
+#ifndef HAVE_EXIT_CURSES
+#define HAVE_EXIT_CURSES 1
+#endif
+
+#ifndef HAVE_EXIT_TERMINFO
+#define HAVE_EXIT_TERMINFO 1
+#endif
+
+#ifndef HAVE_FCNTL_H
+#define HAVE_FCNTL_H 0
+#endif
+
+#ifndef HAVE_FILTER
+#define HAVE_FILTER 1
+#endif
+
+#ifndef HAVE_FORM_H
+#define HAVE_FORM_H 0
+#endif
+
+#ifndef HAVE_FPATHCONF
+#define HAVE_FPATHCONF 0
+#endif
+
+#ifndef HAVE_GETAUXVAL
+#define HAVE_GETAUXVAL 0
+#endif
+
+#ifndef HAVE_GETBEGX
+#define HAVE_GETBEGX 1
+#endif
+
+#ifndef HAVE_GETCURX
+#define HAVE_GETCURX 1
+#endif
+
+#ifndef HAVE_GETCWD
+#define HAVE_GETCWD 0
+#endif
+
+#ifndef HAVE_GETEGID
+#define HAVE_GETEGID 0
+#endif
+
+#ifndef HAVE_GETEUID
+#define HAVE_GETEUID 0
+#endif
+
+#ifndef HAVE_GETMAXX
+#define HAVE_GETMAXX 1
+#endif
+
+#ifndef HAVE_GETNSTR
+#define HAVE_GETNSTR 0
+#endif
+
+#ifndef HAVE_GETOPT_H
+#define HAVE_GETOPT_H 0
+#endif
+
+#ifndef HAVE_GETPARX
+#define HAVE_GETPARX 1
+#endif
+
+#ifndef HAVE_GETTIMEOFDAY
+#define HAVE_GETTIMEOFDAY 0
+#endif
+
+#ifndef HAVE_GETTTYNAM
+#define HAVE_GETTTYNAM 0
+#endif
+
+#ifndef HAVE_GETUID
+#define HAVE_GETUID 0
+#endif
+
+#ifndef HAVE_GETWIN
+#define HAVE_GETWIN 1
+#endif
+
+#ifndef HAVE_GPM_H
+#define HAVE_GPM_H 0
+#endif
+
+#ifndef HAVE_GPP_BUILTIN_H
+#define HAVE_GPP_BUILTIN_H 0
+#endif
+
+#ifndef HAVE_GXX_BUILTIN_H
+#define HAVE_GXX_BUILTIN_H 0
+#endif
+
+#ifndef HAVE_HALFDELAY
+#define HAVE_HALFDELAY 1
+#endif
+
+#ifndef HAVE_HAS_KEY
+#define HAVE_HAS_KEY 0
+#endif
+
+#ifndef HAVE_INIT_EXTENDED_COLOR
+#define HAVE_INIT_EXTENDED_COLOR 0
+#endif
+
+#ifndef HAVE_INTTYPES_H
+#define HAVE_INTTYPES_H 0
+#endif
+
+#ifndef HAVE_IOSTREAM
+#define HAVE_IOSTREAM 0
+#endif
+
+#ifndef HAVE_ISASCII
+#define HAVE_ISASCII 0
+#endif
+
+#ifndef HAVE_ISSETUGID
+#define HAVE_ISSETUGID 0
+#endif
+
+#ifndef HAVE_LANGINFO_CODESET
+#define HAVE_LANGINFO_CODESET 0
+#endif
+
+#ifndef HAVE_LIBC_H
+#define HAVE_LIBC_H 0
+#endif
+
+#ifndef HAVE_LIBDBMALLOC
+#define HAVE_LIBDBMALLOC 0
+#endif
+
+#ifndef HAVE_LIBDMALLOC
+#define HAVE_LIBDMALLOC 0
+#endif
+
+#ifndef HAVE_LIBFORM
+#define HAVE_LIBFORM 0
+#endif
+
+#ifndef HAVE_LIBGPM
+#define HAVE_LIBGPM 0
+#endif
+
+#ifndef HAVE_LIBMENU
+#define HAVE_LIBMENU 0
+#endif
+
+#ifndef HAVE_LIBMPATROL
+#define HAVE_LIBMPATROL 0
+#endif
+
+#ifndef HAVE_LIBPANEL
+#define HAVE_LIBPANEL 0
+#endif
+
+#ifndef HAVE_LIB_PCRE2
+#define HAVE_LIB_PCRE2 0
+#endif
+
+#ifndef HAVE_LIMITS_H
+#define HAVE_LIMITS_H 0
+#endif
+
+#ifndef HAVE_LINK
+#define HAVE_LINK 0
+#endif
+
+#ifndef HAVE_LOCALECONV
+#define HAVE_LOCALECONV 0
+#endif
+
+#ifndef HAVE_LOCALE_H
+#define HAVE_LOCALE_H 0
+#endif
+
+#ifndef HAVE_LONG_FILE_NAMES
+#define HAVE_LONG_FILE_NAMES 0
+#endif
+
+#ifndef HAVE_MATH_FUNCS
+#define HAVE_MATH_FUNCS 0
+#endif
+
+#ifndef HAVE_MATH_H
+#define HAVE_MATH_H 0
+#endif
+
+#ifndef HAVE_MBLEN
+#define HAVE_MBLEN 0
+#endif
+
+#ifndef HAVE_MBRLEN
+#define HAVE_MBRLEN 0
+#endif
+
+#ifndef HAVE_MBRTOWC
+#define HAVE_MBRTOWC 0
+#endif
+
+#ifndef HAVE_MBSRTOWCS
+#define HAVE_MBSRTOWCS 0
+#endif
+
+#ifndef HAVE_MBSTOWCS
+#define HAVE_MBSTOWCS 0
+#endif
+
+#ifndef HAVE_MBTOWC
+#define HAVE_MBTOWC 0
+#endif
+
+#ifndef HAVE_MENU_H
+#define HAVE_MENU_H 0
+#endif
+
+#ifndef HAVE_MKSTEMP
+#define HAVE_MKSTEMP 0
+#endif
+
+#ifndef HAVE_MVDERWIN
+#define HAVE_MVDERWIN 1
+#endif
+
+#ifndef HAVE_MVVLINE
+#define HAVE_MVVLINE 1
+#endif
+
+#ifndef HAVE_MVWIN
+#define HAVE_MVWIN 1
+#endif
+
+#ifndef HAVE_MVWVLINE
+#define HAVE_MVWVLINE 1
+#endif
+
+#ifndef HAVE_NANOSLEEP
+#define HAVE_NANOSLEEP 0
+#endif
+
+#ifndef HAVE_NAPMS
+#define HAVE_NAPMS 1
+#endif
+
+#ifndef HAVE_NC_ALLOC_H
+#define HAVE_NC_ALLOC_H 0
+#endif
+
+#ifndef HAVE_NEWPAD
+#define HAVE_NEWPAD 1
+#endif
+
+#ifndef HAVE_PANEL_H
+#define HAVE_PANEL_H 0
+#endif
+
+#ifndef HAVE_PATH_TTYS
+#define HAVE_PATH_TTYS 0
+#endif
+
+#ifndef HAVE_PCRE2POSIX_H
+#define HAVE_PCRE2POSIX_H 0
+#endif
+
+#ifndef HAVE_PCREPOSIX_H
+#define HAVE_PCREPOSIX_H 0
+#endif
+
+#ifndef HAVE_POLL
+#define HAVE_POLL 0
+#endif
+
+#ifndef HAVE_POLL_H
+#define HAVE_POLL_H 0
+#endif
+
+#ifndef HAVE_PURIFY
+#define HAVE_PURIFY 0
+#endif
+
+#ifndef HAVE_PUTENV
+#define HAVE_PUTENV 0
+#endif
+
+#ifndef HAVE_PUTWC
+#define HAVE_PUTWC 0
+#endif
+
+#ifndef HAVE_PUTWIN
+#define HAVE_PUTWIN 1
+#endif
+
+#ifndef HAVE_REGEXPR_H_FUNCS
+#define HAVE_REGEXPR_H_FUNCS 0
+#endif
+
+#ifndef HAVE_REGEXP_H_FUNCS
+#define HAVE_REGEXP_H_FUNCS 0
+#endif
+
+#ifndef HAVE_REGEX_H_FUNCS
+#define HAVE_REGEX_H_FUNCS 0
+#endif
+
+#ifndef HAVE_REMOVE
+#define HAVE_REMOVE 0
+#endif
+
+#ifndef HAVE_RESET_COLOR_PAIRS
+#define HAVE_RESET_COLOR_PAIRS 0
+#endif
+
+#ifndef HAVE_RESIZETERM
+#define HAVE_RESIZETERM 0
+#endif
+
+#ifndef HAVE_RESIZE_TERM
+#define HAVE_RESIZE_TERM 0
+#endif
+
+#ifndef HAVE_RESTARTTERM
+#define HAVE_RESTARTTERM 1
+#endif
+
+#ifndef HAVE_RIPOFFLINE
+#define HAVE_RIPOFFLINE 1
+#endif
+
+#ifndef HAVE_SCR_DUMP
+#define HAVE_SCR_DUMP 1
+#endif
+
+#ifndef HAVE_SELECT
+#define HAVE_SELECT 0
+#endif
+
+#ifndef HAVE_SETBUF
+#define HAVE_SETBUF 0
+#endif
+
+#ifndef HAVE_SETBUFFER
+#define HAVE_SETBUFFER 0
+#endif
+
+#ifndef HAVE_SETENV
+#define HAVE_SETENV 0
+#endif
+
+#ifndef HAVE_SETFSUID
+#define HAVE_SETFSUID 0
+#endif
+
+#ifndef HAVE_SETUPTERM
+#define HAVE_SETUPTERM 1
+#endif
+
+#ifndef HAVE_SETVBUF
+#define HAVE_SETVBUF 0
+#endif
+
+#ifndef HAVE_SGTTY_H
+#define HAVE_SGTTY_H 0
+#endif
+
+#ifndef HAVE_SIGACTION
+#define HAVE_SIGACTION 0
+#endif
+
+#ifndef HAVE_SIGVEC
+#define HAVE_SIGVEC 0
+#endif
+
+#ifndef HAVE_SIZECHANGE
+#define HAVE_SIZECHANGE 0
+#endif
+
+#ifndef HAVE_SLK_COLOR
+#define HAVE_SLK_COLOR 0
+#endif
+
+#ifndef HAVE_SLK_INIT
+#define HAVE_SLK_INIT 1
+#endif
+
+#ifndef HAVE_SNPRINTF
+#define HAVE_SNPRINTF 0
+#endif
+
+#ifndef HAVE_STDINT_H
+#define HAVE_STDINT_H 0
+#endif
+
+#ifndef HAVE_STRDUP
+#define HAVE_STRDUP 0
+#endif
+
+#ifndef HAVE_STRLCAT
+#define HAVE_STRLCAT 0
+#endif
+
+#ifndef HAVE_STRLCPY
+#define HAVE_STRLCPY 0
+#endif
+
+#ifndef HAVE_STRSTR
+#define HAVE_STRSTR 0
+#endif
+
+#ifndef HAVE_SYMLINK
+#define HAVE_SYMLINK 0
+#endif
+
+#ifndef HAVE_SYSCONF
+#define HAVE_SYSCONF 0
+#endif
+
+#ifndef HAVE_SYS_BSDTYPES_H
+#define HAVE_SYS_BSDTYPES_H 0
+#endif
+
+#ifndef HAVE_SYS_AUXV_H
+#define HAVE_SYS_AUXV_H 0
+#endif
+
+#ifndef HAVE_SYS_IOCTL_H
+#define HAVE_SYS_IOCTL_H 0
+#endif
+
+#ifndef HAVE_SYS_PARAM_H
+#define HAVE_SYS_PARAM_H 0
+#endif
+
+#ifndef HAVE_SYS_POLL_H
+#define HAVE_SYS_POLL_H 0
+#endif
+
+#ifndef HAVE_SYS_SELECT_H
+#define HAVE_SYS_SELECT_H 0
+#endif
+
+#ifndef HAVE_SYS_TERMIO_H
+#define HAVE_SYS_TERMIO_H 0
+#endif
+
+#ifndef HAVE_SYS_TIMES_H
+#define HAVE_SYS_TIMES_H 0
+#endif
+
+#ifndef HAVE_SYS_TIME_H
+#define HAVE_SYS_TIME_H 0
+#endif
+
+#ifndef HAVE_SYS_TIME_SELECT
+#define HAVE_SYS_TIME_SELECT 0
+#endif
+
+#ifndef HAVE_TCGETATTR
+#define HAVE_TCGETATTR 0
+#endif
+
+#ifndef HAVE_TCGETPGRP
+#define HAVE_TCGETPGRP 0
+#endif
+
+#ifndef HAVE_TELL
+#define HAVE_TELL 0
+#endif
+
+#ifndef HAVE_TERMATTRS
+#define HAVE_TERMATTRS 1
+#endif
+
+#ifndef HAVE_TERMCAP_H
+#define HAVE_TERMCAP_H 1
+#endif
+
+#ifndef HAVE_TERMIOS_H
+#define HAVE_TERMIOS_H 0
+#endif
+
+#ifndef HAVE_TERMIO_H
+#define HAVE_TERMIO_H 0
+#endif
+
+#ifndef HAVE_TERMNAME
+#define HAVE_TERMNAME 1
+#endif
+
+#ifndef HAVE_TERM_ENTRY_H
+#define HAVE_TERM_ENTRY_H 1
+#endif
+
+#ifndef HAVE_TERM_H
+#define HAVE_TERM_H 1
+#endif
+
+#ifndef HAVE_TGETENT
+#define HAVE_TGETENT 1
+#endif
+
+#ifndef HAVE_TIGETNUM
+#define HAVE_TIGETNUM 1
+#endif
+
+#ifndef HAVE_TIGETSTR
+#define HAVE_TIGETSTR 1
+#endif
+
+#ifndef HAVE_TIPARM
+#define HAVE_TIPARM 1
+#endif
+
+#ifndef HAVE_TIPARM_S
+#define HAVE_TIPARM_S 1
+#endif
+
+#ifndef HAVE_TISCAN_S
+#define HAVE_TISCAN_S 1
+#endif
+
+#ifndef HAVE_TIMES
+#define HAVE_TIMES 0
+#endif
+
+#ifndef HAVE_TPUTS_SP
+#define HAVE_TPUTS_SP 0
+#endif
+
+#ifndef HAVE_TSEARCH
+#define HAVE_TSEARCH 0
+#endif
+
+#ifndef HAVE_TYPEAHEAD
+#define HAVE_TYPEAHEAD 1
+#endif
+
+#ifndef HAVE_TYPEINFO
+#define HAVE_TYPEINFO 0
+#endif
+
+#ifndef HAVE_TYPE_ATTR_T
+#define HAVE_TYPE_ATTR_T 0
+#endif
+
+#ifndef HAVE_TYPE_SIGACTION
+#define HAVE_TYPE_SIGACTION 0
+#endif
+
+#ifndef HAVE_UNCTRL_H
+#define HAVE_UNCTRL_H 1
+#endif
+
+#ifndef HAVE_UNGET_WCH
+#define HAVE_UNGET_WCH 1
+#endif
+
+#ifndef HAVE_UNISTD_H
+#define HAVE_UNISTD_H 0
+#endif
+
+#ifndef HAVE_UNLINK
+#define HAVE_UNLINK 0
+#endif
+
+#ifndef HAVE_USE_DEFAULT_COLORS
+#define HAVE_USE_DEFAULT_COLORS 0
+#endif
+
+#ifndef HAVE_USE_ENV
+#define HAVE_USE_ENV 1
+#endif
+
+#ifndef HAVE_USE_EXTENDED_NAMES
+#define HAVE_USE_EXTENDED_NAMES NCURSES_XNAMES
+#endif
+
+#ifndef HAVE_USE_SCREEN
+#define HAVE_USE_SCREEN 0
+#endif
+
+#ifndef HAVE_USE_WINDOW
+#define HAVE_USE_WINDOW 0
+#endif
+
+#ifndef HAVE_VFSCANF
+#define HAVE_VFSCANF 0
+#endif
+
+#ifndef HAVE_VIDPUTS
+#define HAVE_VIDPUTS 1
+#endif
+
+#ifndef HAVE_VID_PUTS
+#define HAVE_VID_PUTS 1
+#endif
+
+#ifndef HAVE_VSNPRINTF
+#define HAVE_VSNPRINTF 0
+#endif
+
+#ifndef HAVE_VSSCANF
+#define HAVE_VSSCANF 0
+#endif
+
+#ifndef HAVE_VW_PRINTW
+#define HAVE_VW_PRINTW 1
+#endif
+
+#ifndef HAVE_WCHGAT
+#define HAVE_WCHGAT 1
+#endif
+
+#ifndef HAVE_WCSRTOMBS
+#define HAVE_WCSRTOMBS 0
+#endif
+
+#ifndef HAVE_WCSTOMBS
+#define HAVE_WCSTOMBS 0
+#endif
+
+#ifndef HAVE_WCTOB
+#define HAVE_WCTOB 0
+#endif
+
+#ifndef HAVE_WCTOMB
+#define HAVE_WCTOMB 0
+#endif
+
+#ifndef HAVE_WCTYPE_H
+#define HAVE_WCTYPE_H 0
+#endif
+
+#ifndef HAVE_WINSDELLN
+#define HAVE_WINSDELLN 1
+#endif
+
+#ifndef HAVE_WINSSTR
+#define HAVE_WINSSTR 1
+#endif
+
+#ifndef HAVE_WMEMCHR
+#define HAVE_WMEMCHR 0
+#endif
+
+#ifndef HAVE_WORKING_POLL
+#define HAVE_WORKING_POLL 0
+#endif
+
+#ifndef HAVE_WRESIZE
+#define HAVE_WRESIZE 0
+#endif
+
+#ifndef HAVE_WSYNCDOWN
+#define HAVE_WSYNCDOWN 1
+#endif
+
+#ifndef HAVE__DOSCAN
+#define HAVE__DOSCAN 0
+#endif
+
+#ifndef HAVE__TRACEF
+#define HAVE__TRACEF 0
+#endif
+
+#ifndef HAVE__NC_TPARM_ANALYZE
+#define HAVE__NC_TPARM_ANALYZE 1
+#endif
+
+#ifndef MIXEDCASE_FILENAMES
+#define MIXEDCASE_FILENAMES 0
+#endif
+
+#ifndef NCURSES_CHAR_EQ
+#define NCURSES_CHAR_EQ 0
+#endif
+
+#ifndef NCURSES_EXPANDED
+#define NCURSES_EXPANDED 0
+#endif
+
+#ifndef NCURSES_EXT_COLORS
+#define NCURSES_EXT_COLORS 0
+#endif
+
+#ifndef NCURSES_EXT_FUNCS
+#define NCURSES_EXT_FUNCS 0
+#endif
+
+#ifndef NCURSES_EXT_PUTWIN
+#define NCURSES_EXT_PUTWIN 0
+#endif
+
+#ifndef NCURSES_NO_PADDING
+#define NCURSES_NO_PADDING 0
+#endif
+
+#ifndef NCURSES_OSPEED_COMPAT
+#define NCURSES_OSPEED_COMPAT 0
+#endif
+
+#ifndef NCURSES_PATHSEP
+#define NCURSES_PATHSEP ':'
+#endif
+
+#ifndef NCURSES_WIDECHAR
+#define NCURSES_WIDECHAR 0
+#endif
+
+#ifndef NEED_PTEM_H
+#define NEED_PTEM_H 0
+#endif
+
+#ifndef NO_LEAKS
+#define NO_LEAKS 0
+#endif
+
+#ifndef PURE_TERMINFO
+#define PURE_TERMINFO 0
+#endif
+
+#ifndef STDC_HEADERS
+#define STDC_HEADERS 0
+#endif
+
+#ifndef SVR4_ACTION
+#define SVR4_ACTION 0
+#endif
+
+#ifndef SVR4_TERMIO
+#define SVR4_TERMIO 0
+#endif
+
+#ifndef SYSTEM_NAME
+#define SYSTEM_NAME "unknown"
+#endif
+
+#ifndef TERMINFO
+#define TERMINFO "none"
+#endif
+
+#ifndef TERMPATH
+#define TERMPATH "none"
+#endif
+
+#ifndef TIME_WITH_SYS_TIME
+#define TIME_WITH_SYS_TIME 0
+#endif
+
+#ifndef TYPEOF_CHTYPE
+#define TYPEOF_CHTYPE 0
+#endif
+
+#ifndef USE_COLORFGBG
+#define USE_COLORFGBG 0
+#endif
+
+#ifndef USE_FOPEN_BIN_R
+#define USE_FOPEN_BIN_R 0
+#endif
+
+#ifndef USE_GETCAP
+#define USE_GETCAP 0
+#endif
+
+#ifndef USE_GETCAP_CACHE
+#define USE_GETCAP_CACHE 0
+#endif
+
+#ifndef USE_HARD_TABS
+#define USE_HARD_TABS 0
+#endif
+
+#ifndef USE_HASHED_DB
+#define USE_HASHED_DB 0
+#endif
+
+#ifndef USE_HASHMAP
+#define USE_HASHMAP 0
+#endif
+
+#ifndef USE_HOME_TERMINFO
+#define USE_HOME_TERMINFO 0
+#endif
+
+#ifndef USE_LINKS
+#define USE_LINKS 0
+#endif
+
+#ifndef USE_MY_MEMMOVE
+#define USE_MY_MEMMOVE 0
+#endif
+
+#ifndef USE_OK_BCOPY
+#define USE_OK_BCOPY 0
+#endif
+
+#ifndef USE_PTHREADS_EINTR
+#define USE_PTHREADS_EINTR 0
+#endif
+
+#ifndef USE_RCS_IDS
+#define USE_RCS_IDS 0
+#endif
+
+#ifndef USE_REENTRANT
+#define USE_REENTRANT 0
+#endif
+
+#ifndef USE_SAFE_SPRINTF
+#define USE_SAFE_SPRINTF 0
+#endif
+
+#ifndef USE_SCROLL_HINTS
+#define USE_SCROLL_HINTS 0
+#endif
+
+#ifndef USE_SIGWINCH
+#define USE_SIGWINCH 0
+#endif
+
+#ifndef USE_STRING_HACKS
+#define USE_STRING_HACKS 0
+#endif
+
+#ifndef USE_SYMLINKS
+#define USE_SYMLINKS 0
+#endif
+
+#ifndef USE_SYSMOUSE
+#define USE_SYSMOUSE 0
+#endif
+
+#ifndef USE_WEAK_SYMBOLS
+#define USE_WEAK_SYMBOLS 0
+#endif
+
+#ifndef USE_WIDEC_SUPPORT
+#define USE_WIDEC_SUPPORT 0
+#endif
+
+#ifndef USE_XMC_SUPPORT
+#define USE_XMC_SUPPORT 0
+#endif
+
+#endif /* NC_DEFINE_H */
diff --git a/include/ncurses_dll.h b/include/ncurses_dll.h
new file mode 100644
index 0000000..2a6055f
--- /dev/null
+++ b/include/ncurses_dll.h
@@ -0,0 +1,103 @@
+/****************************************************************************
+ * Copyright 2018-2020,2023 Thomas E. Dickey                                *
+ * Copyright 2009,2014 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.                                                           *
+ ****************************************************************************/
+/* $Id: ncurses_dll.h.in,v 1.18 2023/05/06 20:12:43 tom Exp $ */
+
+#ifndef NCURSES_DLL_H_incl
+#define NCURSES_DLL_H_incl 1
+
+/*
+ * MinGW gcc (unlike MSYS2 and Cygwin) should define _WIN32 and possibly _WIN64.
+ */
+#if defined(__MINGW64__)
+
+#ifndef _WIN64
+#define _WIN64 1
+#endif
+
+#elif defined(__MINGW32__)
+
+#ifndef _WIN32
+#define _WIN32 1
+#endif
+
+/* 2014-08-02 workaround for broken MinGW compiler.
+ * Oddly, only TRACE is mapped to trace - the other -D's are okay.
+ * suggest TDM as an alternative.
+ */
+#if (__GNUC__ == 4) && (__GNUC_MINOR__ == 8)
+
+#ifdef trace
+#undef trace
+#define TRACE
+#endif
+
+#endif	/* broken compiler */
+
+#endif	/* MingW */
+
+/*
+ * For reentrant code, we map the various global variables into SCREEN by
+ * using functions to access them.
+ */
+#define NCURSES_PUBLIC_VAR(name) _nc_##name
+
+#if defined(BUILDING_NCURSES)
+# define NCURSES_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT
+#else
+# define NCURSES_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT
+#endif
+
+#define NCURSES_WRAPPED_VAR(type,name) extern NCURSES_IMPEXP type NCURSES_PUBLIC_VAR(name)(void)
+
+#define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API
+#define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type
+
+/*
+ * These symbols hide dllimport/dllexport, for compilers which care about it.
+ */
+#if defined(__CYGWIN__) || (defined(_WIN32) || defined(_WIN64))
+# if defined(NCURSES_STATIC)	/* "static" here only implies "not-a-DLL" */
+#   define NCURSES_EXPORT_GENERAL_IMPORT
+#   define NCURSES_EXPORT_GENERAL_EXPORT
+# else
+#   define NCURSES_EXPORT_GENERAL_IMPORT __declspec(dllimport)
+#   define NCURSES_EXPORT_GENERAL_EXPORT __declspec(dllexport)
+# endif
+# define NCURSES_API __cdecl
+#else
+# define NCURSES_EXPORT_GENERAL_IMPORT
+# if (__GNUC__ >= 4) && !defined(__cplusplus)
+#   define NCURSES_EXPORT_GENERAL_EXPORT __attribute__((visibility ("default")))
+# else
+#   define NCURSES_EXPORT_GENERAL_EXPORT
+# endif
+# define NCURSES_API /* FIXME: __attribute__ ((cdecl)) is only available on x86 */
+#endif
+
+#endif /* NCURSES_DLL_H_incl */
diff --git a/include/panel.h b/include/panel.h
new file mode 100644
index 0000000..62acc8f
--- /dev/null
+++ b/include/panel.h
@@ -0,0 +1,100 @@
+/****************************************************************************
+ * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 1998-2009,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: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995                    *
+ *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Juergen Pfeifer                         1996-1999,2008          *
+ ****************************************************************************/
+
+/* $Id: panel.h,v 1.14 2020/07/04 20:38:43 tom Exp $ */
+
+/* panel.h -- interface file for panels library */
+
+#ifndef NCURSES_PANEL_H_incl
+#define NCURSES_PANEL_H_incl 1
+
+#include <curses.h>
+
+typedef struct panel
+#if !NCURSES_OPAQUE_PANEL
+{
+  WINDOW *win;
+  struct panel *below;
+  struct panel *above;
+  NCURSES_CONST void *user;
+}
+#endif /* !NCURSES_OPAQUE_PANEL */
+PANEL;
+
+#if	defined(__cplusplus)
+extern "C" {
+#endif
+
+#if defined(BUILDING_PANEL)
+# define PANEL_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT
+#else
+# define PANEL_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT
+#endif
+
+#define PANEL_WRAPPED_VAR(type,name) extern PANEL_IMPEXP type NCURSES_PUBLIC_VAR(name)(void)
+
+#define PANEL_EXPORT(type) PANEL_IMPEXP type NCURSES_API
+#define PANEL_EXPORT_VAR(type) PANEL_IMPEXP type
+
+extern PANEL_EXPORT(WINDOW*) panel_window (const PANEL *);
+extern PANEL_EXPORT(void)    update_panels (void);
+extern PANEL_EXPORT(int)     hide_panel (PANEL *);
+extern PANEL_EXPORT(int)     show_panel (PANEL *);
+extern PANEL_EXPORT(int)     del_panel (PANEL *);
+extern PANEL_EXPORT(int)     top_panel (PANEL *);
+extern PANEL_EXPORT(int)     bottom_panel (PANEL *);
+extern PANEL_EXPORT(PANEL*)  new_panel (WINDOW *);
+extern PANEL_EXPORT(PANEL*)  panel_above (const PANEL *);
+extern PANEL_EXPORT(PANEL*)  panel_below (const PANEL *);
+extern PANEL_EXPORT(int)     set_panel_userptr (PANEL *, NCURSES_CONST void *);
+extern PANEL_EXPORT(NCURSES_CONST void*) panel_userptr (const PANEL *);
+extern PANEL_EXPORT(int)     move_panel (PANEL *, int, int);
+extern PANEL_EXPORT(int)     replace_panel (PANEL *,WINDOW *);
+extern PANEL_EXPORT(int)     panel_hidden (const PANEL *);
+
+#if NCURSES_SP_FUNCS
+extern PANEL_EXPORT(PANEL *) ground_panel(SCREEN *);
+extern PANEL_EXPORT(PANEL *) ceiling_panel(SCREEN *);
+
+extern PANEL_EXPORT(void)    NCURSES_SP_NAME(update_panels) (SCREEN*);
+#endif
+
+#if	defined(__cplusplus)
+}
+#endif
+
+#endif /* NCURSES_PANEL_H_incl */
+
+/* end of panel.h */
diff --git a/include/parametrized.h b/include/parametrized.h
new file mode 100644
index 0000000..687cda6
--- /dev/null
+++ b/include/parametrized.h
@@ -0,0 +1,429 @@
+#ifndef PARAMETRIZED_H
+#define PARAMETRIZED_H 1
+/*
+ * parametrized.h --- is a termcap capability parametrized?
+ *
+ * Note: this file is generated using MKparametrized.sh, do not edit by hand.
+ * A value of -1 in the table means suppress both pad and % translations.
+ * A value of 0 in the table means do pad but not % translations.
+ * A value of 1 in the table means do both pad and % translations.
+ */
+
+static short const parametrized[] = {
+0,	/*  cbt  */
+0,	/*  bel  */
+0,	/*  cr  */
+1,	/*  csr  */
+0,	/*  tbc  */
+0,	/*  clear  */
+0,	/*  el  */
+0,	/*  ed  */
+1,	/*  hpa  */
+0,	/*  cmdch  */
+1,	/*  cup  */
+0,	/*  cud1  */
+0,	/*  home  */
+0,	/*  civis  */
+0,	/*  cub1  */
+1,	/*  mrcup  */
+0,	/*  cnorm  */
+0,	/*  cuf1  */
+0,	/*  ll  */
+0,	/*  cuu1  */
+0,	/*  cvvis  */
+0,	/*  dch1  */
+0,	/*  dl1  */
+0,	/*  dsl  */
+0,	/*  hd  */
+0,	/*  smacs  */
+0,	/*  blink  */
+0,	/*  bold  */
+0,	/*  smcup  */
+0,	/*  smdc  */
+0,	/*  dim  */
+0,	/*  smir  */
+0,	/*  invis  */
+0,	/*  prot  */
+0,	/*  rev  */
+0,	/*  smso  */
+0,	/*  smul  */
+1,	/*  ech  */
+0,	/*  rmacs  */
+0,	/*  sgr0  */
+0,	/*  rmcup  */
+0,	/*  rmdc  */
+0,	/*  rmir  */
+0,	/*  rmso  */
+0,	/*  rmul  */
+0,	/*  flash  */
+0,	/*  ff  */
+0,	/*  fsl  */
+0,	/*  is1  */
+0,	/*  is2  */
+0,	/*  is3  */
+0,	/*  if  */
+0,	/*  ich1  */
+0,	/*  il1  */
+0,	/*  ip  */
+0,	/*  kbs  */
+0,	/*  ktbc  */
+0,	/*  kclr  */
+0,	/*  kctab  */
+0,	/*  kdch1  */
+0,	/*  kdl1  */
+0,	/*  kcud1  */
+0,	/*  krmir  */
+0,	/*  kel  */
+0,	/*  ked  */
+0,	/*  kf0  */
+0,	/*  kf1  */
+0,	/*  kf10  */
+0,	/*  kf2  */
+0,	/*  kf3  */
+0,	/*  kf4  */
+0,	/*  kf5  */
+0,	/*  kf6  */
+0,	/*  kf7  */
+0,	/*  kf8  */
+0,	/*  kf9  */
+0,	/*  khome  */
+0,	/*  kich1  */
+0,	/*  kil1  */
+0,	/*  kcub1  */
+0,	/*  kll  */
+0,	/*  knp  */
+0,	/*  kpp  */
+0,	/*  kcuf1  */
+0,	/*  kind  */
+0,	/*  kri  */
+0,	/*  khts  */
+0,	/*  kcuu1  */
+0,	/*  rmkx  */
+0,	/*  smkx  */
+0,	/*  lf0  */
+0,	/*  lf1  */
+0,	/*  lf10  */
+0,	/*  lf2  */
+0,	/*  lf3  */
+0,	/*  lf4  */
+0,	/*  lf5  */
+0,	/*  lf6  */
+0,	/*  lf7  */
+0,	/*  lf8  */
+0,	/*  lf9  */
+0,	/*  rmm  */
+0,	/*  smm  */
+0,	/*  nel  */
+0,	/*  pad  */
+1,	/*  dch  */
+1,	/*  dl  */
+1,	/*  cud  */
+1,	/*  ich  */
+1,	/*  indn  */
+1,	/*  il  */
+1,	/*  cub  */
+1,	/*  cuf  */
+1,	/*  rin  */
+1,	/*  cuu  */
+1,	/*  pfkey  */
+1,	/*  pfloc  */
+1,	/*  pfx  */
+0,	/*  mc0  */
+0,	/*  mc4  */
+0,	/*  mc5  */
+1,	/*  rep  */
+0,	/*  rs1  */
+0,	/*  rs2  */
+0,	/*  rs3  */
+0,	/*  rf  */
+0,	/*  rc  */
+1,	/*  vpa  */
+0,	/*  sc  */
+0,	/*  ind  */
+0,	/*  ri  */
+1,	/*  sgr  */
+0,	/*  hts  */
+1,	/*  wind  */
+0,	/*  ht  */
+1,	/*  tsl  */
+0,	/*  uc  */
+0,	/*  hu  */
+0,	/*  iprog  */
+0,	/*  ka1  */
+0,	/*  ka3  */
+0,	/*  kb2  */
+0,	/*  kc1  */
+0,	/*  kc3  */
+1,	/*  mc5p  */
+0,	/*  rmp  */
+-1,	/*  acsc  */
+1,	/*  pln  */
+0,	/*  kcbt  */
+0,	/*  smxon  */
+0,	/*  rmxon  */
+0,	/*  smam  */
+0,	/*  rmam  */
+0,	/*  xonc  */
+0,	/*  xoffc  */
+0,	/*  enacs  */
+0,	/*  smln  */
+0,	/*  rmln  */
+0,	/*  kbeg  */
+0,	/*  kcan  */
+0,	/*  kclo  */
+0,	/*  kcmd  */
+0,	/*  kcpy  */
+0,	/*  kcrt  */
+0,	/*  kend  */
+0,	/*  kent  */
+0,	/*  kext  */
+0,	/*  kfnd  */
+0,	/*  khlp  */
+0,	/*  kmrk  */
+0,	/*  kmsg  */
+0,	/*  kmov  */
+0,	/*  knxt  */
+0,	/*  kopn  */
+0,	/*  kopt  */
+0,	/*  kprv  */
+0,	/*  kprt  */
+0,	/*  krdo  */
+0,	/*  kref  */
+0,	/*  krfr  */
+0,	/*  krpl  */
+0,	/*  krst  */
+0,	/*  kres  */
+0,	/*  ksav  */
+0,	/*  kspd  */
+0,	/*  kund  */
+0,	/*  kBEG  */
+0,	/*  kCAN  */
+0,	/*  kCMD  */
+0,	/*  kCPY  */
+0,	/*  kCRT  */
+0,	/*  kDC  */
+0,	/*  kDL  */
+0,	/*  kslt  */
+0,	/*  kEND  */
+0,	/*  kEOL  */
+0,	/*  kEXT  */
+0,	/*  kFND  */
+1,	/*  kHLP  */
+1,	/*  kHOM  */
+1,	/*  kIC  */
+1,	/*  kLFT  */
+0,	/*  kMSG  */
+0,	/*  kMOV  */
+0,	/*  kNXT  */
+0,	/*  kOPT  */
+0,	/*  kPRV  */
+0,	/*  kPRT  */
+0,	/*  kRDO  */
+0,	/*  kRPL  */
+0,	/*  kRIT  */
+0,	/*  kRES  */
+0,	/*  kSAV  */
+0,	/*  kSPD  */
+0,	/*  kUND  */
+0,	/*  rfi  */
+0,	/*  kf11  */
+0,	/*  kf12  */
+0,	/*  kf13  */
+0,	/*  kf14  */
+0,	/*  kf15  */
+0,	/*  kf16  */
+0,	/*  kf17  */
+0,	/*  kf18  */
+0,	/*  kf19  */
+0,	/*  kf20  */
+0,	/*  kf21  */
+0,	/*  kf22  */
+0,	/*  kf23  */
+0,	/*  kf24  */
+0,	/*  kf25  */
+0,	/*  kf26  */
+0,	/*  kf27  */
+0,	/*  kf28  */
+0,	/*  kf29  */
+0,	/*  kf30  */
+0,	/*  kf31  */
+0,	/*  kf32  */
+0,	/*  kf33  */
+0,	/*  kf34  */
+0,	/*  kf35  */
+0,	/*  kf36  */
+0,	/*  kf37  */
+0,	/*  kf38  */
+0,	/*  kf39  */
+0,	/*  kf40  */
+0,	/*  kf41  */
+0,	/*  kf42  */
+0,	/*  kf43  */
+0,	/*  kf44  */
+0,	/*  kf45  */
+0,	/*  kf46  */
+0,	/*  kf47  */
+0,	/*  kf48  */
+0,	/*  kf49  */
+0,	/*  kf50  */
+0,	/*  kf51  */
+0,	/*  kf52  */
+0,	/*  kf53  */
+0,	/*  kf54  */
+0,	/*  kf55  */
+0,	/*  kf56  */
+0,	/*  kf57  */
+0,	/*  kf58  */
+0,	/*  kf59  */
+0,	/*  kf60  */
+0,	/*  kf61  */
+0,	/*  kf62  */
+0,	/*  kf63  */
+0,	/*  el1  */
+0,	/*  mgc  */
+0,	/*  smgl  */
+0,	/*  smgr  */
+-1,	/*  fln  */
+1,	/*  sclk  */
+0,	/*  dclk  */
+0,	/*  rmclk  */
+1,	/*  cwin  */
+1,	/*  wingo  */
+0,	/*  hup  */
+1,	/*  dial  */
+1,	/*  qdial  */
+0,	/*  tone  */
+0,	/*  pulse  */
+0,	/*  hook  */
+0,	/*  pause  */
+0,	/*  wait  */
+1,	/*  u0  */
+1,	/*  u1  */
+1,	/*  u2  */
+1,	/*  u3  */
+1,	/*  u4  */
+1,	/*  u5  */
+1,	/*  u6  */
+1,	/*  u7  */
+1,	/*  u8  */
+1,	/*  u9  */
+0,	/*  op  */
+0,	/*  oc  */
+1,	/*  initc  */
+1,	/*  initp  */
+1,	/*  scp  */
+1,	/*  setf  */
+1,	/*  setb  */
+1,	/*  cpi  */
+1,	/*  lpi  */
+1,	/*  chr  */
+1,	/*  cvr  */
+1,	/*  defc  */
+0,	/*  swidm  */
+0,	/*  sdrfq  */
+0,	/*  sitm  */
+0,	/*  slm  */
+0,	/*  smicm  */
+0,	/*  snlq  */
+0,	/*  snrmq  */
+0,	/*  sshm  */
+0,	/*  ssubm  */
+0,	/*  ssupm  */
+0,	/*  sum  */
+0,	/*  rwidm  */
+0,	/*  ritm  */
+0,	/*  rlm  */
+0,	/*  rmicm  */
+0,	/*  rshm  */
+0,	/*  rsubm  */
+0,	/*  rsupm  */
+0,	/*  rum  */
+0,	/*  mhpa  */
+0,	/*  mcud1  */
+0,	/*  mcub1  */
+0,	/*  mcuf1  */
+1,	/*  mvpa  */
+0,	/*  mcuu1  */
+0,	/*  porder  */
+0,	/*  mcud  */
+0,	/*  mcub  */
+0,	/*  mcuf  */
+0,	/*  mcuu  */
+1,	/*  scs  */
+0,	/*  smgb  */
+1,	/*  smgbp  */
+1,	/*  smglp  */
+1,	/*  smgrp  */
+0,	/*  smgt  */
+1,	/*  smgtp  */
+0,	/*  sbim  */
+1,	/*  scsd  */
+0,	/*  rbim  */
+1,	/*  rcsd  */
+0,	/*  subcs  */
+0,	/*  supcs  */
+0,	/*  docr  */
+0,	/*  zerom  */
+1,	/*  csnm  */
+0,	/*  kmous  */
+0,	/*  minfo  */
+0,	/*  reqmp  */
+1,	/*  getm  */
+1,	/*  setaf  */
+1,	/*  setab  */
+1,	/*  pfxl  */
+0,	/*  devt  */
+0,	/*  csin  */
+0,	/*  s0ds  */
+0,	/*  s1ds  */
+0,	/*  s2ds  */
+0,	/*  s3ds  */
+1,	/*  smglr  */
+1,	/*  smgtb  */
+1,	/*  birep  */
+0,	/*  binel  */
+0,	/*  bicr  */
+1,	/*  colornm  */
+0,	/*  defbi  */
+0,	/*  endbi  */
+1,	/*  setcolor  */
+1,	/*  slines  */
+1,	/*  dispc  */
+0,	/*  smpch  */
+0,	/*  rmpch  */
+0,	/*  smsc  */
+0,	/*  rmsc  */
+0,	/*  pctrm  */
+0,	/*  scesc  */
+0,	/*  scesa  */
+0,	/*  ehhlm  */
+0,	/*  elhlm  */
+0,	/*  elohlm  */
+0,	/*  erhlm  */
+0,	/*  ethlm  */
+0,	/*  evhlm  */
+1,	/*  sgr1  */
+1,	/*  slength  */
+0,	/*  OTi2  */
+0,	/*  OTrs  */
+0,	/*  OTnl  */
+0,	/*  OTbc  */
+0,	/*  OTko  */
+0,	/*  OTma  */
+-1,	/*  OTG2  */
+-1,	/*  OTG3  */
+-1,	/*  OTG1  */
+-1,	/*  OTG4  */
+-1,	/*  OTGR  */
+-1,	/*  OTGL  */
+-1,	/*  OTGU  */
+-1,	/*  OTGD  */
+-1,	/*  OTGH  */
+-1,	/*  OTGV  */
+-1,	/*  OTGC  */
+0,	/*  meml  */
+0,	/*  memu  */
+0,	/*  box1  */
+} /* 414 entries */;
+
+#endif /* PARAMETRIZED_H */
diff --git a/include/term.h b/include/term.h
new file mode 100644
index 0000000..c6fb09b
--- /dev/null
+++ b/include/term.h
@@ -0,0 +1,890 @@
+/****************************************************************************
+ * Copyright 2018-2021,2023 Thomas E. Dickey                                *
+ * Copyright 1998-2013,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: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995                */
+/*    and: Eric S. Raymond <esr@snark.thyrsus.com>                          */
+/*    and: Thomas E. Dickey                        1995-on                  */
+/****************************************************************************/
+
+/* $Id: MKterm.h.awk.in,v 1.85 2023/04/23 19:15:36 tom Exp $ */
+
+/*
+**	term.h -- Definition of struct term
+*/
+
+#ifndef NCURSES_TERM_H_incl
+#define NCURSES_TERM_H_incl 1
+
+#undef  NCURSES_VERSION
+#define NCURSES_VERSION "6.5"
+
+#include <ncurses_dll.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Make this file self-contained by providing defaults for the HAVE_TERMIO[S]_H
+ * definition (based on the system for which this was configured).
+ */
+
+#ifndef __NCURSES_H
+
+typedef struct screen  SCREEN;
+
+#if 1
+#undef  NCURSES_SP_FUNCS
+#define NCURSES_SP_FUNCS 20240427
+#undef  NCURSES_SP_NAME
+#define NCURSES_SP_NAME(name) name##_sp
+
+/* Define the sp-funcs helper function */
+#undef  NCURSES_SP_OUTC
+#define NCURSES_SP_OUTC NCURSES_SP_NAME(NCURSES_OUTC)
+typedef int (*NCURSES_SP_OUTC)(SCREEN*, int);
+#endif
+
+#endif /* __NCURSES_H */
+
+#undef  NCURSES_CONST
+#define NCURSES_CONST const
+
+#undef  NCURSES_SBOOL
+#define NCURSES_SBOOL char
+
+#undef  NCURSES_USE_DATABASE
+#define NCURSES_USE_DATABASE 1
+
+#undef  NCURSES_USE_TERMCAP
+#define NCURSES_USE_TERMCAP 0
+
+#undef  NCURSES_XNAMES
+#define NCURSES_XNAMES 1
+
+/* We will use these symbols to hide differences between
+ * termios/termio/sgttyb interfaces.
+ */
+#undef  TTY
+#undef  SET_TTY
+#undef  GET_TTY
+
+/* Assume POSIX termio if we have the header and function */
+/* #if HAVE_TERMIOS_H && HAVE_TCGETATTR */
+#if 1 && 1
+
+#undef  TERMIOS
+#define TERMIOS 1
+
+#include <termios.h>
+#define TTY struct termios
+
+#else /* !HAVE_TERMIOS_H */
+
+/* #if HAVE_TERMIO_H */
+#if 1
+
+#undef  TERMIOS
+#define TERMIOS 1
+
+#include <termio.h>
+#define TTY struct termio
+
+#else /* !HAVE_TERMIO_H */
+
+#if (defined(_WIN32) || defined(_WIN64))
+#if 0
+#include <win32_curses.h>
+#define TTY struct winconmode
+#else
+#include <ncurses_mingw.h>
+#define TTY struct termios
+#endif
+#else
+#undef TERMIOS
+#include <sgtty.h>
+#include <sys/ioctl.h>
+#define TTY struct sgttyb
+#endif /* MINGW32 */
+#endif /* HAVE_TERMIO_H */
+
+#endif /* HAVE_TERMIOS_H */
+
+#ifdef TERMIOS
+#define GET_TTY(fd, buf) tcgetattr(fd, buf)
+#define SET_TTY(fd, buf) tcsetattr(fd, TCSADRAIN, buf)
+#elif 0 && (defined(_WIN32) || defined(_WIN64))
+#define GET_TTY(fd, buf) _nc_console_getmode(_nc_console_fd2handle(fd),buf)
+#define SET_TTY(fd, buf) _nc_console_setmode(_nc_console_fd2handle(fd),buf)
+#else
+#define GET_TTY(fd, buf) gtty(fd, buf)
+#define SET_TTY(fd, buf) stty(fd, buf)
+#endif
+
+#ifndef	GCC_NORETURN
+#define	GCC_NORETURN /* nothing */
+#endif
+
+#define NAMESIZE 256
+
+/* The cast works because TERMTYPE is the first data in TERMINAL */
+#define CUR ((TERMTYPE *)(cur_term))->
+
+#define auto_left_margin               CUR Booleans[0]
+#define auto_right_margin              CUR Booleans[1]
+#define no_esc_ctlc                    CUR Booleans[2]
+#define ceol_standout_glitch           CUR Booleans[3]
+#define eat_newline_glitch             CUR Booleans[4]
+#define erase_overstrike               CUR Booleans[5]
+#define generic_type                   CUR Booleans[6]
+#define hard_copy                      CUR Booleans[7]
+#define has_meta_key                   CUR Booleans[8]
+#define has_status_line                CUR Booleans[9]
+#define insert_null_glitch             CUR Booleans[10]
+#define memory_above                   CUR Booleans[11]
+#define memory_below                   CUR Booleans[12]
+#define move_insert_mode               CUR Booleans[13]
+#define move_standout_mode             CUR Booleans[14]
+#define over_strike                    CUR Booleans[15]
+#define status_line_esc_ok             CUR Booleans[16]
+#define dest_tabs_magic_smso           CUR Booleans[17]
+#define tilde_glitch                   CUR Booleans[18]
+#define transparent_underline          CUR Booleans[19]
+#define xon_xoff                       CUR Booleans[20]
+#define needs_xon_xoff                 CUR Booleans[21]
+#define prtr_silent                    CUR Booleans[22]
+#define hard_cursor                    CUR Booleans[23]
+#define non_rev_rmcup                  CUR Booleans[24]
+#define no_pad_char                    CUR Booleans[25]
+#define non_dest_scroll_region         CUR Booleans[26]
+#define can_change                     CUR Booleans[27]
+#define back_color_erase               CUR Booleans[28]
+#define hue_lightness_saturation       CUR Booleans[29]
+#define col_addr_glitch                CUR Booleans[30]
+#define cr_cancels_micro_mode          CUR Booleans[31]
+#define has_print_wheel                CUR Booleans[32]
+#define row_addr_glitch                CUR Booleans[33]
+#define semi_auto_right_margin         CUR Booleans[34]
+#define cpi_changes_res                CUR Booleans[35]
+#define lpi_changes_res                CUR Booleans[36]
+#define columns                        CUR Numbers[0]
+#define init_tabs                      CUR Numbers[1]
+#define lines                          CUR Numbers[2]
+#define lines_of_memory                CUR Numbers[3]
+#define magic_cookie_glitch            CUR Numbers[4]
+#define padding_baud_rate              CUR Numbers[5]
+#define virtual_terminal               CUR Numbers[6]
+#define width_status_line              CUR Numbers[7]
+#define num_labels                     CUR Numbers[8]
+#define label_height                   CUR Numbers[9]
+#define label_width                    CUR Numbers[10]
+#define max_attributes                 CUR Numbers[11]
+#define maximum_windows                CUR Numbers[12]
+#define max_colors                     CUR Numbers[13]
+#define max_pairs                      CUR Numbers[14]
+#define no_color_video                 CUR Numbers[15]
+#define buffer_capacity                CUR Numbers[16]
+#define dot_vert_spacing               CUR Numbers[17]
+#define dot_horz_spacing               CUR Numbers[18]
+#define max_micro_address              CUR Numbers[19]
+#define max_micro_jump                 CUR Numbers[20]
+#define micro_col_size                 CUR Numbers[21]
+#define micro_line_size                CUR Numbers[22]
+#define number_of_pins                 CUR Numbers[23]
+#define output_res_char                CUR Numbers[24]
+#define output_res_line                CUR Numbers[25]
+#define output_res_horz_inch           CUR Numbers[26]
+#define output_res_vert_inch           CUR Numbers[27]
+#define print_rate                     CUR Numbers[28]
+#define wide_char_size                 CUR Numbers[29]
+#define buttons                        CUR Numbers[30]
+#define bit_image_entwining            CUR Numbers[31]
+#define bit_image_type                 CUR Numbers[32]
+#define back_tab                       CUR Strings[0]
+#define bell                           CUR Strings[1]
+#define carriage_return                CUR Strings[2]
+#define change_scroll_region           CUR Strings[3]
+#define clear_all_tabs                 CUR Strings[4]
+#define clear_screen                   CUR Strings[5]
+#define clr_eol                        CUR Strings[6]
+#define clr_eos                        CUR Strings[7]
+#define column_address                 CUR Strings[8]
+#define command_character              CUR Strings[9]
+#define cursor_address                 CUR Strings[10]
+#define cursor_down                    CUR Strings[11]
+#define cursor_home                    CUR Strings[12]
+#define cursor_invisible               CUR Strings[13]
+#define cursor_left                    CUR Strings[14]
+#define cursor_mem_address             CUR Strings[15]
+#define cursor_normal                  CUR Strings[16]
+#define cursor_right                   CUR Strings[17]
+#define cursor_to_ll                   CUR Strings[18]
+#define cursor_up                      CUR Strings[19]
+#define cursor_visible                 CUR Strings[20]
+#define delete_character               CUR Strings[21]
+#define delete_line                    CUR Strings[22]
+#define dis_status_line                CUR Strings[23]
+#define down_half_line                 CUR Strings[24]
+#define enter_alt_charset_mode         CUR Strings[25]
+#define enter_blink_mode               CUR Strings[26]
+#define enter_bold_mode                CUR Strings[27]
+#define enter_ca_mode                  CUR Strings[28]
+#define enter_delete_mode              CUR Strings[29]
+#define enter_dim_mode                 CUR Strings[30]
+#define enter_insert_mode              CUR Strings[31]
+#define enter_secure_mode              CUR Strings[32]
+#define enter_protected_mode           CUR Strings[33]
+#define enter_reverse_mode             CUR Strings[34]
+#define enter_standout_mode            CUR Strings[35]
+#define enter_underline_mode           CUR Strings[36]
+#define erase_chars                    CUR Strings[37]
+#define exit_alt_charset_mode          CUR Strings[38]
+#define exit_attribute_mode            CUR Strings[39]
+#define exit_ca_mode                   CUR Strings[40]
+#define exit_delete_mode               CUR Strings[41]
+#define exit_insert_mode               CUR Strings[42]
+#define exit_standout_mode             CUR Strings[43]
+#define exit_underline_mode            CUR Strings[44]
+#define flash_screen                   CUR Strings[45]
+#define form_feed                      CUR Strings[46]
+#define from_status_line               CUR Strings[47]
+#define init_1string                   CUR Strings[48]
+#define init_2string                   CUR Strings[49]
+#define init_3string                   CUR Strings[50]
+#define init_file                      CUR Strings[51]
+#define insert_character               CUR Strings[52]
+#define insert_line                    CUR Strings[53]
+#define insert_padding                 CUR Strings[54]
+#define key_backspace                  CUR Strings[55]
+#define key_catab                      CUR Strings[56]
+#define key_clear                      CUR Strings[57]
+#define key_ctab                       CUR Strings[58]
+#define key_dc                         CUR Strings[59]
+#define key_dl                         CUR Strings[60]
+#define key_down                       CUR Strings[61]
+#define key_eic                        CUR Strings[62]
+#define key_eol                        CUR Strings[63]
+#define key_eos                        CUR Strings[64]
+#define key_f0                         CUR Strings[65]
+#define key_f1                         CUR Strings[66]
+#define key_f10                        CUR Strings[67]
+#define key_f2                         CUR Strings[68]
+#define key_f3                         CUR Strings[69]
+#define key_f4                         CUR Strings[70]
+#define key_f5                         CUR Strings[71]
+#define key_f6                         CUR Strings[72]
+#define key_f7                         CUR Strings[73]
+#define key_f8                         CUR Strings[74]
+#define key_f9                         CUR Strings[75]
+#define key_home                       CUR Strings[76]
+#define key_ic                         CUR Strings[77]
+#define key_il                         CUR Strings[78]
+#define key_left                       CUR Strings[79]
+#define key_ll                         CUR Strings[80]
+#define key_npage                      CUR Strings[81]
+#define key_ppage                      CUR Strings[82]
+#define key_right                      CUR Strings[83]
+#define key_sf                         CUR Strings[84]
+#define key_sr                         CUR Strings[85]
+#define key_stab                       CUR Strings[86]
+#define key_up                         CUR Strings[87]
+#define keypad_local                   CUR Strings[88]
+#define keypad_xmit                    CUR Strings[89]
+#define lab_f0                         CUR Strings[90]
+#define lab_f1                         CUR Strings[91]
+#define lab_f10                        CUR Strings[92]
+#define lab_f2                         CUR Strings[93]
+#define lab_f3                         CUR Strings[94]
+#define lab_f4                         CUR Strings[95]
+#define lab_f5                         CUR Strings[96]
+#define lab_f6                         CUR Strings[97]
+#define lab_f7                         CUR Strings[98]
+#define lab_f8                         CUR Strings[99]
+#define lab_f9                         CUR Strings[100]
+#define meta_off                       CUR Strings[101]
+#define meta_on                        CUR Strings[102]
+#define newline                        CUR Strings[103]
+#define pad_char                       CUR Strings[104]
+#define parm_dch                       CUR Strings[105]
+#define parm_delete_line               CUR Strings[106]
+#define parm_down_cursor               CUR Strings[107]
+#define parm_ich                       CUR Strings[108]
+#define parm_index                     CUR Strings[109]
+#define parm_insert_line               CUR Strings[110]
+#define parm_left_cursor               CUR Strings[111]
+#define parm_right_cursor              CUR Strings[112]
+#define parm_rindex                    CUR Strings[113]
+#define parm_up_cursor                 CUR Strings[114]
+#define pkey_key                       CUR Strings[115]
+#define pkey_local                     CUR Strings[116]
+#define pkey_xmit                      CUR Strings[117]
+#define print_screen                   CUR Strings[118]
+#define prtr_off                       CUR Strings[119]
+#define prtr_on                        CUR Strings[120]
+#define repeat_char                    CUR Strings[121]
+#define reset_1string                  CUR Strings[122]
+#define reset_2string                  CUR Strings[123]
+#define reset_3string                  CUR Strings[124]
+#define reset_file                     CUR Strings[125]
+#define restore_cursor                 CUR Strings[126]
+#define row_address                    CUR Strings[127]
+#define save_cursor                    CUR Strings[128]
+#define scroll_forward                 CUR Strings[129]
+#define scroll_reverse                 CUR Strings[130]
+#define set_attributes                 CUR Strings[131]
+#define set_tab                        CUR Strings[132]
+#define set_window                     CUR Strings[133]
+#define tab                            CUR Strings[134]
+#define to_status_line                 CUR Strings[135]
+#define underline_char                 CUR Strings[136]
+#define up_half_line                   CUR Strings[137]
+#define init_prog                      CUR Strings[138]
+#define key_a1                         CUR Strings[139]
+#define key_a3                         CUR Strings[140]
+#define key_b2                         CUR Strings[141]
+#define key_c1                         CUR Strings[142]
+#define key_c3                         CUR Strings[143]
+#define prtr_non                       CUR Strings[144]
+#define char_padding                   CUR Strings[145]
+#define acs_chars                      CUR Strings[146]
+#define plab_norm                      CUR Strings[147]
+#define key_btab                       CUR Strings[148]
+#define enter_xon_mode                 CUR Strings[149]
+#define exit_xon_mode                  CUR Strings[150]
+#define enter_am_mode                  CUR Strings[151]
+#define exit_am_mode                   CUR Strings[152]
+#define xon_character                  CUR Strings[153]
+#define xoff_character                 CUR Strings[154]
+#define ena_acs                        CUR Strings[155]
+#define label_on                       CUR Strings[156]
+#define label_off                      CUR Strings[157]
+#define key_beg                        CUR Strings[158]
+#define key_cancel                     CUR Strings[159]
+#define key_close                      CUR Strings[160]
+#define key_command                    CUR Strings[161]
+#define key_copy                       CUR Strings[162]
+#define key_create                     CUR Strings[163]
+#define key_end                        CUR Strings[164]
+#define key_enter                      CUR Strings[165]
+#define key_exit                       CUR Strings[166]
+#define key_find                       CUR Strings[167]
+#define key_help                       CUR Strings[168]
+#define key_mark                       CUR Strings[169]
+#define key_message                    CUR Strings[170]
+#define key_move                       CUR Strings[171]
+#define key_next                       CUR Strings[172]
+#define key_open                       CUR Strings[173]
+#define key_options                    CUR Strings[174]
+#define key_previous                   CUR Strings[175]
+#define key_print                      CUR Strings[176]
+#define key_redo                       CUR Strings[177]
+#define key_reference                  CUR Strings[178]
+#define key_refresh                    CUR Strings[179]
+#define key_replace                    CUR Strings[180]
+#define key_restart                    CUR Strings[181]
+#define key_resume                     CUR Strings[182]
+#define key_save                       CUR Strings[183]
+#define key_suspend                    CUR Strings[184]
+#define key_undo                       CUR Strings[185]
+#define key_sbeg                       CUR Strings[186]
+#define key_scancel                    CUR Strings[187]
+#define key_scommand                   CUR Strings[188]
+#define key_scopy                      CUR Strings[189]
+#define key_screate                    CUR Strings[190]
+#define key_sdc                        CUR Strings[191]
+#define key_sdl                        CUR Strings[192]
+#define key_select                     CUR Strings[193]
+#define key_send                       CUR Strings[194]
+#define key_seol                       CUR Strings[195]
+#define key_sexit                      CUR Strings[196]
+#define key_sfind                      CUR Strings[197]
+#define key_shelp                      CUR Strings[198]
+#define key_shome                      CUR Strings[199]
+#define key_sic                        CUR Strings[200]
+#define key_sleft                      CUR Strings[201]
+#define key_smessage                   CUR Strings[202]
+#define key_smove                      CUR Strings[203]
+#define key_snext                      CUR Strings[204]
+#define key_soptions                   CUR Strings[205]
+#define key_sprevious                  CUR Strings[206]
+#define key_sprint                     CUR Strings[207]
+#define key_sredo                      CUR Strings[208]
+#define key_sreplace                   CUR Strings[209]
+#define key_sright                     CUR Strings[210]
+#define key_srsume                     CUR Strings[211]
+#define key_ssave                      CUR Strings[212]
+#define key_ssuspend                   CUR Strings[213]
+#define key_sundo                      CUR Strings[214]
+#define req_for_input                  CUR Strings[215]
+#define key_f11                        CUR Strings[216]
+#define key_f12                        CUR Strings[217]
+#define key_f13                        CUR Strings[218]
+#define key_f14                        CUR Strings[219]
+#define key_f15                        CUR Strings[220]
+#define key_f16                        CUR Strings[221]
+#define key_f17                        CUR Strings[222]
+#define key_f18                        CUR Strings[223]
+#define key_f19                        CUR Strings[224]
+#define key_f20                        CUR Strings[225]
+#define key_f21                        CUR Strings[226]
+#define key_f22                        CUR Strings[227]
+#define key_f23                        CUR Strings[228]
+#define key_f24                        CUR Strings[229]
+#define key_f25                        CUR Strings[230]
+#define key_f26                        CUR Strings[231]
+#define key_f27                        CUR Strings[232]
+#define key_f28                        CUR Strings[233]
+#define key_f29                        CUR Strings[234]
+#define key_f30                        CUR Strings[235]
+#define key_f31                        CUR Strings[236]
+#define key_f32                        CUR Strings[237]
+#define key_f33                        CUR Strings[238]
+#define key_f34                        CUR Strings[239]
+#define key_f35                        CUR Strings[240]
+#define key_f36                        CUR Strings[241]
+#define key_f37                        CUR Strings[242]
+#define key_f38                        CUR Strings[243]
+#define key_f39                        CUR Strings[244]
+#define key_f40                        CUR Strings[245]
+#define key_f41                        CUR Strings[246]
+#define key_f42                        CUR Strings[247]
+#define key_f43                        CUR Strings[248]
+#define key_f44                        CUR Strings[249]
+#define key_f45                        CUR Strings[250]
+#define key_f46                        CUR Strings[251]
+#define key_f47                        CUR Strings[252]
+#define key_f48                        CUR Strings[253]
+#define key_f49                        CUR Strings[254]
+#define key_f50                        CUR Strings[255]
+#define key_f51                        CUR Strings[256]
+#define key_f52                        CUR Strings[257]
+#define key_f53                        CUR Strings[258]
+#define key_f54                        CUR Strings[259]
+#define key_f55                        CUR Strings[260]
+#define key_f56                        CUR Strings[261]
+#define key_f57                        CUR Strings[262]
+#define key_f58                        CUR Strings[263]
+#define key_f59                        CUR Strings[264]
+#define key_f60                        CUR Strings[265]
+#define key_f61                        CUR Strings[266]
+#define key_f62                        CUR Strings[267]
+#define key_f63                        CUR Strings[268]
+#define clr_bol                        CUR Strings[269]
+#define clear_margins                  CUR Strings[270]
+#define set_left_margin                CUR Strings[271]
+#define set_right_margin               CUR Strings[272]
+#define label_format                   CUR Strings[273]
+#define set_clock                      CUR Strings[274]
+#define display_clock                  CUR Strings[275]
+#define remove_clock                   CUR Strings[276]
+#define create_window                  CUR Strings[277]
+#define goto_window                    CUR Strings[278]
+#define hangup                         CUR Strings[279]
+#define dial_phone                     CUR Strings[280]
+#define quick_dial                     CUR Strings[281]
+#define tone                           CUR Strings[282]
+#define pulse                          CUR Strings[283]
+#define flash_hook                     CUR Strings[284]
+#define fixed_pause                    CUR Strings[285]
+#define wait_tone                      CUR Strings[286]
+#define user0                          CUR Strings[287]
+#define user1                          CUR Strings[288]
+#define user2                          CUR Strings[289]
+#define user3                          CUR Strings[290]
+#define user4                          CUR Strings[291]
+#define user5                          CUR Strings[292]
+#define user6                          CUR Strings[293]
+#define user7                          CUR Strings[294]
+#define user8                          CUR Strings[295]
+#define user9                          CUR Strings[296]
+#define orig_pair                      CUR Strings[297]
+#define orig_colors                    CUR Strings[298]
+#define initialize_color               CUR Strings[299]
+#define initialize_pair                CUR Strings[300]
+#define set_color_pair                 CUR Strings[301]
+#define set_foreground                 CUR Strings[302]
+#define set_background                 CUR Strings[303]
+#define change_char_pitch              CUR Strings[304]
+#define change_line_pitch              CUR Strings[305]
+#define change_res_horz                CUR Strings[306]
+#define change_res_vert                CUR Strings[307]
+#define define_char                    CUR Strings[308]
+#define enter_doublewide_mode          CUR Strings[309]
+#define enter_draft_quality            CUR Strings[310]
+#define enter_italics_mode             CUR Strings[311]
+#define enter_leftward_mode            CUR Strings[312]
+#define enter_micro_mode               CUR Strings[313]
+#define enter_near_letter_quality      CUR Strings[314]
+#define enter_normal_quality           CUR Strings[315]
+#define enter_shadow_mode              CUR Strings[316]
+#define enter_subscript_mode           CUR Strings[317]
+#define enter_superscript_mode         CUR Strings[318]
+#define enter_upward_mode              CUR Strings[319]
+#define exit_doublewide_mode           CUR Strings[320]
+#define exit_italics_mode              CUR Strings[321]
+#define exit_leftward_mode             CUR Strings[322]
+#define exit_micro_mode                CUR Strings[323]
+#define exit_shadow_mode               CUR Strings[324]
+#define exit_subscript_mode            CUR Strings[325]
+#define exit_superscript_mode          CUR Strings[326]
+#define exit_upward_mode               CUR Strings[327]
+#define micro_column_address           CUR Strings[328]
+#define micro_down                     CUR Strings[329]
+#define micro_left                     CUR Strings[330]
+#define micro_right                    CUR Strings[331]
+#define micro_row_address              CUR Strings[332]
+#define micro_up                       CUR Strings[333]
+#define order_of_pins                  CUR Strings[334]
+#define parm_down_micro                CUR Strings[335]
+#define parm_left_micro                CUR Strings[336]
+#define parm_right_micro               CUR Strings[337]
+#define parm_up_micro                  CUR Strings[338]
+#define select_char_set                CUR Strings[339]
+#define set_bottom_margin              CUR Strings[340]
+#define set_bottom_margin_parm         CUR Strings[341]
+#define set_left_margin_parm           CUR Strings[342]
+#define set_right_margin_parm          CUR Strings[343]
+#define set_top_margin                 CUR Strings[344]
+#define set_top_margin_parm            CUR Strings[345]
+#define start_bit_image                CUR Strings[346]
+#define start_char_set_def             CUR Strings[347]
+#define stop_bit_image                 CUR Strings[348]
+#define stop_char_set_def              CUR Strings[349]
+#define subscript_characters           CUR Strings[350]
+#define superscript_characters         CUR Strings[351]
+#define these_cause_cr                 CUR Strings[352]
+#define zero_motion                    CUR Strings[353]
+#define char_set_names                 CUR Strings[354]
+#define key_mouse                      CUR Strings[355]
+#define mouse_info                     CUR Strings[356]
+#define req_mouse_pos                  CUR Strings[357]
+#define get_mouse                      CUR Strings[358]
+#define set_a_foreground               CUR Strings[359]
+#define set_a_background               CUR Strings[360]
+#define pkey_plab                      CUR Strings[361]
+#define device_type                    CUR Strings[362]
+#define code_set_init                  CUR Strings[363]
+#define set0_des_seq                   CUR Strings[364]
+#define set1_des_seq                   CUR Strings[365]
+#define set2_des_seq                   CUR Strings[366]
+#define set3_des_seq                   CUR Strings[367]
+#define set_lr_margin                  CUR Strings[368]
+#define set_tb_margin                  CUR Strings[369]
+#define bit_image_repeat               CUR Strings[370]
+#define bit_image_newline              CUR Strings[371]
+#define bit_image_carriage_return      CUR Strings[372]
+#define color_names                    CUR Strings[373]
+#define define_bit_image_region        CUR Strings[374]
+#define end_bit_image_region           CUR Strings[375]
+#define set_color_band                 CUR Strings[376]
+#define set_page_length                CUR Strings[377]
+#define display_pc_char                CUR Strings[378]
+#define enter_pc_charset_mode          CUR Strings[379]
+#define exit_pc_charset_mode           CUR Strings[380]
+#define enter_scancode_mode            CUR Strings[381]
+#define exit_scancode_mode             CUR Strings[382]
+#define pc_term_options                CUR Strings[383]
+#define scancode_escape                CUR Strings[384]
+#define alt_scancode_esc               CUR Strings[385]
+#define enter_horizontal_hl_mode       CUR Strings[386]
+#define enter_left_hl_mode             CUR Strings[387]
+#define enter_low_hl_mode              CUR Strings[388]
+#define enter_right_hl_mode            CUR Strings[389]
+#define enter_top_hl_mode              CUR Strings[390]
+#define enter_vertical_hl_mode         CUR Strings[391]
+#define set_a_attributes               CUR Strings[392]
+#define set_pglen_inch                 CUR Strings[393]
+
+#define BOOLWRITE 37
+#define NUMWRITE  33
+#define STRWRITE  394
+
+/* older synonyms for some capabilities */
+#define beehive_glitch	no_esc_ctlc
+#define teleray_glitch	dest_tabs_magic_smso
+
+/* HPUX-11 uses this name rather than the standard one */
+#ifndef micro_char_size
+#define micro_char_size micro_col_size
+#endif
+
+#ifdef __INTERNAL_CAPS_VISIBLE
+#define termcap_init2                  CUR Strings[394]
+#define termcap_reset                  CUR Strings[395]
+#define magic_cookie_glitch_ul         CUR Numbers[33]
+#define backspaces_with_bs             CUR Booleans[37]
+#define crt_no_scrolling               CUR Booleans[38]
+#define no_correctly_working_cr        CUR Booleans[39]
+#define carriage_return_delay          CUR Numbers[34]
+#define new_line_delay                 CUR Numbers[35]
+#define linefeed_if_not_lf             CUR Strings[396]
+#define backspace_if_not_bs            CUR Strings[397]
+#define gnu_has_meta_key               CUR Booleans[40]
+#define linefeed_is_newline            CUR Booleans[41]
+#define backspace_delay                CUR Numbers[36]
+#define horizontal_tab_delay           CUR Numbers[37]
+#define number_of_function_keys        CUR Numbers[38]
+#define other_non_function_keys        CUR Strings[398]
+#define arrow_key_map                  CUR Strings[399]
+#define has_hardware_tabs              CUR Booleans[42]
+#define return_does_clr_eol            CUR Booleans[43]
+#define acs_ulcorner                   CUR Strings[400]
+#define acs_llcorner                   CUR Strings[401]
+#define acs_urcorner                   CUR Strings[402]
+#define acs_lrcorner                   CUR Strings[403]
+#define acs_ltee                       CUR Strings[404]
+#define acs_rtee                       CUR Strings[405]
+#define acs_btee                       CUR Strings[406]
+#define acs_ttee                       CUR Strings[407]
+#define acs_hline                      CUR Strings[408]
+#define acs_vline                      CUR Strings[409]
+#define acs_plus                       CUR Strings[410]
+#define memory_lock                    CUR Strings[411]
+#define memory_unlock                  CUR Strings[412]
+#define box_chars_1                    CUR Strings[413]
+#endif /* __INTERNAL_CAPS_VISIBLE */
+
+
+/*
+ * Predefined terminfo array sizes
+ */
+#define BOOLCOUNT 44
+#define NUMCOUNT  39
+#define STRCOUNT  414
+
+/* used by code for comparing entries */
+#define acs_chars_index	 146
+
+typedef struct termtype {	/* in-core form of terminfo data */
+    char  *term_names;		/* str_table offset of term names */
+    char  *str_table;		/* pointer to string table */
+    NCURSES_SBOOL  *Booleans;	/* array of boolean values */
+    short *Numbers;		/* array of integer values */
+    char  **Strings;		/* array of string offsets */
+
+#if NCURSES_XNAMES
+    char  *ext_str_table;	/* pointer to extended string table */
+    char  **ext_Names;		/* corresponding names */
+
+    unsigned short num_Booleans;/* count total Booleans */
+    unsigned short num_Numbers;	/* count total Numbers */
+    unsigned short num_Strings;	/* count total Strings */
+
+    unsigned short ext_Booleans;/* count extensions to Booleans */
+    unsigned short ext_Numbers;	/* count extensions to Numbers */
+    unsigned short ext_Strings;	/* count extensions to Strings */
+#endif /* NCURSES_XNAMES */
+
+} TERMTYPE;
+
+/*
+ * The only reason these structures are visible is for read-only use.
+ * Programs which modify the data are not, never were, portable across
+ * curses implementations.
+ *
+ * The first field in TERMINAL is used in macros.
+ * The remaining fields are private.
+ */
+#ifdef NCURSES_INTERNALS
+
+#undef TERMINAL
+#define TERMINAL struct term
+TERMINAL;
+
+typedef struct termtype2 {	/* in-core form of terminfo data */
+    char  *term_names;		/* str_table offset of term names */
+    char  *str_table;		/* pointer to string table */
+    NCURSES_SBOOL  *Booleans;	/* array of boolean values */
+    int   *Numbers;		/* array of integer values */
+    char  **Strings;		/* array of string offsets */
+
+#if NCURSES_XNAMES
+    char  *ext_str_table;	/* pointer to extended string table */
+    char  **ext_Names;		/* corresponding names */
+
+    unsigned short num_Booleans;/* count total Booleans */
+    unsigned short num_Numbers;	/* count total Numbers */
+    unsigned short num_Strings;	/* count total Strings */
+
+    unsigned short ext_Booleans;/* count extensions to Booleans */
+    unsigned short ext_Numbers;	/* count extensions to Numbers */
+    unsigned short ext_Strings;	/* count extensions to Strings */
+#endif /* NCURSES_XNAMES */
+
+} TERMTYPE2;
+#else
+
+typedef struct term {		/* describe an actual terminal */
+    TERMTYPE	type;		/* terminal type description */
+} TERMINAL;
+
+#endif /* NCURSES_INTERNALS */
+
+
+#if 0 && !0
+extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;
+#elif 0
+NCURSES_WRAPPED_VAR(TERMINAL *, cur_term);
+#define cur_term   NCURSES_PUBLIC_VAR(cur_term())
+#else
+extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;
+#endif
+
+#if 0 || 0
+NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolnames);
+NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolcodes);
+NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolfnames);
+NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, numnames);
+NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, numcodes);
+NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, numfnames);
+NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strnames);
+NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strcodes);
+NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strfnames);
+
+#define boolnames  NCURSES_PUBLIC_VAR(boolnames())
+#define boolcodes  NCURSES_PUBLIC_VAR(boolcodes())
+#define boolfnames NCURSES_PUBLIC_VAR(boolfnames())
+#define numnames   NCURSES_PUBLIC_VAR(numnames())
+#define numcodes   NCURSES_PUBLIC_VAR(numcodes())
+#define numfnames  NCURSES_PUBLIC_VAR(numfnames())
+#define strnames   NCURSES_PUBLIC_VAR(strnames())
+#define strcodes   NCURSES_PUBLIC_VAR(strcodes())
+#define strfnames  NCURSES_PUBLIC_VAR(strfnames())
+
+#else
+
+extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolnames[];
+extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolcodes[];
+extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolfnames[];
+extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numnames[];
+extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numcodes[];
+extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numfnames[];
+extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strnames[];
+extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strcodes[];
+extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strfnames[];
+
+#endif
+
+/*
+ * These entrypoints are used only by the ncurses utilities such as tic.
+ */
+#ifdef NCURSES_INTERNALS
+
+extern NCURSES_EXPORT(int) _nc_set_tty_mode (TTY *buf);
+extern NCURSES_EXPORT(int) _nc_read_entry2 (const char * const, char * const, TERMTYPE2 *const);
+extern NCURSES_EXPORT(int) _nc_read_file_entry (const char *const, TERMTYPE2 *);
+extern NCURSES_EXPORT(int) _nc_read_termtype (TERMTYPE2 *, char *, int);
+extern NCURSES_EXPORT(char *) _nc_first_name (const char *const);
+extern NCURSES_EXPORT(int) _nc_name_match (const char *const, const char *const, const char *const);
+extern NCURSES_EXPORT(char *) _nc_tiparm(int, const char *, ...);
+extern NCURSES_EXPORT(const TERMTYPE *) _nc_fallback (const char *);
+extern NCURSES_EXPORT(int) _nc_read_entry (const char * const, char * const, TERMTYPE *const);
+
+#endif /* NCURSES_INTERNALS */
+
+/*
+ * Normal entry points
+ */
+extern NCURSES_EXPORT(TERMINAL *) set_curterm (TERMINAL *);
+extern NCURSES_EXPORT(int) del_curterm (TERMINAL *);
+
+/* miscellaneous entry points */
+extern NCURSES_EXPORT(int) restartterm (NCURSES_CONST char *, int, int *);
+extern NCURSES_EXPORT(int) setupterm (const char *,int,int *);
+
+/* terminfo entry points, also declared in curses.h */
+#if !defined(__NCURSES_H)
+extern NCURSES_EXPORT(char *) tigetstr (const char *);
+extern NCURSES_EXPORT_VAR(char) ttytype[];
+extern NCURSES_EXPORT(int) putp (const char *);
+extern NCURSES_EXPORT(int) tigetflag (const char *);
+extern NCURSES_EXPORT(int) tigetnum (const char *);
+
+#if 1 /* NCURSES_TPARM_VARARGS */
+extern NCURSES_EXPORT(char *) tparm (const char *, ...);	/* special */
+#else
+extern NCURSES_EXPORT(char *) tparm (const char *, long,long,long,long,long,long,long,long,long);	/* special */
+#endif
+
+extern NCURSES_EXPORT(char *) tiparm (const char *, ...);		/* special */
+extern NCURSES_EXPORT(char *) tiparm_s (int, int, const char *, ...);	/* special */
+extern NCURSES_EXPORT(int) tiscan_s (int *, int *, const char *);	/* special */
+
+#endif /* __NCURSES_H */
+
+/* termcap database emulation (XPG4 uses const only for 2nd param of tgetent) */
+#if !defined(NCURSES_TERMCAP_H_incl)
+extern NCURSES_EXPORT(char *) tgetstr (const char *, char **);
+extern NCURSES_EXPORT(char *) tgoto (const char *, int, int);
+extern NCURSES_EXPORT(int) tgetent (char *, const char *);
+extern NCURSES_EXPORT(int) tgetflag (const char *);
+extern NCURSES_EXPORT(int) tgetnum (const char *);
+extern NCURSES_EXPORT(int) tputs (const char *, int, int (*)(int));
+#endif /* NCURSES_TERMCAP_H_incl */
+
+/*
+ * Include curses.h before term.h to enable these extensions.
+ */
+#if defined(NCURSES_SP_FUNCS) && (NCURSES_SP_FUNCS != 0)
+
+extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tigetstr) (SCREEN*, const char *);
+extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(putp) (SCREEN*, const char *);
+extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tigetflag) (SCREEN*, const char *);
+extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tigetnum) (SCREEN*, const char *);
+
+#if 1 /* NCURSES_TPARM_VARARGS */
+extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tparm) (SCREEN*, const char *, ...);	/* special */
+#else
+extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tparm) (SCREEN*, const char *, long,long,long,long,long,long,long,long,long);	/* special */
+#endif
+
+/* termcap database emulation (XPG4 uses const only for 2nd param of tgetent) */
+extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tgetstr) (SCREEN*, const char *, char **);
+extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tgoto) (SCREEN*, const char *, int, int);
+extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tgetent) (SCREEN*, char *, const char *);
+extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tgetflag) (SCREEN*, const char *);
+extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tgetnum) (SCREEN*, const char *);
+extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tputs) (SCREEN*, const char *, int, NCURSES_SP_OUTC);
+
+extern NCURSES_EXPORT(TERMINAL *) NCURSES_SP_NAME(set_curterm) (SCREEN*, TERMINAL *);
+extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(del_curterm) (SCREEN*, TERMINAL *);
+
+extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(restartterm) (SCREEN*, NCURSES_CONST char *, int, int *);
+#endif /* NCURSES_SP_FUNCS */
+
+/*
+ * Debugging features.
+ */
+extern GCC_NORETURN NCURSES_EXPORT(void)    exit_terminfo(int);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* NCURSES_TERM_H_incl */
diff --git a/include/termcap.h b/include/termcap.h
new file mode 100644
index 0000000..2cef868
--- /dev/null
+++ b/include/termcap.h
@@ -0,0 +1,73 @@
+/****************************************************************************
+ * Copyright 2018-2020,2021 Thomas E. Dickey                                *
+ * Copyright 1998-2000,2001 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: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
+ *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ ****************************************************************************/
+
+/* $Id: termcap.h.in,v 1.20 2021/06/17 21:26:02 tom Exp $ */
+
+#ifndef NCURSES_TERMCAP_H_incl
+#define NCURSES_TERMCAP_H_incl	1
+
+#undef  NCURSES_VERSION
+#define NCURSES_VERSION "6.5"
+
+#include <ncurses_dll.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#include <sys/types.h>
+
+#undef  NCURSES_OSPEED
+#define NCURSES_OSPEED short
+
+extern NCURSES_EXPORT_VAR(char) PC;
+extern NCURSES_EXPORT_VAR(char *) UP;
+extern NCURSES_EXPORT_VAR(char *) BC;
+extern NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed;
+
+#if !defined(NCURSES_TERM_H_incl)
+extern NCURSES_EXPORT(char *) tgetstr (const char *, char **);
+extern NCURSES_EXPORT(char *) tgoto (const char *, int, int);
+extern NCURSES_EXPORT(int) tgetent (char *, const char *);
+extern NCURSES_EXPORT(int) tgetflag (const char *);
+extern NCURSES_EXPORT(int) tgetnum (const char *);
+extern NCURSES_EXPORT(int) tputs (const char *, int, int (*)(int));
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* NCURSES_TERMCAP_H_incl */
diff --git a/include/unctrl.h b/include/unctrl.h
new file mode 100644
index 0000000..1f3ed62
--- /dev/null
+++ b/include/unctrl.h
@@ -0,0 +1,68 @@
+/****************************************************************************
+ * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 1998-2001,2009 Free Software Foundation, Inc.                  *
+ *                                                                          *
+ * Permission is hereby granted, free of charge, to any person obtaining a  *
+ * copy of this software and associated documentation files (the            *
+ * "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: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
+ *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ ****************************************************************************/
+
+/*
+ * unctrl.h
+ *
+ * Display a printable version of a control character.
+ * Control characters are displayed in caret notation (^x), DELETE is displayed
+ * as ^?. Printable characters are displayed as is.
+ */
+
+/* $Id: unctrl.h.in,v 1.12 2020/02/02 23:34:34 tom Exp $ */
+
+#ifndef NCURSES_UNCTRL_H_incl
+#define NCURSES_UNCTRL_H_incl	1
+
+#undef  NCURSES_VERSION
+#define NCURSES_VERSION "6.5"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <curses.h>
+
+#undef unctrl
+NCURSES_EXPORT(NCURSES_CONST char *) unctrl (chtype);
+
+#if 1
+NCURSES_EXPORT(NCURSES_CONST char *) NCURSES_SP_NAME(unctrl) (SCREEN*, chtype);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* NCURSES_UNCTRL_H_incl */