doc: regenerate
[xenomai-head.git] / doc / generated / html / api / event_flags_8c-example.html
blobe858c2a59ffba41e3fca2c0e2b6988fb9ea2d3a2
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5 <title>Xenomai API: event_flags.c</title>
6 <link href="tabs.css" rel="stylesheet" type="text/css"/>
7 <link href="doxygen.css" rel="stylesheet" type="text/css"/>
8 </head>
9 <body>
10 <!-- Generated by Doxygen 1.7.1 -->
11 <div class="navigation" id="top">
12 <div class="tabs">
13 <ul class="tablist">
14 <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
15 <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
16 <li><a href="modules.html"><span>Modules</span></a></li>
17 <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
18 <li><a href="files.html"><span>Files</span></a></li>
19 <li><a href="examples.html"><span>Examples</span></a></li>
20 </ul>
21 </div>
22 </div>
23 <div class="header">
24 <div class="headertitle">
25 <h1>event_flags.c</h1> </div>
26 </div>
27 <div class="contents">
28 <div class="fragment"><pre class="fragment"><span class="preprocessor">#include &lt;<a class="code" href="event_8h.html" title="This file is part of the Xenomai project.">native/event.h</a>&gt;</span>
30 <span class="preprocessor">#define EVENT_INIT 0x0 </span><span class="comment">/* No flags present at init */</span>
31 <span class="preprocessor">#define EVENT_MODE EV_PRIO </span><span class="comment">/* Tasks will wait by priority order */</span>
32 <span class="preprocessor">#define EVENT_WAIT_MASK (0x1|0x2|0x4) </span><span class="comment">/* List of monitored events */</span>
33 <span class="preprocessor">#define EVENT_SIGNAL_MASK (0x2) </span><span class="comment">/* List of events to send */</span>
35 RT_EVENT ev_desc;
37 <span class="keywordtype">void</span> foo (<span class="keywordtype">void</span>)
40 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> mask_ret;
41 <span class="keywordtype">int</span> err;
43 <span class="comment">/* Create an event flag; we could also have attempted to bind to</span>
44 <span class="comment"> some pre-existing object, using rt_event_bind() instead of</span>
45 <span class="comment"> creating it. */</span>
47 err = <a name="a0"></a><a class="code" href="group__event.html#ga8b0fbb2b816c62081afe86bf897c503c" title="Create an event group.">rt_event_create</a>(&amp;ev_desc,
48 <span class="stringliteral">&quot;MyEventFlagGroup&quot;</span>,
49 EVENT_INIT,
50 EVENT_MODE);
52 <span class="comment">/* Now, wait for some task to post some event flags... */</span>
54 err = <a name="a1"></a><a class="code" href="group__event.html#ga6e9f775275661d9258f8b1eb02fe4681" title="Pend on an event group.">rt_event_wait</a>(&amp;ev_desc,
55 EVENT_WAIT_MASK,
56 &amp;mask_ret,
57 EV_ANY, <span class="comment">/* Disjunctive wait */</span>
58 TM_INFINITE);
59 <span class="comment">/* ... */</span>
62 <span class="keywordtype">void</span> bar (<span class="keywordtype">void</span>)
65 <span class="comment">/* ... */</span>
67 <span class="comment">/* Post some events. */</span>
69 <a name="a2"></a><a class="code" href="group__event.html#gafda4c544f2429005c4b15de3a7ffc902" title="Post an event group.">rt_event_signal</a>(&amp;ev_desc,EVENT_SIGNAL_MASK);
71 <span class="comment">/* ... */</span>
74 <span class="keywordtype">void</span> cleanup (<span class="keywordtype">void</span>)
77 <a name="a3"></a><a class="code" href="group__event.html#gabccfea1cd018493ef5a28c6fe8e90d7c" title="Delete an event group.">rt_event_delete</a>(&amp;ev_desc);
79 </pre></div> </div>
80 </div>
81 <hr class="footer"/><address class="footer"><small>Generated on Wed Nov 2 2011 18:01:06 for Xenomai API by&nbsp;
82 <a href="http://www.doxygen.org/index.html">
83 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address>
84 </body>
85 </html>