summaryrefslogtreecommitdiffstats
path: root/src/lib/wildcard-match.h
blob: bfe6076f1dd0d77dd0e7d1e98fc548d8e1694670 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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