diff options
author | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-11-07 22:39:30 +0000 |
---|---|---|
committer | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-11-07 22:39:30 +0000 |
commit | a7a95954c816e072bd44fb884029853a3585db33 (patch) | |
tree | 80eea1f19a98b0f9ca3ab09f32d0eea8aa0f85d5 /channels/chan_console.c | |
parent | f7be936f69d32c2b9aedb70d25395cb51c01eea6 (diff) |
Add ability to pass arbitrary data to the ao2_callback_fn (called from
ao2_callback and ao2_find). Currently, passing OBJ_POINTER to either
of these mandates that the passed 'arg' is a hashable object, making
searching for an ao2 object based on outside criteria difficult.
Reviewed by Russell and Mark M. via ReviewBoard:
http://reviewboard.digium.com/r/36/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@155401 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_console.c')
-rw-r--r-- | channels/chan_console.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/channels/chan_console.c b/channels/chan_console.c index c7090a160..e895cf10d 100644 --- a/channels/chan_console.c +++ b/channels/chan_console.c @@ -251,7 +251,7 @@ static struct console_pvt *find_pvt(const char *name) .name = name, }; - return ao2_find(pvts, &tmp_pvt, OBJ_POINTER); + return ao2_find(pvts, &tmp_pvt, NULL, OBJ_POINTER); } /*! @@ -1351,7 +1351,7 @@ static void build_device(struct ast_config *cfg, const char *name) unref_pvt(pvt); } -static int pvt_mark_destroy_cb(void *obj, void *arg, int flags) +static int pvt_mark_destroy_cb(void *obj, void *arg, void *data, int flags) { struct console_pvt *pvt = obj; pvt->destroy = 1; @@ -1403,7 +1403,7 @@ static int load_config(int reload) return -1; } - ao2_callback(pvts, OBJ_NODATA, pvt_mark_destroy_cb, NULL); + ao2_callback(pvts, OBJ_NODATA, pvt_mark_destroy_cb, NULL, NULL); ast_mutex_lock(&globals_lock); for (v = ast_variable_browse(cfg, "general"); v; v = v->next) @@ -1429,7 +1429,7 @@ static int pvt_hash_cb(const void *obj, const int flags) return ast_str_hash(pvt->name); } -static int pvt_cmp_cb(void *obj, void *arg, int flags) +static int pvt_cmp_cb(void *obj, void *arg, void *data, int flags) { struct console_pvt *pvt = obj, *pvt2 = arg; |