diff options
author | Richard Mudgett <rmudgett@digium.com> | 2013-04-04 18:15:34 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2013-04-04 18:15:34 +0000 |
commit | b8e5189456583455ad84b47f75d3b150ab5bda7d (patch) | |
tree | f0d34f8851893e1de4b71feee59605ff79c62b59 /main/event.c | |
parent | 6a25d49296f01b30f25b9be542558d5c4b03e15b (diff) |
Separate some event struct definitions from instantiation.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@384760 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/event.c')
-rw-r--r-- | main/event.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/main/event.c b/main/event.c index 508ebac9b..1c11626bb 100644 --- a/main/event.c +++ b/main/event.c @@ -152,10 +152,7 @@ static int ast_event_hash_presence_state_change(const void *obj, const int flags #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 @@ static struct { * 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 @@ static struct { .hash_fn = ast_event_hash_presence_state_change, .cache_args = { AST_EVENT_IE_PRESENCE_STATE, }, }, - }; /*! @@ -218,13 +219,15 @@ static const char * const event_names[AST_EVENT_TOTAL] = { [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" }, |