summaryrefslogtreecommitdiff
path: root/ev.pod
diff options
context:
space:
mode:
authorroot <root>2007-12-08 14:27:38 +0000
committerroot <root>2007-12-08 14:27:38 +0000
commit57e6fe17689de1646a53a20a46374936391db3e2 (patch)
tree8db7b035c9650fe2f4042dc5749e724fda6fca76 /ev.pod
parent480621758fe1687120978562a553920ed46e1b7e (diff)
fix c++ interface
Diffstat (limited to 'ev.pod')
-rw-r--r--ev.pod9
1 files changed, 8 insertions, 1 deletions
diff --git a/ev.pod b/ev.pod
index ef9892e..62118f1 100644
--- a/ev.pod
+++ b/ev.pod
@@ -1846,14 +1846,21 @@ Example: simple class declaration and watcher initialisation
ev::io iow;
iow.set <myclass, &myclass::io_cb> (&obj);
-=item w->set (void (*function)(watcher &w, int), void *data = 0)
+=item w->set<function> (void *data = 0)
Also sets a callback, but uses a static method or plain function as
callback. The optional C<data> argument will be stored in the watcher's
C<data> member and is free for you to use.
+The prototype of the C<function> must be C<void (*)(ev::TYPE &w, int)>.
+
See the method-C<set> above for more details.
+Example:
+
+ static void io_cb (ev::io &w, int revents) { }
+ iow.set <io_cb> ();
+
=item w->set (struct ev_loop *)
Associates a different C<struct ev_loop> with this watcher. You can only