CmpName

Far Manager

CmpName

The CmpName function compares a null-terminated text string (for example, a file name) with a pattern (mask).
int WINAPI CmpName(
  const char *Pattern,
  const char *String,
  int SkipPath
);

Parameters

Pattern
Address of the pattern string.
String
Address of the null-terminated text string.
SkipPath
If TRUE, the file path in String is ignored and only the file name is used in comparison.

Return value

TRUE if the string matches the pattern, otherwise FALSE.

Remarks

The Pattern parameter can contain any characters allowed in file names and the following special characters (wildcards):
WildcardDescription
* any number of characters
? any single character
[c,x-z] any character from the range specified in square brackets; both individual characters and character ranges can be specified.
For example, files ftp.exe, fc.exe and f.ext will meet the following mask f*.ex?, the mask *co* corresponds to color.ini and edit.com, the mask [c-ft]*.txt corresponds to config.txt, demo.txt, faq.txt and tips.txt.