@c Match pattern to string FUNCTION:
match checks if pszString matches the pattern pszPattern. pszPattern is a string containing joker characters. These are:
* matches one or more any character
# matches one or more digit
$ matches one or more alphanumeric character
@ matches one or more alpha character
(space) matches one or more spaces
? matches a single character
~x matches x even if x is pattern matching character or tilde
x matches character x unless it is a joker character
RETURN VALUE:
The function returns zero if no error occures and returns an error code in case some of the memory buffer does not have enough space. (Either pszBuffer or ParameterArray)
PARAMETERS:
pszPattern IN the pattern to match
--
cbPattern IN the number of characters in the pattern
--
pszString IN the string which is compared to the pattern
--
cbString IN the number of characters in the string
--
ParameterArray OUT is an uninitialized character pointer array. Upon return ParameterArray[i] points the string that matches the i-th joker character.
--
pcbParameterArray OUT is an uninititalized unsigned long array. Upon return pcbParameterArray[i] contains the length of the output parameter ParameterArray[i].
--
pszBuffer OUT should point to a buffer. The size of the buffer should be specified by cbBufferSize. A size equal
cbString
is a safe size. The actual strings matching the joker characters
will get into this buffer zero terminated one after the other:
--
cArraySize IN number of elements in the array ParameterArray
--
cbBufferSize IN size of the buffer pointed by pszBuffer
--
fCase IN pattern matching is performed case sensitive if this value if TRUE.
--
iResult OUT TRUE if pszString matches the pattern pszPattern. FALSE otherwise.
NOTE:
pszPattern and pszString are NOT changed.
If the function returns non-zero (error code) none of the output
variables can be reliably used.
int match_match(char *pszPattern,
unsigned long cbPattern,
char *pszString,
unsigned long cbString,
char **ParameterArray,
unsigned long *pcbParameterArray,
char *pszBuffer,
int cArraySize,
int cbBufferSize,
int fCase,
pMatchSets pThisMatchSets,
int *iResult
){