op_ev_ici()
Abstract
Obtains the ICI associated with an event.
Syntax
op_ev_ici (evhandle)
| Argument | Type | Description |
|---|---|---|
evhandle |
Evhandle |
event handle that identifies the event [An event handle can be obtained from several KPs in this package—such as op_ev_current(), op_ev_seek_time(), and op_ev_next()—and others such as op_intrpt_schedule_self().]. |
Return Type
Ici*
Pointer to the ICI that is associated with the event.
The constant OPC_NIL is returned when there is no ICI associated with the event or if a recoverable error occurs.
Example
/* Obtain the ICI for the next local self intrpt */
/* if there are any. */
ici_ptr = OPC_NIL;
event = op_ev_next_local (op_ev_current ());
while (op_ev_valid (event))
{
if (op_ev_type (event) == OPC_INTRPT_SELF)
{
/* This is the first self intrpt, so */
/* get the ICI and break out of the loop. */
ici_ptr = op_ev_ici (event);
break;
}
/* It must not have been a self intrpt. */
/* Try the next one. */
event = op_ev_next_local (event);
}
Details
Events carry several types of information with them: the type of event, a code associated with the event, and optionally, an ICI. Obtaining a pointer to the ICI then allows the process to extract its contents via op_ici_attr_get().
Note: Calling op_ev_ici() does not remove an ICI; it remains installed with the event.
Purpose
Provides a mechanism for obtaining a pointer to the ICI that is associated with an event. Once the pointer is obtained, the contents of the ICI can be extracted via the KP op_ici_attr_get().
Typically this KP is applied to the current event (an Evhandle for the current event can be obtained via the KP op_ev_current()) in order to obtain information that the source process placed into the accompanying ICI when the event was generated.
Errors
- Program Abort: Segmentation violation. (due to a malformed event handle)
- Recoverable Error: Event handle refers to an event that is either invalid or not currently scheduled.
Reference
- Use the KP op_ev_valid() to determine if the Evhandle is valid
- Use the KP op_ev_type() to obtain the type of the event
- Use the KP op_ev_src_id() to obtain the source object’s ID
- Use the KP op_ev_dst_id() to obtain the destination object’s ID
- Use the KP op_ev_time() to obtain the scheduled time of the event