ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/lib/cf/pod.pm
(Generate patch)

Comparing deliantra/server/lib/cf/pod.pm (file contents):
Revision 1.2 by root, Wed Apr 18 12:43:54 2007 UTC vs.
Revision 1.4 by root, Wed Apr 18 15:28:18 2007 UTC

1package cf::pod; 1package cf::pod;
2
3use Pod::POM;
2 4
3our $indent; 5our $indent;
4our $level; 6our $level;
5our @result; 7our @result;
6 8
146 148
147############################################################################# 149#############################################################################
148 150
149package cf::pod; 151package cf::pod;
150 152
151sub as_paragraphs($) { 153sub pom_as_paragraphs($) {
152 my ($pom) = @_; 154 my ($pom) = @_;
153 155
154 # we suckers use global variables, unfortunately. 156 # we suckers use global variables, unfortunately.
155 my $guard = cf::lock_acquire "cf::pod::as_paragraphs"; 157 my $guard = cf::lock_acquire "cf::pod::as_paragraphs";
156 158
161 $pom->present ("cf::pod::AsParagraphs"); 163 $pom->present ("cf::pod::AsParagraphs");
162 164
163 [grep $_->{index} || exists $_->{markup}, @result] 165 [grep $_->{index} || exists $_->{markup}, @result]
164} 166}
165 167
168sub load_pod($) {
169 my ($path) = @_;
170
171 Coro::Storable::thaw cf::cache "cf::pod::as_paragraphs/$path" => [$path],
172 1 => sub {
173 my ($src) = @_;
174 fork_exec {
175 my $pod = $src->[0];
176 utf8::decode $pod;
177 Coro::Storable::freeze pom_as_paragraphs Pod::POM->new->parse_text ($pod)
178 }
179 };
180}
181
1661; 1821;
167 183

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines