Commit aed58001 authored by Dan Egnor's avatar Dan Egnor
Browse files

Add oop_sys_run_once()

parent 61924a99
......@@ -29,7 +29,8 @@ void oop_sys_delete(oop_source_sys *sys);
event source interface and manages a select() loop. Once the system event
source is created, use <a href="oop_sys_source">oop_sys_source()</a> to
access the event source interface (which lets you register event sinks), and
<a href="oop_sys_run">oop_sys_run()</a> to actually process events.
<a href="oop_sys_run">oop_sys_run()</a> or
<a href="oop_sys_run">oop_sys_run_once()</a> to actually process events.
More than one system event source can exist, though it is rarely useful to do
so (since only one may be active at a time).<p>
......
......@@ -4,13 +4,14 @@
<link rel="stylesheet" type="text/css" href="style.css">
</head><body>
<h2>oop_sys_run()</h2>
<h2>oop_sys_run(), oop_sys_run_once()</h2>
<pre>
#include &lt;oop.h&gt;
/* <em>Run the event loop.</em> */
oop_source *oop_sys_run(oop_source_sys *sys);
oop_source *oop_sys_run_once(oop_source_sys *sys);
</pre>
<h3>Arguments.</h3>
......@@ -21,11 +22,11 @@ oop_source *oop_sys_run(oop_source_sys *sys);
<h3>Description.</h3>
This function starts waiting for events registered with the system event
source <em>sys</em>. As events (file descriptor activity, timed events, and
signals) occur, the appropriate event sinks are called. As long as these
callbacks return OOP_CONTINUE, the function continues running and processing
events.<p>
The oop_sys_run() function starts waiting for events registered with the
system event source <em>sys</em>. As events (file descriptor activity, timed
events, and signals) occur, the appropriate event sinks are called. As long
as these callbacks return OOP_CONTINUE, the function continues running and
processing events.<p>
When one of the callbacks returns some other value, oop_sys_run returns this
value. You can use this technique to allow callbacks to return data to the
......@@ -36,4 +37,9 @@ If an error occurs waiting for events, oop_sys_run returns OOP_ERROR.
If no event sinks are registered (which would lead to an infinite delay),
oop_sys_run returns OOP_CONTINUE.<p>
The oop_sys_run_once() function behaves just like oop_sys_run(), but returns
immediately after processing any pending results. The return values are the
same as oop_sys_run(), except that a return of OOP_CONTINUE does not
necessarily mean that no event sinks are registered.<p>
<hr><a href="ref">liboop reference</a></body></html>
......@@ -43,6 +43,7 @@ void <a href="oop_sys">oop_sys_delete</a>(oop_source_sys *);
/* <em>Run the system event loop.</em> */
void *<a href="oop_sys_run">oop_sys_run</a>(oop_source_sys *);
void *<a href="oop_sys_run">oop_sys_run_once</a>(oop_source_sys *);
/* <em>Get the standard source interface for a system event source.</em> */
oop_source *<a href="oop_sys_source">oop_sys_source</a>(oop_source_sys *);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment