From 30d1744ffce823312d51379585e8c19f722ea4d6 Mon Sep 17 00:00:00 2001 From: Sean Bright Date: Fri, 7 Nov 2008 22:39:30 +0000 Subject: 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: https://origsvn.digium.com/svn/asterisk/trunk@155401 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/manager.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'main/manager.c') diff --git a/main/manager.c b/main/manager.c index 8f4917309..9292c739e 100644 --- a/main/manager.c +++ b/main/manager.c @@ -3558,7 +3558,7 @@ static int variable_count_hash_fn(const void *vvc, const int flags) return res; } -static int variable_count_cmp_fn(void *obj, void *vstr, int flags) +static int variable_count_cmp_fn(void *obj, void *vstr, void *data, int flags) { /* Due to the simplicity of struct variable_count, it makes no difference * if you pass in objects or strings, the same operation applies. This is @@ -3667,7 +3667,7 @@ static void xml_translate(struct ast_str **out, char *in, struct ast_variable *v if (!in_data) { /* build appropriate line start */ ast_str_append(out, 0, xml ? " " : ""); - if ((vc = ao2_find(vco, var, 0))) + if ((vc = ao2_find(vco, var, NULL, 0))) vc->count++; else { /* Create a new entry for this one */ -- cgit v1.2.3