summaryrefslogtreecommitdiffstats
path: root/src/lib/wildcard-match.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/wildcard-match.h')
-rw-r--r--src/lib/wildcard-match.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/wildcard-match.h b/src/lib/wildcard-match.h
new file mode 100644
index 0000000..bfe6076
--- /dev/null
+++ b/src/lib/wildcard-match.h
@@ -0,0 +1,15 @@
+#ifndef WILDCARD_MATCH_H
+#define WILDCARD_MATCH_H
+
+/* Returns TRUE if mask matches data. mask can contain '*' and '?' wildcards. */
+bool wildcard_match(const char *data, const char *mask);
+/* Like wildcard_match(), but match ASCII characters case-insensitively. */
+bool wildcard_match_icase(const char *data, const char *mask);
+
+/* Returns TRUE if mask does *not* contain any '*' or '?' wildcards. */
+static inline bool wildcard_is_literal(const char *mask)
+{
+ return strpbrk(mask, "*?") == NULL;
+}
+
+#endif