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

Comparing libev/ev.pod (file contents):
Revision 1.91 by root, Thu Dec 20 07:12:57 2007 UTC vs.
Revision 1.92 by root, Fri Dec 21 01:26:04 2007 UTC

53The newest version of this document is also available as a html-formatted 53The newest version of this document is also available as a html-formatted
54web page you might find easier to navigate when reading it for the first 54web page you might find easier to navigate when reading it for the first
55time: L<http://cvs.schmorp.de/libev/ev.html>. 55time: L<http://cvs.schmorp.de/libev/ev.html>.
56 56
57Libev is an event loop: you register interest in certain events (such as a 57Libev is an event loop: you register interest in certain events (such as a
58file descriptor being readable or a timeout occuring), and it will manage 58file descriptor being readable or a timeout occurring), and it will manage
59these event sources and provide your program with events. 59these event sources and provide your program with events.
60 60
61To do this, it must take more or less complete control over your process 61To do this, it must take more or less complete control over your process
62(or thread) by executing the I<event loop> handler, and will then 62(or thread) by executing the I<event loop> handler, and will then
63communicate events via a callback mechanism. 63communicate events via a callback mechanism.
469 469
470Returns the current "event loop time", which is the time the event loop 470Returns the current "event loop time", which is the time the event loop
471received events and started processing them. This timestamp does not 471received events and started processing them. This timestamp does not
472change as long as callbacks are being processed, and this is also the base 472change as long as callbacks are being processed, and this is also the base
473time used for relative timers. You can treat it as the timestamp of the 473time used for relative timers. You can treat it as the timestamp of the
474event occuring (or more correctly, libev finding out about it). 474event occurring (or more correctly, libev finding out about it).
475 475
476=item ev_loop (loop, int flags) 476=item ev_loop (loop, int flags)
477 477
478Finally, this is it, the event handler. This function usually is called 478Finally, this is it, the event handler. This function usually is called
479after you initialised all your watchers and you want to start handling 479after you initialised all your watchers and you want to start handling
2240 2240
2241If defined to be C<1>, libev will try to detect the availability of the 2241If defined to be C<1>, libev will try to detect the availability of the
2242monotonic clock option at both compiletime and runtime. Otherwise no use 2242monotonic clock option at both compiletime and runtime. Otherwise no use
2243of the monotonic clock option will be attempted. If you enable this, you 2243of the monotonic clock option will be attempted. If you enable this, you
2244usually have to link against librt or something similar. Enabling it when 2244usually have to link against librt or something similar. Enabling it when
2245the functionality isn't available is safe, though, althoguh you have 2245the functionality isn't available is safe, though, although you have
2246to make sure you link against any libraries where the C<clock_gettime> 2246to make sure you link against any libraries where the C<clock_gettime>
2247function is hiding in (often F<-lrt>). 2247function is hiding in (often F<-lrt>).
2248 2248
2249=item EV_USE_REALTIME 2249=item EV_USE_REALTIME
2250 2250
2440 2440
2441=item ev_set_cb (ev, cb) 2441=item ev_set_cb (ev, cb)
2442 2442
2443Can be used to change the callback member declaration in each watcher, 2443Can be used to change the callback member declaration in each watcher,
2444and the way callbacks are invoked and set. Must expand to a struct member 2444and the way callbacks are invoked and set. Must expand to a struct member
2445definition and a statement, respectively. See the F<ev.v> header file for 2445definition and a statement, respectively. See the F<ev.c> header file for
2446their default definitions. One possible use for overriding these is to 2446their default definitions. One possible use for overriding these is to
2447avoid the C<struct ev_loop *> as first argument in all cases, or to use 2447avoid the C<struct ev_loop *> as first argument in all cases, or to use
2448method calls instead of plain function calls in C++. 2448method calls instead of plain function calls in C++.
2449 2449
2450=head2 EXPORTED API SYMBOLS 2450=head2 EXPORTED API SYMBOLS
2458 2458
2459This can also be used to rename all public symbols to avoid clashes with 2459This can also be used to rename all public symbols to avoid clashes with
2460multiple versions of libev linked together (which is obviously bad in 2460multiple versions of libev linked together (which is obviously bad in
2461itself, but sometimes it is inconvinient to avoid this). 2461itself, but sometimes it is inconvinient to avoid this).
2462 2462
2463A sed comamnd like this will create wrapper C<#define>'s that you need to 2463A sed command like this will create wrapper C<#define>'s that you need to
2464include before including F<ev.h>: 2464include before including F<ev.h>:
2465 2465
2466 <Symbols.ev sed -e "s/.*/#define & myprefix_&/" >wrap.h 2466 <Symbols.ev sed -e "s/.*/#define & myprefix_&/" >wrap.h
2467 2467
2468This would create a file F<wrap.h> which essentially looks like this: 2468This would create a file F<wrap.h> which essentially looks like this:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines