~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/extensions/xmlterm/scripts/xtst

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
# Script to test remote cookie handling
 
3
 
 
4
use strict;
 
5
 
 
6
use POSIX qw(:termios_h);
 
7
 
 
8
my ($term, $oterm, $echo, $noecho, $fd_stdin);
 
9
 
 
10
$fd_stdin = fileno(STDIN);
 
11
 
 
12
$term = POSIX::Termios->new();
 
13
$term->getattr($fd_stdin);
 
14
$oterm = $term->getlflag();
 
15
 
 
16
$echo = ECHO | ECHOK | ICANON;
 
17
$noecho = $oterm & ~$echo;
 
18
 
 
19
my ($old_vmin, $old_vtime);
 
20
$old_vmin = $term->getcc(VMIN);
 
21
$old_vtime = $term->getcc(VTIME);
 
22
 
 
23
$term->setlflag($noecho);             # Suppress input echo
 
24
$term->setcc(VMIN, 0);                # Minimum characters to read
 
25
$term->setcc(VTIME, 30);              # Wait in units of 0.1 seconds
 
26
$term->setattr($fd_stdin, TCSANOW);
 
27
 
 
28
print "VMIN,VTIME = ", $old_vmin, ",", $old_vtime, "\n";
 
29
print "VMIN,VTIME = ", $term->getcc(VMIN), ",", $term->getcc(VTIME), "\n";
 
30
 
 
31
print "\e{A\n";                     # HTML stream escape sequence
 
32
 
 
33
my $key = "";
 
34
my $key2 = "";
 
35
print "nread=", sysread(STDIN, $key, 1), "\n";
 
36
sysread(STDIN, $key2, 21);
 
37
print "--> $key2\n";
 
38
 
 
39
$term->setlflag($echo);
 
40
$term->setcc(VMIN, $old_vmin);
 
41
$term->setcc(VTIME, $old_vtime);
 
42
$term->setattr($fd_stdin, TCSANOW);
 
43