HELPLIB.HLB  —  CRTL  decc$match_wild
    Matches a string to a pattern.

    Format

      #include  <unixlib.h>

      int decc$match_wild  (char *test_string, char *string_pattern);

1  –  Arguments

 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]).

2  –  Description

    The decc$match_wild routine determines whether the specified
    test string is a member of the set of strings specified by the
    pattern.

3  –  Return Values

    1 (TRUE)           The string matches the pattern.
    0 (FALSE)          The string does not match the pattern.

4  –  Example

        /* 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]);
        }
Close Help