NAME
          irEventMonitor - establish/destroy an event monitor.

     SYNOPSIS
          #include <irapi.h>

          int irEventMonitor (ir_event_monitor_t *description);


     DESCRIPTION
          Function irEventMonitor allows an application to monitor any
          events on any channel for any queue key.  irEventMonitor
          takes as an argument description defined as

          typedef struct {
              int *channels;
              ir_qkey_t *qkeys;
              int *events;
          } ir_event_monitor_t;


          Where channels is an array of channels to be monitored ter-
          minated with IRD_INVALID.  If channels is the NULL pointer,
          all channels are monitored.  If channels is an array of size
          one with IRD_INVALID as its only member, no channels are
          monitored.  qkeys is an array of process registration qkeys
          and events is an array of IRAPI event values.  The behavior
          for array termination and NULL pointers is the same as that
          described for channels.

          channels, qkeys and events are logically ANDed when events
          are considered for monitoring.  That is, to monitor event id
          X on channel Y for process Z; X, Y and Z must appear in
          arrays pointed to by events, channels and qkeys respectively
          (or the array pointers may be NULL).

          Calling irEventMonitor with description set to NULL will
          turn off all event monitoring for the process.

          The global parameter IRP_MAX_EVENT_MONITOR limits the number
          of processes monitoring events system wide.

     EVENT
          The event IRE_EVENT_MONITOR is generated when a matching
          event is generated.  event_mod1 contains the original event
          channel number.  event_mod2 contains the original event qkey
          value.  event_mod3 contains the time the original event was
          copied to the monitoring process.  event_text points to an
          ir_event_t structure containing the original event data.

     RETURN VALUE
          irEventMonitor returns IRR_OK on success and IRR_FAIL on
          error.

     ERRORS
          On error irError is set as follows:

          IRER_INVALID if description contains any invalid values for
          channel, qkey or event_id.

          IRER_OVERFLOW if the system is unable to accommodate any
          additional event monitors.

          IRER_SYSERROR on system call failure.  Check irSysError for
          additional information.

     SEE ALSO
          IrEVENTS(4IRAPI), IrERRORS(4IRAPI)

     VERSION
          This is version 11/25/02 of this man page.