189857Sobrien@deftypefn Replacement int fnmatch (const char *@var{pattern}, const char *@var{string}, int @var{flags})
289857Sobrien
389857SobrienMatches @var{string} against @var{pattern}, returning zero if it
489857Sobrienmatches, @code{FNM_NOMATCH} if not.  @var{pattern} may contain the
589857Sobrienwildcards @code{?} to match any one character, @code{*} to match any
689857Sobrienzero or more characters, or a set of alternate characters in square
789857Sobrienbrackets, like @samp{[a-gt8]}, which match one character (@code{a}
889857Sobrienthrough @code{g}, or @code{t}, or @code{8}, in this example) if that one
989857Sobriencharacter is in the set.  A set may be inverted (i.e., match anything
1089857Sobrienexcept what's in the set) by giving @code{^} or @code{!} as the first
1189857Sobriencharacter in the set.  To include those characters in the set, list them
1289857Sobrienas anything other than the first character of the set.  To include a
1389857Sobriendash in the set, list it last in the set.  A backslash character makes
1489857Sobrienthe following character not special, so for example you could match
1589857Sobrienagainst a literal asterisk with @samp{\*}.  To match a literal
1689857Sobrienbackslash, use @samp{\\}.
1789857Sobrien
1889857Sobrien@code{flags} controls various aspects of the matching process, and is a
1989857Sobrienboolean OR of zero or more of the following values (defined in
2089857Sobrien@code{<fnmatch.h>}):
2189857Sobrien
2289857Sobrien@table @code
2389857Sobrien
2489857Sobrien@item FNM_PATHNAME
2589857Sobrien@itemx FNM_FILE_NAME
2689857Sobrien@var{string} is assumed to be a path name.  No wildcard will ever match
2789857Sobrien@code{/}.
2889857Sobrien
2989857Sobrien@item FNM_NOESCAPE
3089857SobrienDo not interpret backslashes as quoting the following special character.
3189857Sobrien
3289857Sobrien@item FNM_PERIOD
3389857SobrienA leading period (at the beginning of @var{string}, or if
3489857Sobrien@code{FNM_PATHNAME} after a slash) is not matched by @code{*} or
3589857Sobrien@code{?} but must be matched explicitly.
3689857Sobrien
3789857Sobrien@item FNM_LEADING_DIR
3889857SobrienMeans that @var{string} also matches @var{pattern} if some initial part
3989857Sobrienof @var{string} matches, and is followed by @code{/} and zero or more
4089857Sobriencharacters.  For example, @samp{foo*} would match either @samp{foobar}
4189857Sobrienor @samp{foobar/grill}.
4289857Sobrien
4389857Sobrien@item FNM_CASEFOLD
4489857SobrienIgnores case when performing the comparison.
4589857Sobrien
4689857Sobrien@end table
4789857Sobrien
4889857Sobrien@end deftypefn
49