NWSMMatchName

Performs a case-sensitive search for long spaces and case-insensitive search for all the other namespaces for a pattern in a string.

Syntax

  #include <smsutapi.h> 
   
  int NWSMMatchName ( 
     UINT32      nameSpaceType, 
     void       *pattern, 
     void       *string, 
     NWBOOLEAN   returnMatchToPatternEndIfWild);
  

Parameters

nameSpaceType

(IN) Specifies the name space type of string and pattern. (see nameSpaceType Values).

pattern

(IN) Points to the pattern to search for (see Wildcard Values).

string

(IN) Points to the string to search.

returnMatchToPatternEndIfWild

(IN) Specifies whether string is a directory path:

  • TRUE Directory path
  • FALSE Not a directory path

Return Values

The following table lists the return values associated with the function.

-1

NWSM_MATCH_UNSUCCESSFULL

0

NWSM_MATCH_SUCCESSFULL

1

NWSM_MATCH_TO_STRING_END

2

NWSM_MATCH_TO_PATTERN_END

Remarks

NWSMMatchName also supports strings in UTF-8 format.

Wild card matching is allowed if the name space supports it.

NWSM_MATCH_TO_STRING_END is returned if string matches the first part of pattern.

NWSM_MATCH_TO_PATTERN_END is returned when part of string matches pattern exactly. For example, when pattern is set to "*ted" and string is set to "sorted_i."

returnMatchToPatternEndIfWild allows NWSMMatchName to return the correct return value for directory paths that matches a pattern to its end.

NWSMMatchName Example

  UINT32 nameSpaceType = DOSNameSpace; 
  char patternBuf[15], stringBuf[15]; /* Arbitrary size.*/ 
   
  STRING pattern = patternBuf, string = stringBuf; 
  strcpy(pattern, “?es*.*”); 
  strcpy(string, “test.exe”); 
   
  NWSMMatchName(nameSpaceType, pattern, string, TRUE);