MINOR: pattern: import acl_find_match_name() into pattern.h
It's only dedicated to pattern match lookups, so it was renamed
pat_find_match_name().
diff --git a/src/acl.c b/src/acl.c
index 86a8597..e8d4dc3 100644
--- a/src/acl.c
+++ b/src/acl.c
@@ -38,17 +38,6 @@
.list = LIST_HEAD_INIT(acl_keywords.list)
};
-/* return the PAT_MATCH_* index for match name "name", or < 0 if not found */
-static int acl_find_match_name(const char *name)
-{
- int i;
-
- for (i = 0; i < PAT_MATCH_NUM; i++)
- if (strcmp(name, pat_match_names[i]) == 0)
- return i;
- return -1;
-}
-
/* input values are 0 or 3, output is the same */
static inline enum acl_test_res pat2acl(enum pat_match_res res)
{
@@ -474,7 +463,7 @@
goto out_free_expr;
}
- idx = acl_find_match_name(args[1]);
+ idx = pat_find_match_name(args[1]);
if (idx < 0) {
memprintf(err, "unknown matching method '%s' when parsing ACL expression", args[1]);
goto out_free_expr;