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

Comparing deliantra/Deliantra-Client/DC.pm (file contents):
Revision 1.141 by root, Fri Apr 6 21:53:56 2007 UTC vs.
Revision 1.154 by root, Sun Oct 14 20:08:38 2007 UTC

15package CFPlus; 15package CFPlus;
16 16
17use Carp (); 17use Carp ();
18 18
19BEGIN { 19BEGIN {
20 $VERSION = '0.97'; 20 $VERSION = '0.993';
21 21
22 use XSLoader; 22 use XSLoader;
23 XSLoader::load "CFPlus", $VERSION; 23 XSLoader::load "CFPlus", $VERSION;
24} 24}
25 25
28use AnyEvent (); 28use AnyEvent ();
29use Pod::POM (); 29use Pod::POM ();
30use File::Path (); 30use File::Path ();
31use Storable (); # finally 31use Storable (); # finally
32use Fcntl (); 32use Fcntl ();
33 33use JSON::XS qw(to_json from_json);
34BEGIN {
35 use Crossfire::Protocol::Base ();
36 *to_json = \&Crossfire::Protocol::Base::to_json;
37 *from_json = \&Crossfire::Protocol::Base::from_json;
38}
39 34
40=item guard { BLOCK } 35=item guard { BLOCK }
41 36
42Returns an object that executes the given block as soon as it is destroyed. 37Returns an object that executes the given block as soon as it is destroyed.
43 38
230} 225}
231 226
232sub fh_nonblocking($$) { 227sub fh_nonblocking($$) {
233 my ($fh, $nb) = @_; 228 my ($fh, $nb) = @_;
234 229
235 if ($^O =~ /Win32/) { 230 if ($^O eq "MSWin32") {
236 $nb = ! ! $nb; 231 $nb = (! ! $nb) + 0;
237 ioctl $fh, 0x8004667e, $nb; # FIONBIO 232 ioctl $fh, 0x8004667e, \$nb; # FIONBIO
238 } else { 233 } else {
239 fcntl $fh, &Fcntl::F_SETFL, $nb ? &Fcntl::O_NONBLOCK : 0; 234 fcntl $fh, &Fcntl::F_SETFL, $nb ? &Fcntl::O_NONBLOCK : 0;
240 } 235 }
241 236
242} 237}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines