version 1.171, 2001/11/17 15:36:06
|
version 1.172, 2001/11/17 18:20:33
|
Line 35
|
Line 35
|
# 8/4,8/7,8/8,8/9,8/11,8/16,8/17,8/18,8/20,8/23,9/20,9/21,9/26, |
# 8/4,8/7,8/8,8/9,8/11,8/16,8/17,8/18,8/20,8/23,9/20,9/21,9/26, |
# 10/2 Gerd Kortemeyer |
# 10/2 Gerd Kortemeyer |
# 10/5,10/10,11/13,11/15 Scott Harrison |
# 10/5,10/10,11/13,11/15 Scott Harrison |
|
# 11/17 Gerd Kortemeyer |
# |
# |
# $Id$ |
# $Id$ |
# |
# |
# 11/17 Gerd Kortemeyer |
|
# |
|
### |
### |
|
|
# Functions for use by content handlers: |
# Functions for use by content handlers: |
Line 2239 sub metadata {
|
Line 2238 sub metadata {
|
$uri=&declutter($uri); |
$uri=&declutter($uri); |
my $filename=$uri; |
my $filename=$uri; |
$uri=~s/\.meta$//; |
$uri=~s/\.meta$//; |
|
# |
|
# Is the metadata already cached? |
|
# If "keys" are set, the assumption is that everything is already cached. |
|
# Everything is cached by the main uri, libraries are never directly cached |
|
# |
unless ($metacache{$uri.':keys'}) { |
unless ($metacache{$uri.':keys'}) { |
|
# |
|
# Is this a recursive call for a library? |
|
# |
if ($liburi) { |
if ($liburi) { |
$liburi=&declutter($liburi); |
$liburi=&declutter($liburi); |
$filename=$liburi; |
$filename=$liburi; |
Line 2253 sub metadata {
|
Line 2260 sub metadata {
|
while ($token=$parser->get_token) { |
while ($token=$parser->get_token) { |
if ($token->[0] eq 'S') { |
if ($token->[0] eq 'S') { |
if (defined($token->[2]->{'package'})) { |
if (defined($token->[2]->{'package'})) { |
|
# |
|
# This is a package - get package info |
|
# |
my $package=$token->[2]->{'package'}; |
my $package=$token->[2]->{'package'}; |
my $keyroot=''; |
my $keyroot=''; |
if (defined($token->[2]->{'part'})) { |
if ($prefix) { |
$keyroot.='_'.$token->[2]->{'part'}; |
$keyroot.='_'.$prefix; |
|
} else { |
|
if (defined($token->[2]->{'part'})) { |
|
$keyroot.='_'.$token->[2]->{'part'}; |
|
} |
} |
} |
if (defined($token->[2]->{'id'})) { |
if (defined($token->[2]->{'id'})) { |
$keyroot.='_'.$token->[2]->{'id'}; |
$keyroot.='_'.$token->[2]->{'id'}; |
Line 2285 sub metadata {
|
Line 2299 sub metadata {
|
} |
} |
} keys %packagetab; |
} keys %packagetab; |
} else { |
} else { |
my $entry=$token->[1]; |
# |
|
# This is not a package - some other kind of start tag |
|
# |
|
my $entry=$token->[1]; |
|
if ($entry eq 'import') { |
|
# |
|
# Importing a library here |
|
# |
|
my $libid=$token->[2]->{'id'}; |
|
|
|
|
|
} else { |
my $unikey=$entry; |
my $unikey=$entry; |
if (defined($token->[2]->{'part'})) { |
if ($prefix) { |
$unikey.='_'.$token->[2]->{'part'}; |
$unikey.='_'.$prefix; |
|
} else { |
|
if (defined($token->[2]->{'part'})) { |
|
$unikey.='_'.$token->[2]->{'part'}; |
|
} |
} |
} |
if (defined($token->[2]->{'id'})) { |
if (defined($token->[2]->{'id'})) { |
$unikey.='_'.$token->[2]->{'id'}; |
$unikey.='_'.$token->[2]->{'id'}; |
Line 2305 sub metadata {
|
Line 2334 sub metadata {
|
) { $metacache{$uri.':'.$unikey}= |
) { $metacache{$uri.':'.$unikey}= |
$metacache{$uri.':'.$unikey.'.default'}; |
$metacache{$uri.':'.$unikey.'.default'}; |
} |
} |
} |
# end of not-a-package not-a-library import |
|
} |
|
# end of not-a-package start tag |
|
} |
|
# the next is the end of "start tag" |
} |
} |
} |
} |
$metacache{$uri.':keys'}=join(',',keys %metathesekeys); |
$metacache{$uri.':keys'}=join(',',keys %metathesekeys); |