diff options
author | Du, Changbin <changbin.du@gmail.com> | 2014-01-23 18:54:12 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-23 19:36:55 -0500 |
commit | aace05097a0fd467230e39acb148be0fdaa90068 (patch) | |
tree | ca2e61621bcb24ad83f3f145987c8ffd5c28c65b /include/linux/parser.h | |
parent | 0d9dfc23f4d8c17365c84eb48ecca28b963ba192 (diff) |
lib/parser.c: add match_wildcard() function
match_wildcard function is a simple implementation of wildcard
matching algorithm. It only supports two usual wildcardes:
'*' - matches zero or more characters
'?' - matches one character
This algorithm is safe since it is non-recursive.
Signed-off-by: Du, Changbin <changbin.du@gmail.com>
Cc: Jason Baron <jbaron@akamai.com>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/parser.h')
-rw-r--r-- | include/linux/parser.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/parser.h b/include/linux/parser.h index ea2281e726f6..39d5b7955b23 100644 --- a/include/linux/parser.h +++ b/include/linux/parser.h | |||
@@ -29,5 +29,6 @@ int match_token(char *, const match_table_t table, substring_t args[]); | |||
29 | int match_int(substring_t *, int *result); | 29 | int match_int(substring_t *, int *result); |
30 | int match_octal(substring_t *, int *result); | 30 | int match_octal(substring_t *, int *result); |
31 | int match_hex(substring_t *, int *result); | 31 | int match_hex(substring_t *, int *result); |
32 | bool match_wildcard(const char *pattern, const char *str); | ||
32 | size_t match_strlcpy(char *, const substring_t *, size_t); | 33 | size_t match_strlcpy(char *, const substring_t *, size_t); |
33 | char *match_strdup(const substring_t *); | 34 | char *match_strdup(const substring_t *); |