mmr_event_arm()

Set a sigevent to deliver when a new mm-renderer event becomes available

Synopsis:

#include <mm/events.h>
int mmr_event_arm(mmr_context_t *ctxt,
                  struct sigevent const *sev)

Arguments:

ctxt
A context handle
sev
A sigevent to send; set to NULL to disarm

Library:

mmrndclient

Description:

Set a sigevent to deliver when a new mm-renderer event becomes available. This function is helpful if your program already has an event-processing loop that uses signals or pulses as notifications and you simply want to add code that processes mm-renderer events. To do this, you must first call mmr_event_arm() to request notification of the next such event. Then, in the new event-handling code, you must call mmr_event_get() to retrieve the event information.

Note:

This function is thread-safe only when using different context handles in each call. It's neither interrupt handler-safe nor signal-handler safe.

Returns:

A positive number if there's already an event waiting, 0 on success, or -1 on failure (check errno).