ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/cfperl.h
(Generate patch)

Comparing deliantra/server/include/cfperl.h (file contents):
Revision 1.36 by root, Thu Dec 14 20:39:54 2006 UTC vs.
Revision 1.39 by root, Sat Dec 16 21:40:26 2006 UTC

24#undef readdir 24#undef readdir
25#undef getprotobyname 25#undef getprotobyname
26#undef gethostbyname 26#undef gethostbyname
27#undef ctime 27#undef ctime
28#undef strerror 28#undef strerror
29
30// same here, massive symbol spamming
31#undef do_open
32#undef do_close
29 33
30// perl bug #40256: perl does overwrite those with reentrant versions 34// perl bug #40256: perl does overwrite those with reentrant versions
31// but does not initialise their state structures. 35// but does not initialise their state structures.
32#undef random 36#undef random
33#undef crypt 37#undef crypt
64#define ARG_MAP(o) DT_MAP , (void *)static_cast<maptile *> (o) 68#define ARG_MAP(o) DT_MAP , (void *)static_cast<maptile *> (o)
65#define ARG_PLAYER(o) DT_PLAYER, (void *)static_cast<player *> (o) 69#define ARG_PLAYER(o) DT_PLAYER, (void *)static_cast<player *> (o)
66#define ARG_ARCH(o) DT_ARCH , (void *)static_cast<archetype *> (o) 70#define ARG_ARCH(o) DT_ARCH , (void *)static_cast<archetype *> (o)
67#define ARG_PARTY(o) DT_PARTY , (void *)static_cast<party *> (o) 71#define ARG_PARTY(o) DT_PARTY , (void *)static_cast<party *> (o)
68#define ARG_REGION(o) DT_REGION, (void *)static_cast<region *> (o) 72#define ARG_REGION(o) DT_REGION, (void *)static_cast<region *> (o)
69#define ARG_SOCKET(o) DT_SOCKET, (void *)static_cast<client_socket *> (o) 73#define ARG_SOCKET(o) DT_SOCKET, (void *)static_cast<client *> (o)
70 74
71// the ", ## __VA_ARGS" is, unfortunately, a gnu-cpp extension 75// the ", ## __VA_ARGS" is, unfortunately, a gnu-cpp extension
72 76
73// all these return true when the normal event processing should be skipped (if any) 77// all these return true when the normal event processing should be skipped (if any)
74#define INVOKE_(event, ...) cfperl_invoke (event, ## __VA_ARGS__, DT_END) 78#define INVOKE_(event, ...) cfperl_invoke (event, ## __VA_ARGS__, DT_END)
355 359
356private: 360private:
357 void cancel () { GEventAPI->cancel ((pe_watcher *)pe); } // private 361 void cancel () { GEventAPI->cancel ((pe_watcher *)pe); } // private
358}; 362};
359 363
364struct iw : watcher<pe_idle>, callback<void (iw &)>
365{
366 template<class O, class M>
367 iw (O object, M method)
368 : callback<void (iw &)> (object, method)
369 {
370 alloc ();
371 }
372
373private:
374 void alloc ();
375};
376
360struct iow : watcher<pe_io>, callback<void (iow &, int)> 377struct iow : watcher<pe_io>, callback<void (iow &, int)>
361{ 378{
362 template<class O, class M> 379 template<class O, class M>
363 iow (O object, M method) 380 iow (O object, M method)
364 : callback<void (iow &, int)> (object, method) 381 : callback<void (iow &, int)> (object, method)
365 { 382 {
366 alloc (); 383 alloc ();
367 } 384 }
368 385
369 iow &fd (int fd); 386 void fd (int fd);
370 int poll (); 387 int poll ();
371 iow &poll (int events); 388 void poll (int events);
372 389
373private: 390private:
374 void alloc (); 391 void alloc ();
375}; 392};
376 393

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines