2
# $Id: ident,v 1.15 2002/03/18 14:55:43 mbox Exp $
4
# ident -- Look up identifiers
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: ident,v 1.15 2002/03/18 14:55:43 mbox Exp $ ';
29
use lib do { $0 =~ m{(.*)/} ? "$1/lib" : "lib" };
31
use LXR::Common qw(:html);
37
foreach ($config->allvariables) {
38
if ($config->variable($_) ne $config->vardefault($_)) {
39
$ret .= "<input type=\"hidden\" name=\"$_\" value=\"" .
40
$config->variable($_) . "\">\n";
50
my @refs = $index->getindex($identifier, $release);
53
foreach my $def (@refs) {
54
my ($file, $line, $type, $rel) = @$def;
55
$rel &&= "(member of ".idref($rel, "search-member", $rel).")";
56
$ret .= expandtemplate($templ,
57
(file => sub { $file },
58
line => sub { $line },
59
type => sub { $type },
62
fileref("$file, line $line",
68
# print("<span class=\"search-li1\"> $type_names{$type} in ".
69
# fileref("$file, line $line", "search-decl",
81
my @uses = $index->getreference($identifier, $release);
82
foreach my $ref (sort { $$a[0] cmp $$b[0] } @uses) {
83
my ($file, $line) = @$ref;
84
$ret .= expandtemplate($templ,
86
file => sub { $file },
87
line => sub { $line },
89
fileref("$file, line $line", "search-ref",
100
my ($templ, $templ_refs);
102
#$templ = "<ul>\n\$files{\n<li>\$iconlink \$namelink\n}</ul>\n";
103
if ($config->htmlident) {
104
unless (open(TEMPL, $config->htmlident)) {
105
warning("Template ".$config->htmlident." does not exist.");
112
die "Ident template not configured";
116
if ($config->htmlident_refs) {
117
unless (open(TEMPL, $config->htmlident_refs)) {
118
warning("Template ".$config->htmlident_refs." does not exist.");
121
$templ_refs = <TEMPL>;
125
die "Ident refs template not configured";
129
# print the description of the current directory
132
# print the listing itself
133
print(expandtemplate($templ,
134
(variables => \&varinputs,
135
identifier => sub { return $identifier },
136
refs => sub { refexpand(@_) },
138
print(expandtemplate($templ_refs,
139
(uses => sub { usesexpand(@_) },