WU_FNMATCH(3)WU_FNMATCH(3)NAMEwu_fnmatch - match filename or pathname
SYNOPSIS
#include "wu_fnmatch.h"
int wu_fnmatch(const char *pattern, const char *string, int flags);
DESCRIPTIONwu_fnmatch matches patterns according to the rules used by
the shell. It checks the string specified by the string
argument to see if it matches the pattern specified by the
pattern argument.
The flags argument modifies the interpretation of pattern
and string. The value of flags is the bitwise inclusive
OR of any of the following constants, which are defined in
the include file wu_fnmatch.h.
FNM_PATHNAME
Slash characters in string must be explicitly
matched by slashes in pattern. If this flag is not
set, then slashes are treated as regular charac
ters.
FNM_NOESCAPE
Every occurrence of a backslash (``\'') followed by
a character in pattern is replaced by that charac
ter. This is done to negate any special meaning
for the character. If this flag is set, then back
slashes are treated as regular characters.
FNM_PERIOD
If this flag is set, then a leading period in
string must be explicity matched by a period in
pattern. A period is considered leading if it is
the first character in string, or if both is set
and the period immediately follows a slash.
FNM_LEADING_DIR
If this flag is set, if the entire pattern has been
matched, and there are more characters remaining in
the string, and either the last character matched
was a slash, or the next character in the string is
a slash, then consider the entire string matched.
FNM_CASEFOLD
Normally, upper case and lower case letters are
distinct. This flag causes them to be considered
equal.
RETURNS
If string matches the pattern specified by pattern, then
wu_fnmatch returns zero. Otherwise, wu_fnmatch returns
July 28, 1999 1
WU_FNMATCH(3)WU_FNMATCH(3)
FNM_NOMATCH.
SEE ALSOsh(1), glob(3), wordexp(3), regexp(3)BUGS
{} alternatives are not handled.
July 28, 1999 2