2
# $Id: find,v 1.8 2002/03/18 14:55:43 mbox Exp $
6
# Arne Georg Gleditsch <argggh@ifi.uio.no>
7
# Per Kristian Gjermshus <pergj@ifi.uio.no>
10
# This program is free software; you can redistribute it and/or modify
11
# it under the terms of the GNU General Public License as published by
12
# the Free Software Foundation; either version 2 of the License, or
13
# (at your option) any later version.
15
# This program is distributed in the hope that it will be useful,
16
# but WITHOUT ANY WARRANTY; without even the implied warranty of
17
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
# GNU General Public License for more details.
20
# You should have received a copy of the GNU General Public License
21
# along with this program; if not, write to the Free Software
22
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24
######################################################################
26
$CVSID = '$Id: find,v 1.8 2002/03/18 14:55:43 mbox Exp $ ';
28
use lib do { $0 =~ m{(.*)/} ? "$1/lib" : "lib" };
30
use LXR::Common qw(:html);
35
print("<p align=\"center\">\n",
36
"Search for files (by name) using regular expressions.\n",
37
"<br>(Need some <a href=\"search-help.html\">Hints</a> ",
38
"on performing searches?)</p>\n");
40
print ("<form method=\"get\" action=\"find\">\n");
42
foreach ($config->allvariables) {
43
if ($config->variable($_) ne $config->vardefault($_)) {
44
print("<input type=\"hidden\" name=\"",$_, "\" ",
45
"value=\"", $config->variable($_), "\">\n");
49
print("<b>Find file: </b><input type=\"text\" name=\"string\" ",
50
"value=\"",$searchtext,"\" size=\"50\">\n",
51
"<input type=\"submit\" value=\"search\">\n",
55
if ($searchtext ne "") {
56
unless (open(FILELLISTING,$config->glimpsedir."/.glimpse_filenames")) {
57
&warning("Could not open .glimpse_filenames.");
61
$sourceroot = $config->sourceroot;
62
while($file = <FILELLISTING>) {
63
$file =~ s/^$sourceroot//;
64
if($file =~ /$searchtext/) {
65
print(&fileref("$file", "find-file", "/$file"),"<br>\n");
73
$searchtext = $HTTP->{'param'}->{'string'};