File: oop_sys_run.html

package info (click to toggle)
liboop 1.0-8
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 1,664 kB
  • ctags: 492
  • sloc: sh: 7,970; ansic: 2,512; makefile: 136
file content (45 lines) | stat: -rw-r--r-- 1,719 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html><head>
<title>liboop: oop_sys_run()</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head><body>

<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>
<dl>
<dt><b>oop_source_sys *sys</b>
<dd>The event source to operate.
</dl>

<h3>Description.</h3>

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 
"owner" of the event loop (the caller of oop_sys_run).  You may then decide 
whether to restart the event loop (by calling oop_sys_run again) or not.<p>

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.html">liboop reference</a></body></html>