1<!-- Creator     : groff version 1.22.3 -->
2<!-- CreationDate: Mon Aug 28 07:57:51 2017 -->
3<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
4"http://www.w3.org/TR/html4/loose.dtd">
5<html>
6<head>
7<meta name="generator" content="groff -Thtml, see www.gnu.org">
8<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
9<meta name="Content-Style" content="text/css">
10<style type="text/css">
11       p       { margin-top: 0; margin-bottom: 0; vertical-align: top }
12       pre     { margin-top: 0; margin-bottom: 0; vertical-align: top }
13       table   { margin-top: 0; margin-bottom: 0; vertical-align: top }
14       h1      { text-align: center }
15</style>
16<title>mtcp_alloc_event</title>
17<link rel="stylesheet" href="./common.css">
18</head>
19<body>
20<div class="main">
21<h1 align="center">mtcp_alloc_event</h1>
22
23<!--
24<a href="#NAME">NAME</a><br>
25<a href="#SYNOPSIS">SYNOPSIS</a><br>
26<a href="#DESCRIPTION">DESCRIPTION</a><br>
27<a href="#RETURN VALUE">RETURN VALUE</a><br>
28<a href="#ERRORS">ERRORS</a><br>
29<a href="#AUTHORS">AUTHORS</a><br>
30<a href="#SEE ALSO">SEE ALSO</a><br>
31<a href="#COLOPHON">COLOPHON</a><br>
32
33<hr>
34-->
35
36<h2>NAME
37<a name="NAME"></a>
38</h2>
39
40
41
42<p style="margin-left:11%; margin-top: 1em">mtcp_alloc_event
43&minus; define a follow-up event for a filter that can
44trigger multiple (child) events</p>
45
46<h2>SYNOPSIS
47<a name="SYNOPSIS"></a>
48</h2>
49
50
51<p style="margin-left:11%; margin-top: 1em"><b>#include
52&lt;mos_api.h&gt;</b></p>
53
54<p style="margin-left:11%; margin-top: 1em"><b>event_t
55mtcp_alloc_event(event_t</b>
56<i>parent_event</i><b>);</b></p>
57
58<h2>DESCRIPTION
59<a name="DESCRIPTION"></a>
60</h2>
61
62
63
64<p style="margin-left:11%; margin-top: 1em"><b>mtcp_alloc_event</b>()
65allocates a new child event that can be triggered by a
66filter. On success, it returns a child event that can be
67triggered inside the filter functions registered on
68<i>parent_event</i></p>
69
70<p style="margin-left:11%; margin-top: 1em">This function
71allows a single filter to trigger a set of multiple child
72events based on the processing result inside the filter
73function. More specifically, a user can call this function
74to pre-allocate a child user-defined event when initializing
75mOS events, providing its parent event <i>parent_event</i>
76registered to the parent event are triggered. The filter
77function, based on its result, can trigger the child event
78created with <b>mtcp_alloc_event ()</b> using the
79<b>mtcp_raise_event ()</b> function.</p>
80
81<h2>RETURN VALUE
82<a name="RETURN VALUE"></a>
83</h2>
84
85
86<p style="margin-left:11%; margin-top: 1em">Returns
87<i>event_t</i> on success; <i>MOS_NULL_EVENT on
88failure.</i></p>
89
90<h2>ERRORS
91<a name="ERRORS"></a>
92</h2>
93
94
95<p style="margin-left:11%; margin-top: 1em">This function
96returns <i>MOS_NULL_EVENT</i> when the
97given <i>parent_event</i> is not defined or cannot allocate
98more <i>event_t</i> structure.</p>
99
100<h2>AUTHORS
101<a name="AUTHORS"></a>
102</h2>
103
104
105<p style="margin-left:11%; margin-top: 1em">mOS development
106team &lt;[email protected]&gt;</p>
107
108<h2>SEE ALSO
109<a name="SEE ALSO"></a>
110</h2>
111
112
113
114<p style="margin-left:11%; margin-top: 1em"><b>mtcp_raise_event</b>(),
115<b>mtcp_define_event</b>()</p>
116
117<h2>COLOPHON
118<a name="COLOPHON"></a>
119</h2>
120
121
122<p style="margin-left:11%; margin-top: 1em">This page is
123part of mOS release 0.3 <i>docs</i> section. A description
124of the project, and information about reporting bugs, can be
125found at http://mos.kaist.edu/.</p>
126<hr>
127<div class="footer">
128  <img src="back-arrow.jpg" width="2%" height="2%"><a href="http://mos.kaist.edu/index_man.html">Back to Index</a>
129</div>
130</div>
131</body>
132</html>
133