summaryrefslogtreecommitdiff
path: root/ncurses-5.3/ncurses/base
diff options
context:
space:
mode:
Diffstat (limited to 'ncurses-5.3/ncurses/base')
-rw-r--r--ncurses-5.3/ncurses/base/MKkeyname.awk90
-rwxr-xr-xncurses-5.3/ncurses/base/MKlib_gen.sh400
-rw-r--r--ncurses-5.3/ncurses/base/MKunctrl.awk69
-rw-r--r--ncurses-5.3/ncurses/base/README7
-rw-r--r--ncurses-5.3/ncurses/base/define_key.c60
-rw-r--r--ncurses-5.3/ncurses/base/keybound.c46
-rw-r--r--ncurses-5.3/ncurses/base/keyok.c73
-rw-r--r--ncurses-5.3/ncurses/base/lib_addch.c365
-rw-r--r--ncurses-5.3/ncurses/base/lib_addstr.c253
-rw-r--r--ncurses-5.3/ncurses/base/lib_beep.c73
-rw-r--r--ncurses-5.3/ncurses/base/lib_bkgd.c138
-rw-r--r--ncurses-5.3/ncurses/base/lib_box.c126
-rw-r--r--ncurses-5.3/ncurses/base/lib_chgat.c62
-rw-r--r--ncurses-5.3/ncurses/base/lib_clear.c56
-rw-r--r--ncurses-5.3/ncurses/base/lib_clearok.c55
-rw-r--r--ncurses-5.3/ncurses/base/lib_clrbot.c76
-rw-r--r--ncurses-5.3/ncurses/base/lib_clreol.c91
-rw-r--r--ncurses-5.3/ncurses/base/lib_color.c531
-rw-r--r--ncurses-5.3/ncurses/base/lib_colorset.c60
-rw-r--r--ncurses-5.3/ncurses/base/lib_delch.c69
-rw-r--r--ncurses-5.3/ncurses/base/lib_delwin.c78
-rw-r--r--ncurses-5.3/ncurses/base/lib_dft_fgbg.c71
-rw-r--r--ncurses-5.3/ncurses/base/lib_echo.c61
-rw-r--r--ncurses-5.3/ncurses/base/lib_endwin.c60
-rw-r--r--ncurses-5.3/ncurses/base/lib_erase.c73
-rw-r--r--ncurses-5.3/ncurses/base/lib_flash.c73
-rw-r--r--ncurses-5.3/ncurses/base/lib_freeall.c111
-rw-r--r--ncurses-5.3/ncurses/base/lib_getch.c537
-rw-r--r--ncurses-5.3/ncurses/base/lib_getstr.c215
-rw-r--r--ncurses-5.3/ncurses/base/lib_hline.c80
-rw-r--r--ncurses-5.3/ncurses/base/lib_immedok.c54
-rw-r--r--ncurses-5.3/ncurses/base/lib_inchstr.c64
-rw-r--r--ncurses-5.3/ncurses/base/lib_initscr.c97
-rw-r--r--ncurses-5.3/ncurses/base/lib_insch.c68
-rw-r--r--ncurses-5.3/ncurses/base/lib_insdel.c63
-rw-r--r--ncurses-5.3/ncurses/base/lib_insstr.c83
-rw-r--r--ncurses-5.3/ncurses/base/lib_instr.c73
-rw-r--r--ncurses-5.3/ncurses/base/lib_isendwin.c51
-rw-r--r--ncurses-5.3/ncurses/base/lib_leaveok.c55
-rw-r--r--ncurses-5.3/ncurses/base/lib_mouse.c1014
-rw-r--r--ncurses-5.3/ncurses/base/lib_move.c61
-rw-r--r--ncurses-5.3/ncurses/base/lib_mvwin.c108
-rw-r--r--ncurses-5.3/ncurses/base/lib_newterm.c209
-rw-r--r--ncurses-5.3/ncurses/base/lib_newwin.c306
-rw-r--r--ncurses-5.3/ncurses/base/lib_nl.c79
-rw-r--r--ncurses-5.3/ncurses/base/lib_overlay.c184
-rw-r--r--ncurses-5.3/ncurses/base/lib_pad.c313
-rw-r--r--ncurses-5.3/ncurses/base/lib_printw.c142
-rw-r--r--ncurses-5.3/ncurses/base/lib_redrawln.c75
-rw-r--r--ncurses-5.3/ncurses/base/lib_refresh.c187
-rw-r--r--ncurses-5.3/ncurses/base/lib_restart.c92
-rw-r--r--ncurses-5.3/ncurses/base/lib_scanw.c106
-rw-r--r--ncurses-5.3/ncurses/base/lib_screen.c205
-rw-r--r--ncurses-5.3/ncurses/base/lib_scroll.c152
-rw-r--r--ncurses-5.3/ncurses/base/lib_scrollok.c55
-rw-r--r--ncurses-5.3/ncurses/base/lib_scrreg.c60
-rw-r--r--ncurses-5.3/ncurses/base/lib_set_term.c479
-rw-r--r--ncurses-5.3/ncurses/base/lib_slk.c201
-rw-r--r--ncurses-5.3/ncurses/base/lib_slkatr_set.c56
-rw-r--r--ncurses-5.3/ncurses/base/lib_slkatrof.c53
-rw-r--r--ncurses-5.3/ncurses/base/lib_slkatron.c53
-rw-r--r--ncurses-5.3/ncurses/base/lib_slkatrset.c53
-rw-r--r--ncurses-5.3/ncurses/base/lib_slkattr.c52
-rw-r--r--ncurses-5.3/ncurses/base/lib_slkclear.c61
-rw-r--r--ncurses-5.3/ncurses/base/lib_slkcolor.c53
-rw-r--r--ncurses-5.3/ncurses/base/lib_slkinit.c51
-rw-r--r--ncurses-5.3/ncurses/base/lib_slklab.c51
-rw-r--r--ncurses-5.3/ncurses/base/lib_slkrefr.c120
-rw-r--r--ncurses-5.3/ncurses/base/lib_slkset.c97
-rw-r--r--ncurses-5.3/ncurses/base/lib_slktouch.c53
-rw-r--r--ncurses-5.3/ncurses/base/lib_touch.c91
-rw-r--r--ncurses-5.3/ncurses/base/lib_ungetch.c79
-rw-r--r--ncurses-5.3/ncurses/base/lib_vline.c79
-rw-r--r--ncurses-5.3/ncurses/base/lib_wattroff.c56
-rw-r--r--ncurses-5.3/ncurses/base/lib_wattron.c56
-rw-r--r--ncurses-5.3/ncurses/base/lib_winch.c54
-rw-r--r--ncurses-5.3/ncurses/base/lib_window.c248
-rw-r--r--ncurses-5.3/ncurses/base/memmove.c69
-rw-r--r--ncurses-5.3/ncurses/base/nc_panel.c41
-rw-r--r--ncurses-5.3/ncurses/base/resizeterm.c288
-rw-r--r--ncurses-5.3/ncurses/base/safe_sprintf.c244
-rw-r--r--ncurses-5.3/ncurses/base/sigaction.c117
-rw-r--r--ncurses-5.3/ncurses/base/tries.c144
-rw-r--r--ncurses-5.3/ncurses/base/version.c47
-rw-r--r--ncurses-5.3/ncurses/base/vsscanf.c356
-rw-r--r--ncurses-5.3/ncurses/base/wresize.c239
86 files changed, 0 insertions, 11656 deletions
diff --git a/ncurses-5.3/ncurses/base/MKkeyname.awk b/ncurses-5.3/ncurses/base/MKkeyname.awk
deleted file mode 100644
index 744a810..0000000
--- a/ncurses-5.3/ncurses/base/MKkeyname.awk
+++ /dev/null
@@ -1,90 +0,0 @@
-# $Id$
-##############################################################################
-# Copyright (c) 1999-2001,2002 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. #
-##############################################################################
-BEGIN {
- print "/* generated by MKkeyname.awk */"
- print ""
- print "#include <curses.priv.h>"
- print "#include <tic.h>"
- print ""
- print "const struct kn _nc_key_names[] = {"
-}
-
-/^[^#]/ {
- printf "\t{ \"%s\", %s },\n", $1, $1;
- }
-
-END {
- printf "\t{ 0, 0 }};\n"
- print ""
- print "NCURSES_EXPORT(NCURSES_CONST char *) keyname (int c)"
- print "{"
- print "static char **table;"
- print "int i;"
- print "char name[20];"
- print "char *p;"
- print ""
- print "\tif (c == -1) return \"-1\";"
- print ""
- print "\tfor (i = 0; _nc_key_names[i].name != 0; i++)"
- print "\t\tif (_nc_key_names[i].code == c)"
- print "\t\t\treturn (NCURSES_CONST char *)_nc_key_names[i].name;"
- print "\tif (c < 0 || c >= 256) return 0;"
- print ""
- print "\tif (table == 0)"
- print "\t\ttable = typeCalloc(char *, 256);"
- print "\tif (table == 0)"
- print "\t\treturn keyname(256);"
- print ""
- print "\tif (table[c] == 0) {"
- print "\t\tp = name;"
- print "\t\tif (c >= 128) {"
- print "\t\t\tstrcpy(p, \"M-\");"
- print "\t\t\tp += 2;"
- print "\t\t\tc -= 128;"
- print "\t\t}"
- print "\t\tif (c < 32)"
- print "\t\t\tsprintf(p, \"^%c\", c + '@');"
- print "\t\telse if (c == 127)"
- print "\t\t\tstrcpy(p, \"^?\");"
- print "\t\telse"
- print "\t\t\tsprintf(p, \"%c\", c);"
- print "\t\ttable[c] = strdup(name);"
- print "\t}"
- print "\treturn (NCURSES_CONST char *)table[c];"
- print "}"
- print ""
- print "#if USE_WIDEC_SUPPORT"
- print "NCURSES_EXPORT(NCURSES_CONST char *) key_name (wchar_t c)"
- print "{"
- print "\tNCURSES_CONST char *result = keyname((int)c);"
- print "\tif (!strncmp(result, \"M-\", 2)) result = 0;"
- print "\treturn result;"
- print "}"
- print "#endif"
-}
diff --git a/ncurses-5.3/ncurses/base/MKlib_gen.sh b/ncurses-5.3/ncurses/base/MKlib_gen.sh
deleted file mode 100755
index 581ba67..0000000
--- a/ncurses-5.3/ncurses/base/MKlib_gen.sh
+++ /dev/null
@@ -1,400 +0,0 @@
-#!/bin/sh
-#
-# MKlib_gen.sh -- generate sources from curses.h macro definitions
-#
-# ($Id$)
-#
-##############################################################################
-# Copyright (c) 1998-2001,2002 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. #
-##############################################################################
-#
-# The XSI Curses standard requires all curses entry points to exist as
-# functions, even though many definitions would normally be shadowed
-# by macros. Rather than hand-hack all that code, we actually
-# generate functions from the macros.
-#
-# This script accepts a file of prototypes on standard input. It discards
-# any that don't have a `generated' comment attached. It then parses each
-# prototype (relying on the fact that none of the macros take function
-# pointer or array arguments) and generates C source from it.
-#
-# Here is what the pipeline stages are doing:
-#
-# 1. sed: extract prototypes of generated functions
-# 2. sed: decorate prototypes with generated arguments a1. a2,...z
-# 3. awk: generate the calls with args matching the formals
-# 4. sed: prefix function names in prototypes so the preprocessor won't expand
-# them.
-# 5. cpp: macro-expand the file so the macro calls turn into C calls
-# 6. awk: strip the expansion junk off the front and add the new header
-# 7. sed: squeeze spaces, strip off gen_ prefix, create needed #undef
-#
-
-# keep the editing independent of locale:
-if test "${LANGUAGE+set}" = set; then LANGUAGE=C; export LANGUAGE; fi
-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
-if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
-if test "${LC_COLLATE+set}" = set; then LC_COLLATE=C; export LC_COLLATE; fi
-
-preprocessor="$1 -I../include"
-AWK="$2"
-USE="$3"
-
-PID=$$
-ED1=sed1_${PID}.sed
-ED2=sed2_${PID}.sed
-ED3=sed3_${PID}.sed
-ED4=sed4_${PID}.sed
-AW1=awk1_${PID}.awk
-AW2=awk2_${PID}.awk
-TMP=gen__${PID}.c
-trap "rm -f $ED1 $ED2 $ED3 $ED4 $AW1 $AW2 $TMP" 0 1 2 5 15
-
-ALL=$USE
-if test "$USE" = implemented ; then
- CALL="call_"
- cat >$ED1 <<EOF1
-/^extern.*implemented/{
- h
- s/^.*implemented:\([^ *]*\).*/P_#if_USE_\1_SUPPORT/p
- g
- s/^extern \([^;]*\);.*/\1/p
- g
- s/^.*implemented:\([^ *]*\).*/P_#endif/p
-}
-/^extern.*generated/{
- h
- s/^.*generated:\([^ *]*\).*/P_#if_USE_\1_SUPPORT/p
- g
- s/^extern \([^;]*\);.*/\1/p
- g
- s/^.*generated:\([^ *]*\).*/P_#endif/p
-}
-EOF1
-else
- CALL=""
- cat >$ED1 <<EOF1
-/^extern.*${ALL}/{
- h
- s/^.*${ALL}:\([^ *]*\).*/P_#if_USE_\1_SUPPORT/p
- g
- s/^extern \([^;]*\);.*/\1/p
- g
- s/^.*${ALL}:\([^ *]*\).*/P_#endif/p
-}
-EOF1
-fi
-
-cat >$ED2 <<EOF2
-/^P_/b nc
-/(void)/b nc
- s/,/ a1% /
- s/,/ a2% /
- s/,/ a3% /
- s/,/ a4% /
- s/,/ a5% /
- s/,/ a6% /
- s/,/ a7% /
- s/,/ a8% /
- s/,/ a9% /
- s/,/ a10% /
- s/,/ a11% /
- s/,/ a12% /
- s/,/ a13% /
- s/,/ a14% /
- s/,/ a15% /
- s/*/ * /g
- s/%/ , /g
- s/)/ z)/
- s/\.\.\. z)/...)/
-:nc
- /(/s// ( /
- s/)/ )/
-EOF2
-
-cat >$ED3 <<EOF3
-/^P_/{
- s/^P_#if_/#if /
- s/^P_//
- b done
-}
- s/ */ /g
- s/ */ /g
- s/ ,/,/g
- s/( /(/g
- s/ )/)/g
- s/ gen_/ /
- s/^M_/#undef /
- /^%%/s// /
-:done
-EOF3
-
-if test "$USE" = generated ; then
-cat >$ED4 <<EOF
- s/^\(.*\) \(.*\) (\(.*\))\$/NCURSES_EXPORT(\1) \2 (\3)/
-EOF
-else
-cat >$ED4 <<EOF
-/^\(.*\) \(.*\) (\(.*\))\$/ {
- h
- s/^\(.*\) \(.*\) (\(.*\))\$/extern \1 call_\2 (\3);/
- p
- g
- s/^\(.*\) \(.*\) (\(.*\))\$/\1 call_\2 (\3)/
- }
-EOF
-fi
-
-cat >$AW1 <<\EOF1
-BEGIN {
- skip=0;
- }
-/^P_#if/ {
- print "\n"
- print $0
- skip=0;
-}
-/^P_#endif/ {
- print $0
- skip=1;
-}
-$0 !~ /^P_/ {
- if (skip)
- print "\n"
- skip=1;
-
- first=$1
- for (i = 1; i <= NF; i++) {
- if ( $i != "NCURSES_CONST" ) {
- first = i;
- break;
- }
- }
- second = first + 1;
- if ( $first == "chtype" ) {
- returnType = "Char";
- } else if ( $first == "SCREEN" ) {
- returnType = "SP";
- } else if ( $first == "WINDOW" ) {
- returnType = "Win";
- } else if ( $first == "attr_t" || $second == "attrset" || $second == "standout" || $second == "standend" || $second == "wattrset" || $second == "wstandout" || $second == "wstandend" ) {
- returnType = "Attr";
- } else if ( $first == "bool" || $first == "NCURSES_BOOL" ) {
- returnType = "Bool";
- } else if ( $second == "*" ) {
- returnType = "Ptr";
- } else {
- returnType = "Code";
- }
- myfunc = second;
- for (i = second; i <= NF; i++) {
- if ($i != "*") {
- myfunc = i;
- break;
- }
- }
- if (using == "generated") {
- print "M_" $myfunc
- }
- print $0;
- print "{";
- argcount = 1;
- check = NF - 1;
- if ($check == "void")
- argcount = 0;
- if (argcount != 0) {
- for (i = 1; i <= NF; i++)
- if ($i == ",")
- argcount++;
- }
-
- # suppress trace-code for functions that we cannot do properly here,
- # since they return data.
- dotrace = 1;
- if ($myfunc ~ /innstr/)
- dotrace = 0;
- if ($myfunc ~ /innwstr/)
- dotrace = 0;
-
- # workaround functions that we do not parse properly
- if ($myfunc ~ /ripoffline/) {
- dotrace = 0;
- argcount = 2;
- }
- if ($myfunc ~ /wunctrl/) {
- dotrace = 0;
- }
-
- call = "%%T((T_CALLED(\""
- args = ""
- comma = ""
- num = 0;
- pointer = 0;
- argtype = ""
- for (i = myfunc; i <= NF; i++) {
- ch = $i;
- if ( ch == "*" )
- pointer = 1;
- else if ( ch == "va_list" )
- pointer = 1;
- else if ( ch == "char" )
- argtype = "char";
- else if ( ch == "int" )
- argtype = "int";
- else if ( ch == "short" )
- argtype = "short";
- else if ( ch == "chtype" )
- argtype = "chtype";
- else if ( ch == "attr_t" || ch == "NCURSES_ATTR_T" )
- argtype = "attr";
-
- if ( ch == "," || ch == ")" ) {
- if (pointer) {
- if ( argtype == "char" ) {
- call = call "%s"
- comma = comma "_nc_visbuf2(" num ","
- pointer = 0;
- } else
- call = call "%p"
- } else if (argcount != 0) {
- if ( argtype == "int" || argtype == "short" ) {
- call = call "%d"
- argtype = ""
- } else if ( argtype != "" ) {
- call = call "%s"
- comma = comma "_trace" argtype "2(" num ","
- } else {
- call = call "%#lx"
- comma = comma "(long)"
- }
- }
- if (ch == ",")
- args = args comma "a" ++num;
- else if ( argcount != 0 && $check != "..." )
- args = args comma "z"
- call = call ch
- if (pointer == 0 && argcount != 0 && argtype != "" )
- args = args ")"
- if (args != "")
- comma = ", "
- pointer = 0;
- argtype = ""
- }
- if ( i == 2 || ch == "(" )
- call = call ch
- }
- call = call "\")"
- if (args != "")
- call = call ", " args
- call = call ")); "
-
- if (dotrace)
- printf "%s", call
-
- if (match($0, "^void"))
- call = ""
- else if (dotrace)
- call = sprintf("return%s( ", returnType);
- else
- call = "%%return ";
-
- call = call $myfunc "(";
- for (i = 1; i < argcount; i++) {
- if (i != 1)
- call = call ", ";
- call = call "a" i;
- }
- if ( argcount != 0 && $check != "..." ) {
- if (argcount != 1)
- call = call ", ";
- call = call "z";
- }
- if (!match($0, "^void"))
- call = call ") ";
- if (dotrace)
- call = call ")";
- print call ";"
-
- if (match($0, "^void"))
- print "%%returnVoid;"
- print "}";
-}
-EOF1
-
-cat >$AW2 <<EOF1
-BEGIN {
- print "/*"
- print " * DO NOT EDIT THIS FILE BY HAND!"
- printf " * It is generated by $0 %s.\n", "$USE"
- if ( "$USE" == "generated" ) {
- print " *"
- print " * This is a file of trivial functions generated from macro"
- print " * definitions in curses.h to satisfy the XSI Curses requirement"
- print " * that every macro also exist as a callable function."
- print " *"
- print " * It will never be linked unless you call one of the entry"
- print " * points with its normal macro definition disabled. In that"
- print " * case, if you have no shared libraries, it will indirectly"
- print " * pull most of the rest of the library into your link image."
- }
- print " */"
- print "#include <curses.priv.h>"
- print ""
- }
-/^DECLARATIONS/ {start = 1; next;}
- {if (start) print \$0;}
-END {
- if ( "$USE" != "generated" ) {
- print "int main(void) { return 0; }"
- }
- }
-EOF1
-
-cat >$TMP <<EOF
-#include <ncurses_cfg.h>
-#include <curses.h>
-
-DECLARATIONS
-
-EOF
-
-sed -n -f $ED1 \
-| sed -e 's/NCURSES_EXPORT(\(.*\)) \(.*\) (\(.*\))/\1 \2(\3)/' \
-| sed -f $ED2 \
-| $AWK -f $AW1 using=$USE \
-| sed -e 's/^\([a-z_][a-z_]*[ *]*\)/\1 gen_/' -e 's/ / /g' >>$TMP
-
-$preprocessor $TMP 2>/dev/null \
-| sed -e 's/ / /g' -e 's/^ //' \
-| $AWK -f $AW2 \
-| sed -f $ED3 \
-| sed \
- -e 's/^.*T_CALLED.*returnCode( \([a-z].*) \));/ return \1;/' \
- -e 's/^.*T_CALLED.*returnCode( \((wmove.*) \));/ return \1;/' \
-| sed -f $ED4
diff --git a/ncurses-5.3/ncurses/base/MKunctrl.awk b/ncurses-5.3/ncurses/base/MKunctrl.awk
deleted file mode 100644
index 892f6fb..0000000
--- a/ncurses-5.3/ncurses/base/MKunctrl.awk
+++ /dev/null
@@ -1,69 +0,0 @@
-# $Id$
-##############################################################################
-# Copyright (c) 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: Thomas E. Dickey <dickey@clark.net> 1997
-#
-
-BEGIN {
- print "/* generated by MKunctrl.awk */"
- print ""
- print "#include <curses.priv.h>"
- print ""
- print "#undef unctrl"
- print ""
- }
-END {
- print "NCURSES_EXPORT(NCURSES_CONST char *) unctrl (register chtype ch)"
- print "{"
- printf "static const char* const table[] = {"
- for ( ch = 0; ch < 256; ch++ ) {
- gap = ","
- if ((ch % 8) == 0)
- printf "\n "
- if (ch < 32) {
- printf "\"^\\%03o\"", ch + 64
- } else if (ch == 127) {
- printf "\"^?\""
- } else if (ch >= 128 && ch < 160) {
- printf "\"~\\%03o\"", ch - 64
- } else {
- printf "\"\\%03o\"", ch
- gap = gap " "
- }
- if (ch == 255)
- gap = "\n"
- else if (((ch + 1) % 8) != 0)
- gap = gap " "
- printf "%s", gap
- }
- print "};"
- print ""
- print "\treturn (NCURSES_CONST char *)table[ChCharOf(ch)];"
- print "}"
- }
diff --git a/ncurses-5.3/ncurses/base/README b/ncurses-5.3/ncurses/base/README
deleted file mode 100644
index 114c11f..0000000
--- a/ncurses-5.3/ncurses/base/README
+++ /dev/null
@@ -1,7 +0,0 @@
--- $Id$
-
-The functions in this directory are the generic (not device-specific) modules
-of ncurses.
-
-As a rule, these modules should not depend directly on term.h references and
-associated terminfo function and variables.
diff --git a/ncurses-5.3/ncurses/base/define_key.c b/ncurses-5.3/ncurses/base/define_key.c
deleted file mode 100644
index 5b79a7f..0000000
--- a/ncurses-5.3/ncurses/base/define_key.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,2000 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 <dickey@clark.net> 1997 *
- ****************************************************************************/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-define_key
-(char *str, int keycode)
-{
- int code = ERR;
-
- T((T_CALLED("define_key(%s,%d)"), _nc_visbuf(str), keycode));
- if (keycode > 0) {
- if (str != 0) {
- define_key(str, 0);
- } else if (has_key(keycode)) {
- while (_nc_remove_key(&(SP->_keytry), keycode))
- code = OK;
- }
- if (str != 0) {
- (void) _nc_add_to_try(&(SP->_keytry), str, keycode);
- code = OK;
- }
- } else {
- while (_nc_remove_string(&(SP->_keytry), str))
- code = OK;
- }
- returnCode(code);
-}
diff --git a/ncurses-5.3/ncurses/base/keybound.c b/ncurses-5.3/ncurses/base/keybound.c
deleted file mode 100644
index 0013a06..0000000
--- a/ncurses-5.3/ncurses/base/keybound.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1999,2000 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 <dickey@clark.net> 1999 *
- ****************************************************************************/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-/*
- * Returns the count'th string definition which is associated with the
- * given keycode. The result is malloc'd, must be freed by the caller.
- */
-
-NCURSES_EXPORT(char *)
-keybound(int code, int count)
-{
- return _nc_expand_try(SP->_key_ok, code, &count, 0);
-}
diff --git a/ncurses-5.3/ncurses/base/keyok.c b/ncurses-5.3/ncurses/base/keyok.c
deleted file mode 100644
index 8b7f410..0000000
--- a/ncurses-5.3/ncurses/base/keyok.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,2000 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 <dickey@clark.net> 1997 *
- ****************************************************************************/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-/*
- * Enable (or disable) ncurses' interpretation of a keycode by adding (or
- * removing) the corresponding 'tries' entry.
- *
- * Do this by storing a second tree of tries, which records the disabled keys.
- * The simplest way to copy is to make a function that returns the string (with
- * nulls set to 0200), then use that to reinsert the string into the
- * corresponding tree.
- */
-
-NCURSES_EXPORT(int)
-keyok(int c, bool flag)
-{
- int code = ERR;
- int count = 0;
- char *s;
-
- T((T_CALLED("keyok(%d,%d)"), c, flag));
- if (flag) {
- while ((s = _nc_expand_try(SP->_key_ok, c, &count, 0)) != 0
- && _nc_remove_key(&(SP->_key_ok), c)) {
- _nc_add_to_try(&(SP->_keytry), s, c);
- free(s);
- code = OK;
- count = 0;
- }
- } else {
- while ((s = _nc_expand_try(SP->_keytry, c, &count, 0)) != 0
- && _nc_remove_key(&(SP->_keytry), c)) {
- _nc_add_to_try(&(SP->_key_ok), s, c);
- free(s);
- code = OK;
- count = 0;
- }
- }
- returnCode(code);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_addch.c b/ncurses-5.3/ncurses/base/lib_addch.c
deleted file mode 100644
index ec43b98..0000000
--- a/ncurses-5.3/ncurses/base/lib_addch.c
+++ /dev/null
@@ -1,365 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998-2001,2002 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. *
- ****************************************************************************/
-
-/*
-** lib_addch.c
-**
-** The routine waddch().
-**
-*/
-
-#include <curses.priv.h>
-#include <ctype.h>
-
-MODULE_ID("$Id$")
-
-/*
- * Ugly microtweaking alert. Everything from here to end of module is
- * likely to be speed-critical -- profiling data sure says it is!
- * Most of the important screen-painting functions are shells around
- * waddch(). So we make every effort to reduce function-call overhead
- * by inlining stuff, even at the cost of making wrapped copies for
- * export. Also we supply some internal versions that don't call the
- * window sync hook, for use by string-put functions.
- */
-
-/* Return bit mask for clearing color pair number if given ch has color */
-#define COLOR_MASK(ch) (~(attr_t)((ch)&A_COLOR?A_COLOR:0))
-
-static inline NCURSES_CH_T
-render_char(WINDOW *win, NCURSES_CH_T ch)
-/* compute a rendition of the given char correct for the current context */
-{
- attr_t a = win->_attrs;
-
- if (ISBLANK(ch) && AttrOf(ch) == A_NORMAL) {
- /* color in attrs has precedence over bkgrnd */
- ch = win->_nc_bkgd;
- SetAttr(ch, a | (AttrOf(win->_nc_bkgd) & COLOR_MASK(a)));
- } else {
- /* color in attrs has precedence over bkgrnd */
- a |= AttrOf(win->_nc_bkgd) & COLOR_MASK(a);
- /* color in ch has precedence */
- AddAttr(ch, (a & COLOR_MASK(AttrOf(ch))));
- }
-
- TR(TRACE_VIRTPUT, ("bkg = %s, attrs = %s -> ch = %s",
- _tracech_t2(1, CHREF(win->_nc_bkgd)),
- _traceattr(win->_attrs),
- _tracech_t2(3, CHREF(ch))));
-
- return (ch);
-}
-
-NCURSES_EXPORT(NCURSES_CH_T)
-_nc_render(WINDOW *win, NCURSES_CH_T ch)
-/* make render_char() visible while still allowing us to inline it below */
-{
- return render_char(win, ch);
-}
-
-/* check if position is legal; if not, return error */
-#ifndef NDEBUG /* treat this like an assertion */
-#define CHECK_POSITION(win, x, y) \
- if (y > win->_maxy \
- || x > win->_maxx \
- || y < 0 \
- || x < 0) { \
- TR(TRACE_VIRTPUT, ("Alert! Win=%p _curx = %d, _cury = %d " \
- "(_maxx = %d, _maxy = %d)", win, x, y, \
- win->_maxx, win->_maxy)); \
- return(ERR); \
- }
-#else
-#define CHECK_POSITION(win, x, y) /* nothing */
-#endif
-
-static inline int
-waddch_literal(WINDOW *win, NCURSES_CH_T ch)
-{
- int x;
- struct ldat *line;
-
- x = win->_curx;
-
- CHECK_POSITION(win, x, win->_cury);
-
- /*
- * If we're trying to add a character at the lower-right corner more
- * than once, fail. (Moving the cursor will clear the flag).
- */
-#if 0 /* Solaris 2.6 allows updating the corner more than once */
- if (win->_flags & _WRAPPED) {
- if (x >= win->_maxx)
- return (ERR);
- win->_flags &= ~_WRAPPED;
- }
-#endif
-
- ch = render_char(win, ch);
- TR(TRACE_VIRTPUT, ("win attr = %s", _traceattr(win->_attrs)));
-
- line = win->_line + win->_cury;
-
- CHANGED_CELL(line, x);
-
- /*
- * Handle non-spacing characters
- */
- if_WIDEC({
- if (wcwidth(CharOf(ch)) == 0) {
- int i;
- int y;
- if ((x > 0 && ((y = win->_cury) >= 0))
- || ((y = win->_cury - 1) >= 0 &&
- (x = win->_maxx) > 0)) {
- wchar_t *chars = (win->_line[y].text[x - 1].chars);
- for (i = 0; i < CCHARW_MAX; ++i) {
- if (chars[i] == 0) {
- chars[i] = CharOf(ch);
- break;
- }
- }
- }
- goto testwrapping;
- }
- });
- line->text[x++] = ch;
- /*
- * Provide for multi-column characters
- */
- if_WIDEC({
- if (wcwidth(CharOf(ch)) > 1)
- AddAttr(line->text[x++], WA_NAC);
- }
- testwrapping:
- );
-
- TR(TRACE_VIRTPUT, ("(%d, %d) = %s", win->_cury, x, _tracech_t(CHREF(ch))));
- if (x > win->_maxx) {
- /*
- * The _WRAPPED flag is useful only for telling an application that
- * we've just wrapped the cursor. We don't do anything with this flag
- * except set it when wrapping, and clear it whenever we move the
- * cursor. If we try to wrap at the lower-right corner of a window, we
- * cannot move the cursor (since that wouldn't be legal). So we return
- * an error (which is what SVr4 does). Unlike SVr4, we can
- * successfully add a character to the lower-right corner (Solaris 2.6
- * does this also, however).
- */
- win->_flags |= _WRAPPED;
- if (++win->_cury > win->_regbottom) {
- win->_cury = win->_regbottom;
- win->_curx = win->_maxx;
- if (!win->_scroll)
- return (ERR);
- scroll(win);
- }
- win->_curx = 0;
- return (OK);
- }
- win->_curx = x;
- return OK;
-}
-
-static inline int
-waddch_nosync(WINDOW *win, const NCURSES_CH_T ch)
-/* the workhorse function -- add a character to the given window */
-{
- int x, y;
- chtype t = 0;
- const char *s = 0;
-
- if ((AttrOf(ch) & A_ALTCHARSET)
- || ((t = CharOf(ch)) > 127)
- || ((s = unctrl(t))[1] == 0))
- return waddch_literal(win, ch);
-
- x = win->_curx;
- y = win->_cury;
-
- switch (t) {
- case '\t':
- x += (TABSIZE - (x % TABSIZE));
-
- /*
- * Space-fill the tab on the bottom line so that we'll get the
- * "correct" cursor position.
- */
- if ((!win->_scroll && (y == win->_regbottom))
- || (x <= win->_maxx)) {
- NCURSES_CH_T blank = NewChar2(BLANK_TEXT, BLANK_ATTR);
- AddAttr(blank, AttrOf(ch));
- while (win->_curx < x) {
- if (waddch_literal(win, blank) == ERR)
- return (ERR);
- }
- break;
- } else {
- wclrtoeol(win);
- win->_flags |= _WRAPPED;
- if (++y > win->_regbottom) {
- x = win->_maxx;
- y--;
- if (win->_scroll) {
- scroll(win);
- x = 0;
- }
- } else {
- x = 0;
- }
- }
- break;
- case '\n':
- wclrtoeol(win);
- if (++y > win->_regbottom) {
- y--;
- if (win->_scroll)
- scroll(win);
- else
- return (ERR);
- }
- /* FALLTHRU */
- case '\r':
- x = 0;
- win->_flags &= ~_WRAPPED;
- break;
- case '\b':
- if (x == 0)
- return (OK);
- x--;
- win->_flags &= ~_WRAPPED;
- break;
- default:
- while (*s) {
- NCURSES_CH_T sch;
- SetChar(sch, *s++, AttrOf(ch));
- if (waddch_literal(win, sch) == ERR)
- return ERR;
- }
- return (OK);
- }
-
- win->_curx = x;
- win->_cury = y;
-
- return (OK);
-}
-
-NCURSES_EXPORT(int)
-_nc_waddch_nosync(WINDOW *win, const NCURSES_CH_T c)
-/* export copy of waddch_nosync() so the string-put functions can use it */
-{
- return (waddch_nosync(win, c));
-}
-
-/*
- * The versions below call _nc_synhook(). We wanted to avoid this in the
- * version exported for string puts; they'll call _nc_synchook once at end
- * of run.
- */
-
-/* These are actual entry points */
-
-NCURSES_EXPORT(int)
-waddch(WINDOW *win, const chtype ch)
-{
- int code = ERR;
- NCURSES_CH_T wch;
- SetChar2(wch, ch);
-
- TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("waddch(%p, %s)"), win,
- _tracechtype(ch)));
-
- if (win && (waddch_nosync(win, wch) != ERR)) {
- _nc_synchook(win);
- code = OK;
- }
-
- TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_RETURN("%d"), code));
- return (code);
-}
-
-NCURSES_EXPORT(int)
-wechochar(WINDOW *win, const chtype ch)
-{
- int code = ERR;
- NCURSES_CH_T wch;
- SetChar2(wch, ch);
-
- TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wechochar(%p, %s)"), win,
- _tracechtype(ch)));
-
- if (win && (waddch_nosync(win, wch) != ERR)) {
- bool save_immed = win->_immed;
- win->_immed = TRUE;
- _nc_synchook(win);
- win->_immed = save_immed;
- code = OK;
- }
- TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_RETURN("%d"), code));
- return (code);
-}
-
-#if USE_WIDEC_SUPPORT
-NCURSES_EXPORT(int)
-wadd_wch(WINDOW *win, const cchar_t * wch)
-{
- int code = ERR;
-
- TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wadd_wch(%p, %s)"), win,
- _tracech_t(wch)));
-
- if (win && (waddch_nosync(win, *wch) != ERR)) {
- _nc_synchook(win);
- code = OK;
- }
-
- TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_RETURN("%d"), code));
- return (code);
-}
-
-NCURSES_EXPORT(int)
-wecho_wchar(WINDOW *win, const cchar_t * wch)
-{
- int code = ERR;
-
- TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wecho_wchar(%p, %s)"), win,
- _tracech_t(wch)));
-
- if (win && (waddch_nosync(win, *wch) != ERR)) {
- bool save_immed = win->_immed;
- win->_immed = TRUE;
- _nc_synchook(win);
- win->_immed = save_immed;
- code = OK;
- }
- TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_RETURN("%d"), code));
- return (code);
-}
-#endif /* USE_WIDEC_SUPPORT */
diff --git a/ncurses-5.3/ncurses/base/lib_addstr.c b/ncurses-5.3/ncurses/base/lib_addstr.c
deleted file mode 100644
index 57731a9..0000000
--- a/ncurses-5.3/ncurses/base/lib_addstr.c
+++ /dev/null
@@ -1,253 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998-2001,2002 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> *
- ****************************************************************************/
-
-/*
-** lib_addstr.c
-*
-** The routines waddnstr(), waddchnstr().
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-#if USE_WIDEC_SUPPORT
-#define CONV_DATA mbstate_t state; wchar_t cached; int clen = 0
-#define CONV_INIT memset (&state, '\0', sizeof (state)); cached = (wchar_t)WEOF
-#define NEXT_CHAR(s,ch, n) \
- { \
- int len, i = 0; \
- memset(&ch, 0, sizeof(cchar_t)); \
- if (cached != (wchar_t) WEOF) { \
- ch.chars[i++] = cached; \
- cached = (wchar_t) WEOF; \
- n -= clen; \
- s += clen; \
- } \
- for (; i < CCHARW_MAX && n > 0; ++i) { \
- if ((len = mbrtowc(&ch.chars[i], s, n, &state)) < 0) { \
- code = ERR; \
- break; \
- } \
- if (i == 0 || wcwidth(ch.chars[i]) == 0) { \
- n -= len; \
- s += len; \
- } else { \
- cached = ch.chars[i]; \
- clen = len; \
- ch.chars[i] = L'\0'; \
- break; \
- } \
- } \
- if (code == ERR) \
- break; \
- }
-#else
-#define CONV_DATA
-#define CONV_INIT
-#define NEXT_CHAR(s,ch, n) \
- ch = *s++; \
- --n
-#endif
-
-NCURSES_EXPORT(int)
-waddnstr(WINDOW *win, const char *astr, int n)
-{
- unsigned const char *str = (unsigned const char *) astr;
- int code = ERR;
- CONV_DATA;
-
- T((T_CALLED("waddnstr(%p,%s,%d)"), win, _nc_visbufn(astr, n), n));
-
- if (win && (str != 0)) {
- TR(TRACE_VIRTPUT | TRACE_ATTRS, ("... current %s", _traceattr(win->_attrs)));
- code = OK;
- if (n < 0)
- n = (int) strlen(astr);
-
- TR(TRACE_VIRTPUT, ("str is not null, length = %d", n));
- CONV_INIT;
- while ((n > 0) && (*str != '\0')) {
- NCURSES_CH_T ch;
- TR(TRACE_VIRTPUT, ("*str = %#x", *str));
- NEXT_CHAR(str, ch, n);
- if (_nc_waddch_nosync(win, ch) == ERR) {
- code = ERR;
- break;
- }
- }
- _nc_synchook(win);
- }
- TR(TRACE_VIRTPUT, ("waddnstr returns %d", code));
- returnCode(code);
-}
-
-NCURSES_EXPORT(int)
-waddchnstr(WINDOW *win, const chtype * astr, int n)
-{
- NCURSES_SIZE_T y = win->_cury;
- NCURSES_SIZE_T x = win->_curx;
- int code = OK;
- struct ldat *line;
-
- T((T_CALLED("waddchnstr(%p,%p,%d)"), win, astr, n));
-
- if (!win)
- returnCode(ERR);
-
- if (n < 0) {
- const chtype *str;
- n = 0;
- for (str = (const chtype *) astr; *str != 0; str++)
- n++;
- }
- if (n > win->_maxx - x + 1)
- n = win->_maxx - x + 1;
- if (n == 0)
- returnCode(code);
-
- line = &(win->_line[y]);
-#if USE_WIDEC_SUPPORT
- {
- int i;
- for (i = 0; i < n; ++i)
- SetChar(line->text[i + x], ChCharOf(astr[i]), ChAttrOf(astr[i]));
- }
-#else
- memcpy(line->text + x, astr, n * sizeof(*astr));
-#endif
- CHANGED_RANGE(line, x, x + n - 1);
-
- _nc_synchook(win);
- returnCode(code);
-}
-
-#if USE_WIDEC_SUPPORT
-
-int
-_nc_wchstrlen(const cchar_t * s)
-{
- int result = 0;
- while (CharOf(s[result]) != L'\0') {
- result++;
- }
- return result;
-}
-
-NCURSES_EXPORT(int)
-wadd_wchnstr(WINDOW *win, const cchar_t * const astr, int n)
-{
- NCURSES_SIZE_T y = win->_cury;
- NCURSES_SIZE_T x = win->_curx;
- int code = OK;
- struct ldat *line;
- int i, start, end;
-
- T((T_CALLED("wadd_wchnstr(%p,%s,%d)"), win, _nc_viscbuf(astr, n), n));
-
- if (!win)
- returnCode(ERR);
-
- if (n < 0) {
- n = _nc_wchstrlen(astr);
- }
- if (n > win->_maxx - x + 1)
- n = win->_maxx - x + 1;
- if (n == 0)
- returnCode(code);
-
- line = &(win->_line[y]);
- start = x;
- end = x + n - 1;
- if (isnac(line->text[x])) {
- line->text[x - 1] = win->_nc_bkgd;
- --start;
- }
- for (i = 0; i < n && x <= win->_maxx; ++i) {
- line->text[x++] = astr[i];
- if (wcwidth(CharOf(astr[i])) > 1) {
- if (x <= win->_maxx)
- AddAttr(line->text[x++], WA_NAC);
- else
- line->text[x - 1] = win->_nc_bkgd;
- }
- }
- if (x <= win->_maxx && isnac(line->text[x])) {
- line->text[x] = win->_nc_bkgd;
- ++end;
- }
- CHANGED_RANGE(line, start, end);
-
- _nc_synchook(win);
- returnCode(code);
-}
-
-NCURSES_EXPORT(int)
-waddnwstr(WINDOW *win, const wchar_t * str, int n)
-{
- int code = ERR;
- int i;
-
- T((T_CALLED("waddnwstr(%p,%s,%d)"), win, _nc_viswbufn(str,n), n));
-
- if (win && (str != 0)) {
- TR(TRACE_VIRTPUT | TRACE_ATTRS, ("... current %s", _traceattr(win->_attrs)));
- code = OK;
- if (n < 0)
- n = (int) wcslen(str);
-
- TR(TRACE_VIRTPUT, ("str is not null, length = %d", n));
- while ((n-- > 0) && (*str != L('\0'))) {
- NCURSES_CH_T ch;
- TR(TRACE_VIRTPUT, ("*str[0] = %#lx", *str));
- SetChar(ch, *str++, A_NORMAL);
- i = 1;
- while (i < CCHARW_MAX && n > 0 && (*str != L('\0'))
- && wcwidth(*str) == 0) {
- TR(TRACE_VIRTPUT, ("*str[%d] = %#lx", i, *str));
- ch.chars[i++] = *str++;
- --n;
- }
- if (_nc_waddch_nosync(win, ch) == ERR) {
- code = ERR;
- break;
- }
- }
- _nc_synchook(win);
- }
- TR(TRACE_VIRTPUT, ("waddnwstr returns %d", code));
- returnCode(code);
-}
-
-#endif
diff --git a/ncurses-5.3/ncurses/base/lib_beep.c b/ncurses-5.3/ncurses/base/lib_beep.c
deleted file mode 100644
index 40ded12..0000000
--- a/ncurses-5.3/ncurses/base/lib_beep.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,2000 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> *
- ****************************************************************************/
-
-/*
- * beep.c
- *
- * The routine beep().
- *
- */
-
-#include <curses.priv.h>
-#include <term.h> /* beep, flash */
-
-MODULE_ID("$Id$")
-
-/*
- * beep()
- *
- * Sound the current terminal's audible bell if it has one. If not,
- * flash the screen if possible.
- *
- */
-
-NCURSES_EXPORT(int)
-beep(void)
-{
- int res = ERR;
-
- T((T_CALLED("beep()")));
-
- /* FIXME: should make sure that we are not in altchar mode */
- if (bell) {
- TPUTS_TRACE("bell");
- res = putp(bell);
- _nc_flush();
- } else if (flash_screen) {
- TPUTS_TRACE("flash_screen");
- res = putp(flash_screen);
- _nc_flush();
- }
-
- returnCode(res);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_bkgd.c b/ncurses-5.3/ncurses/base/lib_bkgd.c
deleted file mode 100644
index 0a0e3d6..0000000
--- a/ncurses-5.3/ncurses/base/lib_bkgd.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,2001-2002 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> *
- ****************************************************************************/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-/*
- * Set the window's background information.
- */
-#if USE_WIDEC_SUPPORT
-NCURSES_EXPORT(void)
-#else
-static inline void
-#endif
-wbkgrndset(WINDOW *win, const ARG_CH_T ch)
-{
- T((T_CALLED("wbkgdset(%p,%s)"), win, _tracech_t(ch)));
-
- if (win) {
- attr_t off = AttrOf(win->_nc_bkgd);
- attr_t on = AttrOf(CHDEREF(ch));
-
- toggle_attr_off(win->_attrs, off);
- toggle_attr_on(win->_attrs, on);
-
- if (CharOf(CHDEREF(ch)) == L('\0'))
- SetChar(win->_nc_bkgd, BLANK_TEXT, AttrOf(CHDEREF(ch)));
- else
- win->_nc_bkgd = CHDEREF(ch);
-#if USE_WIDEC_SUPPORT
- /*
- * If we're compiled for wide-character support, _bkgrnd is the
- * preferred location for the background information since it stores
- * more than _bkgd. Update _bkgd each time we modify _bkgrnd, so the
- * macro getbkgd() will work.
- */
- {
- cchar_t wch;
- int tmp;
-
- wgetbkgrnd(win, &wch);
- tmp = wctob(CharOf(wch));
-
- win->_bkgd = ((tmp == EOF) ? ' ' : (chtype) tmp) | AttrOf(wch);
- }
-#endif
- }
- returnVoid;
-}
-
-NCURSES_EXPORT(void)
-wbkgdset(WINDOW *win, chtype ch)
-{
- NCURSES_CH_T wch;
- SetChar2(wch, ch);
- wbkgrndset(win, CHREF(wch));
-}
-
-/*
- * Set the window's background information and apply it to each cell.
- */
-#if USE_WIDEC_SUPPORT
-NCURSES_EXPORT(int)
-#else
-static inline int
-#undef wbkgrnd
-#endif
-wbkgrnd(WINDOW *win, const ARG_CH_T ch)
-{
- int code = ERR;
- int x, y;
- NCURSES_CH_T new_bkgd = CHDEREF(ch);
-
- T((T_CALLED("wbkgd(%p,%s)"), win, _tracech_t(ch)));
-
- if (win) {
- NCURSES_CH_T old_bkgrnd;
- wgetbkgrnd(win, &old_bkgrnd);
-
- wbkgrndset(win, CHREF(new_bkgd));
- wattrset(win, AttrOf(win->_nc_bkgd));
-
- for (y = 0; y <= win->_maxy; y++) {
- for (x = 0; x <= win->_maxx; x++) {
- if (CharEq(win->_line[y].text[x], old_bkgrnd))
- win->_line[y].text[x] = win->_nc_bkgd;
- else {
- NCURSES_CH_T wch = win->_line[y].text[x];
- RemAttr(wch, (~A_ALTCHARSET));
- win->_line[y].text[x] = _nc_render(win, wch);
- }
- }
- }
- touchwin(win);
- _nc_synchook(win);
- code = OK;
- }
- returnCode(code);
-}
-
-NCURSES_EXPORT(int)
-wbkgd(WINDOW *win, chtype ch)
-{
- NCURSES_CH_T wch;
- SetChar2(wch, ch);
- return wbkgrnd(win, CHREF(wch));
-}
diff --git a/ncurses-5.3/ncurses/base/lib_box.c b/ncurses-5.3/ncurses/base/lib_box.c
deleted file mode 100644
index 6ac360b..0000000
--- a/ncurses-5.3/ncurses/base/lib_box.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998-2001,2002 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> *
- ****************************************************************************/
-
-/*
-** lib_box.c
-**
-** The routine wborder().
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-#if USE_WIDEC_SUPPORT
-static inline chtype
-_my_render(WINDOW *win, chtype ch)
-{
- NCURSES_CH_T wch;
- SetChar2(wch, ch);
- wch = _nc_render(win, wch);
- return CharOf(wch) | AttrOf(wch);
-}
-#define RENDER_WITH_DEFAULT(ch,def) w ## ch = _my_render(win, (ch == 0) ? def : ch)
-#else
-#define RENDER_WITH_DEFAULT(ch,def) w ## ch = _nc_render(win, (ch == 0) ? def : ch)
-#endif
-
-NCURSES_EXPORT(int)
-wborder(WINDOW *win,
- chtype ls, chtype rs,
- chtype ts, chtype bs,
- chtype tl, chtype tr,
- chtype bl, chtype br)
-{
- NCURSES_SIZE_T i;
- NCURSES_SIZE_T endx, endy;
- chtype wls, wrs, wts, wbs, wtl, wtr, wbl, wbr;
-
- T((T_CALLED("wborder(%p,%s,%s,%s,%s,%s,%s,%s,%s)"),
- win,
- _tracechtype2(1, ls),
- _tracechtype2(2, rs),
- _tracechtype2(3, ts),
- _tracechtype2(4, bs),
- _tracechtype2(5, tl),
- _tracechtype2(6, tr),
- _tracechtype2(7, bl),
- _tracechtype2(8, br)));
-
- if (!win)
- returnCode(ERR);
-
- RENDER_WITH_DEFAULT(ls, ACS_VLINE);
- RENDER_WITH_DEFAULT(rs, ACS_VLINE);
- RENDER_WITH_DEFAULT(ts, ACS_HLINE);
- RENDER_WITH_DEFAULT(bs, ACS_HLINE);
- RENDER_WITH_DEFAULT(tl, ACS_ULCORNER);
- RENDER_WITH_DEFAULT(tr, ACS_URCORNER);
- RENDER_WITH_DEFAULT(bl, ACS_LLCORNER);
- RENDER_WITH_DEFAULT(br, ACS_LRCORNER);
-
- T(("using %s, %s, %s, %s, %s, %s, %s, %s",
- _tracechtype2(1, wls),
- _tracechtype2(2, wrs),
- _tracechtype2(3, wts),
- _tracechtype2(4, wbs),
- _tracechtype2(5, wtl),
- _tracechtype2(6, wtr),
- _tracechtype2(7, wbl),
- _tracechtype2(8, wbr)));
-
- endx = win->_maxx;
- endy = win->_maxy;
-
- for (i = 0; i <= endx; i++) {
- SetChar2(win->_line[0].text[i], wts);
- SetChar2(win->_line[endy].text[i], wbs);
- }
- win->_line[endy].firstchar = win->_line[0].firstchar = 0;
- win->_line[endy].lastchar = win->_line[0].lastchar = endx;
-
- for (i = 0; i <= endy; i++) {
- SetChar2(win->_line[i].text[0], wls);
- SetChar2(win->_line[i].text[endx], wrs);
- win->_line[i].firstchar = 0;
- win->_line[i].lastchar = endx;
- }
- SetChar2(win->_line[0].text[0], wtl);
- SetChar2(win->_line[0].text[endx], wtr);
- SetChar2(win->_line[endy].text[0], wbl);
- SetChar2(win->_line[endy].text[endx], wbr);
-
- _nc_synchook(win);
- returnCode(OK);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_chgat.c b/ncurses-5.3/ncurses/base/lib_chgat.c
deleted file mode 100644
index 76f2b9a..0000000
--- a/ncurses-5.3/ncurses/base/lib_chgat.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************************
- * Copyright (c) 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> *
- ****************************************************************************/
-
-/*
-** lib_chgat.c
-**
-** The routine wchgat().
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-wchgat
-(WINDOW *win, int n, attr_t attr, short color, const void *opts GCC_UNUSED)
-{
- int i;
-
- T((T_CALLED("wchgat(%p,%d,%s,%d)"), win, n, _traceattr(attr), color));
-
- if (win) {
- toggle_attr_on(attr, COLOR_PAIR(color));
-
- for (i = win->_curx; i <= win->_maxx && (n == -1 || (n-- > 0)); i++)
- SetAttr(win->_line[win->_cury].text[i], attr);
-
- returnCode(OK);
- } else
- returnCode(ERR);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_clear.c b/ncurses-5.3/ncurses/base/lib_clear.c
deleted file mode 100644
index 10d31f4..0000000
--- a/ncurses-5.3/ncurses/base/lib_clear.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,2000 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> *
- ****************************************************************************/
-
-/*
-** lib_clear.c
-**
-** The routine wclear().
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-wclear(WINDOW *win)
-{
- int code = ERR;
-
- T((T_CALLED("wclear(%p)"), win));
-
- if ((code = werase(win)) != ERR)
- win->_clear = TRUE;
-
- returnCode(code);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_clearok.c b/ncurses-5.3/ncurses/base/lib_clearok.c
deleted file mode 100644
index 0eb9f01..0000000
--- a/ncurses-5.3/ncurses/base/lib_clearok.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,2000 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> *
- ****************************************************************************/
-
-/*
-** lib_clearok.c
-**
-** The routine clearok.
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-clearok(WINDOW *win, bool flag)
-{
- T((T_CALLED("clearok(%p,%d)"), win, flag));
-
- if (win) {
- win->_clear = flag;
- returnCode(OK);
- } else
- returnCode(ERR);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_clrbot.c b/ncurses-5.3/ncurses/base/lib_clrbot.c
deleted file mode 100644
index 8df77b5..0000000
--- a/ncurses-5.3/ncurses/base/lib_clrbot.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,1999,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> *
- ****************************************************************************/
-
-/*
-** lib_clrbot.c
-**
-** The routine wclrtobot().
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-wclrtobot(WINDOW *win)
-{
- int code = ERR;
-
- T((T_CALLED("wclrtobot(%p)"), win));
-
- if (win) {
- NCURSES_SIZE_T y;
- NCURSES_SIZE_T startx = win->_curx;
- NCURSES_CH_T blank = win->_nc_bkgd;
-
- T(("clearing from y = %d to y = %d with maxx = %d",
- win->_cury, win->_maxy, win->_maxx));
-
- for (y = win->_cury; y <= win->_maxy; y++) {
- struct ldat *line = &(win->_line[y]);
- NCURSES_CH_T *ptr = &(line->text[startx]);
- NCURSES_CH_T *end = &(line->text[win->_maxx]);
-
- CHANGED_TO_EOL(line, startx, win->_maxx);
-
- while (ptr <= end)
- *ptr++ = blank;
-
- startx = 0;
- }
- _nc_synchook(win);
- code = OK;
- }
- returnCode(code);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_clreol.c b/ncurses-5.3/ncurses/base/lib_clreol.c
deleted file mode 100644
index b39d24f..0000000
--- a/ncurses-5.3/ncurses/base/lib_clreol.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,1999,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> *
- ****************************************************************************/
-
-/*
-** lib_clreol.c
-**
-** The routine wclrtoeol().
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-wclrtoeol(WINDOW *win)
-{
- int code = ERR;
-
- T((T_CALLED("wclrtoeol(%p)"), win));
-
- if (win) {
- NCURSES_CH_T blank;
- NCURSES_CH_T *ptr, *end;
- struct ldat *line;
- NCURSES_SIZE_T y = win->_cury;
- NCURSES_SIZE_T x = win->_curx;
-
- /*
- * If we have just wrapped the cursor, the clear applies to the
- * new line, unless we are at the lower right corner.
- */
- if ((win->_flags & _WRAPPED) != 0
- && y < win->_maxy) {
- win->_flags &= ~_WRAPPED;
- }
-
- /*
- * There's no point in clearing if we're not on a legal
- * position, either.
- */
- if ((win->_flags & _WRAPPED) != 0
- || y > win->_maxy
- || x > win->_maxx)
- returnCode(ERR);
-
- blank = win->_nc_bkgd;
- line = &win->_line[y];
- CHANGED_TO_EOL(line, x, win->_maxx);
-
- ptr = &(line->text[x]);
- end = &(line->text[win->_maxx]);
-
- while (ptr <= end)
- *ptr++ = blank;
-
- _nc_synchook(win);
- code = OK;
- }
- returnCode(code);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_color.c b/ncurses-5.3/ncurses/base/lib_color.c
deleted file mode 100644
index f6531ed..0000000
--- a/ncurses-5.3/ncurses/base/lib_color.c
+++ /dev/null
@@ -1,531 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998-2001,2002 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> *
- ****************************************************************************/
-
-/* lib_color.c
- *
- * Handles color emulation of SYS V curses
- */
-
-#include <curses.priv.h>
-
-#include <term.h>
-#include <tic.h>
-
-MODULE_ID("$Id$")
-
-/*
- * These should be screen structure members. They need to be globals for
- * historical reasons. So we assign them in start_color() and also in
- * set_term()'s screen-switching logic.
- */
-NCURSES_EXPORT_VAR(int) COLOR_PAIRS = 0;
-NCURSES_EXPORT_VAR(int) COLORS = 0;
-
-#define DATA(r,g,b) {r,g,b, 0,0,0, 0}
-
-/*
- * Given a RGB range of 0..1000, we'll normally set the individual values
- * to about 2/3 of the maximum, leaving full-range for bold/bright colors.
- */
-#define RGB_ON 680
-#define RGB_OFF 0
-/* *INDENT-OFF* */
-static const color_t cga_palette[] =
-{
- /* R G B */
- DATA(RGB_OFF, RGB_OFF, RGB_OFF), /* COLOR_BLACK */
- DATA(RGB_ON, RGB_OFF, RGB_OFF), /* COLOR_RED */
- DATA(RGB_OFF, RGB_ON, RGB_OFF), /* COLOR_GREEN */
- DATA(RGB_ON, RGB_ON, RGB_OFF), /* COLOR_YELLOW */
- DATA(RGB_OFF, RGB_OFF, RGB_ON), /* COLOR_BLUE */
- DATA(RGB_ON, RGB_OFF, RGB_ON), /* COLOR_MAGENTA */
- DATA(RGB_OFF, RGB_ON, RGB_ON), /* COLOR_CYAN */
- DATA(RGB_ON, RGB_ON, RGB_ON), /* COLOR_WHITE */
-};
-
-static const color_t hls_palette[] =
-{
- /* H L S */
- DATA( 0, 0, 0), /* COLOR_BLACK */
- DATA( 120, 50, 100), /* COLOR_RED */
- DATA( 240, 50, 100), /* COLOR_GREEN */
- DATA( 180, 50, 100), /* COLOR_YELLOW */
- DATA( 330, 50, 100), /* COLOR_BLUE */
- DATA( 60, 50, 100), /* COLOR_MAGENTA */
- DATA( 300, 50, 100), /* COLOR_CYAN */
- DATA( 0, 50, 100), /* COLOR_WHITE */
-};
-/* *INDENT-ON* */
-
-#if NCURSES_EXT_FUNCS
-/*
- * These are called from _nc_do_color(), which in turn is called from
- * vidattr - so we have to assume that SP may be null.
- */
-static int
-default_fg(void)
-{
- return (SP != 0) ? SP->_default_fg : COLOR_WHITE;
-}
-
-static int
-default_bg(void)
-{
- return SP != 0 ? SP->_default_bg : COLOR_BLACK;
-}
-#else
-#define default_fg() COLOR_WHITE
-#define default_bg() COLOR_BLACK
-#endif
-
-/*
- * SVr4 curses is known to interchange color codes (1,4) and (3,6), possibly
- * to maintain compatibility with a pre-ANSI scheme. The same scheme is
- * also used in the FreeBSD syscons.
- */
-static int
-toggled_colors(int c)
-{
- if (c < 16) {
- static const int table[] =
- {0, 4, 2, 6, 1, 5, 3, 7,
- 8, 12, 10, 14, 9, 13, 11, 15};
- c = table[c];
- }
- return c;
-}
-
-static void
-set_background_color(int bg, int (*outc) (int))
-{
- if (set_a_background) {
- TPUTS_TRACE("set_a_background");
- tputs(tparm(set_a_background, bg), 1, outc);
- } else {
- TPUTS_TRACE("set_background");
- tputs(tparm(set_background, toggled_colors(bg)), 1, outc);
- }
-}
-
-static void
-set_foreground_color(int fg, int (*outc) (int))
-{
- if (set_a_foreground) {
- TPUTS_TRACE("set_a_foreground");
- tputs(tparm(set_a_foreground, fg), 1, outc);
- } else {
- TPUTS_TRACE("set_foreground");
- tputs(tparm(set_foreground, toggled_colors(fg)), 1, outc);
- }
-}
-
-static void
-init_color_table(void)
-{
- const color_t *tp;
- int n;
-
- tp = (hue_lightness_saturation) ? hls_palette : cga_palette;
- for (n = 0; n < COLORS; n++) {
- if (n < 8) {
- SP->_color_table[n] = tp[n];
- } else {
- SP->_color_table[n] = tp[n % 8];
- if (hue_lightness_saturation) {
- SP->_color_table[n].green = 100;
- } else {
- if (SP->_color_table[n].red)
- SP->_color_table[n].red = 1000;
- if (SP->_color_table[n].green)
- SP->_color_table[n].green = 1000;
- if (SP->_color_table[n].blue)
- SP->_color_table[n].blue = 1000;
- }
- }
- }
-}
-
-/*
- * Reset the color pair, e.g., to whatever color pair 0 is.
- */
-static bool
-reset_color_pair(void)
-{
- bool result = FALSE;
-
- if (orig_pair != 0) {
- TPUTS_TRACE("orig_pair");
- putp(orig_pair);
- result = TRUE;
- }
- return result;
-}
-
-/*
- * Reset color pairs and definitions. Actually we do both more to accommodate
- * badly-written terminal descriptions than for the relatively rare case where
- * someone has changed the color definitions.
- */
-bool
-_nc_reset_colors(void)
-{
- int result = FALSE;
-
- T((T_CALLED("_nc_reset_colors()")));
- if (SP->_color_defs > 0)
- SP->_color_defs = -(SP->_color_defs);
-
- if (reset_color_pair())
- result = TRUE;
- if (orig_colors != 0) {
- TPUTS_TRACE("orig_colors");
- putp(orig_colors);
- result = TRUE;
- }
- returnBool(result);
-}
-
-NCURSES_EXPORT(int)
-start_color(void)
-{
- int result = ERR;
-
- T((T_CALLED("start_color()")));
-
- if (!SP->_coloron) {
-
- if (reset_color_pair() != TRUE) {
- set_foreground_color(default_fg(), _nc_outch);
- set_background_color(default_bg(), _nc_outch);
- }
-
- if (max_pairs > 0 && max_colors > 0) {
- COLOR_PAIRS = SP->_pair_count = max_pairs;
- COLORS = SP->_color_count = max_colors;
-
- if ((SP->_color_pairs = typeCalloc(unsigned short,
- (unsigned) max_pairs)) != 0) {
- if ((SP->_color_table = typeCalloc(color_t, max_colors)) != 0) {
- SP->_color_pairs[0] = PAIR_OF(default_fg(), default_bg());
- init_color_table();
-
- T(("started color: COLORS = %d, COLOR_PAIRS = %d",
- COLORS, COLOR_PAIRS));
-
- SP->_coloron = 1;
- result = OK;
- } else {
- FreeAndNull(SP->_color_pairs);
- }
- }
- }
- }
- returnCode(OK);
-}
-
-/* This function was originally written by Daniel Weaver <danw@znyx.com> */
-static void
-rgb2hls(short r, short g, short b, short *h, short *l, short *s)
-/* convert RGB to HLS system */
-{
- short min, max, t;
-
- if ((min = g < r ? g : r) > b)
- min = b;
- if ((max = g > r ? g : r) < b)
- max = b;
-
- /* calculate lightness */
- *l = (min + max) / 20;
-
- if (min == max) { /* black, white and all shades of gray */
- *h = 0;
- *s = 0;
- return;
- }
-
- /* calculate saturation */
- if (*l < 50)
- *s = ((max - min) * 100) / (max + min);
- else
- *s = ((max - min) * 100) / (2000 - max - min);
-
- /* calculate hue */
- if (r == max)
- t = 120 + ((g - b) * 60) / (max - min);
- else if (g == max)
- t = 240 + ((b - r) * 60) / (max - min);
- else
- t = 360 + ((r - g) * 60) / (max - min);
-
- *h = t % 360;
-}
-
-/*
- * Extension (1997/1/18) - Allow negative f/b values to set default color
- * values.
- */
-NCURSES_EXPORT(int)
-init_pair(short pair, short f, short b)
-{
- unsigned result;
-
- T((T_CALLED("init_pair(%d,%d,%d)"), pair, f, b));
-
- if ((pair < 0) || (pair >= COLOR_PAIRS))
- returnCode(ERR);
-#if NCURSES_EXT_FUNCS
- if (SP->_default_color) {
- if (f < 0)
- f = C_MASK;
- if (b < 0)
- b = C_MASK;
- if (f >= COLORS && f != C_MASK)
- returnCode(ERR);
- if (b >= COLORS && b != C_MASK)
- returnCode(ERR);
- } else
-#endif
- {
- if ((f < 0) || (f >= COLORS)
- || (b < 0) || (b >= COLORS)
- || (pair < 1))
- returnCode(ERR);
- }
-
- /*
- * When a pair's content is changed, replace its colors (if pair was
- * initialized before a screen update is performed replacing original
- * pair colors with the new ones).
- */
- result = PAIR_OF(f, b);
- if (SP->_color_pairs[pair] != 0
- && SP->_color_pairs[pair] != result) {
- int y, x;
- attr_t z = COLOR_PAIR(pair);
-
- for (y = 0; y <= curscr->_maxy; y++) {
- struct ldat *ptr = &(curscr->_line[y]);
- bool changed = FALSE;
- for (x = 0; x <= curscr->_maxx; x++) {
- if ((AttrOf(ptr->text[x]) & A_COLOR) == z) {
- /* Set the old cell to zero to ensure it will be
- updated on the next doupdate() */
- SetChar(ptr->text[x], 0, 0);
- CHANGED_CELL(ptr, x);
- changed = TRUE;
- }
- }
- if (changed)
- _nc_make_oldhash(y);
- }
- }
- SP->_color_pairs[pair] = result;
- if ((int) (SP->_current_attr & A_COLOR) == COLOR_PAIR(pair))
- SP->_current_attr |= A_COLOR; /* force attribute update */
-
- if (initialize_pair) {
- const color_t *tp = hue_lightness_saturation ? hls_palette : cga_palette;
-
- T(("initializing pair: pair = %d, fg=(%d,%d,%d), bg=(%d,%d,%d)",
- pair,
- tp[f].red, tp[f].green, tp[f].blue,
- tp[b].red, tp[b].green, tp[b].blue));
-
- if (initialize_pair) {
- TPUTS_TRACE("initialize_pair");
- putp(tparm(initialize_pair,
- pair,
- tp[f].red, tp[f].green, tp[f].blue,
- tp[b].red, tp[b].green, tp[b].blue));
- }
- }
-
- returnCode(OK);
-}
-
-#define okRGB(n) ((n) >= 0 && (n) < 1000)
-
-NCURSES_EXPORT(int)
-init_color(short color, short r, short g, short b)
-{
- int result = ERR;
-
- T((T_CALLED("init_color(%d,%d,%d,%d)"), color, r, g, b));
-
- if (initialize_color != NULL
- && (color >= 0 && color < COLORS)
- && (okRGB(r) && okRGB(g) && okRGB(b))) {
-
- SP->_color_table[color].init = 1;
- SP->_color_table[color].r = r;
- SP->_color_table[color].g = g;
- SP->_color_table[color].b = b;
-
- if (hue_lightness_saturation) {
- rgb2hls(r, g, b,
- &SP->_color_table[color].red,
- &SP->_color_table[color].green,
- &SP->_color_table[color].blue);
- } else {
- SP->_color_table[color].red = r;
- SP->_color_table[color].green = g;
- SP->_color_table[color].blue = b;
- }
-
- TPUTS_TRACE("initialize_color");
- putp(tparm(initialize_color, color, r, g, b));
- SP->_color_defs = max(color + 1, SP->_color_defs);
- result = OK;
- }
- returnCode(result);
-}
-
-NCURSES_EXPORT(bool)
-can_change_color(void)
-{
- T((T_CALLED("can_change_color()")));
- returnCode((can_change != 0) ? TRUE : FALSE);
-}
-
-NCURSES_EXPORT(bool)
-has_colors(void)
-{
- T((T_CALLED("has_colors()")));
- returnCode((VALID_NUMERIC(max_colors) && VALID_NUMERIC(max_pairs)
- && (((set_foreground != NULL)
- && (set_background != NULL))
- || ((set_a_foreground != NULL)
- && (set_a_background != NULL))
- || set_color_pair)) ? TRUE : FALSE);
-}
-
-NCURSES_EXPORT(int)
-color_content(short color, short *r, short *g, short *b)
-{
- T((T_CALLED("color_content(%d,%p,%p,%p)"), color, r, g, b));
- if (color < 0 || color >= COLORS)
- returnCode(ERR);
-
- if (r)
- *r = SP->_color_table[color].red;
- if (g)
- *g = SP->_color_table[color].green;
- if (b)
- *b = SP->_color_table[color].blue;
- T(("...color_content(%d,%d,%d,%d)", color, *r, *g, *b));
- returnCode(OK);
-}
-
-NCURSES_EXPORT(int)
-pair_content(short pair, short *f, short *b)
-{
- T((T_CALLED("pair_content(%d,%p,%p)"), pair, f, b));
-
- if ((pair < 0) || (pair >= COLOR_PAIRS))
- returnCode(ERR);
- if (f)
- *f = ((SP->_color_pairs[pair] >> C_SHIFT) & C_MASK);
- if (b)
- *b = (SP->_color_pairs[pair] & C_MASK);
-
- T(("...pair_content(%d,%d,%d)", pair, *f, *b));
- returnCode(OK);
-}
-
-NCURSES_EXPORT(void)
-_nc_do_color(int old_pair, int pair, bool reverse, int (*outc) (int))
-{
- NCURSES_COLOR_T fg = C_MASK, bg = C_MASK;
- NCURSES_COLOR_T old_fg, old_bg;
-
- if (pair < 0 || pair >= COLOR_PAIRS) {
- return;
- } else if (pair != 0) {
- if (set_color_pair) {
- TPUTS_TRACE("set_color_pair");
- tputs(tparm(set_color_pair, pair), 1, outc);
- return;
- } else if (SP != 0) {
- pair_content(pair, &fg, &bg);
- }
- }
-
- if (old_pair >= 0
- && SP != 0
- && pair_content(old_pair, &old_fg, &old_bg) != ERR) {
- if ((fg == C_MASK && old_fg != C_MASK)
- || (bg == C_MASK && old_bg != C_MASK)) {
-#if NCURSES_EXT_FUNCS
- /*
- * A minor optimization - but extension. If "AX" is specified in
- * the terminal description, treat it as screen's indicator of ECMA
- * SGR 39 and SGR 49, and assume the two sequences are independent.
- */
- if (SP->_has_sgr_39_49 && old_bg == C_MASK && old_fg != C_MASK) {
- tputs("\033[39m", 1, outc);
- } else if (SP->_has_sgr_39_49 && old_fg == C_MASK && old_bg != C_MASK) {
- tputs("\033[49m", 1, outc);
- } else
-#endif
- reset_color_pair();
- }
- } else {
- reset_color_pair();
- if (old_pair < 0)
- return;
- }
-
-#if NCURSES_EXT_FUNCS
- if (fg == C_MASK)
- fg = default_fg();
- if (bg == C_MASK)
- bg = default_bg();
-#endif
-
- if (reverse) {
- NCURSES_COLOR_T xx = fg;
- fg = bg;
- bg = xx;
- }
-
- TR(TRACE_ATTRS, ("setting colors: pair = %d, fg = %d, bg = %d", pair,
- fg, bg));
-
- if (fg != C_MASK) {
- set_foreground_color(fg, outc);
- }
- if (bg != C_MASK) {
- set_background_color(bg, outc);
- }
-}
diff --git a/ncurses-5.3/ncurses/base/lib_colorset.c b/ncurses-5.3/ncurses/base/lib_colorset.c
deleted file mode 100644
index 855a985..0000000
--- a/ncurses-5.3/ncurses/base/lib_colorset.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,2000 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, 1998 *
- * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en *
- ****************************************************************************/
-
-/*
-** lib_colorset.c
-**
-** The routine wcolor_set().
-**
-*/
-
-#include <curses.priv.h>
-#include <ctype.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-wcolor_set
-(WINDOW *win, short color_pair_number, void *opts)
-{
- T((T_CALLED("wcolor_set(%p,%d)"), win, color_pair_number));
- if (win
- && !opts
- && (color_pair_number >= 0)
- && (color_pair_number < COLOR_PAIRS)) {
- TR(TRACE_ATTRS, ("... current %ld", (long) PAIR_NUMBER(win->_attrs)));
- toggle_attr_on(win->_attrs, COLOR_PAIR(color_pair_number));
- returnCode(OK);
- } else
- returnCode(ERR);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_delch.c b/ncurses-5.3/ncurses/base/lib_delch.c
deleted file mode 100644
index 814fdd5..0000000
--- a/ncurses-5.3/ncurses/base/lib_delch.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
- * Copyright (c) 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> *
- ****************************************************************************/
-
-/*
-** lib_delch.c
-**
-** The routine wdelch().
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-wdelch(WINDOW *win)
-{
- int code = ERR;
-
- T((T_CALLED("wdelch(%p)"), win));
-
- if (win) {
- NCURSES_CH_T blank = win->_nc_bkgd;
- struct ldat *line = &(win->_line[win->_cury]);
- NCURSES_CH_T *end = &(line->text[win->_maxx]);
- NCURSES_CH_T *temp2 = &(line->text[win->_curx + 1]);
- NCURSES_CH_T *temp1 = temp2 - 1;
-
- CHANGED_TO_EOL(line, win->_curx, win->_maxx);
- while (temp1 < end)
- *temp1++ = *temp2++;
-
- *temp1 = blank;
-
- _nc_synchook(win);
- code = OK;
- }
- returnCode(code);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_delwin.c b/ncurses-5.3/ncurses/base/lib_delwin.c
deleted file mode 100644
index 087f3d3..0000000
--- a/ncurses-5.3/ncurses/base/lib_delwin.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
- * Copyright (c) 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> *
- ****************************************************************************/
-
-/*
-** lib_delwin.c
-**
-** The routine delwin().
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-static bool
-cannot_delete(WINDOW *win)
-{
- WINDOWLIST *p;
- bool result = TRUE;
-
- for (p = _nc_windows; p != 0; p = p->next) {
- if (&(p->win) == win) {
- result = FALSE;
- } else if ((p->win._flags & _SUBWIN) != 0
- && p->win._parent == win) {
- result = TRUE;
- break;
- }
- }
- return result;
-}
-
-NCURSES_EXPORT(int)
-delwin(WINDOW *win)
-{
- T((T_CALLED("delwin(%p)"), win));
-
- if (win == 0
- || cannot_delete(win))
- returnCode(ERR);
-
- if (win->_flags & _SUBWIN)
- touchwin(win->_parent);
- else if (curscr != 0)
- touchwin(curscr);
-
- returnCode(_nc_freewin(win));
-}
diff --git a/ncurses-5.3/ncurses/base/lib_dft_fgbg.c b/ncurses-5.3/ncurses/base/lib_dft_fgbg.c
deleted file mode 100644
index 7b4c187..0000000
--- a/ncurses-5.3/ncurses/base/lib_dft_fgbg.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,1999,2000 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 <dickey@clark.net> 1997,1999 *
- ****************************************************************************/
-
-#include <curses.priv.h>
-#include <term.h>
-
-MODULE_ID("$Id$")
-
-/*
- * Modify the behavior of color-pair 0 so that the library doesn't assume that
- * it is white on black. This is an extension to XSI curses.
- */
-NCURSES_EXPORT(int)
-use_default_colors(void)
-{
- T((T_CALLED("use_default_colors()")));
- returnCode(assume_default_colors(C_MASK, C_MASK));
-}
-
-/*
- * Modify the behavior of color-pair 0 so that the library assumes that it
- * is something specific, possibly not white on black.
- */
-NCURSES_EXPORT(int)
-assume_default_colors(int fg, int bg)
-{
- T((T_CALLED("assume_default_colors(%d,%d)"), fg, bg));
-
- if (!orig_pair && !orig_colors)
- returnCode(ERR);
-
- if (initialize_pair) /* don't know how to handle this */
- returnCode(ERR);
-
- SP->_default_color = (fg < 0 || fg == C_MASK) || (bg < 0 || bg == C_MASK);
- SP->_has_sgr_39_49 = (tigetflag("AX") == TRUE);
- SP->_default_fg = (fg >= 0) ? (fg & C_MASK) : C_MASK;
- SP->_default_bg = (bg >= 0) ? (bg & C_MASK) : C_MASK;
- if (SP->_color_pairs != 0)
- init_pair(0, fg, bg);
- returnCode(OK);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_echo.c b/ncurses-5.3/ncurses/base/lib_echo.c
deleted file mode 100644
index d971089..0000000
--- a/ncurses-5.3/ncurses/base/lib_echo.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,2000 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> *
- ****************************************************************************/
-
-/*
- * echo.c
- *
- * Routines:
- * echo()
- * noecho()
- *
- */
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-echo(void)
-{
- T((T_CALLED("echo()")));
- SP->_echo = TRUE;
- returnCode(OK);
-}
-
-NCURSES_EXPORT(int)
-noecho(void)
-{
- T((T_CALLED("noecho()")));
- SP->_echo = FALSE;
- returnCode(OK);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_endwin.c b/ncurses-5.3/ncurses/base/lib_endwin.c
deleted file mode 100644
index 47e7d68..0000000
--- a/ncurses-5.3/ncurses/base/lib_endwin.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,2000 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> *
- ****************************************************************************/
-
-/*
-** lib_endwin.c
-**
-** The routine endwin().
-**
-*/
-
-#include <curses.priv.h>
-#include <term.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-endwin(void)
-{
- T((T_CALLED("endwin()")));
-
- if (SP) {
- SP->_endwin = TRUE;
- SP->_mouse_wrap(SP);
- _nc_screen_wrap();
- _nc_mvcur_wrap(); /* wrap up cursor addressing */
- returnCode(reset_shell_mode());
- }
-
- returnCode(ERR);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_erase.c b/ncurses-5.3/ncurses/base/lib_erase.c
deleted file mode 100644
index 28f32bf..0000000
--- a/ncurses-5.3/ncurses/base/lib_erase.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************************
- * Copyright (c) 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> *
- ****************************************************************************/
-
-/*
-** lib_erase.c
-**
-** The routine werase().
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-werase(WINDOW *win)
-{
- int code = ERR;
- int y;
- NCURSES_CH_T blank;
- NCURSES_CH_T *sp, *end, *start;
-
- T((T_CALLED("werase(%p)"), win));
-
- if (win) {
- blank = win->_nc_bkgd;
- for (y = 0; y <= win->_maxy; y++) {
- start = win->_line[y].text;
- end = &start[win->_maxx];
-
- for (sp = start; sp <= end; sp++)
- *sp = blank;
-
- win->_line[y].firstchar = 0;
- win->_line[y].lastchar = win->_maxx;
- }
- win->_curx = win->_cury = 0;
- win->_flags &= ~_WRAPPED;
- _nc_synchook(win);
- code = OK;
- }
- returnCode(code);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_flash.c b/ncurses-5.3/ncurses/base/lib_flash.c
deleted file mode 100644
index 1269b56..0000000
--- a/ncurses-5.3/ncurses/base/lib_flash.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,2000 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> *
- ****************************************************************************/
-
-/*
- * flash.c
- *
- * The routine flash().
- *
- */
-
-#include <curses.priv.h>
-#include <term.h> /* beep, flash */
-
-MODULE_ID("$Id$")
-
-/*
- * flash()
- *
- * Flash the current terminal's screen if possible. If not,
- * sound the audible bell if one exists.
- *
- */
-
-NCURSES_EXPORT(int)
-flash(void)
-{
- int res = ERR;
-
- T((T_CALLED("flash()")));
-
- /* FIXME: should make sure that we are not in altchar mode */
- if (flash_screen) {
- TPUTS_TRACE("flash_screen");
- res = putp(flash_screen);
- _nc_flush();
- } else if (bell) {
- TPUTS_TRACE("bell");
- res = putp(bell);
- _nc_flush();
- }
-
- returnCode(res);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_freeall.c b/ncurses-5.3/ncurses/base/lib_freeall.c
deleted file mode 100644
index 90d53a2..0000000
--- a/ncurses-5.3/ncurses/base/lib_freeall.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998-2001,2002 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 <dickey@clark.net> 1996,1997 *
- ****************************************************************************/
-
-#include <curses.priv.h>
-#include <term_entry.h>
-
-#if HAVE_NC_FREEALL
-
-#if HAVE_LIBDBMALLOC
-extern int malloc_errfd; /* FIXME */
-#endif
-
-MODULE_ID("$Id$")
-
-/*
- * Free all ncurses data. This is used for testing only (there's no practical
- * use for it as an extension).
- */
-NCURSES_EXPORT(void)
-_nc_freeall(void)
-{
- WINDOWLIST *p, *q;
- char *s;
-
-#if NO_LEAKS
- _nc_free_tparm();
-#endif
- if (SP != 0) {
- while (_nc_windows != 0) {
- /* Delete only windows that're not a parent */
- for (p = _nc_windows; p != 0; p = p->next) {
- bool found = FALSE;
-
- for (q = _nc_windows; q != 0; q = q->next) {
- if ((p != q)
- && (q->win._flags & _SUBWIN)
- && (&(p->win) == q->win._parent)) {
- found = TRUE;
- break;
- }
- }
-
- if (!found) {
- delwin(&(p->win));
- break;
- }
- }
- }
- delscreen(SP);
- }
-
- if (cur_term != 0) {
- _nc_free_termtype(&(cur_term->type));
- free(cur_term);
- }
-
- if ((s = _nc_home_terminfo()) != 0)
- free(s);
-#ifdef TRACE
- (void) _nc_trace_buf(-1, 0);
-#endif
-#if HAVE_LIBDBMALLOC
- malloc_dump(malloc_errfd);
-#elif HAVE_LIBDMALLOC
-#elif HAVE_PURIFY
- purify_all_inuse();
-#endif
-}
-
-NCURSES_EXPORT(void)
-_nc_free_and_exit(int code)
-{
- _nc_freeall();
- exit(code);
-}
-
-#else
-NCURSES_EXPORT(void)
-_nc_freeall(void)
-{
-}
-#endif
diff --git a/ncurses-5.3/ncurses/base/lib_getch.c b/ncurses-5.3/ncurses/base/lib_getch.c
deleted file mode 100644
index 45502ab..0000000
--- a/ncurses-5.3/ncurses/base/lib_getch.c
+++ /dev/null
@@ -1,537 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998-2001,2002 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> *
- ****************************************************************************/
-
-/*
-** lib_getch.c
-**
-** The routine getch().
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-#include <fifo_defs.h>
-
-NCURSES_EXPORT_VAR(int)
-ESCDELAY = 1000; /* max interval betw. chars in funkeys, in millisecs */
-
-#ifdef NCURSES_WGETCH_EVENTS
-#define TWAIT_MASK 7
-#else
-#define TWAIT_MASK 3
-#endif
-
-static inline int
-fifo_peek(void)
-{
- int ch = SP->_fifo[peek];
- TR(TRACE_IEVENT, ("peeking at %d", peek));
-
- p_inc();
- return ch;
-}
-
-static inline int
-fifo_pull(void)
-{
- int ch;
- ch = SP->_fifo[head];
- TR(TRACE_IEVENT, ("pulling %s from %d", _tracechar(ch), head));
-
- if (peek == head) {
- h_inc();
- peek = head;
- } else
- h_inc();
-
-#ifdef TRACE
- if (_nc_tracing & TRACE_IEVENT)
- _nc_fifo_dump();
-#endif
- return ch;
-}
-
-static inline int
-fifo_push(EVENTLIST_0th(_nc_eventlist * evl))
-{
- int n;
- int ch = 0;
- int mask;
-
- (void) mask;
- if (tail == -1)
- return ERR;
-
-#ifdef HIDE_EINTR
- again:
- errno = 0;
-#endif
-
-#ifdef NCURSES_WGETCH_EVENTS
- if (evl
-#if USE_GPM_SUPPORT || defined(USE_EMX_MOUSE)
- || (SP->_mouse_fd >= 0)
-#endif
- ) {
- mask = _nc_timed_wait(TWAIT_MASK, -1, (int *) 0, evl);
- } else
- mask = 0;
-
- if (mask & 4) {
- T(("fifo_push: ungetch KEY_EVENT"));
- ungetch(KEY_EVENT);
- return KEY_EVENT;
- }
-#elif USE_GPM_SUPPORT || defined(USE_EMX_MOUSE)
- if (SP->_mouse_fd >= 0)
- mask = _nc_timed_wait(TWAIT_MASK, -1, (int *) 0 EVENTLIST_2nd(evl));
-#endif
-
-#if USE_GPM_SUPPORT || defined(USE_EMX_MOUSE)
- if ((SP->_mouse_fd >= 0) && (mask & 2)) {
- SP->_mouse_event(SP);
- ch = KEY_MOUSE;
- n = 1;
- } else
-#endif
- { /* Can block... */
- unsigned char c2 = 0;
- n = read(SP->_ifd, &c2, 1);
- ch = c2;
- }
-
-#ifdef HIDE_EINTR
- /*
- * Under System V curses with non-restarting signals, getch() returns
- * with value ERR when a handled signal keeps it from completing.
- * If signals restart system calls, OTOH, the signal is invisible
- * except to its handler.
- *
- * We don't want this difference to show. This piece of code
- * tries to make it look like we always have restarting signals.
- */
- if (n <= 0 && errno == EINTR)
- goto again;
-#endif
-
- if ((n == -1) || (n == 0)) {
- TR(TRACE_IEVENT, ("read(%d,&ch,1)=%d, errno=%d", SP->_ifd, n, errno));
- ch = ERR;
- }
- TR(TRACE_IEVENT, ("read %d characters", n));
-
- SP->_fifo[tail] = ch;
- SP->_fifohold = 0;
- if (head == -1)
- head = peek = tail;
- t_inc();
- TR(TRACE_IEVENT, ("pushed %s at %d", _tracechar(ch), tail));
-#ifdef TRACE
- if (_nc_tracing & TRACE_IEVENT)
- _nc_fifo_dump();
-#endif
- return ch;
-}
-
-static inline void
-fifo_clear(void)
-{
- memset(SP->_fifo, 0, sizeof(SP->_fifo));
- head = -1;
- tail = peek = 0;
-}
-
-static int kgetch(EVENTLIST_0th(_nc_eventlist * evl));
-
-#define wgetch_should_refresh(win) (\
- (is_wintouched(win) || (win->_flags & _HASMOVED)) \
- && !(win->_flags & _ISPAD))
-
-NCURSES_EXPORT(int)
-_nc_wgetch(WINDOW *win,
- unsigned long *result,
- int use_meta
- EVENTLIST_2nd(_nc_eventlist * evl))
-{
- int ch;
-#ifdef NCURSES_WGETCH_EVENTS
- long event_delay = -1;
-#endif
-
- T((T_CALLED("_nc_wgetch(%p)"), win));
-
- *result = 0;
- if (!win)
- returnCode(ERR);
-
- if (cooked_key_in_fifo()) {
- if (wgetch_should_refresh(win))
- wrefresh(win);
-
- *result = fifo_pull();
- returnCode(OK);
- }
-#ifdef NCURSES_WGETCH_EVENTS
- if (evl && (evl->count == 0))
- evl = NULL;
- event_delay = _nc_eventlist_timeout(evl);
-#endif
-
- /*
- * Handle cooked mode. Grab a string from the screen,
- * stuff its contents in the FIFO queue, and pop off
- * the first character to return it.
- */
- if (head == -1 && !SP->_raw && !SP->_cbreak) {
- char buf[MAXCOLUMNS], *sp;
- int rc;
-
- TR(TRACE_IEVENT, ("filling queue in cooked mode"));
-
- rc = wgetnstr(win, buf, MAXCOLUMNS);
-
- /* ungetch in reverse order */
-#ifdef NCURSES_WGETCH_EVENTS
- if (rc != KEY_EVENT)
-#endif
- ungetch('\n');
- for (sp = buf + strlen(buf); sp > buf; sp--)
- ungetch(sp[-1]);
-
-#ifdef NCURSES_WGETCH_EVENTS
- /* Return it first */
- if (rc == KEY_EVENT) {
- *result = rc;
- returnCode(OK);
- }
-#endif
-
- *result = fifo_pull();
- returnCode(OK);
- }
-
- if (win->_use_keypad != SP->_keypad_on)
- _nc_keypad(win->_use_keypad);
-
- if (wgetch_should_refresh(win))
- wrefresh(win);
-
- if (!win->_notimeout && (win->_delay >= 0 || SP->_cbreak > 1)) {
- int delay;
-
- TR(TRACE_IEVENT, ("timed delay in wgetch()"));
- if (SP->_cbreak > 1)
- delay = (SP->_cbreak - 1) * 100;
- else
- delay = win->_delay;
-
-#ifdef NCURSES_WGETCH_EVENTS
- if (event_delay >= 0 && delay > event_delay)
- delay = event_delay;
-#endif
-
- TR(TRACE_IEVENT, ("delay is %d milliseconds", delay));
-
- if (head == -1) { /* fifo is empty */
- int rc = _nc_timed_wait(TWAIT_MASK,
- delay,
- (int *) 0
- EVENTLIST_2nd(evl));
-
-#ifdef NCURSES_WGETCH_EVENTS
- if (rc & 4) {
- *result = KEY_EVENT;
- returnCode(OK);
- }
-#endif
- if (!rc)
- returnCode(ERR);
- }
- /* else go on to read data available */
- }
-
- if (win->_use_keypad) {
- /*
- * This is tricky. We only want to get special-key
- * events one at a time. But we want to accumulate
- * mouse events until either (a) the mouse logic tells
- * us it's picked up a complete gesture, or (b)
- * there's a detectable time lapse after one.
- *
- * Note: if the mouse code starts failing to compose
- * press/release events into clicks, you should probably
- * increase the wait with mouseinterval().
- */
- int runcount = 0;
- int rc;
-
- do {
- ch = kgetch(EVENTLIST_1st(evl));
- if (ch == KEY_MOUSE) {
- ++runcount;
- if (SP->_mouse_inline(SP))
- break;
- }
- if (SP->_maxclick < 0)
- break;
- } while
- (ch == KEY_MOUSE
- && (((rc = _nc_timed_wait(TWAIT_MASK,
- SP->_maxclick,
- (int *) 0
- EVENTLIST_2nd(evl))) != 0
- && !(rc & 4))
- || !SP->_mouse_parse(runcount)));
-#ifdef NCURSES_WGETCH_EVENTS
- if ((rc & 4) && !ch == KEY_EVENT) {
- ungetch(ch);
- ch = KEY_EVENT;
- }
-#endif
- if (runcount > 0 && ch != KEY_MOUSE) {
-#ifdef NCURSES_WGETCH_EVENTS
- /* mouse event sequence ended by an event, report event */
- if (ch == KEY_EVENT) {
- ungetch(KEY_MOUSE); /* FIXME This interrupts a gesture... */
- } else
-#endif
- {
- /* mouse event sequence ended by keystroke, store keystroke */
- ungetch(ch);
- ch = KEY_MOUSE;
- }
- }
- } else {
- if (head == -1)
- fifo_push(EVENTLIST_1st(evl));
- ch = fifo_pull();
- }
-
- if (ch == ERR) {
-#if USE_SIZECHANGE
- if (SP->_sig_winch) {
- _nc_update_screensize();
- /* resizeterm can push KEY_RESIZE */
- if (cooked_key_in_fifo()) {
- *result = fifo_pull();
- returnCode(*result >= KEY_MIN ? KEY_CODE_YES : OK);
- }
- }
-#endif
- returnCode(ERR);
- }
-
- /*
- * If echo() is in effect, display the printable version of the
- * key on the screen. Carriage return and backspace are treated
- * specially by Solaris curses:
- *
- * If carriage return is defined as a function key in the
- * terminfo, e.g., kent, then Solaris may return either ^J (or ^M
- * if nonl() is set) or KEY_ENTER depending on the echo() mode.
- * We echo before translating carriage return based on nonl(),
- * since the visual result simply moves the cursor to column 0.
- *
- * Backspace is a different matter. Solaris curses does not
- * translate it to KEY_BACKSPACE if kbs=^H. This does not depend
- * on the stty modes, but appears to be a hardcoded special case.
- * This is a difference from ncurses, which uses the terminfo entry.
- * However, we provide the same visual result as Solaris, moving the
- * cursor to the left.
- */
- if (SP->_echo && !(win->_flags & _ISPAD)) {
- chtype backup = (ch == KEY_BACKSPACE) ? '\b' : ch;
- if (backup < KEY_MIN)
- wechochar(win, backup);
- }
-
- /*
- * Simulate ICRNL mode
- */
- if ((ch == '\r') && SP->_nl)
- ch = '\n';
-
- /* Strip 8th-bit if so desired. We do this only for characters that
- * are in the range 128-255, to provide compatibility with terminals
- * that display only 7-bit characters. Note that 'ch' may be a
- * function key at this point, so we mustn't strip _those_.
- */
- if (!use_meta)
- if ((ch < KEY_MIN) && (ch & 0x80))
- ch &= 0x7f;
-
- T(("wgetch returning : %s", _tracechar(ch)));
-
- *result = ch;
- returnCode(ch >= KEY_MIN ? KEY_CODE_YES : OK);
-}
-
-#ifdef NCURSES_WGETCH_EVENTS
-NCURSES_EXPORT(int)
-wgetch_events(WINDOW *win, _nc_eventlist * evl)
-{
- int code;
- unsigned long value;
-
- T((T_CALLED("wgetch_events(%p,%p)"), win, evl));
- code = _nc_wgetch(win,
- &value,
- SP->_use_meta
- EVENTLIST_2nd(evl));
- if (code != ERR)
- code = value;
- returnCode(code);
-}
-#endif
-
-NCURSES_EXPORT(int)
-wgetch(WINDOW *win)
-{
- int code;
- unsigned long value;
-
- T((T_CALLED("wgetch(%p)"), win));
- code = _nc_wgetch(win,
- &value,
- SP->_use_meta
- EVENTLIST_2nd((_nc_eventlist *) 0));
- if (code != ERR)
- code = value;
- returnCode(code);
-}
-
-/*
-** int
-** kgetch()
-**
-** Get an input character, but take care of keypad sequences, returning
-** an appropriate code when one matches the input. After each character
-** is received, set an alarm call based on ESCDELAY. If no more of the
-** sequence is received by the time the alarm goes off, pass through
-** the sequence gotten so far.
-**
-** This function must be called when there are no cooked keys in queue.
-** (that is head==-1 || peek==head)
-**
-*/
-
-static int
-kgetch(EVENTLIST_0th(_nc_eventlist * evl))
-{
- struct tries *ptr;
- int ch = 0;
- int timeleft = ESCDELAY;
-
- TR(TRACE_IEVENT, ("kgetch() called"));
-
- ptr = SP->_keytry;
-
- for (;;) {
- if (cooked_key_in_fifo() && SP->_fifo[head] >= KEY_MIN) {
- break;
- } else if (!raw_key_in_fifo()) {
- ch = fifo_push(EVENTLIST_1st(evl));
- if (ch == ERR) {
- peek = head; /* the keys stay uninterpreted */
- return ERR;
- }
-#ifdef NCURSES_WGETCH_EVENTS
- else if (ch == KEY_EVENT) {
- peek = head; /* the keys stay uninterpreted */
- return fifo_pull(); /* Remove KEY_EVENT from the queue */
- }
-#endif
- }
-
- ch = fifo_peek();
- if (ch >= KEY_MIN) {
- /* If not first in queue, somebody put this key there on purpose in
- * emergency. Consider it higher priority than the unfinished
- * keysequence we are parsing.
- */
- peek = head;
- /* assume the key is the last in fifo */
- t_dec(); /* remove the key */
- return ch;
- }
-
- TR(TRACE_IEVENT, ("ch: %s", _tracechar((unsigned char) ch)));
- while ((ptr != NULL) && (ptr->ch != (unsigned char) ch))
- ptr = ptr->sibling;
-
- if (ptr == NULL) {
- TR(TRACE_IEVENT, ("ptr is null"));
- break;
- }
- TR(TRACE_IEVENT, ("ptr=%p, ch=%d, value=%d",
- ptr, ptr->ch, ptr->value));
-
- if (ptr->value != 0) { /* sequence terminated */
- TR(TRACE_IEVENT, ("end of sequence"));
- if (peek == tail)
- fifo_clear();
- else
- head = peek;
- return (ptr->value);
- }
-
- ptr = ptr->child;
-
- if (!raw_key_in_fifo()) {
- int rc;
-
- TR(TRACE_IEVENT, ("waiting for rest of sequence"));
- rc = _nc_timed_wait(TWAIT_MASK,
- timeleft,
- &timeleft
- EVENTLIST_2nd(evl));
-#ifdef NCURSES_WGETCH_EVENTS
- if (rc & 4) {
- TR(TRACE_IEVENT, ("interrupted by a user event"));
- /* FIXME Should have preserved timeleft for reusal... */
- peek = head; /* Restart interpreting later */
- return KEY_EVENT;
- }
-#endif
- if (!rc) {
- TR(TRACE_IEVENT, ("ran out of time"));
- break;
- }
- }
- }
- ch = fifo_pull();
- peek = head;
- return ch;
-}
diff --git a/ncurses-5.3/ncurses/base/lib_getstr.c b/ncurses-5.3/ncurses/base/lib_getstr.c
deleted file mode 100644
index 9b7ea9a..0000000
--- a/ncurses-5.3/ncurses/base/lib_getstr.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998-2000,2002 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> *
- ****************************************************************************/
-
-/*
-** lib_getstr.c
-**
-** The routine wgetstr().
-**
-*/
-
-#include <curses.priv.h>
-#include <term.h>
-
-MODULE_ID("$Id$")
-
-/*
- * This wipes out the last character, no matter whether it was a tab, control
- * or other character, and handles reverse wraparound.
- */
-static char *
-WipeOut(WINDOW *win, int y, int x, char *first, char *last, bool echoed)
-{
- if (last > first) {
- *--last = '\0';
- if (echoed) {
- int y1 = win->_cury;
- int x1 = win->_curx;
-
- wmove(win, y, x);
- waddstr(win, first);
- getyx(win, y, x);
- while (win->_cury < y1
- || (win->_cury == y1 && win->_curx < x1))
- waddch(win, (chtype) ' ');
-
- wmove(win, y, x);
- }
- }
- return last;
-}
-
-NCURSES_EXPORT(int)
-wgetnstr_events(WINDOW *win,
- char *str,
- int maxlen,
- EVENTLIST_1st(_nc_eventlist * evl))
-{
- TTY buf;
- bool oldnl, oldecho, oldraw, oldcbreak;
- char erasec;
- char killc;
- char *oldstr;
- int ch;
- int y, x;
-
- T((T_CALLED("wgetnstr(%p,%p, %d)"), win, str, maxlen));
-
- if (!win)
- returnCode(ERR);
-
- _nc_get_tty_mode(&buf);
-
- oldnl = SP->_nl;
- oldecho = SP->_echo;
- oldraw = SP->_raw;
- oldcbreak = SP->_cbreak;
- nl();
- noecho();
- noraw();
- cbreak();
-
- erasec = erasechar();
- killc = killchar();
-
- oldstr = str;
- getyx(win, y, x);
-
- if (is_wintouched(win) || (win->_flags & _HASMOVED))
- wrefresh(win);
-
- while ((ch = wgetch_events(win, evl)) != ERR) {
- /*
- * Some terminals (the Wyse-50 is the most common) generate
- * a \n from the down-arrow key. With this logic, it's the
- * user's choice whether to set kcud=\n for wgetch();
- * terminating *getstr() with \n should work either way.
- */
- if (ch == '\n'
- || ch == '\r'
- || ch == KEY_DOWN
- || ch == KEY_ENTER) {
- if (oldecho == TRUE
- && win->_cury == win->_maxy
- && win->_scroll)
- wechochar(win, (chtype) '\n');
- break;
- }
-#ifdef KEY_EVENT
- if (ch == KEY_EVENT)
- break;
-#endif
- if (ch == erasec || ch == KEY_LEFT || ch == KEY_BACKSPACE) {
- if (str > oldstr) {
- str = WipeOut(win, y, x, oldstr, str, oldecho);
- }
- } else if (ch == killc) {
- while (str > oldstr) {
- str = WipeOut(win, y, x, oldstr, str, oldecho);
- }
- } else if (ch >= KEY_MIN
- || (maxlen >= 0 && str - oldstr >= maxlen)) {
- beep();
- } else {
- *str++ = ch;
- if (oldecho == TRUE) {
- int oldy = win->_cury;
- if (waddch(win, (chtype) ch) == ERR) {
- /*
- * We can't really use the lower-right
- * corner for input, since it'll mess
- * up bookkeeping for erases.
- */
- win->_flags &= ~_WRAPPED;
- waddch(win, (chtype) ' ');
- str = WipeOut(win, y, x, oldstr, str, oldecho);
- continue;
- } else if (win->_flags & _WRAPPED) {
- /*
- * If the last waddch forced a wrap &
- * scroll, adjust our reference point
- * for erasures.
- */
- if (win->_scroll
- && oldy == win->_maxy
- && win->_cury == win->_maxy) {
- if (--y <= 0) {
- y = 0;
- }
- }
- win->_flags &= ~_WRAPPED;
- }
- wrefresh(win);
- }
- }
- }
-
- win->_curx = 0;
- win->_flags &= ~_WRAPPED;
- if (win->_cury < win->_maxy)
- win->_cury++;
- wrefresh(win);
-
- /* Restore with a single I/O call, to fix minor asymmetry between
- * raw/noraw, etc.
- */
- SP->_nl = oldnl;
- SP->_echo = oldecho;
- SP->_raw = oldraw;
- SP->_cbreak = oldcbreak;
-
- _nc_set_tty_mode(&buf);
-
- *str = '\0';
- if (ch == ERR)
- returnCode(ch);
-#ifdef KEY_EVENT
- if (ch == KEY_EVENT)
- returnCode(ch);
-#endif
-
- T(("wgetnstr returns %s", _nc_visbuf(oldstr)));
-
- returnCode(OK);
-}
-
-#ifdef NCURSES_WGETCH_EVENTS
-NCURSES_EXPORT(int)
-wgetnstr(WINDOW *win, char *str, int maxlen)
-{
- returnCode(wgetnstr_events(win,
- str,
- maxlen,
- EVENTLIST_1st((_nc_eventlist *) 0)));
-}
-#endif
diff --git a/ncurses-5.3/ncurses/base/lib_hline.c b/ncurses-5.3/ncurses/base/lib_hline.c
deleted file mode 100644
index 23c6f1f..0000000
--- a/ncurses-5.3/ncurses/base/lib_hline.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,1999,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> *
- ****************************************************************************/
-
-/*
-** lib_hline.c
-**
-** The routine whline().
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-whline(WINDOW *win, chtype ch, int n)
-{
- int code = ERR;
- NCURSES_SIZE_T start;
- NCURSES_SIZE_T end;
-
- T((T_CALLED("whline(%p,%s,%d)"), win, _tracechtype(ch), n));
-
- if (win) {
- struct ldat *line = &(win->_line[win->_cury]);
- NCURSES_CH_T wch;
-
- start = win->_curx;
- end = start + n - 1;
- if (end > win->_maxx)
- end = win->_maxx;
-
- CHANGED_RANGE(line, start, end);
-
- if (ch == 0)
- SetChar(wch, ChCharOf(ACS_HLINE), ChAttrOf(ACS_HLINE));
- else
- SetChar(wch, ChCharOf(ch), ChAttrOf(ch));
- wch = _nc_render(win, wch);
-
- while (end >= start) {
- line->text[end] = wch;
- end--;
- }
-
- _nc_synchook(win);
- code = OK;
- }
- returnCode(code);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_immedok.c b/ncurses-5.3/ncurses/base/lib_immedok.c
deleted file mode 100644
index e1fb0aa..0000000
--- a/ncurses-5.3/ncurses/base/lib_immedok.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,2000 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> *
- ****************************************************************************/
-
-/*
-** lib_immedok.c
-**
-** The routine immedok.
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(void)
-immedok(WINDOW *win, bool flag)
-{
- T((T_CALLED("immedok(%p,%d)"), win, flag));
-
- if (win)
- win->_immed = flag;
-
- returnVoid;
-}
diff --git a/ncurses-5.3/ncurses/base/lib_inchstr.c b/ncurses-5.3/ncurses/base/lib_inchstr.c
deleted file mode 100644
index 69c38ee..0000000
--- a/ncurses-5.3/ncurses/base/lib_inchstr.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************************
- * Copyright (c) 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> *
- ****************************************************************************/
-
-/*
-** lib_inchstr.c
-**
-** The routine winchnstr().
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-winchnstr(WINDOW *win, chtype * str, int n)
-{
- int i = 0;
-
- T((T_CALLED("winchnstr(%p,%p,%d)"), win, str, n));
-
- if (!str)
- returnCode(0);
-
- if (win) {
- for (; (n < 0 || (i < n)) && (win->_curx + i <= win->_maxx); i++)
- str[i] =
- CharOf(win->_line[win->_cury].text[win->_curx + i]) |
- AttrOf(win->_line[win->_cury].text[win->_curx + i]);
- }
- str[i] = (chtype) 0;
-
- returnCode(i);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_initscr.c b/ncurses-5.3/ncurses/base/lib_initscr.c
deleted file mode 100644
index acb182d..0000000
--- a/ncurses-5.3/ncurses/base/lib_initscr.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998-2001,2002 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> *
- ****************************************************************************/
-
-/*
-** lib_initscr.c
-**
-** The routines initscr(), and termname().
-**
-*/
-
-#include <curses.priv.h>
-#include <tic.h> /* for MAX_ALIAS */
-
-#if HAVE_SYS_TERMIO_H
-#include <sys/termio.h> /* needed for ISC */
-#endif
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(WINDOW *)
-initscr(void)
-{
- static bool initialized = FALSE;
- NCURSES_CONST char *name;
- int value;
-
- START_TRACE();
- T((T_CALLED("initscr()")));
- /* Portable applications must not call initscr() more than once */
- if (!initialized) {
- initialized = TRUE;
-
- if ((name = getenv("TERM")) == 0
- || *name == '\0')
- name = "unknown";
-#ifdef __CYGWIN__
- /*
- * 2002/9/21
- * Work around a bug in Cygwin. Full-screen subprocesses run from
- * bash, in turn spawned from another full-screen process, will dump
- * core when attempting to write to stdout. Opening /dev/tty
- * explicitly seems to fix the problem.
- */
- if (isatty(fileno(stdout))) {
- FILE *fp = fopen("/dev/tty", "w");
- if (fp != 0 && isatty(fileno(fp))) {
- fclose(stdout);
- dup2(fileno(fp), STDOUT_FILENO);
- stdout = fdopen(STDOUT_FILENO, "w");
- }
- }
-#endif
- if (newterm(name, stdout, stdin) == 0) {
- fprintf(stderr, "Error opening terminal: %s.\n", name);
- exit(EXIT_FAILURE);
- }
-
- /* allow user to set maximum escape delay from the environment */
- if ((value = _nc_getenv_num("ESCDELAY")) >= 0) {
- ESCDELAY = value;
- }
-
- /* def_shell_mode - done in newterm/_nc_setupscreen */
- def_prog_mode();
- }
- returnWin(stdscr);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_insch.c b/ncurses-5.3/ncurses/base/lib_insch.c
deleted file mode 100644
index 8c75729..0000000
--- a/ncurses-5.3/ncurses/base/lib_insch.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
- * Copyright (c) 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> *
- ****************************************************************************/
-
-/*
-** lib_insch.c
-**
-** The routine winsch().
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-winsch(WINDOW *win, chtype c)
-{
- int code = ERR;
-
- T((T_CALLED("winsch(%p, %s)"), win, _tracechtype(c)));
-
- if (win) {
- struct ldat *line = &(win->_line[win->_cury]);
- NCURSES_CH_T *end = &(line->text[win->_curx]);
- NCURSES_CH_T *temp1 = &(line->text[win->_maxx]);
- NCURSES_CH_T *temp2 = temp1 - 1;
- NCURSES_CH_T wch;
- SetChar2(wch, c);
-
- CHANGED_TO_EOL(line, win->_curx, win->_maxx);
- while (temp1 > end)
- *temp1-- = *temp2--;
-
- *temp1 = _nc_render(win, wch);
- code = OK;
- }
- returnCode(code);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_insdel.c b/ncurses-5.3/ncurses/base/lib_insdel.c
deleted file mode 100644
index 16866b6..0000000
--- a/ncurses-5.3/ncurses/base/lib_insdel.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
- * Copyright (c) 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> *
- ****************************************************************************/
-
-/*
-** lib_insdel.c
-**
-** The routine winsdelln(win, n).
-** positive n insert n lines above current line
-** negative n delete n lines starting from current line
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-winsdelln(WINDOW *win, int n)
-{
- int code = ERR;
-
- T((T_CALLED("winsdel(%p,%d)"), win, n));
-
- if (win) {
- if (n != 0) {
- _nc_scroll_window(win, -n, win->_cury, win->_maxy,
- win->_nc_bkgd);
- _nc_synchook(win);
- }
- code = OK;
- }
- returnCode(code);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_insstr.c b/ncurses-5.3/ncurses/base/lib_insstr.c
deleted file mode 100644
index d87f9a4..0000000
--- a/ncurses-5.3/ncurses/base/lib_insstr.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,1999,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> *
- ****************************************************************************/
-
-/*
-** lib_insstr.c
-**
-** The routine winsnstr().
-**
-*/
-
-#include <curses.priv.h>
-#include <ctype.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-winsnstr(WINDOW *win, const char *s, int n)
-{
- int code = ERR;
- NCURSES_SIZE_T oy;
- NCURSES_SIZE_T ox;
- const unsigned char *str = (const unsigned char *) s;
- const unsigned char *cp;
-
- T((T_CALLED("winsnstr(%p,%s,%d)"), win, _nc_visbufn(s,n), n));
-
- if (win && str) {
- oy = win->_cury;
- ox = win->_curx;
- for (cp = str; *cp && (n <= 0 || (cp - str) < n); cp++) {
- if (*cp == '\n' || *cp == '\r' || *cp == '\t' || *cp == '\b') {
- NCURSES_CH_T wch;
- SetChar2(wch, *cp);
- _nc_waddch_nosync(win, wch);
- } else if (is7bits(*cp) && iscntrl(*cp)) {
- winsch(win, ' ' + (chtype) (*cp));
- winsch(win, (chtype) '^');
- win->_curx += 2;
- } else {
- winsch(win, (chtype) (*cp));
- win->_curx++;
- }
- if (win->_curx > win->_maxx)
- win->_curx = win->_maxx;
- }
-
- win->_curx = ox;
- win->_cury = oy;
- _nc_synchook(win);
- code = OK;
- }
- returnCode(code);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_instr.c b/ncurses-5.3/ncurses/base/lib_instr.c
deleted file mode 100644
index 3325691..0000000
--- a/ncurses-5.3/ncurses/base/lib_instr.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998-2001,2002 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> *
- ****************************************************************************/
-
-/*
-** lib_instr.c
-**
-** The routine winnstr().
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-winnstr(WINDOW *win, char *str, int n)
-{
- int i = 0, row, col;
-
- T((T_CALLED("winnstr(%p,%p,%d)"), win, str, n));
-
- if (!str)
- returnCode(0);
-
- if (win) {
- getyx(win, row, col);
-
- if (n < 0)
- n = win->_maxx - win->_curx + 1;
-
- for (; i < n;) {
- str[i++] = CharOf(win->_line[row].text[col]);
- if (++col > win->_maxx) {
- col = 0;
- if (++row > win->_maxy)
- break;
- }
- }
- }
- str[i] = '\0'; /* SVr4 does not seem to count the null */
- T(("winnstr returns %s", _nc_visbuf(str)));
- returnCode(i);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_isendwin.c b/ncurses-5.3/ncurses/base/lib_isendwin.c
deleted file mode 100644
index 9ccd3cf..0000000
--- a/ncurses-5.3/ncurses/base/lib_isendwin.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,2000 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> *
- ****************************************************************************/
-
-/*
-** lib_endwin.c
-**
-** The routine endwin().
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(bool)
-isendwin(void)
-{
- if (SP == NULL)
- return FALSE;
- return SP->_endwin;
-}
diff --git a/ncurses-5.3/ncurses/base/lib_leaveok.c b/ncurses-5.3/ncurses/base/lib_leaveok.c
deleted file mode 100644
index 135f8f6..0000000
--- a/ncurses-5.3/ncurses/base/lib_leaveok.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,2000 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> *
- ****************************************************************************/
-
-/*
-** lib_leaveok.c
-**
-** The routine leaveok.
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-leaveok(WINDOW *win, bool flag)
-{
- T((T_CALLED("leaveok(%p,%d)"), win, flag));
-
- if (win) {
- win->_leaveok = flag;
- returnCode(OK);
- } else
- returnCode(ERR);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_mouse.c b/ncurses-5.3/ncurses/base/lib_mouse.c
deleted file mode 100644
index 9bbab1a..0000000
--- a/ncurses-5.3/ncurses/base/lib_mouse.c
+++ /dev/null
@@ -1,1014 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998-2000,2002 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> *
- ****************************************************************************/
-
-/*
- * This module is intended to encapsulate ncurses's interface to pointing
- * devices.
- *
- * The first method used is xterm's internal mouse-tracking facility.
- * The second is Alessandro Rubini's GPM server.
- *
- * Notes for implementors of new mouse-interface methods:
- *
- * The code is logically split into a lower level that accepts event reports
- * in a device-dependent format and an upper level that parses mouse gestures
- * and filters events. The mediating data structure is a circular queue of
- * MEVENT structures.
- *
- * Functionally, the lower level's job is to pick up primitive events and
- * put them on the circular queue. This can happen in one of two ways:
- * either (a) _nc_mouse_event() detects a series of incoming mouse reports
- * and queues them, or (b) code in lib_getch.c detects the kmous prefix in
- * the keyboard input stream and calls _nc_mouse_inline to queue up a series
- * of adjacent mouse reports.
- *
- * In either case, _nc_mouse_parse() should be called after the series is
- * accepted to parse the digested mouse reports (low-level MEVENTs) into
- * a gesture (a high-level or composite MEVENT).
- *
- * Don't be too shy about adding new event types or modifiers, if you can find
- * room for them in the 32-bit mask. The API is written so that users get
- * feedback on which theoretical event types they won't see when they call
- * mousemask. There's one bit per button (the RESERVED_EVENT bit) not being
- * used yet, and a couple of bits open at the high end.
- */
-
-#ifdef __EMX__
-# include <io.h>
-# define INCL_DOS
-# define INCL_VIO
-# define INCL_KBD
-# define INCL_MOU
-# define INCL_DOSPROCESS
-# include <os2.h> /* Need to include before the others */
-#endif
-
-#include <curses.priv.h>
-#include <term.h>
-
-#if USE_GPM_SUPPORT
-#ifndef LINT /* don't need this for llib-lncurses */
-#undef buttons /* term.h defines this, and gpm uses it! */
-#include <gpm.h>
-#include <linux/keyboard.h> /* defines KG_* macros */
-#endif
-#endif
-
-MODULE_ID("$Id$")
-
-#define MY_TRACE TRACE_ICALLS|TRACE_IEVENT
-
-#define INVALID_EVENT -1
-
-static int mousetype;
-#define M_XTERM -1 /* use xterm's mouse tracking? */
-#define M_NONE 0 /* no mouse device */
-#define M_GPM 1 /* use GPM */
-#define M_QNX 2 /* QNX mouse on console */
-#define M_QNX_TERM 3 /* QNX mouse on pterm/xterm (using qansi-m) */
-
-#if USE_GPM_SUPPORT
-#ifndef LINT
-static Gpm_Connect gpm_connect;
-#endif
-#endif
-
-static mmask_t eventmask; /* current event mask */
-
-static bool _nc_mouse_parse(int);
-static void _nc_mouse_resume(SCREEN *);
-static void _nc_mouse_wrap(SCREEN *);
-
-/* maintain a circular list of mouse events */
-
-/* The definition of the circular list size (EV_MAX), is in curses.priv.h, so
- * wgetch() may refer to the size and call _nc_mouse_parse() before circular
- * list overflow.
- */
-static MEVENT events[EV_MAX]; /* hold the last mouse event seen */
-static MEVENT *eventp = events; /* next free slot in event queue */
-#define NEXT(ep) ((ep == events + EV_MAX - 1) ? events : ep + 1)
-#define PREV(ep) ((ep == events) ? events + EV_MAX - 1 : ep - 1)
-
-#ifdef TRACE
-static void
-_trace_slot(const char *tag)
-{
- MEVENT *ep;
-
- _tracef(tag);
-
- for (ep = events; ep < events + EV_MAX; ep++)
- _tracef("mouse event queue slot %ld = %s",
- (long) (ep - events),
- _tracemouse(ep));
-}
-#endif
-
-#ifdef USE_EMX_MOUSE
-
-# define TOP_ROW 0
-# define LEFT_COL 0
-
-static int mouse_wfd;
-static int mouse_thread;
-static int mouse_activated;
-static char mouse_buttons[] =
-{0, 1, 3, 2};
-
-# define M_FD(sp) sp->_mouse_fd
-
-static void
-write_event(int down, int button, int x, int y)
-{
- char buf[6];
- unsigned long ignore;
-
- strncpy(buf, key_mouse, 3); /* should be "\033[M" */
- buf[3] = ' ' + (button - 1) + (down ? 0 : 0x40);
- buf[4] = ' ' + x - LEFT_COL + 1;
- buf[5] = ' ' + y - TOP_ROW + 1;
- DosWrite(mouse_wfd, buf, 6, &ignore);
-}
-
-static void
-mouse_server(unsigned long ignored GCC_UNUSED)
-{
- unsigned short fWait = MOU_WAIT;
- /* NOPTRRECT mourt = { 0,0,24,79 }; */
- MOUEVENTINFO mouev;
- HMOU hmou;
- unsigned short mask = MOUSE_BN1_DOWN | MOUSE_BN2_DOWN | MOUSE_BN3_DOWN;
- int nbuttons = 3;
- int oldstate = 0;
- char err[80];
- unsigned long rc;
-
- /* open the handle for the mouse */
- if (MouOpen(NULL, &hmou) == 0) {
- rc = MouSetEventMask(&mask, hmou);
- if (rc) { /* retry with 2 buttons */
- mask = MOUSE_BN1_DOWN | MOUSE_BN2_DOWN;
- rc = MouSetEventMask(&mask, hmou);
- nbuttons = 2;
- }
- if (rc == 0 && MouDrawPtr(hmou) == 0) {
- for (;;) {
- /* sit and wait on the event queue */
- rc = MouReadEventQue(&mouev, &fWait, hmou);
- if (rc) {
- sprintf(err, "Error reading mouse queue, rc=%lu.\r\n", rc);
- break;
- }
- if (!mouse_activated)
- goto finish;
-
- /*
- * OS/2 numbers a 3-button mouse inconsistently from other
- * platforms:
- * 1 = left
- * 2 = right
- * 3 = middle.
- */
- if ((mouev.fs ^ oldstate) & MOUSE_BN1_DOWN)
- write_event(mouev.fs & MOUSE_BN1_DOWN,
- mouse_buttons[1], mouev.col, mouev.row);
- if ((mouev.fs ^ oldstate) & MOUSE_BN2_DOWN)
- write_event(mouev.fs & MOUSE_BN2_DOWN,
- mouse_buttons[3], mouev.col, mouev.row);
- if ((mouev.fs ^ oldstate) & MOUSE_BN3_DOWN)
- write_event(mouev.fs & MOUSE_BN3_DOWN,
- mouse_buttons[2], mouev.col, mouev.row);
-
- finish:
- oldstate = mouev.fs;
- }
- } else
- sprintf(err, "Error setting event mask, buttons=%d, rc=%lu.\r\n",
- nbuttons, rc);
-
- DosWrite(2, err, strlen(err), &rc);
- MouClose(hmou);
- }
- DosExit(EXIT_THREAD, 0L);
-}
-
-static void
-server_state(const int state)
-{ /* It would be nice to implement pointer-off and stop looping... */
- mouse_activated = state;
-}
-
-#endif
-
-static int initialized;
-
-static void
-initialize_mousetype(void)
-{
- static const char *xterm_kmous = "\033[M";
-
- /* Try gpm first, because gpm may be configured to run in xterm */
-#if USE_GPM_SUPPORT
- /* GPM: initialize connection to gpm server */
- gpm_connect.eventMask = GPM_DOWN | GPM_UP;
- gpm_connect.defaultMask = ~(gpm_connect.eventMask | GPM_HARD);
- gpm_connect.minMod = 0;
- gpm_connect.maxMod = ~((1 << KG_SHIFT) | (1 << KG_SHIFTL) | (1 << KG_SHIFTR));
- if (Gpm_Open(&gpm_connect, 0) >= 0) { /* returns the file-descriptor */
- mousetype = M_GPM;
- SP->_mouse_fd = gpm_fd;
- return;
- }
-#endif
-
- /* OS/2 VIO */
-#ifdef USE_EMX_MOUSE
- if (!mouse_thread
- && strstr(cur_term->type.term_names, "xterm") == 0
- && key_mouse) {
- int handles[2];
-
- if (pipe(handles) < 0) {
- perror("mouse pipe error");
- return;
- } else {
- int rc;
-
- if (!mouse_buttons[0]) {
- char *s = getenv("MOUSE_BUTTONS_123");
-
- mouse_buttons[0] = 1;
- if (s && strlen(s) >= 3) {
- mouse_buttons[1] = s[0] - '0';
- mouse_buttons[2] = s[1] - '0';
- mouse_buttons[3] = s[2] - '0';
- }
- }
- mouse_wfd = handles[1];
- M_FD(SP) = handles[0];
- /* Needed? */
- setmode(handles[0], O_BINARY);
- setmode(handles[1], O_BINARY);
- /* Do not use CRT functions, we may single-threaded. */
- rc = DosCreateThread((unsigned long *) &mouse_thread,
- mouse_server, 0, 0, 8192);
- if (rc) {
- printf("mouse thread error %d=%#x", rc, rc);
- return;
- } else {
- mousetype = M_XTERM;
- return;
- }
- }
- }
-#endif
-
- /* we know how to recognize mouse events under "xterm" */
- if (key_mouse != 0) {
- if (!strcmp(key_mouse, xterm_kmous)) {
- mousetype = M_XTERM;
- return;
- }
- } else if (strstr(cur_term->type.term_names, "xterm") != 0) {
- (void) _nc_add_to_try(&(SP->_keytry), xterm_kmous, KEY_MOUSE);
- mousetype = M_XTERM;
- return;
- }
-}
-
-static void
-_nc_mouse_init(void)
-/* initialize the mouse */
-{
- int i;
-
- if (!initialized) {
- initialized = TRUE;
-
- TR(MY_TRACE, ("_nc_mouse_init() called"));
-
- for (i = 0; i < EV_MAX; i++)
- events[i].id = INVALID_EVENT;
-
- initialize_mousetype();
-
- T(("_nc_mouse_init() set mousetype to %d", mousetype));
- }
-}
-
-/*
- * Query to see if there is a pending mouse event. This is called from
- * fifo_push() in lib_getch.c
- */
-static bool
-_nc_mouse_event(SCREEN * sp GCC_UNUSED)
-{
-#if USE_GPM_SUPPORT
- /* GPM: query server for event, return TRUE if we find one */
- Gpm_Event ev;
-
- if (Gpm_GetEvent(&ev) == 1) {
- eventp->id = 0; /* there's only one mouse... */
-
- eventp->bstate = 0;
- switch (ev.type & 0x0f) {
- case (GPM_DOWN):
- if (ev.buttons & GPM_B_LEFT)
- eventp->bstate |= BUTTON1_PRESSED;
- if (ev.buttons & GPM_B_MIDDLE)
- eventp->bstate |= BUTTON2_PRESSED;
- if (ev.buttons & GPM_B_RIGHT)
- eventp->bstate |= BUTTON3_PRESSED;
- break;
- case (GPM_UP):
- if (ev.buttons & GPM_B_LEFT)
- eventp->bstate |= BUTTON1_RELEASED;
- if (ev.buttons & GPM_B_MIDDLE)
- eventp->bstate |= BUTTON2_RELEASED;
- if (ev.buttons & GPM_B_RIGHT)
- eventp->bstate |= BUTTON3_RELEASED;
- break;
- default:
- break;
- }
-
- eventp->x = ev.x - 1;
- eventp->y = ev.y - 1;
- eventp->z = 0;
-
- /* bump the next-free pointer into the circular list */
- eventp = NEXT(eventp);
- return (TRUE);
- }
-#endif
-
-#ifdef USE_EMX_MOUSE
- {
- char kbuf[3];
-
- int i, res = read(M_FD(sp), &kbuf, 3); /* Eat the prefix */
- if (res != 3)
- printf("Got %d chars instead of 3 for prefix.\n", res);
- for (i = 0; i < res; i++) {
- if (kbuf[i] != key_mouse[i])
- printf("Got char %d instead of %d for prefix.\n",
- (int) kbuf[i], (int) key_mouse[i]);
- }
- return TRUE;
- }
-#endif /* USE_EMX_MOUSE */
-
- /* xterm: never have to query, mouse events are in the keyboard stream */
- return (FALSE); /* no event waiting */
-}
-
-static bool
-_nc_mouse_inline(SCREEN * sp)
-/* mouse report received in the keyboard stream -- parse its info */
-{
- TR(MY_TRACE, ("_nc_mouse_inline() called"));
-
- if (mousetype == M_XTERM) {
- unsigned char kbuf[4];
- MEVENT *prev;
- size_t grabbed;
- int res;
-
- /* This code requires that your xterm entry contain the kmous
- * capability and that it be set to the \E[M documented in the
- * Xterm Control Sequences reference. This is how we
- * arrange for mouse events to be reported via a KEY_MOUSE
- * return value from wgetch(). After this value is received,
- * _nc_mouse_inline() gets called and is immediately
- * responsible for parsing the mouse status information
- * following the prefix.
- *
- * The following quotes from the ctrlseqs.ms document in the
- * X distribution, describing the X mouse tracking feature:
- *
- * Parameters for all mouse tracking escape sequences
- * generated by xterm encode numeric parameters in a single
- * character as value+040. For example, ! is 1.
- *
- * On button press or release, xterm sends ESC [ M CbCxCy.
- * The low two bits of Cb encode button information: 0=MB1
- * pressed, 1=MB2 pressed, 2=MB3 pressed, 3=release. The
- * upper bits encode what modifiers were down when the
- * button was pressed and are added together. 4=Shift,
- * 8=Meta, 16=Control. Cx and Cy are the x and y coordinates
- * of the mouse event. The upper left corner is (1,1).
- *
- * (End quote) By the time we get here, we've eaten the
- * key prefix. FYI, the loop below is necessary because
- * mouse click info isn't guaranteed to present as a
- * single clist item. It always does under Linux but often
- * fails to under Solaris.
- */
- for (grabbed = 0; grabbed < 3; grabbed += res) {
-
- /* For VIO mouse we add extra bit 64 to disambiguate button-up. */
-#ifdef USE_EMX_MOUSE
- res = read(M_FD(sp) >= 0 ? M_FD(sp) : sp->_ifd, &kbuf, 3);
-#else
- res = read(sp->_ifd, kbuf + grabbed, 3 - grabbed);
-#endif
- if (res == -1)
- break;
- }
- kbuf[3] = '\0';
-
- TR(TRACE_IEVENT,
- ("_nc_mouse_inline sees the following xterm data: '%s'", kbuf));
-
- eventp->id = 0; /* there's only one mouse... */
-
- /* processing code goes here */
- eventp->bstate = 0;
- switch (kbuf[0] & 0x3) {
- case 0x0:
- eventp->bstate = BUTTON1_PRESSED;
-#ifdef USE_EMX_MOUSE
- if (kbuf[0] & 0x40)
- eventp->bstate = BUTTON1_RELEASED;
-#endif
- break;
-
- case 0x1:
- eventp->bstate = BUTTON2_PRESSED;
-#ifdef USE_EMX_MOUSE
- if (kbuf[0] & 0x40)
- eventp->bstate = BUTTON2_RELEASED;
-#endif
- break;
-
- case 0x2:
- eventp->bstate = BUTTON3_PRESSED;
-#ifdef USE_EMX_MOUSE
- if (kbuf[0] & 0x40)
- eventp->bstate = BUTTON3_RELEASED;
-#endif
- break;
-
- case 0x3:
- /*
- * Release events aren't reported for individual buttons,
- * just for the button set as a whole...
- */
- eventp->bstate =
- (BUTTON1_RELEASED |
- BUTTON2_RELEASED |
- BUTTON3_RELEASED);
- /*
- * ...however, because there are no kinds of mouse events under
- * xterm that can intervene between press and release, we can
- * deduce which buttons were actually released by looking at the
- * previous event.
- */
- prev = PREV(eventp);
- if (!(prev->bstate & BUTTON1_PRESSED))
- eventp->bstate &= ~BUTTON1_RELEASED;
- if (!(prev->bstate & BUTTON2_PRESSED))
- eventp->bstate &= ~BUTTON2_RELEASED;
- if (!(prev->bstate & BUTTON3_PRESSED))
- eventp->bstate &= ~BUTTON3_RELEASED;
- break;
- }
-
- if (kbuf[0] & 4) {
- eventp->bstate |= BUTTON_SHIFT;
- }
- if (kbuf[0] & 8) {
- eventp->bstate |= BUTTON_ALT;
- }
- if (kbuf[0] & 16) {
- eventp->bstate |= BUTTON_CTRL;
- }
-
- eventp->x = (kbuf[1] - ' ') - 1;
- eventp->y = (kbuf[2] - ' ') - 1;
- TR(MY_TRACE,
- ("_nc_mouse_inline: primitive mouse-event %s has slot %ld",
- _tracemouse(eventp),
- (long) (eventp - events)));
-
- /* bump the next-free pointer into the circular list */
- eventp = NEXT(eventp);
-#if 0 /* this return would be needed for QNX's mods to lib_getch.c */
- return (TRUE);
-#endif
- }
-
- return (FALSE);
-}
-
-static void
-mouse_activate(bool on)
-{
- if (!on && !initialized)
- return;
-
- _nc_mouse_init();
-
- if (on) {
-
- switch (mousetype) {
- case M_XTERM:
-#if NCURSES_EXT_FUNCS
- keyok(KEY_MOUSE, on);
-#endif
- TPUTS_TRACE("xterm mouse initialization");
-#ifdef USE_EMX_MOUSE
- server_state(1);
-#else
- putp("\033[?1000h");
-#endif
- break;
-#if USE_GPM_SUPPORT
- case M_GPM:
- SP->_mouse_fd = gpm_fd;
- break;
-#endif
- }
- /* Make runtime binding to cut down on object size of applications that
- * do not use the mouse (e.g., 'clear').
- */
- SP->_mouse_event = _nc_mouse_event;
- SP->_mouse_inline = _nc_mouse_inline;
- SP->_mouse_parse = _nc_mouse_parse;
- SP->_mouse_resume = _nc_mouse_resume;
- SP->_mouse_wrap = _nc_mouse_wrap;
-
- } else {
-
- switch (mousetype) {
- case M_XTERM:
- TPUTS_TRACE("xterm mouse deinitialization");
-#ifdef USE_EMX_MOUSE
- server_state(0);
-#else
- putp("\033[?1000l");
-#endif
- break;
-#if USE_GPM_SUPPORT
- case M_GPM:
- break;
-#endif
- }
- }
- _nc_flush();
-}
-
-/**************************************************************************
- *
- * Device-independent code
- *
- **************************************************************************/
-
-static bool
-_nc_mouse_parse(int runcount)
-/* parse a run of atomic mouse events into a gesture */
-{
- MEVENT *ep, *runp, *next, *prev = PREV(eventp);
- int n;
- bool merge;
-
- TR(MY_TRACE, ("_nc_mouse_parse(%d) called", runcount));
-
- /*
- * When we enter this routine, the event list next-free pointer
- * points just past a run of mouse events that we know were separated
- * in time by less than the critical click interval. The job of this
- * routine is to collaps this run into a single higher-level event
- * or gesture.
- *
- * We accomplish this in two passes. The first pass merges press/release
- * pairs into click events. The second merges runs of click events into
- * double or triple-click events.
- *
- * It's possible that the run may not resolve to a single event (for
- * example, if the user quadruple-clicks). If so, leading events
- * in the run are ignored.
- *
- * Note that this routine is independent of the format of the specific
- * format of the pointing-device's reports. We can use it to parse
- * gestures on anything that reports press/release events on a per-
- * button basis, as long as the device-dependent mouse code puts stuff
- * on the queue in MEVENT format.
- */
- if (runcount == 1) {
- TR(MY_TRACE,
- ("_nc_mouse_parse: returning simple mouse event %s at slot %ld",
- _tracemouse(prev),
- (long) (prev - events)));
- return (prev->id >= 0)
- ? ((prev->bstate & eventmask) ? TRUE : FALSE)
- : FALSE;
- }
-
- /* find the start of the run */
- runp = eventp;
- for (n = runcount; n > 0; n--) {
- runp = PREV(runp);
- }
-
-#ifdef TRACE
- if (_nc_tracing & TRACE_IEVENT) {
- _trace_slot("before mouse press/release merge:");
- _tracef("_nc_mouse_parse: run starts at %ld, ends at %ld, count %d",
- (long) (runp - events),
- (long) ((eventp - events) + (EV_MAX - 1)) % EV_MAX,
- runcount);
- }
-#endif /* TRACE */
-
- /* first pass; merge press/release pairs */
- do {
- merge = FALSE;
- for (ep = runp; (next = NEXT(ep)) != eventp; ep = next) {
- if (ep->x == next->x && ep->y == next->y
- && (ep->bstate & (BUTTON1_PRESSED | BUTTON2_PRESSED | BUTTON3_PRESSED))
- && (!(ep->bstate & BUTTON1_PRESSED)
- == !(next->bstate & BUTTON1_RELEASED))
- && (!(ep->bstate & BUTTON2_PRESSED)
- == !(next->bstate & BUTTON2_RELEASED))
- && (!(ep->bstate & BUTTON3_PRESSED)
- == !(next->bstate & BUTTON3_RELEASED))
- ) {
- if ((eventmask & BUTTON1_CLICKED)
- && (ep->bstate & BUTTON1_PRESSED)) {
- ep->bstate &= ~BUTTON1_PRESSED;
- ep->bstate |= BUTTON1_CLICKED;
- merge = TRUE;
- }
- if ((eventmask & BUTTON2_CLICKED)
- && (ep->bstate & BUTTON2_PRESSED)) {
- ep->bstate &= ~BUTTON2_PRESSED;
- ep->bstate |= BUTTON2_CLICKED;
- merge = TRUE;
- }
- if ((eventmask & BUTTON3_CLICKED)
- && (ep->bstate & BUTTON3_PRESSED)) {
- ep->bstate &= ~BUTTON3_PRESSED;
- ep->bstate |= BUTTON3_CLICKED;
- merge = TRUE;
- }
- if (merge)
- next->id = INVALID_EVENT;
- }
- }
- } while
- (merge);
-
-#ifdef TRACE
- if (_nc_tracing & TRACE_IEVENT) {
- _trace_slot("before mouse click merge:");
- _tracef("_nc_mouse_parse: run starts at %ld, ends at %ld, count %d",
- (long) (runp - events),
- (long) ((eventp - events) + (EV_MAX - 1)) % EV_MAX,
- runcount);
- }
-#endif /* TRACE */
-
- /*
- * Second pass; merge click runs. At this point, click events are
- * each followed by one invalid event. We merge click events
- * forward in the queue.
- *
- * NOTE: There is a problem with this design! If the application
- * allows enough click events to pile up in the circular queue so
- * they wrap around, it will cheerfully merge the newest forward
- * into the oldest, creating a bogus doubleclick and confusing
- * the queue-traversal logic rather badly. Generally this won't
- * happen, because calling getmouse() marks old events invalid and
- * ineligible for merges. The true solution to this problem would
- * be to timestamp each MEVENT and perform the obvious sanity check,
- * but the timer element would have to have sub-second resolution,
- * which would get us into portability trouble.
- */
- do {
- MEVENT *follower;
-
- merge = FALSE;
- for (ep = runp; (next = NEXT(ep)) != eventp; ep = next)
- if (ep->id != INVALID_EVENT) {
- if (next->id != INVALID_EVENT)
- continue;
- follower = NEXT(next);
- if (follower->id == INVALID_EVENT)
- continue;
-
- /* merge click events forward */
- if ((ep->bstate &
- (BUTTON1_CLICKED | BUTTON2_CLICKED | BUTTON3_CLICKED))
- && (follower->bstate &
- (BUTTON1_CLICKED | BUTTON2_CLICKED | BUTTON3_CLICKED))) {
- if ((eventmask & BUTTON1_DOUBLE_CLICKED)
- && (follower->bstate & BUTTON1_CLICKED)) {
- follower->bstate &= ~BUTTON1_CLICKED;
- follower->bstate |= BUTTON1_DOUBLE_CLICKED;
- merge = TRUE;
- }
- if ((eventmask & BUTTON2_DOUBLE_CLICKED)
- && (follower->bstate & BUTTON2_CLICKED)) {
- follower->bstate &= ~BUTTON2_CLICKED;
- follower->bstate |= BUTTON2_DOUBLE_CLICKED;
- merge = TRUE;
- }
- if ((eventmask & BUTTON3_DOUBLE_CLICKED)
- && (follower->bstate & BUTTON3_CLICKED)) {
- follower->bstate &= ~BUTTON3_CLICKED;
- follower->bstate |= BUTTON3_DOUBLE_CLICKED;
- merge = TRUE;
- }
- if (merge)
- ep->id = INVALID_EVENT;
- }
-
- /* merge double-click events forward */
- if ((ep->bstate &
- (BUTTON1_DOUBLE_CLICKED
- | BUTTON2_DOUBLE_CLICKED
- | BUTTON3_DOUBLE_CLICKED))
- && (follower->bstate &
- (BUTTON1_CLICKED | BUTTON2_CLICKED | BUTTON3_CLICKED))) {
- if ((eventmask & BUTTON1_TRIPLE_CLICKED)
- && (follower->bstate & BUTTON1_CLICKED)) {
- follower->bstate &= ~BUTTON1_CLICKED;
- follower->bstate |= BUTTON1_TRIPLE_CLICKED;
- merge = TRUE;
- }
- if ((eventmask & BUTTON2_TRIPLE_CLICKED)
- && (follower->bstate & BUTTON2_CLICKED)) {
- follower->bstate &= ~BUTTON2_CLICKED;
- follower->bstate |= BUTTON2_TRIPLE_CLICKED;
- merge = TRUE;
- }
- if ((eventmask & BUTTON3_TRIPLE_CLICKED)
- && (follower->bstate & BUTTON3_CLICKED)) {
- follower->bstate &= ~BUTTON3_CLICKED;
- follower->bstate |= BUTTON3_TRIPLE_CLICKED;
- merge = TRUE;
- }
- if (merge)
- ep->id = INVALID_EVENT;
- }
- }
- } while
- (merge);
-
-#ifdef TRACE
- if (_nc_tracing & TRACE_IEVENT) {
- _trace_slot("before mouse event queue compaction:");
- _tracef("_nc_mouse_parse: run starts at %ld, ends at %ld, count %d",
- (long) (runp - events),
- (long) ((eventp - events) + (EV_MAX - 1)) % EV_MAX,
- runcount);
- }
-#endif /* TRACE */
-
- /*
- * Now try to throw away trailing events flagged invalid, or that
- * don't match the current event mask.
- */
- for (; runcount; prev = PREV(eventp), runcount--)
- if (prev->id == INVALID_EVENT || !(prev->bstate & eventmask)) {
- eventp = prev;
- }
-#ifdef TRACE
- if (_nc_tracing & TRACE_IEVENT) {
- _trace_slot("after mouse event queue compaction:");
- _tracef("_nc_mouse_parse: run starts at %ld, ends at %ld, count %d",
- (long) (runp - events),
- (long) ((eventp - events) + (EV_MAX - 1)) % EV_MAX,
- runcount);
- }
- for (ep = runp; ep != eventp; ep = NEXT(ep))
- if (ep->id != INVALID_EVENT)
- TR(MY_TRACE,
- ("_nc_mouse_parse: returning composite mouse event %s at slot %ld",
- _tracemouse(ep),
- (long) (ep - events)));
-#endif /* TRACE */
-
- /* after all this, do we have a valid event? */
- return (PREV(eventp)->id != INVALID_EVENT);
-}
-
-static void
-_nc_mouse_wrap(SCREEN * sp GCC_UNUSED)
-/* release mouse -- called by endwin() before shellout/exit */
-{
- TR(MY_TRACE, ("_nc_mouse_wrap() called"));
-
- switch (mousetype) {
- case M_XTERM:
- if (eventmask)
- mouse_activate(FALSE);
- break;
-#if USE_GPM_SUPPORT
- /* GPM: pass all mouse events to next client */
- case M_GPM:
- break;
-#endif
- }
-}
-
-static void
-_nc_mouse_resume(SCREEN * sp GCC_UNUSED)
-/* re-connect to mouse -- called by doupdate() after shellout */
-{
- TR(MY_TRACE, ("_nc_mouse_resume() called"));
-
- /* xterm: re-enable reporting */
- if (mousetype == M_XTERM && eventmask)
- mouse_activate(TRUE);
-
- /* GPM: reclaim our event set */
-}
-
-/**************************************************************************
- *
- * Mouse interface entry points for the API
- *
- **************************************************************************/
-
-NCURSES_EXPORT(int)
-getmouse(MEVENT * aevent)
-/* grab a copy of the current mouse event */
-{
- T((T_CALLED("getmouse(%p)"), aevent));
-
- if (aevent && (mousetype != M_NONE)) {
- /* compute the current-event pointer */
- MEVENT *prev = PREV(eventp);
-
- /* copy the event we find there */
- *aevent = *prev;
-
- TR(TRACE_IEVENT, ("getmouse: returning event %s from slot %ld",
- _tracemouse(prev),
- (long) (prev - events)));
-
- prev->id = INVALID_EVENT; /* so the queue slot becomes free */
- returnCode(OK);
- }
- returnCode(ERR);
-}
-
-NCURSES_EXPORT(int)
-ungetmouse(MEVENT * aevent)
-/* enqueue a synthesized mouse event to be seen by the next wgetch() */
-{
- T((T_CALLED("ungetmouse(%p)"), aevent));
-
- /* stick the given event in the next-free slot */
- *eventp = *aevent;
-
- /* bump the next-free pointer into the circular list */
- eventp = NEXT(eventp);
-
- /* push back the notification event on the keyboard queue */
- returnCode(ungetch(KEY_MOUSE));
-}
-
-NCURSES_EXPORT(mmask_t)
-mousemask(mmask_t newmask, mmask_t * oldmask)
-/* set the mouse event mask */
-{
- mmask_t result = 0;
-
- T((T_CALLED("mousemask(%#lx,%p)"), newmask, oldmask));
-
- if (oldmask)
- *oldmask = eventmask;
-
- if (!newmask && !initialized)
- returnBits(0);
-
- _nc_mouse_init();
- if (mousetype != M_NONE) {
- eventmask = newmask &
- (BUTTON_ALT | BUTTON_CTRL | BUTTON_SHIFT
- | BUTTON1_PRESSED | BUTTON1_RELEASED | BUTTON1_CLICKED
- | BUTTON1_DOUBLE_CLICKED | BUTTON1_TRIPLE_CLICKED
- | BUTTON2_PRESSED | BUTTON2_RELEASED | BUTTON2_CLICKED
- | BUTTON2_DOUBLE_CLICKED | BUTTON2_TRIPLE_CLICKED
- | BUTTON3_PRESSED | BUTTON3_RELEASED | BUTTON3_CLICKED
- | BUTTON3_DOUBLE_CLICKED | BUTTON3_TRIPLE_CLICKED);
-
- mouse_activate(eventmask != 0);
-
- result = eventmask;
- }
-
- returnBits(result);
-}
-
-NCURSES_EXPORT(bool)
-wenclose(const WINDOW *win, int y, int x)
-/* check to see if given window encloses given screen location */
-{
- bool result = FALSE;
-
- T((T_CALLED("wenclose(%p,%d,%d)"), win, y, x));
-
- if (win != 0) {
- y -= win->_yoffset;
- result = ((win->_begy <= y &&
- win->_begx <= x &&
- (win->_begx + win->_maxx) >= x &&
- (win->_begy + win->_maxy) >= y) ? TRUE : FALSE);
- }
- returnBool(result);
-}
-
-NCURSES_EXPORT(int)
-mouseinterval(int maxclick)
-/* set the maximum mouse interval within which to recognize a click */
-{
- int oldval;
-
- T((T_CALLED("mouseinterval(%d)"), maxclick));
-
- if (SP != 0) {
- oldval = SP->_maxclick;
- if (maxclick >= 0)
- SP->_maxclick = maxclick;
- } else {
- oldval = DEFAULT_MAXCLICK;
- }
-
- returnCode(oldval);
-}
-
-/* This may be used by other routines to ask for the existence of mouse
- support */
-NCURSES_EXPORT(int)
-_nc_has_mouse(void)
-{
- return (mousetype == M_NONE ? 0 : 1);
-}
-
-NCURSES_EXPORT(bool)
-wmouse_trafo(const WINDOW *win, int *pY, int *pX, bool to_screen)
-{
- bool result = FALSE;
-
- T((T_CALLED("wmouse_trafo(%p,%p,%p,%d)"), win, pY, pX, to_screen));
-
- if (win && pY && pX) {
- int y = *pY;
- int x = *pX;
-
- if (to_screen) {
- y += win->_begy + win->_yoffset;
- x += win->_begx;
- if (wenclose(win, y, x))
- result = TRUE;
- } else {
- if (wenclose(win, y, x)) {
- y -= (win->_begy + win->_yoffset);
- x -= win->_begx;
- result = TRUE;
- }
- }
- if (result) {
- *pX = x;
- *pY = y;
- }
- }
- returnBool(result);
-}
-
-/* lib_mouse.c ends here */
diff --git a/ncurses-5.3/ncurses/base/lib_move.c b/ncurses-5.3/ncurses/base/lib_move.c
deleted file mode 100644
index c547fd8..0000000
--- a/ncurses-5.3/ncurses/base/lib_move.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,2000 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> *
- ****************************************************************************/
-
-/*
-** lib_move.c
-**
-** The routine wmove().
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-wmove(WINDOW *win, int y, int x)
-{
- T((T_CALLED("wmove(%p,%d,%d)"), win, y, x));
-
- if (win &&
- x >= 0 && x <= win->_maxx &&
- y >= 0 && y <= win->_maxy) {
- win->_curx = (NCURSES_SIZE_T) x;
- win->_cury = (NCURSES_SIZE_T) y;
-
- win->_flags &= ~_WRAPPED;
- win->_flags |= _HASMOVED;
- returnCode(OK);
- } else
- returnCode(ERR);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_mvwin.c b/ncurses-5.3/ncurses/base/lib_mvwin.c
deleted file mode 100644
index 04c3f6c..0000000
--- a/ncurses-5.3/ncurses/base/lib_mvwin.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/****************************************************************************
- * Copyright (c) 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> *
- ****************************************************************************/
-
-/*
-** lib_mvwin.c
-**
-** The routine mvwin().
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-mvwin(WINDOW *win, int by, int bx)
-{
- T((T_CALLED("mvwin(%p,%d,%d)"), win, by, bx));
-
- if (!win || (win->_flags & _ISPAD))
- returnCode(ERR);
-
- /* Copying subwindows is allowed, but it is expensive... */
- if (win->_flags & _SUBWIN) {
- int err = ERR;
- WINDOW *parent = win->_parent;
- if (parent) { /* Now comes the complicated and costly part, you should really
- * try to avoid to move subwindows. Because a subwindow shares
- * the text buffers with its parent, one can't do a simple
- * memmove of the text buffers. One has to create a copy, then
- * to relocate the subwindow and then to do a copy.
- */
- if ((by - parent->_begy == win->_pary) &&
- (bx - parent->_begx == win->_parx))
- err = OK; /* we don't actually move */
- else {
- WINDOW *clone = dupwin(win);
- if (clone) {
- /* now we have the clone, so relocate win */
-
- werase(win); /* Erase the original place */
- /* fill with parents background */
- wbkgrnd(win, CHREF(parent->_nc_bkgd));
- wsyncup(win); /* Tell the parent(s) */
-
- err = mvderwin(win,
- by - parent->_begy,
- bx - parent->_begx);
- if (err != ERR) {
- err = copywin(clone, win,
- 0, 0, 0, 0, win->_maxy, win->_maxx, 0);
- if (ERR != err)
- wsyncup(win);
- }
- if (ERR == delwin(clone))
- err = ERR;
- }
- }
- }
- returnCode(err);
- }
-
- if (by + win->_maxy > screen_lines - 1
- || bx + win->_maxx > screen_columns - 1
- || by < 0
- || bx < 0)
- returnCode(ERR);
-
- /*
- * Whether or not the window is moved, touch the window's contents so
- * that a following call to 'wrefresh()' will paint the window at the
- * new location. This ensures that if the caller has refreshed another
- * window at the same location, that this one will be displayed.
- */
- win->_begy = by;
- win->_begx = bx;
- returnCode(touchwin(win));
-}
diff --git a/ncurses-5.3/ncurses/base/lib_newterm.c b/ncurses-5.3/ncurses/base/lib_newterm.c
deleted file mode 100644
index 65aabe1..0000000
--- a/ncurses-5.3/ncurses/base/lib_newterm.c
+++ /dev/null
@@ -1,209 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998-2001,2002 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> *
- ****************************************************************************/
-
-/*
-** lib_newterm.c
-**
-** The newterm() function.
-**
-*/
-
-#include <curses.priv.h>
-
-#if SVR4_TERMIO && !defined(_POSIX_SOURCE)
-#define _POSIX_SOURCE
-#endif
-
-#include <term.h> /* clear_screen, cup & friends, cur_term */
-#include <tic.h>
-
-MODULE_ID("$Id$")
-
-#ifndef ONLCR /* Allows compilation under the QNX 4.2 OS */
-#define ONLCR 0
-#endif
-
-/*
- * SVr4/XSI Curses specify that hardware echo is turned off in initscr, and not
- * restored during the curses session. The library simulates echo in software.
- * (The behavior is unspecified if the application enables hardware echo).
- *
- * The newterm function also initializes terminal settings, and since initscr
- * is supposed to behave as if it calls newterm, we do it here.
- */
-static inline int
-_nc_initscr(void)
-{
- int result = ERR;
-
- /* for extended XPG4 conformance requires cbreak() at this point */
- /* (SVr4 curses does this anyway) */
- if (cbreak() == OK) {
- TTY buf;
-
- buf = cur_term->Nttyb;
-#ifdef TERMIOS
- buf.c_lflag &= ~(ECHO | ECHONL);
- buf.c_iflag &= ~(ICRNL | INLCR | IGNCR);
- buf.c_oflag &= ~(ONLCR);
-#else
- buf.sg_flags &= ~(ECHO | CRMOD);
-#endif
- if ((result = _nc_set_tty_mode(&buf)) == OK)
- cur_term->Nttyb = buf;
- }
- return result;
-}
-
-/*
- * filter() has to be called before either initscr() or newterm(), so there is
- * apparently no way to make this flag apply to some terminals and not others,
- * aside from possibly delaying a filter() call until some terminals have been
- * initialized.
- */
-static int filter_mode = FALSE;
-
-NCURSES_EXPORT(void)
-filter(void)
-{
- T((T_CALLED("filter")));
- filter_mode = TRUE;
- returnVoid;
-}
-
-NCURSES_EXPORT(SCREEN *)
-newterm(NCURSES_CONST char *name, FILE * ofp, FILE * ifp)
-{
- int errret;
- int slk_format = _nc_slk_format;
- SCREEN *current;
-
- START_TRACE();
- T((T_CALLED("newterm(\"%s\",%p,%p)"), name, ofp, ifp));
-
- /* this loads the capability entry, then sets LINES and COLS */
- if (setupterm(name, fileno(ofp), &errret) == ERR)
- returnSP(0);
-
- /* implement filter mode */
- if (filter_mode) {
- LINES = 1;
-
- if (VALID_NUMERIC(init_tabs))
- TABSIZE = init_tabs;
- else
- TABSIZE = 8;
-
- T(("TABSIZE = %d", TABSIZE));
-
- clear_screen = 0;
- cursor_down = parm_down_cursor = 0;
- cursor_address = 0;
- cursor_up = parm_up_cursor = 0;
- row_address = 0;
-
- cursor_home = carriage_return;
- }
-
- /* If we must simulate soft labels, grab off the line to be used.
- We assume that we must simulate, if it is none of the standard
- formats (4-4 or 3-2-3) for which there may be some hardware
- support. */
- if (num_labels <= 0 || !SLK_STDFMT(slk_format))
- if (slk_format) {
- if (ERR == _nc_ripoffline(-SLK_LINES(slk_format),
- _nc_slk_initialize))
- returnSP(0);
- }
- /* this actually allocates the screen structure, and saves the
- * original terminal settings.
- */
- current = SP;
- _nc_set_screen(0);
- if (_nc_setupscreen(LINES, COLS, ofp) == ERR) {
- _nc_set_screen(current);
- returnSP(0);
- }
-
- /* if the terminal type has real soft labels, set those up */
- if (slk_format && num_labels > 0 && SLK_STDFMT(slk_format))
- _nc_slk_initialize(stdscr, COLS);
-
- SP->_ifd = fileno(ifp);
- typeahead(fileno(ifp));
-#ifdef TERMIOS
- SP->_use_meta = ((cur_term->Ottyb.c_cflag & CSIZE) == CS8 &&
- !(cur_term->Ottyb.c_iflag & ISTRIP));
-#else
- SP->_use_meta = FALSE;
-#endif
- SP->_endwin = FALSE;
-
- /* Check whether we can optimize scrolling under dumb terminals in case
- * we do not have any of these capabilities, scrolling optimization
- * will be useless.
- */
- SP->_scrolling = ((scroll_forward && scroll_reverse) ||
- ((parm_rindex || parm_insert_line || insert_line) &&
- (parm_index || parm_delete_line || delete_line)));
-
- baudrate(); /* sets a field in the SP structure */
-
- SP->_keytry = 0;
-
- /*
- * Check for mismatched graphic-rendition capabilities. Most SVr4
- * terminfo trees contain entries that have rmul or rmso equated to
- * sgr0 (Solaris curses copes with those entries). We do this only for
- * curses, since many termcap applications assume that smso/rmso and
- * smul/rmul are paired, and will not function properly if we remove
- * rmso or rmul. Curses applications shouldn't be looking at this
- * detail.
- */
-#define SGR0_TEST(mode) (mode != 0) && (exit_attribute_mode == 0 || strcmp(mode, exit_attribute_mode))
- SP->_use_rmso = SGR0_TEST(exit_standout_mode);
- SP->_use_rmul = SGR0_TEST(exit_underline_mode);
-
- /* compute movement costs so we can do better move optimization */
- _nc_mvcur_init();
-
- /* initialize terminal to a sane state */
- _nc_screen_init();
-
- /* Initialize the terminal line settings. */
- _nc_initscr();
-
- _nc_signal_handler(TRUE);
-
- returnSP(SP);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_newwin.c b/ncurses-5.3/ncurses/base/lib_newwin.c
deleted file mode 100644
index 7d040d6..0000000
--- a/ncurses-5.3/ncurses/base/lib_newwin.c
+++ /dev/null
@@ -1,306 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998-2001,2002 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> *
- ****************************************************************************/
-
-/*
-** lib_newwin.c
-**
-** The routines newwin(), subwin() and their dependent
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-static WINDOW *
-remove_window_from_screen(WINDOW *win)
-{
- SCREEN **scan = &_nc_screen_chain;
-
- while (*scan) {
- SCREEN *sp = *scan;
- if (sp->_curscr == win) {
- sp->_curscr = 0;
- if (win == curscr)
- curscr = 0;
- } else if (sp->_stdscr == win) {
- sp->_stdscr = 0;
- if (win == stdscr)
- stdscr = 0;
- } else if (sp->_newscr == win) {
- sp->_newscr = 0;
- if (win == newscr)
- newscr = 0;
- } else {
- scan = &(*scan)->_next_screen;
- continue;
- }
- break;
- }
-
- return 0;
-}
-
-NCURSES_EXPORT(int)
-_nc_freewin(WINDOW *win)
-{
- WINDOWLIST *p, *q;
- int i;
- int result = ERR;
-
- if (win != 0) {
- for (p = _nc_windows, q = 0; p != 0; q = p, p = p->next) {
- if (&(p->win) == win) {
- remove_window_from_screen(win);
- if (q == 0)
- _nc_windows = p->next;
- else
- q->next = p->next;
-
- if (!(win->_flags & _SUBWIN)) {
- for (i = 0; i <= win->_maxy; i++)
- FreeIfNeeded(win->_line[i].text);
- }
- free(win->_line);
- free(p);
-
- result = OK;
- T(("...deleted win=%p", win));
- break;
- }
- }
- }
- return result;
-}
-
-NCURSES_EXPORT(WINDOW *)
-newwin(int num_lines, int num_columns, int begy, int begx)
-{
- WINDOW *win;
- NCURSES_CH_T *ptr;
- int i;
-
- T((T_CALLED("newwin(%d,%d,%d,%d)"), num_lines, num_columns, begy, begx));
-
- if (begy < 0 || begx < 0 || num_lines < 0 || num_columns < 0)
- returnWin(0);
-
- if (num_lines == 0)
- num_lines = SP->_lines_avail - begy;
- if (num_columns == 0)
- num_columns = screen_columns - begx;
-
- if (num_columns + begx > SP->_columns || num_lines + begy > SP->_lines_avail)
- returnWin(0);
-
- if ((win = _nc_makenew(num_lines, num_columns, begy, begx, 0)) == 0)
- returnWin(0);
-
- for (i = 0; i < num_lines; i++) {
- win->_line[i].text = typeCalloc(NCURSES_CH_T, (unsigned) num_columns);
- if (win->_line[i].text == 0) {
- (void) _nc_freewin(win);
- returnWin(0);
- }
- for (ptr = win->_line[i].text;
- ptr < win->_line[i].text + num_columns;
- ptr++)
- SetChar(*ptr, BLANK_TEXT, BLANK_ATTR);
- }
-
- returnWin(win);
-}
-
-NCURSES_EXPORT(WINDOW *)
-derwin(WINDOW *orig, int num_lines, int num_columns, int begy, int begx)
-{
- WINDOW *win;
- int i;
- int flags = _SUBWIN;
-
- T((T_CALLED("derwin(%p,%d,%d,%d,%d)"), orig, num_lines, num_columns,
- begy, begx));
-
- /*
- * make sure window fits inside the original one
- */
- if (begy < 0 || begx < 0 || orig == 0 || num_lines < 0 || num_columns < 0)
- returnWin(0);
- if (begy + num_lines > orig->_maxy + 1
- || begx + num_columns > orig->_maxx + 1)
- returnWin(0);
-
- if (num_lines == 0)
- num_lines = orig->_maxy + 1 - begy;
-
- if (num_columns == 0)
- num_columns = orig->_maxx + 1 - begx;
-
- if (orig->_flags & _ISPAD)
- flags |= _ISPAD;
-
- if ((win = _nc_makenew(num_lines, num_columns, orig->_begy + begy,
- orig->_begx + begx, flags)) == 0)
- returnWin(0);
-
- win->_pary = begy;
- win->_parx = begx;
- win->_attrs = orig->_attrs;
- win->_nc_bkgd = orig->_nc_bkgd;
-
- for (i = 0; i < num_lines; i++)
- win->_line[i].text = &orig->_line[begy++].text[begx];
-
- win->_parent = orig;
-
- returnWin(win);
-}
-
-NCURSES_EXPORT(WINDOW *)
-subwin(WINDOW *w, int l, int c, int y, int x)
-{
- T((T_CALLED("subwin(%p, %d, %d, %d, %d)"), w, l, c, y, x));
- T(("parent has begy = %d, begx = %d", w->_begy, w->_begx));
-
- returnWin(derwin(w, l, c, y - w->_begy, x - w->_begx));
-}
-
-static bool
-dimension_limit(int value)
-{
- NCURSES_SIZE_T test = value;
- return (test == value && value > 0);
-}
-
-NCURSES_EXPORT(WINDOW *)
-_nc_makenew(int num_lines, int num_columns, int begy, int begx, int flags)
-{
- int i;
- WINDOWLIST *wp;
- WINDOW *win;
- bool is_pad = (flags & _ISPAD);
-
- T(("_nc_makenew(%d,%d,%d,%d)", num_lines, num_columns, begy, begx));
-
- if (!dimension_limit(num_lines) || !dimension_limit(num_columns))
- return 0;
-
- if ((wp = typeCalloc(WINDOWLIST, 1)) == 0)
- return 0;
-
- win = &(wp->win);
-
- if ((win->_line = typeCalloc(struct ldat, ((unsigned) num_lines))) == 0) {
- free(win);
- return 0;
- }
-
- win->_curx = 0;
- win->_cury = 0;
- win->_maxy = num_lines - 1;
- win->_maxx = num_columns - 1;
- win->_begy = begy;
- win->_begx = begx;
- win->_yoffset = SP->_topstolen;
-
- win->_flags = flags;
- win->_attrs = A_NORMAL;
- SetChar(win->_nc_bkgd, BLANK_TEXT, BLANK_ATTR);
-
- win->_clear = is_pad ? FALSE : (num_lines == screen_lines
- && num_columns == screen_columns);
- win->_idlok = FALSE;
- win->_idcok = TRUE;
- win->_scroll = FALSE;
- win->_leaveok = FALSE;
- win->_use_keypad = FALSE;
- win->_delay = -1;
- win->_immed = FALSE;
- win->_sync = 0;
- win->_parx = -1;
- win->_pary = -1;
- win->_parent = 0;
-
- win->_regtop = 0;
- win->_regbottom = num_lines - 1;
-
- win->_pad._pad_y = -1;
- win->_pad._pad_x = -1;
- win->_pad._pad_top = -1;
- win->_pad._pad_bottom = -1;
- win->_pad._pad_left = -1;
- win->_pad._pad_right = -1;
-
- for (i = 0; i < num_lines; i++) {
- /*
- * This used to do
- *
- * win->_line[i].firstchar = win->_line[i].lastchar = _NOCHANGE;
- *
- * which marks the whole window unchanged. That's how
- * SVr1 curses did it, but SVr4 curses marks the whole new
- * window changed.
- *
- * With the old SVr1-like code, say you have stdscr full of
- * characters, then create a new window with newwin(),
- * then do a printw(win, "foo ");, the trailing spaces are
- * completely ignored by the following refreshes. So, you
- * get "foojunkjunk" on the screen instead of "foo " as
- * you actually intended.
- *
- * SVr4 doesn't do this. Instead the spaces are actually written.
- * So that's how we want ncurses to behave.
- */
- win->_line[i].firstchar = 0;
- win->_line[i].lastchar = num_columns - 1;
-
- if_USE_SCROLL_HINTS(win->_line[i].oldindex = i);
- }
-
- if (!is_pad && (begx + num_columns == screen_columns)) {
- win->_flags |= _ENDLINE;
-
- if (begx == 0 && num_lines == screen_lines && begy == 0)
- win->_flags |= _FULLWIN;
-
- if (begy + num_lines == screen_lines)
- win->_flags |= _SCROLLWIN;
- }
-
- wp->next = _nc_windows;
- _nc_windows = wp;
-
- T((T_CREATE("window %p"), win));
-
- return (win);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_nl.c b/ncurses-5.3/ncurses/base/lib_nl.c
deleted file mode 100644
index 3509b93..0000000
--- a/ncurses-5.3/ncurses/base/lib_nl.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,1999,2000 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> *
- ****************************************************************************/
-
-/*
- * nl.c
- *
- * Routines:
- * nl()
- * nonl()
- *
- */
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-#ifdef __EMX__
-#include <io.h>
-#endif
-
-NCURSES_EXPORT(int)
-nl(void)
-{
- T((T_CALLED("nl()")));
-
- SP->_nl = TRUE;
-
-#ifdef __EMX__
- _nc_flush();
- _fsetmode(NC_OUTPUT, "t");
-#endif
-
- returnCode(OK);
-}
-
-NCURSES_EXPORT(int)
-nonl(void)
-{
- T((T_CALLED("nonl()")));
-
- SP->_nl = FALSE;
-
-#ifdef __EMX__
- _nc_flush();
- _fsetmode(NC_OUTPUT, "b");
-#endif
-
- returnCode(OK);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_overlay.c b/ncurses-5.3/ncurses/base/lib_overlay.c
deleted file mode 100644
index a0f4071..0000000
--- a/ncurses-5.3/ncurses/base/lib_overlay.c
+++ /dev/null
@@ -1,184 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998-2001,2002 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> *
- ****************************************************************************/
-
-/*
-** lib_overlay.c
-**
-** The routines overlay(), copywin(), and overwrite().
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-static int
-overlap(const WINDOW *const s, WINDOW *const d, int const flag)
-{
- int sx1, sy1, sx2, sy2;
- int dx1, dy1, dx2, dy2;
- int sminrow, smincol;
- int dminrow, dmincol;
- int dmaxrow, dmaxcol;
-
- T((T_CALLED("overlap(%p,%p,%d)"), s, d, flag));
-
- if (s == 0 || d == 0) {
- returnCode(ERR);
- } else {
- T(("src : begy %d, begx %d, maxy %d, maxx %d",
- s->_begy, s->_begx, s->_maxy, s->_maxx));
- T(("dst : begy %d, begx %d, maxy %d, maxx %d",
- d->_begy, d->_begx, d->_maxy, d->_maxx));
-
- sx1 = s->_begx;
- sy1 = s->_begy;
- sx2 = sx1 + s->_maxx;
- sy2 = sy1 + s->_maxy;
-
- dx1 = d->_begx;
- dy1 = d->_begy;
- dx2 = dx1 + d->_maxx;
- dy2 = dy1 + d->_maxy;
-
- if (dx2 < sx1 || dx1 > sx2 || dy2 < sy1 || dy1 > sy2) {
- returnCode(ERR); /* No intersection */
- } else {
- sminrow = max(sy1, dy1) - sy1;
- smincol = max(sx1, dx1) - sx1;
- dminrow = max(sy1, dy1) - dy1;
- dmincol = max(sx1, dx1) - dx1;
- dmaxrow = min(sy2, dy2) - dy1;
- dmaxcol = min(sx2, dx2) - dx1;
-
- returnCode(copywin(s, d,
- sminrow, smincol,
- dminrow, dmincol,
- dmaxrow, dmaxcol,
- flag));
- }
- }
-}
-
-/*
-**
-** overlay(win1, win2)
-**
-**
-** overlay() writes the overlapping area of win1 behind win2
-** on win2 non-destructively.
-**
-**/
-
-NCURSES_EXPORT(int)
-overlay(const WINDOW *win1, WINDOW *win2)
-{
- T((T_CALLED("overlay(%p,%p)"), win1, win2));
- returnCode(overlap(win1, win2, TRUE));
-}
-
-/*
-**
-** overwrite(win1, win2)
-**
-**
-** overwrite() writes the overlapping area of win1 behind win2
-** on win2 destructively.
-**
-**/
-
-NCURSES_EXPORT(int)
-overwrite(const WINDOW *win1, WINDOW *win2)
-{
- T((T_CALLED("overwrite(%p,%p)"), win1, win2));
- returnCode(overlap(win1, win2, FALSE));
-}
-
-NCURSES_EXPORT(int)
-copywin(const WINDOW *src, WINDOW *dst,
- int sminrow, int smincol,
- int dminrow, int dmincol,
- int dmaxrow, int dmaxcol,
- int over)
-{
- int sx, sy, dx, dy;
- bool touched;
- attr_t bk = AttrOf(dst->_nc_bkgd);
- attr_t mask = ~(attr_t) ((bk & A_COLOR) ? A_COLOR : 0);
-
- T((T_CALLED("copywin(%p, %p, %d, %d, %d, %d, %d, %d, %d)"),
- src, dst, sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol, over));
-
- if (!src || !dst)
- returnCode(ERR);
-
- /* make sure rectangle exists in source */
- if ((sminrow + dmaxrow - dminrow) > (src->_maxy + 1) ||
- (smincol + dmaxcol - dmincol) > (src->_maxx + 1)) {
- returnCode(ERR);
- }
-
- T(("rectangle exists in source"));
-
- /* make sure rectangle fits in destination */
- if (dmaxrow > dst->_maxy || dmaxcol > dst->_maxx) {
- returnCode(ERR);
- }
-
- T(("rectangle fits in destination"));
-
- for (dy = dminrow, sy = sminrow; dy <= dmaxrow; sy++, dy++) {
- touched = FALSE;
- for (dx = dmincol, sx = smincol; dx <= dmaxcol; sx++, dx++) {
- if (over) {
- if ((CharOf(src->_line[sy].text[sx]) != L(' ')) &&
- (!CharEq(dst->_line[dy].text[dx], src->_line[sy].text[sx]))) {
- dst->_line[dy].text[dx] = src->_line[sy].text[sx];
- SetAttr(dst->_line[dy].text[dx],
- (AttrOf(src->_line[sy].text[sx]) & mask) | bk);
- touched = TRUE;
- }
- } else {
- if (!CharEq(dst->_line[dy].text[dx], src->_line[sy].text[sx])) {
- dst->_line[dy].text[dx] = src->_line[sy].text[sx];
- touched = TRUE;
- }
- }
- }
- if (touched) {
- touchline(dst, dminrow, (dmaxrow - dminrow + 1));
- }
- }
- T(("finished copywin"));
- returnCode(OK);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_pad.c b/ncurses-5.3/ncurses/base/lib_pad.c
deleted file mode 100644
index 3005f06..0000000
--- a/ncurses-5.3/ncurses/base/lib_pad.c
+++ /dev/null
@@ -1,313 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998-2001,2002 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> *
- ****************************************************************************/
-
-/*
- * lib_pad.c
- * newpad -- create a new pad
- * pnoutrefresh -- refresh a pad, no update
- * pechochar -- add a char to a pad and refresh
- */
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(WINDOW *)
-newpad(int l, int c)
-{
- WINDOW *win;
- NCURSES_CH_T *ptr;
- int i;
-
- T((T_CALLED("newpad(%d, %d)"), l, c));
-
- if (l <= 0 || c <= 0)
- returnWin(0);
-
- if ((win = _nc_makenew(l, c, 0, 0, _ISPAD)) == NULL)
- returnWin(0);
-
- for (i = 0; i < l; i++) {
- if_USE_SCROLL_HINTS(win->_line[i].oldindex = _NEWINDEX);
- if ((win->_line[i].text = typeCalloc(NCURSES_CH_T, ((size_t) c))) == 0) {
- (void) _nc_freewin(win);
- returnWin(0);
- }
- for (ptr = win->_line[i].text; ptr < win->_line[i].text + c; ptr++)
- SetChar(*ptr, BLANK_TEXT, BLANK_ATTR);
- }
-
- returnWin(win);
-}
-
-NCURSES_EXPORT(WINDOW *)
-subpad
-(WINDOW *orig, int l, int c, int begy, int begx)
-{
- WINDOW *win = (WINDOW *) 0;
-
- T((T_CALLED("subpad(%d, %d)"), l, c));
-
- if (orig) {
- if (!(orig->_flags & _ISPAD)
- || ((win = derwin(orig, l, c, begy, begx)) == NULL))
- returnWin(0);
- }
- returnWin(win);
-}
-
-NCURSES_EXPORT(int)
-prefresh
-(WINDOW *win, int pminrow, int pmincol,
- int sminrow, int smincol, int smaxrow, int smaxcol)
-{
- T((T_CALLED("prefresh()")));
- if (pnoutrefresh(win, pminrow, pmincol, sminrow, smincol, smaxrow,
- smaxcol) != ERR
- && doupdate() != ERR) {
- returnCode(OK);
- }
- returnCode(ERR);
-}
-
-NCURSES_EXPORT(int)
-pnoutrefresh
-(WINDOW *win, int pminrow, int pmincol,
- int sminrow, int smincol, int smaxrow, int smaxcol)
-{
- NCURSES_SIZE_T i, j;
- NCURSES_SIZE_T m, n;
- NCURSES_SIZE_T pmaxrow;
- NCURSES_SIZE_T pmaxcol;
-
-#if USE_SCROLL_HINTS
- const int my_len = 2; /* parameterize the threshold for hardscroll */
- NCURSES_SIZE_T displaced;
- bool wide;
-#endif
-
- T((T_CALLED("pnoutrefresh(%p, %d, %d, %d, %d, %d, %d)"),
- win, pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol));
-
- if (win == 0)
- returnCode(ERR);
-
- if (!(win->_flags & _ISPAD))
- returnCode(ERR);
-
- /* negative values are interpreted as zero */
- if (pminrow < 0)
- pminrow = 0;
- if (pmincol < 0)
- pmincol = 0;
- if (sminrow < 0)
- sminrow = 0;
- if (smincol < 0)
- smincol = 0;
-
- pmaxrow = pminrow + smaxrow - sminrow;
- pmaxcol = pmincol + smaxcol - smincol;
-
- T((" pminrow + smaxrow - sminrow %d, win->_maxy %d", pmaxrow, win->_maxy));
- T((" pmincol + smaxcol - smincol %d, win->_maxx %d", pmaxcol, win->_maxx));
-
- /*
- * Trim the caller's screen size back to the actual limits.
- */
- if (pmaxrow > win->_maxy) {
- smaxrow -= (pmaxrow - win->_maxy);
- pmaxrow = pminrow + smaxrow - sminrow;
- }
- if (pmaxcol > win->_maxx) {
- smaxcol -= (pmaxcol - win->_maxx);
- pmaxcol = pmincol + smaxcol - smincol;
- }
-
- if (smaxrow >= screen_lines
- || smaxcol >= screen_columns
- || sminrow > smaxrow
- || smincol > smaxcol)
- returnCode(ERR);
-
- T(("pad being refreshed"));
-
-#if USE_SCROLL_HINTS
- if (win->_pad._pad_y >= 0) {
- displaced = pminrow - win->_pad._pad_y
- - (sminrow - win->_pad._pad_top);
- T(("pad being shifted by %d line(s)", displaced));
- } else
- displaced = 0;
-#endif
-
- /*
- * For pure efficiency, we'd want to transfer scrolling information
- * from the pad to newscr whenever the window is wide enough that
- * its update will dominate the cost of the update for the horizontal
- * band of newscr that it occupies. Unfortunately, this threshold
- * tends to be complex to estimate, and in any case scrolling the
- * whole band and rewriting the parts outside win's image would look
- * really ugly. So. What we do is consider the pad "wide" if it
- * either (a) occupies the whole width of newscr, or (b) occupies
- * all but at most one column on either vertical edge of the screen
- * (this caters to fussy people who put boxes around full-screen
- * windows). Note that changing this formula will not break any code,
- * merely change the costs of various update cases.
- */
-#if USE_SCROLL_HINTS
- wide = (smincol < my_len && smaxcol > (newscr->_maxx - my_len));
-#endif
-
- for (i = pminrow, m = sminrow + win->_yoffset;
- i <= pmaxrow && m <= newscr->_maxy;
- i++, m++) {
- register struct ldat *nline = &newscr->_line[m];
- register struct ldat *oline = &win->_line[i];
- for (j = pmincol, n = smincol; j <= pmaxcol; j++, n++) {
- NCURSES_CH_T ch = oline->text[j];
-#if USE_WIDEC_SUPPORT
- /*
- * Special case for leftmost character of the displayed area.
- * Only half of a double-width character may be visible.
- */
- if (j == pmincol
- && j > 0
- && isnac(ch)) {
- SetChar(ch, L(' '), AttrOf(oline->text[j - 1]));
- }
-#endif
- if (!CharEq(ch, nline->text[n])) {
- nline->text[n] = ch;
- CHANGED_CELL(nline, n);
- }
- }
-
-#if USE_SCROLL_HINTS
- if (wide) {
- int nind = m + displaced;
- if (oline->oldindex < 0
- || nind < sminrow
- || nind > smaxrow) {
- nind = _NEWINDEX;
- } else if (displaced) {
- register struct ldat *pline = &curscr->_line[nind];
- for (j = 0; j <= my_len; j++) {
- int k = newscr->_maxx - j;
- if (pline->text[j] != nline->text[j]
- || pline->text[k] != nline->text[k]) {
- nind = _NEWINDEX;
- break;
- }
- }
- }
-
- nline->oldindex = nind;
- }
-#endif /* USE_SCROLL_HINTS */
- oline->firstchar = oline->lastchar = _NOCHANGE;
- if_USE_SCROLL_HINTS(oline->oldindex = i);
- }
-
- /*
- * Clean up debris from scrolling or resizing the pad, so we do not
- * accidentally pick up the index value during the next call to this
- * procedure. The only rows that should have an index value are those
- * that are displayed during this cycle.
- */
-#if USE_SCROLL_HINTS
- for (i = pminrow - 1; (i >= 0) && (win->_line[i].oldindex >= 0); i--)
- win->_line[i].oldindex = _NEWINDEX;
- for (i = pmaxrow + 1; (i <= win->_maxy)
- && (win->_line[i].oldindex >= 0); i++)
- win->_line[i].oldindex = _NEWINDEX;
-#endif
-
- win->_begx = smincol;
- win->_begy = sminrow;
-
- if (win->_clear) {
- win->_clear = FALSE;
- newscr->_clear = TRUE;
- }
-
- /*
- * Use the pad's current position, if it will be visible.
- * If not, don't do anything; it's not an error.
- */
- if (win->_leaveok == FALSE
- && win->_cury >= pminrow
- && win->_curx >= pmincol
- && win->_cury <= pmaxrow
- && win->_curx <= pmaxcol) {
- newscr->_cury = win->_cury - pminrow + win->_begy + win->_yoffset;
- newscr->_curx = win->_curx - pmincol + win->_begx;
- }
- newscr->_leaveok = win->_leaveok;
- win->_flags &= ~_HASMOVED;
-
- /*
- * Update our cache of the line-numbers that we displayed from the pad.
- * We will use this on subsequent calls to this function to derive
- * values to stuff into 'oldindex[]' -- for scrolling optimization.
- */
- win->_pad._pad_y = pminrow;
- win->_pad._pad_x = pmincol;
- win->_pad._pad_top = sminrow;
- win->_pad._pad_left = smincol;
- win->_pad._pad_bottom = smaxrow;
- win->_pad._pad_right = smaxcol;
-
- returnCode(OK);
-}
-
-NCURSES_EXPORT(int)
-pechochar(WINDOW *pad, const chtype ch)
-{
- T((T_CALLED("pechochar(%p, %s)"), pad, _tracechtype(ch)));
-
- if (pad == 0)
- returnCode(ERR);
-
- if (!(pad->_flags & _ISPAD))
- returnCode(wechochar(pad, ch));
-
- waddch(pad, ch);
- prefresh(pad, pad->_pad._pad_y,
- pad->_pad._pad_x,
- pad->_pad._pad_top,
- pad->_pad._pad_left,
- pad->_pad._pad_bottom,
- pad->_pad._pad_right);
-
- returnCode(OK);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_printw.c b/ncurses-5.3/ncurses/base/lib_printw.c
deleted file mode 100644
index 5081f86..0000000
--- a/ncurses-5.3/ncurses/base/lib_printw.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998-2001,2002 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 <dickey@clark.net> 1997 *
- ****************************************************************************/
-
-/*
-** lib_printw.c
-**
-** The routines printw(), wprintw() and friends.
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-printw(NCURSES_CONST char *fmt,...)
-{
- va_list argp;
- int code;
-
-#ifdef TRACE
- va_start(argp, fmt);
- T((T_CALLED("printw(%s%s)"),
- _nc_visbuf(fmt), _nc_varargs(fmt, argp)));
- va_end(argp);
-#endif
-
- va_start(argp, fmt);
- code = vwprintw(stdscr, fmt, argp);
- va_end(argp);
-
- returnCode(code);
-}
-
-NCURSES_EXPORT(int)
-wprintw(WINDOW *win, NCURSES_CONST char *fmt,...)
-{
- va_list argp;
- int code;
-
-#ifdef TRACE
- va_start(argp, fmt);
- T((T_CALLED("wprintw(%p,%s%s)"),
- win, _nc_visbuf(fmt), _nc_varargs(fmt, argp)));
- va_end(argp);
-#endif
-
- va_start(argp, fmt);
- code = vwprintw(win, fmt, argp);
- va_end(argp);
-
- returnCode(code);
-}
-
-NCURSES_EXPORT(int)
-mvprintw(int y, int x, NCURSES_CONST char *fmt,...)
-{
- va_list argp;
- int code;
-
-#ifdef TRACE
- va_start(argp, fmt);
- T((T_CALLED("mvprintw(%d,%d,%s%s)"),
- y, x, _nc_visbuf(fmt), _nc_varargs(fmt, argp)));
- va_end(argp);
-#endif
-
- if ((code = move(y, x)) != ERR) {
- va_start(argp, fmt);
- code = vwprintw(stdscr, fmt, argp);
- va_end(argp);
- }
- returnCode(code);
-}
-
-NCURSES_EXPORT(int)
-mvwprintw(WINDOW *win, int y, int x, NCURSES_CONST char *fmt,...)
-{
- va_list argp;
- int code;
-
-#ifdef TRACE
- va_start(argp, fmt);
- T((T_CALLED("mvwprintw(%d,%d,%p,%s%s)"),
- y, x, win, _nc_visbuf(fmt), _nc_varargs(fmt, argp)));
- va_end(argp);
-#endif
-
- if ((code = wmove(win, y, x)) != ERR) {
- va_start(argp, fmt);
- code = vwprintw(win, fmt, argp);
- va_end(argp);
- }
- returnCode(code);
-}
-
-NCURSES_EXPORT(int)
-vwprintw(WINDOW *win, NCURSES_CONST char *fmt, va_list argp)
-{
- char *buf;
- int code = ERR;
-
- T((T_CALLED("vwprintw(%p,%s,%p)"),
- win, _nc_visbuf(fmt), argp));
-
- if ((buf = _nc_printf_string(fmt, argp)) != 0) {
- code = waddstr(win, buf);
-#if USE_SAFE_SPRINTF
- free(buf);
-#endif
- }
- returnCode(code);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_redrawln.c b/ncurses-5.3/ncurses/base/lib_redrawln.c
deleted file mode 100644
index c70f162..0000000
--- a/ncurses-5.3/ncurses/base/lib_redrawln.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
- * Copyright (c) 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: Thomas E. Dickey <dickey@clark.net> 1997 *
- ****************************************************************************/
-
-/*
- * lib_redrawln.c
- *
- * The routine wredrawln().
- *
- */
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-wredrawln(WINDOW *win, int beg, int num)
-{
- int i;
- int end;
- size_t len = (win->_maxx + 1);
-
- T((T_CALLED("wredrawln(%p,%d,%d)"), win, beg, num));
-
- if (beg < 0)
- beg = 0;
-
- if (touchline(win, beg, num) == ERR)
- returnCode(ERR);
-
- end = beg + num;
- if (end > curscr->_maxy + 1)
- end = curscr->_maxy + 1;
- if (end > win->_maxy + 1)
- end = win->_maxy + 1;
-
- if (len > (size_t) (curscr->_maxx + 1))
- len = (size_t) (curscr->_maxx + 1);
- len *= sizeof(curscr->_line[0].text[0]);
-
- for (i = beg; i < end; i++) {
- memset(curscr->_line[i + win->_begy].text + win->_begx, 0, len);
- _nc_make_oldhash(i + win->_begy);
- }
-
- returnCode(OK);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_refresh.c b/ncurses-5.3/ncurses/base/lib_refresh.c
deleted file mode 100644
index e9c5fdf..0000000
--- a/ncurses-5.3/ncurses/base/lib_refresh.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998-2001,2002 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> *
- ****************************************************************************/
-
-/*
- * lib_refresh.c
- *
- * The routines wrefresh() and wnoutrefresh().
- *
- */
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-wrefresh(WINDOW *win)
-{
- int code;
-
- T((T_CALLED("wrefresh(%p)"), win));
-
- if (win == curscr) {
- curscr->_clear = TRUE;
- code = doupdate();
- } else if ((code = wnoutrefresh(win)) == OK) {
- if (win->_clear)
- newscr->_clear = TRUE;
- code = doupdate();
- /*
- * Reset the clearok() flag in case it was set for the special
- * case in hardscroll.c (if we don't reset it here, we'll get 2
- * refreshes because the flag is copied from stdscr to newscr).
- * Resetting the flag shouldn't do any harm, anyway.
- */
- win->_clear = FALSE;
- }
- returnCode(code);
-}
-
-NCURSES_EXPORT(int)
-wnoutrefresh(WINDOW *win)
-{
- NCURSES_SIZE_T limit_x;
- NCURSES_SIZE_T i, j;
- NCURSES_SIZE_T begx;
- NCURSES_SIZE_T begy;
- NCURSES_SIZE_T m, n;
-#if USE_SCROLL_HINTS
- bool wide;
-#endif
-
- T((T_CALLED("wnoutrefresh(%p)"), win));
-#ifdef TRACE
- if (_nc_tracing & TRACE_UPDATE)
- _tracedump("...win", win);
-#endif /* TRACE */
-
- /*
- * This function will break badly if we try to refresh a pad.
- */
- if ((win == 0)
- || (win->_flags & _ISPAD))
- returnCode(ERR);
-
- /* put them here so "win == 0" won't break our code */
- begx = win->_begx;
- begy = win->_begy;
-
- newscr->_nc_bkgd = win->_nc_bkgd;
- newscr->_attrs = win->_attrs;
-
- /* merge in change information from all subwindows of this window */
- wsyncdown(win);
-
-#if USE_SCROLL_HINTS
- /*
- * For pure efficiency, we'd want to transfer scrolling information
- * from the window to newscr whenever the window is wide enough that
- * its update will dominate the cost of the update for the horizontal
- * band of newscr that it occupies. Unfortunately, this threshold
- * tends to be complex to estimate, and in any case scrolling the
- * whole band and rewriting the parts outside win's image would look
- * really ugly. So. What we do is consider the window "wide" if it
- * either (a) occupies the whole width of newscr, or (b) occupies
- * all but at most one column on either vertical edge of the screen
- * (this caters to fussy people who put boxes around full-screen
- * windows). Note that changing this formula will not break any code,
- * merely change the costs of various update cases.
- */
- wide = (begx <= 1 && win->_maxx >= (newscr->_maxx - 1));
-#endif
-
- win->_flags &= ~_HASMOVED;
-
- /*
- * Microtweaking alert! This double loop is one of the genuine
- * hot spots in the code. Even gcc doesn't seem to do enough
- * common-subexpression chunking to make it really tense,
- * so we'll force the issue.
- */
-
- /* limit(n) */
- limit_x = win->_maxx;
- /* limit(j) */
- if (limit_x > newscr->_maxx - begx)
- limit_x = newscr->_maxx - begx;
-
- for (i = 0, m = begy + win->_yoffset;
- i <= win->_maxy && m <= newscr->_maxy;
- i++, m++) {
- register struct ldat *nline = &newscr->_line[m];
- register struct ldat *oline = &win->_line[i];
-
- if (oline->firstchar != _NOCHANGE) {
- int last = oline->lastchar;
-
- if (last > limit_x)
- last = limit_x;
-
- for (j = oline->firstchar, n = j + begx; j <= last; j++, n++) {
- if (!CharEq(oline->text[j], nline->text[n])) {
- nline->text[n] = oline->text[j];
- CHANGED_CELL(nline, n);
- }
- }
-
- }
-#if USE_SCROLL_HINTS
- if (wide) {
- int oind = oline->oldindex;
-
- nline->oldindex = (oind == _NEWINDEX) ? _NEWINDEX : begy + oind
- + win->_yoffset;
- }
-#endif /* USE_SCROLL_HINTS */
-
- oline->firstchar = oline->lastchar = _NOCHANGE;
- if_USE_SCROLL_HINTS(oline->oldindex = i);
- }
-
- if (win->_clear) {
- win->_clear = FALSE;
- newscr->_clear = TRUE;
- }
-
- if (!win->_leaveok) {
- newscr->_cury = win->_cury + win->_begy + win->_yoffset;
- newscr->_curx = win->_curx + win->_begx;
- }
- newscr->_leaveok = win->_leaveok;
-
-#ifdef TRACE
- if (_nc_tracing & TRACE_UPDATE)
- _tracedump("newscr", newscr);
-#endif /* TRACE */
- returnCode(OK);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_restart.c b/ncurses-5.3/ncurses/base/lib_restart.c
deleted file mode 100644
index a9b81da..0000000
--- a/ncurses-5.3/ncurses/base/lib_restart.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998-2000,2002 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> *
- ****************************************************************************/
-
-/*
- * Terminfo-only terminal setup routines:
- *
- * int restartterm(const char *, int, int *)
- * TERMINAL *set_curterm(TERMINAL *)
- * int del_curterm(TERMINAL *)
- */
-
-#include <curses.priv.h>
-
-#if SVR4_TERMIO && !defined(_POSIX_SOURCE)
-#define _POSIX_SOURCE
-#endif
-
-#include <term.h> /* lines, columns, cur_term */
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-restartterm(NCURSES_CONST char *termp, int filenum, int *errret)
-{
- int saveecho = SP->_echo;
- int savecbreak = SP->_cbreak;
- int saveraw = SP->_raw;
- int savenl = SP->_nl;
-
- T((T_CALLED("restartterm(%s,%d,%p)"), termp, filenum, errret));
-
- if (setupterm(termp, filenum, errret) != OK)
- returnCode(ERR);
-
- if (saveecho)
- echo();
- else
- noecho();
-
- if (savecbreak) {
- cbreak();
- noraw();
- } else if (saveraw) {
- nocbreak();
- raw();
- } else {
- nocbreak();
- noraw();
- }
- if (savenl)
- nl();
- else
- nonl();
-
- reset_prog_mode();
-
-#if USE_SIZECHANGE
- _nc_update_screensize();
-#endif
-
- returnCode(OK);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_scanw.c b/ncurses-5.3/ncurses/base/lib_scanw.c
deleted file mode 100644
index 3e464be..0000000
--- a/ncurses-5.3/ncurses/base/lib_scanw.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/****************************************************************************
- * Copyright (c) 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> *
- ****************************************************************************/
-
-/*
-** lib_scanw.c
-**
-** The routines scanw(), wscanw() and friends.
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-vwscanw(WINDOW *win, NCURSES_CONST char *fmt, va_list argp)
-{
- char buf[BUFSIZ];
-
- if (wgetnstr(win, buf, sizeof(buf) - 1) == ERR)
- return (ERR);
-
- return (vsscanf(buf, fmt, argp));
-}
-
-NCURSES_EXPORT(int)
-scanw(NCURSES_CONST char *fmt,...)
-{
- int code;
- va_list ap;
-
- T(("scanw(\"%s\",...) called", fmt));
-
- va_start(ap, fmt);
- code = vwscanw(stdscr, fmt, ap);
- va_end(ap);
- return (code);
-}
-
-NCURSES_EXPORT(int)
-wscanw(WINDOW *win, NCURSES_CONST char *fmt,...)
-{
- int code;
- va_list ap;
-
- T(("wscanw(%p,\"%s\",...) called", win, fmt));
-
- va_start(ap, fmt);
- code = vwscanw(win, fmt, ap);
- va_end(ap);
- return (code);
-}
-
-NCURSES_EXPORT(int)
-mvscanw(int y, int x, NCURSES_CONST char *fmt,...)
-{
- int code;
- va_list ap;
-
- va_start(ap, fmt);
- code = (move(y, x) == OK) ? vwscanw(stdscr, fmt, ap) : ERR;
- va_end(ap);
- return (code);
-}
-
-NCURSES_EXPORT(int)
-mvwscanw(WINDOW *win, int y, int x, NCURSES_CONST char *fmt,...)
-{
- int code;
- va_list ap;
-
- va_start(ap, fmt);
- code = (wmove(win, y, x) == OK) ? vwscanw(win, fmt, ap) : ERR;
- va_end(ap);
- return (code);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_screen.c b/ncurses-5.3/ncurses/base/lib_screen.c
deleted file mode 100644
index 90d3c30..0000000
--- a/ncurses-5.3/ncurses/base/lib_screen.c
+++ /dev/null
@@ -1,205 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998-2001,2002 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 *
- ****************************************************************************/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(WINDOW *)
-getwin(FILE * filep)
-{
- WINDOW tmp, *nwin;
- int n;
-
- T((T_CALLED("getwin(%p)"), filep));
-
- clearerr(filep);
- (void) fread(&tmp, sizeof(WINDOW), 1, filep);
- if (ferror(filep))
- returnWin(0);
-
- if (tmp._flags & _ISPAD) {
- nwin = newpad(tmp._maxy + 1, tmp._maxx + 1);
- } else {
- nwin = newwin(tmp._maxy + 1, tmp._maxx + 1, 0, 0);
- }
-
- /*
- * We deliberately do not restore the _parx, _pary, or _parent
- * fields, because the window hierarchy within which they
- * made sense is probably gone.
- */
- if (nwin != 0) {
- nwin->_curx = tmp._curx;
- nwin->_cury = tmp._cury;
- nwin->_maxy = tmp._maxy;
- nwin->_maxx = tmp._maxx;
- nwin->_begy = tmp._begy;
- nwin->_begx = tmp._begx;
- nwin->_yoffset = tmp._yoffset;
- nwin->_flags = tmp._flags & ~(_SUBWIN);
-
- nwin->_attrs = tmp._attrs;
- nwin->_nc_bkgd = tmp._nc_bkgd;
-
- nwin->_notimeout = tmp._notimeout;
- nwin->_clear = tmp._clear;
- nwin->_leaveok = tmp._leaveok;
- nwin->_idlok = tmp._idlok;
- nwin->_idcok = tmp._idcok;
- nwin->_immed = tmp._immed;
- nwin->_scroll = tmp._scroll;
- nwin->_sync = tmp._sync;
- nwin->_use_keypad = tmp._use_keypad;
- nwin->_delay = tmp._delay;
-
- nwin->_regtop = tmp._regtop;
- nwin->_regbottom = tmp._regbottom;
-
- if (tmp._flags & _ISPAD)
- nwin->_pad = tmp._pad;
-
- for (n = 0; n <= nwin->_maxy; n++) {
- clearerr(filep);
- (void) fread(nwin->_line[n].text,
- sizeof(NCURSES_CH_T),
- (size_t) (nwin->_maxx + 1),
- filep);
- if (ferror(filep)) {
- delwin(nwin);
- returnWin(0);
- }
- }
- touchwin(nwin);
- }
- returnWin(nwin);
-}
-
-NCURSES_EXPORT(int)
-putwin(WINDOW *win, FILE * filep)
-{
- int code = ERR;
- int n;
-
- T((T_CALLED("putwin(%p,%p)"), win, filep));
-
- if (win != 0) {
- size_t len = (win->_maxx + 1);
-
- clearerr(filep);
- if (fwrite(win, sizeof(WINDOW), 1, filep) != 1
- || ferror(filep))
- returnCode(code);
-
- for (n = 0; n <= win->_maxy; n++) {
- if (fwrite(win->_line[n].text,
- sizeof(NCURSES_CH_T), len, filep) != len
- || ferror(filep)) {
- returnCode(code);
- }
- }
- code = OK;
- }
- returnCode(code);
-}
-
-NCURSES_EXPORT(int)
-scr_restore(const char *file)
-{
- FILE *fp = 0;
-
- T((T_CALLED("scr_restore(%s)"), _nc_visbuf(file)));
-
- if (_nc_access(file, R_OK) < 0
- || (fp = fopen(file, "rb")) == 0) {
- returnCode(ERR);
- } else {
- delwin(newscr);
- SP->_newscr = newscr = getwin(fp);
- (void) fclose(fp);
- returnCode(OK);
- }
-}
-
-NCURSES_EXPORT(int)
-scr_dump(const char *file)
-{
- FILE *fp = 0;
-
- T((T_CALLED("scr_dump(%s)"), _nc_visbuf(file)));
-
- if (_nc_access(file, W_OK) < 0
- || (fp = fopen(file, "wb")) == 0) {
- returnCode(ERR);
- } else {
- (void) putwin(newscr, fp);
- (void) fclose(fp);
- returnCode(OK);
- }
-}
-
-NCURSES_EXPORT(int)
-scr_init(const char *file)
-{
- FILE *fp = 0;
-
- T((T_CALLED("scr_init(%s)"), _nc_visbuf(file)));
-
- if (exit_ca_mode && non_rev_rmcup)
- returnCode(ERR);
-
- if (_nc_access(file, R_OK) < 0
- || (fp = fopen(file, "rb")) == 0) {
- returnCode(ERR);
- } else {
- delwin(curscr);
- SP->_curscr = curscr = getwin(fp);
- (void) fclose(fp);
- returnCode(OK);
- }
-}
-
-NCURSES_EXPORT(int)
-scr_set(const char *file)
-{
- T((T_CALLED("scr_set(%s)"), _nc_visbuf(file)));
-
- if (scr_init(file) == ERR) {
- returnCode(ERR);
- } else {
- delwin(newscr);
- SP->_newscr = newscr = dupwin(curscr);
- returnCode(OK);
- }
-}
diff --git a/ncurses-5.3/ncurses/base/lib_scroll.c b/ncurses-5.3/ncurses/base/lib_scroll.c
deleted file mode 100644
index 324e637..0000000
--- a/ncurses-5.3/ncurses/base/lib_scroll.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/****************************************************************************
- * Copyright (c) 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: Thomas E. Dickey 1996-2001 *
- * and: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
- * and: Eric S. Raymond <esr@snark.thyrsus.com> *
- ****************************************************************************/
-
-/*
-** lib_scroll.c
-**
-** The routine wscrl(win, n).
-** positive n scroll the window up (ie. move lines down)
-** negative n scroll the window down (ie. move lines up)
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(void)
-_nc_scroll_window(WINDOW *win, int const n, NCURSES_SIZE_T const top,
- NCURSES_SIZE_T const bottom, NCURSES_CH_T blank)
-{
- int limit;
- int line;
- int j;
- size_t to_copy = (size_t) (sizeof(NCURSES_CH_T) * (win->_maxx + 1));
-
- TR(TRACE_MOVE, ("_nc_scroll_window(%p, %d, %d, %d)", win, n, top, bottom));
-
- if (top < 0
- || bottom < top
- || bottom > win->_maxy) {
- TR(TRACE_MOVE, ("nothing to scroll"));
- return;
- }
-
- /*
- * This used to do a line-text pointer-shuffle instead of text copies.
- * That (a) doesn't work when the window is derived and doesn't have
- * its own storage, (b) doesn't save you a lot on modern machines
- * anyway. Your typical memcpy implementations are coded in
- * assembler using a tight BLT loop; for the size of copies we're
- * talking here, the total execution time is dominated by the one-time
- * setup cost. So there is no point in trying to be excessively
- * clever -- esr.
- */
-
- /* shift n lines downwards */
- if (n < 0) {
- limit = top - n;
- if (limit > win->_maxy)
- limit = win->_maxy;
- for (line = bottom; line >= limit; line--) {
- if (line + n >= 0) {
- TR(TRACE_MOVE, ("...copying %d to %d", line + n, line));
- memcpy(win->_line[line].text,
- win->_line[line + n].text,
- to_copy);
- if_USE_SCROLL_HINTS(win->_line[line].oldindex =
- win->_line[line + n].oldindex);
- } else {
- TR(TRACE_MOVE, ("...filling %d", line));
- for (j = 0; j <= win->_maxx; j++)
- win->_line[line].text[j] = blank;
- if_USE_SCROLL_HINTS(win->_line[line].oldindex = _NEWINDEX);
- }
- }
- for (line = top; line < limit; line++) {
- TR(TRACE_MOVE, ("...filling %d", line));
- for (j = 0; j <= win->_maxx; j++)
- win->_line[line].text[j] = blank;
- if_USE_SCROLL_HINTS(win->_line[line].oldindex = _NEWINDEX);
- }
- }
-
- /* shift n lines upwards */
- if (n > 0) {
- limit = bottom - n;
- if (limit < 0)
- limit = 0;
- for (line = top; line <= limit; line++) {
- if (line + n <= win->_maxy) {
- TR(TRACE_MOVE, ("...copying %d to %d", line + n, line));
- memcpy(win->_line[line].text,
- win->_line[line + n].text,
- to_copy);
- if_USE_SCROLL_HINTS(win->_line[line].oldindex =
- win->_line[line + n].oldindex);
- } else {
- TR(TRACE_MOVE, ("...filling %d", line));
- for (j = 0; j <= win->_maxx; j++)
- win->_line[line].text[j] = blank;
- if_USE_SCROLL_HINTS(win->_line[line].oldindex = _NEWINDEX);
- }
- }
- for (line = bottom; line > limit; line--) {
- TR(TRACE_MOVE, ("...filling %d", line));
- for (j = 0; j <= win->_maxx; j++)
- win->_line[line].text[j] = blank;
- if_USE_SCROLL_HINTS(win->_line[line].oldindex = _NEWINDEX);
- }
- }
- touchline(win, top, bottom - top + 1);
-}
-
-NCURSES_EXPORT(int)
-wscrl(WINDOW *win, int n)
-{
- T((T_CALLED("wscrl(%p,%d)"), win, n));
-
- if (!win || !win->_scroll) {
- TR(TRACE_MOVE, ("...scrollok is false"));
- returnCode(ERR);
- }
-
- if (n == 0)
- returnCode(OK);
-
- _nc_scroll_window(win, n, win->_regtop, win->_regbottom, win->_nc_bkgd);
-
- _nc_synchook(win);
- returnCode(OK);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_scrollok.c b/ncurses-5.3/ncurses/base/lib_scrollok.c
deleted file mode 100644
index 125707a..0000000
--- a/ncurses-5.3/ncurses/base/lib_scrollok.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,2000 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> *
- ****************************************************************************/
-
-/*
-** lib_scrollok.c
-**
-** The routine scrollok.
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-scrollok(WINDOW *win, bool flag)
-{
- T((T_CALLED("scrollok(%p,%d)"), win, flag));
-
- if (win) {
- win->_scroll = flag;
- returnCode(OK);
- } else
- returnCode(ERR);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_scrreg.c b/ncurses-5.3/ncurses/base/lib_scrreg.c
deleted file mode 100644
index d9c699f..0000000
--- a/ncurses-5.3/ncurses/base/lib_scrreg.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,2000 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> *
- ****************************************************************************/
-
-/*
-** lib_scrreg.c
-**
-** The routine wsetscrreg().
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-wsetscrreg(WINDOW *win, int top, int bottom)
-{
- T((T_CALLED("wsetscrreg(%p,%d,%d)"), win, top, bottom));
-
- if (win &&
- top >= 0 && top <= win->_maxy &&
- bottom >= 0 && bottom <= win->_maxy &&
- bottom > top) {
- win->_regtop = (NCURSES_SIZE_T) top;
- win->_regbottom = (NCURSES_SIZE_T) bottom;
-
- returnCode(OK);
- } else
- returnCode(ERR);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_set_term.c b/ncurses-5.3/ncurses/base/lib_set_term.c
deleted file mode 100644
index 6942d06..0000000
--- a/ncurses-5.3/ncurses/base/lib_set_term.c
+++ /dev/null
@@ -1,479 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998-2001,2002 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> *
- ****************************************************************************/
-
-/*
-** lib_set_term.c
-**
-** The routine set_term().
-**
-*/
-
-#include <curses.priv.h>
-
-#include <term.h> /* cur_term */
-#include <tic.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(SCREEN *)
-set_term(SCREEN * screenp)
-{
- SCREEN *oldSP;
-
- T((T_CALLED("set_term(%p)"), screenp));
-
- oldSP = SP;
- _nc_set_screen(screenp);
-
- set_curterm(SP->_term);
- curscr = SP->_curscr;
- newscr = SP->_newscr;
- stdscr = SP->_stdscr;
- COLORS = SP->_color_count;
- COLOR_PAIRS = SP->_pair_count;
- memcpy(acs_map, SP->_acs_map, sizeof(SP->_acs_map[0]) * ACS_LEN);
-
- T((T_RETURN("%p"), oldSP));
- return (oldSP);
-}
-
-static void
-_nc_free_keytry(struct tries *kt)
-{
- if (kt != 0) {
- _nc_free_keytry(kt->child);
- _nc_free_keytry(kt->sibling);
- free(kt);
- }
-}
-
-/*
- * Free the storage associated with the given SCREEN sp.
- */
-NCURSES_EXPORT(void)
-delscreen(SCREEN * sp)
-{
- SCREEN **scan = &_nc_screen_chain;
-
- T((T_CALLED("delscreen(%p)"), sp));
-
- while (*scan) {
- if (*scan == sp) {
- *scan = sp->_next_screen;
- break;
- }
- scan = &(*scan)->_next_screen;
- }
-
- (void) _nc_freewin(sp->_curscr);
- (void) _nc_freewin(sp->_newscr);
- (void) _nc_freewin(sp->_stdscr);
-
- if (sp->_slk != 0) {
- FreeIfNeeded(sp->_slk->ent);
- FreeIfNeeded(sp->_slk->buffer);
- free(sp->_slk);
- sp->_slk = 0;
- }
-
- _nc_free_keytry(sp->_keytry);
- sp->_keytry = 0;
-
- _nc_free_keytry(sp->_key_ok);
- sp->_key_ok = 0;
-
- FreeIfNeeded(sp->_color_table);
- FreeIfNeeded(sp->_color_pairs);
-
- FreeIfNeeded(sp->oldhash);
- FreeIfNeeded(sp->newhash);
- FreeIfNeeded(sp->hashtab);
-
- del_curterm(sp->_term);
-
- /*
- * If the associated output stream has been closed, we can discard the
- * set-buffer. Limit the error check to EBADF, since fflush may fail
- * for other reasons than trying to operate upon a closed stream.
- */
- if (sp->_ofp != 0
- && sp->_setbuf != 0
- && fflush(sp->_ofp) != 0
- && errno == EBADF) {
- free(sp->_setbuf);
- }
-
- free(sp);
-
- /*
- * If this was the current screen, reset everything that the
- * application might try to use (except cur_term, which may have
- * multiple references in different screens).
- */
- if (sp == SP) {
- curscr = 0;
- newscr = 0;
- stdscr = 0;
- COLORS = 0;
- COLOR_PAIRS = 0;
- _nc_set_screen(0);
- }
- returnVoid;
-}
-
-static ripoff_t rippedoff[5];
-static ripoff_t *rsp = rippedoff;
-#define N_RIPS SIZEOF(SP->_rippedoff)
-
-static bool
-no_mouse_event(SCREEN * sp GCC_UNUSED)
-{
- return FALSE;
-}
-
-static bool
-no_mouse_inline(SCREEN * sp GCC_UNUSED)
-{
- return FALSE;
-}
-
-static bool
-no_mouse_parse(int code GCC_UNUSED)
-{
- return TRUE;
-}
-
-static void
-no_mouse_resume(SCREEN * sp GCC_UNUSED)
-{
-}
-
-static void
-no_mouse_wrap(SCREEN * sp GCC_UNUSED)
-{
-}
-
-#if NCURSES_EXT_FUNCS && USE_COLORFGBG
-static char *
-extract_fgbg(char *src, int *result)
-{
- char *dst = 0;
- long value = strtol(src, &dst, 0);
-
- if (dst == 0) {
- dst = src;
- } else if (value >= 0) {
- *result = value;
- }
- while (*dst != 0 && *dst != ';')
- dst++;
- if (*dst == ';')
- dst++;
- return dst;
-}
-#endif
-
-NCURSES_EXPORT(int)
-_nc_setupscreen(short slines, short const scolumns, FILE * output)
-/* OS-independent screen initializations */
-{
- int bottom_stolen = 0;
- size_t i;
-
- T((T_CALLED("_nc_setupscreen(%d, %d, %p)"), slines, scolumns, output));
- assert(SP == 0); /* has been reset in newterm() ! */
- if (!_nc_alloc_screen())
- returnCode(ERR);
-
- SP->_next_screen = _nc_screen_chain;
- _nc_screen_chain = SP;
-
- _nc_set_buffer(output, TRUE);
- SP->_term = cur_term;
- SP->_lines = slines;
- SP->_lines_avail = slines;
- SP->_columns = scolumns;
- SP->_cursrow = -1;
- SP->_curscol = -1;
- SP->_nl = TRUE;
- SP->_raw = FALSE;
- SP->_cbreak = 0;
- SP->_echo = TRUE;
- SP->_fifohead = -1;
- SP->_endwin = TRUE;
- SP->_ofp = output;
- SP->_cursor = -1; /* cannot know real cursor shape */
-
-#if NCURSES_NO_PADDING
- SP->_no_padding = getenv("NCURSES_NO_PADDING") != 0;
- TR(TRACE_CHARPUT | TRACE_MOVE, ("padding will%s be used",
- SP->_no_padding ? " not" : ""));
-#endif
-
-#if NCURSES_EXT_FUNCS
- SP->_default_color = FALSE;
- SP->_has_sgr_39_49 = FALSE;
-
- /*
- * Set our assumption of the terminal's default foreground and background
- * colors. The curs_color man-page states that we can assume that the
- * background is black. The origin of this assumption appears to be
- * terminals that displayed colored text, but no colored backgrounds, e.g.,
- * the first colored terminals around 1980. More recent ones with better
- * technology can display not only colored backgrounds, but all
- * combinations. So a terminal might be something other than "white" on
- * black (green/black looks monochrome too), but black on white or even
- * on ivory.
- *
- * White-on-black is the simplest thing to use for monochrome. Almost
- * all applications that use color paint both text and background, so
- * the distinction is moot. But a few do not - which is why we leave this
- * configurable (a better solution is to use assume_default_colors() for
- * the rare applications that do require that sort of appearance, since
- * is appears that more users expect to be able to make a white-on-black
- * or black-on-white display under control of the application than not).
- */
-#ifdef USE_ASSUMED_COLOR
- SP->_default_fg = COLOR_WHITE;
- SP->_default_bg = COLOR_BLACK;
-#else
- SP->_default_fg = C_MASK;
- SP->_default_bg = C_MASK;
-#endif
-
- /*
- * Allow those assumed/default color assumptions to be overridden at
- * runtime:
- */
- if (getenv("NCURSES_ASSUMED_COLORS") != 0) {
- char *p = getenv("NCURSES_ASSUMED_COLORS");
- int fg, bg;
- char sep1, sep2;
- int count = sscanf(p, "%d%c%d%c", &fg, &sep1, &bg, &sep2);
- if (count >= 1) {
- SP->_default_fg = (fg >= 0 && fg < max_colors) ? fg : C_MASK;
- if (count >= 3) {
- SP->_default_bg = (bg >= 0 && bg < max_colors) ? bg : C_MASK;
- }
- TR(TRACE_CHARPUT | TRACE_MOVE,
- ("from environment assumed fg=%d, bg=%d",
- SP->_default_fg,
- SP->_default_bg));
- }
- }
-#if USE_COLORFGBG
- /*
- * If rxvt's $COLORFGBG variable is set, use it to specify the assumed
- * default colors. Note that rxvt (mis)uses bold colors, equating a bold
- * color to that value plus 8. We'll only use the non-bold color for now -
- * decide later if it is worth having default attributes as well.
- */
- if (getenv("COLORFGBG") != 0) {
- char *p = getenv("COLORFGBG");
- TR(TRACE_CHARPUT | TRACE_MOVE, ("decoding COLORFGBG %s", p));
- p = extract_fgbg(p, &(SP->_default_fg));
- p = extract_fgbg(p, &(SP->_default_bg));
- if (*p) /* assume rxvt was compiled with xpm support */
- p = extract_fgbg(p, &(SP->_default_bg));
- TR(TRACE_CHARPUT | TRACE_MOVE, ("decoded fg=%d, bg=%d",
- SP->_default_fg, SP->_default_bg));
- if (SP->_default_fg >= max_colors) {
- if (set_a_foreground != ABSENT_STRING
- && !strcmp(set_a_foreground, "\033[3%p1%dm")) {
- set_a_foreground = "\033[3%?%p1%{8}%>%t9%e%p1%d%;m";
- } else {
- SP->_default_fg %= max_colors;
- }
- }
- if (SP->_default_bg >= max_colors) {
- if (set_a_background != ABSENT_STRING
- && !strcmp(set_a_background, "\033[4%p1%dm")) {
- set_a_background = "\033[4%?%p1%{8}%>%t9%e%p1%d%;m";
- } else {
- SP->_default_bg %= max_colors;
- }
- }
- }
-#endif
-#endif /* NCURSES_EXT_FUNCS */
-
- SP->_maxclick = DEFAULT_MAXCLICK;
- SP->_mouse_event = no_mouse_event;
- SP->_mouse_inline = no_mouse_inline;
- SP->_mouse_parse = no_mouse_parse;
- SP->_mouse_resume = no_mouse_resume;
- SP->_mouse_wrap = no_mouse_wrap;
- SP->_mouse_fd = -1;
-
- /* initialize the panel hooks */
- SP->_panelHook.top_panel = (struct panel *) 0;
- SP->_panelHook.bottom_panel = (struct panel *) 0;
- SP->_panelHook.stdscr_pseudo_panel = (struct panel *) 0;
-
- /*
- * If we've no magic cookie support, we suppress attributes that xmc
- * would affect, i.e., the attributes that affect the rendition of a
- * space. Note that this impacts the alternate character set mapping
- * as well.
- */
- if (magic_cookie_glitch > 0) {
-
- SP->_xmc_triggers = termattrs() & (
- A_ALTCHARSET |
- A_BLINK |
- A_BOLD |
- A_REVERSE |
- A_STANDOUT |
- A_UNDERLINE
- );
- SP->_xmc_suppress = SP->_xmc_triggers & (chtype) ~(A_BOLD);
-
- T(("magic cookie attributes %s", _traceattr(SP->_xmc_suppress)));
-#if USE_XMC_SUPPORT
- /*
- * To keep this simple, suppress all of the optimization hooks
- * except for clear_screen and the cursor addressing.
- */
- clr_eol = 0;
- clr_eos = 0;
- set_attributes = 0;
-#else
- magic_cookie_glitch = ABSENT_NUMERIC;
- acs_chars = 0;
-#endif
- }
-
- /* initialize normal acs before wide, since we use mapping in the latter */
- _nc_init_acs();
-#if USE_WIDEC_SUPPORT
- _nc_init_wacs();
-#endif
- memcpy(SP->_acs_map, acs_map, sizeof(chtype) * ACS_LEN);
-
- _nc_idcok = TRUE;
- _nc_idlok = FALSE;
-
- _nc_windows = 0; /* no windows yet */
-
- SP->oldhash = 0;
- SP->newhash = 0;
-
- T(("creating newscr"));
- if ((newscr = newwin(slines, scolumns, 0, 0)) == 0)
- returnCode(ERR);
-
- T(("creating curscr"));
- if ((curscr = newwin(slines, scolumns, 0, 0)) == 0)
- returnCode(ERR);
-
- SP->_newscr = newscr;
- SP->_curscr = curscr;
-#if USE_SIZECHANGE
- SP->_resize = resizeterm;
-#endif
-
- newscr->_clear = TRUE;
- curscr->_clear = FALSE;
-
- def_shell_mode();
- def_prog_mode();
-
- for (i = 0, rsp = rippedoff; rsp->line && (i < N_RIPS); rsp++, i++) {
- T(("ripping off line %d at %s", i, rsp->line < 0 ? "bottom" : "top"));
- SP->_rippedoff[i] = rippedoff[i];
- if (rsp->hook) {
- int count = (rsp->line < 0) ? -rsp->line : rsp->line;
-
- SP->_rippedoff[i].w = newwin(count,
- scolumns,
- ((rsp->line < 0)
- ? SP->_lines_avail - count
- : 0),
- 0);
- if (SP->_rippedoff[i].w != 0)
- SP->_rippedoff[i].hook(SP->_rippedoff[i].w, scolumns);
- else
- returnCode(ERR);
- if (rsp->line < 0)
- bottom_stolen += count;
- else
- SP->_topstolen += count;
- SP->_lines_avail -= count;
- }
- rsp->line = 0;
- }
- SP->_rip_count = i;
- /* reset the stack */
- rsp = rippedoff;
-
- T(("creating stdscr"));
- assert((SP->_lines_avail + SP->_topstolen + bottom_stolen) == slines);
- if ((stdscr = newwin(LINES = SP->_lines_avail, scolumns, 0, 0)) == 0)
- returnCode(ERR);
- SP->_stdscr = stdscr;
-
- returnCode(OK);
-}
-
-/* The internal implementation interprets line as the number of
- lines to rip off from the top or bottom.
- */
-NCURSES_EXPORT(int)
-_nc_ripoffline(int line, int (*init) (WINDOW *, int))
-{
- T((T_CALLED("_nc_ripoffline(%d, %p)"), line, init));
-
- if (line != 0) {
-
- if (rsp >= rippedoff + N_RIPS)
- returnCode(ERR);
-
- rsp->line = line;
- rsp->hook = init;
- rsp->w = 0;
- rsp++;
- }
-
- returnCode(OK);
-}
-
-NCURSES_EXPORT(int)
-ripoffline(int line, int (*init) (WINDOW *, int))
-{
- T((T_CALLED("ripoffline(%d,%p)"), line, init));
-
- if (line == 0)
- returnCode(OK);
-
- returnCode(_nc_ripoffline((line < 0) ? -1 : 1, init));
-}
diff --git a/ncurses-5.3/ncurses/base/lib_slk.c b/ncurses-5.3/ncurses/base/lib_slk.c
deleted file mode 100644
index e2fb0f5..0000000
--- a/ncurses-5.3/ncurses/base/lib_slk.c
+++ /dev/null
@@ -1,201 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998-2000,2002 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> *
- ****************************************************************************/
-
-/*
- * lib_slk.c
- * Soft key routines.
- */
-
-#include <curses.priv.h>
-
-#include <ctype.h>
-#include <term.h> /* num_labels, label_*, plab_norm */
-
-MODULE_ID("$Id$")
-
-/*
- * We'd like to move these into the screen context structure, but cannot,
- * because slk_init() is called before initscr()/newterm().
- */
-NCURSES_EXPORT_VAR(int)
-_nc_slk_format = 0; /* one more than format specified in slk_init() */
-
-/*
- * Paint the info line for the PC style SLK emulation.
- *
- */
-static void
-slk_paint_info(WINDOW *win)
-{
- if (win && SP->slk_format == 4) {
- int i;
-
- mvwhline(win, 0, 0, 0, getmaxx(win));
- wmove(win, 0, 0);
-
- for (i = 0; i < SP->_slk->maxlab; i++) {
- mvwprintw(win, 0, SP->_slk->ent[i].x, "F%d", i + 1);
- }
- }
-}
-
-/*
- * Initialize soft labels.
- * Called from newterm()
- */
-NCURSES_EXPORT(int)
-_nc_slk_initialize(WINDOW *stwin, int cols)
-{
- int i, x;
- int res = OK;
- char *p;
- unsigned max_length;
-
- T(("slk_initialize()"));
-
- if (SP->_slk) { /* we did this already, so simply return */
- return (OK);
- } else if ((SP->_slk = typeCalloc(SLK, 1)) == 0)
- return (ERR);
-
- SP->_slk->ent = NULL;
- SP->_slk->buffer = NULL;
- SP->_slk->attr = A_STANDOUT;
-
- SP->_slk->maxlab = ((num_labels > 0)
- ? num_labels
- : MAX_SKEY(_nc_slk_format));
- SP->_slk->maxlen = ((num_labels > 0)
- ? label_width * label_height
- : MAX_SKEY_LEN(_nc_slk_format));
- SP->_slk->labcnt = ((SP->_slk->maxlab < MAX_SKEY(_nc_slk_format))
- ? MAX_SKEY(_nc_slk_format)
- : SP->_slk->maxlab);
-
- if (SP->_slk->maxlen <= 0
- || SP->_slk->labcnt <= 0
- || (SP->_slk->ent = typeCalloc(slk_ent,
- (unsigned) SP->_slk->labcnt)) == NULL)
- goto exception;
-
- max_length = SP->_slk->maxlen;
- p = SP->_slk->buffer = (char *) calloc((unsigned) (2 * SP->_slk->labcnt),
- (1 + max_length));
- if (SP->_slk->buffer == NULL)
- goto exception;
-
- for (i = 0; i < SP->_slk->labcnt; i++) {
- SP->_slk->ent[i].text = p;
- p += (1 + max_length);
- SP->_slk->ent[i].form_text = p;
- p += (1 + max_length);
- memset(SP->_slk->ent[i].form_text, ' ', max_length);
- SP->_slk->ent[i].visible = (i < SP->_slk->maxlab);
- }
- if (_nc_slk_format >= 3) { /* PC style */
- int gap = (cols - 3 * (3 + 4 * max_length)) / 2;
-
- if (gap < 1)
- gap = 1;
-
- for (i = x = 0; i < SP->_slk->maxlab; i++) {
- SP->_slk->ent[i].x = x;
- x += max_length;
- x += (i == 3 || i == 7) ? gap : 1;
- }
- slk_paint_info(stwin);
- } else {
- if (_nc_slk_format == 2) { /* 4-4 */
- int gap = cols - (SP->_slk->maxlab * max_length) - 6;
-
- if (gap < 1)
- gap = 1;
- for (i = x = 0; i < SP->_slk->maxlab; i++) {
- SP->_slk->ent[i].x = x;
- x += max_length;
- x += (i == 3) ? gap : 1;
- }
- } else {
- if (_nc_slk_format == 1) { /* 1 -> 3-2-3 */
- int gap = (cols - (SP->_slk->maxlab * max_length) - 5)
- / 2;
-
- if (gap < 1)
- gap = 1;
- for (i = x = 0; i < SP->_slk->maxlab; i++) {
- SP->_slk->ent[i].x = x;
- x += max_length;
- x += (i == 2 || i == 4) ? gap : 1;
- }
- } else
- goto exception;
- }
- }
- SP->_slk->dirty = TRUE;
- if ((SP->_slk->win = stwin) == NULL) {
- exception:
- if (SP->_slk) {
- FreeIfNeeded(SP->_slk->buffer);
- FreeIfNeeded(SP->_slk->ent);
- free(SP->_slk);
- SP->_slk = (SLK *) 0;
- res = (ERR);
- }
- }
-
- /* We now reset the format so that the next newterm has again
- * per default no SLK keys and may call slk_init again to
- * define a new layout. (juergen 03-Mar-1999)
- */
- SP->slk_format = _nc_slk_format;
- _nc_slk_format = 0;
- return (res);
-}
-
-/*
- * Restore the soft labels on the screen.
- */
-NCURSES_EXPORT(int)
-slk_restore(void)
-{
- T((T_CALLED("slk_restore()")));
-
- if (SP->_slk == NULL)
- return (ERR);
- SP->_slk->hidden = FALSE;
- SP->_slk->dirty = TRUE;
- /* we have to repaint info line eventually */
- slk_paint_info(SP->_slk->win);
-
- returnCode(slk_refresh());
-}
diff --git a/ncurses-5.3/ncurses/base/lib_slkatr_set.c b/ncurses-5.3/ncurses/base/lib_slkatr_set.c
deleted file mode 100644
index 45c366d..0000000
--- a/ncurses-5.3/ncurses/base/lib_slkatr_set.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,2000 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, 1998 *
- * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en *
- ****************************************************************************/
-
-/*
- * lib_slkatr_set.c
- * Soft key routines.
- * Set the labels attributes
- */
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-slk_attr_set
-(const attr_t attr, short color_pair_number, void *opts)
-{
- T((T_CALLED("slk_attr_set(%s,%d)"), _traceattr(attr), color_pair_number));
-
- if (SP != 0 && SP->_slk != 0 && !opts &&
- color_pair_number >= 0 && color_pair_number < COLOR_PAIRS) {
- SP->_slk->attr = attr;
- toggle_attr_on(SP->_slk->attr, COLOR_PAIR(color_pair_number));
- returnCode(OK);
- } else
- returnCode(ERR);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_slkatrof.c b/ncurses-5.3/ncurses/base/lib_slkatrof.c
deleted file mode 100644
index 507a5ec..0000000
--- a/ncurses-5.3/ncurses/base/lib_slkatrof.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,2000 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> *
- ****************************************************************************/
-
-/*
- * lib_slkatrof.c
- * Soft key routines.
- * Switch off labels attributes
- */
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-slk_attroff(const chtype attr)
-{
- T((T_CALLED("slk_attroff(%s)"), _traceattr(attr)));
-
- if (SP != 0 && SP->_slk != 0) {
- toggle_attr_off(SP->_slk->attr, attr);
- returnCode(OK);
- } else
- returnCode(ERR);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_slkatron.c b/ncurses-5.3/ncurses/base/lib_slkatron.c
deleted file mode 100644
index 23bd3ad..0000000
--- a/ncurses-5.3/ncurses/base/lib_slkatron.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,2000 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> *
- ****************************************************************************/
-
-/*
- * lib_slkatron.c
- * Soft key routines.
- * Switch on labels attributes
- */
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-slk_attron(const chtype attr)
-{
- T((T_CALLED("slk_attron(%s)"), _traceattr(attr)));
-
- if (SP != 0 && SP->_slk != 0) {
- toggle_attr_on(SP->_slk->attr, attr);
- returnCode(OK);
- } else
- returnCode(ERR);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_slkatrset.c b/ncurses-5.3/ncurses/base/lib_slkatrset.c
deleted file mode 100644
index 3823111..0000000
--- a/ncurses-5.3/ncurses/base/lib_slkatrset.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,2000 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> *
- ****************************************************************************/
-
-/*
- * lib_slkatrset.c
- * Soft key routines.
- * Set the labels attributes
- */
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-slk_attrset(const chtype attr)
-{
- T((T_CALLED("slk_attrset(%s)"), _traceattr(attr)));
-
- if (SP != 0 && SP->_slk != 0) {
- SP->_slk->attr = attr;
- returnCode(OK);
- } else
- returnCode(ERR);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_slkattr.c b/ncurses-5.3/ncurses/base/lib_slkattr.c
deleted file mode 100644
index fa3c549..0000000
--- a/ncurses-5.3/ncurses/base/lib_slkattr.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,2000 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> *
- ****************************************************************************/
-
-/*
- * lib_slkattr.c
- * Soft key routines.
- * Fetch the labels attributes
- */
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(attr_t)
-slk_attr(void)
-{
- T((T_CALLED("slk_attr()")));
-
- if (SP != 0 && SP->_slk != 0) {
- returnAttr(SP->_slk->attr);
- } else
- returnAttr(0);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_slkclear.c b/ncurses-5.3/ncurses/base/lib_slkclear.c
deleted file mode 100644
index ddf10b7..0000000
--- a/ncurses-5.3/ncurses/base/lib_slkclear.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
- * Copyright (c) 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> *
- ****************************************************************************/
-
-/*
- * lib_slkclear.c
- * Soft key routines.
- * Remove soft labels from the screen.
- */
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-slk_clear(void)
-{
- T((T_CALLED("slk_clear()")));
-
- if (SP == NULL || SP->_slk == NULL)
- returnCode(ERR);
- SP->_slk->hidden = TRUE;
- /* For simulated SLK's it's looks much more natural to
- inherit those attributes from the standard screen */
- SP->_slk->win->_nc_bkgd = stdscr->_nc_bkgd;
- SP->_slk->win->_attrs = stdscr->_attrs;
- if (SP->_slk->win == stdscr) {
- returnCode(OK);
- } else {
- werase(SP->_slk->win);
- returnCode(wrefresh(SP->_slk->win));
- }
-}
diff --git a/ncurses-5.3/ncurses/base/lib_slkcolor.c b/ncurses-5.3/ncurses/base/lib_slkcolor.c
deleted file mode 100644
index d485111..0000000
--- a/ncurses-5.3/ncurses/base/lib_slkcolor.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,2000 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, 1998 *
- * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en *
- ****************************************************************************/
-
-/*
- * lib_slkcolor.c
- */
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-slk_color(short color_pair_number)
-{
- T((T_CALLED("slk_color(%d)"), color_pair_number));
-
- if (SP != 0 && SP->_slk != 0 &&
- color_pair_number >= 0 && color_pair_number < COLOR_PAIRS) {
- T(("... current %ld", (long) PAIR_NUMBER(SP->_slk->attr)));
- toggle_attr_on(SP->_slk->attr, COLOR_PAIR(color_pair_number));
- returnCode(OK);
- } else
- returnCode(ERR);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_slkinit.c b/ncurses-5.3/ncurses/base/lib_slkinit.c
deleted file mode 100644
index cec5166..0000000
--- a/ncurses-5.3/ncurses/base/lib_slkinit.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,2000 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> *
- ****************************************************************************/
-
-/*
- * lib_slkinit.c
- * Soft key routines.
- * Initialize soft labels. Called by the user before initscr().
- */
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-slk_init(int format)
-{
- T((T_CALLED("slk_init(%d)"), format));
- if (format < 0 || format > 3)
- returnCode(ERR);
- _nc_slk_format = 1 + format;
- returnCode(OK);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_slklab.c b/ncurses-5.3/ncurses/base/lib_slklab.c
deleted file mode 100644
index 85a300d..0000000
--- a/ncurses-5.3/ncurses/base/lib_slklab.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,2000 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> *
- ****************************************************************************/
-
-/*
- * lib_slklab.c
- * Soft key routines.
- * Fetch the label text.
- */
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(char *)
-slk_label(int n)
-{
- T((T_CALLED("slk_label(%d)"), n));
-
- if (SP == NULL || SP->_slk == NULL || n < 1 || n > SP->_slk->labcnt)
- returnPtr(0);
- returnPtr(SP->_slk->ent[n - 1].text);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_slkrefr.c b/ncurses-5.3/ncurses/base/lib_slkrefr.c
deleted file mode 100644
index 5a55172..0000000
--- a/ncurses-5.3/ncurses/base/lib_slkrefr.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,2000 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> *
- ****************************************************************************/
-
-/*
- * lib_slkrefr.c
- * Write SLK window to the (virtual) screen.
- */
-#include <curses.priv.h>
-#include <term.h> /* num_labels, label_*, plab_norm */
-
-MODULE_ID("$Id$")
-
-/*
- * Write the soft labels to the soft-key window.
- */
-static void
-slk_intern_refresh(SLK * slk)
-{
- int i;
- int fmt = SP->slk_format;
-
- for (i = 0; i < slk->labcnt; i++) {
- if (slk->dirty || slk->ent[i].dirty) {
- if (slk->ent[i].visible) {
- if (num_labels > 0 && SLK_STDFMT(fmt)) {
- if (i < num_labels) {
- TPUTS_TRACE("plab_norm");
- putp(tparm(plab_norm, i + 1, slk->ent[i].form_text));
- }
- } else {
- wmove(slk->win, SLK_LINES(fmt) - 1, slk->ent[i].x);
- if (SP && SP->_slk)
- wattrset(slk->win, SP->_slk->attr);
- waddnstr(slk->win, slk->ent[i].form_text,
- MAX_SKEY_LEN(fmt));
- /* if we simulate SLK's, it's looking much more
- natural to use the current ATTRIBUTE also
- for the label window */
- wattrset(slk->win, stdscr->_attrs);
- }
- }
- slk->ent[i].dirty = FALSE;
- }
- }
- slk->dirty = FALSE;
-
- if (num_labels > 0) {
- if (slk->hidden) {
- TPUTS_TRACE("label_off");
- putp(label_off);
- } else {
- TPUTS_TRACE("label_on");
- putp(label_on);
- }
- }
-}
-
-/*
- * Refresh the soft labels.
- */
-NCURSES_EXPORT(int)
-slk_noutrefresh(void)
-{
- T((T_CALLED("slk_noutrefresh()")));
-
- if (SP == NULL || SP->_slk == NULL)
- returnCode(ERR);
- if (SP->_slk->hidden)
- returnCode(OK);
- slk_intern_refresh(SP->_slk);
-
- returnCode(wnoutrefresh(SP->_slk->win));
-}
-
-/*
- * Refresh the soft labels.
- */
-NCURSES_EXPORT(int)
-slk_refresh(void)
-{
- T((T_CALLED("slk_refresh()")));
-
- if (SP == NULL || SP->_slk == NULL)
- returnCode(ERR);
- if (SP->_slk->hidden)
- returnCode(OK);
- slk_intern_refresh(SP->_slk);
-
- returnCode(wrefresh(SP->_slk->win));
-}
diff --git a/ncurses-5.3/ncurses/base/lib_slkset.c b/ncurses-5.3/ncurses/base/lib_slkset.c
deleted file mode 100644
index 6faf562..0000000
--- a/ncurses-5.3/ncurses/base/lib_slkset.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/****************************************************************************
- * Copyright (c) 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> *
- ****************************************************************************/
-
-/*
- * lib_slkset.c
- * Set soft label text.
- */
-#include <curses.priv.h>
-#include <ctype.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-slk_set(int i, const char *astr, int format)
-{
- SLK *slk = SP->_slk;
- size_t len;
- const char *str = astr;
- const char *p;
-
- T((T_CALLED("slk_set(%d, \"%s\", %d)"), i, str, format));
-
- if (slk == NULL || i < 1 || i > slk->labcnt || format < 0 || format > 2)
- returnCode(ERR);
- if (str == NULL)
- str = "";
-
- while (isspace(UChar(*str)))
- str++; /* skip over leading spaces */
- p = str;
- while (isprint(UChar(*p)))
- p++; /* The first non-print stops */
-
- --i; /* Adjust numbering of labels */
-
- len = (size_t) (p - str);
- if (len > (unsigned) slk->maxlen)
- len = slk->maxlen;
- if (len == 0)
- slk->ent[i].text[0] = 0;
- else
- (void) strncpy(slk->ent[i].text, str, len);
- memset(slk->ent[i].form_text, ' ', (unsigned) slk->maxlen);
- slk->ent[i].text[slk->maxlen] = 0;
- /* len = strlen(slk->ent[i].text); */
-
- switch (format) {
- case 0: /* left-justified */
- memcpy(slk->ent[i].form_text,
- slk->ent[i].text,
- len);
- break;
- case 1: /* centered */
- memcpy(slk->ent[i].form_text + (slk->maxlen - len) / 2,
- slk->ent[i].text,
- len);
- break;
- case 2: /* right-justified */
- memcpy(slk->ent[i].form_text + slk->maxlen - len,
- slk->ent[i].text,
- len);
- break;
- }
- slk->ent[i].form_text[slk->maxlen] = 0;
- slk->ent[i].dirty = TRUE;
- returnCode(OK);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_slktouch.c b/ncurses-5.3/ncurses/base/lib_slktouch.c
deleted file mode 100644
index b4875d7..0000000
--- a/ncurses-5.3/ncurses/base/lib_slktouch.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,2000 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> *
- ****************************************************************************/
-
-/*
- * lib_slktouch.c
- * Soft key routines.
- * Force the code to believe that the soft keys have been changed.
- */
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-slk_touch(void)
-{
- T((T_CALLED("slk_touch()")));
-
- if (SP == NULL || SP->_slk == NULL)
- returnCode(ERR);
- SP->_slk->dirty = TRUE;
-
- returnCode(OK);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_touch.c b/ncurses-5.3/ncurses/base/lib_touch.c
deleted file mode 100644
index ba1b4e2..0000000
--- a/ncurses-5.3/ncurses/base/lib_touch.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,2000 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> *
- ****************************************************************************/
-
-/*
-** lib_touch.c
-**
-** The routines untouchwin(),
-** wtouchln(),
-** is_linetouched()
-** is_wintouched().
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(bool)
-is_linetouched(WINDOW *win, int line)
-{
- T((T_CALLED("is_linetouched(%p,%d)"), win, line));
-
- /* XSI doesn't define any error */
- if (!win || (line > win->_maxy) || (line < 0))
- returnCode((bool) ERR);
-
- returnCode(win->_line[line].firstchar != _NOCHANGE ? TRUE : FALSE);
-}
-
-NCURSES_EXPORT(bool)
-is_wintouched(WINDOW *win)
-{
- int i;
-
- T((T_CALLED("is_wintouched(%p)"), win));
-
- if (win)
- for (i = 0; i <= win->_maxy; i++)
- if (win->_line[i].firstchar != _NOCHANGE)
- returnCode(TRUE);
- returnCode(FALSE);
-}
-
-NCURSES_EXPORT(int)
-wtouchln(WINDOW *win, int y, int n, int changed)
-{
- int i;
-
- T((T_CALLED("wtouchln(%p,%d,%d,%d)"), win, y, n, changed));
-
- if (!win || (n < 0) || (y < 0) || (y > win->_maxy))
- returnCode(ERR);
-
- for (i = y; i < y + n; i++) {
- if (i > win->_maxy)
- break;
- win->_line[i].firstchar = changed ? 0 : _NOCHANGE;
- win->_line[i].lastchar = changed ? win->_maxx : _NOCHANGE;
- }
- returnCode(OK);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_ungetch.c b/ncurses-5.3/ncurses/base/lib_ungetch.c
deleted file mode 100644
index 72c6a8a..0000000
--- a/ncurses-5.3/ncurses/base/lib_ungetch.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998-2001,2002 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> *
- ****************************************************************************/
-
-/*
-** lib_ungetch.c
-**
-** The routine ungetch().
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-#include <fifo_defs.h>
-
-#ifdef TRACE
-NCURSES_EXPORT(void)
-_nc_fifo_dump(void)
-{
- int i;
- T(("head = %d, tail = %d, peek = %d", head, tail, peek));
- for (i = 0; i < 10; i++)
- T(("char %d = %s", i, _tracechar(SP->_fifo[i])));
-}
-#endif /* TRACE */
-
-NCURSES_EXPORT(int)
-ungetch(int ch)
-{
- T((T_CALLED("ungetch(%s)"), _tracechar(ch)));
-
- if (tail == -1)
- returnCode(ERR);
- if (head == -1) {
- head = 0;
- t_inc()
- peek = tail; /* no raw keys */
- } else
- h_dec();
-
- SP->_fifo[head] = ch;
- T(("ungetch %s ok", _tracechar(ch)));
-#ifdef TRACE
- if (_nc_tracing & TRACE_IEVENT)
- _nc_fifo_dump();
-#endif
- returnCode(OK);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_vline.c b/ncurses-5.3/ncurses/base/lib_vline.c
deleted file mode 100644
index 9a57266..0000000
--- a/ncurses-5.3/ncurses/base/lib_vline.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,1999,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> *
- ****************************************************************************/
-
-/*
-** lib_vline.c
-**
-** The routine wvline().
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-wvline(WINDOW *win, chtype ch, int n)
-{
- int code = ERR;
- NCURSES_SIZE_T row, col;
- NCURSES_SIZE_T end;
-
- T((T_CALLED("wvline(%p,%s,%d)"), win, _tracechtype(ch), n));
-
- if (win) {
- NCURSES_CH_T wch;
- row = win->_cury;
- col = win->_curx;
- end = row + n - 1;
- if (end > win->_maxy)
- end = win->_maxy;
-
- if (ch == 0)
- SetChar(wch, ChCharOf(ACS_VLINE), ChAttrOf(ACS_VLINE));
- else
- SetChar(wch, ChCharOf(ch), ChAttrOf(ch));
- wch = _nc_render(win, wch);
-
- while (end >= row) {
- struct ldat *line = &(win->_line[end]);
- line->text[col] = wch;
- CHANGED_CELL(line, col);
- end--;
- }
-
- _nc_synchook(win);
- code = OK;
- }
- returnCode(code);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_wattroff.c b/ncurses-5.3/ncurses/base/lib_wattroff.c
deleted file mode 100644
index 909efa4..0000000
--- a/ncurses-5.3/ncurses/base/lib_wattroff.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,2000 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> *
- ****************************************************************************/
-
-/*
-** lib_wattroff.c
-**
-** The routine wattr_off().
-**
-*/
-
-#include <curses.priv.h>
-#include <ctype.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-wattr_off(WINDOW *win, attr_t at, void *opts GCC_UNUSED)
-{
- T((T_CALLED("wattr_off(%p,%s)"), win, _traceattr(at)));
- if (win) {
- T(("... current %s", _traceattr(win->_attrs)));
- toggle_attr_off(win->_attrs, at);
- returnCode(OK);
- } else
- returnCode(ERR);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_wattron.c b/ncurses-5.3/ncurses/base/lib_wattron.c
deleted file mode 100644
index bfc42ad..0000000
--- a/ncurses-5.3/ncurses/base/lib_wattron.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,2000 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> *
- ****************************************************************************/
-
-/*
-** lib_wattron.c
-**
-** The routines wattr_on().
-**
-*/
-
-#include <curses.priv.h>
-#include <ctype.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-wattr_on(WINDOW *win, attr_t at, void *opts GCC_UNUSED)
-{
- T((T_CALLED("wattr_on(%p,%s)"), win, _traceattr(at)));
- if (win) {
- T(("... current %s", _traceattr(win->_attrs)));
- toggle_attr_on(win->_attrs, at);
- returnCode(OK);
- } else
- returnCode(ERR);
-}
diff --git a/ncurses-5.3/ncurses/base/lib_winch.c b/ncurses-5.3/ncurses/base/lib_winch.c
deleted file mode 100644
index 96af782..0000000
--- a/ncurses-5.3/ncurses/base/lib_winch.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
- * Copyright (c) 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: Thomas E. Dickey <dickey@clark.net> 1998 *
- ****************************************************************************/
-
-/*
-** lib_winch.c
-**
-** The routine winch().
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(chtype)
-winch(WINDOW *win)
-{
- T((T_CALLED("winch(%p)"), win));
- if (win != 0) {
- returnChar(CharOf(win->_line[win->_cury].text[win->_curx]) |
- AttrOf(win->_line[win->_cury].text[win->_curx]));
- } else {
- returnChar(0);
- }
-}
diff --git a/ncurses-5.3/ncurses/base/lib_window.c b/ncurses-5.3/ncurses/base/lib_window.c
deleted file mode 100644
index f2c437c..0000000
--- a/ncurses-5.3/ncurses/base/lib_window.c
+++ /dev/null
@@ -1,248 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998-2001,2002 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> *
- ****************************************************************************/
-
-/*
-** lib_window.c
-**
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(void)
-_nc_synchook(WINDOW *win)
-/* hook to be called after each window change */
-{
- if (win->_immed)
- wrefresh(win);
- if (win->_sync)
- wsyncup(win);
-}
-
-NCURSES_EXPORT(int)
-mvderwin(WINDOW *win, int y, int x)
-/* move a derived window */
-{
- WINDOW *orig;
- int i;
-
- T((T_CALLED("mvderwin(%p,%d,%d)"), win, y, x));
-
- if (win && (orig = win->_parent)) {
- if (win->_parx == x && win->_pary == y)
- returnCode(OK);
- if (x < 0 || y < 0)
- returnCode(ERR);
- if ((x + getmaxx(win) > getmaxx(orig)) ||
- (y + getmaxy(win) > getmaxy(orig)))
- returnCode(ERR);
- } else
- returnCode(ERR);
- wsyncup(win);
- win->_parx = x;
- win->_pary = y;
- for (i = 0; i < getmaxy(win); i++)
- win->_line[i].text = &(orig->_line[y++].text[x]);
- returnCode(OK);
-}
-
-NCURSES_EXPORT(int)
-syncok(WINDOW *win, bool bf)
-/* enable/disable automatic wsyncup() on each change to window */
-{
- T((T_CALLED("syncok(%p,%d)"), win, bf));
-
- if (win) {
- win->_sync = bf;
- returnCode(OK);
- } else
- returnCode(ERR);
-}
-
-NCURSES_EXPORT(void)
-wsyncup(WINDOW *win)
-/* mark changed every cell in win's ancestors that is changed in win */
-/* Rewritten by J. Pfeifer, 1-Apr-96 (don't even think that...) */
-{
- WINDOW *wp;
-
- T((T_CALLED("wsyncup(%p)"), win));
- if (win && win->_parent) {
- for (wp = win; wp->_parent; wp = wp->_parent) {
- int y;
- WINDOW *pp = wp->_parent;
-
- assert((wp->_pary <= pp->_maxy) &&
- ((wp->_pary + wp->_maxy) <= pp->_maxy));
-
- for (y = 0; y <= wp->_maxy; y++) {
- int left = wp->_line[y].firstchar;
- if (left >= 0) { /* line is touched */
- struct ldat *line = &(pp->_line[wp->_pary + y]);
- /* left & right character in parent window coordinates */
- int right = wp->_line[y].lastchar + wp->_parx;
- left += wp->_parx;
-
- CHANGED_RANGE(line, left, right);
- }
- }
- }
- }
- returnVoid;
-}
-
-NCURSES_EXPORT(void)
-wsyncdown(WINDOW *win)
-/* mark changed every cell in win that is changed in any of its ancestors */
-/* Rewritten by J. Pfeifer, 1-Apr-96 (don't even think that...) */
-{
- T((T_CALLED("wsyncdown(%p)"), win));
-
- if (win && win->_parent) {
- WINDOW *pp = win->_parent;
- int y;
-
- /* This recursion guarantees, that the changes are propagated down-
- wards from the root to our direct parent. */
- wsyncdown(pp);
-
- /* and now we only have to propagate the changes from our direct
- parent, if there are any. */
- assert((win->_pary <= pp->_maxy) &&
- ((win->_pary + win->_maxy) <= pp->_maxy));
-
- for (y = 0; y <= win->_maxy; y++) {
- if (pp->_line[win->_pary + y].firstchar >= 0) { /* parent changed */
- struct ldat *line = &(win->_line[y]);
- /* left and right character in child coordinates */
- int left = pp->_line[win->_pary + y].firstchar - win->_parx;
- int right = pp->_line[win->_pary + y].lastchar - win->_parx;
- /* The change maybe outside the childs range */
- if (left < 0)
- left = 0;
- if (right > win->_maxx)
- right = win->_maxx;
- CHANGED_RANGE(line, left, right);
- }
- }
- }
- returnVoid;
-}
-
-NCURSES_EXPORT(void)
-wcursyncup(WINDOW *win)
-/* sync the cursor in all derived windows to its value in the base window */
-{
- WINDOW *wp;
-
- T((T_CALLED("wcursyncup(%p)"), win));
- for (wp = win; wp && wp->_parent; wp = wp->_parent) {
- wmove(wp->_parent, wp->_pary + wp->_cury, wp->_parx + wp->_curx);
- }
- returnVoid;
-}
-
-NCURSES_EXPORT(WINDOW *)
-dupwin(WINDOW *win)
-/* make an exact duplicate of the given window */
-{
- WINDOW *nwin = 0;
- size_t linesize;
- int i;
-
- T((T_CALLED("dupwin(%p)"), win));
-
- if (win != 0) {
-
- if (win->_flags & _ISPAD) {
- nwin = newpad(win->_maxy + 1,
- win->_maxx + 1);
- } else {
- nwin = newwin(win->_maxy + 1,
- win->_maxx + 1,
- win->_begy,
- win->_begx);
- }
-
- if (nwin != 0) {
-
- nwin->_curx = win->_curx;
- nwin->_cury = win->_cury;
- nwin->_maxy = win->_maxy;
- nwin->_maxx = win->_maxx;
- nwin->_begy = win->_begy;
- nwin->_begx = win->_begx;
- nwin->_yoffset = win->_yoffset;
-
- nwin->_flags = win->_flags & ~_SUBWIN;
- /* Due to the use of newwin(), the clone is not a subwindow.
- * The text is really copied into the clone.
- */
-
- nwin->_attrs = win->_attrs;
- nwin->_nc_bkgd = win->_nc_bkgd;
-
- nwin->_notimeout = win->_notimeout;
- nwin->_clear = win->_clear;
- nwin->_leaveok = win->_leaveok;
- nwin->_scroll = win->_scroll;
- nwin->_idlok = win->_idlok;
- nwin->_idcok = win->_idcok;
- nwin->_immed = win->_immed;
- nwin->_sync = win->_sync;
- nwin->_use_keypad = win->_use_keypad;
- nwin->_delay = win->_delay;
-
- nwin->_parx = 0;
- nwin->_pary = 0;
- nwin->_parent = (WINDOW *) 0;
- /* See above: the clone isn't a subwindow! */
-
- nwin->_regtop = win->_regtop;
- nwin->_regbottom = win->_regbottom;
-
- if (win->_flags & _ISPAD)
- nwin->_pad = win->_pad;
-
- linesize = (win->_maxx + 1) * sizeof(NCURSES_CH_T);
- for (i = 0; i <= nwin->_maxy; i++) {
- memcpy(nwin->_line[i].text, win->_line[i].text, linesize);
- nwin->_line[i].firstchar = win->_line[i].firstchar;
- nwin->_line[i].lastchar = win->_line[i].lastchar;
- }
- }
- }
- returnWin(nwin);
-}
diff --git a/ncurses-5.3/ncurses/base/memmove.c b/ncurses-5.3/ncurses/base/memmove.c
deleted file mode 100644
index 9f9181a..0000000
--- a/ncurses-5.3/ncurses/base/memmove.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,2000 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. *
- ****************************************************************************/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-/****************************************************************************
- * Author: Thomas E. Dickey <dickey@clark.net> 1998 *
- ****************************************************************************/
-
-#if USE_MY_MEMMOVE
-#define DST ((char *)s1)
-#define SRC ((const char *)s2)
-NCURSES_EXPORT(void *)
-_nc_memmove(void *s1, const void *s2, size_t n)
-{
- if (n != 0) {
- if ((DST + n > SRC) && (SRC + n > DST)) {
- static char *bfr;
- static size_t length;
- register size_t j;
- if (length < n) {
- length = (n * 3) / 2;
- bfr = typeRealloc(char, length, bfr);
- }
- for (j = 0; j < n; j++)
- bfr[j] = SRC[j];
- SRC = bfr;
- }
- while (n-- != 0)
- DST[n] = SRC[n];
- }
- return s1;
-}
-#else
-extern
-NCURSES_EXPORT(void)
-_nc_memmove(void); /* quiet's gcc warning */
-NCURSES_EXPORT(void)
-_nc_memmove(void)
-{
-} /* nonempty for strict ANSI compilers */
-#endif /* USE_MY_MEMMOVE */
diff --git a/ncurses-5.3/ncurses/base/nc_panel.c b/ncurses-5.3/ncurses/base/nc_panel.c
deleted file mode 100644
index 6bacbb5..0000000
--- a/ncurses-5.3/ncurses/base/nc_panel.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,2000 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 <dickey@clark.net> 1997 *
- ****************************************************************************/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(struct panelhook *)
-_nc_panelhook(void)
-{
- return (SP ? &(SP->_panelHook) : NULL);
-}
diff --git a/ncurses-5.3/ncurses/base/resizeterm.c b/ncurses-5.3/ncurses/base/resizeterm.c
deleted file mode 100644
index 0d2f6a7..0000000
--- a/ncurses-5.3/ncurses/base/resizeterm.c
+++ /dev/null
@@ -1,288 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998-2001,2002 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 *
- ****************************************************************************/
-
-/*
- * This is an extension to the curses library. It provides callers with a hook
- * into the NCURSES data to resize windows, primarily for use by programs
- * running in an X Window terminal (e.g., xterm). I abstracted this module
- * from my application library for NCURSES because it must be compiled with
- * the private data structures -- T.Dickey 1995/7/4.
- */
-
-#include <curses.priv.h>
-#include <term.h>
-
-MODULE_ID("$Id$")
-
-#define stolen_lines (screen_lines - SP->_lines_avail)
-
-NCURSES_EXPORT(bool)
-is_term_resized(int ToLines, int ToCols)
-{
- return (ToLines != screen_lines
- || ToCols != screen_columns);
-}
-
-/*
- * Return the number of levels of child-windows under the current window.
- */
-static int
-child_depth(WINDOW *cmp)
-{
- int depth = 0;
-
- if (cmp != 0) {
- WINDOWLIST *wp;
-
- for (wp = _nc_windows; wp != 0; wp = wp->next) {
- WINDOW *tst = &(wp->win);
- if (tst->_parent == cmp) {
- depth = 1 + child_depth(tst);
- break;
- }
- }
- }
- return depth;
-}
-
-/*
- * Return the number of levels of parent-windows above the current window.
- */
-static int
-parent_depth(WINDOW *cmp)
-{
- int depth = 0;
-
- if (cmp != 0) {
- WINDOW *tst;
- while ((tst = cmp->_parent) != 0) {
- ++depth;
- cmp = tst;
- }
- }
- return depth;
-}
-
-/*
- * FIXME: must adjust position so it's within the parent!
- */
-static int
-adjust_window(WINDOW *win, int ToLines, int ToCols, int stolen)
-{
- int result;
- int bottom = screen_lines + SP->_topstolen - stolen;
- int myLines = win->_maxy + 1;
- int myCols = win->_maxx + 1;
-
- T((T_CALLED("adjust_window(%p,%d,%d) currently %dx%d at %d,%d"),
- win, ToLines, ToCols,
- getmaxy(win), getmaxx(win),
- getbegy(win), getbegx(win)));
-
- if (win->_begy >= bottom) {
- win->_begy += (ToLines - screen_lines);
- } else {
- if (myLines == screen_lines - stolen
- && ToLines != screen_lines)
- myLines = ToLines - stolen;
- else if (myLines == screen_lines
- && ToLines != screen_lines)
- myLines = ToLines;
- }
-
- if (myLines > ToLines)
- myLines = ToLines;
-
- if (myCols > ToCols)
- myCols = ToCols;
-
- if (myLines == screen_lines
- && ToLines != screen_lines)
- myCols = ToLines;
-
- if (myCols == screen_columns
- && ToCols != screen_columns)
- myCols = ToCols;
-
- result = wresize(win, myLines, myCols);
- returnCode(result);
-}
-
-/*
- * If we're decreasing size, recursively search for windows that have no
- * children, decrease those to fit, then decrease the containing window, etc.
- */
-static int
-decrease_size(int ToLines, int ToCols, int stolen)
-{
- bool found;
- int depth = 0;
- WINDOWLIST *wp;
-
- T((T_CALLED("decrease_size(%d, %d)"), ToLines, ToCols));
-
- do {
- found = FALSE;
- TR(TRACE_UPDATE, ("decreasing size of windows to %dx%d, depth=%d",
- ToLines, ToCols, depth));
- for (wp = _nc_windows; wp != 0; wp = wp->next) {
- WINDOW *win = &(wp->win);
-
- if (!(win->_flags & _ISPAD)) {
- if (child_depth(win) == depth) {
- if (adjust_window(win, ToLines, ToCols, stolen) != OK)
- returnCode(ERR);
- }
- }
- }
- ++depth;
- } while (found);
- returnCode(OK);
-}
-
-/*
- * If we're increasing size, recursively search for windows that have no
- * parent, increase those to fit, then increase the contained window, etc.
- */
-static int
-increase_size(int ToLines, int ToCols, int stolen)
-{
- bool found;
- int depth = 0;
- WINDOWLIST *wp;
-
- T((T_CALLED("increase_size(%d, %d)"), ToLines, ToCols));
-
- do {
- found = FALSE;
- TR(TRACE_UPDATE, ("increasing size of windows to %dx%d, depth=%d",
- ToLines, ToCols, depth));
- for (wp = _nc_windows; wp != 0; wp = wp->next) {
- WINDOW *win = &(wp->win);
-
- if (!(win->_flags & _ISPAD)) {
- if (parent_depth(win) == depth) {
- if (adjust_window(win, ToLines, ToCols, stolen) != OK)
- returnCode(ERR);
- }
- }
- }
- ++depth;
- } while (found);
- returnCode(OK);
-}
-
-/*
- * This function reallocates NCURSES window structures, with no side-effects
- * such as ungetch().
- */
-NCURSES_EXPORT(int)
-resize_term(int ToLines, int ToCols)
-{
- int result = OK;
- int was_stolen = (screen_lines - SP->_lines_avail);
-
- T((T_CALLED("resize_term(%d,%d) old(%d,%d)"),
- ToLines, ToCols,
- screen_lines, screen_columns));
-
- if (is_term_resized(ToLines, ToCols)) {
- int myLines = screen_lines;
- int myCols = screen_columns;
-
- if (ToLines > screen_lines) {
- increase_size(myLines = ToLines, myCols, was_stolen);
- }
-
- if (ToCols > screen_columns) {
- increase_size(myLines, myCols = ToCols, was_stolen);
- }
-
- if (ToLines < myLines ||
- ToCols < myCols) {
- decrease_size(ToLines, ToCols, was_stolen);
- }
-
- screen_lines = lines = ToLines;
- screen_columns = columns = ToCols;
-
- SP->_lines_avail = lines - was_stolen;
-
- if (SP->oldhash) {
- FreeAndNull(SP->oldhash);
- }
- if (SP->newhash) {
- FreeAndNull(SP->newhash);
- }
- }
-
- /*
- * Always update LINES, to allow for call from lib_doupdate.c which
- * needs to have the count adjusted by the stolen (ripped off) lines.
- */
- LINES = ToLines - was_stolen;
- COLS = ToCols;
-
- returnCode(result);
-}
-
-/*
- * This function reallocates NCURSES window structures. It is invoked in
- * response to a SIGWINCH interrupt. Other user-defined windows may also need
- * to be reallocated.
- *
- * Because this performs memory allocation, it should not (in general) be
- * invoked directly from the signal handler.
- */
-NCURSES_EXPORT(int)
-resizeterm(int ToLines, int ToCols)
-{
- int result = OK;
-
- SP->_sig_winch = FALSE;
-
- T((T_CALLED("resizeterm(%d,%d) old(%d,%d)"),
- ToLines, ToCols,
- screen_lines, screen_columns));
-
- if (is_term_resized(ToLines, ToCols)) {
-
-#if USE_SIGWINCH
- ungetch(KEY_RESIZE); /* so application can know this */
- clearok(curscr, TRUE); /* screen contents are unknown */
-#endif
-
- result = resize_term(ToLines, ToCols);
- }
-
- returnCode(result);
-}
diff --git a/ncurses-5.3/ncurses/base/safe_sprintf.c b/ncurses-5.3/ncurses/base/safe_sprintf.c
deleted file mode 100644
index b9d9ae4..0000000
--- a/ncurses-5.3/ncurses/base/safe_sprintf.c
+++ /dev/null
@@ -1,244 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998,1999,2000 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 <dickey@clark.net> 1997 *
- ****************************************************************************/
-
-#include <curses.priv.h>
-#include <ctype.h>
-
-MODULE_ID("$Id$")
-
-#if USE_SAFE_SPRINTF
-
-typedef enum {
- Flags, Width, Prec, Type, Format
-} PRINTF;
-
-#define VA_INTGR(type) ival = va_arg(ap, type)
-#define VA_FLOAT(type) fval = va_arg(ap, type)
-#define VA_POINT(type) pval = (void *)va_arg(ap, type)
-
-/*
- * Scan a variable-argument list for printf to determine the number of
- * characters that would be emitted.
- */
-static int
-_nc_printf_length(const char *fmt, va_list ap)
-{
- size_t length = BUFSIZ;
- char *buffer;
- char *format;
- int len = 0;
-
- if (fmt == 0 || *fmt == '\0')
- return -1;
- if ((format = typeMalloc(char, strlen(fmt) + 1)) == 0)
- return -1;
- if ((buffer = typeMalloc(char, length)) == 0) {
- free(format);
- return -1;
- }
-
- while (*fmt != '\0') {
- if (*fmt == '%') {
- static char dummy[] = "";
- PRINTF state = Flags;
- char *pval = dummy; /* avoid const-cast */
- double fval = 0.0;
- int done = FALSE;
- int ival = 0;
- int prec = -1;
- int type = 0;
- int used = 0;
- int width = -1;
- size_t f = 0;
-
- format[f++] = *fmt;
- while (*++fmt != '\0' && len >= 0 && !done) {
- format[f++] = *fmt;
-
- if (isdigit(UChar(*fmt))) {
- int num = *fmt - '0';
- if (state == Flags && num != 0)
- state = Width;
- if (state == Width) {
- if (width < 0)
- width = 0;
- width = (width * 10) + num;
- } else if (state == Prec) {
- if (prec < 0)
- prec = 0;
- prec = (prec * 10) + num;
- }
- } else if (*fmt == '*') {
- VA_INTGR(int);
- if (state == Flags)
- state = Width;
- if (state == Width) {
- width = ival;
- } else if (state == Prec) {
- prec = ival;
- }
- sprintf(&format[--f], "%d", ival);
- f = strlen(format);
- } else if (isalpha(UChar(*fmt))) {
- done = TRUE;
- switch (*fmt) {
- case 'Z': /* FALLTHRU */
- case 'h': /* FALLTHRU */
- case 'l': /* FALLTHRU */
- done = FALSE;
- type = *fmt;
- break;
- case 'i': /* FALLTHRU */
- case 'd': /* FALLTHRU */
- case 'u': /* FALLTHRU */
- case 'x': /* FALLTHRU */
- case 'X': /* FALLTHRU */
- if (type == 'l')
- VA_INTGR(long);
- else if (type == 'Z')
- VA_INTGR(size_t);
- else
- VA_INTGR(int);
- used = 'i';
- break;
- case 'f': /* FALLTHRU */
- case 'e': /* FALLTHRU */
- case 'E': /* FALLTHRU */
- case 'g': /* FALLTHRU */
- case 'G': /* FALLTHRU */
- VA_FLOAT(double);
- used = 'f';
- break;
- case 'c':
- VA_INTGR(int);
- used = 'i';
- break;
- case 's':
- VA_POINT(char *);
- if (prec < 0)
- prec = strlen(pval);
- if (prec > (int) length) {
- length = length + prec;
- buffer = typeRealloc(char, length, buffer);
- if (buffer == 0) {
- free(format);
- return -1;
- }
- }
- used = 'p';
- break;
- case 'p':
- VA_POINT(void *);
- used = 'p';
- break;
- case 'n':
- VA_POINT(int *);
- used = 0;
- break;
- default:
- break;
- }
- } else if (*fmt == '.') {
- state = Prec;
- } else if (*fmt == '%') {
- done = TRUE;
- used = 'p';
- }
- }
- format[f] = '\0';
- switch (used) {
- case 'i':
- sprintf(buffer, format, ival);
- break;
- case 'f':
- sprintf(buffer, format, fval);
- break;
- default:
- sprintf(buffer, format, pval);
- break;
- }
- len += (int) strlen(buffer);
- } else {
- fmt++;
- len++;
- }
- }
-
- free(buffer);
- free(format);
- return len;
-}
-#endif
-
-/*
- * Wrapper for vsprintf that allocates a buffer big enough to hold the result.
- */
-NCURSES_EXPORT(char *)
-_nc_printf_string
-(const char *fmt, va_list ap)
-{
-#if USE_SAFE_SPRINTF
- char *buf = 0;
- int len = _nc_printf_length(fmt, ap);
-
- if (len > 0) {
- if ((buf = typeMalloc(char, len + 1)) == 0)
- return (0);
- vsprintf(buf, fmt, ap);
- }
-#else
- static int rows, cols;
- static char *buf;
- static size_t len;
-
- if (screen_lines > rows || screen_columns > cols) {
- if (screen_lines > rows)
- rows = screen_lines;
- if (screen_columns > cols)
- cols = screen_columns;
- len = (rows * (cols + 1)) + 1;
- buf = typeRealloc(char, len, buf);
- if (buf == 0) {
- return (0);
- }
- }
-
- if (buf != 0) {
-# if HAVE_VSNPRINTF
- vsnprintf(buf, len, fmt, ap); /* GNU extension */
-# else
- vsprintf(buf, fmt, ap); /* ANSI */
-# endif
- }
-#endif
- return buf;
-}
diff --git a/ncurses-5.3/ncurses/base/sigaction.c b/ncurses-5.3/ncurses/base/sigaction.c
deleted file mode 100644
index b2f23db..0000000
--- a/ncurses-5.3/ncurses/base/sigaction.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998-2001,2002 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> *
- ****************************************************************************/
-
-#include <curses.priv.h>
-
-#include <SigAction.h>
-
-/* This file provides sigaction() emulation using sigvec() */
-/* Use only if this is non POSIX system */
-
-#if !HAVE_SIGACTION && HAVE_SIGVEC
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(int)
-sigaction
-(int sig, sigaction_t * sigact, sigaction_t * osigact)
-{
- return sigvec(sig, sigact, osigact);
-}
-
-NCURSES_EXPORT(int)
-sigemptyset
-(sigset_t * mask)
-{
- *mask = 0;
- return 0;
-}
-
-NCURSES_EXPORT(int)
-sigprocmask
-(int mode, sigset_t * mask, sigset_t * omask)
-{
- sigset_t current = sigsetmask(0);
-
- if (omask)
- *omask = current;
-
- if (mode == SIG_BLOCK)
- current |= *mask;
- else if (mode == SIG_UNBLOCK)
- current &= ~*mask;
- else if (mode == SIG_SETMASK)
- current = *mask;
-
- sigsetmask(current);
- return 0;
-}
-
-NCURSES_EXPORT(int)
-sigsuspend(sigset_t * mask)
-{
- return sigpause(*mask);
-}
-
-NCURSES_EXPORT(int)
-sigdelset
-(sigset_t * mask, int sig)
-{
- *mask &= ~sigmask(sig);
- return 0;
-}
-
-NCURSES_EXPORT(int)
-sigaddset
-(sigset_t * mask, int sig)
-{
- *mask |= sigmask(sig);
- return 0;
-}
-
-NCURSES_EXPORT(int)
-sigismember
-(sigset_t * mask, int sig)
-{
- return (*mask & sigmask(sig)) != 0;
-}
-
-#else
-extern
-NCURSES_EXPORT(void)
-_nc_sigaction(void); /* quiet's gcc warning */
-NCURSES_EXPORT(void)
-_nc_sigaction(void)
-{
-} /* nonempty for strict ANSI compilers */
-#endif
diff --git a/ncurses-5.3/ncurses/base/tries.c b/ncurses-5.3/ncurses/base/tries.c
deleted file mode 100644
index 0b3a058..0000000
--- a/ncurses-5.3/ncurses/base/tries.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/****************************************************************************
- * Copyright (c) 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: Thomas E. Dickey <dickey@clark.net> 1997 *
- ****************************************************************************/
-
-/*
-** tries.c
-**
-** Functions to manage the tree of partial-completions for keycodes.
-**
-*/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-/*
- * Expand a keycode into the string that it corresponds to, returning null if
- * no match was found, otherwise allocating a string of the result.
- */
-NCURSES_EXPORT(char *)
-_nc_expand_try
-(struct tries *tree, unsigned short code, int *count, size_t len)
-{
- struct tries *ptr = tree;
- char *result = 0;
-
- if (code != 0) {
- while (ptr != 0) {
- if ((result = _nc_expand_try(ptr->child, code, count, len + 1))
- != 0) {
- break;
- }
- if (ptr->value == code) {
- *count -= 1;
- if (*count == -1) {
- result = typeCalloc(char, len + 2);
- break;
- }
- }
- ptr = ptr->sibling;
- }
- }
- if (result != 0) {
- if ((result[len] = ptr->ch) == 0)
- *((unsigned char *) (result + len)) = 128;
-#ifdef TRACE
- if (len == 0)
- _tracef("expand_key %s %s", _tracechar(code), _nc_visbuf(result));
-#endif
- }
- return result;
-}
-
-/*
- * Remove a code from the specified tree, freeing the unused nodes. Returns
- * true if the code was found/removed.
- */
-NCURSES_EXPORT(int)
-_nc_remove_key
-(struct tries **tree, unsigned short code)
-{
- T((T_CALLED("_nc_remove_key(%p,%d)"), tree, code));
-
- if (code == 0)
- returnCode(FALSE);
-
- while (*tree != 0) {
- if (_nc_remove_key(&(*tree)->child, code)) {
- returnCode(TRUE);
- }
- if ((*tree)->value == code) {
- if ((*tree)->child) {
- /* don't cut the whole sub-tree */
- (*tree)->value = 0;
- } else {
- struct tries *to_free = *tree;
- *tree = (*tree)->sibling;
- free(to_free);
- }
- returnCode(TRUE);
- }
- tree = &(*tree)->sibling;
- }
- returnCode(FALSE);
-}
-
-/*
- * Remove a string from the specified tree, freeing the unused nodes. Returns
- * true if the string was found/removed.
- */
-NCURSES_EXPORT(int)
-_nc_remove_string(struct tries **tree, char *string)
-{
- T((T_CALLED("_nc_remove_string(%p,%s)"), tree, _nc_visbuf(string)));
-
- if (string == 0 || *string == 0)
- returnCode(FALSE);
-
- while (*tree != 0) {
- if ((unsigned char) (*tree)->ch == (unsigned char) *string) {
- if (string[1] != 0)
- returnCode(_nc_remove_string(&(*tree)->child, string + 1));
- if ((*tree)->child) {
- /* don't cut the whole sub-tree */
- (*tree)->value = 0;
- } else {
- struct tries *to_free = *tree;
- *tree = (*tree)->sibling;
- free(to_free);
- }
- returnCode(TRUE);
- }
- tree = &(*tree)->sibling;
- }
- returnCode(FALSE);
-}
diff --git a/ncurses-5.3/ncurses/base/version.c b/ncurses-5.3/ncurses/base/version.c
deleted file mode 100644
index 18813db..0000000
--- a/ncurses-5.3/ncurses/base/version.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1999,2000 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 <dickey@clark.net> 1999 *
- ****************************************************************************/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-NCURSES_EXPORT(const char *)
-curses_version(void)
-{
- static char my_version[80];
-
- T((T_CALLED("curses_version()")));
- sprintf(my_version, "ncurses %s.%d",
- NCURSES_VERSION,
- NCURSES_VERSION_PATCH);
- returnPtr(my_version);
-}
diff --git a/ncurses-5.3/ncurses/base/vsscanf.c b/ncurses-5.3/ncurses/base/vsscanf.c
deleted file mode 100644
index 29c46b6..0000000
--- a/ncurses-5.3/ncurses/base/vsscanf.c
+++ /dev/null
@@ -1,356 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998-2001,2002 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. *
- ****************************************************************************/
-
-/****************************************************************************
- * State-machine fallback written by Thomas E. Dickey 2002 *
- ****************************************************************************/
-
-/*
- * This function is needed to support vwscanw
- */
-
-#include <curses.priv.h>
-
-#if !HAVE_VSSCANF
-
-MODULE_ID("$Id$")
-
-#if !(HAVE_VFSCANF || HAVE__DOSCAN)
-
-#include <ctype.h>
-
-#define L_SQUARE '['
-#define R_SQUARE ']'
-
-typedef enum {
- cUnknown
- ,cError /* anything that isn't ANSI */
- ,cAssigned
- ,cChar
- ,cInt
- ,cFloat
- ,cDouble
- ,cPointer
- ,cLong
- ,cShort
- ,cRange
- ,cString
-} ChunkType;
-
-typedef enum {
- oUnknown
- ,oShort
- ,oLong
-} OtherType;
-
-typedef enum {
- sUnknown
- ,sPercent /* last was '%' beginning a format */
- ,sNormal /* ...somewhere in the middle */
- ,sLeft /* last was left square bracket beginning a range */
- ,sRange /* ...somewhere in the middle */
- ,sFinal /* last finished a format */
-} ScanState;
-
-static ChunkType
-final_ch(int ch, OtherType other)
-{
- ChunkType result = cUnknown;
-
- switch (ch) {
- case 'c':
- if (other == oUnknown)
- result = cChar;
- else
- result = cError;
- break;
- case 'd':
- case 'i':
- case 'X':
- case 'x':
- switch (other) {
- case oUnknown:
- result = cInt;
- break;
- case oShort:
- result = cShort;
- break;
- case oLong:
- result = cLong;
- break;
- }
- break;
- case 'E':
- case 'e':
- case 'f':
- case 'g':
- switch (other) {
- case oUnknown:
- result = cFloat;
- break;
- case oShort:
- result = cError;
- break;
- case oLong:
- result = cDouble;
- break;
- }
- break;
- case 'n':
- if (other == oUnknown)
- result = cAssigned;
- else
- result = cError;
- break;
- case 'p':
- if (other == oUnknown)
- result = cPointer;
- else
- result = cError;
- break;
- case 's':
- if (other == oUnknown)
- result = cString;
- else
- result = cError;
- break;
- }
- return result;
-}
-
-static OtherType
-other_ch(int ch)
-{
- OtherType result = oUnknown;
- switch (ch) {
- case 'h':
- result = oShort;
- break;
- case 'l':
- result = oLong;
- break;
- }
- return result;
-}
-#endif
-
-/*VARARGS2*/
-NCURSES_EXPORT(int)
-vsscanf(const char *str, const char *format, va_list ap)
-{
-#if HAVE_VFSCANF || HAVE__DOSCAN
- /*
- * This code should work on anything descended from AT&T SVr1.
- */
- FILE strbuf;
-
- strbuf._flag = _IOREAD;
- strbuf._ptr = strbuf._base = (unsigned char *) str;
- strbuf._cnt = strlen(str);
- strbuf._file = _NFILE;
-
-#if HAVE_VFSCANF
- return (vfscanf(&strbuf, format, ap));
-#else
- return (_doscan(&strbuf, format, ap));
-#endif
-#else
- static int can_convert = -1;
-
- int assigned = 0;
- int consumed = 0;
-
- T((T_CALLED("vsscanf(%s,%s,...)"),
- _nc_visbuf2(1, str),
- _nc_visbuf2(2, format)));
-
- /*
- * This relies on having a working "%n" format conversion. Check if it
- * works. Only very old C libraries do not support it.
- *
- * FIXME: move this check into the configure script.
- */
- if (can_convert < 0) {
- int check1;
- int check2;
- if (sscanf("123", "%d%n", &check1, &check2) > 0
- && check1 == 123
- && check2 == 3) {
- can_convert = 1;
- } else {
- can_convert = 0;
- }
- }
-
- if (can_convert) {
- size_t len_fmt = strlen(format) + 32;
- char *my_fmt = malloc(len_fmt);
- ChunkType chunk, ctest;
- OtherType other, otest;
- ScanState state;
- unsigned n;
- int eaten;
- void *pointer;
-
- if (my_fmt != 0) {
- /*
- * Split the original format into chunks, adding a "%n" to the end
- * of each (except of course if it used %n), and use that
- * information to decide where to start scanning the next chunk.
- *
- * FIXME: does %n count bytes or characters? If the latter, this
- * will require further work for multibyte strings.
- */
- while (*format != '\0') {
- /* find a chunk */
- state = sUnknown;
- chunk = cUnknown;
- other = cUnknown;
- pointer = 0;
- for (n = 0; format[n] != 0 && state != sFinal; ++n) {
- my_fmt[n] = format[n];
- switch (state) {
- case sUnknown:
- if (format[n] == '%')
- state = sPercent;
- break;
- case sPercent:
- if (format[n] == '%') {
- state = sUnknown;
- } else if (format[n] == L_SQUARE) {
- state = sLeft;
- } else {
- state = sNormal;
- --n;
- }
- break;
- case sLeft:
- state = sRange;
- if (format[n] == '^') {
- ++n;
- my_fmt[n] = format[n];
- }
- break;
- case sRange:
- if (format[n] == R_SQUARE) {
- state = sFinal;
- chunk = cRange;
- }
- break;
- case sNormal:
- if (format[n] == '*') {
- state = sUnknown;
- } else {
- if ((ctest = final_ch(format[n], other)) != cUnknown) {
- state = sFinal;
- chunk = ctest;
- } else if ((otest = other_ch(format[n])) != oUnknown) {
- other = otest;
- } else if (isalpha(format[n])) {
- state = sFinal;
- chunk = cError;
- }
- }
- break;
- case sFinal:
- break;
- }
- }
- my_fmt[n] = '\0';
- format += n;
-
- if (chunk == cUnknown
- || chunk == cError) {
- if (assigned == 0)
- assigned = EOF;
- break;
- }
-
- /* add %n, if the format was not that */
- if (chunk != cAssigned) {
- strcat(my_fmt, "%n");
- }
-
- switch (chunk) {
- case cAssigned:
- strcat(my_fmt, "%n");
- pointer = &eaten;
- break;
- case cInt:
- pointer = va_arg(ap, int *);
- break;
- case cShort:
- pointer = va_arg(ap, short *);
- break;
- case cFloat:
- pointer = va_arg(ap, float *);
- break;
- case cDouble:
- pointer = va_arg(ap, double *);
- break;
- case cLong:
- pointer = va_arg(ap, long *);
- break;
- case cPointer:
- pointer = va_arg(ap, void *);
- break;
- case cChar:
- case cRange:
- case cString:
- pointer = va_arg(ap, char *);
- break;
- case cError:
- case cUnknown:
- break;
- }
- /* do the conversion */
- T(("...converting chunk #%d type %d(%s,%s)",
- assigned + 1, chunk,
- _nc_visbuf2(1, str + consumed),
- _nc_visbuf2(2, my_fmt)));
- if (sscanf(str + consumed, my_fmt, pointer, &eaten) > 0)
- consumed += eaten;
- else
- break;
- ++assigned;
- }
- free(my_fmt);
- }
- }
- returnCode(assigned);
-#endif
-}
-#else
-extern
-NCURSES_EXPORT(void)
-_nc_vsscanf(void); /* quiet's gcc warning */
-NCURSES_EXPORT(void)
-_nc_vsscanf(void)
-{
-} /* nonempty for strict ANSI compilers */
-#endif /* !HAVE_VSSCANF */
diff --git a/ncurses-5.3/ncurses/base/wresize.c b/ncurses-5.3/ncurses/base/wresize.c
deleted file mode 100644
index 7edad36..0000000
--- a/ncurses-5.3/ncurses/base/wresize.c
+++ /dev/null
@@ -1,239 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998-2001,2002 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-2002 *
- ****************************************************************************/
-
-#include <curses.priv.h>
-
-MODULE_ID("$Id$")
-
-static int
-cleanup_lines(struct ldat *data, int length)
-{
- while (--length >= 0)
- free(data->text);
- free(data);
- return ERR;
-}
-
-/*
- * If we have reallocated the ldat structs, we will have to repair pointers
- * used in subwindows.
- */
-static void
-repair_subwindows(WINDOW *cmp)
-{
- WINDOWLIST *wp;
- struct ldat *pline = cmp->_line;
- int row;
-
- for (wp = _nc_windows; wp != 0; wp = wp->next) {
- WINDOW *tst = &(wp->win);
-
- if (tst->_parent == cmp) {
-
- if (tst->_pary > cmp->_maxy)
- tst->_pary = cmp->_maxy;
- if (tst->_parx > cmp->_maxx)
- tst->_parx = cmp->_maxx;
-
- if (tst->_maxy + tst->_pary > cmp->_maxy)
- tst->_maxy = cmp->_maxy - tst->_pary;
- if (tst->_maxx + tst->_parx > cmp->_maxx)
- tst->_maxx = cmp->_maxx - tst->_parx;
-
- for (row = 0; row <= tst->_maxy; ++row) {
- tst->_line[row].text = &pline[tst->_pary + row].text[tst->_parx];
- }
- repair_subwindows(tst);
- }
- }
-}
-
-/*
- * Reallocate a curses WINDOW struct to either shrink or grow to the specified
- * new lines/columns. If it grows, the new character cells are filled with
- * blanks. The application is responsible for repainting the blank area.
- */
-NCURSES_EXPORT(int)
-wresize(WINDOW *win, int ToLines, int ToCols)
-{
- int col, row, size_x, size_y;
- struct ldat *pline;
- struct ldat *new_lines = 0;
-
-#ifdef TRACE
- T((T_CALLED("wresize(%p,%d,%d)"), win, ToLines, ToCols));
- if (win) {
- TR(TRACE_UPDATE, ("...beg (%d, %d), max(%d,%d), reg(%d,%d)",
- win->_begy, win->_begx,
- win->_maxy, win->_maxx,
- win->_regtop, win->_regbottom));
- if (_nc_tracing & TRACE_UPDATE)
- _tracedump("...before", win);
- }
-#endif
-
- if (!win || --ToLines < 0 || --ToCols < 0)
- returnCode(ERR);
-
- size_x = win->_maxx;
- size_y = win->_maxy;
-
- if (ToLines == size_y
- && ToCols == size_x)
- returnCode(OK);
-
- if ((win->_flags & _SUBWIN)) {
- /*
- * Check if the new limits will fit into the parent window's size. If
- * not, do not resize. We could adjust the location of the subwindow,
- * but the application may not like that.
- */
- if (win->_pary + ToLines > win->_parent->_maxy
- || win->_parx + ToCols > win->_parent->_maxx) {
- returnCode(ERR);
- }
- pline = win->_parent->_line;
- } else {
- pline = 0;
- }
-
- /*
- * Allocate new memory as needed. Do the allocations without modifying
- * the original window, in case an allocation fails. Always allocate
- * (at least temporarily) the array pointing to the individual lines.
- */
- new_lines = typeCalloc(struct ldat, (unsigned) (ToLines + 1));
- if (new_lines == 0)
- returnCode(ERR);
-
- /*
- * For each line in the target, allocate or adjust pointers for the
- * corresponding text, depending on whether this is a window or a
- * subwindow.
- */
- for (row = 0; row <= ToLines; ++row) {
- int begin = (row > size_y) ? 0 : (size_x + 1);
- int end = ToCols;
- NCURSES_CH_T *s;
-
- if (!(win->_flags & _SUBWIN)) {
- if (row <= size_y) {
- if (ToCols != size_x) {
- if ((s = typeMalloc(NCURSES_CH_T, ToCols + 1)) == 0)
- returnCode(cleanup_lines(new_lines, row));
- for (col = 0; col <= ToCols; ++col) {
- s[col] = (col <= size_x
- ? win->_line[row].text[col]
- : win->_nc_bkgd);
- }
- } else {
- s = win->_line[row].text;
- }
- } else {
- if ((s = typeMalloc(NCURSES_CH_T, ToCols + 1)) == 0)
- returnCode(cleanup_lines(new_lines, row));
- for (col = 0; col <= ToCols; ++col)
- s[col] = win->_nc_bkgd;
- }
- } else {
- s = &pline[win->_pary + row].text[win->_parx];
- }
-
- if_USE_SCROLL_HINTS(new_lines[row].oldindex = row);
- if (row <= size_y) {
- new_lines[row].firstchar = win->_line[row].firstchar;
- new_lines[row].lastchar = win->_line[row].lastchar;
- }
- if ((ToCols != size_x) || (row > size_y)) {
- if (end >= begin) { /* growing */
- if (new_lines[row].firstchar < begin)
- new_lines[row].firstchar = begin;
- } else { /* shrinking */
- new_lines[row].firstchar = 0;
- }
- new_lines[row].lastchar = ToCols;
- }
- new_lines[row].text = s;
- }
-
- /*
- * Dispose of unwanted memory.
- */
- if (!(win->_flags & _SUBWIN)) {
- if (ToCols == size_x) {
- for (row = ToLines + 1; row <= size_y; row++) {
- free(win->_line[row].text);
- }
- } else {
- for (row = 0; row <= size_y; row++) {
- free(win->_line[row].text);
- }
- }
- }
-
- free(win->_line);
- win->_line = new_lines;
-
- /*
- * Finally, adjust the parameters showing screen size and cursor
- * position:
- */
- win->_maxx = ToCols;
- win->_maxy = ToLines;
-
- if (win->_regtop > win->_maxy)
- win->_regtop = win->_maxy;
- if (win->_regbottom > win->_maxy
- || win->_regbottom == size_y)
- win->_regbottom = win->_maxy;
-
- if (win->_curx > win->_maxx)
- win->_curx = win->_maxx;
- if (win->_cury > win->_maxy)
- win->_cury = win->_maxy;
-
- /*
- * Check for subwindows of this one, and readjust pointers to our text,
- * if needed.
- */
- repair_subwindows(win);
-
-#ifdef TRACE
- TR(TRACE_UPDATE, ("...beg (%d, %d), max(%d,%d), reg(%d,%d)",
- win->_begy, win->_begx,
- win->_maxy, win->_maxx,
- win->_regtop, win->_regbottom));
- if (_nc_tracing & TRACE_UPDATE)
- _tracedump("...after:", win);
-#endif
- returnCode(OK);
-}