⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 search.in

📁 项目源码察看工具lxr-0.3.tar.gz
💻 IN
字号:
#!@perlbin@# $Id: search,v 1.3 1998/04/30 11:58:16 argggh Exp $# search --	Freetext search##	Arne Georg Gleditsch <argggh@ifi.uio.no>#	Per Kristian Gjermshus <pergj@ifi.uio.no>### This program 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 of the License, or# (at your option) any later version.## This program 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 program; if not, write to the Free Software# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.######################################################################use lib 'lib/';use LXR::Common;use LXR::Config;$maxhits = 1000;sub search {    print("<p align=center>\n",	  "This searchpage is powered by ",	  "<a href=\"http://glimpse.cs.arizona.edu\">Glimpse</a>\n");    print("<form method=get action=\"search\">\n");    foreach ($Conf->allvariables) {	if ($Conf->variable($_) ne $Conf->vardefault($_)) {	    print("<input type=hidden name=\"",$_, "\" ",		  "value=\"", $Conf->variable($_), "\">\n");	}    }    print("Search for: <input type=text name=\"string\" ",	  "value=\"",$searchtext,"\" size=60>\n",	  "<input type=submit value=\"search\">\n",#	  $Query->checkbox("case",0,0,"Case sensitive search"),#	  $Query->checkbox("regexp",1,0,"Regular expression search"),#	  $Query->popup_menu("fuzz",[0,1,2,3,4,5,6,7],0),	  "</form>\n",	  "<a href=\"search_help.html\">Hints</a> ",	  "making queries.\n");        $| = 1; print('');    if ($searchtext ne "") {	print("<hr>\n");	unless (open(GLIMPSE, "-|")) {	    open(STDERR, ">&STDOUT");	    $!='';	    exec($Conf->glimpsebin,"-H".$Conf->dbdir,'-y','-n',$searchtext);	    print("Glimpse subprocess died unexpextedly: $!\n");	    exit;	}	$numlines = 0;	while (<GLIMPSE>) {	    $numlines++;	    push(@glimpselines,$_);	    if ($numlines > $maxhits) {		last;	    }	}	close(GLIMPSE);	$retval = $? >> 8;	# The manpage for glimpse says that it returns 2 on syntax errors or	# inaccessible files. It seems this is not the case. 	# We will have to work around it for the time being.    	if ($retval == 0) {	    if (@glimpselines == 0) {		print("No matching files<br>\n");	    } else {		if ($numlines > $maxhits) {		    print("<b> Too many hits, displaying first $maxhits</b><br>\n");		}		print("<h1>$searchtext</h1>\n");		$sourceroot = $Conf->sourceroot;		foreach $glimpseline (@glimpselines) {		    		    $glimpseline =~ s/$sourceroot//;		    ($file, $line, $text) = 			$glimpseline =~ /(.*?):\s*(\d+)\s*:(.*)/;		    $text =~ s/&/&amp;/g;		    $text =~ s/</&lt;/g;		    $text =~ s/>/&gt;/g;		    print(&fileref("$file, line $line", "/$file", $line),			  " -- $text<br>\n");		}	    }	} elsif ($retval == 1) {	    $glimpsebin = $Conf->glimpsebin;	    $glimpseresponse = join("<br>",@glimpselines);	    $glimpseresponse =~ s/$glimpsebin/Reason/;	    $glimpseresponse =~ s/glimpse: error in searching index//;	    print("<b>Search failed</b><br>\n$glimpseresponse");	} else {	    print("Unexpected returnvalue $retval from Glimpse\n");	}    }}($Conf, $HTTP, $Path) = &init;$searchtext = $HTTP->{'param'}->{'string'};&makeheader('search');&search;&makefooter('search');

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -