mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-15 06:18:38 +00:00
Merged revisions 190057 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r190057 | jpeeler | 2009-04-22 16:15:55 -0500 (Wed, 22 Apr 2009) | 9 lines Fix building of chan_h323 with gcc-3.3 There seems to be a bug with old versions of g++ that doesn't allow a structure member to use the name list. Rename list member to group_list in ast_group_info and change the few places it is used. (closes issue #14790) Reported by: stuarth ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@190063 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -46,7 +46,7 @@ static int group_count_function_read(struct ast_channel *chan, const char *cmd,
|
|||||||
struct ast_group_info *gi = NULL;
|
struct ast_group_info *gi = NULL;
|
||||||
|
|
||||||
ast_app_group_list_rdlock();
|
ast_app_group_list_rdlock();
|
||||||
for (gi = ast_app_group_list_head(); gi; gi = AST_LIST_NEXT(gi, list)) {
|
for (gi = ast_app_group_list_head(); gi; gi = AST_LIST_NEXT(gi, group_list)) {
|
||||||
if (gi->chan != chan)
|
if (gi->chan != chan)
|
||||||
continue;
|
continue;
|
||||||
if (ast_strlen_zero(category) || (!ast_strlen_zero(gi->category) && !strcasecmp(gi->category, category)))
|
if (ast_strlen_zero(category) || (!ast_strlen_zero(gi->category) && !strcasecmp(gi->category, category)))
|
||||||
@@ -120,7 +120,7 @@ static int group_function_read(struct ast_channel *chan, const char *cmd,
|
|||||||
|
|
||||||
ast_app_group_list_rdlock();
|
ast_app_group_list_rdlock();
|
||||||
|
|
||||||
for (gi = ast_app_group_list_head(); gi; gi = AST_LIST_NEXT(gi, list)) {
|
for (gi = ast_app_group_list_head(); gi; gi = AST_LIST_NEXT(gi, group_list)) {
|
||||||
if (gi->chan != chan)
|
if (gi->chan != chan)
|
||||||
continue;
|
continue;
|
||||||
if (ast_strlen_zero(data))
|
if (ast_strlen_zero(data))
|
||||||
@@ -178,7 +178,7 @@ static int group_list_function_read(struct ast_channel *chan, const char *cmd,
|
|||||||
|
|
||||||
ast_app_group_list_rdlock();
|
ast_app_group_list_rdlock();
|
||||||
|
|
||||||
for (gi = ast_app_group_list_head(); gi; gi = AST_LIST_NEXT(gi, list)) {
|
for (gi = ast_app_group_list_head(); gi; gi = AST_LIST_NEXT(gi, group_list)) {
|
||||||
if (gi->chan != chan)
|
if (gi->chan != chan)
|
||||||
continue;
|
continue;
|
||||||
if (!ast_strlen_zero(tmp1)) {
|
if (!ast_strlen_zero(tmp1)) {
|
||||||
|
|||||||
@@ -1748,7 +1748,7 @@ struct ast_group_info {
|
|||||||
struct ast_channel *chan;
|
struct ast_channel *chan;
|
||||||
char *category;
|
char *category;
|
||||||
char *group;
|
char *group;
|
||||||
AST_LIST_ENTRY(ast_group_info) list;
|
AST_LIST_ENTRY(ast_group_info) group_list;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
18
main/app.c
18
main/app.c
@@ -948,9 +948,9 @@ int ast_app_group_set_channel(struct ast_channel *chan, const char *data)
|
|||||||
len += strlen(category) + 1;
|
len += strlen(category) + 1;
|
||||||
|
|
||||||
AST_RWLIST_WRLOCK(&groups);
|
AST_RWLIST_WRLOCK(&groups);
|
||||||
AST_RWLIST_TRAVERSE_SAFE_BEGIN(&groups, gi, list) {
|
AST_RWLIST_TRAVERSE_SAFE_BEGIN(&groups, gi, group_list) {
|
||||||
if ((gi->chan == chan) && ((ast_strlen_zero(category) && ast_strlen_zero(gi->category)) || (!ast_strlen_zero(gi->category) && !strcasecmp(gi->category, category)))) {
|
if ((gi->chan == chan) && ((ast_strlen_zero(category) && ast_strlen_zero(gi->category)) || (!ast_strlen_zero(gi->category) && !strcasecmp(gi->category, category)))) {
|
||||||
AST_RWLIST_REMOVE_CURRENT(list);
|
AST_RWLIST_REMOVE_CURRENT(group_list);
|
||||||
free(gi);
|
free(gi);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -967,7 +967,7 @@ int ast_app_group_set_channel(struct ast_channel *chan, const char *data)
|
|||||||
gi->category = (char *) gi + sizeof(*gi) + strlen(group) + 1;
|
gi->category = (char *) gi + sizeof(*gi) + strlen(group) + 1;
|
||||||
strcpy(gi->category, category);
|
strcpy(gi->category, category);
|
||||||
}
|
}
|
||||||
AST_RWLIST_INSERT_TAIL(&groups, gi, list);
|
AST_RWLIST_INSERT_TAIL(&groups, gi, group_list);
|
||||||
} else {
|
} else {
|
||||||
res = -1;
|
res = -1;
|
||||||
}
|
}
|
||||||
@@ -986,7 +986,7 @@ int ast_app_group_get_count(const char *group, const char *category)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
AST_RWLIST_RDLOCK(&groups);
|
AST_RWLIST_RDLOCK(&groups);
|
||||||
AST_RWLIST_TRAVERSE(&groups, gi, list) {
|
AST_RWLIST_TRAVERSE(&groups, gi, group_list) {
|
||||||
if (!strcasecmp(gi->group, group) && (ast_strlen_zero(category) || (!ast_strlen_zero(gi->category) && !strcasecmp(gi->category, category))))
|
if (!strcasecmp(gi->group, group) && (ast_strlen_zero(category) || (!ast_strlen_zero(gi->category) && !strcasecmp(gi->category, category))))
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
@@ -1009,7 +1009,7 @@ int ast_app_group_match_get_count(const char *groupmatch, const char *category)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
AST_RWLIST_RDLOCK(&groups);
|
AST_RWLIST_RDLOCK(&groups);
|
||||||
AST_RWLIST_TRAVERSE(&groups, gi, list) {
|
AST_RWLIST_TRAVERSE(&groups, gi, group_list) {
|
||||||
if (!regexec(®exbuf, gi->group, 0, NULL, 0) && (ast_strlen_zero(category) || (!ast_strlen_zero(gi->category) && !strcasecmp(gi->category, category))))
|
if (!regexec(®exbuf, gi->group, 0, NULL, 0) && (ast_strlen_zero(category) || (!ast_strlen_zero(gi->category) && !strcasecmp(gi->category, category))))
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
@@ -1025,11 +1025,11 @@ int ast_app_group_update(struct ast_channel *old, struct ast_channel *new)
|
|||||||
struct ast_group_info *gi = NULL;
|
struct ast_group_info *gi = NULL;
|
||||||
|
|
||||||
AST_RWLIST_WRLOCK(&groups);
|
AST_RWLIST_WRLOCK(&groups);
|
||||||
AST_RWLIST_TRAVERSE_SAFE_BEGIN(&groups, gi, list) {
|
AST_RWLIST_TRAVERSE_SAFE_BEGIN(&groups, gi, group_list) {
|
||||||
if (gi->chan == old) {
|
if (gi->chan == old) {
|
||||||
gi->chan = new;
|
gi->chan = new;
|
||||||
} else if (gi->chan == new) {
|
} else if (gi->chan == new) {
|
||||||
AST_RWLIST_REMOVE_CURRENT(list);
|
AST_RWLIST_REMOVE_CURRENT(group_list);
|
||||||
ast_free(gi);
|
ast_free(gi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1044,9 +1044,9 @@ int ast_app_group_discard(struct ast_channel *chan)
|
|||||||
struct ast_group_info *gi = NULL;
|
struct ast_group_info *gi = NULL;
|
||||||
|
|
||||||
AST_RWLIST_WRLOCK(&groups);
|
AST_RWLIST_WRLOCK(&groups);
|
||||||
AST_RWLIST_TRAVERSE_SAFE_BEGIN(&groups, gi, list) {
|
AST_RWLIST_TRAVERSE_SAFE_BEGIN(&groups, gi, group_list) {
|
||||||
if (gi->chan == chan) {
|
if (gi->chan == chan) {
|
||||||
AST_RWLIST_REMOVE_CURRENT(list);
|
AST_RWLIST_REMOVE_CURRENT(group_list);
|
||||||
ast_free(gi);
|
ast_free(gi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1162,7 +1162,7 @@ static char *group_show_channels(struct ast_cli_entry *e, int cmd, struct ast_cl
|
|||||||
ast_cli(a->fd, FORMAT_STRING, gi->chan->name, gi->group, (ast_strlen_zero(gi->category) ? "(default)" : gi->category));
|
ast_cli(a->fd, FORMAT_STRING, gi->chan->name, gi->group, (ast_strlen_zero(gi->category) ? "(default)" : gi->category));
|
||||||
numchans++;
|
numchans++;
|
||||||
}
|
}
|
||||||
gi = AST_LIST_NEXT(gi, list);
|
gi = AST_LIST_NEXT(gi, group_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
ast_app_group_list_unlock();
|
ast_app_group_list_unlock();
|
||||||
|
|||||||
Reference in New Issue
Block a user