diff options
author | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-11-25 01:01:49 +0000 |
---|---|---|
committer | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-11-25 01:01:49 +0000 |
commit | 3ce5f8f4ee27228b26f6d39d9e1cf75f439995a7 (patch) | |
tree | 6af2cfc1b0ec46aa179c5019f00274f1eba84fce /res | |
parent | 7bf3c44abe26f6ce1dc917c33e5ed4a98e80776d (diff) |
This is basically a complete rollback of r155401, as it was determined that
it would be best to maintain API compatibility. Instead, this commit introduces
ao2_callback_data() which is functionally identical to ao2_callback() except
that it allows you to pass arbitrary data to the callback.
Reviewed by Mark Michelson via ReviewBoard:
http://reviewboard.digium.com/r/64
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@158959 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r-- | res/res_clialiases.c | 12 | ||||
-rw-r--r-- | res/res_phoneprov.c | 12 | ||||
-rw-r--r-- | res/res_timing_pthread.c | 8 | ||||
-rw-r--r-- | res/res_timing_timerfd.c | 10 |
4 files changed, 21 insertions, 21 deletions
diff --git a/res/res_clialiases.c b/res/res_clialiases.c index 2d9a396a7..bb0a08387 100644 --- a/res/res_clialiases.c +++ b/res/res_clialiases.c @@ -59,7 +59,7 @@ static int alias_hash_cb(const void *obj, const int flags) } /*! \brief Comparison function used for aliases */ -static int alias_cmp_cb(void *obj, void *arg, void *data, int flags) +static int alias_cmp_cb(void *obj, void *arg, int flags) { const struct cli_alias *alias0 = obj, *alias1 = arg; @@ -88,7 +88,7 @@ static char *cli_alias_passthrough(struct ast_cli_entry *e, int cmd, struct ast_ const char *line; /* Try to find the alias based on the CLI entry */ - if (!(alias = ao2_find(cli_aliases, &tmp, NULL, OBJ_POINTER))) { + if (!(alias = ao2_find(cli_aliases, &tmp, OBJ_POINTER))) { return 0; } @@ -168,7 +168,7 @@ static struct ast_cli_entry cli_alias[] = { }; /*! \brief Function called to mark an alias for destruction */ -static int alias_mark(void *obj, void *arg, void *data, int flags) +static int alias_mark(void *obj, void *arg, int flags) { struct cli_alias *alias = obj; alias->marked = 1; @@ -176,7 +176,7 @@ static int alias_mark(void *obj, void *arg, void *data, int flags) } /*! \brief Function called to see if an alias is marked for destruction */ -static int alias_marked(void *obj, void *arg, void *data, int flags) +static int alias_marked(void *obj, void *arg, int flags) { struct cli_alias *alias = obj; return alias->marked ? CMP_MATCH : 0; @@ -199,7 +199,7 @@ static void load_config(int reload) /* Mark CLI aliases for pruning */ if (reload) { - ao2_callback(cli_aliases, OBJ_NODATA, alias_mark, NULL, NULL); + ao2_callback(cli_aliases, OBJ_NODATA, alias_mark, NULL); } for (v = ast_variable_browse(cfg, "general"); v; v = v->next) { @@ -229,7 +229,7 @@ static void load_config(int reload) /* Drop any CLI aliases that should no longer exist */ if (reload) { - ao2_callback(cli_aliases, OBJ_UNLINK | OBJ_NODATA | OBJ_MULTIPLE , alias_marked, NULL, NULL); + ao2_callback(cli_aliases, OBJ_UNLINK | OBJ_NODATA | OBJ_MULTIPLE , alias_marked, NULL); } ast_config_destroy(cfg); diff --git a/res/res_phoneprov.c b/res/res_phoneprov.c index 904731e65..031a03387 100644 --- a/res/res_phoneprov.c +++ b/res/res_phoneprov.c @@ -237,7 +237,7 @@ static struct phone_profile *find_profile(const char *name) .name = name, }; - return ao2_find(profiles, &tmp, NULL, OBJ_POINTER); + return ao2_find(profiles, &tmp, OBJ_POINTER); } static int profile_hash_fn(const void *obj, const int flags) @@ -247,7 +247,7 @@ static int profile_hash_fn(const void *obj, const int flags) return ast_str_case_hash(profile->name); } -static int profile_cmp_fn(void *obj, void *arg, void *data, int flags) +static int profile_cmp_fn(void *obj, void *arg, int flags) { const struct phone_profile *profile1 = obj, *profile2 = arg; @@ -293,7 +293,7 @@ static int routes_hash_fn(const void *obj, const int flags) return ast_str_case_hash(route->uri); } -static int routes_cmp_fn(void *obj, void *arg, void *data, int flags) +static int routes_cmp_fn(void *obj, void *arg, int flags) { const struct http_route *route1 = obj, *route2 = arg; @@ -413,7 +413,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, NULL, OBJ_POINTER))) { + if (!(route = ao2_find(http_routes, &search_route, OBJ_POINTER))) { goto out404; } @@ -778,7 +778,7 @@ static struct user *find_user(const char *macaddress) .macaddress = macaddress, }; - return ao2_find(users, &tmp, NULL, OBJ_POINTER); + return ao2_find(users, &tmp, OBJ_POINTER); } static int users_hash_fn(const void *obj, const int flags) @@ -788,7 +788,7 @@ static int users_hash_fn(const void *obj, const int flags) return ast_str_case_hash(user->macaddress); } -static int users_cmp_fn(void *obj, void *arg, void *data, int flags) +static int users_cmp_fn(void *obj, void *arg, int flags) { const struct user *user1 = obj, *user2 = arg; diff --git a/res/res_timing_pthread.c b/res/res_timing_pthread.c index b9d295e1c..20999caf6 100644 --- a/res/res_timing_pthread.c +++ b/res/res_timing_pthread.c @@ -273,7 +273,7 @@ static struct pthread_timer *find_timer(int handle, int unlinkobj) flags |= OBJ_UNLINK; } - if (!(timer = ao2_find(pthread_timers, &tmp_timer, NULL, flags))) { + if (!(timer = ao2_find(pthread_timers, &tmp_timer, flags))) { ast_assert(timer != NULL); return NULL; } @@ -309,7 +309,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, void *data, int flags) +static int pthread_timer_cmp(void *obj, void *arg, int flags) { struct pthread_timer *timer1 = obj, *timer2 = arg; @@ -401,7 +401,7 @@ static void write_byte(int wr_fd) } while (0); } -static int run_timer(void *obj, void *arg, void *data, int flags) +static int run_timer(void *obj, void *arg, int flags) { struct pthread_timer *timer = obj; @@ -427,7 +427,7 @@ static void *do_timing(void *arg) while (!timing_thread.stop) { struct timespec ts = { 0, }; - ao2_callback(pthread_timers, OBJ_NODATA, run_timer, NULL, NULL); + ao2_callback(pthread_timers, OBJ_NODATA, run_timer, NULL); next_wakeup = ast_tvadd(next_wakeup, ast_tv(0, 5000)); diff --git a/res/res_timing_timerfd.c b/res/res_timing_timerfd.c index d79b63d38..d0ad17520 100644 --- a/res/res_timing_timerfd.c +++ b/res/res_timing_timerfd.c @@ -80,7 +80,7 @@ static int timerfd_timer_hash(const void *obj, const int flags) return timer->handle; } -static int timerfd_timer_cmp(void *obj, void *args, void *data, int flags) +static int timerfd_timer_cmp(void *obj, void *args, int flags) { struct timerfd_timer *timer1 = obj, *timer2 = args; return timer1->handle == timer2->handle ? CMP_MATCH | CMP_STOP : 0; @@ -120,7 +120,7 @@ static void timerfd_timer_close(int handle) .handle = handle, }; - if (!(our_timer = ao2_find(timerfd_timers, &find_helper, NULL, OBJ_POINTER))) { + if (!(our_timer = ao2_find(timerfd_timers, &find_helper, OBJ_POINTER))) { ast_log(LOG_ERROR, "Couldn't find timer with handle %d\n", handle); return; } @@ -172,7 +172,7 @@ static int timerfd_timer_enable_continuous(int handle) .handle = handle, }; - if (!(our_timer = ao2_find(timerfd_timers, &find_helper, NULL, OBJ_POINTER))) { + if (!(our_timer = ao2_find(timerfd_timers, &find_helper, OBJ_POINTER))) { ast_log(LOG_ERROR, "Couldn't find timer with handle %d\n", handle); return -1; } @@ -198,7 +198,7 @@ static int timerfd_timer_disable_continuous(int handle) .handle = handle, }; - if (!(our_timer = ao2_find(timerfd_timers, &find_helper, NULL, OBJ_POINTER))) { + if (!(our_timer = ao2_find(timerfd_timers, &find_helper, OBJ_POINTER))) { ast_log(LOG_ERROR, "Couldn't find timer with handle %d\n", handle); return -1; } @@ -225,7 +225,7 @@ static enum ast_timing_event timerfd_timer_get_event(int handle) .handle = handle, }; - if (!(our_timer = ao2_find(timerfd_timers, &find_helper, NULL, OBJ_POINTER))) { + if (!(our_timer = ao2_find(timerfd_timers, &find_helper, OBJ_POINTER))) { ast_log(LOG_ERROR, "Couldn't find timer with handle %d\n", handle); return -1; } |