*** empty log message ***

master
Marc Alexander Lehmann 15 years ago
parent 4270c68683
commit ac88d08d07

@ -4,6 +4,7 @@ WISH? monotonic clocks times/GetTickCount for coarse corrections?
3.44
- new function: ev_now_update (loop).
- verify_watcher was not marked static.
- improve the "associating..." manpage section.
3.43 Sun Jul 6 05:34:41 CEST 2008
- include more include files on windows to get struct _stati64

@ -1008,7 +1008,11 @@ data:
int otherfd;
void *somedata;
struct whatever *mostinteresting;
}
};
...
struct my_io w;
ev_io_init (&w.io, my_cb, fd, EV_READ);
And since your callback will be called with a pointer to the watcher, you
can cast it back to your own type:
@ -1022,8 +1026,8 @@ can cast it back to your own type:
More interesting and less C-conformant ways of casting your callback type
instead have been omitted.
Another common scenario is having some data structure with multiple
watchers:
Another common scenario is to use some data structure with multiple
embedded watchers:
struct my_biggy
{
@ -1032,8 +1036,10 @@ watchers:
ev_timer t2;
}
In this case getting the pointer to C<my_biggy> is a bit more complicated,
you need to use C<offsetof>:
In this case getting the pointer to C<my_biggy> is a bit more
complicated: Either you store the address of your C<my_biggy> struct
in the C<data> member of the watcher, or you need to use some pointer
arithmetic using C<offsetof> inside your watchers:
#include <stddef.h>

Loading…
Cancel
Save