Description

These functions operate on contract event endpoint file descriptors obtained from the
contract(4) file system and event object handles returned by ct_event_read() and ct_event_read_critical().

The ct_event_read() function reads the next event from the queue referenced by
the file descriptor fd and initializes the event object handle pointed to
by evthndlp. After a successful call to ct_event_read(), the caller is responsible for
calling ct_event_free() on this event object handle when it has finished using
it.

The ct_event_read_critical() function behaves like ct_event_read() except that it reads the next
critical event from the queue, skipping any intermediate events.

The ct_event_reset() function resets the location of the listener to the beginning
of the queue. This function can be used to re-read events, or
read events that were sent before the event endpoint was opened. Informative
and acknowledged critical events, however, might have been removed from the queue.

The ct_event_reliable() function indicates that no event published to the specified event
queue should be dropped by the system until the specified listener has
read the event. This function requires that the caller have the {PRIV_CONTRACT_EVENT}
privilege in its effective set.

The ct_event_free() function frees any storage associated with the event object handle
specified by evthndl.

The ct_event_get_ctid() function returns the ID of the contract that sent the
specified event.

The ct_event_get_evid() function returns the ID of the specified event.

The event has been acknowledged (for critical and negotiation messages).

CTE_NEG

The message represents an exit negotiation.

The ct_event_get_type() function reads the event type. The value is one of
the event types described in contract(4) or the contract type's manual page.

The ct_event_get_nevid() function reads the negotiation ID from an CT_EV_NEGEND event.

The ct_event_get_newct() function obtains the ID of the contract created when the
negotiation referenced by the CT_EV_NEGEND event succeeded. If no contract was created,
ctidp will be 0. If the operation was cancelled, *ctidp will
equal the ID of the existing contract.