ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/Pod.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC/Pod.pm (file contents):
Revision 1.17 by root, Wed Dec 26 21:03:21 2007 UTC vs.
Revision 1.18 by root, Tue Mar 25 01:46:36 2008 UTC

11our %wiki; 11our %wiki;
12 12
13my $MA_BEG = "\x{fcd0}"; 13my $MA_BEG = "\x{fcd0}";
14my $MA_SEP = "\x{fcd1}"; 14my $MA_SEP = "\x{fcd1}";
15my $MA_END = "\x{fcd2}"; 15my $MA_END = "\x{fcd2}";
16
17# nodes (order must stay as it is)
18sub N_PARENT (){ 0 }
19sub N_PAR (){ 1 }
20sub N_LEVEL (){ 2 }
21sub N_KW (){ 3 }
22sub N_DOC (){ 4 }
23
24# paragraphs (order must stay as it is)
25sub P_INDENT (){ 0 }
26sub P_LEVEL (){ 1 }
27sub P_MARKUP (){ 2 }
28sub P_INDEX (){ 3 }
16 29
17*wiki = Storable::retrieve DC::find_rcfile "docwiki.pst"; 30*wiki = Storable::retrieve DC::find_rcfile "docwiki.pst";
18 31
19sub goto_document($) { 32sub goto_document($) {
20 $goto_document->(split /\//, $_[0]); 33 $goto_document->(split /\//, $_[0]);
28 my $kw = lc pop @path; 41 my $kw = lc pop @path;
29 42
30 $node = $node->{parent} 43 $node = $node->{parent}
31 or return 0; 44 or return 0;
32 45
33 return ! ! grep $_ eq $kw, @{ $node->{kw} }; 46 return scalar grep $_ eq $kw, @{ $node->{kw} };
34} 47}
35 48
36sub find(@) { 49sub find(@) {
37 my (@path) = @_; 50 my (@path) = @_;
38 51
76 my @res; 89 my @res;
77 90
78 do { 91 do {
79 my $p = $doc->[$par]; 92 my $p = $doc->[$par];
80 93
81 if (length $p->{markup}) { 94 if (length $p->[P_MARKUP]) {
82 push @res, { 95 push @res, {
83 markup => $p->{markup}, 96 markup => $p->[P_MARKUP],
84 indent => $p->{indent}, 97 indent => $p->[P_INDENT],
85 }; 98 };
86 } 99 }
87 } while $doc->[++$par]{level} > $lvl; 100 } while $doc->[++$par][P_LEVEL] > $lvl;
88 101
89 @res 102 @res
90} 103}
91 104
92sub section(@) { 105sub section(@) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines