ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Glib-EV/EV.xs
(Generate patch)

Comparing Glib-EV/EV.xs (file contents):
Revision 1.2 by root, Sat Dec 8 02:58:27 2007 UTC vs.
Revision 1.3 by root, Thu Dec 20 07:23:50 2007 UTC

15} 15}
16 16
17static void 17static void
18timeout_cb (EV_P_ ev_timer *w, int revents) 18timeout_cb (EV_P_ ev_timer *w, int revents)
19{ 19{
20 ev_unloop (EV_A_ EVUNLOOP_ONE); 20 ev_unloop (EV_A, EVUNLOOP_ONE);
21} 21}
22 22
23typedef struct 23typedef struct
24{ 24{
25 struct ev_io io; 25 struct ev_io io;
38 | (revents & EV_READ ? G_IO_OUT : 0)); 38 | (revents & EV_READ ? G_IO_OUT : 0));
39 39
40 if (!oev && s->pfd->revents) 40 if (!oev && s->pfd->revents)
41 ++*(s->got_events); 41 ++*(s->got_events);
42 42
43 ev_unloop (EV_A_ EVUNLOOP_ONE); 43 ev_unloop (EV_A, EVUNLOOP_ONE);
44} 44}
45 45
46static gint 46static gint
47event_poll_func (GPollFD *fds, guint nfds, gint timeout) 47event_poll_func (GPollFD *fds, guint nfds, gint timeout)
48{ 48{
70 io_cb, 70 io_cb,
71 pfd->fd, 71 pfd->fd,
72 (pfd->events & G_IO_IN ? EV_READ : 0) 72 (pfd->events & G_IO_IN ? EV_READ : 0)
73 | (pfd->events & G_IO_OUT ? EV_WRITE : 0) 73 | (pfd->events & G_IO_OUT ? EV_WRITE : 0)
74 ); 74 );
75 ev_io_start (EV_A_ &s->io); 75 ev_io_start (EV_DEFAULT, &s->io);
76 } 76 }
77 77
78 if (timeout >= 0) 78 if (timeout >= 0)
79 { 79 {
80 ev_timer_init (&to, timeout_cb, timeout * 1e-3, 0.); 80 ev_timer_init (&to, timeout_cb, timeout * 1e-3, 0.);
81 ev_timer_start (EV_A_ &to); 81 ev_timer_start (EV_DEFAULT, &to);
82 } 82 }
83 83
84 ev_loop (EV_A_ 0); 84 ev_loop (EV_DEFAULT, 0);
85 85
86 if (timeout >= 0) 86 if (timeout >= 0)
87 ev_timer_stop (EV_A_ &to); 87 ev_timer_stop (EV_DEFAULT, &to);
88 88
89 for (n = 0; n < nfds; ++n) 89 for (n = 0; n < nfds; ++n)
90 ev_io_stop (EV_A_ &slots[n].io); 90 ev_io_stop (EV_DEFAULT, &slots[n].io);
91 91
92 return got_events; 92 return got_events;
93} 93}
94 94
95MODULE = Glib::EV PACKAGE = Glib::EV 95MODULE = Glib::EV PACKAGE = Glib::EV

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines