NWSMCatGenericStrings

Concatenates a specified number of strings into a STRING_BUFFER structure.

Syntax

  #include <smsutapi.h> 
   
  void* NWSMCatGenericStrings ( 
     UINT32           nameSpaceType, 
     UINT8            numStrings, 
     STRING_BUFFER **dest, 
     void            *src1, 
     void            *src2,...);
  

Parameters

nameSpaceType

(IN) Specifies the name space type of the source and destination strings (see nameSpaceType Values).

numStrings

(IN) Specifies the number of source strings to concatenate.

dest

(OUT) Points to the buffer to receive the concatenated strings.

src1

(IN) Points to the first string to concatenate.

src2

(IN) Points to the second string to concatenate.

...

(IN) Points to other strings to concatenate.

Return Values

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

NULL

Cannot concatenate the strings.

Nonzero

The strings are concatenated and the pointer points to dest.string.

Remarks

NWSMCatGenericStrings supports strings in UTF-8 format and mult-byte formatting.

To free the string, call NWSMFreeString.

If dest is NULL, NWSMCatGenericStrings allocates memory for the string. If dest.string is too small to contain the concatenated strings, NWSMCatGenericStrings frees the memory and allocates a new structure with more memory.

See Also

NWSMCatStrings, NWSMFreeString, NWSMStr

NWSMCatGenericStrings Example

  #include <smsutapi.h> 
   
  STRING     resultString; 
  UINT8      numStrings = 2; 
  STRING_BUFFER *dest = NULL; 
  char *destString = “/home/user/dir1”, *src1 = “dir1”, *src2 = “*.c”; 
  UINT16 destLen; 
   
  destLen = strlen(destString); 
  dest = (STRING_BUFFER *)malloc(sizeof(STRING_BUFFER) + destLen); 
  dest->size = destLen + 1; 
  strcpy(dest->string, destString); 
   
  resultString = NWSMCatStrings(numStrings, &dest, src1, src2);