gecko-dev/extensions/xmlterm/scripts/xtst
svn%xmlterm.org 990f06577a --NOT PART OF DEFAULT BUILD--
XMLterm changes only.
Added a coupled of pagelet test scripts.
2000-10-10 04:40:22 +00:00

44 lines
1.1 KiB
Perl
Executable File

#!/usr/bin/perl
# Script to test remote cookie handling
use strict;
use POSIX qw(:termios_h);
my ($term, $oterm, $echo, $noecho, $fd_stdin);
$fd_stdin = fileno(STDIN);
$term = POSIX::Termios->new();
$term->getattr($fd_stdin);
$oterm = $term->getlflag();
$echo = ECHO | ECHOK | ICANON;
$noecho = $oterm & ~$echo;
my ($old_vmin, $old_vtime);
$old_vmin = $term->getcc(VMIN);
$old_vtime = $term->getcc(VTIME);
$term->setlflag($noecho); # Suppress input echo
$term->setcc(VMIN, 0); # Minimum characters to read
$term->setcc(VTIME, 30); # Wait in units of 0.1 seconds
$term->setattr($fd_stdin, TCSANOW);
print "VMIN,VTIME = ", $old_vmin, ",", $old_vtime, "\n";
print "VMIN,VTIME = ", $term->getcc(VMIN), ",", $term->getcc(VTIME), "\n";
print "\e{A\n"; # HTML stream escape sequence
my $key = "";
my $key2 = "";
print "nread=", sysread(STDIN, $key, 1), "\n";
sysread(STDIN, $key2, 21);
print "--> $key2\n";
$term->setlflag($echo);
$term->setcc(VMIN, $old_vmin);
$term->setcc(VTIME, $old_vtime);
$term->setattr($fd_stdin, TCSANOW);