Date: Tue, 26 May 2009 18:53:44 +0000 (UTC) From: Ed Schouten <ed@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r192833 - vendor/ee/1.4.3 Message-ID: <200905261853.n4QIriAE069252@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ed Date: Tue May 26 18:53:44 2009 New Revision: 192833 URL: http://svn.freebsd.org/changeset/base/192833 Log: Tag of ee 1.4.3. Added: vendor/ee/1.4.3/ - copied from r192830, vendor/ee/dist/ Replaced: vendor/ee/1.4.3/create.make - copied unchanged from r192832, vendor/ee/dist/create.make vendor/ee/1.4.3/new_curse.c - copied unchanged from r192832, vendor/ee/dist/new_curse.c Copied: vendor/ee/1.4.3/create.make (from r192832, vendor/ee/dist/create.make) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/ee/1.4.3/create.make Tue May 26 18:53:44 2009 (r192833, copy of r192832, vendor/ee/dist/create.make) @@ -0,0 +1,279 @@ +#!/bin/sh + +# +# This script will determine if the system is a System V or BSD based +# UNIX system and create a makefile for ee appropriate for the system. +# +# $Header: /home/hugh/sources/old_ae/RCS/create.make,v 1.12 2001/06/28 05:39:14 hugh Exp $ +# + +#set -x + +# test for existence of termcap (exists on both BSD and SysV systems) + +if [ -f /etc/termcap -o -f /usr/share/lib/termcap -o -f /usr/share/misc/termcap ] +then + if [ -f /usr/share/lib/termcap ] + then + termcap_exists="-DTERMCAP=\"\\\"/usr/share/lib/termcap\\\"\"" + elif [ -f /usr/share/misc/termcap ] + then + termcap_exists="-DTERMCAP=\"\\\"/usr/share/misc/termcap\\\"\"" + elif [ -f /etc/termcap ] + then + termcap_exists="-DTERMCAP=\"\\\"/etc/termcap\\\"\"" + fi +else + termcap_exists="" +fi + +# test for terminfo directory (exists on SysV systems) + +if [ -d /usr/lib/terminfo -o -d /usr/share/lib/terminfo -o -d /usr/share/terminfo ] +then + terminfo_exists="" +else + terminfo_exists="-DCAP" +fi + +# test for existence of termio header (on SysV systems) + +if [ -f /usr/include/termio.h ] +then + termio="-DSYS5" +else + termio="" +fi + +# test for sgtty header (on BSD systems) + +if [ -f /usr/include/sgtty.h ] +then + sgtty="TRUE" +else + sgtty="" +fi + +# look for select call in headers, make sure headers exist + +HEADER_FILES="" + +if [ -f /usr/include/sys/time.h ] +then + HEADER_FILES="/usr/include/sys/time.h " +fi + +if [ -f /usr/include/sys/types.h ] +then + HEADER_FILES="$HEADER_FILES /usr/include/sys/types.h" +fi + +# check for unistd.h + +if [ -f /usr/include/unistd.h ] +then + HAS_UNISTD=-DHAS_UNISTD + HEADER_FILES="$HEADER_FILES /usr/include/unistd.h" +else + HAS_UNISTD="" +fi + +if [ -n "$HEADER_FILES" ] +then + string="`grep select $HEADER_FILES`" + if [ -n "$string" ] + then + BSD_SELECT="-DBSD_SELECT" + else + BSD_SELECT="" + fi +fi + +# check for existence of select.h (on AIX) + +if [ -f /usr/include/sys/select.h ] +then + select_hdr="-DSLCT_HDR" +else + select_hdr="" +fi + +# check for stdlib.h + +if [ -f /usr/include/stdlib.h ] +then + HAS_STDLIB=-DHAS_STDLIB +else + HAS_STDLIB="" +fi + +# check for stdarg.h + +if [ -f /usr/include/stdarg.h ] +then + HAS_STDARG=-DHAS_STDARG +else + HAS_STDARG="" +fi + +# check for ctype.h + +if [ -f /usr/include/ctype.h ] +then + HAS_CTYPE=-DHAS_CTYPE +else + HAS_CTYPE="" +fi + +# check for sys/ioctl.h + +if [ -f /usr/include/sys/ioctl.h ] +then + HAS_SYS_IOCTL=-DHAS_SYS_IOCTL +else + HAS_SYS_IOCTL="" +fi + +# check for sys/wait.h + +if [ -f /usr/include/sys/wait.h ] +then + HAS_SYS_WAIT=-DHAS_SYS_WAIT +else + HAS_SYS_WAIT="" +fi + +# check for localization headers + +if [ -f /usr/include/locale.h -a -f /usr/include/nl_types.h ] +then + catgets="" +else + catgets="-DNO_CATGETS" +fi + +# make decisions about use of new_curse.c (use of new_curse is recommended +# rather than local curses) + +if [ -n "$terminfo_exists" -a -z "$termcap_exists" ] +then + echo "Neither terminfo or termcap are on this system! " + if [ -f /usr/include/curses.h ] + then + echo "Relying on local curses implementation." + else + cat <<-EOF + Don't know where to find curses, you'll need to modify + source code to be able to build! + + Modify the file make.default and build ee by typing: + + make -f make.default + + EOF + + exit 1 + fi + + TARGET="curses" + curses="" +else + curses="-DNCURSE" + TARGET="ee" +fi + +if [ -z "$termio" -a -z "$sgtty" ] +then + echo "Neither termio.h or sgtty.h are on this system! " + if [ -f /usr/include/curses.h ] + then + echo "Relying on local curses implementation." + else + cat <<-EOF + Don't know where to find curses, you'll need to modify + source code to be able to build! + + Modify the file make.default and build ee by typing: + + make -f make.default + + EOF + + exit 1 + fi + + TARGET="curses" + curses="" +fi + +# check if this is a SunOS system + +if [ -d /usr/5include ] +then + five_include="-I/usr/5include" +else + five_include="" +fi + +if [ -d /usr/5lib ] +then + five_lib="-L/usr/5lib" +else + five_lib="" +fi + + +if [ -n "$CFLAGS" ] +then + if [ -z "`echo $CFLAGS | grep '[-]g'`" ] + then + other_cflags="${CFLAGS} -s" + else + other_cflags="${CFLAGS}" + fi +else + other_cflags="-s" +fi + +# time to write the makefile + +echo "Generating make.local" + +if [ -f make.local ] +then + mv make.local make.lcl.old +fi + +echo "DEFINES = $termio $terminfo_exists $BSD_SELECT $catgets $select $curses " > make.local +echo "" >> make.local +echo "CFLAGS = $HAS_UNISTD $HAS_STDARG $HAS_STDLIB $HAS_CTYPE $HAS_SYS_IOCTL $HAS_SYS_WAIT $five_lib $five_include $select_hdr $other_cflags $termcap_exists" >> make.local +echo "" >> make.local +echo "" >> make.local +echo "all : $TARGET" >> make.local + +cat >> make.local << EOF + +curses : ee.c + cc ee.c -o ee \$(CFLAGS) -lcurses + +ee : ee.o new_curse.o + cc -o ee ee.o new_curse.o \$(CFLAGS) + +ee.o : ee.c new_curse.h + cc -c ee.c \$(DEFINES) \$(CFLAGS) + +new_curse.o : new_curse.c new_curse.h + cc new_curse.c -c \$(DEFINES) \$(CFLAGS) + +EOF + +if [ -f make.lcl.old ] +then + diffs="`cmp make.lcl.old make.local`" + if [ -n "${diffs}" ] + then + rm -f ee.o new_curse.o ee + fi + rm -f make.lcl.old +fi + Copied: vendor/ee/1.4.3/new_curse.c (from r192832, vendor/ee/dist/new_curse.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/ee/1.4.3/new_curse.c Tue May 26 18:53:44 2009 (r192833, copy of r192832, vendor/ee/dist/new_curse.c) @@ -0,0 +1,3817 @@ +/* + | new_curse.c + | + | A subset of curses developed for use with ae. + | + | written by Hugh Mahon + | + | THIS MATERIAL IS PROVIDED "AS IS". THERE ARE + | NO WARRANTIES OF ANY KIND WITH REGARD TO THIS + | MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE + | IMPLIED WARRANTIES OF MERCHANTABILITY AND + | FITNESS FOR A PARTICULAR PURPOSE. Neither + | Hewlett-Packard nor Hugh Mahon shall be liable + | for errors contained herein, nor for + | incidental or consequential damages in + | connection with the furnishing, performance or + | use of this material. Neither Hewlett-Packard + | nor Hugh Mahon assumes any responsibility for + | the use or reliability of this software or + | documentation. This software and + | documentation is totally UNSUPPORTED. There + | is no support contract available. Hewlett- + | Packard has done NO Quality Assurance on ANY + | of the program or documentation. You may find + | the quality of the materials inferior to + | supported materials. + | + | This software is not a product of Hewlett-Packard, Co., or any + | other company. No support is implied or offered with this software. + | You've got the source, and you're on your own. + | + | This software may be distributed under the terms of Larry Wall's + | Artistic license, a copy of which is included in this distribution. + | + | This notice must be included with this software and any derivatives. + | + | Copyright (c) 1986, 1987, 1988, 1991, 1992, 1993, 1994, 1995 Hugh Mahon + | All are rights reserved. + | + | $Header: /home/hugh/sources/old_ae/RCS/new_curse.c,v 1.52 2001/06/28 05:39:42 hugh Exp $ + | + */ + +char *copyright_message[] = { "Copyright (c) 1986, 1987, 1988, 1991, 1992, 1993, 1994, 1995 Hugh Mahon", + "All rights are reserved."}; + +char * new_curse_name= "@(#) new_curse.c $Revision: 1.52 $"; + +#include "new_curse.h" +#include <signal.h> +#include <fcntl.h> + +#ifdef SYS5 +#include <string.h> +#else +#include <strings.h> +#endif + +#ifdef BSD_SELECT +#include <sys/types.h> +#include <sys/time.h> + +#ifdef SLCT_HDR +#include <sys/select.h> /* on AIX */ +#endif /* SLCT_HDR */ + +#endif /* BSD_SELECT */ + +#ifdef HAS_STDLIB +#include <stdlib.h> +#endif + +#if defined(__STDC__) +#include <stdarg.h> +#else +#include <varargs.h> +#endif + +#ifdef HAS_UNISTD +#include <unistd.h> +#endif + +#ifdef HAS_SYS_IOCTL +#include <sys/ioctl.h> +#endif + + +WINDOW *curscr; +static WINDOW *virtual_scr; +WINDOW *stdscr; +WINDOW *last_window_refreshed; + +#ifdef TIOCGWINSZ + struct winsize ws; +#endif + +#define min(a, b) (a < b ? a : b) +#define highbitset(a) ((a) & 0x80) + +#ifndef CAP +#define String_Out(table, stack, place) Info_Out(table, stack, place) +#else +#define String_Out(table, stack, place) Cap_Out(table, stack, place) +#endif + +#define bw__ 0 /* booleans */ +#define am__ 1 +#define xb__ 2 +#define xs__ 3 /* hp glitch (standout not erased by overwrite) */ +#define xn__ 4 +#define eo__ 5 +#define gn__ 6 /* generic type terminal */ +#define hc__ 7 /* hardcopy terminal */ +#define km__ 8 +#define hs__ 9 +#define in__ 10 +#define da__ 11 +#define db__ 12 +#define mi__ 13 /* safe to move during insert mode */ +#define ms__ 14 /* safe to move during standout mode */ +#define os__ 15 +#define es__ 16 +#define xt__ 17 +#define hz__ 18 /* hazeltine glitch */ +#define ul__ 19 +#define xo__ 20 +#define chts__ 21 +#define nxon__ 22 +#define nrrmc__ 23 +#define npc__ 24 +#define mc5i__ 25 + +#define co__ 0 /* number of columns */ /* numbers */ +#define it__ 1 /* spaces per tab */ +#define li__ 2 /* number of lines */ +#define lm__ 3 +#define sg__ 4 /* magic cookie glitch */ +#define pb__ 5 +#define vt__ 6 +#define ws__ 7 + +#define cols__ 0 +#define lines__ 2 +#define xmc__ 4 +#define vt__ 6 +#define wsl__ 7 +#define nlab__ 8 +#define lh__ 9 +#define lw__ 10 + +#define bt__ 0 /* back tab */ /* strings */ +#define bl__ 1 /* bell */ +#define cr__ 2 /* carriage return */ +#define cs__ 3 /* change scroll region */ +#define ct__ 4 /* clear all tab stops */ +#define cl__ 5 /* clear screen and home cursor */ +#define ce__ 6 /* clear to end of line */ +#define cd__ 7 /* clear to end of display */ +#define ch__ 8 /* set cursor column */ +#define CC__ 9 /* term, settable cmd char in */ +#define cm__ 10 /* screen rel cursor motion, row, column */ +#define do__ 11 /* down one line */ +#define ho__ 12 /* home cursor */ +#define vi__ 13 /* make cursor invisible */ +#define le__ 14 /* move cursor left one space */ +#define CM__ 15 /* memory rel cursor addressing */ +#define ve__ 16 /* make cursor appear normal */ +#define nd__ 17 /* non-destructive space (cursor right) */ +#define ll__ 18 /* last line, first col */ +#define up__ 19 /* cursor up */ +#define vs__ 20 +#define dc__ 21 /* delete character */ +#define dl__ 22 /* delete line */ +#define ds__ 23 +#define hd__ 24 +#define as__ 25 +#define mb__ 26 +#define md__ 27 /* turn on bold */ +#define ti__ 28 +#define dm__ 29 /* turn on delete mode */ +#define mh__ 30 /* half bright mode */ +#define im__ 31 /* insert mode */ +#define mk__ 32 +#define mp__ 33 +#define mr__ 34 +#define so__ 35 /* enter standout mode */ +#define us__ 36 +#define ec__ 37 +#define ae__ 38 +#define me__ 39 +#define te__ 40 +#define ed__ 41 +#define ei__ 42 /* exit insert mode */ +#define se__ 43 /* exit standout mode */ +#define ue__ 44 +#define vb__ 45 +#define ff__ 46 +#define fs__ 47 +#define i1__ 48 +#define i2__ 49 +#define i3__ 50 +#define if__ 51 +#define ic__ 52 +#define al__ 53 +#define ip__ 54 +#define kb__ 55 /* backspace key */ +#define ka__ 56 +#define kC__ 57 +#define kt__ 58 +#define kD__ 59 +#define kL__ 60 +#define kd__ 61 +#define kM__ 62 +#define kE__ 63 +#define kS__ 64 +#define k0__ 65 +#define k1__ 66 +#define kf10__ 67 +#define k2__ 68 +#define k3__ 69 +#define k4__ 70 +#define k5__ 71 +#define k6__ 72 +#define k7__ 73 +#define k8__ 74 +#define k9__ 75 +#define kh__ 76 +#define kI__ 77 +#define kA__ 78 +#define kl__ 79 +#define kH__ 80 +#define kN__ 81 +#define kP__ 82 +#define kr__ 83 +#define kF__ 84 +#define kR__ 85 +#define kT__ 86 +#define ku__ 87 /* key up */ +#define ke__ 88 +#define ks__ 89 +#define l0__ 90 +#define l1__ 91 +#define la__ 92 +#define l2__ 93 +#define l3__ 94 +#define l4__ 95 +#define l5__ 96 +#define l6__ 97 +#define l7__ 98 +#define l8__ 99 +#define l9__ 100 +#define mo__ 101 +#define mm__ 102 +#define nw__ 103 +#define pc__ 104 +#define DC__ 105 +#define DL__ 106 +#define DO__ 107 +#define IC__ 118 +#define SF__ 109 +#define AL__ 110 +#define LE__ 111 +#define RI__ 112 +#define SR__ 113 +#define UP__ 114 +#define pk__ 115 +#define pl__ 116 +#define px__ 117 +#define ps__ 118 +#define pf__ 119 +#define po__ 120 +#define rp__ 121 +#define r1__ 122 +#define r2__ 123 +#define r3__ 124 +#define rf__ 125 +#define rc__ 126 +#define cv__ 127 +#define sc__ 128 +#define sf__ 129 +#define sr__ 130 +#define sa__ 131 /* sgr */ +#define st__ 132 +#define wi__ 133 +#define ta__ 134 +#define ts__ 135 +#define uc__ 136 +#define hu__ 137 +#define iP__ 138 +#define K1__ 139 +#define K2__ 140 +#define K3__ 141 +#define K4__ 142 +#define K5__ 143 +#define pO__ 144 +#define ml__ 145 +#define mu__ 146 +#define rmp__ 145 +#define acsc__ 146 +#define pln__ 147 +#define kcbt__ 148 +#define smxon__ 149 +#define rmxon__ 150 +#define smam__ 151 +#define rmam__ 152 +#define xonc__ 153 +#define xoffc__ 154 +#define enacs__ 155 +#define smln__ 156 +#define rmln__ 157 +#define kbeg__ 158 +#define kcan__ 159 +#define kclo__ 160 +#define kcmd__ 161 +#define kcpy__ 162 +#define kcrt__ 163 +#define kend__ 164 +#define kent__ 165 +#define kext__ 166 +#define kfnd__ 167 +#define khlp__ 168 +#define kmrk__ 169 +#define kmsg__ 170 +#define kmov__ 171 +#define knxt__ 172 +#define kopn__ 173 +#define kopt__ 174 +#define kprv__ 175 +#define kprt__ 176 +#define krdo__ 177 +#define kref__ 178 +#define krfr__ 179 +#define krpl__ 180 +#define krst__ 181 +#define kres__ 182 +#define ksav__ 183 +#define kspd__ 184 +#define kund__ 185 +#define kBEG__ 186 +#define kCAN__ 187 +#define kCMD__ 188 +#define kCPY__ 189 +#define kCRT__ 190 +#define kDC__ 191 +#define kDL__ 192 +#define kslt__ 193 +#define kEND__ 194 +#define kEOL__ 195 +#define kEXT__ 196 +#define kFND__ 197 +#define kHLP__ 198 +#define kHOM__ 199 +#define kIC__ 200 +#define kLFT__ 201 +#define kMSG__ 202 +#define kMOV__ 203 +#define kNXT__ 204 +#define kOPT__ 205 +#define kPRV__ 206 +#define kPRT__ 207 +#define kRDO__ 208 +#define kRPL__ 209 +#define kRIT__ 210 +#define kRES__ 211 +#define kSAV__ 212 +#define kSPD__ 213 +#define kUND__ 214 +#define rfi__ 215 +#define kf11__ 216 +#define kf12__ 217 +#define kf13__ 218 +#define kf14__ 219 +#define kf15__ 220 +#define kf16__ 221 +#define kf17__ 222 +#define kf18__ 223 +#define kf19__ 224 +#define kf20__ 225 +#define kf21__ 226 +#define kf22__ 227 +#define kf23__ 228 +#define kf24__ 229 +#define kf25__ 230 +#define kf26__ 231 +#define kf27__ 232 +#define kf28__ 233 +#define kf29__ 234 +#define kf30__ 235 +#define kf31__ 236 +#define kf32__ 237 +#define kf33__ 238 +#define kf34__ 239 +#define kf35__ 240 +#define kf36__ 241 +#define kf37__ 242 +#define kf38__ 243 +#define kf39__ 244 +#define kf40__ 245 +#define kf41__ 246 +#define kf42__ 247 +#define kf43__ 248 +#define kf44__ 249 +#define kf45__ 250 +#define kf46__ 251 +#define kf47__ 252 +#define kf48__ 253 +#define kf49__ 254 +#define kf50__ 255 +#define kf51__ 256 +#define kf52__ 257 +#define kf53__ 258 +#define kf54__ 259 +#define kf55__ 260 +#define kf56__ 261 +#define kf57__ 262 +#define kf58__ 263 +#define kf59__ 264 +#define kf60__ 265 +#define kf61__ 266 +#define kf62__ 267 +#define kf63__ 268 +#define el1__ 269 +#define mgc__ 270 +#define smgl__ 271 +#define smgr__ 272 + +#ifdef CAP +char *Boolean_names[] = { +"bw", "am", "xb", "xs", "xn", "eo", "gn", "hc", "km", "hs", "in", "da", "db", +"mi", "ms", "os", "es", "xt", "hz", "ul", "xo", "HC", "nx", "NR", "NP", "5i" +}; + +char *Number_names[] = { +"co#", "it#", "li#", "lm#", "sg#", "pb#", "vt#", "ws#", "Nl#", "lh#", "lw#" +}; + +char *String_names[] = { +"bt=", "bl=", "cr=", "cs=", "ct=", "cl=", "ce=", "cd=", "ch=", "CC=", "cm=", +"do=", "ho=", "vi=", "le=", "CM=", "ve=", "nd=", "ll=", "up=", "vs=", "dc=", +"dl=", "ds=", "hd=", "as=", "mb=", "md=", "ti=", "dm=", "mh=", "im=", "mk=", +"mp=", "mr=", "so=", "us=", "ec=", "ae=", "me=", "te=", "ed=", "ei=", "se=", +"ue=", "vb=", "ff=", "fs=", "i1=", "i2=", "i3=", "if=", "ic=", "al=", "ip=", +"kb=", "ka=", "kC=", "kt=", "kD=", "kL=", "kd=", "kM=", "kE=", "kS=", "k0=", +"k1=", "k;=", "k2=", "k3=", "k4=", "k5=", "k6=", "k7=", "k8=", "k9=", "kh=", +"kI=", "kA=", "kl=", "kH=", "kN=", "kP=", "kr=", "kF=", "kR=", "kT=", "ku=", +"ke=", "ks=", "l0=", "l1=", "la=", "l2=", "l3=", "l4=", "l5=", "l6=", "l7=", +"l8=", "l9=", "mo=", "mm=", "nw=", "pc=", "DC=", "DL=", "DO=", "IC=", "SF=", +"AL=", "LE=", "RI=", "SR=", "UP=", "pk=", "pl=", "px=", "ps=", "pf=", "po=", +"rp=", "r1=", "r2=", "r3=", "rf=", "rc=", "cv=", "sc=", "sf=", "sr=", "sa=", +"st=", "wi=", "ta=", "ts=", "uc=", "hu=", "iP=", "K1=", "K3=", "K2=", "K4=", +"K5=", "pO=", "rP=", "ac=", "pn=", "kB=", "SX=", "RX=", "SA=", "RA=", "XN=", +"XF=", "eA=", "LO=", "LF=", "@1=", "@2=", "@3=", "@4=", "@5=", "@6=", "@7=", +"@8=", "@9=", "@0=", "%1=", "%2=", "%3=", "%4=", "%5=", "%6=", "%7=", "%8=", +"%9=", "%0=", "&1=", "&2=", "&3=", "&4=", "&5=", "&6=", "&7=", "&8=", "&9=", +"&0=", "*1=", "*2=", "*3=", "*4=", "*5=", "*6=", "*7=", "*8=", "*9=", "*0=", +"#1=", "#2=", "#3=", "#4=", "%a=", "%b=", "%c=", "%d=", "%e=", "%f=", "%g=", +"%h=", "%i=", "%j=", "!1=", "!2=", "!3=", "RF=", "F1=", "F2=", "F3=", "F4=", +"F5=", "F6=", "F7=", "F8=", "F9=", "FA=", "FB=", "FC=", "FD=", "FE=", "FF=", +"FG=", "FH=", "FI=", "FJ=", "FK=", "FL=", "FM=", "FN=", "FO=", "FP=", "FQ=", +"FR=", "FS=", "FT=", "FU=", "FV=", "FW=", "FX=", "FY=", "FZ=", "Fa=", "Fb=", +"Fc=", "Fd=", "Fe=", "Ff=", "Fg=", "Fh=", "Fi=", "Fj=", "Fk=", "Fl=", "Fm=", +"Fn=", "Fo=", "Fp=", "Fq=", "Fr=", "cb=", "MC=", "ML=", "MR=" +}; +#endif + +char *new_curse = "October 1987"; + +char in_buff[100]; /* buffer for ungetch */ +int bufp; /* next free position in in_buff */ + +char *TERMINAL_TYPE = NULL; /* terminal type to be gotten from environment */ +int CFOUND = FALSE; +int Data_Line_len = 0; +int Max_Key_len; /* max length of a sequence sent by a key */ +char *Data_Line = NULL; +char *TERM_PATH = NULL; +char *TERM_data_ptr = NULL; +char *Term_File_name = NULL; /* name of file containing terminal description */ +FILE *TFP; /* file pointer to file with terminal des. */ +int Fildes; /* file descriptor for terminfo file */ +int STAND = FALSE; /* is standout mode activated? */ +int TERM_INFO = FALSE; /* is terminfo being used (TRUE), or termcap (FALSE) */ +int Time_Out; /* set when time elapsed while trying to read function key */ +int Curr_x; /* current x position on screen */ +int Curr_y; /* current y position on the screen */ +int LINES; +int COLS; +int Move_It; /* flag to move cursor if magic cookie glitch */ +int initialized = FALSE; /* tells whether new_curse is initialized */ +float speed; +float chars_per_millisecond; +int Repaint_screen; /* if an operation to change screen impossible, repaint screen */ +int Intr; /* storeage for interrupt character */ +int Parity; /* 0 = no parity, 1 = odd parity, 2 = even parity */ +int Noblock; /* for BSD systems */ +int Num_bits; /* number of bits per character */ +int Flip_Bytes; /* some systems have byte order reversed */ +int interrupt_flag = FALSE; /* set true if SIGWINCH received */ + +#ifndef CAP +char *Strings; +#endif + +#if !defined(TERMCAP) +#define TERMCAP "/etc/termcap" +#endif + +struct KEYS { + int length; /* length of string sent by key */ + char *string; /* string sent by key */ + int value; /* CURSES value of key (9-bit) */ + }; + +struct KEY_STACK { + struct KEYS *element; + struct KEY_STACK *next; + }; + +struct KEY_STACK *KEY_TOS = NULL; +struct KEY_STACK *KEY_POINT; + +/* + | + | Not all systems have good terminal information, so we will define + | keyboard information here for the most widely used terminal type, + | the VT100. + | + */ + +struct KEYS vt100[] = + { + { 3, "\033[A", 0403 }, /* key up */ + { 3, "\033[C", 0405 }, /* key right */ + { 3, "\033[D", 0404 }, /* key left */ + + { 4, "\033[6~", 0522 }, /* key next page */ + { 4, "\033[5~", 0523 }, /* key prev page */ + { 3, "\033[[", 0550 }, /* key end */ + { 3, "\033[@", 0406 }, /* key home */ + { 4, "\033[2~", 0513 }, /* key insert char */ + + { 3, "\033[y", 0410 }, /* key F0 */ + { 3, "\033[P", 0411 }, /* key F1 */ + { 3, "\033[Q", 0412 }, /* key F2 */ + { 3, "\033[R", 0413 }, /* key F3 */ + { 3, "\033[S", 0414 }, /* key F4 */ + { 3, "\033[t", 0415 }, /* key F5 */ + { 3, "\033[u", 0416 }, /* key F6 */ + { 3, "\033[v", 0417 }, /* key F7 */ + { 3, "\033[l", 0420 }, /* key F8 */ + { 3, "\033[w", 0421 }, /* key F9 */ + { 3, "\033[x", 0422 }, /* key F10 */ + + { 5, "\033[10~", 0410 }, /* key F0 */ + { 5, "\033[11~", 0411 }, /* key F1 */ + { 5, "\033[12~", 0412 }, /* key F2 */ + { 5, "\033[13~", 0413 }, /* key F3 */ + { 5, "\033[14~", 0414 }, /* key F4 */ + { 5, "\033[15~", 0415 }, /* key F5 */ + { 5, "\033[17~", 0416 }, /* key F6 */ + { 5, "\033[18~", 0417 }, /* key F7 */ + { 5, "\033[19~", 0420 }, /* key F8 */ + { 5, "\033[20~", 0421 }, /* key F9 */ + { 5, "\033[21~", 0422 }, /* key F10 */ + { 5, "\033[23~", 0423 }, /* key F11 */ + { 5, "\033[24~", 0424 }, /* key F12 */ + { 3, "\033[q", 0534 }, /* ka1 upper-left of keypad */ + { 3, "\033[s", 0535 }, /* ka3 upper-right of keypad */ + { 3, "\033[r", 0536 }, /* kb2 center of keypad */ + { 3, "\033[p", 0537 }, /* kc1 lower-left of keypad */ + { 3, "\033[n", 0540 }, /* kc3 lower-right of keypad */ + + /* + | The following are the same keys as above, but with + | a different character following the escape char. + */ + + { 3, "\033OA", 0403 }, /* key up */ + { 3, "\033OC", 0405 }, /* key right */ + { 3, "\033OD", 0404 }, /* key left */ + { 3, "\033OB", 0402 }, /* key down */ + { 4, "\033O6~", 0522 }, /* key next page */ + { 4, "\033O5~", 0523 }, /* key prev page */ + { 3, "\033O[", 0550 }, /* key end */ + { 3, "\033O@", 0406 }, /* key home */ + { 4, "\033O2~", 0513 }, /* key insert char */ + + { 3, "\033Oy", 0410 }, /* key F0 */ + { 3, "\033OP", 0411 }, /* key F1 */ + { 3, "\033OQ", 0412 }, /* key F2 */ + { 3, "\033OR", 0413 }, /* key F3 */ + { 3, "\033OS", 0414 }, /* key F4 */ + { 3, "\033Ot", 0415 }, /* key F5 */ + { 3, "\033Ou", 0416 }, /* key F6 */ + { 3, "\033Ov", 0417 }, /* key F7 */ + { 3, "\033Ol", 0420 }, /* key F8 */ + { 3, "\033Ow", 0421 }, /* key F9 */ + { 3, "\033Ox", 0422 }, /* key F10 */ + + { 5, "\033O10~", 0410 }, /* key F0 */ + { 5, "\033O11~", 0411 }, /* key F1 */ + { 5, "\033O12~", 0412 }, /* key F2 */ + { 5, "\033O13~", 0413 }, /* key F3 */ + { 5, "\033O14~", 0414 }, /* key F4 */ + { 5, "\033O15~", 0415 }, /* key F5 */ + { 5, "\033O17~", 0416 }, /* key F6 */ + { 5, "\033O18~", 0417 }, /* key F7 */ + { 5, "\033O19~", 0420 }, /* key F8 */ + { 5, "\033O20~", 0421 }, /* key F9 */ + { 5, "\033O21~", 0422 }, /* key F10 */ + { 5, "\033O23~", 0423 }, /* key F11 */ + { 5, "\033O24~", 0424 }, /* key F12 */ + { 3, "\033Oq", 0534 }, /* ka1 upper-left of keypad */ + { 3, "\033Os", 0535 }, /* ka3 upper-right of keypad */ + { 3, "\033Or", 0536 }, /* kb2 center of keypad */ + { 3, "\033Op", 0537 }, /* kc1 lower-left of keypad */ + { 3, "\033On", 0540 }, /* kc3 lower-right of keypad */ + + { 0, "", 0 } /* end */ + }; + +struct Parameters { + int value; + struct Parameters *next; + }; + +int Key_vals[] = { + 0407, 0526, 0515, 0525, 0512, 0510, 0402, 0514, 0517, 0516, 0410, 0411, + 0422, 0412, 0413, 0414, 0415, 0416, 0417, 0420, 0421, 0406, 0513, 0511, + 0404, 0533, 0522, 0523, 0405, 0520, 0521, 0524, 0403, + 0534, 0535, 0536, 0537, 0540, 0541, 0542, 0543, 0544, 0545, 0546, 0547, + 0550, 0527, 0551, 0552, 0553, 0554, 0555, 0556, 0557, 0560, 0561, 0562, + 0532, 0563, 0564, 0565, 0566, 0567, 0570, 0571, 0627, 0630, 0572, 0573, + 0574, 0575, 0576, 0577, 0600, 0601, 0602, 0603, 0604, 0605, 0606, 0607, + 0610, 0611, 0612, 0613, 0614, 0615, 0616, 0617, 0620, 0621, 0622, 0623, + 0624, 0625, 0626, 0423, 0424, 0425, 0426, 0427, 0430, 0431, + 0432, 0433, 0434, 0435, 0436, 0437, 0440, 0441, 0442, 0443, 0444, 0445, + 0446, 0447, 0450, 0451, 0452, 0453, 0454, 0455, 0456, 0457, 0460, 0461, + 0462, 0463, 0464, 0465, 0466, 0467, 0470, 0471, 0472, 0473, 0474, 0475, + 0476, 0477, 0500, 0501, 0502, 0503, 0504, 0505, 0506, 0507 +}; + +int attributes_set[9]; + +static int nc_attributes = 0; /* global attributes for new_curse to observe */ + +#ifdef SYS5 +struct termio Terminal; +struct termio Saved_tty; +#else +struct sgttyb Terminal; +struct sgttyb Saved_tty; +#endif + +char *tc_; + +int Booleans[128]; +int Numbers[128]; +char *String_table[1024]; + +int *virtual_lines; + +static char nc_scrolling_ability = FALSE; + +#ifdef CAP + +#if defined(__STDC__) || defined(__cplusplus) +#define P_(s) s +#else +#define P_(s) () +#endif /* __STDC__ */ + +int tc_Get_int P_((int)); +void CAP_PARSE P_((void)); +void Find_term P_((void)); + +#undef P_ + +#endif /* CAP */ + + +#ifndef __STDC__ +#ifndef HAS_STDLIB +extern char *fgets(); +extern char *malloc(); +extern char *getenv(); +FILE *fopen(); /* declaration for open function */ +#endif /* HAS_STDLIB */ +#endif /* __STDC__ */ + +#ifdef SIGWINCH + +/* + | Copy the contents of one window to another. + */ + +void +copy_window(origin, destination) +WINDOW *origin, *destination; +{ + int row, column; + struct _line *orig, *dest; + + orig = origin->first_line; + dest = destination->first_line; + + for (row = 0; + row < (min(origin->Num_lines, destination->Num_lines)); + row++) + { + for (column = 0; + column < (min(origin->Num_cols, destination->Num_cols)); + column++) + { + dest->row[column] = orig->row[column]; *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905261853.n4QIriAE069252>