mtcp_alloc_event

NAME

mtcp_alloc_event − define a follow-up event for a filter that can trigger multiple (child) events

SYNOPSIS

#include <mos_api.h>

event_t mtcp_alloc_event(event_t parent_event);

DESCRIPTION

mtcp_alloc_event() allocates a new child event that can be triggered by a filter. On success, it returns a child event that can be triggered inside the filter functions registered on parent_event

This function allows a single filter to trigger a set of multiple child events based on the processing result inside the filter function. More specifically, a user can call this function to pre-allocate a child user-defined event when initializing mOS events, providing its parent event parent_event registered to the parent event are triggered. The filter function, based on its result, can trigger the child event created with mtcp_alloc_event () using the mtcp_raise_event () function.

RETURN VALUE

Returns event_t on success; MOS_NULL_EVENT on failure.

ERRORS

This function returns MOS_NULL_EVENT when the given parent_event is not defined or cannot allocate more event_t structure.

AUTHORS

mOS development team <mtcp-user@list.ndsl.kaist.edu>

SEE ALSO

mtcp_raise_event(), mtcp_define_event()

COLOPHON

This page is part of mOS release 0.3 docs section. A description of the project, and information about reporting bugs, can be found at http://mos.kaist.edu/.