line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package HTML::WebMake::WMLinkGlossary; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
########################################################################### |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
46
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
21
|
|
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
7
|
use HTML::WebMake::Main; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
19
|
|
13
|
1
|
|
|
1
|
|
90
|
use HTML::WebMake::SiteCache; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
19
|
|
14
|
1
|
|
|
1
|
|
728
|
use Text::EtText::LinkGlossary; |
|
1
|
|
|
|
|
381
|
|
|
1
|
|
|
|
|
24
|
|
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
|
|
518
|
use vars qw{ |
17
|
|
|
|
|
|
|
@ISA |
18
|
1
|
|
|
1
|
|
5
|
}; |
|
1
|
|
|
|
|
2
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
@ISA = qw(Exporter Text::EtText::LinkGlossary); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
########################################################################### |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub new ($$$) { |
26
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
27
|
0
|
|
0
|
|
|
|
$class = ref($class) || $class; |
28
|
0
|
|
|
|
|
|
my ($main, $cache) = @_; |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
my $self = { |
31
|
|
|
|
|
|
|
'main' => $main, |
32
|
|
|
|
|
|
|
'cache' => $cache, |
33
|
|
|
|
|
|
|
}; |
34
|
0
|
|
|
|
|
|
bless ($self, $class); |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
$self; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
0
|
0
|
|
sub dbg { HTML::WebMake::Main::dbg (@_); } |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# ------------------------------------------------------------------------- |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub open { |
44
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
45
|
|
|
|
|
|
|
# already open, ignored |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub close { |
49
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
50
|
|
|
|
|
|
|
# ignored for this implementation |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
# ------------------------------------------------------------------------- |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub get_link { |
56
|
0
|
|
|
0
|
1
|
|
my ($self, $name) = @_; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
# is it a $(url_ref)? |
59
|
0
|
0
|
|
|
|
|
if ($name =~ /^\$\(.*\)$/) { return $name; } |
|
0
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
61
|
0
|
|
|
|
|
|
$self->{db}{'L#'.$name}; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub put_link { |
65
|
0
|
|
|
0
|
1
|
|
my ($self, $name, $url) = @_; |
66
|
0
|
|
|
|
|
|
$self->{db}{'L#'.$name} = $url; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
# ------------------------------------------------------------------------- |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub get_auto_link { |
72
|
0
|
|
|
0
|
1
|
|
my ($self, $name) = @_; |
73
|
0
|
|
|
|
|
|
$self->{db}{'A#'.$name}; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub put_auto_link { |
77
|
0
|
|
|
0
|
1
|
|
my ($self, $name, $url) = @_; |
78
|
0
|
|
|
|
|
|
$self->{db}{'A#'.$name} = $url; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
# ------------------------------------------------------------------------- |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub get_auto_link_keys { |
84
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
85
|
0
|
|
|
|
|
|
local ($_); |
86
|
|
|
|
|
|
|
|
87
|
0
|
|
|
|
|
|
$_ = $self->{db}{'LinkKeys'}; |
88
|
0
|
0
|
|
|
|
|
if (defined $_) { return split (/#/); } |
|
0
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
# no keys entry there -- better create one. |
91
|
|
|
|
|
|
|
# This is a migration process, so should only happen once per |
92
|
|
|
|
|
|
|
# cache file. |
93
|
0
|
|
|
|
|
|
my @keys = (); |
94
|
0
|
|
|
|
|
|
foreach (keys %{$self->{db}}) { |
|
0
|
|
|
|
|
|
|
95
|
0
|
0
|
|
|
|
|
next unless (/^A\#(.+)$/); |
96
|
0
|
|
|
|
|
|
push (@keys, $1); |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
|
99
|
0
|
|
|
|
|
|
@keys; |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
# ------------------------------------------------------------------------- |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
sub add_auto_link_keys { |
105
|
0
|
|
|
0
|
1
|
|
my ($self, @newkeys) = @_; |
106
|
0
|
|
|
|
|
|
my @keys = $self->get_auto_link_keys(); |
107
|
|
|
|
|
|
|
|
108
|
0
|
|
|
|
|
|
my %key_uniq = (); |
109
|
0
|
|
|
|
|
|
foreach my $key (@keys, @newkeys) { $key_uniq{$key} = 1; } |
|
0
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
|
111
|
0
|
|
|
|
|
|
$self->{db}{'LinkKeys'} = join ('#', keys %key_uniq); |
112
|
|
|
|
|
|
|
} |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
# ------------------------------------------------------------------------- |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
1; |