1169695Skan@deftypefn Replacement int fnmatch (const char *@var{pattern}, const char *@var{string}, int @var{flags}) 2169695Skan 3169695SkanMatches @var{string} against @var{pattern}, returning zero if it 4169695Skanmatches, @code{FNM_NOMATCH} if not. @var{pattern} may contain the 5169695Skanwildcards @code{?} to match any one character, @code{*} to match any 6169695Skanzero or more characters, or a set of alternate characters in square 7169695Skanbrackets, like @samp{[a-gt8]}, which match one character (@code{a} 8169695Skanthrough @code{g}, or @code{t}, or @code{8}, in this example) if that one 9169695Skancharacter is in the set. A set may be inverted (i.e., match anything 10169695Skanexcept what's in the set) by giving @code{^} or @code{!} as the first 11169695Skancharacter in the set. To include those characters in the set, list them 12169695Skanas anything other than the first character of the set. To include a 13169695Skandash in the set, list it last in the set. A backslash character makes 14169695Skanthe following character not special, so for example you could match 15169695Skanagainst a literal asterisk with @samp{\*}. To match a literal 16169695Skanbackslash, use @samp{\\}. 17169695Skan 18169695Skan@code{flags} controls various aspects of the matching process, and is a 19169695Skanboolean OR of zero or more of the following values (defined in 20169695Skan@code{<fnmatch.h>}): 21169695Skan 22169695Skan@table @code 23169695Skan 24169695Skan@item FNM_PATHNAME 25169695Skan@itemx FNM_FILE_NAME 26169695Skan@var{string} is assumed to be a path name. No wildcard will ever match 27169695Skan@code{/}. 28169695Skan 29169695Skan@item FNM_NOESCAPE 30169695SkanDo not interpret backslashes as quoting the following special character. 31169695Skan 32169695Skan@item FNM_PERIOD 33169695SkanA leading period (at the beginning of @var{string}, or if 34169695Skan@code{FNM_PATHNAME} after a slash) is not matched by @code{*} or 35169695Skan@code{?} but must be matched explicitly. 36169695Skan 37169695Skan@item FNM_LEADING_DIR 38169695SkanMeans that @var{string} also matches @var{pattern} if some initial part 39169695Skanof @var{string} matches, and is followed by @code{/} and zero or more 40169695Skancharacters. For example, @samp{foo*} would match either @samp{foobar} 41169695Skanor @samp{foobar/grill}. 42169695Skan 43169695Skan@item FNM_CASEFOLD 44169695SkanIgnores case when performing the comparison. 45169695Skan 46169695Skan@end table 47169695Skan 48169695Skan@end deftypefn 49