#include <fnmatch.h> int fnmatch(const char *pattern, const char *string, int flags);
This function indicates if string matches the pattern. The pattern may include the following special characters:
*
?
[...]
!
, matches if the character is not in the range.
Between the brackets, the range is specified by listing the characters
that are in the range, or two characters separated by -
to
indicate all characters in that range. For example, [a-d]
matches a
, b
, c
, or d
.
\
\*
matches an asterisk. This is only available if flags
includes FNM_QUOTE
.
The value of flags is a combination of zero of more of the following:
FNM_PATHNAME
/
never matches any of the wildcards.
FNM_QUOTE
\\
may be used for quoting special
characters in the pattern.
Zero if the string matches, FNM_NOMATCH if it does not.
not ANSI, POSIX
if (fnmatch("*.[ch]", filename, FNM_PATH|FNM_QUOTE)) do_source_file(filename);
Go to the first, previous, next, last section, table of contents.