NWSMCatGenericString

Appends a specified number of bytes from the source string to the destination string.

Syntax

  #include <smsutapi.h> 
   
  void* NWSMCatGenericString ( 
     UINT32             nameSpacetype, 
     STRING_BUFFER **dest, 
     void              *source);
  

Parameters

name SpaceType

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

dest

(IN/OUT) Points to the string to append.

source

(IN) Points to the string to append to the end of dest.

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

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

To free the string, call NWSMFreeString.

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

See Also

NWSMCatStrings, NWSMFreeString, NWSMStr

NWSMCatGenericString Example

  #include <smsutapi.h> 
   
  STRING resultString; 
  STRING_BUFFER *dest = NULL; 
  char *source = “*.exe”, *destString = “/home/user/dirl”; 
  INT16 srcLen = -1; 
  UINT16 destLen; 
   
  destLen = strlen(destString); 
  dest = (STRING_BUFFER *)malloc(sizeof(STRING_BUFFER) + destLen); 
  dest->size = destLen + 1; 
  strcpy(dest->string, destString); 
   
  resultString = NWSMCatString(&dest, source, srcLen);