From aed58001e429ec9f669fdf78c9aa0a1e73713ac5 Mon Sep 17 00:00:00 2001 From: Dan Egnor <egnor@ofb.net> Date: Fri, 18 Jul 2003 14:49:52 +0000 Subject: [PATCH] Add oop_sys_run_once() --- oop_sys.html | 3 ++- oop_sys_run.html | 18 ++++++++++++------ ref.html | 1 + 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/oop_sys.html b/oop_sys.html index c9ea483..d17bebe 100644 --- a/oop_sys.html +++ b/oop_sys.html @@ -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> diff --git a/oop_sys_run.html b/oop_sys_run.html index b2a986d..b7c1311 100644 --- a/oop_sys_run.html +++ b/oop_sys_run.html @@ -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 <oop.h> /* <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> diff --git a/ref.html b/ref.html index 50bf9f5..c9bb42b 100644 --- a/ref.html +++ b/ref.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 *); -- GitLab