summaryrefslogtreecommitdiff
path: root/main/stasis.c
diff options
context:
space:
mode:
authorDavid M. Lee <dlee@digium.com>2013-05-15 02:37:22 +0000
committerDavid M. Lee <dlee@digium.com>2013-05-15 02:37:22 +0000
commit9648e258c76a24c5a24e16c634fcda73829e5d30 (patch)
treea0dc5b31ee73a83a7799413929a40436a1526293 /main/stasis.c
parente8f4ac6c610265b46014da9259062bb74d3892d1 (diff)
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
Diffstat (limited to 'main/stasis.c')
-rw-r--r--main/stasis.c13
1 files changed, 3 insertions, 10 deletions
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;
}