NWSMCatStrings

Concatenates a specified number of strings into a STRING_BUFFER structure.

Syntax

  #include <smsutapi.h> 
   
  STRING NWSMCatStrings ( 
     UINT8             numStrings, 
     STRING_BUFFER **dest, 
     void             *src1, 
     void            *src2, ...);
  

Parameters

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

NOTE:This function is supported only for backward compatibility, the NWSMCatGenericStrings function can be used instead of this, as it provides the same functionality.

To free the string, call NWSMFreeString.

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

See Also

NWSMCatStrings, NWSMFreeString, NWSMStr

NWSMCatStrings 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);