mirror of
https://github.com/asterisk/asterisk.git
synced 2026-01-06 18:13:45 +00:00
This is basically a complete rollback of r155401, as it was determined that
it would be best to maintain API compatibility. Instead, this commit introduces ao2_callback_data() which is functionally identical to ao2_callback() except that it allows you to pass arbitrary data to the callback. Reviewed by Mark Michelson via ReviewBoard: http://reviewboard.digium.com/r/64 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@158959 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -59,7 +59,7 @@ static int alias_hash_cb(const void *obj, const int flags)
|
||||
}
|
||||
|
||||
/*! \brief Comparison function used for aliases */
|
||||
static int alias_cmp_cb(void *obj, void *arg, void *data, int flags)
|
||||
static int alias_cmp_cb(void *obj, void *arg, int flags)
|
||||
{
|
||||
const struct cli_alias *alias0 = obj, *alias1 = arg;
|
||||
|
||||
@@ -88,7 +88,7 @@ static char *cli_alias_passthrough(struct ast_cli_entry *e, int cmd, struct ast_
|
||||
const char *line;
|
||||
|
||||
/* Try to find the alias based on the CLI entry */
|
||||
if (!(alias = ao2_find(cli_aliases, &tmp, NULL, OBJ_POINTER))) {
|
||||
if (!(alias = ao2_find(cli_aliases, &tmp, OBJ_POINTER))) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ static struct ast_cli_entry cli_alias[] = {
|
||||
};
|
||||
|
||||
/*! \brief Function called to mark an alias for destruction */
|
||||
static int alias_mark(void *obj, void *arg, void *data, int flags)
|
||||
static int alias_mark(void *obj, void *arg, int flags)
|
||||
{
|
||||
struct cli_alias *alias = obj;
|
||||
alias->marked = 1;
|
||||
@@ -176,7 +176,7 @@ static int alias_mark(void *obj, void *arg, void *data, int flags)
|
||||
}
|
||||
|
||||
/*! \brief Function called to see if an alias is marked for destruction */
|
||||
static int alias_marked(void *obj, void *arg, void *data, int flags)
|
||||
static int alias_marked(void *obj, void *arg, int flags)
|
||||
{
|
||||
struct cli_alias *alias = obj;
|
||||
return alias->marked ? CMP_MATCH : 0;
|
||||
@@ -199,7 +199,7 @@ static void load_config(int reload)
|
||||
|
||||
/* Mark CLI aliases for pruning */
|
||||
if (reload) {
|
||||
ao2_callback(cli_aliases, OBJ_NODATA, alias_mark, NULL, NULL);
|
||||
ao2_callback(cli_aliases, OBJ_NODATA, alias_mark, NULL);
|
||||
}
|
||||
|
||||
for (v = ast_variable_browse(cfg, "general"); v; v = v->next) {
|
||||
@@ -229,7 +229,7 @@ static void load_config(int reload)
|
||||
|
||||
/* Drop any CLI aliases that should no longer exist */
|
||||
if (reload) {
|
||||
ao2_callback(cli_aliases, OBJ_UNLINK | OBJ_NODATA | OBJ_MULTIPLE , alias_marked, NULL, NULL);
|
||||
ao2_callback(cli_aliases, OBJ_UNLINK | OBJ_NODATA | OBJ_MULTIPLE , alias_marked, NULL);
|
||||
}
|
||||
|
||||
ast_config_destroy(cfg);
|
||||
|
||||
Reference in New Issue
Block a user