ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev.pod
(Generate patch)

Comparing libev/ev.pod (file contents):
Revision 1.299 by sf-exg, Sat Aug 28 21:42:12 2010 UTC vs.
Revision 1.301 by root, Fri Sep 10 05:38:38 2010 UTC

2123Example: Call a callback every hour, or, more precisely, whenever the 2123Example: Call a callback every hour, or, more precisely, whenever the
2124system time is divisible by 3600. The callback invocation times have 2124system time is divisible by 3600. The callback invocation times have
2125potentially a lot of jitter, but good long-term stability. 2125potentially a lot of jitter, but good long-term stability.
2126 2126
2127 static void 2127 static void
2128 clock_cb (struct ev_loop *loop, ev_io *w, int revents) 2128 clock_cb (struct ev_loop *loop, ev_periodic *w, int revents)
2129 { 2129 {
2130 ... its now a full hour (UTC, or TAI or whatever your clock follows) 2130 ... its now a full hour (UTC, or TAI or whatever your clock follows)
2131 } 2131 }
2132 2132
2133 ev_periodic hourly_tick; 2133 ev_periodic hourly_tick;
4042will be C<0>. 4042will be C<0>.
4043 4043
4044=item EV_COMMON 4044=item EV_COMMON
4045 4045
4046By default, all watchers have a C<void *data> member. By redefining 4046By default, all watchers have a C<void *data> member. By redefining
4047this macro to a something else you can include more and other types of 4047this macro to something else you can include more and other types of
4048members. You have to define it each time you include one of the files, 4048members. You have to define it each time you include one of the files,
4049though, and it must be identical each time. 4049though, and it must be identical each time.
4050 4050
4051For example, the perl EV module uses something like this: 4051For example, the perl EV module uses something like this:
4052 4052
4351maintainable. 4351maintainable.
4352 4352
4353And of course, some compiler warnings are just plain stupid, or simply 4353And of course, some compiler warnings are just plain stupid, or simply
4354wrong (because they don't actually warn about the condition their message 4354wrong (because they don't actually warn about the condition their message
4355seems to warn about). For example, certain older gcc versions had some 4355seems to warn about). For example, certain older gcc versions had some
4356warnings that resulted an extreme number of false positives. These have 4356warnings that resulted in an extreme number of false positives. These have
4357been fixed, but some people still insist on making code warn-free with 4357been fixed, but some people still insist on making code warn-free with
4358such buggy versions. 4358such buggy versions.
4359 4359
4360While libev is written to generate as few warnings as possible, 4360While libev is written to generate as few warnings as possible,
4361"warn-free" code is not a goal, and it is recommended not to build libev 4361"warn-free" code is not a goal, and it is recommended not to build libev

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines