diff options
author | Corey Farrell <git@cfware.com> | 2017-12-29 23:59:00 -0500 |
---|---|---|
committer | Corey Farrell <git@cfware.com> | 2018-01-01 19:17:15 -0500 |
commit | 5b395a7b97775f62083675f13537179150befd3f (patch) | |
tree | 466e3550e77dd543e0eb52a20d8499c6a443e081 /main/named_acl.c | |
parent | b47882df72fbeae6ab340b21817d7f3fc4a1ba97 (diff) |
core: Use macros to generate ao2_container callbacks where possible.
This uses AO2_STRING_FIELD_HASH_FN and AO2_STRING_FIELD_CMP_FN where
possible in the Asterisk core.
This removes CMP_STOP from the result of CMP_FN callbacks for the
following structure types:
* ast_bucket_metadata
* ast_bucket_scheme
* generic_monitor_instance_list (ccss.c)
* named_acl
Change-Id: Ide4c1449a894bce70dea1fef664dade9b57578f1
Diffstat (limited to 'main/named_acl.c')
-rw-r--r-- | main/named_acl.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/main/named_acl.c b/main/named_acl.c index 458d4d397..9ea89903e 100644 --- a/main/named_acl.c +++ b/main/named_acl.c @@ -107,19 +107,8 @@ struct named_acl { char name[ACL_NAME_LENGTH]; /* Same max length as a configuration category */ }; -static int named_acl_hash_fn(const void *obj, const int flags) -{ - const struct named_acl *entry = obj; - return ast_str_hash(entry->name); -} - -static int named_acl_cmp_fn(void *obj, void *arg, const int flags) -{ - struct named_acl *entry1 = obj; - struct named_acl *entry2 = arg; - - return (!strcmp(entry1->name, entry2->name)) ? (CMP_MATCH | CMP_STOP) : 0; -} +AO2_STRING_FIELD_HASH_FN(named_acl, name) +AO2_STRING_FIELD_CMP_FN(named_acl, name) /*! \brief destructor for named_acl_config */ static void named_acl_config_destructor(void *obj) |