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
This commit is contained in:
Sean Bright
2008-11-07 22:39:30 +00:00
parent bd3f685f20
commit 30d1744ffc
14 changed files with 133 additions and 133 deletions

View File

@@ -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 ? " " : "<tr><td>");
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 */