|
- mozilla/
+ /mozilla
|
diff --git a/mozilla/webtools/lxr/lib/LXR/Common.pm b/mozilla/webtools/lxr/lib/LXR/Common.pm
index a31e843da60..9a1095f1104 100755
--- a/mozilla/webtools/lxr/lib/LXR/Common.pm
+++ b/mozilla/webtools/lxr/lib/LXR/Common.pm
@@ -1,4 +1,4 @@
-# $Id: Common.pm,v 1.15 1999-01-31 11:18:32 jwz%mozilla.org Exp $
+# $Id: Common.pm,v 1.16 1999-03-10 22:58:54 endico%mozilla.org Exp $
package LXR::Common;
@@ -526,6 +526,11 @@ sub pathname {
}
+sub treename {
+ return $Conf->{'treename'};
+}
+
+
sub titleexpand {
if ($who eq 'source' || $who eq 'sourcedir' || $who eq 'diff') {
return($Conf->sourcerootname.$Path->{'virtf'});
@@ -739,6 +744,7 @@ sub makeheader {
('dotdoturl', \&dotdoturl),
('thisurl', \&thisurl),
('pathname', \&pathname),
+ ('treename', \&treename),
('modes', \&modeexpand),
('variables', \&varexpand)));
}
diff --git a/mozilla/webtools/lxr/lib/LXR/Config.pm b/mozilla/webtools/lxr/lib/LXR/Config.pm
index 2d2ba2799f5..f6111ab8e49 100755
--- a/mozilla/webtools/lxr/lib/LXR/Config.pm
+++ b/mozilla/webtools/lxr/lib/LXR/Config.pm
@@ -1,4 +1,4 @@
-# $Id: Config.pm,v 1.3 1998-07-28 19:17:42 jwz%netscape.com Exp $
+# $Id: Config.pm,v 1.4 1999-03-10 22:58:55 endico%mozilla.org Exp $
package LXR::Config;
@@ -16,9 +16,53 @@ sub new {
my $self = {};
bless($self);
$self->_initialize(@parms);
- return($self);
+ return(treeify($self));
}
+sub treeify {
+ my ($self) = @_;
+
+ #If there are multiple definitions of sourceroot in lxr.conf then
+ #this installation is configured for multiple trees. For a single
+ #tree "sourceroot" is a single directory where the source can be
+ #found. If the file contains multiple definitions of sourceroot then
+ #each definition is a tree,directory pair.
+
+ if ($self->{'sourceroot'} =~ /\S\s+\S/) {
+ #remove the extra space that i stupidly added when parsing lxr.conf
+ $self->{'sourceroot'} =~ s/^\s+//;;
+ $self->{'oldroot'} = $self->{'sourceroot'};
+
+ #since there's whitespace within the root directory definition
+ #there is one or more tree defined. (Using directory names with
+ #embedded spaces here would be a bad thing.)
+ my %treehash = split(/\s+/, $self->{'sourceroot'});
+
+ #To compute which tree we're looking at, grab the second to last
+ #component from the script name which will be of the form:
+ # /seamonkey/source
+ $self->{'treename'} = $ENV{'SCRIPT_NAME'};
+ $self->{'treename'} =~ s/.*\/([^\/]+)\/[\w]*/$1/;
+
+ #Match the tree name against our list of trees and extract the proper
+ #directory. Set "sourceroot" to this directory.
+ $self->{'sourceroot'} = $treehash{$self->{'treename'}};
+
+ #set srcrootname to tree name
+ $self->{'sourcerootname'} = $self->{'treename'};
+
+ #append tree name to virtroot
+ $self->{'virtroot'} = $self->{'virtroot'} . "/" . $self->{'treename'} ;
+
+ #append tree name to baserul
+ $self->{'baseurl'} = $self->{'baseurl'} . $self->{'treename'};
+
+ #append tree name to dbdir
+ $self->{'dbdir'} = $self->{'dbdir'} . "/" . $self->{'treename'} ;
+
+ }
+ return($self);
+}
sub makevalueset {
my $val = shift;
@@ -115,8 +159,12 @@ sub _initialize {
$dir eq 'searchhead' ||
$dir eq 'searchtail' ||
$dir eq 'htmldir') {
- if ($arg =~ /(\S+)/) {
+ if ($arg =~ /([^\n]+)/) {
+ if ($dir eq 'sourceroot') {
+ $self->{$dir} = $self->{$dir} . " " . $1;
+ }else{
$self->{$dir} = $1;
+ }
}
} elsif ($dir eq 'map') {
if ($arg =~ /(\S+)\s+(\S+)/) {
diff --git a/mozilla/webtools/lxr/lxr.conf b/mozilla/webtools/lxr/lxr.conf
index a4b60e88287..1cf2b4a3e8f 100644
--- a/mozilla/webtools/lxr/lxr.conf
+++ b/mozilla/webtools/lxr/lxr.conf
@@ -7,11 +7,12 @@
# Define typed variable "a". First value is default.
#variable: a, Architecture, (-)
-# Define the base url for the LXR files.
-baseurl: http://cvs-mirror.mozilla.org/webtools/lxr/
+# Define the base url for the LXR files. Tree name (if any) is appened
+# to this.
+baseurl: http://lxr.mozilla.org/
# url prefix for bonsai
-bonsaihome: /webtools/bonsai
+bonsaihome: http://cvs-mirror.mozilla.org/webtools/bonsai
# These are the templates for the HTML heading, directory listing and
# footer, respectively.
@@ -23,19 +24,40 @@ sourcehead: template-source-head
sourcedirhead: template-sourcedir-head
-# The source is here.
-sourceroot: /opt/lxr-data/mozilla/
+# If there's only one tree being indexed then allow this older
+# syntax for backward compatability. "sourceroot" should
+# be the directory containing the source we're indexing.
+#sourceroot: /home/mozillatrees/nspr/nspr
+
+# If we're indexing more than one tree then include one sourceroot
+# entry per tree where each entry is a tree/directory pair.
+sourceroot: classic /export2/lxr-data/classic/mozilla
+sourceroot: ef /export2/lxr-data/ef/mozilla
+sourceroot: mailnews /export2/lxr-data/mailnews/mozilla
+sourceroot: mozilla /export2/lxr-data/mozilla/mozilla
+sourceroot: nspr /export2/lxr-data/nspr/mozilla
+sourceroot: seamonkey /export2/lxr-data//seamonkey/mozilla
+sourceroot: grendel /export2/lxr-data/grendel/mozilla
+
+# name of the source.
srcrootname: mozilla
# prepend this to url
-virtroot: /webtools/lxr
+virtroot:
# "#include " is mapped to this directory (in the LXR source
# tree)
incprefix: /include
# The database files go here.
-dbdir: /opt/lxr-data/db
+#dbdir: /opt/lxr-data/db
+
+# If using multiple trees, give the parent directory containing
+# dirs for each tree. For mozilla, /export/lxr-data contains
+# a directory for each tree. Each of these directories contains
+# the tree's databases, and a mozilla directory containing the
+# source.
+dbdir: /export2/lxr-data
# Glimpse can be found here.
glimpsebin: /opt/local/bin/glimpse
diff --git a/mozilla/webtools/lxr/root/index.html b/mozilla/webtools/lxr/root/index.html
new file mode 100644
index 00000000000..36034782cdd
--- /dev/null
+++ b/mozilla/webtools/lxr/root/index.html
@@ -0,0 +1,172 @@
+
+ Mozilla Cross-Reference
+
+
+
+
+ |
+
+
+
+
+
+ Mozilla Cross-Reference
+
+ |
+
+
+
+
+
+
+
+
+
+ Starting Points:
+
+
+
+ -
+ SeaMonkey
+
+ -
+
+ This module is SeaMonkeyAll, the Mozilla browser project.
+
+
+
+
+
+ -
+ NSPR
+
+ -
+
+ This module is
+ NSPR,
+ a cross platform library for operating system facilities
+ including threads, I/O, timing and memory management.
+
+
+
+
+
+ -
+ Grendel
+
+ -
+
+ This module is Grendel, a mail reader written in java.
+
+
+
+
+
+ -
+ Electrical Fire
+
+ -
+
+ This is /mozilla/ef, a multi-platform Just-In-Time
+ Java compiler
+
+
+
+
+
+ -
+ Mail & News
+
+ -
+
+ This is the SeaMonkeyMailNews module, containing the new
+ Messenger
+ code which is being re-written from scratch.
+
+
+
+
+
+ -
+ Mozilla
+
+ -
+
+ This contains the entre CVS repository.
+
+
+
+
+
+ -
+ Classic
+
+ -
+
+ This is Mozilla Classic. Its a snapshot of the MozillaSource
+ module from Oct 26, 1998 just before the change was made to xpfe.
+ This is here for reference. No work is done on this branch.
+
+
+
+
+
+
+ |
+
+
+
+ |
+ |
+
+
+ This is a cross referenced display of the
+Mozilla source code.
+The sources displayed are those that are currently checked
+in to the mainline of the mozilla.org
+CVS server;
+these pages are updated many times a day, so they should
+be pretty close to the latest-and-greatest.
+
+It's possible to search through the entire Mozilla source text;
+or to search for files whose name matches a pattern; or to search
+for the definitions of particular functions, variables, etc.
+
+ The individual files of the source code are formatted on the fly
+and presented with clickable identifiers. An identifier is a
+macro, typedef, struct, enum, union, function, function prototype or
+variable. Clicking on them shows you a summary of how and where they
+are used.
+
+ The free-text search command is implemented
+using Glimpse, so all the
+capabilities of Glimpse are available.
+Regular expression searches are
+especially useful.
+
+ (Don't use use a web-crawler to try and download all of these pages;
+the CGIs will feed you several gigabytes worth of generated HTML!)
+
+ The pages here are generated by the
+LXR tool, which was originally
+written to display the source code of the Linux kernel (LXR stands
+for ``Linux Cross Reference.'') Check out the
+main LXR site for more information.
+
+ Thanks to
+ Arne Georg Gleditsch and
+ Per Kristian Gjermshus, the
+ authors of the LXR tool, for writing it and making it available
+ to the world; and thanks to
+ Dawn Endico for
+ doing almost all of the work to get LXR working with the Mozilla
+ sources.
+
+ |
+
+
+
+
diff --git a/mozilla/webtools/lxr/root/search-help.html b/mozilla/webtools/lxr/root/search-help.html
new file mode 100644
index 00000000000..a709f1e2737
--- /dev/null
+++ b/mozilla/webtools/lxr/root/search-help.html
@@ -0,0 +1,166 @@
+
+
+mozilla cross-reference: search help
+
+
+
+
+ |
+
+
+
+
+
+
+This text is copied from the Glimpse manual page. I have tried to remove
+things that do not apply to the lxr searcher, but beware, some things might
+have slipped through. I'll try to put together something better when I get
+the time. For more information on glimpse go to the
+Glimpse homepage.
+
+
+
+Patterns
+
+glimpse supports a large variety of patterns, including simple
+strings, strings with classes of characters, sets of strings,
+wild cards, and regular expressions (see Limitations).
+
+
+ Strings
+
+
+Strings are any sequence of characters, including the special symbols
+`^' for beginning of line and `$' for end of line. The following
+special characters (`$', `^', `*', `[', `^', `|', `(', `)', `!', and
+`\' ) as well as the following meta characters special to glimpse (and
+agrep): `;', `,', `#', `>', `<', `-', and `.', should be preceded by
+`\\' if they are to be matched as regular characters. For example,
+\\^abc\\\\ corresponds to the string ^abc\\, whereas ^abc corresponds
+to the string abc at the beginning of a line.
+
+
+ Classes of characters
+
+
+a list of characters inside [] (in order) corresponds to any character
+from the list. For example, [a-ho-z] is any character between a and h
+or between o and z. The symbol `^' inside [] complements the list.
+For example, [^i-n] denote any character in the character set except
+character 'i' to 'n'.
+The symbol `^' thus has two meanings, but this is consistent with
+egrep.
+The symbol `.' (don't care) stands for any symbol (except for the
+newline symbol).
+
+
+ Boolean operations
+
+
+Glimpse
+supports an `AND' operation denoted by the symbol `;'
+an `OR' operation denoted by the symbol `,',
+a limited version of a 'NOT' operation (starting at version 4.0B1)
+denoted by the symbol `~',
+or any combination.
+For example, pizza;cheeseburger' will output all lines containing
+both patterns.
+'{political,computer};science' will match 'political science'
+or 'science of computers'.
+
+
+Wild cards
+
+
+The symbol '#' is used to denote a sequence
+of any number (including 0)
+of arbitrary characters (see Limitations).
+The symbol # is equivalent to .* in egrep.
+In fact, .* will work too, because it is a valid regular expression
+(see below), but unless this is part of an actual regular expression,
+# will work faster.
+(Currently glimpse is experiencing some problems with #.)
+
+
+Combination of exact and approximate matching
+
+
+Any pattern inside angle brackets <> must match the text exactly even
+if the match is with errors. For example, <mathemat>ics matches
+mathematical with one error (replacing the last s with an a), but
+mathe<matics> does not match mathematical no matter how many errors are
+allowed. (This option is buggy at the moment.)
+
+
+Regular expressions
+
+
+Since the index is word based, a regular expression must match words
+that appear in the index for glimpse to find it. Glimpse first strips
+the regular expression from all non-alphabetic characters, and
+searches the index for all remaining words. It then applies the
+regular expression matching algorithm to the files found in the index.
+For example, glimpse 'abc.*xyz' will search the index for all files
+that contain both 'abc' and 'xyz', and then search directly for
+'abc.*xyz' in those files. (If you use glimpse -w 'abc.*xyz', then
+'abcxyz' will not be found, because glimpse will think that abc and
+xyz need to be matches to whole words.) The syntax of regular
+expressions in glimpse is in general the same as that for agrep. The
+union operation `|', Kleene closure `*', and parentheses () are all
+supported. Currently '+' is not supported. Regular expressions are
+currently limited to approximately 30 characters (generally excluding
+meta characters). The maximal number of errors
+for regular expressions that use '*' or '|' is 4.
+
+
+Limitations
+
+
+The index of glimpse is word based. A pattern that contains more than
+one word cannot be found in the index. The way glimpse overcomes this
+weakness is by splitting any multi-word pattern into its set of words
+and looking for all of them in the index.
+For example, 'linear programming' will first consult the index
+to find all files containing both linear and programming,
+and then apply agrep to find the combined pattern.
+This is usually an effective solution, but it can be slow for
+cases where both words are very common, but their combination is not.
+
+
+As was mentioned in the section on Patterns above, some characters
+serve as meta characters for glimpse and need to be
+preceded by '\\' to search for them. The most common
+examples are the characters '.' (which stands for a wild card),
+and '*' (the Kleene closure).
+So, "glimpse ab.de" will match abcde, but "glimpse ab\\.de"
+will not, and "glimpse ab*de" will not match ab*de, but
+"glimpse ab\\*de" will.
+The meta character - is translated automatically to a hypen
+unless it appears between [] (in which case it denotes a range of
+characters).
+
+
+There is no size limit for simple patterns and simple patterns
+within Boolean expressions.
+More complicated patterns, such as regular expressions,
+are currently limited to approximately 30 characters.
+Lines are limited to 1024 characters.
+
+
+
+
+
+
+
+ Arne Georg Gleditsch and Per Kristian Gjermshus
+
+
+
+
diff --git a/mozilla/webtools/lxr/source b/mozilla/webtools/lxr/source
index 601201f5608..17e5334dd86 100755
--- a/mozilla/webtools/lxr/source
+++ b/mozilla/webtools/lxr/source
@@ -1,5 +1,5 @@
#!/usr/bonsaitools/bin/perl
-# $Id: source,v 1.12 1999-01-21 00:42:23 endico%mozilla.org Exp $
+# $Id: source,v 1.13 1999-03-10 22:58:50 endico%mozilla.org Exp $
# source -- Present sourcecode as html, complete with references
#
# Arne Georg Gleditsch
@@ -282,6 +282,3 @@ if (!($Path->{'file'} =~ /\.(html)$/)) {
&makefooter('sourcedir');
}
}
-
-#$len = length($file);
-#print ("length is: ", $len) ;
diff --git a/mozilla/webtools/lxr/template-head b/mozilla/webtools/lxr/template-head
index 8ca9c35020b..70f940e59c5 100644
--- a/mozilla/webtools/lxr/template-head
+++ b/mozilla/webtools/lxr/template-head
@@ -12,6 +12,8 @@
 | |