From 9648e258c76a24c5a24e16c634fcda73829e5d30 Mon Sep 17 00:00:00 2001 From: "David M. Lee" Date: Wed, 15 May 2013 02:37:22 +0000 Subject: Refactored the rest of the message types to use the STASIS_MESSAGE_TYPE_* macros. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388751 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/stasis.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'main/stasis.c') diff --git a/main/stasis.c b/main/stasis.c index 3388a8042..98dff95a6 100644 --- a/main/stasis.c +++ b/main/stasis.c @@ -47,7 +47,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") /*! Threadpool for dispatching notifications to subscribers */ static struct ast_threadpool *pool; -static struct stasis_message_type *__subscription_change_message_type; +STASIS_MESSAGE_TYPE_DEFN(stasis_subscription_change_type); /*! \internal */ struct stasis_topic { @@ -438,11 +438,6 @@ static struct stasis_subscription_change *subscription_change_alloc(struct stasi return change; } -struct stasis_message_type *stasis_subscription_change_type(void) -{ - return __subscription_change_message_type; -} - static void send_subscription_change_message(struct stasis_topic *topic, char *uniqueid, char *description) { RAII_VAR(struct stasis_subscription_change *, change, NULL, ao2_cleanup); @@ -556,10 +551,9 @@ struct stasis_topic *stasis_topic_pool_get_topic(struct stasis_topic_pool *pool, /*! \brief Cleanup function */ static void stasis_exit(void) { - ao2_cleanup(__subscription_change_message_type); - __subscription_change_message_type = NULL; ast_threadpool_shutdown(pool); pool = NULL; + STASIS_MESSAGE_TYPE_CLEANUP(stasis_subscription_change_type); } int stasis_init(void) @@ -593,8 +587,7 @@ int stasis_init(void) return -1; } - __subscription_change_message_type = stasis_message_type_create("stasis_subscription_change"); - if (!__subscription_change_message_type) { + if (STASIS_MESSAGE_TYPE_INIT(stasis_subscription_change_type) != 0) { return -1; } -- cgit v1.2.3