aboutsummaryrefslogtreecommitdiffstats
path: root/main/astobj2.c
diff options
context:
space:
mode:
authorrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2007-09-06 15:43:49 +0000
committerrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2007-09-06 15:43:49 +0000
commit73260d8507adefaee9c464aae5243e84c64a1e3b (patch)
tree1e584b4e44b4599d6f3e11d935d3f0fb03c59902 /main/astobj2.c
parent831753611bd3da095e01f57235a61c9adb4c02d3 (diff)
various changes to the documentation, and redefinition of
ao2_hash_fn and ao2_callback_fn typedefs, in preparation to more cleanup of the _search_flags Please do not merge this change to 1.4 yet - there are no functional changes anyways. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@81712 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/astobj2.c')
-rw-r--r--main/astobj2.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/main/astobj2.c b/main/astobj2.c
index 6bda2340f..cc357f176 100644
--- a/main/astobj2.c
+++ b/main/astobj2.c
@@ -26,7 +26,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/cli.h"
/*!
- * astobj2 objects are always prepended this data structure,
+ * astobj2 objects are always preceded by this data structure,
* which contains a lock, a reference counter,
* the flags and a pointer to a destructor.
* The refcount is used to decide when it is time to
@@ -244,8 +244,8 @@ AST_LIST_HEAD_NOLOCK(bucket, bucket_list);
* we hold the lock (that we need anyways).
*/
struct ao2_container {
- ao2_hash_fn hash_fn;
- ao2_callback_fn cmp_fn;
+ ao2_hash_fn *hash_fn;
+ ao2_callback_fn *cmp_fn;
int n_buckets;
/*! Number of elements in the container */
int elements;
@@ -273,8 +273,8 @@ static int hash_zero(const void *user_obj, const int flags)
* A container is just an object, after all!
*/
struct ao2_container *
-ao2_container_alloc(const uint n_buckets, ao2_hash_fn hash_fn,
- ao2_callback_fn cmp_fn)
+ao2_container_alloc(const uint n_buckets, ao2_hash_fn *hash_fn,
+ ao2_callback_fn *cmp_fn)
{
/* XXX maybe consistency check on arguments ? */
/* compute the container size */
@@ -383,7 +383,7 @@ static int cb_true(void *user_data, void *arg, int flags)
*/
void *ao2_callback(struct ao2_container *c,
const enum search_flags flags,
- ao2_callback_fn cb_fn, void *arg)
+ ao2_callback_fn *cb_fn, void *arg)
{
int i, last; /* search boundaries */
void *ret = NULL;
@@ -397,15 +397,6 @@ void *ao2_callback(struct ao2_container *c,
}
/* override the match function if necessary */
-#if 0
- /* Removing this slightly changes the meaning of OBJ_POINTER, but makes it
- * do what I want it to. I'd like to hint to ao2_callback that the arg is
- * of the same object type, so it can be passed to the hash function.
- * However, I don't want to imply that this is the object being searched for. */
- if (flags & OBJ_POINTER)
- cb_fn = match_by_addr;
- else
-#endif
if (cb_fn == NULL) /* if NULL, match everything */
cb_fn = cb_true;
/*