From 990f06577ab11f89648d39ff7fb7bf8dc38398ad Mon Sep 17 00:00:00 2001 From: "svn%xmlterm.org" Date: Tue, 10 Oct 2000 04:40:22 +0000 Subject: [PATCH] --NOT PART OF DEFAULT BUILD-- XMLterm changes only. Added a coupled of pagelet test scripts. --- extensions/xmlterm/scripts/xrpchelp | 34 +++++++++++++++++++++++ extensions/xmlterm/scripts/xtst | 43 +++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100755 extensions/xmlterm/scripts/xrpchelp create mode 100755 extensions/xmlterm/scripts/xtst diff --git a/extensions/xmlterm/scripts/xrpchelp b/extensions/xmlterm/scripts/xrpchelp new file mode 100755 index 000000000000..003075bdc238 --- /dev/null +++ b/extensions/xmlterm/scripts/xrpchelp @@ -0,0 +1,34 @@ +#!/usr/bin/perl +# Usage: xrpchelp [] + +use Frontier::Client; + +die "Usage: xrpchelp []\n" + unless (@ARGV == 1) or (@ARGV == 2); + +my $url = shift @ARGV; # XML-RPC server URL + +$server = Frontier::Client->new( 'url' => $url, 'debug' => 0 ); + +my $cookie = $ENV{LTERM_COOKIE}; # Cookie for security +print "\e{S$cookie\012"; # Escape sequence for start of HTML + +if (@ARGV) { # Print help string for method + + print $server->call("system.methodHelp", @ARGV), "\n"; # Print method help + +} else { # List all method names + + my $list = $server->call("system.listMethods", @ARGV); # Get method names + + print "
    \n"; # Ordered list start tag + + foreach $method (@$list) { # For each method name, add list element + print qq%
  1. $method\n%; + } + + print "
\n"; # Ordered list end tag +} + +print "\000"; # Escape sequence for end of HTML diff --git a/extensions/xmlterm/scripts/xtst b/extensions/xmlterm/scripts/xtst new file mode 100755 index 000000000000..d007ac793c0a --- /dev/null +++ b/extensions/xmlterm/scripts/xtst @@ -0,0 +1,43 @@ +#!/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); +