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

Comparing libev/ev.pod (file contents):
Revision 1.315 by root, Fri Oct 22 09:33:14 2010 UTC vs.
Revision 1.319 by root, Fri Oct 22 10:09:12 2010 UTC

124this argument. 124this argument.
125 125
126=head2 TIME REPRESENTATION 126=head2 TIME REPRESENTATION
127 127
128Libev represents time as a single floating point number, representing 128Libev represents time as a single floating point number, representing
129the (fractional) number of seconds since the (POSIX) epoch (in practise 129the (fractional) number of seconds since the (POSIX) epoch (in practice
130somewhere near the beginning of 1970, details are complicated, don't 130somewhere near the beginning of 1970, details are complicated, don't
131ask). This type is called C<ev_tstamp>, which is what you should use 131ask). This type is called C<ev_tstamp>, which is what you should use
132too. It usually aliases to the C<double> type in C. When you need to do 132too. It usually aliases to the C<double> type in C. When you need to do
133any calculations on it, you should treat it as some floating point value. 133any calculations on it, you should treat it as some floating point value.
134 134
165 165
166=item ev_tstamp ev_time () 166=item ev_tstamp ev_time ()
167 167
168Returns the current time as libev would use it. Please note that the 168Returns the current time as libev would use it. Please note that the
169C<ev_now> function is usually faster and also often returns the timestamp 169C<ev_now> function is usually faster and also often returns the timestamp
170you actually want to know. 170you actually want to know. Also interetsing is the combination of
171C<ev_update_now> and C<ev_now>.
171 172
172=item ev_sleep (ev_tstamp interval) 173=item ev_sleep (ev_tstamp interval)
173 174
174Sleep for the given interval: The current thread will be blocked until 175Sleep for the given interval: The current thread will be blocked until
175either it is interrupted or the given time interval has passed. Basically 176either it is interrupted or the given time interval has passed. Basically
213 assert (("sorry, no epoll, no sex", 214 assert (("sorry, no epoll, no sex",
214 ev_supported_backends () & EVBACKEND_EPOLL)); 215 ev_supported_backends () & EVBACKEND_EPOLL));
215 216
216=item unsigned int ev_recommended_backends () 217=item unsigned int ev_recommended_backends ()
217 218
218Return the set of all backends compiled into this binary of libev and also 219Return the set of all backends compiled into this binary of libev and
219recommended for this platform. This set is often smaller than the one 220also recommended for this platform, meaning it will work for most file
221descriptor types. This set is often smaller than the one returned by
220returned by C<ev_supported_backends>, as for example kqueue is broken on 222C<ev_supported_backends>, as for example kqueue is broken on most BSDs
221most BSDs and will not be auto-detected unless you explicitly request it 223and will not be auto-detected unless you explicitly request it (assuming
222(assuming you know what you are doing). This is the set of backends that 224you know what you are doing). This is the set of backends that libev will
223libev will probe for if you specify no backends explicitly. 225probe for if you specify no backends explicitly.
224 226
225=item unsigned int ev_embeddable_backends () 227=item unsigned int ev_embeddable_backends ()
226 228
227Returns the set of backends that are embeddable in other event loops. This 229Returns the set of backends that are embeddable in other event loops. This
228is the theoretical, all-platform, value. To find which backends 230value is platform-specific but can include backends not available on the
229might be supported on the current system, you would need to look at 231current system. To find which embeddable backends might be supported on
230C<ev_embeddable_backends () & ev_supported_backends ()>, likewise for 232the current system, you would need to look at C<ev_embeddable_backends ()
231recommended ones. 233& ev_supported_backends ()>, likewise for recommended ones.
232 234
233See the description of C<ev_embed> watchers for more info. 235See the description of C<ev_embed> watchers for more info.
234 236
235=item ev_set_allocator (void *(*cb)(void *ptr, long size)) [NOT REENTRANT] 237=item ev_set_allocator (void *(*cb)(void *ptr, long size)) [NOT REENTRANT]
236 238
4882 4884
4883=item application 4885=item application
4884 4886
4885In this document, an application is whatever is using libev. 4887In this document, an application is whatever is using libev.
4886 4888
4889=item backend
4890
4891The part of the code dealing with the operating system interfaces.
4892
4887=item callback 4893=item callback
4888 4894
4889The address of a function that is called when some event has been 4895The address of a function that is called when some event has been
4890detected. Callbacks are being passed the event loop, the watcher that 4896detected. Callbacks are being passed the event loop, the watcher that
4891received the event, and the actual event bitset. 4897received the event, and the actual event bitset.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines