summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorSean Bright <sean@malleable.com>2008-11-07 22:39:30 +0000
committerSean Bright <sean@malleable.com>2008-11-07 22:39:30 +0000
commit30d1744ffce823312d51379585e8c19f722ea4d6 (patch)
tree80eea1f19a98b0f9ca3ab09f32d0eea8aa0f85d5 /res
parentbd3f685f205c602554b84f458e6bc67a37d4d3c0 (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: https://origsvn.digium.com/svn/asterisk/trunk@155401 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rw-r--r--res/res_phoneprov.c12
-rw-r--r--res/res_timing_pthread.c8
2 files changed, 10 insertions, 10 deletions
diff --git a/res/res_phoneprov.c b/res/res_phoneprov.c
index cd63a265a..5fcb29466 100644
--- a/res/res_phoneprov.c
+++ b/res/res_phoneprov.c
@@ -236,7 +236,7 @@ static struct phone_profile *find_profile(const char *name)
.name = name,
};
- return ao2_find(profiles, &tmp, OBJ_POINTER);
+ return ao2_find(profiles, &tmp, NULL, OBJ_POINTER);
}
static int profile_hash_fn(const void *obj, const int flags)
@@ -246,7 +246,7 @@ static int profile_hash_fn(const void *obj, const int flags)
return ast_str_hash(profile->name);
}
-static int profile_cmp_fn(void *obj, void *arg, int flags)
+static int profile_cmp_fn(void *obj, void *arg, void *data, int flags)
{
const struct phone_profile *profile1 = obj, *profile2 = arg;
@@ -299,7 +299,7 @@ static int routes_hash_fn(const void *obj, const int flags)
return ast_str_hash(uri);
}
-static int routes_cmp_fn(void *obj, void *arg, int flags)
+static int routes_cmp_fn(void *obj, void *arg, void *data, int flags)
{
const struct http_route *route1 = obj, *route2 = arg;
@@ -419,7 +419,7 @@ static struct ast_str *phoneprov_callback(struct ast_tcptls_session_instance *se
struct timeval now = ast_tvnow();
struct ast_tm tm;
- if (!(route = ao2_find(http_routes, &search_route, OBJ_POINTER))) {
+ if (!(route = ao2_find(http_routes, &search_route, NULL, OBJ_POINTER))) {
goto out404;
}
@@ -780,7 +780,7 @@ static struct user *find_user(const char *macaddress)
.macaddress = macaddress,
};
- return ao2_find(users, &tmp, OBJ_POINTER);
+ return ao2_find(users, &tmp, NULL, OBJ_POINTER);
}
static int users_hash_fn(const void *obj, const int flags)
@@ -797,7 +797,7 @@ static int users_hash_fn(const void *obj, const int flags)
return ast_str_hash(mac);
}
-static int users_cmp_fn(void *obj, void *arg, int flags)
+static int users_cmp_fn(void *obj, void *arg, void *data, int flags)
{
const struct user *user1 = obj, *user2 = arg;
diff --git a/res/res_timing_pthread.c b/res/res_timing_pthread.c
index 6e57246a6..4114e3677 100644
--- a/res/res_timing_pthread.c
+++ b/res/res_timing_pthread.c
@@ -268,7 +268,7 @@ static struct pthread_timer *find_timer(int handle, int unlinkobj)
flags |= OBJ_UNLINK;
}
- if (!(timer = ao2_find(pthread_timers, &tmp_timer, flags))) {
+ if (!(timer = ao2_find(pthread_timers, &tmp_timer, NULL, flags))) {
ast_assert(timer != NULL);
return NULL;
}
@@ -304,7 +304,7 @@ static int pthread_timer_hash(const void *obj, const int flags)
/*!
* \note only PIPE_READ is guaranteed valid
*/
-static int pthread_timer_cmp(void *obj, void *arg, int flags)
+static int pthread_timer_cmp(void *obj, void *arg, void *data, int flags)
{
struct pthread_timer *timer1 = obj, *timer2 = arg;
@@ -396,7 +396,7 @@ static void write_byte(int wr_fd)
} while (0);
}
-static int run_timer(void *obj, void *arg, int flags)
+static int run_timer(void *obj, void *arg, void *data, int flags)
{
struct pthread_timer *timer = obj;
@@ -422,7 +422,7 @@ static void *do_timing(void *arg)
while (!timing_thread.stop) {
struct timespec ts = { 0, };
- ao2_callback(pthread_timers, OBJ_NODATA, run_timer, NULL);
+ ao2_callback(pthread_timers, OBJ_NODATA, run_timer, NULL, NULL);
next_wakeup = ast_tvadd(next_wakeup, ast_tv(0, 5000));