pep.c
changeset 34 eea355fa94cf
parent 32 9a6164bc805c
child 35 a77a8e7ab8ae
equal deleted inserted replaced
33:9151fef57135 34:eea355fa94cf
   102 static void pep_handler_free (pep_handler_t *handler)
   102 static void pep_handler_free (pep_handler_t *handler)
   103 {
   103 {
   104 	if (handler -> destroy_notify)
   104 	if (handler -> destroy_notify)
   105 		handler -> destroy_notify (handler -> data);
   105 		handler -> destroy_notify (handler -> data);
   106 	g_free (handler -> xmlns);
   106 	g_free (handler -> xmlns);
   107 	g_free (handler);
   107 	g_slice_free (pep_handler_t, handler);
   108 	return;
   108 	return;
   109 }
   109 }
   110 
   110 
   111 static LmHandlerResult pep_handler (const gchar *from, LmMessageNode *mnode)
   111 static LmHandlerResult pep_handler (const gchar *from, LmMessageNode *mnode)
   112 {
   112 {
   162 	return LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS;
   162 	return LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS;
   163 }
   163 }
   164 
   164 
   165 void pep_register_xmlns_handler (const gchar *xmlns, pep_xmlns_handler_t handler, gpointer udata, GDestroyNotify notify)
   165 void pep_register_xmlns_handler (const gchar *xmlns, pep_xmlns_handler_t handler, gpointer udata, GDestroyNotify notify)
   166 {
   166 {
   167 	pep_handler_t *h = g_new (pep_handler_t, 1);
   167 	pep_handler_t *h = g_slice_new (pep_handler_t);
   168 
   168 
   169 	h->xmlns          = g_strdup (xmlns);
   169 	h->xmlns          = g_strdup (xmlns);
   170 	h->handler        = handler;
   170 	h->handler        = handler;
   171 	h->data           = udata;
   171 	h->data           = udata;
   172 	h->destroy_notify = notify;
   172 	h->destroy_notify = notify;