VMS Help
CRTL, decc$match_wild
*Conan The Librarian
|
Matches a string to a pattern.
Format
#include <unixlib.h>
int decc$match_wild (char *test_string, char *string_pattern);
test_string
The address of a null-terminated string.
string_pattern
The address of a string containing the pattern to be matched.
This pattern can contain wildcards (such as asterisks (*),
question marks (?), and percent signs (%) as well as regular
expressions (such as the range [a-z]).
The decc$match_wild routine determines whether the specified
test string is a member of the set of strings specified by the
pattern.
1 (TRUE) The string matches the pattern.
0 (FALSE) The string does not match the pattern.
/* Define as a foreign command and then provide */
/* two arguments: test_string, string_pattern. */
#include <unixlib.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
if (decc$match_wild(argv[1], argv[2]))
printf("\n%s matches %s", argv[1], argv[2]);
else
printf("\n%s does not match %s", argv[1], argv[2]);
}