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

Comparing libev/ev.html (file contents):
Revision 1.69 by root, Fri Dec 7 20:19:16 2007 UTC vs.
Revision 1.70 by root, Sat Dec 8 14:27:39 2007 UTC

4<head> 4<head>
5 <title>libev</title> 5 <title>libev</title>
6 <meta name="description" content="Pod documentation for libev" /> 6 <meta name="description" content="Pod documentation for libev" />
7 <meta name="inputfile" content="&lt;standard input&gt;" /> 7 <meta name="inputfile" content="&lt;standard input&gt;" />
8 <meta name="outputfile" content="&lt;standard output&gt;" /> 8 <meta name="outputfile" content="&lt;standard output&gt;" />
9 <meta name="created" content="Fri Dec 7 21:19:14 2007" /> 9 <meta name="created" content="Sat Dec 8 15:27:35 2007" />
10 <meta name="generator" content="Pod::Xhtml 1.57" /> 10 <meta name="generator" content="Pod::Xhtml 1.57" />
11<link rel="stylesheet" href="http://res.tst.eu/pod.css"/></head> 11<link rel="stylesheet" href="http://res.tst.eu/pod.css"/></head>
12<body> 12<body>
13<div class="pod"> 13<div class="pod">
14<!-- INDEX START --> 14<!-- INDEX START -->
769 <dt>bool ev_is_pending (ev_TYPE *watcher)</dt> 769 <dt>bool ev_is_pending (ev_TYPE *watcher)</dt>
770 <dd> 770 <dd>
771 <p>Returns a true value iff the watcher is pending, (i.e. it has outstanding 771 <p>Returns a true value iff the watcher is pending, (i.e. it has outstanding
772events but its callback has not yet been invoked). As long as a watcher 772events but its callback has not yet been invoked). As long as a watcher
773is pending (but not active) you must not call an init function on it (but 773is pending (but not active) you must not call an init function on it (but
774<code>ev_TYPE_set</code> is safe) and you must make sure the watcher is available to 774<code>ev_TYPE_set</code> is safe), you must not change its priority, and you must
775libev (e.g. you cnanot <code>free ()</code> it).</p> 775make sure the watcher is available to libev (e.g. you cannot <code>free ()</code>
776it).</p>
776 </dd> 777 </dd>
777 <dt>callback ev_cb (ev_TYPE *watcher)</dt> 778 <dt>callback ev_cb (ev_TYPE *watcher)</dt>
778 <dd> 779 <dd>
779 <p>Returns the callback currently set on the watcher.</p> 780 <p>Returns the callback currently set on the watcher.</p>
780 </dd> 781 </dd>
795invocation after new events have been received. This is useful, for 796invocation after new events have been received. This is useful, for
796example, to reduce latency after idling, or more often, to bind two 797example, to reduce latency after idling, or more often, to bind two
797watchers on the same event and make sure one is called first.</p> 798watchers on the same event and make sure one is called first.</p>
798 <p>If you need to suppress invocation when higher priority events are pending 799 <p>If you need to suppress invocation when higher priority events are pending
799you need to look at <code>ev_idle</code> watchers, which provide this functionality.</p> 800you need to look at <code>ev_idle</code> watchers, which provide this functionality.</p>
801 <p>You <i>must not</i> change the priority of a watcher as long as it is active or
802pending.</p>
800 <p>The default priority used by watchers when no priority has been set is 803 <p>The default priority used by watchers when no priority has been set is
801always <code>0</code>, which is supposed to not be too high and not be too low :).</p> 804always <code>0</code>, which is supposed to not be too high and not be too low :).</p>
802 <p>Setting a priority outside the range of <code>EV_MINPRI</code> to <code>EV_MAXPRI</code> is 805 <p>Setting a priority outside the range of <code>EV_MINPRI</code> to <code>EV_MAXPRI</code> is
803fine, as long as you do not mind that the priority value you query might 806fine, as long as you do not mind that the priority value you query might
804or might not have been adjusted to be within valid range.</p> 807or might not have been adjusted to be within valid range.</p>
808 </dd>
809 <dt>ev_invoke (loop, ev_TYPE *watcher, int revents)</dt>
810 <dd>
811 <p>Invoke the <code>watcher</code> with the given <code>loop</code> and <code>revents</code>. Neither
812<code>loop</code> nor <code>revents</code> need to be valid as long as the watcher callback
813can deal with that fact.</p>
814 </dd>
815 <dt>int ev_clear_pending (loop, ev_TYPE *watcher)</dt>
816 <dd>
817 <p>If the watcher is pending, this function returns clears its pending status
818and returns its <code>revents</code> bitset (as if its callback was invoked). If the
819watcher isn't pending it does nothing and returns <code>0</code>.</p>
805 </dd> 820 </dd>
806</dl> 821</dl>
807 822
808 823
809 824
1806 ev::io iow; 1821 ev::io iow;
1807 iow.set &lt;myclass, &amp;myclass::io_cb&gt; (&amp;obj); 1822 iow.set &lt;myclass, &amp;myclass::io_cb&gt; (&amp;obj);
1808 1823
1809</pre> 1824</pre>
1810 </dd> 1825 </dd>
1811 <dt>w-&gt;set (void (*function)(watcher &amp;w, int), void *data = 0)</dt> 1826 <dt>w-&gt;set&lt;function&gt; (void *data = 0)</dt>
1812 <dd> 1827 <dd>
1813 <p>Also sets a callback, but uses a static method or plain function as 1828 <p>Also sets a callback, but uses a static method or plain function as
1814callback. The optional <code>data</code> argument will be stored in the watcher's 1829callback. The optional <code>data</code> argument will be stored in the watcher's
1815<code>data</code> member and is free for you to use.</p> 1830<code>data</code> member and is free for you to use.</p>
1831 <p>The prototype of the <code>function</code> must be <code>void (*)(ev::TYPE &amp;w, int)</code>.</p>
1816 <p>See the method-<code>set</code> above for more details.</p> 1832 <p>See the method-<code>set</code> above for more details.</p>
1833 <p>Example:</p>
1834<pre> static void io_cb (ev::io &amp;w, int revents) { }
1835 iow.set &lt;io_cb&gt; ();
1836
1837</pre>
1817 </dd> 1838 </dd>
1818 <dt>w-&gt;set (struct ev_loop *)</dt> 1839 <dt>w-&gt;set (struct ev_loop *)</dt>
1819 <dd> 1840 <dd>
1820 <p>Associates a different <code>struct ev_loop</code> with this watcher. You can only 1841 <p>Associates a different <code>struct ev_loop</code> with this watcher. You can only
1821do this when the watcher is inactive (and not pending either).</p> 1842do this when the watcher is inactive (and not pending either).</p>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines