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.18 by root, Tue Mar 25 01:46:36 2008 UTC vs.
Revision 1.20 by root, Sun Mar 30 00:25:11 2008 UTC

25sub P_INDENT (){ 0 } 25sub P_INDENT (){ 0 }
26sub P_LEVEL (){ 1 } 26sub P_LEVEL (){ 1 }
27sub P_MARKUP (){ 2 } 27sub P_MARKUP (){ 2 }
28sub P_INDEX (){ 3 } 28sub P_INDEX (){ 3 }
29 29
30*wiki = Storable::retrieve DC::find_rcfile "docwiki.pst"; 30our %wiki;
31
32sub load_docwiki {
33 *wiki = Storable::retrieve $_[0];
34}
31 35
32sub goto_document($) { 36sub goto_document($) {
33 $goto_document->(split /\//, $_[0]); 37 $goto_document->(split /\//, $_[0]);
34} 38}
35 39
38 42
39 return 1 unless @path; 43 return 1 unless @path;
40 44
41 my $kw = lc pop @path; 45 my $kw = lc pop @path;
42 46
43 $node = $node->{parent} 47 $node = $node->[N_PARENT]
44 or return 0; 48 or return 0;
45 49
46 return scalar grep $_ eq $kw, @{ $node->{kw} }; 50 return scalar grep $_ eq $kw, @{ $node->[N_KW] };
47} 51}
48 52
49sub find(@) { 53sub find(@) {
50 my (@path) = @_; 54 my (@path) = @_;
51 55
65 my ($node) = @_; 69 my ($node) = @_;
66 70
67 my @path; 71 my @path;
68 72
69 # skip toplevel hierarchy pod/, because its not a document 73 # skip toplevel hierarchy pod/, because its not a document
70 while ($node->{parent}) { 74 while ($node->[N_PARENT]) {
71 unshift @path, $node; 75 unshift @path, $node;
72 $node = $node->{parent}; 76 $node = $node->[N_PARENT];
73 } 77 }
74 78
75 @path 79 @path
76} 80}
77 81
78sub full_path($) { 82sub full_path($) {
79 join "/", map $_->{kw}[0], &full_path_of 83 join "/", map $_->[N_KW][0], &full_path_of
80} 84}
81 85
82sub section_of($) { 86sub section_of($) {
83 my ($node) = @_; 87 my ($node) = @_;
84 88
85 my $doc = $node->{doc}; 89 my $doc = $node->[N_DOC];
86 my $par = $node->{par}; 90 my $par = $node->[N_PAR];
87 my $lvl = $node->{level}; 91 my $lvl = $node->[N_LEVEL];
88 92
89 my @res; 93 my @res;
90 94
91 do { 95 do {
92 my $p = $doc->[$par]; 96 my $p = $doc->[$par];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines