NPA_Register_With_EventBus
Registers to produce or consume events prior to interacting
with the Novell Event Bus.
- Thread Context:Blocking if eventFlags
MAY_NOT_SLEEP_BIT is clear or Non-Blocking
if eventFlags MAY_NOT_SLEEP_BIT is set.
Syntax
LONG NPA_Register_With_EventBus (
LONG npaHandle,
LONG eventType,
BYTE *registrationName,
BYTE *eventName,
void *userParameter,
LONG eventFlags,
LONG typeFlags,
LONG (*esr) (struct EventBlockDef *eventBlock),
LONG (*callBack) (struct EventBlockDef *eventBlock),
LONG *registrationHandle
);
Parameters
- npaHandle
- (IN) The CDM's or HAM's handle for using the NPA
APIs. Its value was assigned during NPA_Register_CDM_Module or NPA_Register_HAM_Module, respectively.
- eventType
- (IN) This defines the type of event user.
- registrationName
- (IN) Points to the name string identifying this
registration and has a maximum length of 80 characters including
the NULL terminator.
- eventName
- (IN) Points to the name string of the event. It
must match for both producer and consumer to successfully send and
receive events.
- userParameter
- (IN) Custom value to be passed to the consumer when
invoked for this event.
- eventFlags
- (IN) This flag field is used to specify whether
the event can block, which direction to call synchronous consumers,
and whether the event is consumable. These flags must match for
the producer and consumer.
- typeFlags
- See the following:
- esr
- The esr, or Event Service Routine,
receives system messages from the Novell Event Bus. Can be set to
0 if not needed. See EventBlockStruct.
- callBack
- Callback function to be called for consumers to
receive messages. Producers ignore this field.
- registrationHandle
- (OUT) Points to a handle that is returned upon successful
registration of this event. It is returned when deregistering for
this event using NPA_Unregister_With_EventBus.
Return Values
The following table lists return values and descriptions.
Remarks
NPA_Register_With_EventBus is used
to register as a producer or consumer for an event. After a producer
successfully registers, it can get event blocks and send events
using NPA_Send_Event. Consumers
can receive events.
When a producer sends an event, the consumer's esr is
called with a pointer to the event block. The consumer can consume
the event (if the consumable bit is set), which does not allow any
other consumers with the consumable bit set to be called. All other
consumers are called.