#!/usr/bin/perl -w #!/citi/gtfd/mach/bin/perl -w ############### # $Id: hman.pl,v 1.7 1997/11/04 21:56:13 teto Exp teto $ # $Source: /pub/src/dev/hman/RCS/hman.pl,v $ ############################################ # TODO: # reorganize location of man pages - move 3x stuff from man3 to man3x # recurse - if 'man 3x curses' does not work try 'man 3 curses' # display more STDERR # Fix broken whatis entries - instead of # manpage section - description # manpage description section - # highlite keywords found # pass MANPATH as a command line argument ############################################ # Inspired by: # http://www.jinr.dubna.su/~gagin # http://thsun1.jinr.dubna.su/~gagin/rman.pl # http://thsun1.jinr.dubna.su/cgi-bin/rman.pl # http://www.jinr.dubna.su/~gagin/rman.pl.html # # CGI form interface to PolyglotMan program, which is available as # ftp://ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z # # The most recent version of this program available as # http://www.geocities.com/SiliconValley/Lakes/8777/hman.html #--------------------------------------------------------------------- # This is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # hman is distributed in the hope that # it will be useful, but WITHOUT ANY WARRANTY; without even the implied # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this software; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # # THIS SOFTWARE IS NOT DESIGNED OR INTENDED FOR USE OR RESALE AS ON-LINE # CONTROL EQUIPMENT IN HAZARDOUS ENVIRONMENTS REQUIRING FAIL-SAFE # PERFOHMANCE, SUCH AS IN THE OPERATION OF NUCLEAR FACILITIES, AIRCRAFT # NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, DIRECT LIFE # SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH THE FAILURE OF THE # SOFTWARE COULD LEAD DIRECTLY TO DEATH, PERSONAL INJURY, OR SEVERE # PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH RISK ACTIVITIES"). # ANY EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES # IS SPECIFICALLY DISCLAIMED. #--------------------------------------------------------------------- # Request form: hman.pl?ManTopic=SOMETOPIC&ManSection=SECTION # Request form: hman.pl?DirectPath=filename # #--------------------------------------------------------------------- # Stuff to change # path to PolyglotMan program. "-b" is not nessesary $hman="$ENV{HMANPRG} $ENV{HMANOPT}"; # path to man program $ManPrg='/usr/bin/man'; # path to cat program $ENV{PAGER} = '/bin/cat'; # path to man directories ($ManPathFind = $ENV{MANPATH}) =~ s/:/ /g; # URL to this program $hmanpl='/cgi-bin/hman'; # if man produced number of lines less then follows, # I assume that request failed $emptyman=5; # tail of every produced html document $HtmlTail='
Topic for man search needed
\n"); }
if ($ManSection eq "") { badness("No section specified
\n"); }
$ManSection =~ s/all//;
if ($ManSection =~ /key/) { manKey($ManTopic); }
findIt($ManTopic);
open(MANOUT, "$ManPrg $ManSection $ManTopic |")
|| die "$hmanpl: can't run \"$ManPrg Section $ManTopic |\", $!\n";
for (0..$emptyman) {
$temp = ";
for (@temp) {print;}
print "