1<!-- Creator : groff version 1.22.3 --> 2<!-- CreationDate: Mon Aug 28 07:57:52 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_raise_event</title> 17<link rel="stylesheet" href="./common.css"> 18</head> 19<body> 20<div class="main"> 21<h1 align="center">mtcp_raise_event</h1> 22<!-- 23<a href="#NAME">NAME</a><br> 24<a href="#SYNOPSIS">SYNOPSIS</a><br> 25<a href="#DESCRIPTION">DESCRIPTION</a><br> 26<a href="#RETURN VALUE">RETURN VALUE</a><br> 27<a href="#AUTHORS">AUTHORS</a><br> 28<a href="#SEE ALSO">SEE ALSO</a><br> 29<a href="#COLOPHON">COLOPHON</a><br> 30 31<hr> 32--> 33 34<h2>NAME 35<a name="NAME"></a> 36</h2> 37 38 39 40<p style="margin-left:11%; margin-top: 1em">mtcp_raise_event 41− raise a child event for a multi-event filter</p> 42 43<h2>SYNOPSIS 44<a name="SYNOPSIS"></a> 45</h2> 46 47 48<p style="margin-left:11%; margin-top: 1em"><b>#include 49<mos_api.h></b></p> 50 51<p style="margin-left:11%; margin-top: 1em"><b>int 52mtcp_raise_event(mctx_t</b> <i>mctx</i><b>, event_t</b> 53<i>child_event</i><b>);</b></p> 54 55<h2>DESCRIPTION 56<a name="DESCRIPTION"></a> 57</h2> 58 59 60 61<p style="margin-left:11%; margin-top: 1em"><b>mtcp_raise_event</b>() 62raises a child event <i>child_event</i> , in turn, the 63callback functions and the filter functions registered to 64the child event will be triggered.</p> 65 66<p style="margin-left:11%; margin-top: 1em">The 67<i>child_event</i> should be a event that is allocated via 68<b>mtcp_alloc_event ()</b> or user-defined events which is 69created via <b>mtcp_define_event ()</b> are triggered 70automatically by mOS core based on its condition, and those 71events are not allowed to be triggered by 72<b>mtcp_alloc_event ()</b></p> 73 74<p style="margin-left:11%; margin-top: 1em">This function 75is designed to be called inside event-filter functions, so 76that a single filter can trigger a set of multiple child 77events based on the processing result inside the filter 78function.</p> 79 80<p style="margin-left:11%; margin-top: 1em">For example, a 81filter function can be a string-pattern matching function 82that finds for multiple possible patterns. According to the 83pattern-matching result, it can trigger multiple child 84events that corresponds to each pattern. In this case, 85<b>mtcp_raise_event</b>() can be called multiple times 86inside the filter function for each pattern found in the 87given string.</p> 88 89<h2>RETURN VALUE 90<a name="RETURN VALUE"></a> 91</h2> 92 93 94<p style="margin-left:11%; margin-top: 1em">Returns 0 on 95success. When the given <i>child_event</i> parameter points 96to any event that is undefined or invalid (not the one 97created via <b>mtcp_alloc_event()</b> ), it fails and 98returns -1.</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 <[email protected]></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_alloc_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