[asterisk-commits] russell: branch russell/chan_refcount r82331 - /team/russell/chan_refcount/main/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Sep 13 12:47:28 CDT 2007
Author: russell
Date: Thu Sep 13 12:47:28 2007
New Revision: 82331
URL: http://svn.digium.com/view/asterisk?view=rev&rev=82331
Log:
rename some variables since I didn't end up having to put this in channel.h
Modified:
team/russell/chan_refcount/main/channel.c
Modified: team/russell/chan_refcount/main/channel.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/main/channel.c?view=diff&rev=82331&r1=82330&r2=82331
==============================================================================
--- team/russell/chan_refcount/main/channel.c (original)
+++ team/russell/chan_refcount/main/channel.c Thu Sep 13 12:47:28 2007
@@ -1140,21 +1140,21 @@
#endif
struct ast_channel_iterator {
- struct ao2_iterator _i;
- const char *_name;
- size_t _name_len;
- const char *_exten;
- const char *_context;
+ struct ao2_iterator i;
+ const char *name;
+ size_t name_len;
+ const char *exten;
+ const char *context;
};
struct ast_channel_iterator *ast_channel_iterator_destroy(struct ast_channel_iterator *i)
{
- if (i->_name)
- ast_free((void *) i->_name);
- if (i->_exten)
- ast_free((void *) i->_exten);
- if (i->_context)
- ast_free((void *) i->_context);
+ if (i->name)
+ ast_free((void *) i->name);
+ if (i->exten)
+ ast_free((void *) i->exten);
+ if (i->context)
+ ast_free((void *) i->context);
ast_free(i);
return NULL;
@@ -1168,26 +1168,26 @@
if (!(i = ast_calloc(1, sizeof(*i))))
return NULL;
- if (!ast_strlen_zero(exten) && !(i->_exten = ast_strdup(exten)))
+ if (!ast_strlen_zero(exten) && !(i->exten = ast_strdup(exten)))
goto return_error;
- if (!ast_strlen_zero(context) && !(i->_context = ast_strdup(context)))
+ if (!ast_strlen_zero(context) && !(i->context = ast_strdup(context)))
goto return_error;
- if (!ast_strlen_zero(name) && !(i->_name = ast_strdup(name)))
+ if (!ast_strlen_zero(name) && !(i->name = ast_strdup(name)))
goto return_error;
- i->_name_len = name_len;
-
- i->_i = ao2_iterator_init(channels, 0);
+ i->name_len = name_len;
+
+ i->i = ao2_iterator_init(channels, 0);
return i;
return_error:
- if (i->_exten)
- ast_free((void *) i->_exten);
- if (i->_context)
- ast_free((void *) i->_context);
+ if (i->exten)
+ ast_free((void *) i->exten);
+ if (i->context)
+ ast_free((void *) i->context);
ast_free(i);
return NULL;
@@ -1214,17 +1214,17 @@
{
struct ast_channel *chan = NULL;
- for (; (chan = ao2_iterator_next(&i->_i)); ast_channel_unref(chan)) {
- if (i->_name) { /* match by name */
- if ((!i->_name_len && strcasecmp(chan->name, i->_name)) ||
- (i->_name_len && strncasecmp(chan->name, i->_name, i->_name_len)))
+ for (; (chan = ao2_iterator_next(&i->i)); ast_channel_unref(chan)) {
+ if (i->name) { /* match by name */
+ if ((!i->name_len && strcasecmp(chan->name, i->name)) ||
+ (i->name_len && strncasecmp(chan->name, i->name, i->name_len)))
continue; /* name match failed */
- } else if (i->_exten) {
- if (i->_context && strcasecmp(chan->context, i->_context) &&
- strcasecmp(chan->macrocontext, i->_context))
+ } else if (i->exten) {
+ if (i->context && strcasecmp(chan->context, i->context) &&
+ strcasecmp(chan->macrocontext, i->context))
continue; /* context match failed */
- if (strcasecmp(chan->exten, i->_exten) &&
- strcasecmp(chan->macroexten, i->_exten))
+ if (strcasecmp(chan->exten, i->exten) &&
+ strcasecmp(chan->macroexten, i->exten))
continue; /* exten match failed */
}
break; /* chan points to the next chan desired. */
More information about the asterisk-commits
mailing list