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

Comparing deliantra/server/server/cfperl.xs (file contents):
Revision 1.84 by root, Fri Dec 15 19:59:20 2006 UTC vs.
Revision 1.85 by root, Sat Dec 16 03:08:26 2006 UTC

1060 1060
1061///////////////////////////////////////////////////////////////////////////// 1061/////////////////////////////////////////////////////////////////////////////
1062 1062
1063struct EventAPI *watcher_base::GEventAPI; 1063struct EventAPI *watcher_base::GEventAPI;
1064 1064
1065static void iw_dispatch (pe_event *ev)
1066{
1067 iw *w = (iw *)ev->ext_data;
1068 w->call (*w);
1069}
1070
1071void
1072iw::alloc ()
1073{
1074 pe = GEventAPI->new_idle (0, 0);
1075
1076 pe->base.callback = (void *)iw_dispatch;
1077 pe->base.ext_data = (void *)this;
1078}
1079
1065static void iow_dispatch (pe_event *ev) 1080static void iow_dispatch (pe_event *ev)
1066{ 1081{
1067 iow *w = (iow *)ev->ext_data; 1082 iow *w = (iow *)ev->ext_data;
1068 w->call (*w, ((pe_ioevent *)ev)->got); 1083 w->call (*w, ((pe_ioevent *)ev)->got);
1069} 1084}
1078 1093
1079 pe->fd = -1; 1094 pe->fd = -1;
1080 pe->poll = 0; 1095 pe->poll = 0;
1081} 1096}
1082 1097
1083iow & 1098void
1084iow::fd (int fd) 1099iow::fd (int fd)
1085{ 1100{
1086 pe->fd = fd; 1101 pe->fd = fd;
1087
1088 return *this;
1089} 1102}
1090 1103
1091int 1104int
1092iow::poll () 1105iow::poll ()
1093{ 1106{
1094 return pe->poll; 1107 return pe->poll;
1095} 1108}
1096 1109
1097iow & 1110void
1098iow::poll (int events) 1111iow::poll (int events)
1099{ 1112{
1100 if (pe->poll != events) 1113 if (pe->poll != events)
1101 { 1114 {
1102 if (pe->poll) stop (); 1115 if (pe->poll) stop ();
1103 pe->poll = events; 1116 pe->poll = events;
1104 if (pe->poll) start (); 1117 if (pe->poll) start ();
1105 } 1118 }
1106
1107 return *this;
1108} 1119}
1109 1120
1110MODULE = cf PACKAGE = cf PREFIX = cf_ 1121MODULE = cf PACKAGE = cf PREFIX = cf_
1111 1122
1112BOOT: 1123BOOT:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines