Lines Matching defs:handler
32 #include "message-handler.h"
67 /* Message handler functions */
69 /* Register message handler for the specified object. object_path must be a unique name starting with "/". */
71 struct pa_message_handler *handler;
81 handler = pa_xnew0(struct pa_message_handler, 1);
82 handler->userdata = userdata;
83 handler->callback = cb;
84 handler->object_path = pa_xstrdup(object_path);
85 handler->description = pa_xstrdup(description);
87 pa_assert_se(pa_hashmap_put(c->message_handlers, handler->object_path, handler) == 0);
90 /* Unregister a message handler */
92 struct pa_message_handler *handler;
97 pa_assert_se(handler = pa_hashmap_remove(c->message_handlers, object_path));
99 pa_xfree(handler->object_path);
100 pa_xfree(handler->description);
101 pa_xfree(handler);
106 struct pa_message_handler *handler;
124 if (!(handler = pa_hashmap_get(c->message_handlers, path_copy))) {
156 /* The handler is expected to return an error code and may also
158 ret = handler->callback(handler->object_path, message, parameters, response, handler->userdata);
165 /* Set handler description */
167 struct pa_message_handler *handler;
172 if (!(handler = pa_hashmap_get(c->message_handlers, object_path)))
175 pa_xfree(handler->description);
176 handler->description = pa_xstrdup(description);