TOCPREVNEXTINDEX

Lund Performance Solutions


The WILDCARD Tool
The WILDCARD tool is a library of procedures that provide functionality not inherent in any programming language or environment. Functionally, the WILDCARD library provides solutions for two common programming tasks. First, it offers the ability to build a fileset from a complex fileset specification. This ability expands on LISTF-style operations so that you can add, subtract, or otherwise qualify groups of files for use in your programs. Second, WILDCARD provides a way to match patterns in string expressions (i.e., filename expressions).
The WILDCARD tool, then, is actually two groups of callable procedures: FILESET procedures and PATTERN procedures.
The FILESET procedures include:
getfileset
buildfileset
buildfilename
fileseterrmsg
fs_version
The PATTERN procedures include:
pattern_build
pattern_match
pattern_fga_match
check_fga_wildcard

NOTE POSIX (HFS) file structures are not currently supported.

FILESET Procedures

In order to provide maximum flexibility, the FILESET building tasks have been broken into five separate procedure calls. The generated fileset is stored in an ASCII flat file so that you can access it as best suits your needs. The section called "Output Format" provides details on the layout of the file. The complete syntax that can be used to specify a file is described in the section called "Fileset Syntax". If you are familiar with the MAGNET o BLAZE tools (included in the System Manager’s Toolbox), then you may be familiar with this syntax already.
The getfileset procedure allows you to build a fileset with a single procedure call. If this call is not flexible enough for your needs, you may want to use the procedures buildfilename and buildfileset. These procedures provide more latitude for building the fileset the way you need it.
The remaining procedures, fs_version and fileseterrmsg, are used to provide the version string of the FILESET procedures and the error text for a specified error code.

FILESET Syntax

This section outlines the syntax used in the various fileset procedures.


Figure 9.1 WILDCARD Extended Fileset Syntax

NOTE All literals are case-insensitive.

For further information, you may wish to refer to Appendix B, which features a list of the more common file codes, and Appendix C, which provides a convenient reference for LISTF WILDCARD syntax.

Output Format

This section presents the output format of the FILESET procedures.
File structure: 80 byte, fixed, ASCII
Table 9.1 Output Format
Bytes
Item
0 .. 7
Account name
8 .. 15
Group name
16 .. 23
File name
24 .. 28
File code
29 .. 37
Record size
38 .. 41
File type
42 .. 53
End-of-file
54 .. 64
File limit
65 .. 68
Blocking factor
69 .. 79
Sectors

Operation

All of the FILESET procedures are callable from either Native Mode or Compatibility Mode.
The Native Mode version follows the Procedure Calling Convention established by Hewlett- Packard and is therefore callable from any language following these conventions.
For Compatibility Mode, follow the rules established by Hewlett-Packard for parameter passing and segmentation (i.e., not callable from CCS/C CREL format programs).
Two levels of integration are provided so that you can choose the method that best suits your needs. The first level is simply to call the procedures as you would call an intrinsic. FILESET procedures can be accessed in much the same manner as intrinsics are accessed. The second method may be a better choice if a greater level of control is desired. In this case, you would merge the declaration files into your source, and then recompile and link the program.

GETFILESET

The purpose of this procedure is to build a fileset based on the fileset specification string that is passed to this procedure.
Syntax:
short int getfileset (expression)
Return Value
getfileset returns a 16-bit integer encoded as follows:
Table 9.2 Getfileset’s Return Values
Code
Definition
Description
< 0
:Error
where the absolute value is the error number. This can be passed fileseterrmsg to retrieve the error text.
0
:No error
where the resulting fileset is in the temporary file FILES.
> 0
:Warning
where the value is the number of characters processed from the provided fileset specification string.
Parameters

expression
Byte array (required). It contains the NULL (ASCII 0) terminated fileset specification string. For a complete discussion of fileset specifications see Appendix C.

Operation
To use this routine, all that is required is to declare getfileset as an external procedure. Depending on the language used, this may occur automatically. Then, compile your application and link with the either the WILDCARD object file, relocatable library or executable library. After calling getfileset, check the return value for errors. If no error occurred, the resultant fileset can be accessed through the temporary file called "FILES".

NOTE FILES cannot be file equated. See the sample code TESTGFS.C.LPSTOOLS for an example.

BUILDFILENAME

This procedure is used to complete the building of the filename based on the specified mode. Five different modes are available ranging from fully-qualifying the filename to generating a unique filename. No errors are possible. The filename will be constructed using the standard MPE filename format (i.e., filename.group.account).
Syntax
buildfilename (filename, mode, terminator);
The Parameter Set is listed next, where each parameter is either an integer, character array, or integer array.
Table 9.3 BUILDFILENAME’s Parameter Set
Parameter
Name
Type
Comment
1
filename
character array
Required
2
mode
short int
Required
3
terminator
short int
Required
Return Value
There is no Return Value.
Parameters

filename
Byte array (required). Modes 0, 1, 2, and 3 contain the space character (ASCII 32) terminated filename. For mode 4, this filename will contain the unique filename generated by the call.
For all modes, the array will be terminated with the character provided in the parameter terminator. The dot (.) separator should not be specified. No filename validation will occur.
modes
Short int (required). Recognized values range from 0 to 4. The definitions are as follows:
0 = Append the logon group and account to the specified filename
1 = Append the logon account to the specified filename
2 = Append the program group and account to the specified filename
3 = Append the program account to the specified filename
4 = Generate a unique filename in logon group
If an unknown mode is given, then the terminator is appended to filename.
terminator
Short int (required). It is used to specify the character that will be used to terminate the byte array filename.

Operation
To use this routine, declare buildfilename as an external procedure. Depending on the language, this may occur automatically. Compile your application and link it with either the WILDCARD object file, relocatable library or executable library. Before calling buildfilename, determine which mode you want to use. Then, for modes 0 through 3, initialize the parameter filename. For all modes, initialize the terminator parameter before calling buildfilename.
The result of all operation will be in the byte array filename. The format for the filename will be in MPE format. Any values filled in by the call will be in uppercase. Groups, accounts and filenames will be separated by dots (.). The filename will be terminated with the character specified by the terminator parameter.
No errors are possible; calling buildfilename with an invalid mode will simply result in the filename being terminated by the terminator you provided. Also, calling buildfilename without a filename (for modes 0 through 3) will not cause an error, however, the resulting filename may not be very useful. For example, see the sample code TESTFS.C.LPSTOOLS or TESTFS.SPL.LPSTOOLS.

BUILDFILESET

This procedure will generate the fileset specified by the expression. The fileset will be stored in the file given by the parameter filename and the domain will be determined by the boolean value of perm. The stat parameter is a two element array. The 0th element contains the status, the 1st element contains an error code if the 0th element is non-zero. The procedure return value equals the number of characters processed from the expression parameter.
Syntax
short int buildfileset (expression, filename, perm, stat);
The Parameter Set is listed next, where each parameter is either an integer, character array, or integer array.
Table 9.4 BUILDFILESET’s Parameter Set
Parameter
Name
Type
Comment
1
expression
character array
Required
2
filename
character array
Required
3
perm
logical
Required
4
stat
short int
Required
Return Value
buildfileset returns a 16-bit integer that represents the number of characters processed from the expression string. Nominally, this equals the length of expression.
Parameters

expression
Byte array (required). This parameter contains the NULL (ASCII 0) terminated fileset specification string. See the Fileset Specification Syntax in Appendix C for a complete discussion of fileset specifications.
filename
Byte array (required). It contains the NULL (ASCII 0) terminated string used to build a file to hold the result of the buildfileset call. It cannot be file equated.
perm
Logical (required). It contains a value of true (even) or false (odd) used to indicate if the output file should be a permanent or temporary file.
stat
Short int array (required). It contains the status of the call to buildfileset. Stat(0) returns the status of the call. A nonzero value indicates an error. The nonzero code can be optionally passed to fileseterrmsg to retrieve the error text.

Operation
To use this routine, declare buildfileset as an external procedure. Depending on the language, this may occur automatically. Compile your application and link it with either the WILDCARD object file, relocatable library or executable library. After calling buildfileset, check the status variable stat to determine if the call was successful. Also, check the return value to determine if the entire expression was processed. If the variable stat equals zero, then the resultant can be accessed through the file specified by the parameter filename (see the sample code TESTFS.C.LPSTOOLS or TESTFS.SPL.LPSTOOLS).

FILESETERRMSG

The purpose of fileseterrmsg is to provide and format the text describing the error returned from a buildfileset or getfileset call.
Syntax
short int fileseterrmsg (status, buffer);
The Parameter Set is listed next, where each parameter is either an integer array or character array.
Table 9.5 FILESETERRMSG’s Parameter Set
Parameter
Name
Type
Comment
1
status
short int array
Required
2
buffer
character array
Required
Return Value
The integer value returned by fileseterrmsg is the byte length of the text that has been placed in buffer.
Parameters

status
Short int array (required). It contains the status of the call to buildfileset.
status(0) is the error number and it is used to look up the text of the error message.
status(1) (if non-zero) is appended to the end of the error text. The format used is: info: <status(1)>. Its use is purely informational. Most of the time when status(1) is non-zero, it will represent the error number returned by the intrinsic FCHECK plus some kind of file system error.
buffer
Byte array (required). The length must be at least 80 bytes.

Operation
To use this entry point, declare fileseterrmsg as an external. Depending on the language, this may occur automatically. Compile your application and link it with either the WILDCARD object file, relocatable library or executable library (see the sample code TESTFS.C.LPSTOOLS or TESTFS.SPL.LPSTOOLS).

FS_VERSION

This procedure will obtain the FILESET version string.
Syntax
fs_version (buffer);
Return Value
There are no Return Values.
Parameters

buffer
Byte array (required). The length must be at least 80 bytes.

Operation
To use this routine, declare fs_version as an external procedure. Depending on the language, this may occur automatically. Compile your application and link it with either the WILDCARD object file, relocatable library or executable library. After calling fs_version, the byte array will contain the ASCII version string. This can be used to test FILESET versions to ensure compatibility of applications that use FILESET (see the sample code TESTFS.C.LPSTOOLS or TESTFS.SPL.LPSTOOLS).

Fileset Error Numbers and Meanings

Table 9.6 Fileset Error Numbers and Meanings
stat(0)
meaning
stat(1) meaning
7
error during fclose
error number from FCHECK
8
error during fcontrol
error number from FCHECK
9
error during fopen, new
error number from FCHECK
10
error during fopen, old
error number from FCHECK
11
error during fread
error number from FCHECK
12
error during file rename
error number from FCHECK
13
error saving file
error number from FCHECK
14
error during fwrite
error number from FCHECK
21
error closing listf temporary file
error number from FCHECK
22
error opening listf temporary file
error number from FCHECK
23
error reading listf temporary file
error number from FCHECK
 
2
error from command intrinsic
error number from COMMAND
29
error during listf command
error number from COMMAND
 
1
expected alphabetic or numeric
not used
3
expected date
not used
4
bad filename part
not used
5
bad groupname part
not used
6
bad accountname part
not used
15
bad 16 bit integer
not used
16
same as #1 & # 15
not used
17
bad 32 bit integer
not used
18
error converting to 32 bit integer
not used
19
same as #18, except value
not used
20
unknown keyword
not used
24
expected keyword "on" or "off"
not used
25
unexpected value in expression
not used
26
unknown relational operator
not used
27
unbalanced right parenthesis
not used
28
expected keyword "today"
not used

PATTERN Procedures

The WILDCARD Pattern Matching collection contains four procedures used for building and checking for pattern matches. Three of the procedures (pattern_build, pattern_match, pattern_fga_match) provide a low-level approach for integration into your application. The fourth procedure (check_fga_wildcard) provides a higher-level approach.
The procedures that start with the string pattern_ are easily callable from either Pascal or C. The other procedure can be called from any Native Mode language.
Conceptually, any of the pattern_ procedures could be called from any Native Mode language. Given that the data structure passed into a pattern_ procedure is fairly complex, you should be aware that calling these types of procedures from either COBOL or SPLash! can be tricky. Conceptually, the pattern_match procedure can be used for matching strings of any length. However, it was really designed for matching strings that contain fully-qualified filenames.

Operation

The first thing that must be done to use those procedures is to initialize the PATTERN_TYPE data structures. This is done by calling the pattern_build procedure with the appropriate parameters.
Once the PATTERN_TYPE data-structures have been successfully initialized, the pattern_match or pattern_fga_match procedures can be called repeatedly to check for as many matches as you need. This approach is nice since the pattern_build procedure is only called once to set up the pattern (the check_fga_wildcard procedure uses both pattern_build and pattern_fga_match). This approach also makes it possible to initialize several WILDCARD patterns up front and then use them as needed.

CHECK_FGA_WILDCARD

This procedure is very simple to use. Simply pass in the Wildcard string and the filename string and this procedure will return either true or false. True means the filename was represented by the Wildcard, and False means it wasn’t. Additionally, if the return value is negative, it will contain an error number.

CHECK_WILDCARD

This procedure will simplify the use of the WILDCARD Pattern matching procedures. This procedure is particularly useful if only one (or a few) filename(s) are being tested. Also, this procedure reduces some of the programming necessary to use the pattern matching procedures.
Syntax
int check_wildcard (wildcard, filename);
The Parameter Set is listed next, where each parameter is either an integer array or character array.
Table 9.7 CHECK_WILDCARD’s Parameter Set
Parameter
Name
Type
Comment
1
wildcard
character array
Required
2
filename
character array
Required
Return Value
Check_wildcard returns a 32-bit integer encoded as follow:
Table 9.8 CHECK_WILDCARD’s Return Values
Code
Definition
Error Description
< 0
:Filename is matched by wildcard
 
= 0
:Nomatch
 
> 0
:Error
 
 
 
 
 
 
 
-1 = Missing 1st "." delimiter
-2 = Error initializing filename pattern
-3 = Missing 2nd "." delimiter
-4 = Error initializing groupname pattern
-5 = Missing accountname
-6 = Error initializing accountname pattern
-7 = Missing filename
-8 = Missing groupname
Parameters

wildcard
Byte array (required). A fully-qualified string ASCII space terminated. This procedure expects that the components of the filename are separated by a dot (.). Also, the buffer containing the string should not contain any characters past the terminating space.
Example 1: @.@.@
Example 2: @.pub.sys
Example 3: @foo@.???.s#96
filename
Byte array (required). A NULL (ASCII zero) terminated MPE fully-qualified filename.

Operation
Using this procedure can significantly reduce the amount of programming required to check fully- qualified MPE filenames. This is a stand-alone procedure and is not used in conjunction with any of the other WILDCARD Pattern procedures. See TESTCW.C.LPSTOOLS or TESTPAT.PASCAL.LPSTOOLS.

PATTERN_BUILD

This routine encodes a "pattern" into a special format to be used by the procedures pattern_match and pattern_fga_match. The "pattern" is returned in its encoded form in the variable of type PATTERN_TYPE. Both C and Pascal header files and example programs have been provided to assist in understanding how to use this procedure.
Syntax
int pattern_build (wp_pattern_string,
wp_pattern_length,
wp_pattern,
wp_error,
wp_wildcard_chars,
wp_options,
wp_chars_used);
The Parameter Set is listed next, where each parameter is either an integer array, character array, PATTERN_OPTIONS_TYPE, or PATTERN_TYPE:
Table 9.9 PATTERN_BUILD’s Parameter Set Return Value
Parameter
Name
Type
Comment
1
wp_pattern_string
character array
Required
2
wp_pattern_length
integer 32-bit signed
Required
3
wp_pattern
PATTERN_TYPE
Required
4
wp_error
integer 32-bit signed
Required
5
wp_wildcard_chars
character array
Optional
6
wp_options
PATTERN_OPIONS_TYPE
Optional
7
wp_chars_used
integer 32-bit signed
Optional
Pattern_build returns a 32-bit integer encoded as follow:
Table 9.10 PATTERN_BUILD’s Return Values
Code
Definition
Error Description
<> 0
:Error
See the wp_error parameter.
= 0
:No error
 
Parameters

wp_pattern_string
Byte array by reference (required). It contains the wildcard pattern that is to be initialized.
Example: @.pub.sys
wp_pattern_length
32-bit integer (required). It contains the byte length of the wildcard pattern stored in wp_pattern_string.
wp_pattern
PATTERN_TYPE data-structure by reference (required). This parameter is initialized within pattern_build, then subsequently passed to pattern_match or pattern_fga_match. The programmer is only responsible for declaring and passing this parameter.
wp_error
32-integer by reference (required). This parameter will contain an error number if the procedure return value is nonzero encoded as follows:
= 1: Too many firm (constant) characters in wp_pattern_string (see the following section of a discussion of firm characters).
= 2: Negative length
= 3: Too many parts (firms+wildcard characters) in wp_pattern_string
= 4: Escape, internal error (check wp_pattern_string)
wp_wildcard_chars
Byte array (optional). It contains the characters that will be used to represent wildcards.
byte 0: single character, default - ’?’
byte 1: multiple character wildcard, default = ’@’
byte 2: single digit wildcard, default = ’#’
byte 3: not used, must be an ASCII blank, default = ’ ’
See the following section for a discussion on setting this parameter.
wp_options
PATTERN_OPTIONS_TYPE data-structure by reference (optional). The parameter is used to select or deselect the following options:
  • upshift before matching
  • trim leading blanks
  • trim trailing blanks
  • See the following section for a discussion on setting this parameter.
    wp_chars_used
    32-bit integer by reference (optional). It returns the number of characters used from wp_pattern_string. This normally equals the length of the pattern unless an error occurs.

    Operation
    FIRM CHARACTERS
    A firm character is a character that is not a valid wildcard character. WILDCARD patterns are usually constructed of both wildcard and firm characters.
    Example: A@.PUB.W???
    The maximum number of firm characters that a pattern can contain is eight (8). Therefore the longest legal pattern is: @1@2@3@4@5@6@7@8@, or 17 characters long. If the pattern is longer than this, the wp_error parameter will be set up to three (pb_err_many_parts). If more than eight (8) firm characters are found, then the parameter wp_error will be set to one (pb_err_many_firm).
    SETTING WP_OPTIONS
    The default WILDCARD Pattern options are:
  • Upshift pattern and strings before matching
  • Trim (remove) leading spaces from strings before matching
  • Trim (remove) trailing spaces from strings before matching
  • Each of these options are selected by enabling the appropriate entry in the PATTERN_OPTIONS_TYPE data structure.
    Examples for the PATTERN_OPTIONS_TYPE data structure:
    in C:
    With the declaration

    PATTERN_OPTIONS_TYPE
    wp_options;
     
    wp_options.upshift
    = 1
    /* to select (default) */
    wp_options.upshift
    = 0
    /* to deselect */
    wp_options.trim_leading
    = 1
    /* to select (default) */
    wp_options.trim_leading
    = 0
    /* to deselect */
    wp_options.trim_trailing
    = 1
    /* to select (default) */
    wp_options.trim_trailing
    = 0
    /* to deselect */

    In PASCAL:
    With the declaration

    wp_options:
    PATTERN_OPTIONS_TYPE;
     
    options
    := options + [upshift]
    { to select (default) }
    options
    := options - [upshift]
    { to deselect }
    options
    := options + [trim_leading]
    { to select (default) }
    options
    := options - [trim_leading]
    { to deselect }
    options
    := options + [trim_trailing]
    { to select (default) }
    options
    := options - [trim_trailing]
    { to deselect }

    SETTING WP_WILDCARD _CHARS
    The WILDCARD Pattern matching procedures can be programmed to accept any wildcard characters. By default, the WILDCARD Pattern matching procedures use the question mark (?) for any single character wildcard. The "at" sign (@) for any sequence of wildcards, and the "pound" sign (#) for any digit wildcard. MPE and DOS examples follow.
    Examples for wp_wildcard_chars are:
    In C:
    With the declaration

    char pchars[4];
     
    strcpy(pchars,"?@#")
    /* MPE style wildcards */
    strcpy(pchars,"?*#")
    /* DOS style wildcards */

    In Pascal:
    With the declaration

    pchars:array[1..4] of char;
     
    pchars:="?@#";
    { MPE style wildcards }
    pchars:="?*#";
    { DOS style wildcards }

    For example:
    In C:
    With the following declarations
    /* WILDCARD Pattern variables */

    int
     
    wp_result,
    /* function returned */
    wp_error,
    /* error # if wp_result <> 0 */
    wp_buffer_length,
    /* function returned */
    wp_mismatches,
    /* returned by pattern_fga_match */
    wp_chars_used,
    /* # of chars used by wp_pattern_build */
     
    char
     
    wp_buffer[256];
    /* buffer for passing strings to wp */
    wp_pchars[4];
    /* ptr to user definable wildcard set */
     
    PATTERN_TYPE
     
    wp_pattern;
    /* internal representation */
     
    PATTERN_OPTIONS_TYPE
     
    wp_options;
    /* used to select wp options */
     
    /* initialization code */
     
    strcpy(wp_chars, "?@#");
    /* use default MPE wildcards */
    wp_options.upshift=1;
    /* upshift before comparing */
    wp_options.trim_leading=1;
    /* trim leading spaces */
    wp_options.trim_trailing=1;
    /* trim trailing spaces */
    strcpy(wp_buffer, "a##@");
    /* specify a pattern */
    wp_buffer_length=strlen(wp_buffer);
     
    wp_error=wp_chars_used=0;
    /* clear status variables - optional */
    wp_result=pattern_build(wp_buffer, wp_buffer_length, &wp-file_pattern, &wp_error, wp_pchars
    wp_options, &wp_chars_used);
    If(wp_result != 0)
     
    /* report error */
     
    strcpy(wp_buffer, "A69OUT");
     
    wp_buffer_length=6;
     
    wp_result=pattern_match(wp_buffer, wp_buffer_length, &wp_pattern);
    If(wp_result == 0)
     
    /* report error */
     
    else
     
    /* report no match */;
     

    In Pascal:
    With the following declarations
    { WILDCARD Pattern variables }

    $include ’paspat.dec1.lpstools’$
     
     
    var
     
    wp_buffer
    :packed array [1..80] of char;
    wp_error
    :integer;
    wp_buffer_length
    :integer;
    wp_option
    :pattern_options_type;
    wp_pattern
    :pattern_type;
    wp_result
    :integer;
    wp_chars_used
    :integer;
    wp_pchars
    :packed array [1..8] of char;

    wp_chars := "?@#";
    { use default MPE wildcards }
    wp_options := wp_options + [upshift]
    { upshift before comparing }
    wp_options := wp_options + [trim_leading]
    { trim leading spaces }
    wp_options := wp_options + [trim_trailing]
    { trim trailing spaces }
    wp_buffer := "a##@";
    { specify a pattern }
    wp_buffer_length := 4;
    { the pattern’s length }
    wp_chars_used := 0;
    { clear status variables - optional }
    wp_error := 0;
     
    wp_result := pattern build (addr(wp_buffer), wp_buffer_length, wp_pattern, wp_error,
    wp_pchars, wp_options, wp_chars_used);
     
     
    if wp_result <> 0 then
     
    { report error }
     
     
     
    wp_buffer := "A69OUT";
     
    wp_buffer_length := 6;
     
    wp-result := pattern_match(addr(wp_buffer), wp_buffer_length, wp_pattern);
     
     
    if wp_result = 0 then
     
    { report error }
     
    else
     
    { report no match };
     

    PATTERN_FGA_MATCH

    This procedure was specifically deigned to test a fully-qualified filename against a pattern. Since there are three components to an MPE fully-qualified filename, three patterns must be initialized (with pattern_match) before calling this procedure.
    Syntax
    int pattern_fga_match (fga_string,
    file_pattern,
    group_pattern,
    account_pattern,
    mismatches);
    The Parameter Set is listed next, where each parameter is either an integer, character array, or PATTERN_TYPE:
    Table 9.11 PATTERN_FGA_MATCH’s Parameter Set
    Parameter
    Name
    Type
    Comment
    1
    fga_string
    character array
    Required
    2
    file_pattern
    PATTERN_TYPE
    Required
    3
    group_pattern
    PATTERN_TYPE
    Required
    4
    account_pattern
    PATTERN_TYPE
    Required
    5
    mismatches
    integer 32-bit signed
    Required
    Return Value
    Pattern_fga_match returns a 32-bit integer encoded as follow:
    Table 9.12 PATTERN_FGA_MATCH’s Return Values
    Code
    Definition
    Error Description
    = 0
    :MATCH
     
    = 1
    :NO MATCH
     
    = 2
    : Internal error
    (check input data for correctness)
    See the C and Pascal header files for defines for the return values.
    When a NO MATCH is returned, the variable mismatches can be tested to determine the components of the filename that failed to match.
    Parameters

    fga_string
    Byte array (required). A fully-qualified string ASCII space terminated. This procedure expects that the components of the filename are separated by a dot (.). Also, the buffer containing this string should not contain any characters beyond the terminating space.
    file_pattern
    PATTERN_TYPE by reference (required). Initialized by a call to pattern_build with the desired filename wildcard pattern.
    group_pattern
    PATTERN_TYPE by reference (required). Initialized by a call to pattern_build with the desired groupname wildcard pattern.
    account_pattern
    PATTERN_TYPE by reference (required). Initialized by a call to pattern_build with the desired accountname wildcard pattern.
    mismatches
    32-bit integer by reference (required). This variable is used to determine which components of the filename failed. If the return value is zero, then the value of this variable should not be used. If the return value is 1 (NO MATCH), then this variable is encoded as follows:
    = 1 : Account name NO MATCH
    = 2 : Group name NO MATCH
    = 3 : Account and group name NO MATCH
    = 4 : File name NO MATCH
    = 5 : Account and file name NO MATCH
    = 6 : Group and file name NO MATCH
    = 7 : Account and group and file name NO MATCH

    Operation
    As in the case with the pattern_match procedure, once the pattern_build procedure is used to build the filename, groupname and accountname patterns it can be called as many times as needed. A typical initialization sequence for this procedure might be:
    wp_result = pattern_build(filename,...,filename_pattern...)
    ...
    wp_result = pattern_build(groupname,...,groupname_pattern...)
    ...
    wp_result = pattern_build(accountname,...,accountname_pattern...)
    ...
    wp_result = pattern_fga_match(fga_string,...,filename_pattern)
    ...
    See the file PATTEST.PASCAL.LPSTOOLS.

    PATTERN_MATCH

    This procedure is used to "test" for pattern matches. For input, it requires an initialized variable of type PATTERN_TYPE (see procedure pattern_build), a string to check, and the length of the string.
    Syntax
    int pattern_match (wp_buffer,
    wp_buffer_length,
    wp_pattern);
    The Parameter Set is listed next, where each parameter is either an integer, character array, or PATTERN_TYPE:
    Table 9.13 PATTERN_MATCH’s Parameter Set
    Parameter
    Name
    Type
    Comment
    1
    wp_buffer
    character array
    Required
    2
    wp_buffer_length
    integer 32-bit signed
    Required
    3
    wp_pattern
    PATTERN_TYPE
    Required
    Return Value
    Pattern_match returns a 32-bit integer encoded as follow:
    Table 9.14 PATTERN_FGA_MATCH’s Return Values
    Code
    Definition
    Error Description
    = 0
    :MATCH
     
    = 1
    :NO MATCH
     
    = 2
    : Internal error
    (check input data for correctness)
    See the C and Pascal header files for defines for the return values.
    Parameters

    wp_buffer
    Byte array (required). It contains the string that is being tested for in the pattern (in wp_pattern)
    NOTE Since the length is also given, the string doesn’t have to be space or NULL terminated.
    wp_buffer_length
    32-bit integer (required). The length of the string in wp_buffer.
    wp_pattern
    PATTERN_TYPE data-structure by reference (required). This variable should have been initialized by a call to pattern_build.

    Operation
    Before calling this procedure, call the pattern_build procedure to initialize a variable of type PATTERN_TYPE. Then, initialize wp_buffer and wp_buffer_length and call pattern_match. Since wp_pattern is initialized external to this procedure, pattern_match can be called as many times as needed without reinitializing the wp_pattern variable (see the example for the pattern_build procedure).

    Lund Performance Solutions
    www.lund.com
    Voice: (541) 812-7600
    Fax: (541) 81207611
    info@lund.com
    TOCPREVNEXTINDEX