termcap.pl revision 7c478bd95313f5f23a4c958a745db2134aa03244
;# $RCSfile: termcap.pl,v $$Revision: 4.1 $$Date: 92/08/07 18:24:16 $
#
# This library is no longer being maintained, and is included for backward
# compatibility with Perl 4 programs which may require it.
#
# In particular, this should not be used as an example of modern Perl
# programming techniques.
#
# Suggested alternative: Term::Cap
#
;#
;# Usage:
;# require 'ioctl.pl';
;# ioctl(TTY,$TIOCGETP,$foo);
;# ($ispeed,$ospeed) = unpack('cc',$foo);
;# require 'termcap.pl';
;# &Tgetent('vt100'); # sets $TC{'cm'}, etc.
;# &Tputs(&Tgoto($TC{'cm'},$col,$row), 0, 'FILEHANDLE');
;# &Tputs($TC{'dl'},$affcnt,'FILEHANDLE');
;#
sub Tgetent {
local($TERM) = @_;
# warn "Tgetent: no ospeed set" unless $ospeed;
}
$TERM =~ s/(\W)/\\$1/g;
if ($TERMCAP !~ m:^/:) {
}
}
if ($TERMCAP =~ m:^/:) {
$entry = '';
do {
$loop = "
while (<TERMCAP>) {
next if /^#/;
next if /^\t/;
if (/(^|\\|)${TERM}[:\\|]/) {
chop;
while (chop eq '\\\\') {
\$_ .= <TERMCAP>;
chop;
}
\$_ .= ':';
last;
}
}
close TERMCAP;
\$entry .= \$_;
";
eval $loop;
}
if ($field =~ /^\w\w$/) {
}
elsif ($field =~ /^(\w\w)#(.*)/) {
}
elsif ($field =~ /^(\w\w)=(.*)/) {
$entry = $1;
$_ = $2;
s/\\E/\033/g;
s/\\n/\n/g;
s/\\r/\r/g;
s/\\t/\t/g;
s/\\b/\b/g;
s/\\f/\f/g;
s/\\\^/\377/g;
s/\^\?/\177/g;
s/\\(.)/$1/g;
s/\377/^/g;
}
}
}
sub Tputs {
local($ms);
if ($string =~ /(^[\d.]+)(\*?)(.*)$/) {
$ms = $1;
$string = $3;
if ($decr > .1) {
}
}
$string;
}
sub Tgoto {
local($string) = shift(@_);
local($result) = '';
local($after) = '';
local(@tmp);
local($online) = 0;
while ($string =~ /^([^%]*)%(.)(.*)/) {
$result .= $1;
$code = $2;
$string = $3;
if ($code eq 'd') {
}
elsif ($code eq '.') {
if ($online) {
}
else {
}
}
}
elsif ($code eq '+') {
}
elsif ($code eq 'r') {
}
elsif ($code eq '>') {
}
}
elsif ($code eq '2') {
}
elsif ($code eq '3') {
}
elsif ($code eq 'i') {
}
else {
return "OOPS";
}
}
}
1;