#!/usr/local2/mosaic/bin/perl # Copyright 1994, 1995 by Magnus Kempe # version 6.0 # Direct search of section, clause, or subclause in Ada 95 RM # INSTALLATION: please adapt the four lines below according to your # own hierarchy of dorectories, and correct the path to "perl" in the # first line of this script: $site = "http://www.hbg.psu.edu"; # name of your machine $wwwpath = "/usr/local2/WebUsers/"; # path to WWW directory $path = "/math-cs/courses/comp409/rm95html-1.0"; # subpath from WWW to LRM directory $me = "/cgi-bin/findrm9x"; # path to this script # For installation, no modification should be necessary below this line @zn = ('00' .. '99'); if ($ENV{'REQUEST_METHOD'} eq 'POST') { read (STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $CONTENTS{$name} = $value; } $_ = $CONTENTS{'classic'}; s/^(\d+)\.(\d+)\.(\d+)\((\d+)\)$/@zn[$1]-@zn[$2]-@zn[$3].html#$4/; s/^(\d+)\.(\d+)\.(\d+)$/@zn[$1]-@zn[$2]-@zn[$3].html/; s/^(\d+)\.(\d+)\((\d+)\)$/@zn[$1]-@zn[$2].html#$3/; s/^(\d+)\.(\d+)$/@zn[$1]-@zn[$2].html/; s/^(\d+)\((\d+)\)$/@zn[$1].html#$2/; s/^(\d+)$/@zn[$1].html/; s/^([A-Z])\.(\d+)\.(\d+)\((\d+)\)$/$1-@zn[$2]-@zn[$3].html#$4/; s/^([A-Z])\.(\d+)\.(\d+)$/$1-@zn[$2]-@zn[$3].html/; s/^([A-Z])\.(\d+)\((\d+)\)$/$1-@zn[$2].html#$3/; s/^([A-Z])\.(\d+)$/$1-@zn[$2].html/; s/^([A-Z])\((\d+)\)$/$1.html#$2/; s/^([A-Z])$/$1.html/; $ff = $f = "$path/rm9x-$_"; $ff =~ s/#.*$//; if (-f "$wwwpath/$ff") { print "Location: $site$f\n\n"; } else { print "Location: $site$path/rm9x-toc.html\n\n"; } } else { print "Content-type: text/html\n\n"; print "\n" . "\n" . "Ada 95 RM - Search\n" . "\n" . "\n\n" . "\n"; print "

Ada 95 Reference Manual

\n"; print "

Search: direct access

\n"; print "
\n" . "Enter destination: \n" . "

\n"; print "


" . "

Instructions

\n" . "Place the pointer in the above box. \n" . "Then type the section, clause, or subclause number that you want \n" . "to access directly and press the corresponding button or the \n" . "Return key on your keyboard.\n" . "

\n" . "You may specify a paragraph number in parenthesis.

\n" . "Valid search strings are e.g.

\n"; print "
\n" . "\"Ada\n -- " . "Email comments, additions, corrections, gripes, kudos, etc. to:\n" . "
\n" . "Magnus Kempe\n" . " -- Magnus.Kempe@di.epfl.ch
\n" . "Copyright statement
\n"; ($sec,$min,$hour,$day,$month,$year,$wday,$yday,$isdst) = localtime(time); print "Page generated: $year-@zn[1+$month]-@zn[$day]" . "\n
\n" . "\n\n" . "\n"; }