[asterisk-commits] rmudgett: trunk r384760 - /trunk/main/event.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Apr 4 13:15:37 CDT 2013


Author: rmudgett
Date: Thu Apr  4 13:15:34 2013
New Revision: 384760

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=384760
Log:
Separate some event struct definitions from instantiation.

Modified:
    trunk/main/event.c

Modified: trunk/main/event.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/event.c?view=diff&rev=384760&r1=384759&r2=384760
==============================================================================
--- trunk/main/event.c (original)
+++ trunk/main/event.c Thu Apr  4 13:15:34 2013
@@ -152,10 +152,7 @@
 
 #define MAX_CACHE_ARGS 8
 
-/*!
- * \brief Event types that are kept in the cache.
- */
-static struct {
+struct cache_events {
 	/*!
 	 * \brief Container of cached events
 	 *
@@ -174,7 +171,12 @@
 	 * will be replaced.
 	 */
 	enum ast_event_ie_type cache_args[MAX_CACHE_ARGS];
-} ast_event_cache[AST_EVENT_TOTAL] = {
+};
+
+/*!
+ * \brief Event types that are kept in the cache.
+ */
+static struct cache_events ast_event_cache[AST_EVENT_TOTAL] = {
 	[AST_EVENT_MWI] = {
 		.hash_fn = ast_event_hash_mwi,
 		.cache_args = { AST_EVENT_IE_MAILBOX, AST_EVENT_IE_CONTEXT },
@@ -191,7 +193,6 @@
 		.hash_fn = ast_event_hash_presence_state_change,
 		.cache_args = { AST_EVENT_IE_PRESENCE_STATE, },
 	},
-
 };
 
 /*!
@@ -218,13 +219,15 @@
 	[AST_EVENT_PRESENCE_STATE]      = "PresenceState",
 };
 
+struct ie_map {
+	enum ast_event_ie_pltype ie_pltype;
+	const char *name;
+};
+
 /*!
  * \brief IE payload types and names
  */
-static const struct ie_map {
-	enum ast_event_ie_pltype ie_pltype;
-	const char *name;
-} ie_maps[AST_EVENT_IE_TOTAL] = {
+static const struct ie_map ie_maps[AST_EVENT_IE_TOTAL] = {
 	[AST_EVENT_IE_NEWMSGS]             = { AST_EVENT_IE_PLTYPE_UINT, "NewMessages" },
 	[AST_EVENT_IE_OLDMSGS]             = { AST_EVENT_IE_PLTYPE_UINT, "OldMessages" },
 	[AST_EVENT_IE_MAILBOX]             = { AST_EVENT_IE_PLTYPE_STR,  "Mailbox" },




More information about the asterisk-commits mailing list