1ptree_register_handler(3PPIICCLLTRPElEu)g-In Library Fputnrcetei_ornesgister_handler(3PICLTREE)
2
3
4

NAME

6       ptree_register_handler - register a handler for the event
7

SYNOPSIS

9       cc [ flag... ] file... -lpicltree [ library... ]
10       #include <picltree.h>
11
12       int ptree_register_handler(const char *ename,
13            void (*evt_handler)(const char *ename, const void *earg,
14            size_t size, void *cookie), void *cookie);
15
16

DESCRIPTION

18       The  ptree_register_handler() function registers an event handler for a
19       PICL event. The argument ename specifies the name of the PICL event for
20       which  to  register the handler. The argument evt_handler specifies the
21       event handler function. The argument cookie is a pointer to caller-spe‐
22       cific  data to be passed as an argument to the event handler when it is
23       invoked.
24
25
26       The event handler function must be defined as
27
28         void evt_handler(const char *ename, const void *earg, \
29                 size_t size, void *cookie)
30
31
32
33       where, ename, earg, size, and cookie are the arguments  passed  to  the
34       event  handler when it is invoked. The argument ename is the PICL event
35       name for which the handler is invoked.  The  arguments  earg  and  size
36       gives  the  pointer  to the event argument buffer and its size, respec‐
37       tively. The argument cookie is the pointer to the caller specific  data
38       registered with the handler. The arguments ename and earg point to buf‐
39       fers that are transient and shall not be modified by the event  handler
40       or reused after the event handler finishes execution.
41
42
43       The  PICL  framework  invokes  the event handlers in the order in which
44       they were registered when dispatching an event. If  the  event  handler
45       execution  order  is  required to be the same as the plug-in dependency
46       order, then a plug-in should register its handlers from its init  func‐
47       tion.  The handlers that do not have any ordering dependencies on other
48       plug-in handlers can be registered at any time.
49
50
51       The registered handler may be called at any time after this function is
52       called.
53

RETURN VALUES

55       Upon  successful  completion, 0 is returned. On failure, a non-negative
56       integer is returned to indicate an error and the handler is not  regis‐
57       tered.
58

ERRORS

60       PICL_INVALIDARG    Invalid argument
61
62
63       PICL_FAILURE       General system failure
64
65

ATTRIBUTES

67       See attributes(5) for descriptions of the following attributes:
68
69
70
71
72       ┌─────────────────────────────┬─────────────────────────────┐
73       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
74       ├─────────────────────────────┼─────────────────────────────┤
75       │Interface Stability          │Evolving                     │
76       ├─────────────────────────────┼─────────────────────────────┤
77       │MT-Level                     │MT-Safe                      │
78       └─────────────────────────────┴─────────────────────────────┘
79

SEE ALSO

81       ptree_unregister_handler(3PICLTREE), attributes(5)
82
83
84
85SunOS 5.11                        1 Aug 2000 ptree_register_handler(3PICLTREE)
Impressum