summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1999-11-24 12:34:28 +0000
committerpeter <peter@FreeBSD.org>1999-11-24 12:34:28 +0000
commit48603c7746f57ffcad2316c665d396c1614a89d2 (patch)
treeea0ffcc0f51b6c763ebc82157875ed13a1638eb3
parent610bf0583921fb3be1aba58505c4a2b4bab828ec (diff)
downloadFreeBSD-src-48603c7746f57ffcad2316c665d396c1614a89d2.zip
FreeBSD-src-48603c7746f57ffcad2316c665d396c1614a89d2.tar.gz
Ensure libmytinfo stays dead.. I originally left it here so that we might
be able to build the old shared versions rather than taking a binary for the compat area, but that seems to have caused confusion.
-rw-r--r--lib/libmytinfo/EXAMPLES/terminfo.src104
-rw-r--r--lib/libmytinfo/INSTALL211
-rw-r--r--lib/libmytinfo/Makefile66
-rw-r--r--lib/libmytinfo/README75
-rw-r--r--lib/libmytinfo/README.doc125
-rw-r--r--lib/libmytinfo/TESTS/Makefile42
-rw-r--r--lib/libmytinfo/TESTS/caps.c173
-rw-r--r--lib/libmytinfo/TESTS/clear.c156
-rw-r--r--lib/libmytinfo/TESTS/quit.c72
-rw-r--r--lib/libmytinfo/TESTS/tput.c196
-rw-r--r--lib/libmytinfo/TESTS/tset.c919
-rw-r--r--lib/libmytinfo/TESTS/ttest.c297
-rw-r--r--lib/libmytinfo/addstr.c88
-rw-r--r--lib/libmytinfo/bin_order48
-rw-r--r--lib/libmytinfo/bsearch.c97
-rw-r--r--lib/libmytinfo/buildpath.c198
-rw-r--r--lib/libmytinfo/cap_list529
-rw-r--r--lib/libmytinfo/compar.c40
-rw-r--r--lib/libmytinfo/config.h89
-rw-r--r--lib/libmytinfo/defs.h195
-rw-r--r--lib/libmytinfo/fillterm.c81
-rw-r--r--lib/libmytinfo/findcap.c149
-rw-r--r--lib/libmytinfo/findterm.c286
-rw-r--r--lib/libmytinfo/getother.c49
-rw-r--r--lib/libmytinfo/gettbin.c127
-rw-r--r--lib/libmytinfo/gettcap.c276
-rw-r--r--lib/libmytinfo/gettinfo.c303
-rw-r--r--lib/libmytinfo/mkbinorder.c116
-rw-r--r--lib/libmytinfo/mkcaplist.c166
-rw-r--r--lib/libmytinfo/mkcapsort.c134
-rw-r--r--lib/libmytinfo/mktermhead.c160
-rw-r--r--lib/libmytinfo/mkversion.c35
-rw-r--r--lib/libmytinfo/readcaps.c151
-rw-r--r--lib/libmytinfo/tcapconv.c194
-rw-r--r--lib/libmytinfo/tcapvars.c36
-rw-r--r--lib/libmytinfo/term.h664
-rw-r--r--lib/libmytinfo/term.head527
-rw-r--r--lib/libmytinfo/term.tail137
-rw-r--r--lib/libmytinfo/termcap.c165
-rw-r--r--lib/libmytinfo/terminfo.c132
-rw-r--r--lib/libmytinfo/tgoto.c148
-rw-r--r--lib/libmytinfo/tiget.c51
-rw-r--r--lib/libmytinfo/tmatch.c37
-rw-r--r--lib/libmytinfo/tparm.c808
-rw-r--r--lib/libmytinfo/tputs.c266
-rw-r--r--lib/libmytinfo/tty.c457
-rw-r--r--lib/libmytinfo/version.h10
47 files changed, 0 insertions, 9385 deletions
diff --git a/lib/libmytinfo/EXAMPLES/terminfo.src b/lib/libmytinfo/EXAMPLES/terminfo.src
deleted file mode 100644
index 0fed13e..0000000
--- a/lib/libmytinfo/EXAMPLES/terminfo.src
+++ /dev/null
@@ -1,104 +0,0 @@
-#
-# terminfo.src
-#
-# By Ross Ridge
-# Public Domain
-# 92/02/01 07:30:32
-#
-# Some sample terminfo definitions
-#
-# @(#) mytinfo terminfo.src 3.2 92/02/01 public domain, By Ross Ridge
-#
-#
-dumb|dumb terminal, gn, co#80,
-#
-# Note not all ANSI terminals will support all of these capabilities.
-# This doesn't define any real terminal, and probably wouldn't work
-# with any real terminal either.
-#
-ansi-all|ANS X3.64-1979 terminal,
- cr=^M, cud1=^J, ind=^J, nel=^M^J, bell=^G, cub1=^H,
- cuu1=\EM, ff=^L, ht=^I,
- .ind=\ED, .nel=\EE, hts=\EH, hd=\EK, hu=\EL, ri=\EM,
- .ich1=\E[@, .ich=\E[%p1%d@, .cuu1=\E[A, cuu=\E[%p1%dA,
- cud1=\E[B, .cud=\E[%p1%dB, cuf1=\E[C, cuf=\E[%p1%dC,
- .cub1=\E[D, cub=\E[%p1%dD, .cnl=\E[%p1%dE, .cpl=\E[%p1%dF,
- .hpa=\E[%i%p1%dG, cup=\E[%i%p1%d;%p2%dH, .cht=\E[%p1%dI,
- ed=\E[J, el=\E[K, el1=\E[1K, il1=\E[L, il=\E[%p1%dL,
- dl1=\E[M, dl=\E[%p1%dM, .ef=\E[N, .ea=\E[O,
- dch1=\E[P, dch=\E[%p1%dP, .sem=\E[%p1%dQ,
- .cpr=\E[%i%p1%d;%p2%dR, indn=\E[%p1%dS, .ind=\E[S,
- rin=\E[%p1%dT, .ri=\E[T, .np=\E[%p1%dU, .pp=\E[%p1%dU,
- .ctc=\E[%p1%dW, ech=\E[%p1%dX, .cvt=\E[%p1%dY,
- cbt=\E[Z, hpa=\E[%i%p1%d`, .hpr=\E[%p1%da,
- rep=%p1%c%?%p2%{1}%>%t\E[%p2%{1}%-%db%;,
- .da=\E[c, vpa=\E[%i%p1%dd, .vpr=\E[%p1%e,
- .hvp=\E[%i%p1%d;%p2%df, tbc=\E[3g,
- mc=\E[0i, mc4=\E[4i, mc5=\E[5i,
- sgr=\E[%?%p6%t;1%;%?%p5%p1%|%t;2%;%?%p2%t;4%;%?%p4%t;6%;%?%p3%p1%|%t;7%;%?%p7%t;8%;m,
- smso=\E[1;7m, rmso=\E[m, smul=\E[4m, rmul=\E[m,
- blink=\E[6m, bold=\E[1m, invis=\E[8m, rev=\E[7m,
- sgr0=\E[m, .dsr=\E[%p1%dn, .daq=\E[%p1%do,
- .sl=\E[%p1%d\s@, .sr=\E[%p1%d\sA, clear=\E[H\EJ, home=\E[H,
- smir=\E[4h, rmir=\E[4l,
- is2=\E[1Q\E[1;2;3;4;5;7;10;11;13;14;16;15;17;18;19;20l\E[6;12h\E[m,
- rs2=\Ec\E[1Q\E[1;2;3;4;5;7;10;11;13;14;16;15;17;18;19;20l\E[6;12h\E[m\E[H\EJ,
-ansi-all-8|ANS X3.64-1979 terminal (8 bit),
- cr=^M, cud1=^J, ind=^J, nel=^M^J, bell=^G, cub1=^H,
- cuu1=\215, ff=^L, ht=^I,
- .ind=\204, .nel=\205, hts=\207, hd=\213, hu=\214, ri=\215,
- .ich1=\233@, .ich=\E%p1%d@, .cuu1=\233A, cuu=\233%p1%dA,
- cud1=\233B, .cud=\233%p1%dB, cuf1=\233C, cuf=\233%p1%dC,
- .cub1=\233D, cub=\233%p1%dD, .cnl=\233%p1%dE, .cpl=\233%p1%dF,
- .hpa=\233%i%p1%dG, cup=\233%i%p1%d;%p2%dH, .cht=\233%p1%dI,
- ed=\233J, el=\233K, el1=\2331K, il1=\233L, il=\233%p1%dL,
- dl1=\233M, dl=\233%p1%dM, .ef=\233N, .ea=\233O,
- dch1=\233P, dch=\233%p1%dP, .sem=\233%p1%dQ,
- .cpr=\233%i%p1%d;%p2%dR, indn=\233%p1%dS, .ind=\233S,
- rin=\233%p1%dT, .ri=\233T, .np=\233%p1%dU, .pp=\233%p1%dU,
- .ctc=\233%p1%dW, ech=\233%p1%dX, .cvt=\233%p1%dY,
- cbt=\233Z, hpa=\233%i%p1%d`, .hpr=\233%p1%da,
- rep=%p1%c%?%p2%{1}%>%t\233%p2%{1}%-%db%;,
- .da=\233c, vpa=\233%i%p1%dd, .vpr=\233%p1%e,
- .hvp=\233%i%p1%d;%p2%df, tbc=\2333g,
- mc=\2330i, mc4=\2334i, mc5=\2334i,
- sgr=\233%?%p6%t;1%;%?%p5%p1%|%t;2%;%?%p2%t;4%;%?%p4%t;6%;%?%p3%p1%|%t;7%;%?%p7%t;8%;m,
- smso=\2331;7m, rmso=\233m, smul=\2334m, rmul=\233m,
- blink=\2336m, bold=\2331m, invis=\2338m, rev=\2337m,
- sgr0=\233m, .dsr=\233%p1%dn, .daq=\233%p1%do,
- .sl=\233%p1%d\s@, .sr=\233%p1%d\sA, clear=\233H\EJ, home=\233H,
- smir=\2334h, rmir=\2334l,
- is2=\2331Q\2331;2;3;4;5;7;10;11;13;14;16;15;17;18;19;20l\2336;12h\233m,
- rs2=\Ec\2331Q\2331;2;3;4;5;7;10;11;13;14;16;15;17;18;19;20l\2336;12h\233m\233H\EJ,
-#
-# Not tested...
-#
-vt100|dec vt100,
- xon, UWxc, msgr,
- cols#80, lines#24, it#8, vt#3,
- cr=\r, csr=^[[%i%p1%d;%p2%dr, tbc=^[[3g, clear=^[[;H^[[2J$<100>,
- el=^[[K$<3>, ed=^[[J$<50>, cup=^[[%i%p1%d;%p2%dH$<5>, cud1=^[[B,
- home=^[[H, cub1=^[[D, cuf1=^[[C$<2>, cuu1=^[[A$<2>, blink=^[[5m$<2>,
- bold=^[[1m$<2>, rev=^[[7m$<2>, smso=^[[7m$<2>, smul=^[[4m$<2>,
- sgr0=^[[m^N$<2>, rmso=^[[m$<2>, rmul=^[[m$<2>, hts=^[H, ht=^I,
- is2=^[[1;24r^[[?1l^[[?3l^[[30h^[[?7h^[>, bell=^G,
- kbs=\b, kcud1=^[[B, kf0=^[OP, kf1=^[OQ, kf2=^[OR, kf3=^[OS,
- kcub1=^[[D, kcuf1=^[[C, kcuu1=^[[A, lf0=PF1, lf1=PF2,
- lf2=PF3, lf3=PF4, nel=\r^[D, cud=^[[%p1%dB, cub=^[[%p1%dD,
- cuf=^[[%p1%dC, cuu=^[[%p1%dA, rc=^[8, sc=^[7, ind=^[D, ri=^[M$<5>,
- sgr=^[[0;%?%p4%t;5%;%?%p6%t;1%;%?%p3%p1%|%t;7%;%?%p2%t;4%;m%?%p1%t^N%e^O%;$<2>,
- smacs=^O, rmacs=^N,
-vt100-am|vt100 with automatic margins,
- am, xenl, @el, @ed,
- use=vt100,
-vt102|dec vt102,
- is=\E<\E[1;24r\E[?1l\E[?3l\E[?5l\E[?7h\E>,
- il=\E[%p1%dL, dch=\E[%p1%dP, dl=\E[%p1%dM,
- il1=\E[L, dch1=\E[P, dl1=\E[M,
- mir, rmir=\E[4l, smir=\E[4h,
- use=vt100,
-vt200|vt220|vt200-js|vt220-js|dec vt200 series with jump scroll,
- clear=\E[H\E[J, rmso=\E[27m, rmul=\E[24m,
- is2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[1;24r\E[24;1H,
- rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h,
- use=vt102,
diff --git a/lib/libmytinfo/INSTALL b/lib/libmytinfo/INSTALL
deleted file mode 100644
index 3a0276d..0000000
--- a/lib/libmytinfo/INSTALL
+++ /dev/null
@@ -1,211 +0,0 @@
-Compiling this package requires a fair bit of knowledge about your system.
-There are no automatic configuration programmes or prepared configuration
-files for different type of systems. You will need to edit the Makefile
-to specify things like which compiler to use and any options it needs.
-The file config.h needs to be edited to reflect the system you are
-using and to enable and/or disable certain features.
-
-Defines in config.h
-===================
-
-USE_ANSIC
-
-Normally this will be defined automaticly if __STDC__ is defined, but
-if your compile isn't truly ANSI C compliant you may need to undefine this.
-
-USE_TERMIO
-
-Define this if your system uses the termio tty driver. System III and
-System V use termio.
-
-USE_SGTTY
-
-Define this if your system uses the "sgtty" tty driver. V7 Unix and BSD
-use sgtty.
-
-USE_WINSZ
-
-If you defined USE_SGTTY you can define this if your system supports
-SIGWINSZ and the accompaning ioctls. If this is defined the library
-will get number of columns and lines from the tty driver not the
-terminal description. BSD 4.3 supports SIGWINSZ. This will also work
-if USE_TERMIO is defined on some hybrid System V machines such as Release 4.
-
-Do not define both USE_TERMIO and USE_SGTTY. If your system supports both
-you'd probably be better of defining USE_TERMIO. If your system supports
-neither termio or sgtty you can leave USE_TERMIO and USE_SGTTY undefined,
-but this is only recommended for use with micomputers.
-
-USE_STRINGS
-
-If you define this then the header file <strings.h> will be included
-and BSD type string library assumed (index instead of strchr), otherwise
-<string.h> will included. If you have a BSD type system define this.
-If you have an ANSI C, System III, or System V type of system leave it
-undefined.
-
-USE_MYBSEARCH
-
-If your system's C library doesn't include bsearch, define this.
-Most System V systems have bsearch. However even your C library has this
-function you still may want to define USE_MYBSEARCH, see USE_SHORT_BSEARCH
-below. ("MYBSEARCH" is misnomer, I didn't write this routine.)
-
-USE_SHORT_BSEARCH
-
-If you define USE_MYBSEARCH you can define this so that the bsearch
-routine that library uses the type short instead of size_t (usually long)
-for it's arguments. This results a large speedup on 68000 based machines
-and possibly a significant speedup on others as well. However on some CPU's
-defining this will only make things slower.
-
-USE_MYSTRTOK
-
-If your system's C library doesn't include strtok, define this.
-Most ANSI C, System III, and System V systems have this.
-
-USE_MYQSORT
-
-If your system's C library doesn't include qsort, define this.
-All most all systems should have this function, if it doesn't complain
-to your vendor. The qsort routine comes from the GNU Emacs distribution.
-
-USE_MYMKDIR
-
-Define this if your system doesn't have the mkdir library function call.
-My routine simply calls the system command mkdir, you may have to
-edit mkdir.c if the pathname of that command isn't "/bin/mkdir".
-
-USE_MEMORY
-
-If your system has a <memory.h> header define this. If USE_MEMORY
-is not defined bcopy will used instead of memcpy.
-
-USE_SMALLMEM
-
-Use you can define use this to save some memory, but it doesn't
-save much at moment, and will only slow the library down.
-
-USE_FAKE_STDIO
-
-If you define this then the library won't use the real stdio but a
-fake one instead. This is for compatiblity with termcap and vi which
-don't use stdio.
-
-USE_DOPRNT
-
-If you don't have a vfprintf function, but you have a _doprnt function
-define this. If you don't have either than you can compile the library
-but not the support programmes. System V has vfprintf and most Unixes
-have a _doprnt (but probably not documented). BSD has released a freely
-distributable vfprintf for BSD Unixes.
-
-USE_UPBC_KLUDGE
-
-Define this if you want the library's tgoto to work like termcap's tgoto
-and avoid putting ^D, and \n into an output string by using the cursor up
-and backspace strings.
-
-USE_EXTERN_UPBC
-
-If you defined USE_UPBC_KLUDGE you can define this so tgoto will,
-like termcap's tgoto, get the cursor up and backspace strings from the
-externs UP and BC instead from the library's internal record.
-
-USE_LITOUT_KLUDGE
-
-Don't define this. It's another kludge for tgoto.
-
-If neither USE_UPBC_KLUDGE or USE_LITOUT_KLUDGE is defined then tgoto
-won't worry about putting ^D, and \n in a string.
-
-USE_PROTOTYPES
-
-Define this if your compiler supports ANSI C style prototypes.
-
-USE_STDLIB
-
-Define this if your system has an <stdlib.h> header.
-
-USE_STDARG
-
-Define this if your system has an <stdarg.h> header. If this isn't
-defined <varargs.h> will be included instead.
-
-USE_STDDEF
-
-Define this if your system has an <stddef.h> header. If this isn't
-defined <sys/types.h> will be included instead.
-
-typedef char *anyptr;
-
-You should change the typedef to a type that any pointer can be assigned
-to or from. ANSI C compilers can use "typedef void *anyptr", most
-other compilers should use "typedef char *anyptr".
-
-#define mysize_t unsigned
-
-"mysize_t" needs to defined as the type of the size of an object, or
-the type of the sizeof operator. Traditional usage is "unsigned", for
-ANSI C you should define mysize_t as "size_t".
-
-TERMCAPFILE
-
-Define this to a string containing the default termcap file(s) to look
-for terminal descriptions in. Multiple filenames should be seperated
-by spaces and environment variables can be specfied by prefixing them
-with dolar signs ($). eg:
- #define TERMCAPFILE "$TERMCAPFILE $HOME/.termcap /etc/termcap"
-
-TERMINFOSRC
-
-Define this to a string containing the default terminfo source file to
-look for terminal descriptions in.
-
-TERMINFODIR
-
-Define this as the directory containing the default terminfo database,
-usually "/usr/lib/terminfo".
-
-Any of TERMCAPFILE, TERMINFOSRC or TERMINFODIR can be left undefined.
-
-
-defs.h
-======
-
-You may also need to edit defs.h and change the definitions of MAX_BUF,
-MAX_LINE, and MAX_NAME. Unless you are seriously starved for memory I
-don't recomend making them smaller.
-
-
-cap_list
-========
-
-You can add new capabilities to the file cap_list. You must provide
-a type, terminfo variable name, terminfo capname, and termcap name for
-all capabilities and you must make sure they are all unique.
-
-
-Making in the library
-=====================
-
-Once you've configured the package you can just type "make" and it
-will build the library and the "term.h" header. You can enter
-"make all" to make the library and the support programmes, tconv,
-cap2info, tic, clear, tput and tset. If you want a profiled library
-you can enter "make profiled". You can remove all the intermediate
-files with "make clean". "make spotless" will remove the target
-files as well.
-
-
-Installing the library
-======================
-
-As for installing it, that's up to you. Depending on how much you
-plan to use the libraries and whether or not you have termcap and/or
-terminfo already you can install them "standard" places (ie. /usr/lib,
-/usr/include, /usr/bin), in local directories, or just leave them in
-the source directory. However if you are compiling programmes that
-use terminfo and linking it with this library you must make sure that
-this library's term.h file is included in your programme and not the
-system supplied one.
diff --git a/lib/libmytinfo/Makefile b/lib/libmytinfo/Makefile
deleted file mode 100644
index 89eff2b..0000000
--- a/lib/libmytinfo/Makefile
+++ /dev/null
@@ -1,66 +0,0 @@
-# Makefile for libmytinfo
-# Use 'make update_term_h' manually after changing internal
-# mytinfo structures
-# $FreeBSD$
-
-LIB= mytinfo
-SRCS= addstr.c binorder.c buildpath.c caplist.c capsort.c compar.c\
- fillterm.c findcap.c findterm.c getother.c gettbin.c\
- gettcap.c gettinfo.c tcapconv.c tcapvars.c termcap.c\
- terminfo.c tgoto.c tiget.c tmatch.c tparm.c tputs.c tty.c version.c
-CLEANFILES=binorder.c caplist.c capsort.c mkbinorder mkcaplist \
- mkcapsort mktermhead mkversion readcaps.o version.c
-
-CFLAGS+=-Wall -I${.CURDIR}
-
-CAPS= 1000
-
-# ${.CURDIR}/term.h: ${.CURDIR}/term.head ${.CURDIR}/term.tail
-update_term_h: ${.CURDIR}/term.head ${.CURDIR}/term.tail
- cat ${.CURDIR}/term.head ${.CURDIR}/term.tail > ${.CURDIR}/term.h
-
-beforeinstall:
- $(INSTALL) -C -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/term.h \
- ${DESTDIR}/usr/include
- ln -sf term.h ${DESTDIR}/usr/include/nterm.h
-
-build-tools: mkbinorder mkcaplist mkcapsort mkversion
-
-capsort.c: mkcapsort
- ./mkcapsort > capsort.c
-
-.for f in caplist capsort compar findcap
-CLEANFILES+=cross-$f.o
-cross-$f.o: $f.c
- ${CC} ${CFLAGS} -c -o ${.TARGET} ${.ALLSRC}
-.endfor
-
-mkcapsort: mkcapsort.c cross-caplist.o cross-compar.o
- $(CC) -static $(CFLAGS) $(LDFLAGS) -o ${.TARGET} ${.ALLSRC}
-
-binorder.c: mkbinorder ${.CURDIR}/bin_order
- ./mkbinorder ${.CURDIR}/bin_order > binorder.c
-
-mkbinorder: mkbinorder.c cross-capsort.o cross-caplist.o cross-compar.o \
- cross-findcap.o
- $(CC) -static $(CFLAGS) $(LDFLAGS) -o ${.TARGET} ${.ALLSRC}
-
-version.c: mkversion
- ./mkversion > version.c
-
-mkversion: mkversion.c
- $(CC) -static $(CFLAGS) $(LDFLAGS) -o mkversion ${.CURDIR}/mkversion.c
-
-${.CURDIR}/term.head: mktermhead ${.CURDIR}/cap_list
- ./mktermhead -n $(CAPS) ${.CURDIR}/cap_list > ${.CURDIR}/term.head
-
-caplist.c: mkcaplist ${.CURDIR}/cap_list
- ./mkcaplist -n $(CAPS) ${.CURDIR}/cap_list > caplist.c
-
-mktermhead: mktermhead.c readcaps.o
- $(CC) -static $(CFLAGS) $(LDFLAGS) -o mktermhead ${.CURDIR}/mktermhead.c readcaps.o
-
-mkcaplist: mkcaplist.c readcaps.o
- $(CC) -static $(CFLAGS) $(LDFLAGS) -o mkcaplist ${.CURDIR}/mkcaplist.c readcaps.o
-
-.include <bsd.lib.mk>
diff --git a/lib/libmytinfo/README b/lib/libmytinfo/README
deleted file mode 100644
index ea65c94..0000000
--- a/lib/libmytinfo/README
+++ /dev/null
@@ -1,75 +0,0 @@
-Mytinfo is Public Domain and comes with no guarantees.
-By Ross Ridge (ross@zooid.guild.org).
-
-Mytinfo is a single library that combines the functionality of the
-standard Unix termcap and terminfo libraries. It has the special
-ability of being able to fetch terminal descriptions from both
-termcap and terminfo databases regardless of which set of functions,
-termcap or terminfo, are used. It can even read terminal descriptions
-from terminfo source files.
-
-You should be able to compile this library on almost all versions of Unix.
-Much of it's development was done on '386 Xenix, but I've sucessfuly built
-mytinfo under BSD 4.3, HP-UX 2.1 (System III), SunOS 3.5, and Amix
-(System V R4). There hasn't been a large amount of testing of the support
-programmes that come with the library, but the library itself has been in
-use on a couple of public access Unix sites for over two years. It has
-successfully linked and run with many programmes such as rn, vi and nethack.
-
-Included in the package is tconv, an "all-in-one" programme that will
-compile terminfo sources to binary format and also translate termcap to
-either terminfo source or binary. tic and cap2info are just links
-to the tconv programme. I've also written replacement for tset,
-that uses the mytinfo library, in case tset doesn't come with your
-system or if you aren't too pleased with the one that did. Since this
-is the newest part of the package it probably still has a few bugs.
-You'll also find tput, as well two versions of clear, one that uses
-termcap and the other that uses terminfo.
-
-The environment variables TERMCAP and TERMINFO can have multiple
-filenames separated by a space, a feature not in terminfo and not in
-most termcaps. This is very handy for users that maintain their own
-private databases, as they don't have to have a copy the entire
-database. Eg:
- TERMCAP="$HOME/.termcap /etc/termcap"
- TERMINFO="$HOME/terminfo /usr/lib/terminfo"
- export TERMCAP TERMINFO
-The library will also check compiled-in default locations for terminal
-descriptions. Like most termcaps, the TERMCAP variable can also
-contain the complete termcap terminal description, usually supplied
-from tset at login. The TERMINFO variable can also contain a complete
-terminfo description, but there is no programme like tset to supply it.
-
-Unlike termcap, this library can only use capabilities that it knows about.
-However it does knows about all the standard ones, and you can easily
-add your own to it's list. Included in the list are all terminfo
-capabilities to Release 4 of System V, obsolete termcap capabilities, a
-few caps used from the University of Waterloo (UW), a couple from GNU Emacs,
-and a few I made up myself. Two extensions to the standard termcap % codes
-are supported, GNU's %a, %m, %b, and %f, and UW's %-, %a, and %s.
-
-Termcap and terminfo source descriptions can be mixed in one file, but
-because of this termcap databases must be in a certain style. All
-continuation lines of a termcap entry must be indented from the left
-margin by white space. This shouldn't be a problem with most sites
-since this is the style that most termcap files are distributed, but local
-additions may not adhere to this style. Another possible problem is
-that termcap entries should end with a colon (:), but in most
-distributed termcaps there are entries that don't. If a one line
-termcap entry doesn't end with a colon, it will be ignored. A quick
-way to find these is "tconv -c /etc/termcap > /dev/null".
-
-See the file INSTALL for instructions on configuring and installing
-this library. The file README.doc lists the functions supported by the
-library, and gives short description of the tconv programme. tconv.1 is
-a simple man page for tconv. terminfo.src contains a few sample
-terminal descriptions in terminfo source format. TODO is a list of
-possible enhancements too the library, your comments and additions
-are welcome.
-
-Please let me know of any bugs you find, as well as any ideas you have
-for improvement.
-
-Ross Ridge
-
-ross@zooid.guild.org
diff --git a/lib/libmytinfo/README.doc b/lib/libmytinfo/README.doc
deleted file mode 100644
index 04e1409..0000000
--- a/lib/libmytinfo/README.doc
+++ /dev/null
@@ -1,125 +0,0 @@
-----------------------------------------------------------------------------
-tconv [-b] [-c [-OUGd]] [-i] [-B [-D dir]] [-I] [-k] [-t term] [file]
-tic [file]
-cap2info [-t term] [-OUGdk] [file]
-
--c convert from termcap
--i convert from terminfo source
--b convert from terminfo binary
--B convert to terminfo binary
--I convert to terminfo source
-
-The following switches are available when converting from termcap:
--d don't supply any defaults for missing capabilities
--O include obsolete termcap capabilities
--G include GNU capabilities
--U include UW capabilities
-
--k keep comments
--D dir directory to put terminfo binaries in
-
--t term name of terminal to translate
-file filename of termcap/terminfo database to use
-
-If a file is specifed and no terminal is given the entire file we be translated.
-If no terminal and no file is specified then the terminal name will be taken
-from the environment varible TERM. Unless compiling to a terminfo binary,
-output is to stdout.
-----------------------------------------------------------------------------
-
-char *tparm(char *str, ...); /* up to nine parameters */
-char *tgoto(char *str, int column, int row);
-
-tparm and tgoto support the following termcap and terminfo % codes:
-
-Terminfo % Codes
-
- %% output a '%'
- %[[:][-+# ][width][.precision]][doxXs]
- output pop according to the printf format
- %c output pop as a char
- %'c' push character constant c.
- %{n} push decimal constant n.
- %p[1-9] push paramter [1-9]
- %g[a-z] push variable [a-z]
- %P[a-z] put pop in variable [a-z]
- %l push the length of pop (a string)
- %+ add pop to pop and push the result
- %- subtract pop from pop and push the result
- %* multiply pop and pop and push the result
- %& bitwise and pop and pop and push the result
- %| bitwise or pop and pop and push the result
- %^ bitwise xor pop and pop and push the result
- %~ push the bitwise not of pop
- %= compare if pop and pop are equal and push the result
- %> compare if pop is less than pop and push the result
- %< compare if pop is greater than pop and push the result
- %A logical and pop and pop and push the result
- %O logical or pop and pop and push the result
- %! push the logical not of pop
- %? condition %t if_true [%e if_false] %;
- if condtion evaulates as true then evaluate if_true,
- else evaluate if_false. elseif's can be done:
-%? cond %t true [%e cond2 %t true2] ... [%e condN %t trueN] [%e false] %;
- %i add one to parameters 1 and 2. (ANSI)
-
-Termcap Codes
-
- %% output a %
- %. output parameter as a character
- %d output parameter as a decimal number
- %2 output parameter in printf format %02d
- %3 output parameter in printf format %03d
- %+x add the character x to parameter and output it as a character
-(UW) %-x subtract parameter FROM the character x and output it as a char
-(UW) %ax add the character x to parameter
-(GNU) %a[+*-/=][cp]x
- GNU arithmetic.
-(UW) %sx subtract parameter FROM the character x
- %>xy if parameter > character x then add character y to parameter
- %B convert to BCD (parameter = (parameter/10)*16 + parameter%16)
- %D Delta Data encode (parameter = parameter - 2*(paramter%16))
- %i increment the first two parameters by one
- %n xor the first two parameters by 0140
-(GNU) %m xor the first two parameters by 0177
- %r swap the first two parameters
-(GNU) %b backup to previous parameter
-(GNU) %f skip this parameter
-
-(GNU) used by GNU Emacs termcap libraries
-(UW) used by the University of Waterloo (MFCF) termcap libraries
-
-Note the two definitions of %a, the GNU defintion is used if the characters
-after the 'a' are valid for it, otherwise the UW definition is used.
-----------------------------------------------------------------------------
-
-int setupterm(char *term; int fd; int *err);
-int set_curterm(TERMINAL *new);
-int del_curterm(TERMINAL *old);
-char *tparm(char *str, ...); /* see above */
-int tputs(char *str, int count, int (*putc)());
-int putp(str);
-int tigetflag(char *cap);
-int tigetnum(char *cap);
-char *tigetstr(char *cap);
-int def_prog_mode();
-int def_shell_mode();
-int reset_prog_mode();
-int reset_shell_mode();
-char *boolnames[], *boolcodes[], *boolfnames[];
-char *numnames[], *numcodes[], *numfnames[];
-char *strnames[], *strcodes[], *strfnames[];
-
-These functions work just like the terminfo functions. Note restartterm(),
-vidputs(), vidattr(), and mvcur() are not available.
-----------------------------------------------------------------------------
-
-int tgetent(char *buf, char *term);
-int tgetflag(char *cap);
-int tgetnum(char *cap);
-char *tgetstr(char *cap, char **area);
-char *tgoto(char *cap, int column, int row);
-int tputs(char *str, int count, int (*putc)());
-
-These functions work just like termcap functions.
-----------------------------------------------------------------------------
diff --git a/lib/libmytinfo/TESTS/Makefile b/lib/libmytinfo/TESTS/Makefile
deleted file mode 100644
index d9b7937..0000000
--- a/lib/libmytinfo/TESTS/Makefile
+++ /dev/null
@@ -1,42 +0,0 @@
-# Makefile for libmytinfo tests
-# $FreeBSD$
-
-LIB= mytinfo
-
-TESTS= ttest tputs.test tparm.test readcaps.test caps clear.tcap \
- clear.tinfo tset tput
-
-CFLAGS+= -Wall -I${.CURDIR}/..
-
-CLEANFILES+= $(TESTS) quit.o
-
-all: $(TESTS)
-
-ttest: ttest.c quit.o
- $(CC) $(CFLAGS) -o ttest $(LDFLAGS) ${.CURDIR}/ttest.c quit.o -l$(LIB)
-
-caps: caps.c quit.o
- $(CC) $(CFLAGS) -o caps $(LDFLAGS) ${.CURDIR}/caps.c quit.o -l$(LIB)
-
-tputs.test: ${.CURDIR}/../tputs.c
- $(CC) -o tputs.test $(LDFLAGS) $(CFLAGS) -DTEST ${.CURDIR}/../tputs.c -l$(LIB)
-
-tparm.test: ${.CURDIR}/../tparm.c
- $(CC) -o tparm.test $(LDFLAGS) $(CFLAGS) -DTEST ${.CURDIR}/../tparm.c -l$(LIB)
-
-readcaps.test: ${.CURDIR}/../readcaps.c
- $(CC) -o readcaps.test $(LDFLAGS) $(CFLAGS) -DTEST ${.CURDIR}/../readcaps.c -l$(LIB)
-
-clear.tcap: clear.c
- $(CC) $(LDFLAGS) $(CFLAGS) -o clear.tcap ${.CURDIR}/clear.c -l$(LIB)
-
-clear.tinfo: clear.c
- $(CC) $(LDFLAGS) $(CFLAGS) -DUSE_TERMINFO -o clear.tinfo ${.CURDIR}/clear.c -l$(LIB)
-
-tset: tset.c quit.o
- $(CC) $(CFLAGS) $(LDFLAGS) -o tset ${.CURDIR}/tset.c quit.o -l$(LIB)
-
-tput: tput.c quit.o
- $(CC) $(CFLAGS) $(LDFLAGS) -o tput ${.CURDIR}/tput.c quit.o -l$(LIB)
-
-.include <bsd.prog.mk>
diff --git a/lib/libmytinfo/TESTS/caps.c b/lib/libmytinfo/TESTS/caps.c
deleted file mode 100644
index e90d26e..0000000
--- a/lib/libmytinfo/TESTS/caps.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * caps.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/02/01 07:29:45
- *
- * caps [-c | -t] [term]
- *
- * -c use termcap names instead of terminfo variable names
- * -t use terminfo capnames instead of variables names
- * term name of terminal to use
- *
- * prints out all the capabilities given the specified terminal. If no
- * terminal is given, it is taken from the environment variable TERM.
- *
- */
-
-#define NOTLIB
-#include "defs.h"
-#include <term.h>
-
-const char SCCSid[] = "@(#) mytinfo caps.c 3.2 92/02/01 public domain, By Ross Ridge";
-
-/* output a string in a human readable format */
-void
-putstr(s)
-char *s; {
- while(*s != '\0') {
- switch(*s) {
- case '\n': printf("\\n"); break;
- case '\b': printf("\\b"); break;
- case '\t': printf("\\t"); break;
- case '\r': printf("\\r"); break;
- case '\f': printf("\\f"); break;
- case ' ': printf("\\s"); break;
- case '\177': printf("^?"); break;
- case '\200': printf("\\0"); break;
- default:
- if (*s > 0 && *s < 32)
- printf("^%c", *s + 64);
- else if (*s < 0)
- printf("\\%03o", *s & 0xff);
- else
- putchar(*s);
- break;
- }
- s++;
- }
-}
-
-void
-do_cleanup(e)
-int e; {
- fprintf(stderr, "usage: %s [-c | -t ] [terminal]\n", prg_name);
- return;
-}
-
-int
-main(argc, argv)
-int argc;
-char **argv; {
- int names = 0;
- register int i;
- int flag, num;
- char *str;
-
- prg_name = argv[0];
- cleanup = do_cleanup;
-
- if (argc > 3)
- quit(-1, "argument count");
-
- if (argc == 1)
- setupterm(NULL, 2, (int *) 0);
- else if (argc == 2) {
- if (argv[1][0] != '-')
- setupterm(argv[1], 2, (int *) 0);
- else {
- if (argv[1][1] == 'c')
- names = 2;
- else if (argv[1][1] == 't')
- names = 1;
- else
- quit(-1, "unknown switch '%c'", argv[1][1]);
- setupterm(NULL, 2, (int *) 0);
- }
- } else {
- if (argv[1][0] != '-')
- quit(-1, "bad switch");
- if (argv[1][1] == 'c')
- names = 2;
- else if (argv[1][1] == 't')
- names = 1;
- else
- quit(-1, "unknown switch '%c'", argv[1][1]);
- setupterm(argv[2], 2, (int *) 0);
-
- }
-
- fflush(stderr);
- fflush(stdout);
- printf("\n");
-#ifdef _CUR_TERM
- printf("%s: %s\n", cur_term->name, cur_term->name_all);
- printf("pad: %d xon: %d termcap: %d\n",
- cur_term->pad, cur_term->xon, cur_term->termcap);
- printf("true_columns: %d true_lines: %d baudrate: %lu\n",
- cur_term->true_columns, cur_term->true_lines,
- (unsigned long) cur_term->baudrate);
- printf("\n");
-#endif
-
- printf("Booleans:\n");
- for(i = 0; boolnames[i] != NULL; i++) {
-#ifdef _CUR_TERM
- flag = cur_term->bools[i];
-#else
- flag = tigetflag(boolnames[i]);
-#endif
- if (flag != -1 && flag != 0) {
- switch(names) {
- case 0:
- printf(" %s\n", boolfnames[i]);
- break;
- case 1:
- printf(" %s\n", boolnames[i]);
- break;
- case 2:
- printf(" %s\n", boolcodes[i]);
- break;
- }
- }
- }
-
- printf("\nNumerics:\n");
- for(i = 0; numnames[i] != NULL; i++) {
- num = tigetnum(numnames[i]);
- if (num != -2 && num != -1) {
- switch(names) {
- case 0:
- printf(" %-32s: %d\n", numfnames[i], num);
- break;
- case 1:
- printf(" %-5s: %d\n", numnames[i], num);
- break;
- case 2:
- printf(" %-2s: %d\n", numcodes[i], num);
- break;
- }
- }
- }
- printf("\nStrings:\n");
- for(i = 0; strnames[i] != NULL; i++) {
- str = tigetstr(strnames[i]);
- if (str != (char *) -1 && str != (char *) 0) {
- switch(names) {
- case 0:
- printf(" %-32s: ", strfnames[i]);
- break;
- case 1:
- printf(" %-5s: ", strnames[i]);
- break;
- case 2:
- printf(" %-2s: ", strcodes[i]);
- break;
- }
- putstr(str);
- putchar('\n');
- }
- }
- return 0;
-}
diff --git a/lib/libmytinfo/TESTS/clear.c b/lib/libmytinfo/TESTS/clear.c
deleted file mode 100644
index b603a52..0000000
--- a/lib/libmytinfo/TESTS/clear.c
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * clear.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/02/01 07:29:47
- *
- * clear
- *
- * clears the terminal's screen
- *
- */
-
-#include "defs.h"
-
-const char SCCSid[] = "@(#) mytinfo clear.c 3.2 92/02/01 public domain, By Ross Ridge";
-
-#ifndef USE_TERMINFO
-
-#ifdef USE_SGTTY
-#include <sgtty.h>
-#endif
-#ifdef USE_TERMIO
-#include <termio.h>
-#endif
-#ifdef USE_TERMIOS
-#include <termios.h>
-#endif
-#ifdef __FreeBSD__
-int tgetent __P((char *, char *));
-int tgetnum __P((char *));
-int tputs __P((char *, int, int (*)(char)));
-#endif
-
-char PC;
-short ospeed;
-
-int
-#ifdef USE_PROTOTYPES
-putch(char c)
-#else
-putch(c)
-int c;
-#endif
-{
- return putchar(c);
-}
-
-int
-main(argc, argv)
-int argc;
-char **argv; {
-#ifdef USE_PROTOTYPES
- char *tgetstr(char *, char **);
-#else
- char *tgetstr();
-#endif
- char *term;
- char buf[MAX_BUF];
- char CL[MAX_LINE];
- char *s, *pc;
-
-#ifdef USE_SGTTY
- struct sgttyb tty;
-
- gtty(1, &tty);
- ospeed = tty.sg_ospeed;
-#else
-#ifdef USE_TERMIO
- struct termio tty;
-
- ioctl(1, TCGETA, &tty);
- ospeed = tty.c_cflag & CBAUD;
-#else
-#ifdef USE_TERMIOS
- struct termios tty;
-
- tcgetattr(1, &tty);
- switch(cfgetospeed(&tty)) {
- case B0: ospeed = 0; break;
- case B50: ospeed = 1; break;
- case B75: ospeed = 2; break;
- case B110: ospeed = 3; break;
- case B134: ospeed = 4; break;
- case B150: ospeed = 5; break;
- case B200: ospeed = 6; break;
- case B300: ospeed = 7; break;
- case B600: ospeed = 8; break;
- case B1200: ospeed = 9; break;
- case B1800: ospeed = 10; break;
- case B2400: ospeed = 11; break;
- case B4800: ospeed = 12; break;
- case B9600: ospeed = 13; break;
- case EXTA: ospeed = 14; break;
- case EXTB: ospeed = 15; break;
-#ifdef B57600
- case B57600: ospeed = 16; break;
-#endif
-#ifdef B115200
- case B115200: ospeed = 17; break;
-#endif
- }
-#else
- ospeed = 0;
-#endif
-#endif
-#endif
-
- term = getenv("TERM");
- if (term == NULL)
- exit(1);
-
- if (tgetent(buf, term) != 1)
- exit(1);
-
- s = CL;
- pc = tgetstr("pc", &s);
- if (pc != NULL)
- PC = *pc;
-
- s = CL;
- tgetstr("cl", &s);
-
- if (CL != NULL) {
- tputs(CL, tgetnum("li"), putch);
- exit(1);
- }
-
- return 0;
-}
-
-#else /* USE_TERMINFO */
-
-#include <term.h>
-
-int
-#ifdef USE_PROTOTYPES
-putch(char c)
-#else
-putch(c)
-int c;
-#endif
-{
- return putchar(c);
-}
-
-int
-main() {
- setupterm((char *) 0, 1, (int *) 0);
- if (clear_screen == (char *) 0)
- exit(1);
- tputs(clear_screen, lines > 0 ? lines : 1, putch);
- return 0;
-}
-
-#endif /* USE_TERMINFO */
diff --git a/lib/libmytinfo/TESTS/quit.c b/lib/libmytinfo/TESTS/quit.c
deleted file mode 100644
index f30fb50..0000000
--- a/lib/libmytinfo/TESTS/quit.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * quit.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/02/01 07:30:14
- *
- * quit with a diagnostic message printed on stderr
- *
- */
-
-#define NOTLIB
-#include "defs.h"
-
-#ifdef USE_SCCS_IDS
-static const char SCCSid[] = "@(#) mytinfo quit.c 3.2 92/02/01 public domain, By Ross Ridge";
-#endif
-
-char *prg_name;
-
-#if defined(USE_PROTOTYPES) && !defined(lint)
-void (*cleanup)(int);
-#else
-void (*cleanup)();
-#endif
-
-/* PRINTFLIKE2 */
-noreturn
-#ifdef USE_STDARG
-#ifdef USE_PROTOTYPES
-void
-quit(int e, char *fmt, ...)
-#else
-void quit(e, fmt)
-int e;
-char *fmt;
-#endif
-#else
-void quit(va_alist)
-va_dcl
-#endif
-{
-#ifndef USE_STDARG
- int e;
- char *fmt;
-#endif
- va_list ap;
-
-#ifdef USE_STDARG
- va_start(ap, fmt);
-#else
- va_start(ap);
- e = va_arg(ap, int);
- fmt = va_arg(ap, char *);
-#endif
-
- (*cleanup)(e);
-
- if (e != 0)
- fprintf(stderr, "%s: ", prg_name);
-#ifdef USE_DOPRNT
- _doprnt(fmt, ap, stderr);
-#else
- vfprintf(stderr, fmt, ap);
-#endif
- putc('\n', stderr);
- if (e > 0 && e < sys_nerr) {
- fprintf(stderr, "%d - %s\n", e, sys_errlist[e]);
- }
- fflush(stderr);
- exit(e);
-}
diff --git a/lib/libmytinfo/TESTS/tput.c b/lib/libmytinfo/TESTS/tput.c
deleted file mode 100644
index 9c220b8..0000000
--- a/lib/libmytinfo/TESTS/tput.c
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * tput.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/02/01 07:30:39
- *
- */
-
-#define NOTLIB
-
-#include "defs.h"
-
-const char SCCSid[] = "@(#) mytinfo tput.c 3.2 92/02/01 public domain, By Ross Ridge";
-
-#define SINGLE
-#include <term.h>
-
-#include <ctype.h>
-
-#define PUTS(s) putp(s)
-#define PUTCHAR(c) putchar(c)
-#define FLUSH fflush(stdout)
-
-extern void (*cleanup)();
-
-static void
-clean(e)
-int e; {
- return;
-}
-
-static void
-usage(e)
-int e; {
- fprintf(stderr, "usage: %s [-T term] capname\n", prg_name);
- return;
-}
-
-int
-main(argc, argv)
-int argc;
-char **argv; {
- char *s;
- int i, j, c;
- int reset;
- FILE *f;
- char *term;
-
- prg_name = argv[0];
- s = strrchr(prg_name, '/');
- if (s != NULL && *++s != '\0') {
- prg_name = s;
- }
-
- term = getenv("TERM");
-
- cleanup = usage;
-
- if (argc > 2 && argv[1][0] == '-' && argv[1][1] == 'T') {
- if (argv[1][2] == '\0' && argc > 3) {
- term = argv[2];
- argc--;
- argv++;
- } else {
- term = argv[1] + 2;
- }
- argc--;
- argv++;
- }
-
- if (argc != 2) {
- quit(-1, "arg count");
- }
-
- cleanup = clean;
-
- setupterm(term, 1, (int *)0);
-
- reset = 0;
- if (strcmp(argv[1], "reset") == 0) {
- reset = 1;
- }
- if (reset || strcmp(argv[1], "init") == 0) {
-
- if (init_prog != NULL) {
- system(init_prog);
- }
- FLUSH;
-
- if (reset && reset_1string != NULL) {
- PUTS(reset_1string);
- } else if (init_1string != NULL) {
- PUTS(init_1string);
- }
- FLUSH;
-
- if (reset && reset_2string != NULL) {
- PUTS(reset_2string);
- } else if (init_2string != NULL) {
- PUTS(init_2string);
- }
- FLUSH;
-
- if (set_lr_margin != NULL) {
- PUTS(tparm(set_lr_margin, 0, columns - 1));
- } else if (set_left_margin_parm != NULL
- && set_right_margin_parm != NULL) {
- PUTS(tparm(set_left_margin_parm, 0));
- PUTS(tparm(set_right_margin_parm, columns - 1));
- } else if (clear_margins != NULL && set_left_margin != NULL
- && set_right_margin != NULL) {
- PUTS(clear_margins);
- if (carriage_return != NULL) {
- PUTS(carriage_return);
- } else {
- PUTCHAR('\r');
- }
- PUTS(set_left_margin);
- if (parm_right_cursor) {
- PUTS(tparm(parm_right_cursor, columns - 1));
- } else {
- for(i = 0; i < columns - 1; i++) {
- PUTCHAR(' ');
- }
- }
- PUTS(set_right_margin);
- if (carriage_return != NULL) {
- PUTS(carriage_return);
- } else {
- PUTCHAR('\r');
- }
- }
- FLUSH;
-
- if (init_tabs != 8) {
- if (clear_all_tabs != NULL && set_tab != NULL) {
- for(i = 0; i < columns - 1; i += 8) {
- if (parm_right_cursor) {
- PUTS(tparm(parm_right_cursor,
- 8));
- } else {
- for(j = 0; j < 8; j++) {
- PUTCHAR(' ');
- }
- }
- PUTS(set_tab);
- }
- FLUSH;
- }
- }
-
- if (reset && reset_file != NULL) {
- f = fopen(reset_file, "r");
- if (f == NULL) {
- quit(errno, "Can't open reset_file: '%s'",
- reset_file);
- }
- while((c = fgetc(f)) != EOF) {
- PUTCHAR(c);
- }
- fclose(f);
- } else if (init_file != NULL) {
- f = fopen(init_file, "r");
- if (f == NULL) {
- quit(errno, "Can't open init_file: '%s'",
- init_file);
- }
- while((c = fgetc(f)) != EOF) {
- PUTCHAR(c);
- }
- fclose(f);
- }
- FLUSH;
-
- if (reset && reset_3string != NULL) {
- PUTS(reset_3string);
- } else if (init_2string != NULL) {
- PUTS(init_3string);
- }
- FLUSH;
- return 0;
- }
-
- s = tigetstr(argv[1]);
-
- if (s == (char *) -1) {
- quit(-1, "unknown capname '%s'", argv[1]);
- } else if (s == NULL) {
- return 0;
- }
-
- putp(s);
-
- return 0;
-}
diff --git a/lib/libmytinfo/TESTS/tset.c b/lib/libmytinfo/TESTS/tset.c
deleted file mode 100644
index 3d1eb65..0000000
--- a/lib/libmytinfo/TESTS/tset.c
+++ /dev/null
@@ -1,919 +0,0 @@
-/*
- * tset.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/02/19 18:53:12
- *
- */
-
-#define NOTLIB
-
-#include "defs.h"
-
-const char SCCSid[] = "@(#) mytinfo tset.c 3.3 92/02/19 public domain, By Ross Ridge";
-
-#define SINGLE
-#include <term.h>
-
-#include <ctype.h>
-
-#if defined(USE_TERMIO) || defined(USE_TERMIOS)
-
-#ifndef ICANON
-#ifdef USE_TERMIO
-#include <termio.h>
-#else
-#include <termios.h>
-#endif
-#endif
-
-#undef USE_SUSPEND
-#ifdef VSUSP
-#define USE_SUSPEND
-#endif
-
-#define USE_INTERRUPT
-
-#if defined(USE_TERMIO) && !defined(TCSETS)
-#undef USE_SUSPEND
-#endif
-
-#else /* USE_TERMIO */
-#ifdef USE_SGTTY
-
-#ifndef CBREAK
-#include <sgtty.h>
-#endif
-
-#undef USE_INTERRUPT
-#ifdef TIOCGETC
-#define USE_INTERRUPT
-#endif
-
-#undef USE_SUSPEND
-#ifdef TIOCGLTC
-#define USE_SUSPEND
-#endif
-
-#undef USE_NEWBSDTTY
-#ifdef TIOCSETD
-#ifdef NTTYDISC
-#define USE_NEWBSDTTY
-#endif
-#endif
-
-#else /* USE_SGTTY */
-
-#undef USE_SUSPEND
-#define USE_NOTTY
-
-#endif /* else USE_SGTTY */
-#endif /* else USE_TERMIO */
-
-#ifndef key_interrupt_char
-#undef USE_INTERRUPT
-#endif
-
-#ifndef key_suspend_char
-#undef USE_SUSPEND
-#endif
-
-char *term;
-int asked = 0;
-long baudrate;
-
-#ifndef USE_STDLIB
-#ifdef USE_PROTOTYPES
-long atol(char const *);
-#else
-long atol();
-#endif
-#endif
-
-#define OUTPUT_TERM 1
-#define OUTPUT_SHELL 2
-#define OUTPUT_TERMCAP 3
-
-#define PUTS(s) tputs(s, 1, putch)
-#define PUTCHAR(c) putc(c, stderr)
-#define FLUSH fflush(stderr)
-
-#ifdef USE_SMALLMEM
-extern unsigned short _baud_tbl[];
-#else
-extern long _baud_tbl[];
-#endif
-
-extern void (*cleanup)();
-
-static void
-clean(e)
-int e; {
- return;
-}
-
-static int
-#ifdef USE_PROTOTYPES
-putch(char c)
-#else
-putch(c)
-int c;
-#endif
-{
- return putc(c, stderr);
-}
-
-void
-set_term(name, query)
-char *name;
-int query; {
- static char buf[MAX_LINE];
- char *s, *t;
-
- if (query) {
- fprintf(stderr, "TERM = (%s) ", name);
- fflush(stderr);
- asked = 1;
- if (fgets(buf, sizeof(buf), stdin) != NULL) {
- s = buf;
- while(*s != '\0' && isspace(*s))
- s++;
- t = s;
- while(*s != '\0' && !isspace(*s))
- s++;
- *s = '\0';
- if (*t != '\0') {
- term = t;
- return;
- }
- }
- }
- term = strcpy(buf, name);
-}
-
-int
-map_term(map, ask)
-char *map;
-int ask; {
- char *type;
- char test = 0;
- char *baud = NULL;
-
- type = map;
-#ifndef USE_NOTTY
- while(*map && strchr(">@<!:?", *map) == NULL)
- map++;
- if (*map != '\0' && *map != ':' && *map != '?') {
- if (*map == '!') {
- switch(*++map) {
- case '>': test = 'g'; break;
- case '@': test = 'n'; break;
- case '<': test = 'l'; break;
- default:
- quit(-1, "bad argument to 'm' switch");
- }
- } else
- test = *map;
- *map++ = '\0';
- baud = map;
- while(*map && *map != ':')
- map++;
- }
-
-#else
- while(*map && *map != ':' && *map != '?')
- map++;
-#endif
-
- if (*map == ':')
- *map++ = '\0';
- if (*map == '?') {
- ask = 1;
- *map++ = '\0';
- }
- if (*map == '\0')
- quit(-1, "bad argument to 'm' switch");
-
- if (type[0] != '\0' && strcmp(type, term) != 0) {
- return 0;
- }
-
-#ifndef USE_NOTTY
- switch(test) {
- case '>':
- if (baudrate <= atol(baud))
- return 0;
- break;
- case '<':
- if (baudrate >= atol(baud))
- return 0;
- break;
- case '@':
- if (baudrate != atol(baud))
- return 0;
- break;
- case 'l':
- if (baudrate < atol(baud))
- return 0;
- break;
- case 'g':
- if (baudrate > atol(baud))
- return 0;
- break;
- case 'n':
- if (baudrate == atol(baud))
- return 0;
- break;
- }
-#endif
-
- set_term(map, ask);
- return 1;
-}
-
-int
-conv_char(s)
-char *s; {
- if (s[0] == '^' && s[1] >= '@' && s[1] < '\177')
- return s[1] & 31;
- else if (s[0] == '^' && s[1] == '?')
- return '\177';
- else if (s[0] != '\0')
- return s[0];
- else
- return -2;
-}
-
-char *
-expand_char(c)
-int c; {
- static char buf[5];
-
- if (c < 0 || c > 127) {
- sprintf(buf, "\\%03o", c & 0177);
- } else if (c == 127) {
- return "DEL";
- } else if (c < 32) {
- buf[0] = '^';
- buf[1] = c + 64;
- buf[2] = '\0';
- } else {
- buf[0] = c;
- buf[1] = '\0';
- }
-
- return buf;
-}
-
-#define START 1
-#define COPY 2
-#define ESCAPE 3
-
-void
-compress_buf(buf)
-char *buf; {
- char *s, *d;
- int state = START;
-
- d = s = buf;
-
- while(*s) {
- switch(state) {
- case START:
- if (isspace(*s) || *s == ':') {
- s++;
- break;
- }
- state = COPY;
- /* FALLTHROUGH */
- case COPY:
- switch(*s) {
- case '^':
- case '\\':
- state = ESCAPE;
- break;
- case ':':
- state = START;
- break;
- }
- *d++ = *s++;
- break;
-
- case ESCAPE:
- *d++ = *s++;
- state = COPY;
- break;
- }
- }
-}
-
-static void
-usage(e)
-int e; {
-#ifdef USE_ANSIC
- fprintf(stderr, "usage: %s [-] [-"
-#define ARG(s) s
-#else
- fprintf(stderr, "usage: %s [-] [-", prg_name);
-#define ARG(s) fputs(s, stderr);
-#endif
- ARG("l")
-#ifndef USE_NOTTY
-#ifdef USE_NEWBSDTTY
- ARG("n")
-#endif
-#endif
- ARG("rsAI")
-#ifndef USE_NOTTY
- ARG("Q")
-#endif
- ARG("S")
-#ifndef USE_NOTTY
- ARG("T")
-#endif
- ARG("]")
-#ifndef USE_NOTTY
- ARG(" [-e[c]] [-E[c]] [-k[c]]")
-#ifdef USE_INTERRUPT
- ARG(" [-i[c]]")
-#endif
-#ifdef USE_SUSPEND
- ARG(" [-z[c]]")
-#endif
-#endif
- ARG("\n\t[-m ident")
-#ifndef USE_NOTTY
- ARG("[[!][<@>]speed]")
-#endif
- ARG(":[?]term] [term]\n")
-#ifdef USE_ANSIC
- , prg_name);
-#endif
-
-#undef ARG
-
- return;
-}
-
-int
-main(argc, argv)
-int argc;
-char **argv; {
- char *s;
- int i, j, r, c;
- int ask = 0;
-#ifndef USE_NOTTY
- int erase_char = -1;
- int erase_if_bs = 0;
- int kill_char = -1;
-#ifdef USE_INTERRUPT
- int interrupt_char = -1;
-#endif
-#ifdef USE_SUSPEND
- int suspend_char = -1;
-#endif
-#ifdef USE_NEWBSDTTY
- int newbsdtty = 0;
-#endif
-#endif /* !USE_NOTTY */
- int output_type = 0;
- int no_term_init = 0;
- int term_type_is = 0;
- int no_set_to = 0;
- int reset = 0;
- int matched = 0;
- int expand_tabs = -1;
- int is_csh;
-#ifndef USE_NOTTTY
-#if defined(USE_TERMIOS) || defined(USE_TERMIO) && defined(TCSETS)
- struct termios tty;
-#else
-#ifdef USE_TERMIO
- struct termio tty;
-#else
-#ifdef USE_SGTTY
- struct sgttyb tty;
-#ifdef USE_INTERRUPT
- struct tchars tty2;
-#endif
-#ifdef USE_SUSPEND
- struct ltchars tty3;
-#endif
-#endif /* USE_SGTTY */
-#endif /* else USE_TERMIO */
-#endif
-#endif /* !USE_NOTTY */
- struct term_path *path;
- char buf[MAX_BUF];
- FILE *f;
- int datatype;
-
- prg_name = argv[0];
- s = strrchr(prg_name, '/');
- if (s != NULL && *++s != '\0') {
- if (strcmp(s, "reset") == 0) {
- reset = 1;
- }
- prg_name = s;
- }
-
- cleanup = clean;
-
-#ifndef USE_NOTTY
-#ifdef USE_TERMIOS
- if (tcgetattr(2, &tty) == -1)
- quit(errno, "tcgetattr failed");
- baudrate = cfgetospeed(&tty);
-#else
-#ifdef USE_TERMIO
-#ifdef TCSETS
- if (ioctl(2, TCGETS, &tty) == -1)
-#else
- if (ioctl(2, TCGETA, &tty) == -1)
-#endif
- {
- quit(errno, "ioctl failed");
- }
- baudrate = _baud_tbl[tty.c_cflag & CBAUD];
-#else
-#ifdef USE_SGTTY
- if (gtty(2, &tty) == -1) {
- quit(errno, "gtty failed");
- }
- baudrate = _baud_tbl[tty.sg_ospeed];
-#ifdef USE_INTERRUPT
- if (ioctl(2, TIOCGETC, &tty2) == -1) {
- quit(errno, "ioctl failed");
- }
-#endif
-#ifdef USE_SUSPEND
- if (ioctl(2, TIOCGLTC, &tty3) == -1) {
- quit(errno, "ioctl failed");
- }
-#endif
-#endif /* USE_SGTTY */
-#endif /* else USE_TERMIO */
-#endif
-#endif /* !USE_NOTTY */
-
- term = getenv("TERM");
-
- cleanup = usage;
-
- for(i = 1; i < argc; i++) {
- if (argv[i][0] != '-') {
- if (term == NULL) {
- term = argv[i];
- }
- continue;
- }
- s = argv[i] + 1;
- if (*s == '\0') {
- output_type = OUTPUT_TERM;
- continue;
- }
- while (*s != '\0') {
- switch(*s++) {
- case 'A':
- ask = 1;
- continue;
-#ifndef USE_NOTTY
- case 'E':
- erase_if_bs = 1;
- /* FALLTHROUGH */
- case 'e':
- erase_char = conv_char(s);
- break;
- case 'k':
- kill_char = conv_char(s);
- break;
-#ifdef USE_INTERRUPT
- case 'i':
- interrupt_char = conv_char(s);
- break;
-#endif
-#ifdef USE_SUSPEND
- case 'z':
- suspend_char = conv_char(s);
- break;
-#endif
- case 'T':
- erase_char = kill_char
-#ifdef USE_INTERRUPT
- = interrupt_char
-#endif
-#ifdef USE_SUSPEND
- = suspend_char
-#endif
- = -2;
- continue;
-#ifdef USE_NEWBSDTTY
- case 'n':
- newbsdtty = 1;
- continue;
-#endif
- case 'Q':
- no_set_to = 1;
- continue;
-#endif /* !USE_NOTTY */
- case 'l':
- case 'I':
- no_term_init = 1;
- continue;
- case 'r':
- term_type_is = 1;
- continue;
- case 's':
- output_type = OUTPUT_SHELL;
- continue;
- case 'S':
- output_type = OUTPUT_TERMCAP;
- continue;
- case 'm':
- if (*s == '\0') {
- if (i == argc - 1) {
- quit(-1, "'m' switch requires an argument.");
- }
- s = argv[++i];
- }
- if (!matched) {
- matched = map_term(s, ask);
- }
- break;
- default:
- quit(-1, "unknown switch '%c'", s[-1]);
- break;
- }
- break;
- }
- }
-
- cleanup = clean;
-
- path = _buildpath("$MYTERMINFO", 2,
- "$TERMINFO", 2,
- "$TERMCAP", 1,
-#ifdef TERMINFODIR
- TERMINFODIR, 0,
-#endif
-#ifdef TERMCAPFILE
- TERMCAPFILE, 0,
-#endif
-#ifdef TERMINFOSRC
- TERMINFOSRC, 0,
-#endif
- NULL, -1);
-
- if (path == NULL) {
- quit(-1, "malloc error");
- }
-
- do {
- if (term == NULL) {
- term = "unknown";
- }
-
- if (ask && !asked) {
- set_term(term, 1);
- }
-
- datatype = _fillterm(term, path, buf);
-
- switch(datatype) {
- case -3:
- quit(-1, "malloc error");
- /* NOTREACHED */
- case -2:
- quit(-1, "database in bad format");
- /* NOTREACHED */
- case -1:
- /* quit(-1, "database not found"); */
- case 0:
- if (ask || asked) {
- fprintf(stderr, "terminal type '%s' unknown.\n",
- term);
- term = NULL;
- ask = 1;
- asked = 0;
- } else {
- quit(-1, "terminal type '%s' unknown.\n", term);
- }
- break;
- case 1:
- case 2:
- case 3:
- break;
- default:
- quit(-1, "oops...");
- }
- } while(term == NULL);
-
- _delpath(path);
-
- cur_term->baudrate = baudrate;
-
- if (!no_term_init) {
-
- if (init_prog != NULL) {
- system(init_prog);
- }
- FLUSH;
-
- if (reset && reset_1string != NULL) {
- PUTS(reset_1string);
- } else if (init_1string != NULL) {
- PUTS(init_1string);
- }
- FLUSH;
-
- if (reset && reset_2string != NULL) {
- PUTS(reset_2string);
- } else if (init_2string != NULL) {
- PUTS(init_2string);
- }
- FLUSH;
-
- if (set_lr_margin != NULL) {
- PUTS(tparm(set_lr_margin, 0, columns - 1));
- } else if (set_left_margin_parm != NULL
- && set_right_margin_parm != NULL) {
- PUTS(tparm(set_left_margin_parm, 0));
- PUTS(tparm(set_right_margin_parm, columns - 1));
- } else if (clear_margins != NULL && set_left_margin != NULL
- && set_right_margin != NULL) {
- PUTS(clear_margins);
- if (carriage_return != NULL) {
- PUTS(carriage_return);
- } else {
- PUTCHAR('\r');
- }
- PUTS(set_left_margin);
- if (parm_right_cursor) {
- PUTS(tparm(parm_right_cursor, columns - 1));
- } else {
- for(i = 0; i < columns - 1; i++) {
- PUTCHAR(' ');
- }
- }
- PUTS(set_right_margin);
- if (carriage_return != NULL) {
- PUTS(carriage_return);
- } else {
- PUTCHAR('\r');
- }
- }
- FLUSH;
-
- if (init_tabs != 8) {
- if (clear_all_tabs != NULL && set_tab != NULL) {
- if (carriage_return != NULL) {
- PUTS(carriage_return);
- } else {
- PUTCHAR('\r');
- }
- PUTS(clear_all_tabs);
- PUTS(set_tab);
- for(i = 8; i < columns - 1; i += 8) {
- if (parm_right_cursor) {
- PUTS(tparm(parm_right_cursor,
- 8));
- } else {
- for(j = 0; j < 8; j++) {
- PUTCHAR(' ');
- }
- }
- PUTS(set_tab);
- }
- if (carriage_return != NULL) {
- PUTS(carriage_return);
- } else {
- PUTCHAR('\r');
- }
- expand_tabs = 0;
- FLUSH;
- } else {
- expand_tabs = 1;
- }
- } else {
- expand_tabs = 0;
- }
-
- if (reset && reset_file != NULL) {
- f = fopen(reset_file, "r");
- if (f == NULL) {
- quit(errno, "Can't open reset_file: '%s'",
- reset_file);
- }
- while((c = fgetc(f)) != EOF) {
- PUTCHAR(c);
- }
- fclose(f);
- } else if (init_file != NULL) {
- f = fopen(init_file, "r");
- if (f == NULL) {
- quit(errno, "Can't open init_file: '%s'",
- init_file);
- }
- while((c = fgetc(f)) != EOF) {
- PUTCHAR(c);
- }
- fclose(f);
- }
- FLUSH;
-
- if (reset && reset_3string != NULL) {
- PUTS(reset_3string);
- } else if (init_2string != NULL) {
- PUTS(init_3string);
- }
- FLUSH;
- }
-
- if (term_type_is) {
- fprintf(stderr, "Terminal type is %s\n", term);
- }
-
-#ifndef USE_NOTTY
-#if defined(USE_TERMIO) || defined(USE_TERMIOS)
-
-#ifdef USE_TERMIO
- if (expand_tabs == 0 && (tty.c_cflag & TABDLY) == TAB3) {
- tty.c_cflag = tty.c_cflag & ~TABDLY;
- } else if (expand_tabs == 1) {
- tty.c_cflag = (tty.c_cflag & ~TABDLY) | TAB3;
- }
-#else
- if (!expand_tabs)
- tty.c_oflag &= ~OXTABS;
- else
- tty.c_oflag |= OXTABS;
-#endif
-
-#define SETTO(v, m, t, c) (c != tty.c_cc[v] ? (tty.c_cc[v] = c, \
- !no_set_to ? fprintf(stderr, "%s set to %s\n", t, \
- expand_char(c)) : 0) : 0)
-
-#endif
-#ifdef USE_SGTTY
-
-#ifdef USE_NEWBSDTTY
- if (newbsdtty) {
- if (ioctl(2, TIOCSETD, NTTYDISC) == -1) {
- quit(errno, "Can't switch tty to new line disc.");
- }
- }
-#endif
-
- if (expand_tabs == 0) {
- tty.sg_flags &= ~XTABS;
- } else if (expand_tabs == 1) {
- tty.sg_flags |= XTABS;
- }
-
-#define SETTO(v, m, t, c) (c != m ? (m = c, \
- !no_set_to ? fprintf(stderr, "%s set to %s\n", t, \
- expand_char(c)) : 0) : 0)
-#endif
-
- if (erase_char != -1
- && (!erase_if_bs || backspaces_with_bs
- || (cursor_left == NULL && cursor_left[0] != '\b'))) {
- if (erase_char != -2) {
- c = erase_char;
- } else if (cursor_left == NULL || cursor_left[0] == '\0'
- || cursor_left[1] != '\0') {
- c = '\b';
- } else {
- c = cursor_left[0];
- }
- SETTO(VERASE, tty.sg_erase, "Erase", c);
- }
-
- if (kill_char != -1) {
- if (kill_char != -2) {
- c = kill_char;
- } else if (key_kill_char == NULL || key_kill_char[0] == '\0'
- || key_kill_char[1] != '\0') {
- c = '\025';
- } else {
- c = key_kill_char[0];
- }
- SETTO(VKILL, tty.sg_kill, "Kill", c);
- }
-
-
-#ifdef USE_INTERRUPT
- if (interrupt_char != -1) {
- if (interrupt_char != -2) {
- c = interrupt_char;
- } else if (key_interrupt_char == NULL
- || key_interrupt_char[0] == '\0'
- || key_interrupt_char[1] != '\0') {
- c = '\177';
- } else {
- c = key_interrupt_char[0];
- }
- SETTO(VINTR, tty2.t_intrc, "Interrupt", c);
- }
-#endif
-
-#ifdef USE_SUSPEND
- if (suspend_char != -1) {
- if (suspend_char != -2) {
- c = suspend_char;
- } else if (key_suspend_char == NULL
- || key_suspend_char[0] == '\0'
- || key_suspend_char[1] != '\0') {
- c = '\032';
- } else {
- c = key_suspend_char[0];
- }
- SETTO(VSUSP, tty3.t_suspc, "Suspend", c);
- }
-#endif
-
-#ifdef USE_TERMIOS
- if (tcsetattr(2, TCSADRAIN, &tty) == -1)
- quit(errno, "tcsetattr failed");
-#else
-#ifdef USE_TERMIO
-#ifdef TCSETS
- if (ioctl(2, TCSETS, &tty) == -1)
-#else
- if (ioctl(2, TCSETA, &tty) == -1)
-#endif
- {
- quit(errno, "ioctl failed");
- }
-#else
-#ifdef USE_SGTTY
- if (stty(2, &tty) == -1) {
- quit(errno, "stty failed");
- }
-#ifdef USE_INTERRUPT
- if (ioctl(2, TIOCSETC, &tty2) == -1) {
- quit(errno, "ioctl failed");
- }
-#endif
-#ifdef USE_SUSPEND
- if (ioctl(2, TIOCSLTC, &tty3) == -1) {
- quit(errno, "ioctl failed");
- }
-#endif
-#endif /* USE_SGTTY */
-#endif /* else USE_TERMIO */
-#endif
-#endif /* !USE_NOTTY */
-
- s = getenv("SHELL");
- r = strlen(s);
-
- if (r >= 3 && strcmp("csh", s + r - 3) == 0) {
- is_csh = 1;
- } else {
- is_csh = 0;
- }
-
- switch(output_type) {
- case OUTPUT_TERM:
- fprintf(stdout, "%s\n", term);
- break;
-
- case OUTPUT_TERMCAP:
- if (is_csh) {
- if (datatype == 1) {
- compress_buf(buf);
- fprintf(stdout, "%s %s", term, buf);
- } else {
- s = getenv("TERMCAP");
- if (s == NULL || *s == '\0') {
- s = ":";
- }
- fprintf(stdout, "%s %s", term, s);
- }
- break;
- }
- /* FALLTHROUGH */
- case OUTPUT_SHELL:
- if (is_csh) {
- fprintf(stdout, "set noglob;\n");
- fprintf(stdout, "setenv TERM '%s';\n", term);
- if (datatype == 1) {
- compress_buf(buf);
- fprintf(stdout, "setenv TERMCAP '%s';\n", buf);
- }
- fprintf(stdout, "unset noglob;\n");
- } else {
- fprintf(stdout, "export TERM TERMCAP;\n");
- fprintf(stdout, "TERM='%s';\n", term);
- if (datatype == 1) {
- compress_buf(buf);
- fprintf(stdout, "TERMCAP='%s';\n", buf);
- }
- }
- break;
- }
-
- return 0;
-}
diff --git a/lib/libmytinfo/TESTS/ttest.c b/lib/libmytinfo/TESTS/ttest.c
deleted file mode 100644
index d6cc36e..0000000
--- a/lib/libmytinfo/TESTS/ttest.c
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
- * ttest.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/02/01 07:30:47
- *
- */
-
-#define NOTLIB
-#include "defs.h"
-#include <term.h>
-
-const char SCCSid[] = "@(#) mytinfo ttest.c 3.2 92/02/01 public domain, By Ross Ridge";
-
-int
-cup(x,y)
-int x, y; {
- if (columns < 2 || lines < 2)
- return -1;
- if (cursor_address != NULL)
- putp(tparm(cursor_address, y, x));
- else if (cursor_home != NULL && cursor_down != NULL
- && cursor_right != NULL) {
- putp(cursor_home);
- if (parm_down_cursor != NULL)
- putp(tparm(parm_down_cursor, y));
- else
- for(; y > 0; y--)
- putp(cursor_down);
- if (parm_right_cursor != NULL)
- putp(tparm(parm_right_cursor, y));
- else
- for(; y > 0; y--)
- putp(cursor_right);
- } else if (cursor_to_ll != NULL && cursor_up != NULL
- && cursor_right != NULL) {
- putp(cursor_to_ll);
- if (parm_up_cursor != NULL)
- putp(tparm(parm_up_cursor, y));
- else
- for(y++; y < columns ; y++)
- putp(cursor_up);
- if (parm_right_cursor != NULL)
- putp(tparm(parm_right_cursor, y));
- else
- for(; y > 0; y--)
- putp(cursor_right);
- } else
- return 1;
- return 0;
-}
-
-int
-clear() {
- int r;
- if (clear_screen != NULL)
- putp(clear_screen);
- else if (clr_eos != NULL) {
- r = cup(0,0);
- if (r != 0)
- return r;
- putp(clr_eos);
- } else
- return -2;
- return 0;
-}
-
-void
-nl() {
- if (newline != NULL)
- putp(newline);
- else if (carriage_return != NULL && cursor_down != NULL) {
- putp(cursor_down);
- putp(carriage_return);
- } else
- quit(-1, "can't do a newline");
- return;
-}
-
-void
-putln(s)
-char *s; {
- int i;
-
- if (columns < 2 || auto_right_margin)
- fputs(s, stdout);
- else {
- i = 0;
- while(*s) {
- putchar(*s);
- s++;
- if (++i == columns) {
- nl();
- i = 0;
- }
- }
- }
- nl();
-}
-
-void
-anykey() {
- fputs("-- press any key --", stdout);
- fflush(stdout);
- getchar();
- nl();
-}
-
-void
-do_cleanup(e)
-int e; {
- fflush(stdout);
- fflush(stderr);
- reset_shell_mode();
- fprintf(stderr, "\n");
-}
-
-#ifdef USE_SGTTY
-struct sgttyb new_tty;
-#else
-#ifdef USE_TERMIO
-struct termio new_tty;
-#else
-struct termios new_tty;
-#endif
-#endif
-
-int
-main(argc, argv)
-int argc;
-char **argv; {
- register int i;
-
- prg_name = argv[0];
- cleanup = do_cleanup;
-
- if (argc == 1)
- setupterm(NULL, 1, (int *) 0);
- else if (argc == 2)
- setupterm(argv[1], 1, (int *) 0);
- else {
- fprintf(stderr, "usage: %s [terminal]\n", argv[0]);
- return 1;
- }
- fflush(stderr);
- fflush(stdout);
-#ifdef USE_SGTTY
- ioctl(1, TIOCGETP, &new_tty);
- new_tty.sg_flags &= ~(CRMOD | ECHO | XTABS);
-#ifdef CBREAK
- new_tty.sg_flags |= CBREAK;
-#else
- new_tty.sg_flags |= RAW;
-#endif
- ioctl(1, TIOCSETP, &new_tty);
-#endif
-#ifdef USE_TERMIO
- ioctl(1, TCGETA, &new_tty);
-#else
-#ifdef USE_TERMIOS
- tcgetattr(1, &new_tty);
-#endif
-#endif
-#if defined(USE_TERMIO) || defined(USE_TERMIOS)
- new_tty.c_lflag &= ~(ICANON | ECHO);
- new_tty.c_oflag &= ~(OPOST);
- new_tty.c_cc[VMIN] = 1;
- new_tty.c_cc[VTIME] = 1;
-#endif
-#ifdef USE_TERMIO
- ioctl(1, TCSETA, &new_tty);
-#else
-#ifdef USE_TERMIOS
- tcsetattr(1, TCSADRAIN, &new_tty);
-#endif
-#endif
- def_prog_mode();
-
- clear();
- printf("columns = %d", columns);
- nl();
- printf("lines = %d", lines);
- if (columns < 2)
- quit(-1, "columns must be > 1");
- nl();
- anykey();
- nl();
- if (auto_right_margin) {
- putln("auto_right_margin = TRUE");
- nl();
- for(i = 0; i < columns; i++)
- putchar('1');
- for(i = 0; i < columns / 2; i++)
- putchar('2');
- nl();
- } else {
- putln("auto_right_margin = FALSE");
- nl();
- for(i = 0; i < columns + columns / 2; i++)
- putchar('1');
- nl();
- for(i = 0; i < columns / 2; i++)
- putchar('2');
- nl();
- }
- nl();
- putln("***a line of 1's followed by a line of 2's");
- nl();
- anykey();
- nl();
-
- if (over_strike) {
- putln("over_strike = TRUE");
- if (cursor_left != NULL) {
- for(i = 0; i < columns / 4 + 1; i++) {
- putchar('/');
- putp(cursor_left);
- putchar('\\');
- }
- } else if (carriage_return != NULL) {
- for(i = 0; i < columns / 4 + 1; i++)
- putchar('/');
- putp(carriage_return);
- for(i = 0; i < columns / 4 + 1; i++)
- putchar('\\');
- }
- nl();
- nl();
- putln("*** X's made from \\'s overstriking /'s");
- nl();
- anykey();
- nl();
- }
-
- if (cup(0,0) == 0) {
- clear();
- putln("cup test");
- for(i = 1; i < columns; i++)
- putp(tparm(cursor_address, 0, i));
- for(i = 0; i < lines; i++)
- putp(tparm(cursor_address, i, columns - 1));
- for(i = columns; i--;)
- putp(tparm(cursor_address, lines - 1, i));
- for(i = lines; i--;)
- putp(tparm(cursor_address, i, 0));
- nl();
- anykey();
- }
- clear();
-
- putln("Attribute test");
- nl();
- if (enter_blink_mode != NULL) {
- putp(enter_blink_mode);
- printf("blink");
- putp(exit_attribute_mode);
- nl();
- }
- if (enter_bold_mode != NULL) {
- putp(enter_bold_mode);
- printf("bold");
- putp(exit_attribute_mode);
- nl();
- }
- if (enter_dim_mode != NULL) {
- putp(enter_dim_mode);
- printf("dim");
- putp(exit_attribute_mode);
- nl();
- }
- if (enter_reverse_mode != NULL) {
- putp(enter_reverse_mode);
- printf("reverse");
- putp(exit_attribute_mode);
- nl();
- }
- if (enter_standout_mode != NULL) {
- putp(enter_standout_mode);
- printf("standout");
- putp(exit_standout_mode);
- nl();
- }
- if (enter_underline_mode != NULL) {
- putp(enter_underline_mode);
- printf("underline");
- putp(exit_underline_mode);
- nl();
- }
- nl();
- anykey();
-
- clear();
- reset_shell_mode();
-
- return (0);
-}
diff --git a/lib/libmytinfo/addstr.c b/lib/libmytinfo/addstr.c
deleted file mode 100644
index d3d7444..0000000
--- a/lib/libmytinfo/addstr.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * addstr.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/02/01 07:34:01
- *
- */
-
-#include "defs.h"
-#include <term.h>
-
-#include <ctype.h>
-
-#ifdef USE_SCCS_IDS
-static char const SCCSid[] = "@(#) mytinfo addstr.c 3.2 92/02/01 public domain, By Ross Ridge";
-#endif
-/*
- * I think this routine could be improved, as it is now it searches a
- * linked list of strbufs for one that has enough room left for the
- * string. The only thing else I can think of doing would be to
- * expand a buffer by realloc and then fix the string pointers if it
- * moves.
- */
-
-static struct strbuf *strbuf = NULL;
-
-struct strbuf *
-_endstr() {
- register struct strbuf *p;
-
- p = strbuf;
- strbuf = NULL;
- return p;
-}
-
-char *
-_addstr(s)
-register char *s; {
- register struct strbuf *p;
- register int l;
-
- if (s == NULL) {
- strbuf = NULL;
- return NULL;
- }
-
- if (strbuf == NULL) {
- strbuf = (struct strbuf *) malloc(sizeof(struct strbuf));
- if (strbuf == NULL)
- return NULL;
- strbuf->len = 0;
- strbuf->next = NULL;
- }
- l = strlen(s) + 1;
- if (l > MAX_CHUNK)
- return NULL;
- p = strbuf;
- while (l + p->len > MAX_CHUNK) {
- if (p->next == NULL) {
- p->next = (struct strbuf *)
- malloc(sizeof(struct strbuf));
- p = p->next;
- if (p == NULL)
- return NULL;
- p->len = 0;
- p->next = NULL;
- break;
- }
- p = p->next;
- }
- s = strcpy(p->buf + p->len, s);
- p->len += l;
- return s;
-}
-
-void
-_del_strs(p)
-TERMINAL *p; {
- struct strbuf *q;
-
- q = p->strbuf;
- while(q != NULL) {
- p->strbuf = q->next;
- free((anyptr) q);
- q = p->strbuf;
- }
-}
diff --git a/lib/libmytinfo/bin_order b/lib/libmytinfo/bin_order
deleted file mode 100644
index e00d342..0000000
--- a/lib/libmytinfo/bin_order
+++ /dev/null
@@ -1,48 +0,0 @@
- bin_order
-
- By Ross Ridge
- Public Domain
- 92/02/01 07:29:39
-
- Order of entries in a terminfo binary
-
- @(#) mytinfo bin_order 3.2 92/02/01 public domain, By Ross Ridge
-
-
-!
-bw am xsb xhp xenl eo gn hc km hs in da db mir msgr os eslok xt hz ul
-xon nxon mc5i chts nrrmc npc ndscr ccc bce hls xhpa crxm daisy xvpa sam
-cpix lpix
-
-#
-cols it lines lm xmc pb vt wsl nlab lh lw ma wnum colors pairs ncv bufsz
-spinv spinh maddr mjump mcs mls npins orc orl orhi orvi cps widcs btns
-bitwin bitype
-
-$
-cbt bel cr csr tbc clear el ed hpa cmdch cup cud1 home civis cub1 mrcup cnorm
-cuf1 ll cuu1 cvvis dch1 dl1 dsl hd smacs blink bold smcup smdc dim smir invis
-prot rev smso smul ech rmacs sgr0 rmcup rmdc rmir rmso rmul flash ff fsl is1
-is2 is3 if ich1 il1 ip kbs ktbc kclr kctab kdch1 kdl1 kcud1 krmir kel ked
-kf0 kf1 kf10 kf2 kf3 kf4 kf5 kf6 kf7 kf8 kf9 khome kich1 kil1 kcub1 kll
-knp kpp kcuf1 kind kri khts kcuu1 rmkx smkx lf0 lf1 lf10 lf2 lf3 lf4 lf5
-lf6 lf7 lf8 lf9 rmm smm nel pad dch dl cud ich indn il cub cuf rin cuu pfkey
-pfloc pfx mc0 mc4 mc5 rep rs1 rs2 rs3 rf rc vpa sc ind ri sgr hts wind ht
-tsl uc hu iprog ka1 ka3 kb2 kc1 kc3 mc5p rmp acsc pln kcbt smxon rmxon
-smam rmam xonc xoffc enacs smln rmln kbeg kcan kclo kcmd kcpy kcrt kend
-kent kext kfnd khlp kmrk kmsg kmov knxt kopn kopt kprv kprt krdo kref
-krfr krpl krst kres ksav kspd kund kBEG kCAN kCMD kCPY kCRT kDC kDL kslt
-kEND kEOL kEXT kFND kHLP kHOM kIC kLFT kMSG kMOV kNXT kOPT kPRV kPRT kRDO
-kRPL kRIT kRES kSAV kSPD kUND rfi kf11 kf12 kf13 kf14 kf15 kf16 kf17 kf18
-kf19 kf20 kf21 kf22 kf23 kf24 kf25 kf26 kf27 kf28 kf29 kf30 kf31 kf32
-kf33 kf34 kf35 kf36 kf37 kf38 kf39 kf40 kf41 kf42 kf43 kf44 kf45 kf46 kf47
-kf48 kf49 kf50 kf51 kf52 kf53 kf54 kf55 kf56 kf57 kf58 kf59 kf60 kf61 kf62
-kf63 el1 mgc smgl smgr fln sclk dclk rmclk cwin wingo hup dial qdial tone
-pulse hook pause wait u0 u1 u2 u3 u4 u5 u6 u7 u8 u9 op oc initc initp scp
-setf setb cpi lpi chr cvr defc swidm sdrfq sitm slm smicm snlq snrmq sshm
-ssubm ssupm sum rwidm ritm rlm rmicm rshm rsubm rsupm rum mhpa mcud1 mcub1
-mcuf1 mvpa mcuu1 porder mcud mcub mcuf mcuu scs smgb smgbp smglp smgrp smgt
-smgtp sbim scsd rbim rcsd subcs supcs docr zerom csnm kmous minfo reqmp
-getm setaf setab pfxl devt csin s0ds s1ds s2ds s3ds smglr smgtb birep binel
-bicr colornm defbi endbi setcolor slines dispc smpch rmpch smsc rmsc pctrm
-scesc scesa
diff --git a/lib/libmytinfo/bsearch.c b/lib/libmytinfo/bsearch.c
deleted file mode 100644
index aa4eabf..0000000
--- a/lib/libmytinfo/bsearch.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * bsearch.c
- *
- * This is something I found on watmath. I've made some minor changes for use
- * in this package.
- *
- * 92/06/04 11:35:15
- */
-
-#if 0
-#ifndef lint
-static char *RCSid = "$OHeader: /usr/mfcf/src/accounts/libuw/RCS/bsearch.c,v 1.1 88/06/11 20:41:48 root Exp $";
-#endif
-#endif
-
-#include "defs.h"
-
-#ifdef USE_MYBSEARCH
-
-#ifdef USE_SCCS_IDS
-static char const SCCSid[] = "@(#) mytinfo bsearch.c 3.4 92/06/04 public domain, By Ross Ridge";
-#endif
-
-#ifdef USE_SHORT_BSEARCH
-#define fast_int short
-#else
-#define fast_int mysize_t
-#endif
-
-/*
- * bsearch - find an element of a sorted vector
- *
- * found = bsearch(key, array, dimension, width, compare)
- * returns a pointer to the specified element in the array,
- * or (char*)0 if the element can't be found.
- * key
- * pointer to the element to be searched for in the array
- * array
- * address of an array of elements
- * dimension
- * number of elements in the array
- * width
- * sizeof(type) of each element
- * compare
- * pointer to a function taking (char *) pointers to two elements
- * and returning <0, 0, or >0 as the first element comes before,
- * at, or after the second element. A compare function is provided
- * for comparing strings.
-*/
-#if 0
-/*
- * $OLog: bsearch.c,v $
- * Revision 1.1 88/06/11 20:41:48 root
- * Initial revision
- *
-*/
-#endif
-
- static anyptr
-bsearch(key, array, dimension, iwidth, compare)
- anyptr key;
- anyptr array;
- int dimension;
- mysize_t iwidth;
- compar_fn compare;
-{
- register fast_int start; /* offset to start of current interval */
- register fast_int end; /* offset to end+1 of current interval */
- register fast_int middle; /* offset to middle of current interval */
- auto int status;
- register fast_int width;
-
- width = iwidth / sizeof(char);
-
- start = 0;
- middle = 0;
- end = dimension;
-
- while (start < end) {
-
- middle = (start + end) / 2;
-
- status = (*compare)(key, ((char *)array + middle*width));
-
- if (status < 0)
- end = middle;
-
- else if (status > 0)
- start = middle + 1;
-
- else return (anyptr)(((char *)array) + middle*width);
- }
-
- return 0;
-}
-
-#endif /* USE_MYBSEARCH */
diff --git a/lib/libmytinfo/buildpath.c b/lib/libmytinfo/buildpath.c
deleted file mode 100644
index 4e6f529..0000000
--- a/lib/libmytinfo/buildpath.c
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * buildpath.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/02/01 07:29:42
- *
- * _buildpath builds a list of file names and terminal descriprions extracted
- * from its arguments. It returns a pointer to a structure that is used by
- * other routines as the list of file names to search for terminal
- * descriptions. It is passed a variable number of arguments consisting
- * of file name and type pairs. The file name can actually be a list of
- * file names seperated by spaces and any environment variables specified
- * by a dollar sign ($) followed by its name are substituted in. A type
- * of 1 indicates that the file name may actually be termcap description
- * and a type of 2 indicates it may be a terminfo description. A type of 0
- * indicates that the file name can only be a file name (or list of them).
- *
- */
-
-#include "defs.h"
-
-#include <ctype.h>
-
-#ifdef USE_SCCS_IDS
-static const char SCCSid[] = "@(#) mytinfo buildpath.c 3.2 92/02/01 public domain, By Ross Ridge";
-#endif
-
-/* more memory is allocated for file names every HUNK file names */
-#define HUNK 32
-
-/* characters that seperate file names in a list */
-#define SEPERATORS " :"
-
-static struct term_path *path = NULL; /* the list of files */
-static int files = 0; /* # of files in the list */
-static int size = 0; /* # of files there is space for */
-
-/* add a file name, type pair to the list */
-static int
-addfile(file, type)
-char *file;
-int type; {
- int l;
- char *s;
-
- if (file == NULL) {
- if (type != -1)
- return -1;
- } else if (file[0] == '\0')
- return -1;
-
-#ifdef DEBUG
- if (file != NULL)
- printf("addfile: %s\n", file);
-#endif
-
- if (files >= size) {
- size += HUNK;
- path = (struct term_path *) reallocf((anyptr) path,
- size * sizeof(struct term_path));
- if (path == NULL)
- return 0;
- }
- if (file == NULL) {
- path[files].file = file;
- } else {
- l = strlen(file) + 1;
- s = (char *) malloc(l * sizeof(char));
- if (s == NULL)
- return 0;
- path[files].file = strcpy(s, file);
- }
- path[files].type = type;
-
- return ++files;
-}
-
-/* deallocate space used by the path list */
-void
-_delpath(ppath)
-struct term_path *ppath; {
- struct term_path *p;
-
- p = ppath;
- while(p->file != NULL) {
- free((anyptr)p->file);
- p++;
- }
-
- free((anyptr)ppath);
-}
-
-/* build a list of paths. see above */
-#ifdef lint
-/*VARARGS2*/
-struct term_path *
-_buildpath(file, type)
-char *file;
-int type;
-#else
-#ifdef USE_STDARG
-#ifdef USE_PROTOTYPES
-struct term_path *_buildpath(char *file, int type, ...)
-#else
-struct term_path *_buildpath(file, type)
-char *file;
-int type;
-#endif /* USE_PROTOTYPES */
-#else /* USE_STDARG */
-struct term_path *_buildpath(va_alist)
-va_dcl
-#endif /* USE_STDARG */
-#endif /* lint */
-{
-#ifndef lint
-#ifndef USE_STDARG
- char *file;
- int type;
-#endif
-#endif
- va_list ap;
- register char *s, *d, *e;
- char *p;
- char line[MAX_BUF+1];
- char name[MAX_NAME+1];
- int i,j;
-
- size = 0;
- files = 0;
- path = NULL;
-
-#ifdef lint
- ap = NULL;
-#else
-#ifdef USE_STDARG
- va_start(ap, type);
-#else
- va_start(ap);
- file = va_arg(ap, char *);
- type = va_arg(ap, int);
-#endif
-#endif
-
- while (type >= 0 && type <= 2) {
- s = file;
- d = line;
- i = 0;
- while(*s != '\0') {
- if (*s == '$') {
- s++;
- j = 0;
- while(*s != '\0' && (*s == '_' || isalnum(*s)))
- if (j < MAX_NAME) {
- name[j] = *s++;
- j++;
- } else
- break;
- name[j] = '\0';
- e = getenv(name);
- if (e != NULL) {
- while(*e != '\0') {
- if (i < MAX_BUF) {
- *d++ = *e++;
- i++;
- } else
- break;
- }
- } else if (*s == '/')
- s++;
- } else {
- if (i < MAX_BUF) {
- *d++ = *s++;
- i++;
- } else
- break;
- }
- }
- *d = '\0';
- if (type == 0 || line[0] == '/') {
- p = line;
- while ((s = strsep(&p, SEPERATORS)) != NULL && *s == '\0')
- ;
- while(s != NULL) {
- if (addfile(s, 0) == 0)
- return NULL;
- while ((s = strsep(&p, SEPERATORS)) != NULL && *s == '\0')
- ;
- }
- } else
- if (addfile(line, type) == 0)
- return NULL;
- file = va_arg(ap, char *);
- type = va_arg(ap, int);
- }
- addfile(NULL, -1);
- return path;
-}
diff --git a/lib/libmytinfo/cap_list b/lib/libmytinfo/cap_list
deleted file mode 100644
index 8acf973..0000000
--- a/lib/libmytinfo/cap_list
+++ /dev/null
@@ -1,529 +0,0 @@
- cap_list
-
- By Ross Ridge
- Public Domain
- 92/02/01 07:29:44
-
- @(#) mytinfo cap_list 3.2 92/02/01 public domain, By Ross Ridge
-
-types: ! = boolean, # = number, $ = string, $G = string with parameters,
- $K = string that never is outputed (with tputs).
-
-type variable capname termcap
-
-Standard terminfo capabilities:
-
-! auto_left_margin bw bw
-! auto_right_margin am am
-! ceol_standout_glitch xhp xs
-! dest_tabs_magic_smso xt xt
-! eat_newline_glitch xenl xn
-! erase_overstrike eo eo
-! generic_type gn gn
-! hard_copy hc hc
-! hard_cursor chts HC
-! has_meta_key km km
-! has_status_line hs hs
-! insert_null_glitch in in
-! memory_above da da
-! memory_below db db
-! move_insert_mode mir mi
-! move_standout_mode msgr ms
-! needs_xon_xoff nxon nx
-! no_esc_ctlc xsb xb
-! no_pad_char npc NP
-! non_rev_rmcup nrrmc NR
-! over_strike os os
-! prtr_silent mc5i 5i
-! status_line_esc_ok eslok es
-! tilde_glitch hz hz
-! transparent_underline ul ul
-! xon_xoff xon xo
-# columns cols co
-# init_tabs it it
-# label_height lh lh
-# label_width lw lw
-# lines lines li
-# lines_of_memory lm lm
-# magic_cookie_glitch xmc sg
-# num_labels nlab Nl
-# padding_baud_rate pb pb
-# virtual_terminal vt vt
-# width_status_line wsl ws
-$K acs_chars acsc ac
-$ back_tab cbt bt
-$ bell bel bl
-$ carriage_return cr cr
-$G change_scroll_region csr cs
-$ char_padding rmp rP
-$ clear_all_tabs tbc ct
-$ clear_margins mgc MC
-$ clear_screen clear cl
-$ clr_bol el1 cb
-$ clr_eol el ce
-$ clr_eos ed cd
-$G column_address hpa ch
-$K command_character cmdch CC
-$G cursor_address cup cm
-$ cursor_down cud1 do
-$ cursor_home home ho
-$ cursor_invisible civis vi
-$ cursor_left cub1 le
-$G cursor_mem_address mrcup CM
-$ cursor_normal cnorm ve
-$ cursor_right cuf1 nd
-$ cursor_to_ll ll ll
-$ cursor_up cuu1 up
-$ cursor_visible cvvis vs
-$ delete_character dch1 dc
-$ delete_line dl1 dl
-$ dis_status_line dsl ds
-$ down_half_line hd hd
-$ ena_acs enacs eA
-$ enter_alt_charset_mode smacs as
-$ enter_am_mode smam SA
-$ enter_blink_mode blink mb
-$ enter_bold_mode bold md
-$ enter_ca_mode smcup ti
-$ enter_delete_mode smdc dm
-$ enter_dim_mode dim mh
-$ enter_insert_mode smir im
-$ enter_protected_mode prot mp
-$ enter_reverse_mode rev mr
-$ enter_secure_mode invis mk
-$ enter_standout_mode smso so
-$ enter_underline_mode smul us
-$ enter_xon_mode smxon SX
-$G erase_chars ech ec
-$ exit_alt_charset_mode rmacs ae
-$ exit_am_mode rmam RA
-$ exit_attribute_mode sgr0 me
-$ exit_ca_mode rmcup te
-$ exit_delete_mode rmdc ed
-$ exit_insert_mode rmir ei
-$ exit_standout_mode rmso se
-$ exit_underline_mode rmul ue
-$ exit_xon_mode rmxon RX
-$ flash_screen flash vb
-$ form_feed ff ff
-$ from_status_line fsl fs
-$ init_1string is1 i1
-$ init_2string is2 is
-$ init_3string is3 i3
-$K init_file if if
-$K init_prog iprog iP
-$ insert_character ich1 ic
-$ insert_line il1 al
-$ insert_padding ip ip
-$K key_a1 ka1 K1
-$K key_a3 ka3 K3
-$K key_b2 kb2 K2
-$K key_backspace kbs kb
-$K key_beg kbeg @1
-$K key_btab kcbt kB
-$K key_c1 kc1 K4
-$K key_c3 kc3 K5
-$K key_cancel kcan @2
-$K key_catab ktbc ka
-$K key_clear kclr kC
-$K key_close kclo @3
-$K key_command kcmd @4
-$K key_copy kcpy @5
-$K key_create kcrt @6
-$K key_ctab kctab kt
-$K key_dc kdch1 kD
-$K key_dl kdl1 kL
-$K key_down kcud1 kd
-$K key_eic krmir kM
-$K key_end kend @7
-$K key_enter kent @8
-$K key_eol kel kE
-$K key_eos ked kS
-$K key_exit kext @9
-$K key_f0 kf0 k0
-$K key_f1 kf1 k1
-$K key_f10 kf10 k;
-$K key_f11 kf11 F1
-$K key_f12 kf12 F2
-$K key_f13 kf13 F3
-$K key_f14 kf14 F4
-$K key_f15 kf15 F5
-$K key_f16 kf16 F6
-$K key_f17 kf17 F7
-$K key_f18 kf18 F8
-$K key_f19 kf19 F9
-$K key_f2 kf2 k2
-$K key_f20 kf20 FA
-$K key_f21 kf21 FB
-$K key_f22 kf22 FC
-$K key_f23 kf23 FD
-$K key_f24 kf24 FE
-$K key_f25 kf25 FF
-$K key_f26 kf26 FG
-$K key_f27 kf27 FH
-$K key_f28 kf28 FI
-$K key_f29 kf29 FJ
-$K key_f3 kf3 k3
-$K key_f30 kf30 FK
-$K key_f31 kf31 FL
-$K key_f32 kf32 FM
-$K key_f33 kf33 FN
-$K key_f34 kf34 FO
-$K key_f35 kf35 FP
-$K key_f36 kf36 FQ
-$K key_f37 kf37 FR
-$K key_f38 kf38 FS
-$K key_f39 kf39 FT
-$K key_f4 kf4 k4
-$K key_f40 kf40 FU
-$K key_f41 kf41 FV
-$K key_f42 kf42 FW
-$K key_f43 kf43 FX
-$K key_f44 kf44 FY
-$K key_f45 kf45 FZ
-$K key_f46 kf46 Fa
-$K key_f47 kf47 Fb
-$K key_f48 kf48 Fc
-$K key_f49 kf49 Fd
-$K key_f5 kf5 k5
-$K key_f50 kf50 Fe
-$K key_f51 kf51 Ff
-$K key_f52 kf52 Fg
-$K key_f53 kf53 Fh
-$K key_f54 kf54 Fi
-$K key_f55 kf55 Fj
-$K key_f56 kf56 Fk
-$K key_f57 kf57 Fl
-$K key_f58 kf58 Fm
-$K key_f59 kf59 Fn
-$K key_f6 kf6 k6
-$K key_f60 kf60 Fo
-$K key_f61 kf61 Fp
-$K key_f62 kf62 Fq
-$K key_f63 kf63 Fr
-$K key_f7 kf7 k7
-$K key_f8 kf8 k8
-$K key_f9 kf9 k9
-$K key_find kfnd @0
-$K key_help khlp %1
-$K key_home khome kh
-$K key_ic kich1 kI
-$K key_il kil1 kA
-$K key_left kcub1 kl
-$K key_ll kll kH
-$K key_mark kmrk %2
-$K key_message kmsg %3
-$K key_move kmov %4
-$K key_next knxt %5
-$K key_npage knp kN
-$K key_open kopn %6
-$K key_options kopt %7
-$K key_ppage kpp kP
-$K key_previous kprv %8
-$K key_print kprt %9
-$K key_redo krdo %0
-$K key_reference kref &1
-$K key_refresh krfr &2
-$K key_replace krpl &3
-$K key_restart krst &4
-$K key_resume kres &5
-$K key_right kcuf1 kr
-$K key_save ksav &6
-$K key_sbeg kBEG &9
-$K key_scancel kCAN &0
-$K key_scommand kCMD *1
-$K key_scopy kCPY *2
-$K key_screate kCRT *3
-$K key_sdc kDC *4
-$K key_sdl kDL *5
-$K key_select kslt *6
-$K key_send kEND *7
-$K key_seol kEOL *8
-$K key_sexit kEXT *9
-$K key_sf kind kF
-$K key_sfind kFND *0
-$K key_shelp kHLP #1
-$K key_shome kHOM #2
-$K key_sic kIC #3
-$K key_sleft kLFT #4
-$K key_smessage kMSG %a
-$K key_smove kMOV %b
-$K key_snext kNXT %c
-$K key_soptions kOPT %d
-$K key_sprevious kPRV %e
-$K key_sprint kPRT %f
-$K key_sr kri kR
-$K key_sredo kRDO %g
-$K key_sreplace kRPL %h
-$K key_sright kRIT %i
-$K key_srsume kRES %j
-$K key_ssave kSAV !1
-$K key_ssuspend kSPD !2
-$K key_stab khts kT
-$K key_sundo kUND !3
-$K key_suspend kspd &7
-$K key_undo kund &8
-$K key_up kcuu1 ku
-$ keypad_local rmkx ke
-$ keypad_xmit smkx ks
-$K lab_f0 lf0 l0
-$K lab_f1 lf1 l1
-$K lab_f10 lf10 la
-$K lab_f2 lf2 l2
-$K lab_f3 lf3 l3
-$K lab_f4 lf4 l4
-$K lab_f5 lf5 l5
-$K lab_f6 lf6 l6
-$K lab_f7 lf7 l7
-$K lab_f8 lf8 l8
-$K lab_f9 lf9 l9
-$ label_off rmln LF
-$ label_on smln LO
-$ meta_off rmm mo
-$ meta_on smm mm
-$ newline nel nw
-$K pad_char pad pc
-$G parm_dch dch DC
-$G parm_delete_line dl DL
-$G parm_down_cursor cud DO
-$G parm_ich ich IC
-$G parm_index indn SF
-$G parm_insert_line il AL
-$G parm_left_cursor cub LE
-$G parm_right_cursor cuf RI
-$G parm_rindex rin SR
-$G parm_up_cursor cuu UP
-$G pkey_key pfkey pk
-$G pkey_local pfloc pl
-$G pkey_xmit pfx px
-$G plab_norm pln pn
-$ print_screen mc0 ps
-$G prtr_non mc5p pO
-$ prtr_off mc4 pf
-$ prtr_on mc5 po
-$G repeat_char rep rp
-$ req_for_input rfi RF
-$ reset_1string rs1 r1
-$ reset_2string rs2 r2
-$ reset_3string rs3 r3
-$K reset_file rf rf
-$ restore_cursor rc rc
-$G row_address vpa cv
-$ save_cursor sc sc
-$ scroll_forward ind sf
-$ scroll_reverse ri sr
-$G set_attributes sgr sa
-$ set_left_margin smgl ML
-$ set_right_margin smgr MR
-$ set_tab hts st
-$G set_window wind wi
-$ tab ht ta
-$G to_status_line tsl ts
-$ underline_char uc uc
-$ up_half_line hu hu
-$ xoff_character xoffc XF
-$ xon_character xonc XN
-
-Release 3.2 and 4 capabilities (AMIX)
-(some of the string attributes are guesses...)
-
-! back_color_erase bce ut
-! can_change ccc cc
-! col_addr_glitch xhpa YA
-! cpi_changes_res cpix YF
-! cr_cancels_micro_mode crxm YB
-! has_print_wheel daisy YC
-! hue_lightness_saturation hls hl
-! lpi_changes_res lpix YG
-! non_dest_scroll_region ndscr ND
-! row_addr_glitch xvpa YD
-! semi_auto_right_margin sam YE
-# bit_image_entwining bitwin Yo
-# bit_image_type bitype Yp
-# buffer_capacity bufsz Ya
-# buttons btns BT
-# dot_horz_spacing spinh Yc
-# dot_vert_spacing spinv Yb
-# max_attributes ma ma
-# max_colors colors Co
-# max_micro_address maddr Yd
-# max_micro_jump mjump Ye
-# max_pairs pairs pa
-# maximum_windows wnum MW
-# micro_char_size mcs Yf
-# micro_line_size mls Yg
-# no_color_video ncv NC
-# number_of_pins npins Yh
-# output_res_char orc Yi
-# output_res_horz_inch orhi Yk
-# output_res_line orl Yj
-# output_res_vert_inch orvi Yl
-# print_rate cps Ym
-# wide_char_size widcs Yn
-$ alt_scancode_esc scesa S8
-$G bit_image_carriage_return bicr Yv
-$G bit_image_newline binel Zz
-$G bit_image_repeat birep Xy
-$G change_char_pitch cpi ZA
-$G change_line_pitch lpi ZB
-$G change_res_horz chr ZC
-$G change_res_vert cvr ZD
-$G char_set_names csnm Zy
-$ code_set_init csin ci
-$G color_names colornm Yw
-$G create_window cwin CW
-$G define_bit_image_region defbi Yx
-$G define_char defc ZE
-$ device_type devt dv
-$G dial_phone dial DI
-$ display_clock dclk DK
-$ display_pc_char dispc S1
-$ end_bit_image_region endbi Yy
-$ enter_doublewide_mode swidm ZF
-$ enter_draft_quality sdrfq ZG
-$ enter_italics_mode sitm ZH
-$ enter_leftward_mode slm ZI
-$ enter_micro_mode smicm ZJ
-$ enter_near_letter_quality snlq ZK
-$ enter_normal_quality snrmq ZL
-$ enter_pc_charset_mode smpch S2
-$ enter_scancode_mode smsc S4
-$ enter_shadow_mode sshm ZM
-$ enter_subscript_mode ssubm ZN
-$ enter_superscript_mode ssupm ZO
-$ enter_upward_mode sum ZP
-$ exit_doublewide_mode rwidm ZQ
-$ exit_italics_mode ritm ZR
-$ exit_leftward_mode rlm ZS
-$ exit_micro_mode rmicm ZT
-$ exit_pc_charset_mode rmpch S3
-$ exit_scancode_mode rmsc S5
-$ exit_shadow_mode rshm ZU
-$ exit_subscript_mode rsubm ZV
-$ exit_superscript_mode rsupm ZW
-$ exit_upward_mode rum ZX
-$ fixed_pause pause PA
-$ flash_hook hook fh
-$ get_mouse getm Gm
-$G goto_window wingo WG
-$ hangup hup HU
-$G initialize_color initc Ic
-$G initialize_pair initp Ip
-$ key_mouse kmous Km
-$ label_format fln Lf
-$G micro_column_address mhpa ZY
-$ micro_down mcud1 ZZ
-$ micro_left mcub1 Za
-$ micro_right mcuf1 Zb
-$G micro_row_address mvpa Zc
-$ micro_up mcuu1 Zd
-$ mouse_info minfo Mi
-$K order_of_pins porder Ze
-$ orig_colors oc oc
-$ orig_pair op op
-$G parm_down_micro mcud Zf
-$G parm_left_micro mcub Zg
-$G parm_right_micro mcuf Zh
-$G parm_up_micro mcuu Zi
-$ pc_term_options pctrm S6
-$G pkey_plab pfxl xl
-$ pulse pulse PU
-$ quick_dial qdial QD
-$ remove_clock rmclk RC
-$ req_mouse_pos reqmp RQ
-$ scancode_escape scesc S7
-$G select_char_set scs Zj
-$ set0_des_seq s0ds s0
-$ set1_des_seq s1ds s1
-$ set2_des_seq s2ds s2
-$ set3_des_seq s3ds s3
-$G set_a_background setab AB
-$G set_a_foreground setaf AF
-$G set_background setb Sb
-$ set_bottom_margin smgb Zk
-$G set_bottom_margin_parm smgbp Zl
-$G set_clock sclk SC
-$G set_color_band setcolor Yz
-$G set_color_pair scp sp
-$G set_foreground setf Sf
-$G set_left_margin_parm smglp Zm
-$G set_lr_margin smglr ML
-$G set_page_length slines YZ
-$G set_right_margin_parm smgrp Zn
-$G set_tb_margin smgtb MT
-$ set_top_margin smgt Zo
-$G set_top_margin_parm smgtp Zp
-$G start_bit_image sbim Zq
-$G start_char_set_def scsd Zr
-$ stop_bit_image rbim Zs
-$G stop_char_set_def rcsd Zt
-$K subscript_characters subcs Zu
-$K superscript_characters supcs Zv
-$K these_cause_cr docr Zw
-$ tone tone TO
-$ user0 u0 u0
-$ user1 u1 u1
-$ user2 u2 u2
-$ user3 u3 u3
-$ user4 u4 u4
-$ user5 u5 u5
-$ user6 u6 u6
-$ user7 u7 u7
-$ user8 u8 u8
-$ user9 u9 u9
-$ wait_tone wait WA
-$ zero_motion zerom Zx
-
-"Obsolete" termcap capabilities (variable and terminfo names are mine)
-
-$ backspace_if_not_bs OTbc bc
-! backspaces_with_bs OTbs bs
-# backspace_delay OTdB dB
-# carriage_return_delay OTdC dC
-# form_feed_delay OTdF dF
-# new_line_delay OTdN dN
-# horizontal_tab_delay OTdT dT
-# vertical_tab_delay OTdV dV
-! even_parity OTEP EP
-! half_duplex OTHD HD
-# number_of_function_keys OTkn kn
-$K other_non_function_keys OTko ko
-! lower_case_only OTLC LC
-$K arrow_key_map OTma ma
-$ memory_lock_above OTml ml
-$ memory_unlock OTmu mu
-! no_correctly_working_cr OTnc nc
-! linefeed_is_newline OTNL NL
-$ linefeed_if_not_lf OTnl nl
-! crt_without_scrolling OTns ns
-! odd_parity OTOP OP
-! has_hardware_tabs OTpt pt
-! uppercase_only OTUC UC
-! return_does_clr_eol OTxr xr
-! tek_4025_insert_line OTxx xx
-# magic_cookie_glitch_ul OTug ug
-
-Caps used by the University of Waterloo (variable and terminfo names are mine)
-
-$K key_interrupt_char UWki ki
-$K key_kill_char UWkk kk
-$K key_suspend_char UWkz kz
-! initialization_messy UWxc xc
-! index_at_bottom_does_cr UWxl xl
-
-! rind_only_at_top OTxq xq
-
-Different names for existing terminfo caps used by GNU Emacs:
-! GNU_has_meta_key GNUMT MT
-# GNU_tab_width GNUtw tw
-
-Non standard capabilities:
-
-$ scroll_left sl1 Sl
-$ scroll_right sr1 Sr
-$G parm_scroll_left sl SL
-$G parm_scroll_right sr SI
-
-Dummy (must be present and last):
-
-$K _get_other use tc
diff --git a/lib/libmytinfo/compar.c b/lib/libmytinfo/compar.c
deleted file mode 100644
index f8998d3..0000000
--- a/lib/libmytinfo/compar.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * compar.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/06/04 11:36:24
- *
- */
-
-#include "defs.h"
-
-#ifdef USE_SCCS_IDS
-static const char SCCSid[] = "@(#) mytinfo compar.c 3.3 92/06/04 public domain, By Ross Ridge";
-#endif
-
-/* compare two elements a sorted list of pointers to strings */
-int
-_compar(a, b)
-#ifdef USE_ANSIC
-void const *a;
-void const *b; {
-#else
-anyptr a, b; {
-#endif
- register char *aa = **(char ***)a;
- register char *bb = **(char ***)b;
-
- /* An optimization trick from C News, compare the first
- * two chars of the string here to avoid a the overhead of a
- * call to strcmp.
- */
-
-#ifdef __GNUC__
- return ((*aa - *bb) ? : strcmp(aa, bb));
-#else
- if (*aa != *bb)
- return *aa - *bb;
- return strcmp(aa, bb);
-#endif
-}
diff --git a/lib/libmytinfo/config.h b/lib/libmytinfo/config.h
deleted file mode 100644
index 87afa05..0000000
--- a/lib/libmytinfo/config.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * config.h
- *
- * By Ross Ridge
- * Public Domain
- * 92/02/19 18:56:28
- *
- * @(#) mytinfo config.h 3.3 92/02/19 public domain, By Ross Ridge
- *
- * Read the file INSTALL for more information on configuring mytinfo
- *
- */
-
-#ifndef _CONFIG_H_
-#define _CONFIG_H_
-
-#ifdef __STDC__
-#define USE_ANSIC /* undefine this if your compiler lies */
-#endif
-
-#define USE_TERMIOS /* use POSIX termios */
-#undef USE_TERMIO /* use termio (SysIII, SysV) */
-#undef USE_SGTTY /* use sgtty (v7, BSD) */
-#define USE_WINSZ /* get window size from the tty driver */
-#undef USE_STRINGS /* include <strings.h> instead of <string.h> */
-#undef USE_MYBSEARCH /* your library doesn't have bsearch */
-#undef USE_MYSTRTOK /* your library doesn't have strtok */
-#undef USE_MYQSORT /* your library doesn't have qsort */
-#undef USE_MYMKDIR /* your library doesn't have mkdir */
-#define USE_MEMORY /* you have an <memory.h> header */
-#undef USE_FAKE_STDIO /* don't use real stdio */
-#undef USE_DOPRNT /* no vfprintf, use _doprnt */
-#undef USE_TERMINFO /* look in terminfo dirs for entry */
-#define USE_TERMCAP /* look in termcap dirs for entry */
-
-#undef USE_SHORT_BSEARCH /* speeds up MYBSEARCH on most machines */
-
-#undef USE_SMALLMEM /* save some memory */
-
-#undef USE_UPBC_KLUDGE /* do tgoto like real togo */
-#undef USE_EXTERN_UPBC /* get cuu1 and cub1 from externs UP and BC */
-#undef USE_LITOUT_KLUDGE /* an alternate tgoto kludge, not recommened */
-
-
-#ifndef USE_ANSIC
-
-#undef USE_PROTOTYPES /* use ANSI C prototypes */
-#undef USE_STDLIB /* you have a <stdlib.h> */
-#undef USE_STDARG /* you have a <stdarg.h> */
-#undef USE_STDDEF /* you have a <stddef.h> */
-
-#define const
-#define volatile
-#define noreturn /* a function that doesn't return */
-
-typedef char *anyptr; /* a type that any pointer can be assigned to */
-
-#define mysize_t unsigned /* size_t, the size of an object */
-
-#else /* USE_ANSIC */
-
-#define USE_PROTOTYPES
-#define USE_STDLIB
-#define USE_STDARG
-#define USE_STDDEF
-
-typedef void *anyptr;
-
-#define mysize_t size_t
-
-#ifdef __GNUC__
-#define noreturn volatile
-#else
-#define noreturn
-#endif
-
-#endif /* USE_ANSIC */
-
-#ifdef __FreeBSD__
-#define TERMCAPFILE "$TERMCAPFILE $HOME/.termcap /usr/share/misc/termcap"
-#else
-#define TERMCAPFILE "$TERMCAPFILE $HOME/.termcap /etc/termcap"
-#endif
-
-#define TERMINFOSRC "/usr/lib/terminfo/terminfo.src"
-
-#define TERMINFODIR "/usr/lib/terminfo"
-
-#endif
diff --git a/lib/libmytinfo/defs.h b/lib/libmytinfo/defs.h
deleted file mode 100644
index 7b8e8d9..0000000
--- a/lib/libmytinfo/defs.h
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * defs.h
- *
- * By Ross Ridge
- * Public Domain
- * 92/06/04 11:37:02
- *
- * @(#) mytinfo defs.h 3.3 92/06/04 public domain, By Ross Ridge
- */
-
-#ifndef _DEFS_H_
-#define _DEFS_H_
-
-#ifdef TEST
-#undef NOTLIB
-#define NOTLIB
-#endif
-
-#include "config.h"
-
-#ifdef NOTLIB
-#undef USE_FAKE_STDIO
-#endif
-
-#ifdef USE_STDDEF
-#include <stddef.h>
-#else
-#include <sys/types.h>
-#endif
-
-#ifdef USE_STDLIB
-#include <stdlib.h>
-#else
-#ifdef USE_PROTOTYPES
-anyptr malloc(mysize_t);
-anyptr realloc(anyptr, mysize_t);
-char *getenv(char const *);
-#else
-anyptr malloc();
-anyptr realloc();
-char *getenv();
-#endif
-#endif
-
-#ifdef USE_STDARG
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-#ifndef _VA_LIST
-#define _VA_LIST
-#endif
-
-#ifdef USE_FAKE_STDIO
-#include "fake_stdio.h"
-#define sprintf _fake_sprintf
-#ifdef USE_PROTOTYPES
-int sprintf(char *, char *, ...);
-#else
-int sprintf();
-#endif
-#else /* USE_FAKE_STDIO */
-#if 0
-#include <stdio.h>
-#else
-#undef NULL
-#include <stdio.h>
-#endif
-#endif /* !USE_FAKE_STDIO */
-
-#ifdef USE_STRINGS
-#include <strings.h>
-#define strchr(s, c) index(s, c)
-#define strrchr(s, c) rindex(s, c)
-#ifndef USE_MYSTRTOK
-#ifdef USE_PROTOTYPES
-char *strtok(char *, char *);
-#else
-char *strtok();
-#endif
-#endif
-#else
-#include <string.h>
-#endif
-
-#ifdef USE_MEMORY
-#include <memory.h>
-#else
-#define memcpy(b, a, n) bcopy(a, b, n)
-#endif
-
-#include <errno.h>
-
-#define MAX_BUF 4096
-#define MAX_LINE 640
-#define MAX_NAME 128
-
-#define MAX_CHUNK MAX_LINE
-
-#define MAX_DEPTH 32
-
-#define MAX_VARNAME 32
-#define MAX_TINFONAME 5
-#define MAX_TCAPNAME 2
-
-struct caplist {
- char type;
- char flag;
- char var[MAX_VARNAME + 1];
- char tinfo[MAX_TINFONAME + 1];
- char tcap[MAX_TCAPNAME + 1];
-};
-
-struct term_path {
- char *file;
- int type; /* 0 = file, 1 = TERMCAP env, 2 = TERMINFO env */
-};
-
-struct _terminal;
-
-#ifdef USE_PROTOTYPES
-
-int _gettcap(char *, struct _terminal *, struct term_path *);
-int _gettinfo(char *, struct _terminal *, struct term_path *);
-int _fillterm(char *, struct term_path *, char *);
-int _findterm(char *, struct term_path *, char *);
-int _init_tty(void), _lit_output(void), _check_tty(void);
-void _figure_termcap(void);
-int _tmatch(char *, char *);
-void _norm_output(void);
-int readcaps(FILE *, struct caplist *, int);
-noreturn void quit(int, char *, ...);
-#ifdef lint
-extern void (*cleanup)();
-#else
-extern void (*cleanup)(int);
-#endif
-struct term_path *_buildpath(char *, int, ...);
-void _delpath(struct term_path *);
-char *_addstr(char *);
-struct strbuf *_endstr(void);
-void _del_strs(struct _terminal *);
-void _tcapconv(void);
-void _tcapdefault(void);
-int _getother(char *, struct term_path *, struct _terminal *);
-int _gettbin(char *, struct _terminal *);
-int _findboolcode(char *), _findnumcode(char *), _findstrcode(char *);
-int _findboolname(char *), _findnumname(char *), _findstrname(char *);
-int _findboolfname(char *), _findnumfname(char *), _findstrfname(char *);
-
-#ifdef USE_ANSIC
-int _compar(void const *, void const *);
-typedef int (*compar_fn)(void const *, void const *);
-#else
-int _compar(anyptr, anyptr);
-typedef int (*compar_fn)(anyptr, anyptr);
-#endif
-
-#else /* USE_PROTOTYPES */
-
-int _gettcap(), _gettinfo(), _fillterm(), _findterm(), _init_tty();
-int _lit_output(), _check_tty();
-void _figure_termcap();
-int _tmatch();
-void _norm_output();
-int readcaps();
-noreturn void /* GOTO */ quit(/*FORMAT2*/);
-extern void (*cleanup)();
-struct term_path *_buildpath();
-void _delpath();
-char *_addstr();
-struct strbuf *_endstr();
-void _del_strs();
-void _tcapconv();
-void _tcapdefault();
-int _getother();
-int _gettbin();
-int _findboolcode(), _findnumcode(), _findstrcode();
-int _findboolname(), _findnumname(), _findstrname();
-int _findboolfname(), _findnumfname(), _findstrfname();
-int _compar();
-typedef int (*compar_fn)();
-
-#endif /* USE_PROTOTYPES */
-
-extern char _strflags[];
-
-extern char _mytinfo_version[];
-
-/* for quit.c */
-extern int sys_nerr;
-extern char *prg_name;
-
-#endif /* _DEFS_H_ */
diff --git a/lib/libmytinfo/fillterm.c b/lib/libmytinfo/fillterm.c
deleted file mode 100644
index 8e120c9..0000000
--- a/lib/libmytinfo/fillterm.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * fillterm.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/02/01 07:29:54
- *
- */
-
-#include "defs.h"
-#include <term.h>
-
-#ifdef USE_SCCS_IDS
-static const char SCCSid[] = "@(#) mytinfo fillterm.c 3.2 92/02/01 public domain, By Ross Ridge";
-#endif
-
-TERMINAL _term_buf;
-TERMINAL *cur_term;
-
-int
-_fillterm(name, path, buf)
-char *name, *buf;
-struct term_path *path; {
- register int i, r;
-
- r = -1;
-
- for(i = NUM_OF_BOOLS; i;)
- _term_buf.bools[--i] = -1;
- for(i = NUM_OF_NUMS; i;)
- _term_buf.nums[--i] = -2;
- for(i = NUM_OF_STRS; i;)
- _term_buf.strs[--i] = (char *) -1;
-
- _term_buf.name_all = NULL;
-
- r = _findterm(name, path, buf);
- switch(r) {
- case 1:
- if (_gettcap(buf, &_term_buf, path) != 0)
- return -3;
- _tcapconv();
- _tcapdefault();
- break;
- case 2:
- if (_gettinfo(buf, &_term_buf, path) != 0)
- return -3;
- break;
- case 3:
- if (_gettbin(buf, &_term_buf) != 0)
- return -3;
- break;
- default:
- return r;
- }
-
- if ((_term_buf.name = _addstr(name)) == NULL)
- return -3;
-
- for(i = NUM_OF_BOOLS; i;)
- if (_term_buf.bools[--i] == -1)
- _term_buf.bools[i] = 0;
- for(i = NUM_OF_NUMS; i;)
- if (_term_buf.nums[--i] == -2)
- _term_buf.nums[i] = -1;
- for(i = NUM_OF_STRS; i;)
- if (_term_buf.strs[--i] == (char *) -1)
- _term_buf.strs[i] = NULL;
-
- _term_buf.fd = 1;
- _term_buf.pad = 1;
- _term_buf.baudrate = 0;
- _term_buf.strbuf = _endstr();
-
- cur_term = (TERMINAL *) malloc(sizeof(_term_buf));
- if (cur_term == NULL)
- return -3;
- memcpy((anyptr)cur_term, (anyptr)&_term_buf, sizeof(_term_buf));
-
- return r;
-}
diff --git a/lib/libmytinfo/findcap.c b/lib/libmytinfo/findcap.c
deleted file mode 100644
index 81ede3f..0000000
--- a/lib/libmytinfo/findcap.c
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * findcap.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/02/01 07:29:55
- *
- */
-
-#include "defs.h"
-#include <term.h>
-
-#include "bsearch.c"
-
-#ifdef USE_SCCS_IDS
-static const char SCCSid[] = "@(#) mytinfo findcap.c 3.2 92/02/01 public domain, By Ross Ridge";
-#endif
-
-extern char **_sboolcodes[], **_snumcodes[], **_sstrcodes[];
-extern char **_sboolnames[], **_snumnames[], **_sstrnames[];
-extern char **_sboolfnames[], **_snumfnames[], **_sstrfnames[];
-
-static char **p2p2c;
-
-int
-_findboolcode(s)
-char *s; {
- char ***match;
-
- p2p2c = &s;
-
- match = (char ***) bsearch((anyptr) &p2p2c, (anyptr) _sboolcodes,
- NUM_OF_BOOLS, sizeof(p2p2c), _compar);
- if (match == NULL)
- return -1;
- return *match - boolcodes;
-}
-
-int
-_findboolname(s)
-char *s; {
- char ***match;
-
- p2p2c = &s;
-
- match = (char ***) bsearch((anyptr) &p2p2c, (anyptr) _sboolnames,
- NUM_OF_BOOLS, sizeof(p2p2c), _compar);
- if (match == NULL)
- return -1;
- return *match - boolnames;
-}
-
-int
-_findboolfname(s)
-char *s; {
- char ***match;
-
- p2p2c = &s;
-
- match = (char ***) bsearch((anyptr) &p2p2c, (anyptr) _sboolfnames,
- NUM_OF_BOOLS, sizeof(p2p2c), _compar);
- if (match == NULL)
- return -1;
- return *match - boolfnames;
-}
-
-int
-_findnumcode(s)
-char *s; {
- char ***match;
-
- p2p2c = &s;
-
- match = (char ***) bsearch((anyptr) &p2p2c, (anyptr) _snumcodes,
- NUM_OF_NUMS, sizeof(p2p2c), _compar);
- if (match == NULL)
- return -1;
- return *match - numcodes;
-}
-
-int
-_findnumname(s)
-char *s; {
- char ***match;
-
- p2p2c = &s;
-
- match = (char ***) bsearch((anyptr) &p2p2c, (anyptr) _snumnames,
- NUM_OF_NUMS, sizeof(p2p2c), _compar);
- if (match == NULL)
- return -1;
- return *match - numnames;
-}
-
-int
-_findnumfname(s)
-char *s; {
- char ***match;
-
- p2p2c = &s;
-
- match = (char ***) bsearch((anyptr) &p2p2c, (anyptr) _snumfnames,
- NUM_OF_NUMS, sizeof(p2p2c), _compar);
- if (match == NULL)
- return -1;
- return *match - numfnames;
-}
-
-int
-_findstrcode(s)
-char *s; {
- char ***match;
-
- p2p2c = &s;
-
- match = (char ***) bsearch((anyptr) &p2p2c, (anyptr) _sstrcodes,
- NUM_OF_STRS, sizeof(p2p2c), _compar);
- if (match == NULL)
- return -1;
- return *match - strcodes;
-}
-
-int
-_findstrname(s)
-char *s; {
- char ***match;
-
- p2p2c = &s;
-
- match = (char ***) bsearch((anyptr) &p2p2c, (anyptr) _sstrnames,
- NUM_OF_STRS, sizeof(p2p2c), _compar);
- if (match == NULL)
- return -1;
- return *match - strnames;
-}
-
-int
-_findstrfname(s)
-char *s; {
- char ***match;
-
- p2p2c = &s;
-
- match = (char ***) bsearch((anyptr) &p2p2c, (anyptr) _sstrfnames,
- NUM_OF_STRS, sizeof(p2p2c), _compar);
- if (match == NULL)
- return -1;
- return *match - strfnames;
-}
diff --git a/lib/libmytinfo/findterm.c b/lib/libmytinfo/findterm.c
deleted file mode 100644
index 8fc41a0..0000000
--- a/lib/libmytinfo/findterm.c
+++ /dev/null
@@ -1,286 +0,0 @@
-/* findterm.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/02/01 07:29:56
- *
- */
-
-#include "defs.h"
-
-#include <ctype.h>
-#include <fcntl.h>
-#ifdef USE_STDDEF
-#include <sys/types.h>
-#endif
-#include <sys/stat.h>
-#ifdef __FreeBSD__
-#include <unistd.h>
-#endif
-
-#ifdef USE_SCCS_IDS
-static const char SCCSid[] = "@(#) mytinfo findterm.c 3.2 92/02/01 public domain, By Ross Ridge";
-#endif
-static int linecnt;
-
-static int
-getln(f, buf, len)
-FILE *f;
-register char *buf;
-int len; {
- register int c, i = 0;
-
- while((c = getc(f)) == '#') {
- linecnt++;
- while((c = getc(f)) != '\n')
- if (c == EOF)
- return -1;
- }
-
- while(c != '\n') {
- if (c == EOF)
- return -1;
- if (i < len) {
- i++;
- *buf++ = c;
- }
- c = getc(f);
- }
-
- while(i > 0 && isspace(*(buf-1))) {
- buf--;
- i--;
- }
-
- *buf = '\0';
- return i;
-}
-
-static int
-_findterm2(name, file, buf)
-char *name, *buf;
-char *file; {
- char line[MAX_LINE];
- FILE *f;
- register char *sp, *dp;
- int c;
- int l;
- int cont;
- int fd;
- struct stat st;
-
- linecnt = 0;
-
-#ifdef DEBUG
- printf("open: %s\n", file);
-#endif
- fd = open(file, O_RDONLY);
- if (fd == -1)
- return -1;
- if (fstat(fd, &st) == -1) {
- close(fd);
- return -1;
- }
- if ((st.st_mode & 0170000) == 0040000) {
- sprintf(buf, "%s/%c/%s", file, name[0], name);
- close(fd);
- fd = open(buf, O_RDONLY);
- if (fd == -1)
- return -1;
- if (read(fd, buf, MAX_BUF) < 12
- || buf[0] != 032 || buf[1] != 1) {
- close(fd);
- return -1;
- }
- close(fd);
- return 3;
- }
- f = fdopen(fd, "r");
- if (f == NULL) {
- close(fd);
- return -1;
- }
-
- while ((l = getln(f, buf, MAX_LINE)) != -1) {
- linecnt++;
- if (!isspace(buf[0]) && l != 0) {
- sp = buf + l - 1;
- cont = 0;
- switch(*sp) {
- case '\\':
- cont = 1;
- *sp = '\0';
- /* FALLTHROUGH */
- case ':':
- sp = buf;
- dp = line;
- while (*sp != ':') {
- if (*sp == '\0' && cont &&
- (l = getln(f, buf, MAX_LINE))
- != -1) {
- linecnt++;
- sp = buf;
- if (l > 0 && buf[l-1] == '\\')
- cont = 1;
- else
- cont = 0;
- continue;
- }
- if (*sp == '\0') {
-#ifdef DEBUG
- printf("bad line (%d)\n",
- linecnt);
- fclose(f);
- return -2;
-#else
- goto err;
-#endif
- }
- *dp++ = *sp++;
- }
- *dp = '\0';
- if (!_tmatch(line, name))
- break;
- if (!cont) {
- fclose(f);
- return 1;
- }
- l = strlen(buf);
- dp = buf + l;
- while((c = getc(f)) != EOF && l < MAX_BUF) {
- if (c == '\n')
- break;
- if (c == '\\') {
- c = getc(f);
- if (c == EOF)
- break;
- if (c == '\n') {
- c = getc(f);
- if (c == EOF)
- break;
- if (c == '#') {
- while((c = getc(f)) != EOF && c != '\n');
- if (c == EOF)
- break;
- continue;
- }
- *dp++ = c;
- continue;
- }
- *dp++ = '\\';
- *dp++ = c;
- continue;
- }
- *dp++ = c;
- }
- *dp = '\0';
- fclose(f);
- return 1;
- case ',':
- sp = buf;
- dp = line;
- while(*sp != ',')
- *dp++ = *sp++;
- *dp = '\0';
- if (!_tmatch(line, name))
- break;
- dp = buf + l;
- while ((c = getc(f)) != EOF && l < MAX_BUF) {
- if (c == '\n') {
- c = getc(f);
- if (isspace(c))
- continue;
- if (c == '\n') {
- ungetc(c, f);
- continue;
- }
- if (c == '#') {
- while((c = getc(f)) != EOF)
- if (c == '\n')
- break;
- if (c == EOF)
- break;
- ungetc(c, f);
- continue;
- }
- break;
- }
- *dp++ = c;
- l++;
- }
- *dp = '\0';
- fclose(f);
- return 2;
- default:
- err:
-#ifdef DEBUG
- printf("strange line (%d)\n", linecnt);
-#endif
- break;
- }
- }
- }
- fclose(f);
- return 0;
-}
-
-int
-_findterm(name, path, buf)
-char *name;
-struct term_path *path;
-char *buf; {
- register char *s, *d;
- int r = 0;
- while(path->file != NULL) {
- switch(path->type) {
- case 0:
- r = _findterm2(name, path->file, buf);
- break;
- case 1:
- if (path->file[0] == '/') {
- r = _findterm2(name, path->file, buf);
- } else {
- s = path->file;
- d = buf;
- while(*s != '\0' && *s != ':')
- *d++ = *s++;
- *d = '\0';
- if (_tmatch(buf, name)) {
- while(*s != '\0')
- *d++ = *s++;
- return 1;
- }
- r = 0;
- }
- break;
- case 2:
- if (path->file[0] == '/') {
- r = _findterm2(name, path->file, buf);
- } else {
- s = path->file;
- d = buf;
- while(*s != '\0' && *s != ',')
- *d++ = *s++;
- *d = '\0';
- if (_tmatch(buf, name)) {
- while(*s != '\0')
- *d++ = *s++;
- return 2;
- }
- r = 0;
- }
- break;
- default:
- r = 0;
- break;
- }
- if (r == 1 || r == 2 || r == 3) {
-#ifdef DEBUG
- printf("found in %s\n", path->file);
-#endif
- break;
- }
- path++;
- }
- return r;
-}
diff --git a/lib/libmytinfo/getother.c b/lib/libmytinfo/getother.c
deleted file mode 100644
index 2542f66..0000000
--- a/lib/libmytinfo/getother.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * getother.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/02/01 07:29:58
- *
- */
-
-#include "defs.h"
-#include <term.h>
-
-#ifdef USE_SCCS_IDS
-static const char SCCSid[] = "@(#) mytinfo getother.c 3.2 92/02/01 public domain, By Ross Ridge";
-#endif
-
-int
-_getother(name, path, ct)
-char *name;
-struct term_path *path;
-TERMINAL *ct; {
- static int depth = 0;
- int r;
- char buf[MAX_BUF];
-
- if (depth >= MAX_DEPTH)
- return 1; /* infinite loop */
-
-#ifdef DEBUG
- printf("\ngetother: %s\n", name);
-#endif
-
- switch(_findterm(name, path, buf)) {
- case -3:
- return 1;
- case 1:
- depth++;
- r = _gettcap(buf, ct, path);
- break;
- case 2:
- depth++;
- r = _gettinfo(buf, ct, path);
- break;
- default:
- return 0;
- }
- depth--;
- return r;
-}
diff --git a/lib/libmytinfo/gettbin.c b/lib/libmytinfo/gettbin.c
deleted file mode 100644
index 678a7d8..0000000
--- a/lib/libmytinfo/gettbin.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * gettbin.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/02/01 07:29:59
- *
- * Get a terminfo binary entry
- *
- */
-
-#include "defs.h"
-#include <term.h>
-
-#ifdef USE_SCCS_IDS
-static const char SCCSid[] = "@(#) mytinfo gettbin.c 3.2 92/02/01 public domain, By Ross Ridge";
-#endif
-
-extern int _boolorder[], _numorder[], _strorder[];
-
-#ifdef TRUE_BYTE_ORDERING
-/* 8 bit char, 16 bit short, lsb first, twos complement */
-#define convshort(s) (*(short *)(s))
-
-#else
-
-#ifdef TWOS_COPLEMENT
-/* 8 bit char, 16 bit short, lsb last, twos complement */
-#define convshort(s) ((short)(((s[0] & 0377) << 8) | (s[1] & 0377)))
-
-#else
-
-/* anything else... */
-
-static short
-convshort(s)
-char *s; {
- register int a,b;
-
- a = (int) s[0] & 0377;
- b = (int) s[1] & 0377;
-
- if (a == 0377 && b == 0377)
- return -1;
- if (a == 0376 && b == 0377)
- return -2;
-
- return a + b * 256;
-}
-#endif
-#endif
-
-int
-_gettbin(buf, cur)
-char *buf;
-TERMINAL *cur; {
- register char *s;
- int i;
- int sz_names, sz_bools, sz_nums, sz_offs, sz_strs;
- int n_bools, n_nums, n_strs;
- char *strtbl;
-
- buf[MAX_BUF-1] = '\0';
- s = buf;
-
- if (convshort(s) != 0432)
- return 1;
- sz_names = convshort(s + 2);
- sz_bools = convshort(s + 4);
- n_nums = convshort(s + 6);
- n_strs = convshort(s + 8);
- sz_strs = convshort(s + 10);
-
- n_bools = sz_bools;
- sz_nums = n_nums * 2;
- sz_offs = n_strs * 2;
-
- if ((sz_names + sz_bools) & 1)
- sz_bools++;
-
- if (12 + sz_names + sz_bools + sz_nums + sz_offs + sz_strs >= MAX_BUF)
- return 1;
-
- s += 12;
- if ((cur->name_all = _addstr(s)) == NULL)
- return 1;
- s += sz_names;
- while(--s >= buf + 12) {
- if (*s == '|') {
- if ((cur->name_long = _addstr(s + 1)) == NULL)
- return 1;
- break;
- }
- }
-
- s = buf + 12 + sz_names;
- for(i = 0; i < n_bools && _boolorder[i] != -1; i++, s++) {
- if (cur->bools[_boolorder[i]] == -1 && *s == 1)
- cur->bools[_boolorder[i]] = 1;
- }
-
- s = buf + 12 + sz_names + sz_bools;
- for(i = 0; i < n_nums && _numorder[i] != -1; i++, s += 2) {
- if (convshort(s) == -2)
- cur->nums[_numorder[i]] = -1;
- else if (cur->nums[_numorder[i]] == -2 && convshort(s) != -1)
- cur->nums[_numorder[i]] = convshort(s);
- }
-
- s = buf + 12 + sz_names + sz_bools + sz_nums;
- strtbl = s + sz_offs;
- for(i = 0; i < n_strs && _strorder[i] != -1; i++, s += 2) {
- if (convshort(s) == -2)
- cur->strs[_strorder[i]] = NULL;
- else if (cur->strs[_strorder[i]] == (char *) -1
- && convshort(s) != -1) {
-#ifdef DEBUG
- printf("$%s ", strnames[_strorder[i]]);
-#endif
- if ((cur->strs[_strorder[i]]
- = _addstr(strtbl + convshort(s))) == NULL)
- return 1;
- }
- }
-
- return 0;
-}
diff --git a/lib/libmytinfo/gettcap.c b/lib/libmytinfo/gettcap.c
deleted file mode 100644
index 1424b88..0000000
--- a/lib/libmytinfo/gettcap.c
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
- * gettcap.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/02/01 07:30:00
- *
- */
-
-#include "defs.h"
-#include <term.h>
-
-#include <ctype.h>
-
-#ifdef USE_SCCS_IDS
-static const char SCCSid[] = "@(#) mytinfo gettcap.c 3.2 92/02/01 public domain, By Ross Ridge";
-#endif
-
-int
-_gettcap(sp, cur, path)
-register char *sp;
-TERMINAL *cur;
-struct term_path *path; {
- static char name[MAX_NAME];
- static char entry[MAX_LINE];
- register char *dp;
- register TERMINAL *ct = cur;
- int i, pad, fract, mul = 0, ind;
- char c, flag;
-
- dp = entry;
- while(*sp != ':' && *sp != '\0')
- *dp++ = *sp++;
- if (ct->name_all == NULL) {
- *dp = '\0';
- if ((ct->name_all = _addstr(entry)) == NULL)
- return 1;
- while(dp > entry && *--dp != '|');
- ct->name_long = ct->name_all + (dp - entry) + 1;
- }
-
- while(*sp != '\0') {
- while(*sp == ':')
- sp++;
- while(isspace(*sp))
- sp++;
- if (*sp == ':')
- continue;
- if (*sp == '\0')
- break;
- dp = name;
- while (*sp != ':' && *sp != '#' && *sp != '=' &&
- !isspace(*sp) && *sp != '\0')
- *dp++ = *sp++;
- *dp = '\0';
-#ifdef DEBUG
- printf(" %s", name);
-#endif
- switch(*sp) {
- case '=':
-#ifdef DEBUG
- putchar('$');
-#endif
- ind = _findstrcode(name);
- if (ind != -1)
- flag = _strflags[ind];
- else
- flag = 'K';
- dp = entry;
- fract = pad = 0;
- sp++;
- if (isdigit(*sp) && flag != 'K') {
- pad = *sp++ - '0';
- while(isdigit(*sp))
- pad = pad * 10 + (*sp++ - '0');
- if (*sp == '.' && isdigit(sp[1])) {
- sp++;
- fract = (*sp++ - '0');
- }
- if (*sp == '*') {
- mul = 1;
- sp++;
- } else
- mul = 0;
-
- }
- while(*sp != '\0' && *sp != ':') {
- switch(*sp) {
- case '\\':
- switch(*++sp) {
- case 'e':
- case 'E': *dp++ = '\033'; break;
- case 'l': *dp++ = '\012'; break;
- case 'n': *dp++ = '\n'; break;
- case 'r': *dp++ = '\r'; break;
- case 't': *dp++ = '\t'; break;
- case 'b': *dp++ = '\b'; break;
- case 'f': *dp++ = '\f'; break;
- case 's': *dp++ = ' '; break;
-
- case '^':
- case '\\':
- case ',':
- case ':':
- *dp++ = *sp;
- break;
-
- case '0':
- if (!isdigit(*(sp + 1))) {
- *dp++ = '\200';
- break;
- }
- ;/* FALLTHROUGH */
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- c = *sp - '0';
- if (sp[1] >= '0'
- && sp[1] <= '8')
- c = c * 8
- + (*++sp - '0');
- if (sp[1] >= '0'
- && sp[1] <= '8')
- c = c * 8
- + (*++sp - '0');
- switch((char)c) {
- case 0:
- if (flag == 'K')
- *dp++ = '\200';
- else {
- *dp++ = '\\';
- *dp++ = '0';
- *dp++ = '0';
- *dp++ = '0';
- }
- break;
- case '$':
- case '\'':
- case '\\':
- if (flag != 'K')
- *dp++ = '\\';
- /* FALLTHROUGH */
- default:
- if (flag == 'G'
- && c == '%')
- *dp++ = '\\';
- *dp++ = c;
- break;
- }
- break;
- default:
- *dp++ = '\\';
- *dp++ = *sp;
- break;
- }
- sp++;
- break;
- case '^':
- if (*++sp >= 'A' && *sp <= '_') {
- *dp++ = *sp++ - '@';
- } else if (*sp >= 'a' && *sp <= 'z') {
- *dp++ = *sp++ - 'a' + 1;
- } else if (*sp == '@') {
- if (flag == 'K')
- *dp++ = '\200';
- else {
- *dp++ = '\\';
- *dp++ = '0';
- *dp++ = '0';
- *dp++ = '0';
- }
- sp++;
- } else if (*sp == '?') {
- *dp++ = '\177';
- sp++;
- } else
- *dp++ = '^';
- break;
- case '$':
- if (flag != 'K')
- *dp++ = '\\';
- /* FALLTHROUGH */
- default:
- *dp++ = *sp++;
- break;
- }
- }
- if (pad != 0 || fract != 0) {
- if (fract == 0)
- sprintf(dp, "$<%d", pad);
- else
- sprintf(dp, "$<%d.%d", pad, fract);
- dp += strlen(dp);
- if (mul)
- *dp++ = '*';
- *dp++ = '>';
- }
- *dp++ = '\0';
- if(name[0] == 't' && name[1] == 'c' && name[2] == '\0'){
- if (_getother(entry, path, ct))
- return 1;
- break;
- }
- if (ind == -1)
- break;
- if (ct->strs[ind] != (char *) -1)
- break;
- if ((ct->strs[ind] = _addstr(entry)) == NULL)
- return 1;
- break;
- case '#':
-#ifdef DEBUG
- putchar('#');
-#endif
- i = atoi(++sp);
- while(*sp != '\0' && *sp++ != ':');
- ind = _findnumcode(name);
- if (ind == -1)
- break;
- if (ct->nums[ind] != -2)
- break;
- ct->nums[ind] = i;
- break;
- default:
- while(*sp != '\0' && *sp++ != ':');
- if (*(dp - 1) == '@') {
-#ifdef DEBUG
- putchar('@');
-#endif
- *(dp - 1) = '\0';
- ind = _findboolcode(name);
- if (ind != -1) {
-#ifdef DEBUG
- putchar('!');
-#endif
- if (ct->bools[ind] == -1)
- ct->bools[ind] = 0;
- break;
- }
- ind = _findnumcode(name);
- if (ind != -1) {
-#ifdef DEBUG
- putchar('#');
-#endif
- if (ct->nums[ind] == -2)
- ct->nums[ind] = -1;
- break;
- }
- ind = _findstrcode(name);
- if (ind != -1) {
-#ifdef DEBUG
- putchar('$');
-#endif
- if (ct->strs[ind] == (char *) -1)
- ct->strs[ind] = NULL;
- break;
- }
- break;
- }
-#ifdef DEBUG
- putchar('!');
-#endif
- ind = _findboolcode(name);
- if (ind == -1)
- break;
- if (ct->bools[ind] != -1)
- break;
- ct->bools[ind] = 1;
- }
- }
- return 0;
-}
diff --git a/lib/libmytinfo/gettinfo.c b/lib/libmytinfo/gettinfo.c
deleted file mode 100644
index 7b7b445..0000000
--- a/lib/libmytinfo/gettinfo.c
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * gettinfo.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/02/01 07:30:02
- *
- */
-
-#include "defs.h"
-#include <term.h>
-
-#include <ctype.h>
-
-#ifdef USE_SCCS_IDS
-static const char SCCSid[] = "@(#) mytinfo gettinfo.c 3.2 92/02/01 public domain, By Ross Ridge";
-#endif
-
-int _gettinfo(sp, cur, path)
-register char *sp;
-struct term_path *path;
-TERMINAL *cur; {
- static char name[MAX_NAME];
- static char entry[MAX_LINE];
- register char *dp;
- register TERMINAL *ct = cur;
- int ind, i, base;
- char c, flag;
-
- dp = entry;
- while(*sp != ',' && *sp != '\0')
- *dp++ = *sp++;
- if (ct->name_all == NULL) {
- *dp = '\0';
- if ((ct->name_all = _addstr(entry)) == NULL)
- return 1;
- while(dp > entry && *--dp != '|');
- ct->name_long = ct->name_all + (dp - entry) + 1;
- }
-
- while(*sp != '\0') {
- while(*sp == ',')
- sp++;
- while(isspace(*sp))
- sp++;
- if (*sp == ',')
- continue;
- if (*sp == '\0')
- break;
- dp = name;
- while (*sp != ',' && *sp != '#' && *sp != '=' && !isspace(*sp) && *sp != '\0')
- *dp++ = *sp++;
- *dp = '\0';
-#ifdef DEBUG
- printf(" %s", name);
-#endif
- switch(*sp) {
- case '=':
-#ifdef DEBUG
- putchar('$');
-#endif
- dp = entry;
- sp++;
- ind = _findstrname(name);
- if (ind != -1)
- flag = _strflags[ind];
- else {
- ind = _findstrfname(name);
- if (ind != -1)
- flag = _strflags[ind];
- else
- flag = 'K';
- }
- while(*sp != '\0' && *sp != ',') {
- switch(*sp) {
- case '%':
- *dp++ = *sp++;
- if (*sp == '^' && flag == 'G')
- *dp++ = *sp++;
- break;
- case '\\':
- switch(*++sp) {
- case 'e':
- case 'E': *dp++ = '\033'; break;
- case 'l': *dp++ = '\012'; break;
- case 'n': *dp++ = '\n'; break;
- case 'r': *dp++ = '\r'; break;
- case 't': *dp++ = '\t'; break;
- case 'b': *dp++ = '\b'; break;
- case 'f': *dp++ = '\f'; break;
- case 's': *dp++ = ' '; break;
-
- case '^':
- case '\\':
- case ',':
- case ':':
- *dp++ = *sp; break;
-
- case '0':
- if (!isdigit(*(sp + 1))) {
- *dp++ = '\200';
- break;
- }
- /* FALLTHROUGH */
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- c = *sp - '0';
- if (isdigit(sp[1]))
- c = c * 8 + (*++sp-'0');
- if (isdigit(sp[1]))
- c = c * 8 + (*++sp-'0');
- switch((char)c) {
- case 0:
- if (flag == 'K')
- *dp++ = '\200';
- else {
- *dp++ = '\\';
- *dp++ = '0';
- *dp++ = '0';
- *dp++ = '0';
- }
- break;
- case '$':
- case '\'':
- case '\\':
- if (flag != 'K')
- *dp++ = '\\';
- /* FALLTHROUGH */
- default:
- if (flag == 'G'
- && c == '%')
- *dp++ = '\\';
- *dp++ = c;
- break;
- }
- break;
- default:
- *dp++ = '\\';
- *dp++ = *sp;
- break;
- }
- sp++;
- break;
- case '^':
- if (*++sp >= 'A' && *sp <= '_') {
- *dp++ = *sp++ - '@';
- } else if (*sp >= 'a' && *sp <= 'z') {
- *dp++ = *sp++ - 'a' + 1;
- } else if (*sp == '@') {
- if (flag == 'K')
- *dp++ = '\200';
- else {
- *dp++ = '\\';
- *dp++ = '0';
- *dp++ = '0';
- *dp++ = '0';
- }
- sp++;
- } else
- *dp++ = '^';
- break;
- default:
- *dp++ = *sp++;
- break;
- }
- }
- *dp++ = '\0';
- if (strcmp(name, "use") == 0) {
- if (_getother(entry, path, ct))
- return 1;
- break;
- }
- if (ind == -1)
- break;
- if (ct->strs[ind] != (char *) -1)
- break;
- if ((ct->strs[ind] = _addstr(entry)) == NULL)
- return 1;
- break;
- case '#':
-#ifdef DEBUG
- putchar('#');
-#endif
-#if 0
- i = atoi(++sp);
-#else
- sp++;
- if (*sp == '0') {
- sp++;
- if (*sp == 'x' || *sp == 'X') {
- sp++;
- base = 16;
- } else
- base = 8;
- } else
- base = 10;
- i = 0;
- while(1) {
- if (isdigit(*sp))
- i = i * base + *sp - '0';
- else if (base == 16 && isxdigit(*sp))
- i = i * base + tolower(*sp) - 'a' + 10;
- else
- break;
- sp++;
- }
-#endif
- while(*sp != '\0' && *sp != ',')
- sp++;
-
- ind = _findnumname(name);
- if (ind != -1) {
- if (ct->nums[ind] != -2)
- break;
- ct->nums[ind] = i;
- } else {
- ind = _findnumfname(name);
- if (ind != -1) {
- if (ct->nums[ind] != -2)
- break;
- ct->nums[ind] = i;
- }
- }
- break;
- default:
- while(*sp != '\0' && *sp++ != ',');
- if (*(dp - 1) == '@') {
-#ifdef DEBUG
- putchar('@');
-#endif
- *(dp - 1) = '\0';
- ind = _findboolname(name);
- if (ind != -1) {
-#ifdef DEBUG
- putchar('!');
-#endif
- ct->bools[ind] = 0;
- break;
- }
- ind = _findnumname(name);
- if (ind != -1) {
-#ifdef DEBUG
- putchar('#');
-#endif
- ct->nums[ind] = -1;
- break;
- }
- ind = _findstrname(name);
- if (ind != -1) {
-#ifdef DEBUG
- putchar('$');
-#endif
- ct->strs[ind] = NULL;
- break;
- }
- ind = _findboolfname(name);
- if (ind != -1) {
-#ifdef DEBUG
- putchar('!');
-#endif
- ct->bools[ind] = 0;
- break;
- }
- ind = _findnumfname(name);
- if (ind != -1) {
-#ifdef DEBUG
- putchar('#');
-#endif
- ct->nums[ind] = -1;
- break;
- }
- ind = _findstrfname(name);
- if (ind != -1) {
-#ifdef DEBUG
- putchar('$');
-#endif
- ct->strs[ind] = NULL;
- break;
- }
- break;
- }
-#ifdef DEBUG
- putchar('!');
-#endif
- ind = _findboolname(name);
- if (ind == -1) {
- ind = _findboolfname(name);
- if (ind == -1)
- break;
- }
- if (ct->bools[ind] != -1)
- break;
- ct->bools[ind] = 1;
- break;
- }
- }
- return 0;
-}
diff --git a/lib/libmytinfo/mkbinorder.c b/lib/libmytinfo/mkbinorder.c
deleted file mode 100644
index 0bcc474..0000000
--- a/lib/libmytinfo/mkbinorder.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * mkbinorder.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/02/01 07:30:04
- *
- */
-
-#define NOTLIB
-#include "defs.h"
-#include <term.h>
-
-const char SCCSid[] = "@(#) mytinfo mkbinorder.c 3.2 92/02/01 public domain, By Ross Ridge";
-
-char cap[MAX_NAME];
-char *p2c = cap;
-char **p2p2c = &p2c;
-
-int
-main(argc, argv)
-int argc;
-char **argv; {
- int r;
- int ind;
- FILE *f;
-
- if (argc == 1)
- f = stdin;
- else if (argc == 2) {
- f = fopen(argv[1], "r");
- if (f == NULL) {
- fprintf(stderr, "can't open %s\n", argv[1]);
- exit(1);
- }
- } else {
- fprintf(stderr, "argument count\n");
- exit(1);
- }
-
- do {
- r = fscanf(f, "%s", cap);
- } while(r == 1 && strcmp(cap, "!") != 0);
- if (r != 1) {
- fprintf(stderr, "expected '!'\n");
- exit(1);
- }
-
- puts("/*");
- puts(" * binorder.c");
- puts(" *");
- puts(" * This file was generated automatically");
- puts(" *");
- puts(" */\n");
-
- puts("int _boolorder[] = {");
-
- while(1) {
- r = fscanf(f, "%s", cap);
- cap[MAX_TINFONAME] = '\0';
- if (r != 1) {
- fprintf(stderr, "unexpected EOF\n");
- exit(1);
- }
- if (strcmp(cap, "#") == 0)
- break;
- ind = _findboolname(cap);
- if (ind == -1) {
- fprintf(stderr, "unknown bool name '%s'\n", cap);
- continue;
- }
- printf("\t%d,\n", ind);
- }
- puts("\t-1");
- puts("};\n");
-
- puts("int _numorder[] = {");
-
- while(1) {
- r = fscanf(f, "%s", cap);
- cap[MAX_TINFONAME] = '\0';
- if (r != 1) {
- fprintf(stderr, "unexpected EOF\n");
- exit(1);
- }
- if (strcmp(cap, "$") == 0)
- break;
- ind = _findnumname(cap);
- if (ind == -1) {
- fprintf(stderr, "unknown num name '%s'\n", cap);
- continue;
- }
- printf("\t%d,\n", ind);
- }
- puts("\t-1");
- puts("};\n");
-
- puts("int _strorder[] = {");
-
- while(1) {
- r = fscanf(f, "%s", cap);
- cap[MAX_TINFONAME] = '\0';
- if (r != 1)
- break;
- ind = _findstrname(cap);
- if (ind == -1) {
- fprintf(stderr, "unknown str name '%s'\n", cap);
- continue;
- }
- printf("\t%d,\n", ind);
- }
- puts("\t-1");
- puts("};\n");
-
- return 0;
-}
diff --git a/lib/libmytinfo/mkcaplist.c b/lib/libmytinfo/mkcaplist.c
deleted file mode 100644
index 2fedf2d..0000000
--- a/lib/libmytinfo/mkcaplist.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * mkcaplist.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/02/01 07:30:05
- *
- * mkcaplist [-n caps] [file]
- *
- * makes caplist.c from the cap_list file
- *
- */
-
-#define NOTLIB
-#include "defs.h"
-
-const char SCCSid[] = "@(#) mytinfo mkcaplist.c 3.2 92/02/01 public domain, By Ross Ridge";
-
-#define DEFAULT_CAPS 1000
-
-struct caplist *list;
-
-int
-main(argc, argv)
-int argc;
-char **argv; {
- FILE *f;
- int caps = DEFAULT_CAPS;
- int n;
- register int i;
-
- if (argc > 2 && argv[1][0] == '-' && argv[1][1] == 'n') {
- caps = atoi(argv[2]);
- argv += 2;
- argc -= 2;
- }
-
- if (argc == 1) {
- f = stdin;
- } else if (argc == 2) {
- f = fopen(argv[1], "r");
- if (f == NULL) {
- fprintf(stderr, "%s: can't open '%s'\n", argv[0],
- argv[1]);
- return 1;
- }
- } else {
- fprintf(stderr, "%s: too many arguments\n", argv[0]);
- fprintf(stderr, "usage: %s [-n caps] [file]\n", argv[0]);
- return 1;
- }
-
- list = (struct caplist *) malloc(caps * sizeof(struct caplist));
- if (list == NULL) {
- fprintf(stderr, "%s: malloc failed.\n", argv[0]);
- return 1;
- }
-
- n = readcaps(f, list, caps);
- if (n > caps) {
- fprintf(stderr, "%s: too many caps, use -n.\n", argv[0]);
- return 1;
- }
- if (n == 0) {
- fprintf(stderr, "%s: no caps in file.\n", argv[0]);
- return 1;
- }
- if (n == -1) {
- fprintf(stderr, "%s: bad caps line.\n", argv[0]);
- return 1;
- }
- if (n == -2) {
- fprintf(stderr, "%s: unexpected EOF.\n", argv[0]);
- return 1;
- }
-
- puts("/*");
- puts(" * caplist.c ");
- puts(" *");
- puts(" * This file was generated automatically.");
- puts(" *");
- puts(" */");
- putchar('\n');
-
- puts("char *boolnames[] = {");
- for (i = 0; i < n; i++)
- if (list[i].type == '!')
- printf("\t\"%s\",\n", list[i].tinfo);
- puts("\t(char *)0");
- puts("};");
- putchar('\n');
-
- puts("char *boolcodes[] = {");
- for (i = 0; i < n; i++)
- if (list[i].type == '!')
- printf("\t\"%s\",\n", list[i].tcap);
- puts("\t(char *)0");
- puts("};");
- putchar('\n');
-
- puts("char *boolfnames[] = {");
- for (i = 0; i < n; i++)
- if (list[i].type == '!')
- printf("\t\"%s\",\n", list[i].var);
- puts("\t(char *)0");
- puts("};");
- putchar('\n');
-
- puts("char *numnames[] = {");
- for (i = 0; i < n; i++)
- if (list[i].type == '#')
- printf("\t\"%s\",\n", list[i].tinfo);
- puts("\t(char *)0");
- puts("};");
- putchar('\n');
-
- puts("char *numcodes[] = {");
- for (i = 0; i < n; i++)
- if (list[i].type == '#')
- printf("\t\"%s\",\n", list[i].tcap);
- puts("\t(char *)0");
- puts("};");
- putchar('\n');
-
- puts("char *numfnames[] = {");
- for (i = 0; i < n; i++)
- if (list[i].type == '#')
- printf("\t\"%s\",\n", list[i].var);
- puts("\t(char *)0");
- puts("};");
- putchar('\n');
-
- puts("char *strnames[] = {");
- for (i = 0; i < n; i++)
- if (list[i].type == '$')
- printf("\t\"%s\",\n", list[i].tinfo);
- puts("\t(char *)0");
- puts("};");
- putchar('\n');
-
- puts("char *strcodes[] = {");
- for (i = 0; i < n; i++)
- if (list[i].type == '$')
- printf("\t\"%s\",\n", list[i].tcap);
- puts("\t(char *)0");
- puts("};");
- putchar('\n');
-
- puts("char *strfnames[] = {");
- for (i = 0; i < n; i++)
- if (list[i].type == '$')
- printf("\t\"%s\",\n", list[i].var);
- puts("\t(char *)0");
- puts("};");
- putchar('\n');
-
- puts("char _strflags[] = {");
- for (i = 0; i < n; i++)
- if (list[i].type == '$')
- printf("\t'%c',\n", list[i].flag);
- puts("\t'\\0'");
- puts("};");
- putchar('\n');
-
- return 0;
-}
diff --git a/lib/libmytinfo/mkcapsort.c b/lib/libmytinfo/mkcapsort.c
deleted file mode 100644
index ee93ced..0000000
--- a/lib/libmytinfo/mkcapsort.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * mkcapsort.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/06/04 11:38:02
- *
- * mkcapsort
- *
- * make the sorted lists of pointers to strins
- *
- */
-
-#define NOTLIB
-#include "defs.h"
-#include <term.h>
-
-#ifdef USE_MYQSORT
-#include "qsort.c"
-#endif
-
-const char SCCSid[] = "@(#) mytinfo mkcapsort.c 3.3 92/06/04 public domain, By Ross Ridge";
-
-char **sboolnames[NUM_OF_BOOLS], **sboolcodes[NUM_OF_BOOLS], **sboolfnames[NUM_OF_BOOLS];
-char **snumnames[NUM_OF_NUMS], **snumcodes[NUM_OF_NUMS], **snumfnames[NUM_OF_NUMS];
-char **sstrnames[NUM_OF_STRS], **sstrcodes[NUM_OF_STRS], **sstrfnames[NUM_OF_STRS];
-
-
-int
-main() {
- register int i;
-
- i = NUM_OF_BOOLS;
- while(i) {
- i--;
- sboolnames[i] = &boolnames[i];
- sboolcodes[i] = &boolcodes[i];
- sboolfnames[i] = &boolfnames[i];
- }
-
- i = NUM_OF_NUMS;
- while(i) {
- i--;
- snumnames[i] = &numnames[i];
- snumcodes[i] = &numcodes[i];
- snumfnames[i] = &numfnames[i];
- }
-
- i = NUM_OF_STRS;
- while(i) {
- i--;
- sstrnames[i] = &strnames[i];
- sstrcodes[i] = &strcodes[i];
- sstrfnames[i] = &strfnames[i];
- }
-
- qsort((anyptr) sboolnames, NUM_OF_BOOLS, sizeof(*sboolnames), _compar);
- qsort((anyptr) sboolcodes, NUM_OF_BOOLS, sizeof(*sboolcodes), _compar);
- qsort((anyptr) sboolfnames, NUM_OF_BOOLS, sizeof(*sboolfnames),_compar);
- qsort((anyptr) snumnames, NUM_OF_NUMS, sizeof(*snumnames), _compar);
- qsort((anyptr) snumcodes, NUM_OF_NUMS, sizeof(*snumcodes), _compar);
- qsort((anyptr) snumfnames, NUM_OF_NUMS, sizeof(*snumfnames), _compar);
- qsort((anyptr) sstrnames, NUM_OF_STRS, sizeof(*sstrnames), _compar);
- qsort((anyptr) sstrcodes, NUM_OF_STRS, sizeof(*sstrcodes), _compar);
- qsort((anyptr) sstrfnames, NUM_OF_STRS, sizeof(*sstrfnames), _compar);
-
- printf("/*\n");
- printf(" * capsort.c\n");
- printf(" *\n");
- printf(" * This file was generated automatically.\n");
- printf(" *\n");
- printf(" */\n\n");
-
- puts("extern char *boolnames[], *boolcodes[], *boolfnames[];");
- puts("extern char *numnames[], *numcodes[], *numfnames[];");
- puts("extern char *strnames[], *strcodes[], *strfnames[];");
- putchar('\n');
-
- printf("char **_sboolnames[] = {\n");
- for(i = 0; i < NUM_OF_BOOLS; i++)
- printf("\tboolnames + %ld,\n", (long) (sboolnames[i] - boolnames));
- printf(" (char **) 0\n");
- printf("};\n\n");
-
- printf("char **_sboolcodes[] = {\n");
- for(i = 0; i < NUM_OF_BOOLS; i++)
- printf("\tboolcodes + %ld,\n", (long) (sboolcodes[i] - boolcodes));
- printf(" (char **) 0\n");
- printf("};\n\n");
-
- printf("char **_sboolfnames[] = {\n");
- for(i = 0; i < NUM_OF_BOOLS; i++)
- printf("\tboolfnames + %ld,\n", (long) (sboolfnames[i] - boolfnames));
- printf(" (char **) 0\n");
- printf("};\n\n");
-
- printf("char **_snumnames[] = {\n");
- for(i = 0; i < NUM_OF_NUMS; i++)
- printf("\tnumnames + %ld,\n", (long) (snumnames[i] - numnames));
- printf(" (char **) 0\n");
- printf("};\n\n");
-
- printf("char **_snumcodes[] = {\n");
- for(i = 0; i < NUM_OF_NUMS; i++)
- printf("\tnumcodes + %ld,\n", (long) (snumcodes[i] - numcodes));
- printf(" (char **) 0\n");
- printf("};\n\n");
-
- printf("char **_snumfnames[] = {\n");
- for(i = 0; i < NUM_OF_NUMS; i++)
- printf("\tnumfnames + %ld,\n", (long) (snumfnames[i] - numfnames));
- printf(" (char **) 0\n");
- printf("};\n\n");
-
- printf("char **_sstrnames[] = {\n");
- for(i = 0; i < NUM_OF_STRS; i++)
- printf("\tstrnames + %ld,\n", (long) (sstrnames[i] - strnames));
- printf(" (char **) 0\n");
- printf("};\n\n");
-
- printf("char **_sstrcodes[] = {\n");
- for(i = 0; i < NUM_OF_STRS; i++)
- printf("\tstrcodes + %ld,\n", (long) (sstrcodes[i] - strcodes));
- printf(" (char **) 0\n");
- printf("};\n\n");
-
- printf("char **_sstrfnames[] = {\n");
- for(i = 0; i < NUM_OF_STRS; i++)
- printf("\tstrfnames + %ld,\n", (long) (sstrfnames[i] - strfnames));
- printf(" (char **) 0\n");
- printf("};\n\n");
-
- return 0;
-}
diff --git a/lib/libmytinfo/mktermhead.c b/lib/libmytinfo/mktermhead.c
deleted file mode 100644
index bacf051..0000000
--- a/lib/libmytinfo/mktermhead.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * mktermhead.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/06/04 11:38:57
- *
- * mktermhead [-n caps] file
- *
- * generates term.head
- *
- */
-
-#define NOTLIB
-#include "defs.h"
-
-const char SCCSid[] = "@(#) mytinfo mktermhead.c 3.3 92/06/04 public domain, By Ross Ridge";
-
-#define DEFAULT_CAPS 1000
-
-
-int
-main(argc, argv)
-int argc;
-char **argv; {
- FILE *f;
- int caps = DEFAULT_CAPS;
- int n;
- register int i;
- int nb, ns, nn;
- struct caplist *list;
-
- if (argc > 2 && argv[1][0] == '-' && argv[1][1] == 'n') {
- caps = atoi(argv[2]);
- argv += 2;
- argc -= 2;
- }
-
- if (argc == 1) {
- f = stdin;
- } else if (argc == 2) {
- f = fopen(argv[1], "r");
- if (f == NULL) {
- fprintf(stderr, "%s: can't open '%s'\n", argv[0],
- argv[1]);
- return 1;
- }
- } else {
- fprintf(stderr, "%s: too many arguments\n", argv[0]);
- fprintf(stderr, "usage: %s [-n caps] [file]\n", argv[0]);
- return 1;
- }
-
- list = (struct caplist *) malloc(caps * sizeof(struct caplist));
- if (list == NULL) {
- fprintf(stderr, "%s: malloc failed.\n", argv[0]);
- return 1;
- }
-
- n = readcaps(f, list, caps);
- if (n > caps) {
- fprintf(stderr, "%s: too many caps, use -n.\n", argv[0]);
- return 1;
- }
- switch(n) {
- case 0:
- fprintf(stderr, "%s: no caps in file.\n", argv[0]);
- return 1;
- case -1:
- fprintf(stderr, "%s: bad caps line.\n", argv[0]);
- return 1;
- case -2:
- fprintf(stderr, "%s: unexpected EOF.\n", argv[0]);
- return 1;
- }
-
- puts("/*");
- puts(" * term.h ");
- puts(" *");
- puts(" * This file was generated automatically.");
- puts(" *");
- puts(" */");
- putchar('\n');
- puts("#ifndef _TERM_H_");
- puts("#define _TERM_H_");
- putchar('\n');
- nb = 0;
- for (i = 0; i < n; i++) {
- if (list[i].type == '!') {
- printf("#define %-*s (_CUR_TERM.bools[%d])\n",
- MAX_VARNAME, list[i].var, nb);
- nb++;
- }
- }
-
- nn = 0;
- for (i = 0; i < n; i++) {
- if (list[i].type == '#') {
- printf("#define %-*s (_CUR_TERM.nums[%d])\n",
- MAX_VARNAME, list[i].var, nn);
- nn++;
- }
- }
-
- ns = 0;
- for (i = 0; i < n; i++) {
- if (list[i].type == '$') {
- printf("#define %-*s (_CUR_TERM.strs[%d])\n",
- MAX_VARNAME, list[i].var, ns);
- ns++;
- }
- }
-
- putchar('\n');
-
- printf ("#define NUM_OF_BOOLS\t%d\n", nb);
- printf ("#define NUM_OF_NUMS\t%d\n", nn);
- printf ("#define NUM_OF_STRS\t%d\n", ns);
-
- putchar('\n');
- puts("#ifndef OVERRIDE");
- puts("#undef _USE_SGTTY");
-#ifdef USE_SGTTY
- puts("#define _USE_SGTTY");
-#endif
- puts("#undef _USE_TERMIO");
-#ifdef USE_TERMIO
- puts("#define _USE_TERMIO");
-#endif
- puts("#undef _USE_TERMIOS");
-#ifdef USE_TERMIOS
- puts("#define _USE_TERMIOS");
-#endif
- puts("#undef _USE_SMALLMEM");
-#ifdef USE_SMALLMEM
- puts("#define _USE_SMALLMEM");
-#endif
- puts("#undef _USE_PROTOTYPES");
-#ifdef USE_PROTOTYPES
- puts("#define _USE_PROTOTYPES");
-#endif
- puts("#undef _USE_WINSZ");
-#ifdef USE_WINSZ
- puts("#define _USE_WINSZ");
-#endif
- puts("#undef _USE_TERMINFO");
-#ifdef USE_TERMINFO
- puts("#define _USE_TERMINFO");
-#endif
- puts("#undef _USE_TERMCAP");
-#ifdef USE_TERMCAP
- puts("#define _USE_TERMCAP");
-#endif
- puts("#undef _MAX_CHUNK");
- printf("#define _MAX_CHUNK %d\n", MAX_CHUNK);
- puts("#endif /* OVERRIDE */");
- putchar('\n');
-
- return 0;
-}
diff --git a/lib/libmytinfo/mkversion.c b/lib/libmytinfo/mkversion.c
deleted file mode 100644
index 9fbc12e..0000000
--- a/lib/libmytinfo/mkversion.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * mkversion.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/02/01 07:30:09
- *
- * generates version.c
- *
- */
-
-#define NOTLIB
-#include "defs.h"
-
-#include "version.h"
-
-const char SCCSid[] = "@(#) mytinfo mkversion.c 3.2 92/02/01 public domain, By Ross Ridge";
-
-int
-main(argc, argv)
-int argc;
-char **argv; {
- puts("/*");
- puts(" * version.c ");
- puts(" *");
- puts(" * This file was generated automatically.");
- puts(" *");
- puts(" */");
- putchar('\n');
-
- printf("char _mytinfo_version[] = \"@(#) mytinfo: Release %d, Patchlevel %d (ache).\";\n",
- RELEASE, PATCHLEVEL);
-
- return 0;
-}
diff --git a/lib/libmytinfo/readcaps.c b/lib/libmytinfo/readcaps.c
deleted file mode 100644
index b78bdc1..0000000
--- a/lib/libmytinfo/readcaps.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * readcaps.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/02/01 07:30:15
- *
- * Read in the cap_list file
- *
- */
-
-#define NOTLIB
-#include "defs.h"
-
-#include <ctype.h>
-
-#ifdef USE_SCCS_IDS
-static const char SCCSid[] = "@(#) mytinfo readcaps.c 3.2 92/02/01 public domain, By Ross Ridge";
-#endif
-
-#ifdef __GNUC__
-__inline__
-#endif
-static int
-skipline(f)
-register FILE *f; {
- register int c;
-
- do {
- c = getc(f);
- if (c == EOF)
- return EOF;
-#ifdef TEST
- putchar(c);
-#endif
- } while (c != '\n');
-
- return 0;
-}
-
-#ifdef __GNUC__
-__inline__
-#endif
-static int
-getfield(f, s, len)
-register FILE *f;
-register char *s;
-int len; {
- register int c;
- int i;
-#ifdef TEST
- char *start = s;
-#endif
-
- do {
- c = getc(f);
- if (c == EOF)
- return EOF;
- } while (c != '\n' && isspace(c));
- if (c == '\n')
- return 0;
-
- i = 0;
- while(!isspace(c)) {
- if (i++ < len)
- *s++ = c;
- c = getc(f);
- if (c == EOF)
- return EOF;
-
- }
- *s = '\0';
-#ifdef TEST
- printf(" %s", start);
-#endif
- return c;
-}
-
-int
-readcaps(f, buf, max)
-FILE *f;
-register struct caplist *buf;
-int max; {
- int type;
- register int count;
- int c;
- static char dummy;
-
- count = 0;
- type = getc(f);
- while(type != EOF) {
- if (type == '$' || type == '!' || type == '#') {
- if (count >= max)
- return count + 1;
-#ifdef TEST
- putchar(type);
-#endif
- buf[count].type = type;
-
- if (type == '$') {
- c = getc(f);
- if (c == EOF)
- break;
- if (c == 'G')
- buf[count].flag = 'G';
- else if (c == 'K')
- buf[count].flag = 'K';
- else
- buf[count].flag = ' ';
- }
-
- c = getfield(f, buf[count].var, MAX_VARNAME);
- if (c == EOF || c == '\n' || c == 0)
- return -1;
- c = getfield(f, buf[count].tinfo, MAX_TINFONAME);
- if (c == EOF || c == '\n' || c == 0)
- return -1;
- c = getfield(f, buf[count].tcap, MAX_TCAPNAME);
- if (c == EOF || c == 0)
- return -1;
- if (c != '\n')
- if (getfield(f, &dummy, 1) != 0)
- return -1;
- count++;
-#ifdef TEST
- putchar('\n');
-#endif
- } else {
-#ifdef TEST
- putchar(type);
-#endif
- if (type != '\n' && skipline(f) == EOF)
- return -1;
- }
- type = getc(f);
- }
- return count;
-}
-
-#ifdef TEST
-struct caplist list[1000];
-
-int
-main() {
- int ret;
-
- ret = readcaps(stdin, list, 1000);
- printf("ret = %d\n", ret);
- return 0;
-}
-#endif
diff --git a/lib/libmytinfo/tcapconv.c b/lib/libmytinfo/tcapconv.c
deleted file mode 100644
index 3cd4d36..0000000
--- a/lib/libmytinfo/tcapconv.c
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * tcapconv.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/02/01 07:30:20
- *
- */
-
-#include "defs.h"
-#define SINGLE
-#include <term.h>
-
-#ifdef USE_SCCS_IDS
-static const char SCCSid[] = "@(#) mytinfo tcapconv.c 3.2 92/02/01 public domain, By Ross Ridge";
-#endif
-
-extern char **_sstrcodes[], **_sstrnames[];
-
-static char *C_CR = "\r";
-static char *C_LF = "\n";
-static char *C_BS = "\b";
-/* static char *C_FF = "\f"; */
-static char *C_HT = "\t";
-/* static char *C_VT = "\013"; */
-/* static char *C_NL = "\r\n"; */
-
-#define DEF(s) ((s) != (char *) -1 && (s) != NULL)
-#define NOTSET(s) ((s) == (char *) -1)
-
-/*
- * This routine fills in caps that either had defaults under termcap or
- * can be manufactured from obsolete termcap capabilities.
- */
-
-void
-_tcapdefault() {
- char buf[MAX_LINE * 2 + 2];
- int set_scroll_forward_to_lf;
-
- if (NOTSET(carriage_return)) {
- if (carriage_return_delay > 0) {
- sprintf(buf, "%s$<%d>", C_CR, carriage_return_delay);
- carriage_return = _addstr(buf);
- } else
- carriage_return = _addstr(C_CR);
- }
- if (NOTSET(cursor_left)) {
- if (backspace_delay > 0) {
- sprintf(buf, "%s$<%d>", C_BS, backspace_delay);
- cursor_left = _addstr(buf);
- } else if (backspaces_with_bs == 1)
- cursor_left = _addstr(C_BS);
- else if (DEF(backspace_if_not_bs))
- cursor_left = _addstr(backspace_if_not_bs);
- }
-/* vi doesn't use "do", but it does seems to use nl (or '\n') instead */
- if (NOTSET(cursor_down)) {
- if (DEF(linefeed_if_not_lf))
- cursor_down = _addstr(linefeed_if_not_lf);
- else if (linefeed_is_newline != 1) {
- if (new_line_delay > 0) {
- sprintf(buf, "%s$<%d>", C_LF, new_line_delay);
- cursor_down = _addstr(buf);
- } else
- cursor_down = _addstr(C_LF);
- }
- }
- set_scroll_forward_to_lf = 0;
- if (NOTSET(scroll_forward) && crt_without_scrolling != 1) {
- set_scroll_forward_to_lf = 1;
- if (DEF(linefeed_if_not_lf))
- scroll_forward = _addstr(linefeed_if_not_lf);
- else if (linefeed_is_newline != 1) {
- if (new_line_delay > 0) {
- sprintf(buf, "%s$<%d>", C_LF, new_line_delay);
- scroll_forward = _addstr(buf);
- } else
- scroll_forward = _addstr(C_LF);
- }
- }
- if (NOTSET(newline)) {
- if (linefeed_is_newline == 1) {
- if (new_line_delay > 0) {
- sprintf(buf, "%s$<%d>", C_LF, new_line_delay);
- newline = _addstr(buf);
- } else
- newline = _addstr(C_LF);
- } else if (DEF(carriage_return) && carriage_return_delay <= 0) {
- if (set_scroll_forward_to_lf) {
- strncpy(buf, carriage_return, MAX_LINE-2);
- buf[MAX_LINE-1] = '\0';
- strncat(buf, scroll_forward, MAX_LINE-strlen(buf)-1);
- } else if (DEF(linefeed_if_not_lf)) {
- strncpy(buf, carriage_return, MAX_LINE-2);
- buf[MAX_LINE-1] = '\0';
- strncat(buf, linefeed_if_not_lf, MAX_LINE-strlen(buf)-1);
- }
- else if (new_line_delay > 0)
- sprintf(buf, "%s%s$<%d>", carriage_return, C_LF, new_line_delay);
- else {
- strncpy(buf, carriage_return, MAX_LINE-2);
- buf[MAX_LINE-1] = '\0';
- strncat(buf, C_LF, MAX_LINE-strlen(buf)-1);
- }
- buf[MAX_LINE-1] = '\0';
- newline = _addstr(buf);
- }
- }
-
-/*
- * We wait until know to decide if we've got a working cr because even
- * one that doesn't work can be used for newline. Unfortunately the
- * space allocated for it is wasted.
- */
- if (return_does_clr_eol == 1 || no_correctly_working_cr == 1)
- carriage_return = NULL;
-
-/*
- * supposedly most termcap entries have ta now and '\t' is no longer a
- * default, but it doesn't seem to be true...
- */
- if (NOTSET(tab)) {
- if (horizontal_tab_delay > 0) {
- sprintf(buf, "%s$<%d>", C_HT, horizontal_tab_delay);
- tab = _addstr(buf);
- } else
- tab = _addstr(C_HT);
- }
-#if 0
-/* probably not needed and might confuse some programmes */
- if (NOTSET(form_feed)) {
- if (form_feed_delay > 0) {
- sprintf(buf, "%s$<%d>", C_FF, form_feed_delay);
- form_feed = _addstr(buf);
- } else
- form_feed = _addstr(C_FF);
- }
-#endif
- if (init_tabs == -1 && has_hardware_tabs == 1)
- init_tabs = 8;
-
- if (NOTSET(key_backspace))
- key_backspace = _addstr(C_BS);
- if (NOTSET(key_left))
- key_left = _addstr(C_BS);
- if (NOTSET(key_down))
- key_down = _addstr(C_LF);
-}
-
-void
-_tcapconv() {
- char buf[MAX_LINE+1];
-
- if (GNU_tab_width > 0 && init_tabs == -1)
- init_tabs = GNU_tab_width;
-
- if (GNU_has_meta_key == 1 && has_meta_key == -1)
- has_meta_key = 1;
-
-/*
- * this is some what a kludge, but should work unless someone breaks
- * conventions.
- */
- if (DEF(other_non_function_keys)) {
- register char *s;
- static char *o;
- static char name[MAX_NAME] = "k";
- char *str;
- int ind;
-
- s = strcpy(buf, other_non_function_keys);
- while(*s != '\0') {
- o = s;
- while(*s != ',' && *s != '\0')
- s++;
- if (*s != '\0')
- *s++ = '\0';
- ind = _findstrcode(o);
- if (ind == -1)
- continue;
- str = _term_buf.strs[ind];
- if (!DEF(str))
- continue;
- strncpy(name + 1, strnames[ind], MAX_NAME - 2);
- ind = _findstrname(name);
- if (ind == -1)
- continue;
- if (!NOTSET(_term_buf.strs[ind]))
- continue;
- _term_buf.strs[ind] = _addstr(str);
- }
- }
-}
diff --git a/lib/libmytinfo/tcapvars.c b/lib/libmytinfo/tcapvars.c
deleted file mode 100644
index 52e339c..0000000
--- a/lib/libmytinfo/tcapvars.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * tcapvars.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/02/01 07:30:21
- *
- */
-
-#include "defs.h"
-#include <term.h>
-
-#ifdef USE_SCCS_IDS
-static const char SCCSid[] = "@(#) mytinfo tcapvars.c 3.2 92/02/01 public domain, By Ross Ridge";
-#endif
-
-char PC;
-short ospeed;
-char *UP, *BC;
-
-void
-_figure_termcap() {
-#if defined(USE_SGTTY) || defined(USE_TERMIO) || defined(USE_TERMIOS)
-#ifdef USE_TERMIOS
- extern speed_t _baud_tbl[];
-#else
-#ifdef USE_SMALLMEM
- extern unsigned short _baud_tbl[];
-#else
- extern long _baud_tbl[];
-#endif
-#endif
- cur_term->padch = PC;
- cur_term->baudrate = _baud_tbl[ospeed];
-#endif
-}
diff --git a/lib/libmytinfo/term.h b/lib/libmytinfo/term.h
deleted file mode 100644
index f2b3a4d..0000000
--- a/lib/libmytinfo/term.h
+++ /dev/null
@@ -1,664 +0,0 @@
-/*
- * term.h
- *
- * This file was generated automatically.
- *
- */
-
-#ifndef _TERM_H_
-#define _TERM_H_
-
-#define auto_left_margin (_CUR_TERM.bools[0])
-#define auto_right_margin (_CUR_TERM.bools[1])
-#define ceol_standout_glitch (_CUR_TERM.bools[2])
-#define dest_tabs_magic_smso (_CUR_TERM.bools[3])
-#define eat_newline_glitch (_CUR_TERM.bools[4])
-#define erase_overstrike (_CUR_TERM.bools[5])
-#define generic_type (_CUR_TERM.bools[6])
-#define hard_copy (_CUR_TERM.bools[7])
-#define hard_cursor (_CUR_TERM.bools[8])
-#define has_meta_key (_CUR_TERM.bools[9])
-#define has_status_line (_CUR_TERM.bools[10])
-#define insert_null_glitch (_CUR_TERM.bools[11])
-#define memory_above (_CUR_TERM.bools[12])
-#define memory_below (_CUR_TERM.bools[13])
-#define move_insert_mode (_CUR_TERM.bools[14])
-#define move_standout_mode (_CUR_TERM.bools[15])
-#define needs_xon_xoff (_CUR_TERM.bools[16])
-#define no_esc_ctlc (_CUR_TERM.bools[17])
-#define no_pad_char (_CUR_TERM.bools[18])
-#define non_rev_rmcup (_CUR_TERM.bools[19])
-#define over_strike (_CUR_TERM.bools[20])
-#define prtr_silent (_CUR_TERM.bools[21])
-#define status_line_esc_ok (_CUR_TERM.bools[22])
-#define tilde_glitch (_CUR_TERM.bools[23])
-#define transparent_underline (_CUR_TERM.bools[24])
-#define xon_xoff (_CUR_TERM.bools[25])
-#define back_color_erase (_CUR_TERM.bools[26])
-#define can_change (_CUR_TERM.bools[27])
-#define col_addr_glitch (_CUR_TERM.bools[28])
-#define cpi_changes_res (_CUR_TERM.bools[29])
-#define cr_cancels_micro_mode (_CUR_TERM.bools[30])
-#define has_print_wheel (_CUR_TERM.bools[31])
-#define hue_lightness_saturation (_CUR_TERM.bools[32])
-#define lpi_changes_res (_CUR_TERM.bools[33])
-#define non_dest_scroll_region (_CUR_TERM.bools[34])
-#define row_addr_glitch (_CUR_TERM.bools[35])
-#define semi_auto_right_margin (_CUR_TERM.bools[36])
-#define backspaces_with_bs (_CUR_TERM.bools[37])
-#define even_parity (_CUR_TERM.bools[38])
-#define half_duplex (_CUR_TERM.bools[39])
-#define lower_case_only (_CUR_TERM.bools[40])
-#define no_correctly_working_cr (_CUR_TERM.bools[41])
-#define linefeed_is_newline (_CUR_TERM.bools[42])
-#define crt_without_scrolling (_CUR_TERM.bools[43])
-#define odd_parity (_CUR_TERM.bools[44])
-#define has_hardware_tabs (_CUR_TERM.bools[45])
-#define uppercase_only (_CUR_TERM.bools[46])
-#define return_does_clr_eol (_CUR_TERM.bools[47])
-#define tek_4025_insert_line (_CUR_TERM.bools[48])
-#define initialization_messy (_CUR_TERM.bools[49])
-#define index_at_bottom_does_cr (_CUR_TERM.bools[50])
-#define rind_only_at_top (_CUR_TERM.bools[51])
-#define GNU_has_meta_key (_CUR_TERM.bools[52])
-#define columns (_CUR_TERM.nums[0])
-#define init_tabs (_CUR_TERM.nums[1])
-#define label_height (_CUR_TERM.nums[2])
-#define label_width (_CUR_TERM.nums[3])
-#define lines (_CUR_TERM.nums[4])
-#define lines_of_memory (_CUR_TERM.nums[5])
-#define magic_cookie_glitch (_CUR_TERM.nums[6])
-#define num_labels (_CUR_TERM.nums[7])
-#define padding_baud_rate (_CUR_TERM.nums[8])
-#define virtual_terminal (_CUR_TERM.nums[9])
-#define width_status_line (_CUR_TERM.nums[10])
-#define bit_image_entwining (_CUR_TERM.nums[11])
-#define bit_image_type (_CUR_TERM.nums[12])
-#define buffer_capacity (_CUR_TERM.nums[13])
-#define buttons (_CUR_TERM.nums[14])
-#define dot_horz_spacing (_CUR_TERM.nums[15])
-#define dot_vert_spacing (_CUR_TERM.nums[16])
-#define max_attributes (_CUR_TERM.nums[17])
-#define max_colors (_CUR_TERM.nums[18])
-#define max_micro_address (_CUR_TERM.nums[19])
-#define max_micro_jump (_CUR_TERM.nums[20])
-#define max_pairs (_CUR_TERM.nums[21])
-#define maximum_windows (_CUR_TERM.nums[22])
-#define micro_char_size (_CUR_TERM.nums[23])
-#define micro_line_size (_CUR_TERM.nums[24])
-#define no_color_video (_CUR_TERM.nums[25])
-#define number_of_pins (_CUR_TERM.nums[26])
-#define output_res_char (_CUR_TERM.nums[27])
-#define output_res_horz_inch (_CUR_TERM.nums[28])
-#define output_res_line (_CUR_TERM.nums[29])
-#define output_res_vert_inch (_CUR_TERM.nums[30])
-#define print_rate (_CUR_TERM.nums[31])
-#define wide_char_size (_CUR_TERM.nums[32])
-#define backspace_delay (_CUR_TERM.nums[33])
-#define carriage_return_delay (_CUR_TERM.nums[34])
-#define form_feed_delay (_CUR_TERM.nums[35])
-#define new_line_delay (_CUR_TERM.nums[36])
-#define horizontal_tab_delay (_CUR_TERM.nums[37])
-#define vertical_tab_delay (_CUR_TERM.nums[38])
-#define number_of_function_keys (_CUR_TERM.nums[39])
-#define magic_cookie_glitch_ul (_CUR_TERM.nums[40])
-#define GNU_tab_width (_CUR_TERM.nums[41])
-#define acs_chars (_CUR_TERM.strs[0])
-#define back_tab (_CUR_TERM.strs[1])
-#define bell (_CUR_TERM.strs[2])
-#define carriage_return (_CUR_TERM.strs[3])
-#define change_scroll_region (_CUR_TERM.strs[4])
-#define char_padding (_CUR_TERM.strs[5])
-#define clear_all_tabs (_CUR_TERM.strs[6])
-#define clear_margins (_CUR_TERM.strs[7])
-#define clear_screen (_CUR_TERM.strs[8])
-#define clr_bol (_CUR_TERM.strs[9])
-#define clr_eol (_CUR_TERM.strs[10])
-#define clr_eos (_CUR_TERM.strs[11])
-#define column_address (_CUR_TERM.strs[12])
-#define command_character (_CUR_TERM.strs[13])
-#define cursor_address (_CUR_TERM.strs[14])
-#define cursor_down (_CUR_TERM.strs[15])
-#define cursor_home (_CUR_TERM.strs[16])
-#define cursor_invisible (_CUR_TERM.strs[17])
-#define cursor_left (_CUR_TERM.strs[18])
-#define cursor_mem_address (_CUR_TERM.strs[19])
-#define cursor_normal (_CUR_TERM.strs[20])
-#define cursor_right (_CUR_TERM.strs[21])
-#define cursor_to_ll (_CUR_TERM.strs[22])
-#define cursor_up (_CUR_TERM.strs[23])
-#define cursor_visible (_CUR_TERM.strs[24])
-#define delete_character (_CUR_TERM.strs[25])
-#define delete_line (_CUR_TERM.strs[26])
-#define dis_status_line (_CUR_TERM.strs[27])
-#define down_half_line (_CUR_TERM.strs[28])
-#define ena_acs (_CUR_TERM.strs[29])
-#define enter_alt_charset_mode (_CUR_TERM.strs[30])
-#define enter_am_mode (_CUR_TERM.strs[31])
-#define enter_blink_mode (_CUR_TERM.strs[32])
-#define enter_bold_mode (_CUR_TERM.strs[33])
-#define enter_ca_mode (_CUR_TERM.strs[34])
-#define enter_delete_mode (_CUR_TERM.strs[35])
-#define enter_dim_mode (_CUR_TERM.strs[36])
-#define enter_insert_mode (_CUR_TERM.strs[37])
-#define enter_protected_mode (_CUR_TERM.strs[38])
-#define enter_reverse_mode (_CUR_TERM.strs[39])
-#define enter_secure_mode (_CUR_TERM.strs[40])
-#define enter_standout_mode (_CUR_TERM.strs[41])
-#define enter_underline_mode (_CUR_TERM.strs[42])
-#define enter_xon_mode (_CUR_TERM.strs[43])
-#define erase_chars (_CUR_TERM.strs[44])
-#define exit_alt_charset_mode (_CUR_TERM.strs[45])
-#define exit_am_mode (_CUR_TERM.strs[46])
-#define exit_attribute_mode (_CUR_TERM.strs[47])
-#define exit_ca_mode (_CUR_TERM.strs[48])
-#define exit_delete_mode (_CUR_TERM.strs[49])
-#define exit_insert_mode (_CUR_TERM.strs[50])
-#define exit_standout_mode (_CUR_TERM.strs[51])
-#define exit_underline_mode (_CUR_TERM.strs[52])
-#define exit_xon_mode (_CUR_TERM.strs[53])
-#define flash_screen (_CUR_TERM.strs[54])
-#define form_feed (_CUR_TERM.strs[55])
-#define from_status_line (_CUR_TERM.strs[56])
-#define init_1string (_CUR_TERM.strs[57])
-#define init_2string (_CUR_TERM.strs[58])
-#define init_3string (_CUR_TERM.strs[59])
-#define init_file (_CUR_TERM.strs[60])
-#define init_prog (_CUR_TERM.strs[61])
-#define insert_character (_CUR_TERM.strs[62])
-#define insert_line (_CUR_TERM.strs[63])
-#define insert_padding (_CUR_TERM.strs[64])
-#define key_a1 (_CUR_TERM.strs[65])
-#define key_a3 (_CUR_TERM.strs[66])
-#define key_b2 (_CUR_TERM.strs[67])
-#define key_backspace (_CUR_TERM.strs[68])
-#define key_beg (_CUR_TERM.strs[69])
-#define key_btab (_CUR_TERM.strs[70])
-#define key_c1 (_CUR_TERM.strs[71])
-#define key_c3 (_CUR_TERM.strs[72])
-#define key_cancel (_CUR_TERM.strs[73])
-#define key_catab (_CUR_TERM.strs[74])
-#define key_clear (_CUR_TERM.strs[75])
-#define key_close (_CUR_TERM.strs[76])
-#define key_command (_CUR_TERM.strs[77])
-#define key_copy (_CUR_TERM.strs[78])
-#define key_create (_CUR_TERM.strs[79])
-#define key_ctab (_CUR_TERM.strs[80])
-#define key_dc (_CUR_TERM.strs[81])
-#define key_dl (_CUR_TERM.strs[82])
-#define key_down (_CUR_TERM.strs[83])
-#define key_eic (_CUR_TERM.strs[84])
-#define key_end (_CUR_TERM.strs[85])
-#define key_enter (_CUR_TERM.strs[86])
-#define key_eol (_CUR_TERM.strs[87])
-#define key_eos (_CUR_TERM.strs[88])
-#define key_exit (_CUR_TERM.strs[89])
-#define key_f0 (_CUR_TERM.strs[90])
-#define key_f1 (_CUR_TERM.strs[91])
-#define key_f10 (_CUR_TERM.strs[92])
-#define key_f11 (_CUR_TERM.strs[93])
-#define key_f12 (_CUR_TERM.strs[94])
-#define key_f13 (_CUR_TERM.strs[95])
-#define key_f14 (_CUR_TERM.strs[96])
-#define key_f15 (_CUR_TERM.strs[97])
-#define key_f16 (_CUR_TERM.strs[98])
-#define key_f17 (_CUR_TERM.strs[99])
-#define key_f18 (_CUR_TERM.strs[100])
-#define key_f19 (_CUR_TERM.strs[101])
-#define key_f2 (_CUR_TERM.strs[102])
-#define key_f20 (_CUR_TERM.strs[103])
-#define key_f21 (_CUR_TERM.strs[104])
-#define key_f22 (_CUR_TERM.strs[105])
-#define key_f23 (_CUR_TERM.strs[106])
-#define key_f24 (_CUR_TERM.strs[107])
-#define key_f25 (_CUR_TERM.strs[108])
-#define key_f26 (_CUR_TERM.strs[109])
-#define key_f27 (_CUR_TERM.strs[110])
-#define key_f28 (_CUR_TERM.strs[111])
-#define key_f29 (_CUR_TERM.strs[112])
-#define key_f3 (_CUR_TERM.strs[113])
-#define key_f30 (_CUR_TERM.strs[114])
-#define key_f31 (_CUR_TERM.strs[115])
-#define key_f32 (_CUR_TERM.strs[116])
-#define key_f33 (_CUR_TERM.strs[117])
-#define key_f34 (_CUR_TERM.strs[118])
-#define key_f35 (_CUR_TERM.strs[119])
-#define key_f36 (_CUR_TERM.strs[120])
-#define key_f37 (_CUR_TERM.strs[121])
-#define key_f38 (_CUR_TERM.strs[122])
-#define key_f39 (_CUR_TERM.strs[123])
-#define key_f4 (_CUR_TERM.strs[124])
-#define key_f40 (_CUR_TERM.strs[125])
-#define key_f41 (_CUR_TERM.strs[126])
-#define key_f42 (_CUR_TERM.strs[127])
-#define key_f43 (_CUR_TERM.strs[128])
-#define key_f44 (_CUR_TERM.strs[129])
-#define key_f45 (_CUR_TERM.strs[130])
-#define key_f46 (_CUR_TERM.strs[131])
-#define key_f47 (_CUR_TERM.strs[132])
-#define key_f48 (_CUR_TERM.strs[133])
-#define key_f49 (_CUR_TERM.strs[134])
-#define key_f5 (_CUR_TERM.strs[135])
-#define key_f50 (_CUR_TERM.strs[136])
-#define key_f51 (_CUR_TERM.strs[137])
-#define key_f52 (_CUR_TERM.strs[138])
-#define key_f53 (_CUR_TERM.strs[139])
-#define key_f54 (_CUR_TERM.strs[140])
-#define key_f55 (_CUR_TERM.strs[141])
-#define key_f56 (_CUR_TERM.strs[142])
-#define key_f57 (_CUR_TERM.strs[143])
-#define key_f58 (_CUR_TERM.strs[144])
-#define key_f59 (_CUR_TERM.strs[145])
-#define key_f6 (_CUR_TERM.strs[146])
-#define key_f60 (_CUR_TERM.strs[147])
-#define key_f61 (_CUR_TERM.strs[148])
-#define key_f62 (_CUR_TERM.strs[149])
-#define key_f63 (_CUR_TERM.strs[150])
-#define key_f7 (_CUR_TERM.strs[151])
-#define key_f8 (_CUR_TERM.strs[152])
-#define key_f9 (_CUR_TERM.strs[153])
-#define key_find (_CUR_TERM.strs[154])
-#define key_help (_CUR_TERM.strs[155])
-#define key_home (_CUR_TERM.strs[156])
-#define key_ic (_CUR_TERM.strs[157])
-#define key_il (_CUR_TERM.strs[158])
-#define key_left (_CUR_TERM.strs[159])
-#define key_ll (_CUR_TERM.strs[160])
-#define key_mark (_CUR_TERM.strs[161])
-#define key_message (_CUR_TERM.strs[162])
-#define key_move (_CUR_TERM.strs[163])
-#define key_next (_CUR_TERM.strs[164])
-#define key_npage (_CUR_TERM.strs[165])
-#define key_open (_CUR_TERM.strs[166])
-#define key_options (_CUR_TERM.strs[167])
-#define key_ppage (_CUR_TERM.strs[168])
-#define key_previous (_CUR_TERM.strs[169])
-#define key_print (_CUR_TERM.strs[170])
-#define key_redo (_CUR_TERM.strs[171])
-#define key_reference (_CUR_TERM.strs[172])
-#define key_refresh (_CUR_TERM.strs[173])
-#define key_replace (_CUR_TERM.strs[174])
-#define key_restart (_CUR_TERM.strs[175])
-#define key_resume (_CUR_TERM.strs[176])
-#define key_right (_CUR_TERM.strs[177])
-#define key_save (_CUR_TERM.strs[178])
-#define key_sbeg (_CUR_TERM.strs[179])
-#define key_scancel (_CUR_TERM.strs[180])
-#define key_scommand (_CUR_TERM.strs[181])
-#define key_scopy (_CUR_TERM.strs[182])
-#define key_screate (_CUR_TERM.strs[183])
-#define key_sdc (_CUR_TERM.strs[184])
-#define key_sdl (_CUR_TERM.strs[185])
-#define key_select (_CUR_TERM.strs[186])
-#define key_send (_CUR_TERM.strs[187])
-#define key_seol (_CUR_TERM.strs[188])
-#define key_sexit (_CUR_TERM.strs[189])
-#define key_sf (_CUR_TERM.strs[190])
-#define key_sfind (_CUR_TERM.strs[191])
-#define key_shelp (_CUR_TERM.strs[192])
-#define key_shome (_CUR_TERM.strs[193])
-#define key_sic (_CUR_TERM.strs[194])
-#define key_sleft (_CUR_TERM.strs[195])
-#define key_smessage (_CUR_TERM.strs[196])
-#define key_smove (_CUR_TERM.strs[197])
-#define key_snext (_CUR_TERM.strs[198])
-#define key_soptions (_CUR_TERM.strs[199])
-#define key_sprevious (_CUR_TERM.strs[200])
-#define key_sprint (_CUR_TERM.strs[201])
-#define key_sr (_CUR_TERM.strs[202])
-#define key_sredo (_CUR_TERM.strs[203])
-#define key_sreplace (_CUR_TERM.strs[204])
-#define key_sright (_CUR_TERM.strs[205])
-#define key_srsume (_CUR_TERM.strs[206])
-#define key_ssave (_CUR_TERM.strs[207])
-#define key_ssuspend (_CUR_TERM.strs[208])
-#define key_stab (_CUR_TERM.strs[209])
-#define key_sundo (_CUR_TERM.strs[210])
-#define key_suspend (_CUR_TERM.strs[211])
-#define key_undo (_CUR_TERM.strs[212])
-#define key_up (_CUR_TERM.strs[213])
-#define keypad_local (_CUR_TERM.strs[214])
-#define keypad_xmit (_CUR_TERM.strs[215])
-#define lab_f0 (_CUR_TERM.strs[216])
-#define lab_f1 (_CUR_TERM.strs[217])
-#define lab_f10 (_CUR_TERM.strs[218])
-#define lab_f2 (_CUR_TERM.strs[219])
-#define lab_f3 (_CUR_TERM.strs[220])
-#define lab_f4 (_CUR_TERM.strs[221])
-#define lab_f5 (_CUR_TERM.strs[222])
-#define lab_f6 (_CUR_TERM.strs[223])
-#define lab_f7 (_CUR_TERM.strs[224])
-#define lab_f8 (_CUR_TERM.strs[225])
-#define lab_f9 (_CUR_TERM.strs[226])
-#define label_off (_CUR_TERM.strs[227])
-#define label_on (_CUR_TERM.strs[228])
-#define meta_off (_CUR_TERM.strs[229])
-#define meta_on (_CUR_TERM.strs[230])
-#define newline (_CUR_TERM.strs[231])
-#define pad_char (_CUR_TERM.strs[232])
-#define parm_dch (_CUR_TERM.strs[233])
-#define parm_delete_line (_CUR_TERM.strs[234])
-#define parm_down_cursor (_CUR_TERM.strs[235])
-#define parm_ich (_CUR_TERM.strs[236])
-#define parm_index (_CUR_TERM.strs[237])
-#define parm_insert_line (_CUR_TERM.strs[238])
-#define parm_left_cursor (_CUR_TERM.strs[239])
-#define parm_right_cursor (_CUR_TERM.strs[240])
-#define parm_rindex (_CUR_TERM.strs[241])
-#define parm_up_cursor (_CUR_TERM.strs[242])
-#define pkey_key (_CUR_TERM.strs[243])
-#define pkey_local (_CUR_TERM.strs[244])
-#define pkey_xmit (_CUR_TERM.strs[245])
-#define plab_norm (_CUR_TERM.strs[246])
-#define print_screen (_CUR_TERM.strs[247])
-#define prtr_non (_CUR_TERM.strs[248])
-#define prtr_off (_CUR_TERM.strs[249])
-#define prtr_on (_CUR_TERM.strs[250])
-#define repeat_char (_CUR_TERM.strs[251])
-#define req_for_input (_CUR_TERM.strs[252])
-#define reset_1string (_CUR_TERM.strs[253])
-#define reset_2string (_CUR_TERM.strs[254])
-#define reset_3string (_CUR_TERM.strs[255])
-#define reset_file (_CUR_TERM.strs[256])
-#define restore_cursor (_CUR_TERM.strs[257])
-#define row_address (_CUR_TERM.strs[258])
-#define save_cursor (_CUR_TERM.strs[259])
-#define scroll_forward (_CUR_TERM.strs[260])
-#define scroll_reverse (_CUR_TERM.strs[261])
-#define set_attributes (_CUR_TERM.strs[262])
-#define set_left_margin (_CUR_TERM.strs[263])
-#define set_right_margin (_CUR_TERM.strs[264])
-#define set_tab (_CUR_TERM.strs[265])
-#define set_window (_CUR_TERM.strs[266])
-#define tab (_CUR_TERM.strs[267])
-#define to_status_line (_CUR_TERM.strs[268])
-#define underline_char (_CUR_TERM.strs[269])
-#define up_half_line (_CUR_TERM.strs[270])
-#define xoff_character (_CUR_TERM.strs[271])
-#define xon_character (_CUR_TERM.strs[272])
-#define alt_scancode_esc (_CUR_TERM.strs[273])
-#define bit_image_carriage_return (_CUR_TERM.strs[274])
-#define bit_image_newline (_CUR_TERM.strs[275])
-#define bit_image_repeat (_CUR_TERM.strs[276])
-#define change_char_pitch (_CUR_TERM.strs[277])
-#define change_line_pitch (_CUR_TERM.strs[278])
-#define change_res_horz (_CUR_TERM.strs[279])
-#define change_res_vert (_CUR_TERM.strs[280])
-#define char_set_names (_CUR_TERM.strs[281])
-#define code_set_init (_CUR_TERM.strs[282])
-#define color_names (_CUR_TERM.strs[283])
-#define create_window (_CUR_TERM.strs[284])
-#define define_bit_image_region (_CUR_TERM.strs[285])
-#define define_char (_CUR_TERM.strs[286])
-#define device_type (_CUR_TERM.strs[287])
-#define dial_phone (_CUR_TERM.strs[288])
-#define display_clock (_CUR_TERM.strs[289])
-#define display_pc_char (_CUR_TERM.strs[290])
-#define end_bit_image_region (_CUR_TERM.strs[291])
-#define enter_doublewide_mode (_CUR_TERM.strs[292])
-#define enter_draft_quality (_CUR_TERM.strs[293])
-#define enter_italics_mode (_CUR_TERM.strs[294])
-#define enter_leftward_mode (_CUR_TERM.strs[295])
-#define enter_micro_mode (_CUR_TERM.strs[296])
-#define enter_near_letter_quality (_CUR_TERM.strs[297])
-#define enter_normal_quality (_CUR_TERM.strs[298])
-#define enter_pc_charset_mode (_CUR_TERM.strs[299])
-#define enter_scancode_mode (_CUR_TERM.strs[300])
-#define enter_shadow_mode (_CUR_TERM.strs[301])
-#define enter_subscript_mode (_CUR_TERM.strs[302])
-#define enter_superscript_mode (_CUR_TERM.strs[303])
-#define enter_upward_mode (_CUR_TERM.strs[304])
-#define exit_doublewide_mode (_CUR_TERM.strs[305])
-#define exit_italics_mode (_CUR_TERM.strs[306])
-#define exit_leftward_mode (_CUR_TERM.strs[307])
-#define exit_micro_mode (_CUR_TERM.strs[308])
-#define exit_pc_charset_mode (_CUR_TERM.strs[309])
-#define exit_scancode_mode (_CUR_TERM.strs[310])
-#define exit_shadow_mode (_CUR_TERM.strs[311])
-#define exit_subscript_mode (_CUR_TERM.strs[312])
-#define exit_superscript_mode (_CUR_TERM.strs[313])
-#define exit_upward_mode (_CUR_TERM.strs[314])
-#define fixed_pause (_CUR_TERM.strs[315])
-#define flash_hook (_CUR_TERM.strs[316])
-#define get_mouse (_CUR_TERM.strs[317])
-#define goto_window (_CUR_TERM.strs[318])
-#define hangup (_CUR_TERM.strs[319])
-#define initialize_color (_CUR_TERM.strs[320])
-#define initialize_pair (_CUR_TERM.strs[321])
-#define key_mouse (_CUR_TERM.strs[322])
-#define label_format (_CUR_TERM.strs[323])
-#define micro_column_address (_CUR_TERM.strs[324])
-#define micro_down (_CUR_TERM.strs[325])
-#define micro_left (_CUR_TERM.strs[326])
-#define micro_right (_CUR_TERM.strs[327])
-#define micro_row_address (_CUR_TERM.strs[328])
-#define micro_up (_CUR_TERM.strs[329])
-#define mouse_info (_CUR_TERM.strs[330])
-#define order_of_pins (_CUR_TERM.strs[331])
-#define orig_colors (_CUR_TERM.strs[332])
-#define orig_pair (_CUR_TERM.strs[333])
-#define parm_down_micro (_CUR_TERM.strs[334])
-#define parm_left_micro (_CUR_TERM.strs[335])
-#define parm_right_micro (_CUR_TERM.strs[336])
-#define parm_up_micro (_CUR_TERM.strs[337])
-#define pc_term_options (_CUR_TERM.strs[338])
-#define pkey_plab (_CUR_TERM.strs[339])
-#define pulse (_CUR_TERM.strs[340])
-#define quick_dial (_CUR_TERM.strs[341])
-#define remove_clock (_CUR_TERM.strs[342])
-#define req_mouse_pos (_CUR_TERM.strs[343])
-#define scancode_escape (_CUR_TERM.strs[344])
-#define select_char_set (_CUR_TERM.strs[345])
-#define set0_des_seq (_CUR_TERM.strs[346])
-#define set1_des_seq (_CUR_TERM.strs[347])
-#define set2_des_seq (_CUR_TERM.strs[348])
-#define set3_des_seq (_CUR_TERM.strs[349])
-#define set_a_background (_CUR_TERM.strs[350])
-#define set_a_foreground (_CUR_TERM.strs[351])
-#define set_background (_CUR_TERM.strs[352])
-#define set_bottom_margin (_CUR_TERM.strs[353])
-#define set_bottom_margin_parm (_CUR_TERM.strs[354])
-#define set_clock (_CUR_TERM.strs[355])
-#define set_color_band (_CUR_TERM.strs[356])
-#define set_color_pair (_CUR_TERM.strs[357])
-#define set_foreground (_CUR_TERM.strs[358])
-#define set_left_margin_parm (_CUR_TERM.strs[359])
-#define set_lr_margin (_CUR_TERM.strs[360])
-#define set_page_length (_CUR_TERM.strs[361])
-#define set_right_margin_parm (_CUR_TERM.strs[362])
-#define set_tb_margin (_CUR_TERM.strs[363])
-#define set_top_margin (_CUR_TERM.strs[364])
-#define set_top_margin_parm (_CUR_TERM.strs[365])
-#define start_bit_image (_CUR_TERM.strs[366])
-#define start_char_set_def (_CUR_TERM.strs[367])
-#define stop_bit_image (_CUR_TERM.strs[368])
-#define stop_char_set_def (_CUR_TERM.strs[369])
-#define subscript_characters (_CUR_TERM.strs[370])
-#define superscript_characters (_CUR_TERM.strs[371])
-#define these_cause_cr (_CUR_TERM.strs[372])
-#define tone (_CUR_TERM.strs[373])
-#define user0 (_CUR_TERM.strs[374])
-#define user1 (_CUR_TERM.strs[375])
-#define user2 (_CUR_TERM.strs[376])
-#define user3 (_CUR_TERM.strs[377])
-#define user4 (_CUR_TERM.strs[378])
-#define user5 (_CUR_TERM.strs[379])
-#define user6 (_CUR_TERM.strs[380])
-#define user7 (_CUR_TERM.strs[381])
-#define user8 (_CUR_TERM.strs[382])
-#define user9 (_CUR_TERM.strs[383])
-#define wait_tone (_CUR_TERM.strs[384])
-#define zero_motion (_CUR_TERM.strs[385])
-#define backspace_if_not_bs (_CUR_TERM.strs[386])
-#define other_non_function_keys (_CUR_TERM.strs[387])
-#define arrow_key_map (_CUR_TERM.strs[388])
-#define memory_lock_above (_CUR_TERM.strs[389])
-#define memory_unlock (_CUR_TERM.strs[390])
-#define linefeed_if_not_lf (_CUR_TERM.strs[391])
-#define key_interrupt_char (_CUR_TERM.strs[392])
-#define key_kill_char (_CUR_TERM.strs[393])
-#define key_suspend_char (_CUR_TERM.strs[394])
-#define scroll_left (_CUR_TERM.strs[395])
-#define scroll_right (_CUR_TERM.strs[396])
-#define parm_scroll_left (_CUR_TERM.strs[397])
-#define parm_scroll_right (_CUR_TERM.strs[398])
-#define _get_other (_CUR_TERM.strs[399])
-
-#define NUM_OF_BOOLS 53
-#define NUM_OF_NUMS 42
-#define NUM_OF_STRS 400
-
-#ifndef OVERRIDE
-#undef _USE_SGTTY
-#undef _USE_TERMIO
-#undef _USE_TERMIOS
-#define _USE_TERMIOS
-#undef _USE_SMALLMEM
-#undef _USE_PROTOTYPES
-#define _USE_PROTOTYPES
-#undef _USE_WINSZ
-#define _USE_WINSZ
-#undef _USE_TERMINFO
-#undef _USE_TERMCAP
-#define _USE_TERMCAP
-#undef _MAX_CHUNK
-#define _MAX_CHUNK 640
-#endif /* OVERRIDE */
-
-/*
- * 92/02/01 07:30:28
- * @(#) mytinfo term.tail 3.2 92/02/01 public domain, By Ross Ridge
- *
- */
-
-#if defined(_USE_TERMIO) || defined(_USE_TERMIOS)
-#ifndef ICANON
-#ifdef _USE_TERMIO
-#include <termio.h>
-#else
-#include <termios.h>
-#endif
-#endif
-#if defined(_USE_WINSZ) && defined(__FreeBSD__)
-#include <sys/ioctl.h>
-#endif
-#if defined(_USE_WINSZ) && defined(xenix)
-#include <sys/stream.h>
-#include <sys/ptem.h>
-#endif
-#endif
-
-#ifdef _USE_SGTTY
-#ifndef CBREAK
-#include <sgtty.h>
-#endif
-#endif
-
-typedef struct _terminal {
- int fd;
-#ifdef _USE_SMALLMEM
-#ifdef _USE_TERMIOS
- speed_t baudrate;
-#else
- unsigned short baudrate;
-#endif
- unsigned pad:1, xon:1, termcap:1;
-#else
- int pad;
- int xon;
- int termcap;
-#ifdef _USE_TERMIOS
- speed_t baudrate;
-#else
- long baudrate;
-#endif
-#endif
- char padch;
- short true_lines, true_columns;
- struct strbuf {
- struct strbuf *next;
-#ifdef _USE_SMALLMEM
- short len;
-#else
- int len;
-#endif
- char buf[_MAX_CHUNK];
- } *strbuf;
- char *name, *name_long, *name_all;
-#ifdef _USE_SGTTY
- struct sgtty_str {
- struct sgttyb v6;
-#ifdef TIOCGETC
- struct tchars v7;
-#endif
-#ifdef TIOCLGET
- int bsd;
-#endif
-#ifdef TIOCGLTC
- struct ltchars bsd_new;
-#endif
- } prog_mode, shell_mode;
-#else /* _USE_SGTTY */
-#ifdef _USE_TERMIOS
- struct termios prog_mode, shell_mode;
-#else
-#ifdef _USE_TERMIO
- struct termio prog_mode, shell_mode;
-#endif
-#endif
-#endif /* else _USE_SGTTY */
-#ifdef _USE_WINSZ
-#ifdef TIOCGWINSZ
- struct winsize prog_winsz, shell_winsz;
-#endif
-#endif
- char bools[NUM_OF_BOOLS];
- short nums[NUM_OF_NUMS];
- char *strs[NUM_OF_STRS];
-} TERMINAL;
-
-#ifndef _CUR_TERM
-#ifdef SINGLE
-#define _CUR_TERM _term_buf
-#else
-#define _CUR_TERM (*cur_term)
-#endif
-#endif
-
-extern TERMINAL *cur_term;
-extern TERMINAL _term_buf;
-
-#ifndef __P
-#if defined(_USE_PROTOTYPES) && (defined(__STDC__) || defined(__cplusplus))
-#define __P(protos) protos /* full-blown ANSI C */
-#else
-#define __P(protos) () /* traditional C preprocessor */
-#endif
-#endif
-
-extern char *tparm __P((const char *, ...));
-extern int setupterm __P((char *, int, int *)), set_curterm __P((TERMINAL *));
-extern int del_curterm __P((TERMINAL *)), tputs __P((const char *, int, int (*)(int)));
-extern int putp __P((char *));
-extern int tigetflag __P((char *)), tigetnum __P((char *));
-extern char *tigetstr __P((char *));
-extern int def_prog_mode __P((void)), def_shell_mode __P((void));
-extern int reset_prog_mode __P((void)), reset_shell_mode __P((void));
-
-extern char *boolnames[], *boolcodes[], *boolfnames[];
-extern char *numnames[], *numcodes[], *numfnames[];
-extern char *strnames[], *strcodes[], *strfnames[];
-
-#ifndef OK
-#undef ERR
-#define OK (0)
-#define ERR (-1)
-#endif
-
-/* Compatibility */
-#define Filedes fd
-#define Ottyb shell_mode
-#define Nttyb prog_mode
-#define TTY struct termios
-
-#endif /* _TERM_H_ */
diff --git a/lib/libmytinfo/term.head b/lib/libmytinfo/term.head
deleted file mode 100644
index 4001038..0000000
--- a/lib/libmytinfo/term.head
+++ /dev/null
@@ -1,527 +0,0 @@
-/*
- * term.h
- *
- * This file was generated automatically.
- *
- */
-
-#ifndef _TERM_H_
-#define _TERM_H_
-
-#define auto_left_margin (_CUR_TERM.bools[0])
-#define auto_right_margin (_CUR_TERM.bools[1])
-#define ceol_standout_glitch (_CUR_TERM.bools[2])
-#define dest_tabs_magic_smso (_CUR_TERM.bools[3])
-#define eat_newline_glitch (_CUR_TERM.bools[4])
-#define erase_overstrike (_CUR_TERM.bools[5])
-#define generic_type (_CUR_TERM.bools[6])
-#define hard_copy (_CUR_TERM.bools[7])
-#define hard_cursor (_CUR_TERM.bools[8])
-#define has_meta_key (_CUR_TERM.bools[9])
-#define has_status_line (_CUR_TERM.bools[10])
-#define insert_null_glitch (_CUR_TERM.bools[11])
-#define memory_above (_CUR_TERM.bools[12])
-#define memory_below (_CUR_TERM.bools[13])
-#define move_insert_mode (_CUR_TERM.bools[14])
-#define move_standout_mode (_CUR_TERM.bools[15])
-#define needs_xon_xoff (_CUR_TERM.bools[16])
-#define no_esc_ctlc (_CUR_TERM.bools[17])
-#define no_pad_char (_CUR_TERM.bools[18])
-#define non_rev_rmcup (_CUR_TERM.bools[19])
-#define over_strike (_CUR_TERM.bools[20])
-#define prtr_silent (_CUR_TERM.bools[21])
-#define status_line_esc_ok (_CUR_TERM.bools[22])
-#define tilde_glitch (_CUR_TERM.bools[23])
-#define transparent_underline (_CUR_TERM.bools[24])
-#define xon_xoff (_CUR_TERM.bools[25])
-#define back_color_erase (_CUR_TERM.bools[26])
-#define can_change (_CUR_TERM.bools[27])
-#define col_addr_glitch (_CUR_TERM.bools[28])
-#define cpi_changes_res (_CUR_TERM.bools[29])
-#define cr_cancels_micro_mode (_CUR_TERM.bools[30])
-#define has_print_wheel (_CUR_TERM.bools[31])
-#define hue_lightness_saturation (_CUR_TERM.bools[32])
-#define lpi_changes_res (_CUR_TERM.bools[33])
-#define non_dest_scroll_region (_CUR_TERM.bools[34])
-#define row_addr_glitch (_CUR_TERM.bools[35])
-#define semi_auto_right_margin (_CUR_TERM.bools[36])
-#define backspaces_with_bs (_CUR_TERM.bools[37])
-#define even_parity (_CUR_TERM.bools[38])
-#define half_duplex (_CUR_TERM.bools[39])
-#define lower_case_only (_CUR_TERM.bools[40])
-#define no_correctly_working_cr (_CUR_TERM.bools[41])
-#define linefeed_is_newline (_CUR_TERM.bools[42])
-#define crt_without_scrolling (_CUR_TERM.bools[43])
-#define odd_parity (_CUR_TERM.bools[44])
-#define has_hardware_tabs (_CUR_TERM.bools[45])
-#define uppercase_only (_CUR_TERM.bools[46])
-#define return_does_clr_eol (_CUR_TERM.bools[47])
-#define tek_4025_insert_line (_CUR_TERM.bools[48])
-#define initialization_messy (_CUR_TERM.bools[49])
-#define index_at_bottom_does_cr (_CUR_TERM.bools[50])
-#define rind_only_at_top (_CUR_TERM.bools[51])
-#define GNU_has_meta_key (_CUR_TERM.bools[52])
-#define columns (_CUR_TERM.nums[0])
-#define init_tabs (_CUR_TERM.nums[1])
-#define label_height (_CUR_TERM.nums[2])
-#define label_width (_CUR_TERM.nums[3])
-#define lines (_CUR_TERM.nums[4])
-#define lines_of_memory (_CUR_TERM.nums[5])
-#define magic_cookie_glitch (_CUR_TERM.nums[6])
-#define num_labels (_CUR_TERM.nums[7])
-#define padding_baud_rate (_CUR_TERM.nums[8])
-#define virtual_terminal (_CUR_TERM.nums[9])
-#define width_status_line (_CUR_TERM.nums[10])
-#define bit_image_entwining (_CUR_TERM.nums[11])
-#define bit_image_type (_CUR_TERM.nums[12])
-#define buffer_capacity (_CUR_TERM.nums[13])
-#define buttons (_CUR_TERM.nums[14])
-#define dot_horz_spacing (_CUR_TERM.nums[15])
-#define dot_vert_spacing (_CUR_TERM.nums[16])
-#define max_attributes (_CUR_TERM.nums[17])
-#define max_colors (_CUR_TERM.nums[18])
-#define max_micro_address (_CUR_TERM.nums[19])
-#define max_micro_jump (_CUR_TERM.nums[20])
-#define max_pairs (_CUR_TERM.nums[21])
-#define maximum_windows (_CUR_TERM.nums[22])
-#define micro_char_size (_CUR_TERM.nums[23])
-#define micro_line_size (_CUR_TERM.nums[24])
-#define no_color_video (_CUR_TERM.nums[25])
-#define number_of_pins (_CUR_TERM.nums[26])
-#define output_res_char (_CUR_TERM.nums[27])
-#define output_res_horz_inch (_CUR_TERM.nums[28])
-#define output_res_line (_CUR_TERM.nums[29])
-#define output_res_vert_inch (_CUR_TERM.nums[30])
-#define print_rate (_CUR_TERM.nums[31])
-#define wide_char_size (_CUR_TERM.nums[32])
-#define backspace_delay (_CUR_TERM.nums[33])
-#define carriage_return_delay (_CUR_TERM.nums[34])
-#define form_feed_delay (_CUR_TERM.nums[35])
-#define new_line_delay (_CUR_TERM.nums[36])
-#define horizontal_tab_delay (_CUR_TERM.nums[37])
-#define vertical_tab_delay (_CUR_TERM.nums[38])
-#define number_of_function_keys (_CUR_TERM.nums[39])
-#define magic_cookie_glitch_ul (_CUR_TERM.nums[40])
-#define GNU_tab_width (_CUR_TERM.nums[41])
-#define acs_chars (_CUR_TERM.strs[0])
-#define back_tab (_CUR_TERM.strs[1])
-#define bell (_CUR_TERM.strs[2])
-#define carriage_return (_CUR_TERM.strs[3])
-#define change_scroll_region (_CUR_TERM.strs[4])
-#define char_padding (_CUR_TERM.strs[5])
-#define clear_all_tabs (_CUR_TERM.strs[6])
-#define clear_margins (_CUR_TERM.strs[7])
-#define clear_screen (_CUR_TERM.strs[8])
-#define clr_bol (_CUR_TERM.strs[9])
-#define clr_eol (_CUR_TERM.strs[10])
-#define clr_eos (_CUR_TERM.strs[11])
-#define column_address (_CUR_TERM.strs[12])
-#define command_character (_CUR_TERM.strs[13])
-#define cursor_address (_CUR_TERM.strs[14])
-#define cursor_down (_CUR_TERM.strs[15])
-#define cursor_home (_CUR_TERM.strs[16])
-#define cursor_invisible (_CUR_TERM.strs[17])
-#define cursor_left (_CUR_TERM.strs[18])
-#define cursor_mem_address (_CUR_TERM.strs[19])
-#define cursor_normal (_CUR_TERM.strs[20])
-#define cursor_right (_CUR_TERM.strs[21])
-#define cursor_to_ll (_CUR_TERM.strs[22])
-#define cursor_up (_CUR_TERM.strs[23])
-#define cursor_visible (_CUR_TERM.strs[24])
-#define delete_character (_CUR_TERM.strs[25])
-#define delete_line (_CUR_TERM.strs[26])
-#define dis_status_line (_CUR_TERM.strs[27])
-#define down_half_line (_CUR_TERM.strs[28])
-#define ena_acs (_CUR_TERM.strs[29])
-#define enter_alt_charset_mode (_CUR_TERM.strs[30])
-#define enter_am_mode (_CUR_TERM.strs[31])
-#define enter_blink_mode (_CUR_TERM.strs[32])
-#define enter_bold_mode (_CUR_TERM.strs[33])
-#define enter_ca_mode (_CUR_TERM.strs[34])
-#define enter_delete_mode (_CUR_TERM.strs[35])
-#define enter_dim_mode (_CUR_TERM.strs[36])
-#define enter_insert_mode (_CUR_TERM.strs[37])
-#define enter_protected_mode (_CUR_TERM.strs[38])
-#define enter_reverse_mode (_CUR_TERM.strs[39])
-#define enter_secure_mode (_CUR_TERM.strs[40])
-#define enter_standout_mode (_CUR_TERM.strs[41])
-#define enter_underline_mode (_CUR_TERM.strs[42])
-#define enter_xon_mode (_CUR_TERM.strs[43])
-#define erase_chars (_CUR_TERM.strs[44])
-#define exit_alt_charset_mode (_CUR_TERM.strs[45])
-#define exit_am_mode (_CUR_TERM.strs[46])
-#define exit_attribute_mode (_CUR_TERM.strs[47])
-#define exit_ca_mode (_CUR_TERM.strs[48])
-#define exit_delete_mode (_CUR_TERM.strs[49])
-#define exit_insert_mode (_CUR_TERM.strs[50])
-#define exit_standout_mode (_CUR_TERM.strs[51])
-#define exit_underline_mode (_CUR_TERM.strs[52])
-#define exit_xon_mode (_CUR_TERM.strs[53])
-#define flash_screen (_CUR_TERM.strs[54])
-#define form_feed (_CUR_TERM.strs[55])
-#define from_status_line (_CUR_TERM.strs[56])
-#define init_1string (_CUR_TERM.strs[57])
-#define init_2string (_CUR_TERM.strs[58])
-#define init_3string (_CUR_TERM.strs[59])
-#define init_file (_CUR_TERM.strs[60])
-#define init_prog (_CUR_TERM.strs[61])
-#define insert_character (_CUR_TERM.strs[62])
-#define insert_line (_CUR_TERM.strs[63])
-#define insert_padding (_CUR_TERM.strs[64])
-#define key_a1 (_CUR_TERM.strs[65])
-#define key_a3 (_CUR_TERM.strs[66])
-#define key_b2 (_CUR_TERM.strs[67])
-#define key_backspace (_CUR_TERM.strs[68])
-#define key_beg (_CUR_TERM.strs[69])
-#define key_btab (_CUR_TERM.strs[70])
-#define key_c1 (_CUR_TERM.strs[71])
-#define key_c3 (_CUR_TERM.strs[72])
-#define key_cancel (_CUR_TERM.strs[73])
-#define key_catab (_CUR_TERM.strs[74])
-#define key_clear (_CUR_TERM.strs[75])
-#define key_close (_CUR_TERM.strs[76])
-#define key_command (_CUR_TERM.strs[77])
-#define key_copy (_CUR_TERM.strs[78])
-#define key_create (_CUR_TERM.strs[79])
-#define key_ctab (_CUR_TERM.strs[80])
-#define key_dc (_CUR_TERM.strs[81])
-#define key_dl (_CUR_TERM.strs[82])
-#define key_down (_CUR_TERM.strs[83])
-#define key_eic (_CUR_TERM.strs[84])
-#define key_end (_CUR_TERM.strs[85])
-#define key_enter (_CUR_TERM.strs[86])
-#define key_eol (_CUR_TERM.strs[87])
-#define key_eos (_CUR_TERM.strs[88])
-#define key_exit (_CUR_TERM.strs[89])
-#define key_f0 (_CUR_TERM.strs[90])
-#define key_f1 (_CUR_TERM.strs[91])
-#define key_f10 (_CUR_TERM.strs[92])
-#define key_f11 (_CUR_TERM.strs[93])
-#define key_f12 (_CUR_TERM.strs[94])
-#define key_f13 (_CUR_TERM.strs[95])
-#define key_f14 (_CUR_TERM.strs[96])
-#define key_f15 (_CUR_TERM.strs[97])
-#define key_f16 (_CUR_TERM.strs[98])
-#define key_f17 (_CUR_TERM.strs[99])
-#define key_f18 (_CUR_TERM.strs[100])
-#define key_f19 (_CUR_TERM.strs[101])
-#define key_f2 (_CUR_TERM.strs[102])
-#define key_f20 (_CUR_TERM.strs[103])
-#define key_f21 (_CUR_TERM.strs[104])
-#define key_f22 (_CUR_TERM.strs[105])
-#define key_f23 (_CUR_TERM.strs[106])
-#define key_f24 (_CUR_TERM.strs[107])
-#define key_f25 (_CUR_TERM.strs[108])
-#define key_f26 (_CUR_TERM.strs[109])
-#define key_f27 (_CUR_TERM.strs[110])
-#define key_f28 (_CUR_TERM.strs[111])
-#define key_f29 (_CUR_TERM.strs[112])
-#define key_f3 (_CUR_TERM.strs[113])
-#define key_f30 (_CUR_TERM.strs[114])
-#define key_f31 (_CUR_TERM.strs[115])
-#define key_f32 (_CUR_TERM.strs[116])
-#define key_f33 (_CUR_TERM.strs[117])
-#define key_f34 (_CUR_TERM.strs[118])
-#define key_f35 (_CUR_TERM.strs[119])
-#define key_f36 (_CUR_TERM.strs[120])
-#define key_f37 (_CUR_TERM.strs[121])
-#define key_f38 (_CUR_TERM.strs[122])
-#define key_f39 (_CUR_TERM.strs[123])
-#define key_f4 (_CUR_TERM.strs[124])
-#define key_f40 (_CUR_TERM.strs[125])
-#define key_f41 (_CUR_TERM.strs[126])
-#define key_f42 (_CUR_TERM.strs[127])
-#define key_f43 (_CUR_TERM.strs[128])
-#define key_f44 (_CUR_TERM.strs[129])
-#define key_f45 (_CUR_TERM.strs[130])
-#define key_f46 (_CUR_TERM.strs[131])
-#define key_f47 (_CUR_TERM.strs[132])
-#define key_f48 (_CUR_TERM.strs[133])
-#define key_f49 (_CUR_TERM.strs[134])
-#define key_f5 (_CUR_TERM.strs[135])
-#define key_f50 (_CUR_TERM.strs[136])
-#define key_f51 (_CUR_TERM.strs[137])
-#define key_f52 (_CUR_TERM.strs[138])
-#define key_f53 (_CUR_TERM.strs[139])
-#define key_f54 (_CUR_TERM.strs[140])
-#define key_f55 (_CUR_TERM.strs[141])
-#define key_f56 (_CUR_TERM.strs[142])
-#define key_f57 (_CUR_TERM.strs[143])
-#define key_f58 (_CUR_TERM.strs[144])
-#define key_f59 (_CUR_TERM.strs[145])
-#define key_f6 (_CUR_TERM.strs[146])
-#define key_f60 (_CUR_TERM.strs[147])
-#define key_f61 (_CUR_TERM.strs[148])
-#define key_f62 (_CUR_TERM.strs[149])
-#define key_f63 (_CUR_TERM.strs[150])
-#define key_f7 (_CUR_TERM.strs[151])
-#define key_f8 (_CUR_TERM.strs[152])
-#define key_f9 (_CUR_TERM.strs[153])
-#define key_find (_CUR_TERM.strs[154])
-#define key_help (_CUR_TERM.strs[155])
-#define key_home (_CUR_TERM.strs[156])
-#define key_ic (_CUR_TERM.strs[157])
-#define key_il (_CUR_TERM.strs[158])
-#define key_left (_CUR_TERM.strs[159])
-#define key_ll (_CUR_TERM.strs[160])
-#define key_mark (_CUR_TERM.strs[161])
-#define key_message (_CUR_TERM.strs[162])
-#define key_move (_CUR_TERM.strs[163])
-#define key_next (_CUR_TERM.strs[164])
-#define key_npage (_CUR_TERM.strs[165])
-#define key_open (_CUR_TERM.strs[166])
-#define key_options (_CUR_TERM.strs[167])
-#define key_ppage (_CUR_TERM.strs[168])
-#define key_previous (_CUR_TERM.strs[169])
-#define key_print (_CUR_TERM.strs[170])
-#define key_redo (_CUR_TERM.strs[171])
-#define key_reference (_CUR_TERM.strs[172])
-#define key_refresh (_CUR_TERM.strs[173])
-#define key_replace (_CUR_TERM.strs[174])
-#define key_restart (_CUR_TERM.strs[175])
-#define key_resume (_CUR_TERM.strs[176])
-#define key_right (_CUR_TERM.strs[177])
-#define key_save (_CUR_TERM.strs[178])
-#define key_sbeg (_CUR_TERM.strs[179])
-#define key_scancel (_CUR_TERM.strs[180])
-#define key_scommand (_CUR_TERM.strs[181])
-#define key_scopy (_CUR_TERM.strs[182])
-#define key_screate (_CUR_TERM.strs[183])
-#define key_sdc (_CUR_TERM.strs[184])
-#define key_sdl (_CUR_TERM.strs[185])
-#define key_select (_CUR_TERM.strs[186])
-#define key_send (_CUR_TERM.strs[187])
-#define key_seol (_CUR_TERM.strs[188])
-#define key_sexit (_CUR_TERM.strs[189])
-#define key_sf (_CUR_TERM.strs[190])
-#define key_sfind (_CUR_TERM.strs[191])
-#define key_shelp (_CUR_TERM.strs[192])
-#define key_shome (_CUR_TERM.strs[193])
-#define key_sic (_CUR_TERM.strs[194])
-#define key_sleft (_CUR_TERM.strs[195])
-#define key_smessage (_CUR_TERM.strs[196])
-#define key_smove (_CUR_TERM.strs[197])
-#define key_snext (_CUR_TERM.strs[198])
-#define key_soptions (_CUR_TERM.strs[199])
-#define key_sprevious (_CUR_TERM.strs[200])
-#define key_sprint (_CUR_TERM.strs[201])
-#define key_sr (_CUR_TERM.strs[202])
-#define key_sredo (_CUR_TERM.strs[203])
-#define key_sreplace (_CUR_TERM.strs[204])
-#define key_sright (_CUR_TERM.strs[205])
-#define key_srsume (_CUR_TERM.strs[206])
-#define key_ssave (_CUR_TERM.strs[207])
-#define key_ssuspend (_CUR_TERM.strs[208])
-#define key_stab (_CUR_TERM.strs[209])
-#define key_sundo (_CUR_TERM.strs[210])
-#define key_suspend (_CUR_TERM.strs[211])
-#define key_undo (_CUR_TERM.strs[212])
-#define key_up (_CUR_TERM.strs[213])
-#define keypad_local (_CUR_TERM.strs[214])
-#define keypad_xmit (_CUR_TERM.strs[215])
-#define lab_f0 (_CUR_TERM.strs[216])
-#define lab_f1 (_CUR_TERM.strs[217])
-#define lab_f10 (_CUR_TERM.strs[218])
-#define lab_f2 (_CUR_TERM.strs[219])
-#define lab_f3 (_CUR_TERM.strs[220])
-#define lab_f4 (_CUR_TERM.strs[221])
-#define lab_f5 (_CUR_TERM.strs[222])
-#define lab_f6 (_CUR_TERM.strs[223])
-#define lab_f7 (_CUR_TERM.strs[224])
-#define lab_f8 (_CUR_TERM.strs[225])
-#define lab_f9 (_CUR_TERM.strs[226])
-#define label_off (_CUR_TERM.strs[227])
-#define label_on (_CUR_TERM.strs[228])
-#define meta_off (_CUR_TERM.strs[229])
-#define meta_on (_CUR_TERM.strs[230])
-#define newline (_CUR_TERM.strs[231])
-#define pad_char (_CUR_TERM.strs[232])
-#define parm_dch (_CUR_TERM.strs[233])
-#define parm_delete_line (_CUR_TERM.strs[234])
-#define parm_down_cursor (_CUR_TERM.strs[235])
-#define parm_ich (_CUR_TERM.strs[236])
-#define parm_index (_CUR_TERM.strs[237])
-#define parm_insert_line (_CUR_TERM.strs[238])
-#define parm_left_cursor (_CUR_TERM.strs[239])
-#define parm_right_cursor (_CUR_TERM.strs[240])
-#define parm_rindex (_CUR_TERM.strs[241])
-#define parm_up_cursor (_CUR_TERM.strs[242])
-#define pkey_key (_CUR_TERM.strs[243])
-#define pkey_local (_CUR_TERM.strs[244])
-#define pkey_xmit (_CUR_TERM.strs[245])
-#define plab_norm (_CUR_TERM.strs[246])
-#define print_screen (_CUR_TERM.strs[247])
-#define prtr_non (_CUR_TERM.strs[248])
-#define prtr_off (_CUR_TERM.strs[249])
-#define prtr_on (_CUR_TERM.strs[250])
-#define repeat_char (_CUR_TERM.strs[251])
-#define req_for_input (_CUR_TERM.strs[252])
-#define reset_1string (_CUR_TERM.strs[253])
-#define reset_2string (_CUR_TERM.strs[254])
-#define reset_3string (_CUR_TERM.strs[255])
-#define reset_file (_CUR_TERM.strs[256])
-#define restore_cursor (_CUR_TERM.strs[257])
-#define row_address (_CUR_TERM.strs[258])
-#define save_cursor (_CUR_TERM.strs[259])
-#define scroll_forward (_CUR_TERM.strs[260])
-#define scroll_reverse (_CUR_TERM.strs[261])
-#define set_attributes (_CUR_TERM.strs[262])
-#define set_left_margin (_CUR_TERM.strs[263])
-#define set_right_margin (_CUR_TERM.strs[264])
-#define set_tab (_CUR_TERM.strs[265])
-#define set_window (_CUR_TERM.strs[266])
-#define tab (_CUR_TERM.strs[267])
-#define to_status_line (_CUR_TERM.strs[268])
-#define underline_char (_CUR_TERM.strs[269])
-#define up_half_line (_CUR_TERM.strs[270])
-#define xoff_character (_CUR_TERM.strs[271])
-#define xon_character (_CUR_TERM.strs[272])
-#define alt_scancode_esc (_CUR_TERM.strs[273])
-#define bit_image_carriage_return (_CUR_TERM.strs[274])
-#define bit_image_newline (_CUR_TERM.strs[275])
-#define bit_image_repeat (_CUR_TERM.strs[276])
-#define change_char_pitch (_CUR_TERM.strs[277])
-#define change_line_pitch (_CUR_TERM.strs[278])
-#define change_res_horz (_CUR_TERM.strs[279])
-#define change_res_vert (_CUR_TERM.strs[280])
-#define char_set_names (_CUR_TERM.strs[281])
-#define code_set_init (_CUR_TERM.strs[282])
-#define color_names (_CUR_TERM.strs[283])
-#define create_window (_CUR_TERM.strs[284])
-#define define_bit_image_region (_CUR_TERM.strs[285])
-#define define_char (_CUR_TERM.strs[286])
-#define device_type (_CUR_TERM.strs[287])
-#define dial_phone (_CUR_TERM.strs[288])
-#define display_clock (_CUR_TERM.strs[289])
-#define display_pc_char (_CUR_TERM.strs[290])
-#define end_bit_image_region (_CUR_TERM.strs[291])
-#define enter_doublewide_mode (_CUR_TERM.strs[292])
-#define enter_draft_quality (_CUR_TERM.strs[293])
-#define enter_italics_mode (_CUR_TERM.strs[294])
-#define enter_leftward_mode (_CUR_TERM.strs[295])
-#define enter_micro_mode (_CUR_TERM.strs[296])
-#define enter_near_letter_quality (_CUR_TERM.strs[297])
-#define enter_normal_quality (_CUR_TERM.strs[298])
-#define enter_pc_charset_mode (_CUR_TERM.strs[299])
-#define enter_scancode_mode (_CUR_TERM.strs[300])
-#define enter_shadow_mode (_CUR_TERM.strs[301])
-#define enter_subscript_mode (_CUR_TERM.strs[302])
-#define enter_superscript_mode (_CUR_TERM.strs[303])
-#define enter_upward_mode (_CUR_TERM.strs[304])
-#define exit_doublewide_mode (_CUR_TERM.strs[305])
-#define exit_italics_mode (_CUR_TERM.strs[306])
-#define exit_leftward_mode (_CUR_TERM.strs[307])
-#define exit_micro_mode (_CUR_TERM.strs[308])
-#define exit_pc_charset_mode (_CUR_TERM.strs[309])
-#define exit_scancode_mode (_CUR_TERM.strs[310])
-#define exit_shadow_mode (_CUR_TERM.strs[311])
-#define exit_subscript_mode (_CUR_TERM.strs[312])
-#define exit_superscript_mode (_CUR_TERM.strs[313])
-#define exit_upward_mode (_CUR_TERM.strs[314])
-#define fixed_pause (_CUR_TERM.strs[315])
-#define flash_hook (_CUR_TERM.strs[316])
-#define get_mouse (_CUR_TERM.strs[317])
-#define goto_window (_CUR_TERM.strs[318])
-#define hangup (_CUR_TERM.strs[319])
-#define initialize_color (_CUR_TERM.strs[320])
-#define initialize_pair (_CUR_TERM.strs[321])
-#define key_mouse (_CUR_TERM.strs[322])
-#define label_format (_CUR_TERM.strs[323])
-#define micro_column_address (_CUR_TERM.strs[324])
-#define micro_down (_CUR_TERM.strs[325])
-#define micro_left (_CUR_TERM.strs[326])
-#define micro_right (_CUR_TERM.strs[327])
-#define micro_row_address (_CUR_TERM.strs[328])
-#define micro_up (_CUR_TERM.strs[329])
-#define mouse_info (_CUR_TERM.strs[330])
-#define order_of_pins (_CUR_TERM.strs[331])
-#define orig_colors (_CUR_TERM.strs[332])
-#define orig_pair (_CUR_TERM.strs[333])
-#define parm_down_micro (_CUR_TERM.strs[334])
-#define parm_left_micro (_CUR_TERM.strs[335])
-#define parm_right_micro (_CUR_TERM.strs[336])
-#define parm_up_micro (_CUR_TERM.strs[337])
-#define pc_term_options (_CUR_TERM.strs[338])
-#define pkey_plab (_CUR_TERM.strs[339])
-#define pulse (_CUR_TERM.strs[340])
-#define quick_dial (_CUR_TERM.strs[341])
-#define remove_clock (_CUR_TERM.strs[342])
-#define req_mouse_pos (_CUR_TERM.strs[343])
-#define scancode_escape (_CUR_TERM.strs[344])
-#define select_char_set (_CUR_TERM.strs[345])
-#define set0_des_seq (_CUR_TERM.strs[346])
-#define set1_des_seq (_CUR_TERM.strs[347])
-#define set2_des_seq (_CUR_TERM.strs[348])
-#define set3_des_seq (_CUR_TERM.strs[349])
-#define set_a_background (_CUR_TERM.strs[350])
-#define set_a_foreground (_CUR_TERM.strs[351])
-#define set_background (_CUR_TERM.strs[352])
-#define set_bottom_margin (_CUR_TERM.strs[353])
-#define set_bottom_margin_parm (_CUR_TERM.strs[354])
-#define set_clock (_CUR_TERM.strs[355])
-#define set_color_band (_CUR_TERM.strs[356])
-#define set_color_pair (_CUR_TERM.strs[357])
-#define set_foreground (_CUR_TERM.strs[358])
-#define set_left_margin_parm (_CUR_TERM.strs[359])
-#define set_lr_margin (_CUR_TERM.strs[360])
-#define set_page_length (_CUR_TERM.strs[361])
-#define set_right_margin_parm (_CUR_TERM.strs[362])
-#define set_tb_margin (_CUR_TERM.strs[363])
-#define set_top_margin (_CUR_TERM.strs[364])
-#define set_top_margin_parm (_CUR_TERM.strs[365])
-#define start_bit_image (_CUR_TERM.strs[366])
-#define start_char_set_def (_CUR_TERM.strs[367])
-#define stop_bit_image (_CUR_TERM.strs[368])
-#define stop_char_set_def (_CUR_TERM.strs[369])
-#define subscript_characters (_CUR_TERM.strs[370])
-#define superscript_characters (_CUR_TERM.strs[371])
-#define these_cause_cr (_CUR_TERM.strs[372])
-#define tone (_CUR_TERM.strs[373])
-#define user0 (_CUR_TERM.strs[374])
-#define user1 (_CUR_TERM.strs[375])
-#define user2 (_CUR_TERM.strs[376])
-#define user3 (_CUR_TERM.strs[377])
-#define user4 (_CUR_TERM.strs[378])
-#define user5 (_CUR_TERM.strs[379])
-#define user6 (_CUR_TERM.strs[380])
-#define user7 (_CUR_TERM.strs[381])
-#define user8 (_CUR_TERM.strs[382])
-#define user9 (_CUR_TERM.strs[383])
-#define wait_tone (_CUR_TERM.strs[384])
-#define zero_motion (_CUR_TERM.strs[385])
-#define backspace_if_not_bs (_CUR_TERM.strs[386])
-#define other_non_function_keys (_CUR_TERM.strs[387])
-#define arrow_key_map (_CUR_TERM.strs[388])
-#define memory_lock_above (_CUR_TERM.strs[389])
-#define memory_unlock (_CUR_TERM.strs[390])
-#define linefeed_if_not_lf (_CUR_TERM.strs[391])
-#define key_interrupt_char (_CUR_TERM.strs[392])
-#define key_kill_char (_CUR_TERM.strs[393])
-#define key_suspend_char (_CUR_TERM.strs[394])
-#define scroll_left (_CUR_TERM.strs[395])
-#define scroll_right (_CUR_TERM.strs[396])
-#define parm_scroll_left (_CUR_TERM.strs[397])
-#define parm_scroll_right (_CUR_TERM.strs[398])
-#define _get_other (_CUR_TERM.strs[399])
-
-#define NUM_OF_BOOLS 53
-#define NUM_OF_NUMS 42
-#define NUM_OF_STRS 400
-
-#ifndef OVERRIDE
-#undef _USE_SGTTY
-#undef _USE_TERMIO
-#undef _USE_TERMIOS
-#define _USE_TERMIOS
-#undef _USE_SMALLMEM
-#undef _USE_PROTOTYPES
-#define _USE_PROTOTYPES
-#undef _USE_WINSZ
-#define _USE_WINSZ
-#undef _USE_TERMINFO
-#undef _USE_TERMCAP
-#define _USE_TERMCAP
-#undef _MAX_CHUNK
-#define _MAX_CHUNK 640
-#endif /* OVERRIDE */
-
diff --git a/lib/libmytinfo/term.tail b/lib/libmytinfo/term.tail
deleted file mode 100644
index dd5b6ad..0000000
--- a/lib/libmytinfo/term.tail
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * 92/02/01 07:30:28
- * @(#) mytinfo term.tail 3.2 92/02/01 public domain, By Ross Ridge
- *
- */
-
-#if defined(_USE_TERMIO) || defined(_USE_TERMIOS)
-#ifndef ICANON
-#ifdef _USE_TERMIO
-#include <termio.h>
-#else
-#include <termios.h>
-#endif
-#endif
-#if defined(_USE_WINSZ) && defined(__FreeBSD__)
-#include <sys/ioctl.h>
-#endif
-#if defined(_USE_WINSZ) && defined(xenix)
-#include <sys/stream.h>
-#include <sys/ptem.h>
-#endif
-#endif
-
-#ifdef _USE_SGTTY
-#ifndef CBREAK
-#include <sgtty.h>
-#endif
-#endif
-
-typedef struct _terminal {
- int fd;
-#ifdef _USE_SMALLMEM
-#ifdef _USE_TERMIOS
- speed_t baudrate;
-#else
- unsigned short baudrate;
-#endif
- unsigned pad:1, xon:1, termcap:1;
-#else
- int pad;
- int xon;
- int termcap;
-#ifdef _USE_TERMIOS
- speed_t baudrate;
-#else
- long baudrate;
-#endif
-#endif
- char padch;
- short true_lines, true_columns;
- struct strbuf {
- struct strbuf *next;
-#ifdef _USE_SMALLMEM
- short len;
-#else
- int len;
-#endif
- char buf[_MAX_CHUNK];
- } *strbuf;
- char *name, *name_long, *name_all;
-#ifdef _USE_SGTTY
- struct sgtty_str {
- struct sgttyb v6;
-#ifdef TIOCGETC
- struct tchars v7;
-#endif
-#ifdef TIOCLGET
- int bsd;
-#endif
-#ifdef TIOCGLTC
- struct ltchars bsd_new;
-#endif
- } prog_mode, shell_mode;
-#else /* _USE_SGTTY */
-#ifdef _USE_TERMIOS
- struct termios prog_mode, shell_mode;
-#else
-#ifdef _USE_TERMIO
- struct termio prog_mode, shell_mode;
-#endif
-#endif
-#endif /* else _USE_SGTTY */
-#ifdef _USE_WINSZ
-#ifdef TIOCGWINSZ
- struct winsize prog_winsz, shell_winsz;
-#endif
-#endif
- char bools[NUM_OF_BOOLS];
- short nums[NUM_OF_NUMS];
- char *strs[NUM_OF_STRS];
-} TERMINAL;
-
-#ifndef _CUR_TERM
-#ifdef SINGLE
-#define _CUR_TERM _term_buf
-#else
-#define _CUR_TERM (*cur_term)
-#endif
-#endif
-
-extern TERMINAL *cur_term;
-extern TERMINAL _term_buf;
-
-#ifndef __P
-#if defined(_USE_PROTOTYPES) && (defined(__STDC__) || defined(__cplusplus))
-#define __P(protos) protos /* full-blown ANSI C */
-#else
-#define __P(protos) () /* traditional C preprocessor */
-#endif
-#endif
-
-extern char *tparm __P((const char *, ...));
-extern int setupterm __P((char *, int, int *)), set_curterm __P((TERMINAL *));
-extern int del_curterm __P((TERMINAL *)), tputs __P((const char *, int, int (*)(int)));
-extern int putp __P((char *));
-extern int tigetflag __P((char *)), tigetnum __P((char *));
-extern char *tigetstr __P((char *));
-extern int def_prog_mode __P((void)), def_shell_mode __P((void));
-extern int reset_prog_mode __P((void)), reset_shell_mode __P((void));
-
-extern char *boolnames[], *boolcodes[], *boolfnames[];
-extern char *numnames[], *numcodes[], *numfnames[];
-extern char *strnames[], *strcodes[], *strfnames[];
-
-#ifndef OK
-#undef ERR
-#define OK (0)
-#define ERR (-1)
-#endif
-
-/* Compatibility */
-#define Filedes fd
-#define Ottyb shell_mode
-#define Nttyb prog_mode
-#define TTY struct termios
-
-#endif /* _TERM_H_ */
diff --git a/lib/libmytinfo/termcap.c b/lib/libmytinfo/termcap.c
deleted file mode 100644
index f914c0b..0000000
--- a/lib/libmytinfo/termcap.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * termcap.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/06/01 07:43:08
- *
- * termcap compatibility functions
- *
- */
-
-#include "defs.h"
-#include <term.h>
-#ifdef __FreeBSD__
-#include <unistd.h>
-#endif
-
-#ifdef USE_SCCS_IDS
-static const char SCCSid[] = "@(#) mytinfo termcap.c 3.3 92/06/01 public domain, By Ross Ridge";
-#endif
-
-extern char _mytinfo_version[];
-/* not static */
-char *_force_pick1 = _mytinfo_version;
-
-int
-tgetent(buf, term)
-char *term, *buf; {
- char *s;
- struct term_path *path;
- int r = -1;
- int fd;
-
- if (term == NULL)
- term = getenv("TERM");
- if (term == NULL)
- return 0;
-
- path = _buildpath(
-#ifdef USE_TERMINFO
- "$MYTERMINFO", 2,
- "$TERMINFO", 2,
-#ifdef TERMINFODIR
- TERMINFODIR, 0,
-#endif
-#ifdef TERMINFOSRC
- TERMINFOSRC, 0,
-#endif
-#endif
-#ifdef USE_TERMCAP
- "$TERMCAP", 1,
-#ifdef TERMCAPFILE
- TERMCAPFILE, 0,
-#endif
-#endif
- NULL, -1);
-
- if (path == NULL)
- return -1;
-
-#if 1
- {
- char buf1[MAX_BUF];
- r = _fillterm(term, path, buf1);
- }
-#else
- r = _fillterm(term, path, buf);
-#endif
-
- _delpath(path);
-
- switch(r) {
- case -3:
- case -2:
- case -1:
- return -1;
- case 0:
- return 0;
- case 1:
- case 2:
- case 3:
- if (isatty(1))
- fd = 1;
- else if (isatty(2))
- fd = 2;
- else if (isatty(3)) /* V10 /dev/tty ?? */
- fd = 3;
- else if (isatty(0))
- fd = 0;
- else
- fd = 1;
-
- cur_term->fd = fd;
- _term_buf.fd = fd;
-
- if (_init_tty() == ERR)
- return 0;
- if ((s = getenv("LINES")) != NULL && atoi(s) > 0)
- lines = atoi(s);
- if ((s = getenv("COLUMNS")) != NULL && atoi(s) > 0)
- columns = atoi(s);
- cur_term->termcap = 1;
- return 1;
- default:
- return -1;
- }
-}
-
-static char cap2[3];
-
-int
-tgetnum(cap)
-char *cap; {
- int ind;
-
- cap2[0] = cap[0];
- cap2[1] = cap[1];
- cap2[2] = '\0';
-
- ind = _findnumcode(cap2);
- if (ind == -1)
- return -1;
- return cur_term->nums[ind];
-}
-
-int
-tgetflag(cap)
-char *cap; {
- int ind;
-
- cap2[0] = cap[0];
- cap2[1] = cap[1];
- cap2[2] = '\0';
-
- ind = _findboolcode(cap2);
- if (ind == -1)
- return 0;
- return cur_term->bools[ind];
-}
-
-char *
-tgetstr(cap, area)
-char *cap;
-char **area; {
- register char *sp, *dp;
- int ind;
-
- cap2[0] = cap[0];
- cap2[1] = cap[1];
- cap2[2] = '\0';
-
- ind = _findstrcode(cap2);
- if (ind == -1)
- return NULL;
- sp = cur_term->strs[ind];
- if (area == NULL || sp == NULL)
- return sp;
- dp = *area;
- while (*sp != '\0')
- *dp++ = *sp++;
- *dp++ = '\0';
- sp = *area;
- *area = dp;
- return sp;
-}
diff --git a/lib/libmytinfo/terminfo.c b/lib/libmytinfo/terminfo.c
deleted file mode 100644
index 0568588..0000000
--- a/lib/libmytinfo/terminfo.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * terminfo.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/02/01 07:30:30
- *
- * terminfo compatible libary functions
- *
- */
-
-#include "defs.h"
-#include <term.h>
-
-#ifdef USE_SCCS_IDS
-static const char SCCSid[] = "@(#) mytinfo terminfo.c 3.2 92/02/01 public domain, By Ross Ridge";
-#endif
-
-extern char _mytinfo_version[];
-/* not static */
-char *_force_pick2 = _mytinfo_version;
-
-#ifdef USE_FAKE_STDIO
-
-#ifdef __GNUC__
-__inline__
-#endif
-static int
-printerr(msg)
-char *msg; {
- return write(2, msg, strlen(msg));
-}
-
-#define RETERR(e, msg) { (err == NULL ? (printerr(msg), exit(1)) \
- : (*err = e)); return ERR; }
-
-#else
-
-#define RETERR(e, msg) { (err == NULL ? (fprintf(stderr, "setupterm(\"%s\",%d,NULL): %s", term, fd, msg), exit(1)) \
- : (*err = e)); return ERR; }
-
-#endif
-
-int
-setupterm(term, fd, err)
-char *term;
-int fd;
-int *err; {
- struct term_path *path;
- char *s;
- int r = -1;
- char buf[MAX_BUF];
-
-
- if (term == NULL)
- term = getenv("TERM");
- if (term == NULL)
- RETERR(0, "TERM not set\n")
-
- path = _buildpath(
-#ifdef USE_TERMINFO
- "$MYTERMINFO", 2,
- "$TERMINFO", 2,
-#ifdef TERMINFODIR
- TERMINFODIR, 0,
-#endif
-#ifdef TERMINFOSRC
- TERMINFOSRC, 0,
-#endif
-#endif
-#ifdef USE_TERMCAP
- "$TERMCAP", 1,
-#ifdef TERMCAPFILE
- TERMCAPFILE, 0,
-#endif
-#endif
- NULL, -1);
-
- if (path == NULL)
- RETERR(0, "malloc error\n");
-
- r = _fillterm(term, path, buf);
-
- _delpath(path);
-
- switch(r) {
- case -3:
- RETERR(0, "malloc error\n");
- case -2:
- RETERR(-1, "bad format\n");
- case -1:
- RETERR(-1, "database not found\n");
- case 0:
- RETERR(0, "terminal not found\n");
- case 1:
- case 2:
- case 3:
- cur_term->fd = fd;
- _term_buf.fd = fd;
- if (_init_tty() == ERR)
- RETERR(0, "problem initializing tty\n");
- if ((s = getenv("LINES")) != NULL && atoi(s) > 0)
- lines = atoi(s);
- if ((s = getenv("COLUMNS")) != NULL && atoi(s) > 0)
- columns = atoi(s);
- if (err != NULL)
- *err = 1;
- return OK;
- default:
- RETERR(0, "oops...\n");
- }
-}
-
-int
-set_curterm(p)
-TERMINAL *p; {
- cur_term = p;
- if (_init_tty() == ERR)
- return ERR;
- if (_check_tty() == ERR)
- return ERR;
- return OK;
-}
-
-int
-del_curterm(p)
-TERMINAL *p; {
- _del_strs(p);
- free((anyptr) p);
-
- return OK;
-}
diff --git a/lib/libmytinfo/tgoto.c b/lib/libmytinfo/tgoto.c
deleted file mode 100644
index 1bc735b..0000000
--- a/lib/libmytinfo/tgoto.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * tgoto.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/02/01 07:30:33
- *
- * A few kludged attempts to worry outputing ^D's and NL's...
- * My advice is to get a decent terminal.
- *
- */
-
-#include "defs.h"
-#include <term.h>
-
-#ifdef USE_SCCS_IDS
-static const char SCCSid[] = "@(#) mytinfo tgoto.c 3.2 92/02/01 public domain, By Ross Ridge";
-#endif
-
-#ifdef USE_LITOUT_KLUDGE
-
-/*
- * This kludge works by telling tputs to switch the tty driver to
- * "literal output" when printing the string so we don't have worry
- * about newlines and EOTs. The problem is that ioctls used to
- * switch modes might flush buffers and cause other problems.
- */
-
-
-char *
-tgoto(str, x, y)
-char *str;
-int x,y; {
- register char *sp;
-
- static char buf[MAX_LINE] = {'\\', '@'};
-
- sp = str = tparm(str, y, x);
-
- while (*sp != '\0') {
- if (*sp == '\004' || *sp == '\n') {
- strncpy(buf + 2, str, MAX_LINE - 2);
- buf[MAX_LINE - 2] = '\0';
- return buf;
- }
- sp++;
- }
- return sp;
-}
-#else
-
-#ifdef USE_UPBC_KLUDGE
-
-#ifdef USE_EXTERN_UPBC
-extern char *BC, *UP;
-#else
-#define BC cursor_left
-#define UP cursor_right
-#endif
-
-#ifdef __GNUC__
-__inline__
-#endif
-static int
-checkit(s)
-register char *s; {
- while(*s != '\0') {
- if (*s == '\004' || *s == '\n')
- return 1;
- s++;
- }
- return 0;
-}
-
-/*
- * Major kludge, basically we just change the parmeters until we get
- * a string that doesn't contain a newline or EOT.
- */
-
-char *
-tgoto(str, x, y)
-char *str;
-int x,y; {
- static char buf[MAX_LINE];
- register char *orig, *s;
- int l;
-
- orig = tparm(str, y, x);
-
- if (!checkit(orig))
- return orig;
-
- s = tparm(str, y + 1, x);
-
- if (!checkit(s)) {
- if (BC == NULL)
- return s;
- l = strlen(s);
- strncpy(buf, s, MAX_LINE - 1);
- if (l < MAX_LINE - 1)
- strncpy(buf + l, BC, MAX_LINE - 1 - l);
- return s;
- }
-
- s = tparm(str, y, x + 1);
-
- if (!checkit(s)) {
- if (UP == NULL)
- return s;
- l = strlen(s);
- strncpy(buf, s, MAX_LINE - 1);
- if (l < MAX_LINE - 1)
- strncpy(buf + l, UP, MAX_LINE - 1 - l);
- return s;
- }
-
- s = tparm(str, y + 1, x + 1);
-
- if (!checkit(s)) {
- if (UP == NULL || BC == NULL)
- return s;
- l = strlen(s);
- strncpy(buf, s, MAX_LINE - 1);
- if (l < MAX_LINE - 1)
- strncpy(buf + l, UP, MAX_LINE - 1 - l);
- l += strlen(UP);
- if (l < MAX_LINE - 1)
- strncpy(buf + l, BC, MAX_LINE - 1 - l);
- return s;
- }
-
- return orig;
-}
-
-#else
-
-/* the simple tgoto, don't worry about any of this newline/EOT crap */
-
-char *
-tgoto(str, x, y)
-char *str;
-int x,y; {
- return tparm(str, y, x);
-}
-
-#endif
-
-#endif
diff --git a/lib/libmytinfo/tiget.c b/lib/libmytinfo/tiget.c
deleted file mode 100644
index e312422..0000000
--- a/lib/libmytinfo/tiget.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * tiget.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/02/01 07:30:34
- *
- * The various tiget terminfo functions.
- */
-
-#include "defs.h"
-#include <term.h>
-
-#ifdef USE_SCCS_IDS
-static const char SCCSid[] = "@(#) mytinfo tiget.c 3.2 92/02/01 public domain, By Ross Ridge";
-#endif
-
-int
-tigetnum(cap)
-char *cap; {
- int ind;
-
- ind = _findnumname(cap);
- if (ind == -1)
- return -2;
- return cur_term->nums[ind];
-}
-
-int
-tigetflag(cap)
-char *cap; {
- int ind;
-
- ind = _findboolname(cap);
- if (ind == -1)
- return -1;
- return cur_term->bools[ind];
-}
-
-char *
-tigetstr(cap)
-char *cap; {
- int ind;
-
- ind = _findstrname(cap);
- if (ind == -1)
- return (char *) -1;
- return cur_term->strs[ind];
-}
-
-
diff --git a/lib/libmytinfo/tmatch.c b/lib/libmytinfo/tmatch.c
deleted file mode 100644
index afccda7..0000000
--- a/lib/libmytinfo/tmatch.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * tmatch.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/02/01 07:30:35
- *
- * See if a terminal name matches a list of terminal names from a
- * terminal description
- *
- */
-
-#include "defs.h"
-
-#ifdef USE_SCCS_IDS
-static const char SCCSid[] = "@(#) mytinfo tmatch.c 3.2 92/02/01 public domain, By Ross Ridge";
-#endif
-
-int
-_tmatch(line, name)
-char *line, *name; {
- char term[MAX_LINE];
- char *sp, *dp;
-
- sp = line;
- while (*sp != '\0') {
- dp = term;
- while (*sp != '\0' && *sp != '|')
- *dp++ = *sp++;
- *dp = '\0';
- if (strcmp(term, name) == 0)
- return 1;
- if (*sp == '|')
- sp++;
- }
- return 0;
-}
diff --git a/lib/libmytinfo/tparm.c b/lib/libmytinfo/tparm.c
deleted file mode 100644
index b15dc57..0000000
--- a/lib/libmytinfo/tparm.c
+++ /dev/null
@@ -1,808 +0,0 @@
-/*
- * tparm.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/02/01 07:30:36
- *
- * $FreeBSD$
- */
-
-#include "defs.h"
-#include <term.h>
-
-#include <ctype.h>
-
-#ifdef USE_SCCS_IDS
-static const char SCCSid[] = "@(#) mytinfo tparm.c 3.2 92/02/01 public domain, By Ross Ridge";
-#endif
-
-#ifndef MAX_PUSHED
-#define MAX_PUSHED 32
-#endif
-
-#define ARG 1
-#define NUM 2
-
-#define INTEGER 1
-#define STRING 2
-
-typedef struct stack_str {
- int type;
- int argnum;
- int value;
-} stack;
-
-static stack S[MAX_PUSHED];
-static stack vars['z'-'a'+1];
-static int pos = 0;
-
-static struct arg_str {
- int type;
- int integer;
- char *string;
-} arg_list[10];
-
-static int argcnt;
-
-static va_list tparm_args;
-
-static int
-pusharg(arg)
-int arg; {
- if (pos == MAX_PUSHED)
- return 1;
- S[pos].type = ARG;
- S[pos++].argnum = arg;
- return 0;
-}
-
-static int
-pushnum(num)
-int num; {
- if (pos == MAX_PUSHED)
- return 1;
- S[pos].type = NUM;
- S[pos++].value = num;
- return 0;
-}
-
-/* VARARGS2 */
-static int
-getarg(argnum, type, p)
-int argnum, type;
-anyptr p; {
- while (argcnt < argnum) {
- arg_list[argcnt].type = INTEGER;
- arg_list[argcnt++].integer = (int) va_arg(tparm_args, int);
- }
- if (argcnt > argnum) {
- if (arg_list[argnum].type != type)
- return 1;
- else if (type == STRING)
- *(char **)p = arg_list[argnum].string;
- else
- *(int *)p = arg_list[argnum].integer;
- } else {
- arg_list[argcnt].type = type;
- if (type == STRING)
- *(char **)p = arg_list[argcnt++].string
- = (char *) va_arg(tparm_args, char *);
- else
- *(int *)p = arg_list[argcnt++].integer = (int) va_arg(tparm_args, int);
- }
- return 0;
-}
-
-
-static int
-popstring(str)
-char **str; {
- if (pos-- == 0)
- return 1;
- if (S[pos].type != ARG)
- return 1;
- return(getarg(S[pos].argnum, STRING, (anyptr) str));
-}
-
-static int
-popnum(num)
-int *num; {
- if (pos-- == 0)
- return 1;
- switch (S[pos].type) {
- case ARG:
- return (getarg(S[pos].argnum, INTEGER, (anyptr) num));
- case NUM:
- *num = S[pos].value;
- return 0;
- }
- return 1;
-}
-
-static int
-cvtchar(sp, c)
-register char *sp, *c; {
- switch(*sp) {
- case '\\':
- switch(*++sp) {
- case '\'':
- case '$':
- case '\\':
- case '%':
- *c = *sp;
- return 2;
- case '\0':
- *c = '\\';
- return 1;
- case '0':
- if (sp[1] == '0' && sp[2] == '0') {
- *c = '\0';
- return 4;
- }
- *c = '\200'; /* '\0' ???? */
- return 2;
- default:
- *c = *sp;
- return 2;
- }
- default:
- *c = *sp;
- return 1;
- }
-}
-
-static int termcap;
-
-/* sigh... this has got to be the ugliest code I've ever written.
- Trying to handle everything has its cost, I guess.
-
- It actually isn't to hard to figure out if a given % code is supposed
- to be interpeted with its termcap or terminfo meaning since almost
- all terminfo codes are invalid unless something has been pushed on
- the stack and termcap strings will never push things on the stack
- (%p isn't used by termcap). So where we have a choice we make the
- decision by wether or not somthing has been pushed on the stack.
- The static variable termcap keeps track of this; it starts out set
- to 1 and is incremented as each argument processed by a termcap % code,
- however if something is pushed on the stack it's set to 0 and the
- rest of the % codes are interpeted as terminfo % codes. Another way
- of putting it is that if termcap equals one we haven't decided either
- way yet, if it equals zero we're looking for terminfo codes, and if
- its greater than 1 we're looking for termcap codes.
-
- Terminfo % codes:
-
- %% output a '%'
- %[[:][-+# ][width][.precision]][doxXs]
- output pop according to the printf format
- %c output pop as a char
- %'c' push character constant c.
- %{n} push decimal constant n.
- %p[1-9] push paramter [1-9]
- %g[a-z] push variable [a-z]
- %P[a-z] put pop in variable [a-z]
- %l push the length of pop (a string)
- %+ add pop to pop and push the result
- %- subtract pop from pop and push the result
- %* multiply pop and pop and push the result
- %& bitwise and pop and pop and push the result
- %| bitwise or pop and pop and push the result
- %^ bitwise xor pop and pop and push the result
- %~ push the bitwise not of pop
- %= compare if pop and pop are equal and push the result
- %> compare if pop is less than pop and push the result
- %< compare if pop is greater than pop and push the result
- %A logical and pop and pop and push the result
- %O logical or pop and pop and push the result
- %! push the logical not of pop
- %? condition %t if_true [%e if_false] %;
- if condtion evaulates as true then evaluate if_true,
- else evaluate if_false. elseif's can be done:
-%? cond %t true [%e cond2 %t true2] ... [%e condN %t trueN] [%e false] %;
- %i add one to parameters 1 and 2. (ANSI)
-
- Termcap Codes:
-
- %% output a %
- %. output parameter as a character
- %d output parameter as a decimal number
- %2 output parameter in printf format %02d
- %3 output parameter in printf format %03d
- %+x add the character x to parameter and output it as a character
-(UW) %-x subtract parameter FROM the character x and output it as a char
-(UW) %ax add the character x to parameter
-(GNU) %a[+*-/=][cp]x
- GNU arithmetic.
-(UW) %sx subtract parameter FROM the character x
- %>xy if parameter > character x then add character y to parameter
- %B convert to BCD (parameter = (parameter/10)*16 + parameter%16)
- %D Delta Data encode (parameter = parameter - 2*(paramter%16))
- %i increment the first two parameters by one
- %n xor the first two parameters by 0140
-(GNU) %m xor the first two parameters by 0177
- %r swap the first two parameters
-(GNU) %b backup to previous parameter
-(GNU) %f skip this parameter
-
- Note the two definitions of %a, the GNU defintion is used if the characters
- after the 'a' are valid, otherwise the UW definition is used.
-
- (GNU) used by GNU Emacs termcap libraries
- (UW) used by the University of Waterloo (MFCF) termcap libraries
-
-*/
-
-#ifdef lint
-/* VARARGS1 */
-char *
-tparm(str)
-char *str; {
-#else /* lint */
-#ifdef USE_STDARG
-#ifdef USE_PROTOTYPES
-char *tparm(const char *str, ...) {
-#else /* USE_PROTOTYPES */
-char *tparm(str)
-char *str; {
-#endif /* USE_PROTOTYPES */
-#else /* USE_STDARG */
-char *tparm(va_alist)
-va_dcl {
- char *str;
-#endif
-#endif
- static char OOPS[] = "OOPS";
- static char buf[MAX_LINE];
- register char *dp;
- register char *fmt;
- const char *sp;
- char conv_char;
- char scan_for;
- int scan_depth = 0, if_depth;
- static int i, j;
- static char *s, c;
- char fmt_buf[MAX_LINE];
- char sbuf[MAX_LINE];
-
-#ifdef USE_STDARG
- va_start(tparm_args, str);
-#else
- va_start(tparm_args);
- str = (char *) va_arg(tparm_args, char *);
-#endif
-
- sp = str;
- dp = buf;
- scan_for = 0;
- if_depth = 0;
- argcnt = 0;
- pos = 0;
- termcap = 1;
- while(*sp != '\0') {
- switch(*sp) {
- case '\\':
- if (scan_for) {
- if (*++sp != '\0')
- sp++;
- break;
- }
- *dp++ = *sp++;
- if (*sp != '\0')
- *dp++ = *sp++;
- break;
- case '%':
- sp++;
- if (scan_for) {
- if (*sp == scan_for && if_depth == scan_depth) {
- if (scan_for == ';')
- if_depth--;
- scan_for = 0;
- } else if (*sp == '?')
- if_depth++;
- else if (*sp == ';') {
- if (if_depth == 0)
- return OOPS;
- else
- if_depth--;
- }
- sp++;
- break;
- }
- fmt = NULL;
- switch(*sp) {
- case '%':
- *dp++ = *sp++;
- break;
- case '+':
- if (!termcap) {
- if (popnum(&j) || popnum(&i))
- return OOPS;
- i += j;
- if (pushnum(i))
- return OOPS;
- sp++;
- break;
- }
- ;/* FALLTHROUGH */
- case 'C':
- if (*sp == 'C') {
- if (getarg(termcap - 1, INTEGER, &i))
- return OOPS;
- if (i >= 96) {
- i /= 96;
- if (i == '$')
- *dp++ = '\\';
- *dp++ = i;
- }
- }
- fmt = "%c";
- /* FALLTHROUGH */
- case 'a':
- if (!termcap)
- return OOPS;
- if (getarg(termcap - 1, INTEGER, (anyptr) &i))
- return OOPS;
- if (*++sp == '\0')
- return OOPS;
- if ((sp[1] == 'p' || sp[1] == 'c')
- && sp[2] != '\0' && fmt == NULL) {
- /* GNU arithmetic parameter, what they
- really need is terminfo. */
- int val, lc;
- if (sp[1] == 'p'
- && getarg(termcap - 1 + sp[2] - '@',
- INTEGER, (anyptr) &val))
- return OOPS;
- if (sp[1] == 'c') {
- lc = cvtchar(sp + 2, &c) + 2;
- /* Mask out 8th bit so \200 can be
- used for \0 as per GNU doc's */
- val = c & 0177;
- } else
- lc = 2;
- switch(sp[0]) {
- case '=':
- break;
- case '+':
- val = i + val;
- break;
- case '-':
- val = i - val;
- break;
- case '*':
- val = i * val;
- break;
- case '/':
- val = i / val;
- break;
- default:
- /* Not really GNU's %a after all... */
- lc = cvtchar(sp, &c);
- val = c + i;
- break;
- }
- arg_list[termcap - 1].integer = val;
- sp += lc;
- break;
- }
- sp += cvtchar(sp, &c);
- arg_list[termcap - 1].integer = c + i;
- if (fmt == NULL)
- break;
- sp--;
- /* FALLTHROUGH */
- case '-':
- if (!termcap) {
- if (popnum(&j) || popnum(&i))
- return OOPS;
- i -= j;
- if (pushnum(i))
- return OOPS;
- sp++;
- break;
- }
- fmt = "%c";
- /* FALLTHROUGH */
- case 's':
- if (termcap && (fmt == NULL || *sp == '-')) {
- if (getarg(termcap - 1, INTEGER, &i))
- return OOPS;
- if (*++sp == '\0')
- return OOPS;
- sp += cvtchar(sp, &c);
- arg_list[termcap - 1].integer = c - i;
- if (fmt == NULL)
- break;
- sp--;
- }
- if (!termcap)
- return OOPS;
- ;/* FALLTHROUGH */
- case '.':
- if (termcap && fmt == NULL)
- fmt = "%c";
- ;/* FALLTHROUGH */
- case 'd':
- if (termcap && fmt == NULL)
- fmt = "%d";
- ;/* FALLTHROUGH */
- case '2':
- if (termcap && fmt == NULL)
- fmt = "%02d";
- ;/* FALLTHROUGH */
- case '3':
- if (termcap && fmt == NULL)
- fmt = "%03d";
- ;/* FALLTHROUGH */
- case ':': case ' ': case '#': case 'u':
- case 'x': case 'X': case 'o': case 'c':
- case '0': case '1': case '4': case '5':
- case '6': case '7': case '8': case '9':
- if (fmt == NULL) {
- if (termcap)
- return OOPS;
- if (*sp == ':')
- sp++;
- fmt = fmt_buf;
- *fmt++ = '%';
- while(*sp != 's' && *sp != 'x' && *sp != 'X' && *sp != 'd' && *sp != 'o' && *sp != 'c' && *sp != 'u') {
- if (*sp == '\0')
- return OOPS;
- *fmt++ = *sp++;
- }
- *fmt++ = *sp;
- *fmt = '\0';
- fmt = fmt_buf;
- }
- conv_char = fmt[strlen(fmt) - 1];
- if (conv_char == 's') {
- if (popstring(&s))
- return OOPS;
- sprintf(sbuf, fmt, s);
- } else {
- if (termcap) {
- if (getarg(termcap++ - 1,
- INTEGER, &i))
- return OOPS;
- } else
- if (popnum(&i))
- return OOPS;
- if (i == 0 && conv_char == 'c')
- strcpy(sbuf, "\000");
- else
- sprintf(sbuf, fmt, i);
- }
- sp++;
- fmt = sbuf;
- while(*fmt != '\0') {
- if (*fmt == '$' || *fmt == '^' || *fmt == '\\')
- *dp++ = '\\';
- *dp++ = *fmt++;
- }
- break;
- case 'r':
- if (!termcap || getarg(1, INTEGER, &i))
- return OOPS;
- arg_list[1].integer = arg_list[0].integer;
- arg_list[0].integer = i;
- sp++;
- break;
- case 'i':
- if (getarg(1, INTEGER, &i)
- || arg_list[0].type != INTEGER)
- return OOPS;
- arg_list[1].integer++;
- arg_list[0].integer++;
- sp++;
- break;
- case 'n':
- if (!termcap || getarg(1, INTEGER, &i))
- return OOPS;
- arg_list[0].integer ^= 0140;
- arg_list[1].integer ^= 0140;
- sp++;
- break;
- case '>':
- if (!termcap) {
- if (popnum(&j) || popnum(&i))
- return OOPS;
- i = (i > j);
- if (pushnum(i))
- return OOPS;
- sp++;
- break;
- }
- if (getarg(termcap-1, INTEGER, &i))
- return OOPS;
- sp += cvtchar(sp, &c);
- if (i > c) {
- sp += cvtchar(sp, &c);
- arg_list[termcap-1].integer += c;
- } else
- sp += cvtchar(sp, &c);
- sp++;
- break;
- case 'B':
- if (!termcap || getarg(termcap-1, INTEGER, &i))
- return OOPS;
- arg_list[termcap-1].integer = 16*(i/10)+i%10;
- sp++;
- break;
- case 'D':
- if (!termcap || getarg(termcap-1, INTEGER, &i))
- return OOPS;
- arg_list[termcap-1].integer = i - 2 * (i % 16);
- sp++;
- break;
- case 'p':
- if (termcap > 1)
- return OOPS;
- if (*++sp == '\0')
- return OOPS;
- if (*sp == '0')
- i = 9;
- else
- i = *sp - '1';
- if (i < 0 || i > 9)
- return OOPS;
- if (pusharg(i))
- return OOPS;
- termcap = 0;
- sp++;
- break;
- case 'P':
- if (termcap || *++sp == '\0')
- return OOPS;
- i = *sp++ - 'a';
- if (i < 0 || i > 25)
- return OOPS;
- if (pos-- == 0)
- return OOPS;
- switch(vars[i].type = S[pos].type) {
- case ARG:
- vars[i].argnum = S[pos].argnum;
- break;
- case NUM:
- vars[i].value = S[pos].value;
- break;
- }
- break;
- case 'g':
- if (termcap || *++sp == '\0')
- return OOPS;
- i = *sp++ - 'a';
- if (i < 0 || i > 25)
- return OOPS;
- switch(vars[i].type) {
- case ARG:
- if (pusharg(vars[i].argnum))
- return OOPS;
- break;
- case NUM:
- if (pushnum(vars[i].value))
- return OOPS;
- break;
- }
- break;
- case '\'':
- if (termcap > 1)
- return OOPS;
- if (*++sp == '\0')
- return OOPS;
- sp += cvtchar(sp, &c);
- if (pushnum(c) || *sp++ != '\'')
- return OOPS;
- termcap = 0;
- break;
- case '{':
- if (termcap > 1)
- return OOPS;
- i = 0;
- sp++;
- while(isdigit(*sp))
- i = 10 * i + *sp++ - '0';
- if (*sp++ != '}' || pushnum(i))
- return OOPS;
- termcap = 0;
- break;
- case 'l':
- if (termcap || popstring(&s))
- return OOPS;
- i = strlen(s);
- if (pushnum(i))
- return OOPS;
- sp++;
- break;
- case '*':
- if (termcap || popnum(&j) || popnum(&i))
- return OOPS;
- i *= j;
- if (pushnum(i))
- return OOPS;
- sp++;
- break;
- case '/':
- if (termcap || popnum(&j) || popnum(&i))
- return OOPS;
- i /= j;
- if (pushnum(i))
- return OOPS;
- sp++;
- break;
- case 'm':
- if (termcap) {
- if (getarg(1, INTEGER, &i))
- return OOPS;
- arg_list[0].integer ^= 0177;
- arg_list[1].integer ^= 0177;
- sp++;
- break;
- }
- if (popnum(&j) || popnum(&i))
- return OOPS;
- i %= j;
- if (pushnum(i))
- return OOPS;
- sp++;
- break;
- case '&':
- if (popnum(&j) || popnum(&i))
- return OOPS;
- i &= j;
- if (pushnum(i))
- return OOPS;
- sp++;
- break;
- case '|':
- if (popnum(&j) || popnum(&i))
- return OOPS;
- i |= j;
- if (pushnum(i))
- return OOPS;
- sp++;
- break;
- case '^':
- if (popnum(&j) || popnum(&i))
- return OOPS;
- i ^= j;
- if (pushnum(i))
- return OOPS;
- sp++;
- break;
- case '=':
- if (popnum(&j) || popnum(&i))
- return OOPS;
- i = (i == j);
- if (pushnum(i))
- return OOPS;
- sp++;
- break;
- case '<':
- if (popnum(&j) || popnum(&i))
- return OOPS;
- i = (i < j);
- if (pushnum(i))
- return OOPS;
- sp++;
- break;
- case 'A':
- if (popnum(&j) || popnum(&i))
- return OOPS;
- i = (i && j);
- if (pushnum(i))
- return OOPS;
- sp++;
- break;
- case 'O':
- if (popnum(&j) || popnum(&i))
- return OOPS;
- i = (i || j);
- if (pushnum(i))
- return OOPS;
- sp++;
- break;
- case '!':
- if (popnum(&i))
- return OOPS;
- i = !i;
- if (pushnum(i))
- return OOPS;
- sp++;
- break;
- case '~':
- if (popnum(&i))
- return OOPS;
- i = ~i;
- if (pushnum(i))
- return OOPS;
- sp++;
- break;
- case '?':
- if (termcap > 1)
- return OOPS;
- termcap = 0;
- if_depth++;
- sp++;
- break;
- case 't':
- if (popnum(&i) || if_depth == 0)
- return OOPS;
- if (!i) {
- scan_for = 'e';
- scan_depth = if_depth;
- }
- sp++;
- break;
- case 'e':
- if (if_depth == 0)
- return OOPS;
- scan_for = ';';
- scan_depth = if_depth;
- sp++;
- break;
- case ';':
- if (if_depth-- == 0)
- return OOPS;
- sp++;
- break;
- case 'b':
- if (--termcap < 1)
- return OOPS;
- sp++;
- break;
- case 'f':
- if (!termcap++)
- return OOPS;
- sp++;
- break;
- }
- break;
- default:
- if (scan_for)
- sp++;
- else
- *dp++ = *sp++;
- break;
- }
- }
- va_end(tparm_args);
- *dp = '\0';
- return buf;
-}
-
-#ifdef TEST
-
-void
-putch(c)
-char c; {
- if (c < 0) {
- printf("\\%03o", c);
- } else if (c < 32) {
- printf("^%c", c + '@');
- } else if (c == 127) {
- printf("^?");
- } else {
- putchar(c);
- }
-}
-
-char line[MAX_LINE];
-
-int
-main(argc, argv)
-int argc;
-char **argv; {
- register char *sp;
- putchar('\n');
-
- while(fgets(line, sizeof(line), stdin) != NULL) {
- line[strlen(line)-1] = '\0';
- sp = tparm(line, 1, -2, 30, 0, "bob was here");
- while(*sp)
- putch(*sp++);
- putchar('\n');
- }
- return 0;
-}
-#endif
diff --git a/lib/libmytinfo/tputs.c b/lib/libmytinfo/tputs.c
deleted file mode 100644
index 840b3c8..0000000
--- a/lib/libmytinfo/tputs.c
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- * tputs.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/06/04 11:41:15
- *
- * Output a terminal capability string with any needed padding
- *
- */
-
-#include "defs.h"
-#include <term.h>
-
-#include <ctype.h>
-
-#ifdef USE_SCCS_IDS
-static const char SCCSid[] = "@(#) mytinfo tputs.c 3.3 92/06/04 public domain, By Ross Ridge";
-#endif
-
-#ifdef TEST
-#define def_prog_mode() (OK)
-#define _norm_output() ((void)(0))
-#define _lit_output() (1)
-#endif
-
-/*
- * BITSPERCHAR (as actually transmitted over a serial line) is usually 10
- * (not 8). 1 stop bit, 1 start bit, 7 data bits, and one parity bit.
- */
-
-#define BITSPERCHAR 10
-
-#ifdef USE_FAKE_STDIO
-#undef putchar
-#endif
-
-#ifdef USE_PROTOTYPES
-#define PUTCHAR(c) (outc == (int (*)(int)) NULL ? (putchar(c)):(*outc)(c))
-#else
-#define PUTCHAR(c) (outc == (int (*)()) NULL ? (putchar(c)):(*outc)(c))
-#endif
-
-int
-tputs(sp, count, outc)
-register const char *sp;
-int count;
-#ifdef USE_PROTOTYPES
-register int (*outc)(int);
-#else
-register int (*outc)();
-#endif
-{
- register int l;
- register long cnt;
- int must_pad, multiply_pad;
- int forced_lit = 0;
-
- /* some programmes expect this behaviour from tputs */
- if (sp == NULL) {
-#ifdef DEBUG
- fprintf(stderr, "tputs: NULL\n");
-#endif
- return 0;
- }
-
- if (cur_term->termcap) {
- _figure_termcap();
- }
-
- while(*sp != '\0') {
- switch(*sp) {
- case '\\':
- switch(*++sp) {
- case 'n': PUTCHAR('\n'); sp++; break;
- case 'b': PUTCHAR('\b'); sp++; break;
- case 't': PUTCHAR('\t'); sp++; break;
- case 'r': PUTCHAR('\r'); sp++; break;
- case 'f': PUTCHAR('\f'); sp++; break;
- case 'l': PUTCHAR('\012'); sp++; break;
- case 's': PUTCHAR(' '); sp++; break;
- case 'e': case 'E': PUTCHAR('\033'); sp++; break;
-
- case '^':
- case '\\':
- case ',':
- case ':':
- case '\'':
- case '$':
- PUTCHAR(*sp++);
- break;
-
- case '0':
- if (*(sp + 1) < '0' || *(sp + 1) > '7') {
- PUTCHAR('\200'); /* I'd prefer \0 */
- sp++;
- break;
- }
- ;/* FALLTHROUGH */
- case '1': case '2': case '3': case '4':
- case '5': case '6': case '7':
- l = *sp++ - '0';
- if (*sp >= '0' && *sp <= '7') {
- l = l * 8 + (*sp++ - '0');
- if (*sp >= '0' && *sp <= '7')
- l = l * 8 + (*sp++ - '0');
- }
- PUTCHAR(l);
- break;
-
- case '\0':
- PUTCHAR('\\');
- break;
-
- case '@':
- if (!forced_lit)
- forced_lit = _lit_output();
- sp++;
- break;
-
- default:
- PUTCHAR('\\');
- PUTCHAR(*sp++);
- break;
- }
- break;
- case '^':
- if (*++sp == '\0')
- break;
- l = *sp - '@';
- if (l > 31)
- l -= 32;
- if (l < 0 || l > 31) {
- PUTCHAR('^');
- PUTCHAR(*sp++);
- } else {
- PUTCHAR(l);
- sp++;
- }
- break;
- case '$':
- if (*++sp != '<') {
- PUTCHAR('$');
- break;
- }
- must_pad = 0;
- multiply_pad = 0;
- l = 0;
- sp++;
- while (isdigit(*sp))
- l = l * 10 + (*sp++ - '0');
- l *= 10;
- if (*sp == '.') {
- sp++;
- if (isdigit(*sp))
- l += *sp++ - '0';
- }
- if (*sp == '/') {
- must_pad = 1;
- if (*++sp == '*') {
- multiply_pad = 1;
- sp++;
- }
- } else if (*sp == '*') {
- multiply_pad = 1;
- if (*++sp == '/') {
- must_pad = 1;
- sp++;
- }
- }
- if (*sp != '>') {
- PUTCHAR('p');
- PUTCHAR('a');
- PUTCHAR('d');
- PUTCHAR('?');
- break;
- }
- sp++;
-#ifdef TEST
- printf("\nl = %d", l);
-#endif
- if (cur_term->pad || must_pad) {
- cnt = ((long) l * cur_term->baudrate
- * (multiply_pad ? count : 1)
- + (10000L * BITSPERCHAR / 2L))
- / (10000L * BITSPERCHAR);
-#ifdef TEST
- printf("; cnt = %ld\n", cnt);
-#endif
- while(cnt--)
- PUTCHAR(cur_term->padch);
- }
-#ifdef TEST
- printf("\n");
-#endif
- break;
- default:
- PUTCHAR(*sp++);
- }
- }
- if (forced_lit)
- _norm_output();
- return OK;
-}
-
-int
-putp(str)
-char *str; {
-#ifdef USE_PROTOTYPES
- return(tputs(str, 1,(int (*)(int)) NULL));
-#else
- return(tputs(str, 1,(int (*)()) NULL));
-#endif
-}
-
-#ifdef TEST
-
-TERMINAL test_term, *cur_term = &test_term;
-
-int
-#ifdef USE_PROTOTYPES
-putch(char c)
-#else
-putch(c)
-char c;
-#endif
-{
- if (c & 0x80) {
- printf("\\%03o", c);
- } else if (c < 32) {
- printf("^%c", c + '@');
- } else if (c == 127) {
- printf("^?");
- } else {
- putchar(c);
- }
- return 0;
-}
-
-char line[MAX_LINE];
-
-int
-main(argc, argv)
-int argc;
-char **argv; {
- test_term.termcap = 0;
- test_term.baudrate = 1200;
- test_term.pad = 0;
- test_term.padch = 0;
- if (argc > 1)
- test_term.baudrate = atoi(argv[1]);
- if (argc > 2)
- test_term.padch = argv[2][0];
- if (argc > 3)
- test_term.pad = 1;
-
- putchar('\n');
-
- while(fgets(line, sizeof(line), stdin) != NULL) {
- line[strlen(line)-1] = '\0';
- tputs(line, 7, putch);
- putchar('\n');
- }
- return 0;
-}
-#endif
diff --git a/lib/libmytinfo/tty.c b/lib/libmytinfo/tty.c
deleted file mode 100644
index 9c22eb1..0000000
--- a/lib/libmytinfo/tty.c
+++ /dev/null
@@ -1,457 +0,0 @@
-/*
- * tty.c
- *
- * By Ross Ridge
- * Public Domain
- * 92/02/01 07:30:49
- *
- * Do some tty related things
- *
- */
-
-#include "defs.h"
-#include <term.h>
-
-#ifdef USE_SCCS_IDS
-static const char SCCSid[] = "@(#) mytinfo tty.c 3.2 92/02/01 public domain, By Ross Ridge";
-#endif
-#ifndef EXTA_IS
-#define EXTA_IS 19200
-#endif
-
-#ifndef EXTB_IS
-#define EXTB_IS 38400
-#endif
-
-#ifdef lint
-#define ioctl _ioctl
-/* shutup lint */
-/* ARGSUSED */
-/* VARARGS1 */
-static int ioctl(a, b, p) int a; long b; anyptr *p; { return 0; }
-#endif
-
-#if defined(USE_TERMIO) || defined(USE_TERMIOS)
-
-#ifdef USE_TERMIOS
-speed_t _baud_tbl[] = {0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800,
- 2400, 4800, 9600, EXTA_IS, EXTB_IS
-#ifdef B57600
- ,57600
-#endif
-#ifdef B115200
- ,115200
-#endif
- };
-#else
-#ifdef USE_SMALLMEM
-unsigned short _baud_tbl[] = {0, 50, 75, 110, 134, 150, 200, 300, 600, 1200,
- 1800, 2400, 4800, 9600, EXTA_IS, EXTB_IS};
-#else
-long _baud_tbl[] = {0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800,
- 2400, 4800, 9600, EXTA_IS, EXTB_IS};
-#endif
-#endif
-
-#ifdef USE_TERMIO
-static struct termio old;
-#else
-static struct termios old;
-#endif
-
-int
-_lit_output() {
-#ifdef USE_TERMIO
- struct termio tmp;
- if (ioctl(cur_term->fd, TCGETA, &old) == -1)
- return 0;
-#else
- struct termios tmp;
- if (tcgetattr(cur_term->fd, &old) == -1)
- return 0;
-#endif
- if (!(old.c_oflag & OPOST) || !(old.c_oflag & ONLCR))
- return 0;
- memcpy((anyptr)&tmp, (anyptr)&old, sizeof(old));
- tmp.c_oflag &= ~OPOST;
-#ifdef USE_TERMIO
- ioctl(cur_term->fd, TCSETA, &tmp);
-#else
- tcsetattr(cur_term->fd, TCSADRAIN, &tmp);
-#endif
- return 1;
-}
-
-void
-_norm_output() {
-#ifdef USE_TERMIO
- ioctl(cur_term->fd, TCSETA, &old);
-#else
- tcsetattr(cur_term->fd, TCSADRAIN, &old);
-#endif
-}
-
-int
-_check_tty() {
- if ((cur_term->prog_mode.c_iflag & IXON) && cur_term->xon)
- cur_term->pad = 0;
- else
- cur_term->pad = 1;
-#ifdef USE_TERMIO
- cur_term->baudrate = _baud_tbl[cur_term->prog_mode.c_cflag & CBAUD];
-#else
- cur_term->baudrate = cfgetospeed(&cur_term->prog_mode);
-#endif
- return OK;
-}
-
-int
-def_prog_mode() {
- if (cur_term == NULL)
- return ERR;
-#ifdef USE_WINSZ
-#ifdef TIOCGWINSZ
- if (ioctl(cur_term->fd, TIOCGWINSZ, &cur_term->prog_winsz) < 0)
- return ERR;
-#endif
-#endif
-#ifdef USE_TERMIO
- if (ioctl(cur_term->fd, TCGETA, &cur_term->prog_mode) == 0
-#else
- if (tcgetattr(cur_term->fd, &cur_term->prog_mode) == 0
-#endif
- && _check_tty() == OK)
- return OK;
- return ERR;
-}
-
-int
-def_shell_mode() {
- if (cur_term == NULL)
- return ERR;
- cur_term->termcap = 0;
-#ifdef USE_WINSZ
-#ifdef TIOCGWINSZ
- if (ioctl(cur_term->fd, TIOCGWINSZ, &cur_term->shell_winsz) < 0)
- return ERR;
-#endif
-#endif
-#ifdef USE_TERMIO
- return ioctl(cur_term->fd, TCGETA, &cur_term->shell_mode)==0 ? OK : ERR;
-#else
- return tcgetattr(cur_term->fd, &cur_term->shell_mode)==0 ? OK : ERR;
-#endif
-}
-
-
-#pragma weak reset_prog_mode
-int
-reset_prog_mode() {
- if (cur_term == NULL)
- return ERR;
-#ifdef USE_TERMIO
- return ioctl(cur_term->fd, TCSETA, &cur_term->prog_mode)==0 ? OK : ERR;
-#else
- return tcsetattr(cur_term->fd, TCSADRAIN, &cur_term->prog_mode)==0 ? OK : ERR;
-#endif
-}
-
-#pragma weak reset_shell_mode
-int
-reset_shell_mode() {
- if (cur_term == NULL)
- return ERR;
-#ifdef USE_TERMIO
- return ioctl(cur_term->fd, TCSETA, &cur_term->shell_mode)==0 ? OK : ERR;
-#else
- return tcsetattr(cur_term->fd, TCSADRAIN, &cur_term->shell_mode)==0 ? OK : ERR;
-#endif
-}
-
-int
-_init_tty() {
- cur_term->true_lines = lines;
- cur_term->true_columns = columns;
- if (pad_char == NULL)
- cur_term->padch = '\000';
- else
- cur_term->padch = pad_char[0];
- if (def_shell_mode() == ERR || def_prog_mode() == ERR) {
- cur_term->pad = 0;
- cur_term->baudrate = 1;
- cur_term->xon = 0;
- return OK;
- }
- cur_term->xon = (xoff_character == NULL || xoff_character[0] == '\021')
- && (xon_character == NULL || xon_character[0] == '\023')
- && xon_xoff;
-#ifdef USE_WINSZ
-#ifdef TIOCGWINSZ
- if (cur_term->prog_winsz.ws_row != 0
- && cur_term->prog_winsz.ws_col != 0) {
- lines = cur_term->prog_winsz.ws_row;
- columns = cur_term->prog_winsz.ws_col;
- }
-#endif
-#endif
- return OK;
-}
-
-#else
-
-#ifdef USE_SGTTY
-
-#ifdef USE_SMALLMEM
-unsigned short _baud_tbl[] = {0, 50, 75, 110, 134, 150, 200, 300, 600, 1200,
- 1800, 2400, 4800, 9600, EXTA_IS, EXTB_IS};
-#else
-long _baud_tbl[] = {0, 50, 75, 110, 134, 150, 200, 300, 600, 1200,
- 1800, 2400, 4800, 9600, EXTA_IS, EXTB_IS};
-#endif
-
-
-#ifdef TIOCLGET
-
-static int old;
-
-int
-_lit_output() {
- struct sgttyb buf;
- int tmp;
-
- ioctl(cur_term->fd, TIOCGETP, &buf);
- if (buf.sg_flags & RAW)
- return 0;
- ioctl(cur_term->fd, TIOCLGET, &old);
- if (old & LLITOUT)
- return 0;
- tmp = old | LLITOUT;
- ioctl(cur_term->fd, TIOCLSET, &tmp);
- return 1;
-}
-
-void
-_norm_output() {
- ioctl(cur_term->fd, TIOCLSET, &old);
-}
-
-#else
-
-static struct sgttyb old;
-
-int
-_lit_output() {
- struct sgttyb tmp;
- ioctl(cur_term->fd, TIOCGETP, &old);
- if (old.sg_flags & RAW)
- return 0;
- memcpy((anyptr)&tmp, (anyptr)&old, sizeof(old));
- tmp.sg_flags |= RAW;
- ioctl(cur_term->fd, TIOCSETP, &tmp);
- return 1;
-}
-
-void
-_norm_output() {
- ioctl(cur_term->fd, TIOCSETP, &old);
-}
-
-#endif
-
-int
-_check_tty() {
- if (!(cur_term->prog_mode.v6.sg_flags & RAW) && cur_term->xon)
- cur_term->pad = 0;
- else
- cur_term->pad = 1;
- cur_term->baudrate = _baud_tbl[cur_term->prog_mode.v6.sg_ospeed & 0xf];
- return OK;
-}
-
-int
-def_shell_mode() {
- if (ioctl(cur_term->fd, TIOCGETP, &cur_term->shell_mode.v6) < 0)
- return ERR;
-#ifdef TIOCGETC
- if (ioctl(cur_term->fd, TIOCGETC, &cur_term->shell_mode.v7) < 0)
- return ERR;
-#endif
-#ifdef TIOCLGET
- if (ioctl(cur_term->fd, TIOCLGET, &cur_term->shell_mode.bsd) < 0)
- return ERR;
-#endif
-#ifdef TIOCGLTC
- if (ioctl(cur_term->fd, TIOCGLTC, &cur_term->shell_mode.bsd_new) < 0)
- return ERR;
-#endif
-#ifdef USE_WINSZ
-#ifdef TIOCGWINSZ
- if (ioctl(cur_term->fd, TIOCGWINSZ, &cur_term->shell_winsz)<0)
- return ERR;
-#endif
-#endif
- cur_term->termcap = 0;
- return OK;
-}
-
-int
-def_prog_mode() {
- if (ioctl(cur_term->fd, TIOCGETP, &cur_term->prog_mode.v6) < 0)
- return ERR;
-#ifdef TIOCGETC
- if (ioctl(cur_term->fd, TIOCGETC, &cur_term->prog_mode.v7) < 0)
- return ERR;
-#endif
-#ifdef TIOCLGET
- if (ioctl(cur_term->fd, TIOCLGET, &cur_term->prog_mode.bsd) < 0)
- return ERR;
-#endif
-#ifdef TIOCGLTC
- if (ioctl(cur_term->fd, TIOCGLTC, &cur_term->prog_mode.bsd_new) < 0)
- return ERR;
-#endif
-#ifdef USE_WINSZ
-#ifdef TIOCGWINSZ
- if (ioctl(cur_term->fd, TIOCGWINSZ, &cur_term->prog_winsz)<0)
- return ERR;
-#endif
-#endif
- return _check_tty();
-}
-
-int
-reset_shell_mode() {
- if (ioctl(cur_term->fd, TIOCSETP, &cur_term->shell_mode.v6) < 0)
- return ERR;
-#ifdef TIOCGETC
- if (ioctl(cur_term->fd, TIOCSETC, &cur_term->shell_mode.v7) < 0)
- return ERR;
-#endif
-#ifdef TIOCLGET
- if (ioctl(cur_term->fd, TIOCLSET, &cur_term->shell_mode.bsd) < 0)
- return ERR;
-#endif
-#ifdef TIOCGLTC
- if (ioctl(cur_term->fd, TIOCSLTC, &cur_term->shell_mode.bsd_new) < 0)
- return ERR;
-#endif
- return OK;
-}
-
-int
-reset_prog_mode() {
- if (ioctl(cur_term->fd, TIOCSETP, &cur_term->prog_mode.v6) < 0)
- return ERR;
-#ifdef TIOCGETC
- if (ioctl(cur_term->fd, TIOCSETC, &cur_term->prog_mode.v7) < 0)
- return ERR;
-#endif
-#ifdef TIOCLGET
- if (ioctl(cur_term->fd, TIOCLSET, &cur_term->prog_mode.bsd) < 0)
- return ERR;
-#endif
-#ifdef TIOCGLTC
- if (ioctl(cur_term->fd, TIOCSLTC, &cur_term->prog_mode.bsd_new) < 0)
- return ERR;
-#endif
- return OK;
-}
-
-int
-_init_tty() {
- cur_term->true_lines = lines;
- cur_term->true_columns = columns;
- if (pad_char == NULL)
- cur_term->padch = '\000';
- else
- cur_term->padch = pad_char[0];
- if (def_shell_mode() == ERR || def_prog_mode() == ERR) {
- cur_term->pad = 0;
- cur_term->baudrate = 1;
- cur_term->xon = 0;
- return OK;
- }
-#ifndef TIOCGETC
- cur_term->xon = (xoff_character == NULL || xoff_character[0] == '\021')
- && (xon_character == NULL || xon_character[0] == '\023')
- && xon_xoff;
-#else
- if (xon_xoff) {
- if (xon_character != NULL) {
- cur_term->prog_mode.v7.t_startc = xon_character[0];
- if (ioctl(cur_term->fd, TIOCSETC,
- &cur_term->prog_mode.v7) < 0)
- return ERR;
- }
- if (xoff_character != NULL) {
- cur_term->prog_mode.v7.t_stopc = xoff_character[0];
- if (ioctl(cur_term->fd, TIOCSETC,
- &cur_term->prog_mode.v7) < 0)
- return ERR;
- }
- }
- cur_term->xon = xon_xoff;
-#endif
-#ifdef USE_WINSZ
-#ifdef TIOCGWINSZ
- if (cur_term->prog_winsz.ws_row != 0
- && cur_term->prog_winsz.ws_col != 0) {
- lines = cur_term->prog_winsz.ws_row;
- columns = cur_term->prog_winsz.ws_col;
- }
-#endif
-#endif
- return OK;
-}
-
-#else
-
-int
-_lit_output() {
- return 0;
-}
-
-void
-_norm_output() {
- return;
-}
-
-int
-_check_tty() {
- return OK;
-}
-
-int
-def_prog_mode() {
- return OK;
-}
-
-int
-reset_prog_mode() {
- return OK;
-}
-
-int
-def_shell_mode() {
- return OK;
-}
-
-int
-reset_shell_mode() {
- return OK;
-}
-
-int
-_init_tty() {
- cur_term->pad = 1;
- cur_term->padch = 0;
- cur_term->baudrate = 1200;
- cur_term->xon = 0;
- cur_term->termcap = 0;
- cur_term->true_lines = lines;
- cur_term->true_columns = columns;
-}
-
-#endif
-
-#endif
diff --git a/lib/libmytinfo/version.h b/lib/libmytinfo/version.h
deleted file mode 100644
index 917223d..0000000
--- a/lib/libmytinfo/version.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- * version.h
- *
- * By Ross Ridge
- * Public Domain
- *
- */
-
-#define RELEASE 3
-#define PATCHLEVEL 0
OpenPOWER on IntegriCloud