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

Comparing deliantra/Deliantra-Client/DC/DB.pm (file contents):
Revision 1.4 by root, Fri Apr 6 23:00:52 2007 UTC vs.
Revision 1.5 by root, Mon Apr 16 20:35:29 2007 UTC

17use strict; 17use strict;
18use utf8; 18use utf8;
19 19
20use Carp (); 20use Carp ();
21use AnyEvent (); 21use AnyEvent ();
22use Storable (); # finally 22use Storable ();
23 23
24use CFPlus; 24use CFPlus;
25 25
26sub sync { 26sub sync {
27 # for debugging 27 # for debugging
179} 179}
180 180
181sub do_get { 181sub do_get {
182 my ($db, $key) = @_; 182 my ($db, $key) = @_;
183 183
184 utf8::downgrade $key;
184 my $data; 185 my $data;
185 (table $db)->db_get ($key, $data) == 0 186 (table $db)->db_get ($key, $data) == 0
186 ? $data 187 ? $data
187 : () 188 : ()
188} 189}
189 190
190sub do_put { 191sub do_put {
191 my ($db, $key, $data) = @_; 192 my ($db, $key, $data) = @_;
192 193
194 utf8::downgrade $key;
195 utf8::downgrade $data;
193 (table $db)->db_put ($key => $data) 196 (table $db)->db_put ($key => $data)
194} 197}
195 198
196sub do_table { 199sub do_table {
197 my ($db) = @_; 200 my ($db) = @_;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines