ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cfmaps/cfmapidx
(Generate patch)

Comparing cfmaps/cfmapidx (file contents):
Revision 1.10 by elmex, Sun Feb 10 10:59:04 2008 UTC vs.
Revision 1.11 by root, Thu Oct 22 05:31:04 2009 UTC

19 19
20our $VERSION = '0.913'; 20our $VERSION = '0.913';
21 21
22use Deliantra; 22use Deliantra;
23use Deliantra::Map; 23use Deliantra::Map;
24use DB_File; 24use SDBM_File;
25 25
26sub escape_html($) { 26sub escape_html($) {
27 local $_ = shift; 27 local $_ = shift;
28 s/([<>&])/sprintf "&#%d;", ord $1/ge; 28 s/([<>&])/sprintf "&#%d;", ord $1/ge;
29 $_ 29 $_
30} 30}
31 31
32sub search { 32sub search {
33 my (@kw) = @_; 33 my (@kw) = @_;
34 34
35 tie %idx, DB_File, ".index.dat", O_RDONLY, 0, $DB_HASH 35 tie %idx, SDBM_File, ".index.dat", O_RDONLY, 0, $DB_HASH
36 or die ".index.dat: $!"; 36 or die ".index.dat: $!";
37 37
38 my $cnt; 38 my $cnt;
39 my %res; 39 my %res;
40 my @found; 40 my @found;
83} 83}
84 84
85if ($ARGV[0] eq "-a") { 85if ($ARGV[0] eq "-a") {
86 shift; 86 shift;
87 87
88 tie %idx, DB_File, ".index.dat~", O_RDWR|O_CREAT, 0644, $DB_HASH 88 tie %idx, SDBM_File, ".index.dat~", O_RDWR|O_CREAT, 0644, $DB_HASH
89 or die ".index.dat~: $!"; 89 or die ".index.dat~: $!";
90 90
91 my %idx2; 91 my %idx2;
92 92
93 for my $path (@ARGV) { 93 for my $path (@ARGV) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines