ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/EV/EV/MakeMaker.pm
(Generate patch)

Comparing EV/EV/MakeMaker.pm (file contents):
Revision 1.2 by root, Thu Dec 20 08:18:54 2007 UTC vs.
Revision 1.3 by root, Mon Apr 7 13:24:40 2008 UTC

69 69
70=head2 API 70=head2 API
71 71
72See the EVAPI.h header. 72See the EVAPI.h header.
73 73
74In short, all the functions and macros from F<ev.h> should work, except
75that the trailing underscore macros (C<EV_A_>, C<EV_DEFAULT_>) are not
76available (except C<EV_P_> :).
77
78Multiplicity is enabled.
79
80The C<data> member in each watcher is of type C<SV *> and not C<void *>
81(this might change at some point).
82
83=head2 EXAMPLE
84
85The L<EV::Glib>, L<EV::ADNS> and L<Glib::EV> all give nice examples on how
86to use this module.
87
88Here are some F<.xs> fragments taken from EV::ADNS that should get you
89going:
90
91#include "EVAPI.h"
92
93 static ev_prepare pw;
94 static ev_idle iw;
95
96 static void
97 idle_cb (EV_P_ ev_idle *w, int revents)
98 {
99 ev_idle_stop (EV_A, w);
100 }
101
102 MODULE = ...
103
104 BOOT:
105 {
106 I_EV_API ("EV::ADNS");
107 ev_prepare_init (&pw, prepare_cb);
108 ev_init (&iw, idle_cb); ev_set_priority (&iw, EV_MINPRI);
109 ev_idle_start (EV_DEFAULT, &iw);
110 }
111
74=cut 112=cut
113

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines