PICL Plug-In Library Functions ptreeregisterhandler(3PICLTRE)
NAME
ptreeregisterhandler - register a handler for the event
SYNOPSIS
cc [ flag... ] file... -lpicltree [ library... ]
#include
int ptreeregisterhandler(const char *ename,
void (*evthandler)(const char *ename, const void *earg,
sizet size, void *cookie), void *cookie);
DESCRIPTION
The ptreeregisterhandler() function registers an event
handler for a PICL event. The argument ename specifies the
name of the PICL event for which to register the handler.
The argument evthandler specifies the event handler func-
tion. The argument cookie is a pointer to caller-specific
data to be passed as an argument to the event handler when
it is invoked.
The event handler function must be defined as
void evthandler(const char *ename, const void *earg, \
sizet size, void *cookie)
where, ename, earg, size, and cookie are the arguments
passed to the event handler when it is invoked. The argument
ename is the PICL event name for which the handler is
invoked. The arguments earg and size gives the pointer to
the event argument buffer and its size, respectively. The
argument cookie is the pointer to the caller specific data
registered with the handler. The arguments ename and earg
point to buffers that are transient and shall not be modi-
fied by the event handler or reused after the event handler
finishes execution.
The PICL framework invokes the event handlers in the order
in which they were registered when dispatching an event. If
the event handler execution order is required to be the same
as the plug-in dependency order, then a plug-in should
register its handlers from its init function. The handlers
that do not have any ordering dependencies on other plug-in
handlers can be registered at any time.
The registered handler may be called at any time after this
function is called.
SunOS 5.11 Last change: 1 Aug 2000 1
PICL Plug-In Library Functions ptreeregisterhandler(3PICLTRE)
RETURN VALUES
Upon successful completion, 0 is returned. On failure, a
non-negative integer is returned to indicate an error and
the handler is not registered.
ERORS
PICLINVALIDARG Invalid argument
PICLFAILURE General system failure
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Evolving
MT-Level MT-Safe
SEE ALSO
ptreeunregisterhandler(3PICLTRE), attributes(5)
SunOS 5.11 Last change: 1 Aug 2000 2
|