NWSMTSGetSupportedNameTypes

Returns the name types supported by the target service

Syntax

  #include <smsutapi.h>
  
  #include <smstsapi.h>
   
  
  CCODE NWSMTSGetSupportedNameTypes(
     UINT32   connection, 
     UINT32  *nameTypes);
  

Parameters

connection

(IN) Specifies the connection information returned by NWSMTSConnectToTargetService or NWSMTSConnectToTargetServiceEx.

nameTypes

(OUT) Specifies the name types supported by the target service.

Return Values

See Section 9.3, Target Service Return Values for more information.

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

0x00000000

Successful

0xFFFDFFB9

NWSMTS_UNSUPPORTED_FUNCTION

0xFFFDFFE7

NWSMTS_INVALID_CONNECTION_HANDL

0xFFFEFFFB

NWSMDR_UNSUPPORTED_FUNCTION

0xFFFEFFFF

NWSMDR_INVALID_CONNECTION

Remarks

The nameType parameter contains a bit map of all name types that are supported by the target service.

The following table shows the nameTypes values.

Return Values

Description

Supported By

0x01

NWSM_NAME_TYPE_MBCS: Characters are represented in Multi Byte Character Set (MBCS) format.

TSAFS

0x02

NWSM_NAME_TYPE_UTF8: Characters are represented in UTF-8 format.

TSAFS

NOTE:This symbol is not present in the SMS import file, as all versions of SMS do not export this symbol. To use this function, programmatically import the symbol and invoke it.

Example

  #include <smsutapi.h>
  #include <smstsapi.h>
  #define ADDITIONAL_BUFFER_SIZE 512
  NWSM_SCAN_CONTROL *scanControl;
  UINT32connection, nameTypes;
  /* NWSMTSConnectToTargetService/NWSMTSConnectToTargetServiceEx is used to initialize the connection parameter used
  in the example below */
  /* Backing up using UTF-8 data set names */
  /* Setup the scan control structure. Note that some fields in scanControl are set to their default values 
  when the memory is calloc’d. */
  scanControl = (NWSM_SCAN_CONTROL *)calloc(1, sizeof(NWSM_SCAN_CONTROL) + ADDITIONAL_BUFFER_SIZE);
  scanControl->bufferSize = sizeof(NWSM_SCAN_CONTROL) + ADDITIONAL_BUFFER_SIZE;
  scanControl->scanControlSize = sizeof(NWSM_SCAN_CONTROL);
  scanControl->otherInformationSize = 0;
  /* Set other scanControl parameters to defaults or chosen values */
  /* Get the supported name types from the connected target service */
  cCode = NWSMTSGetSupportedNameTypes(connection, &nameTypes);
  if (!cCode && (nameTypes & NWSM_NAME_TYPE_UTF8))
  {
  /* Set the name space type that the TSA should return to UTF8 format, this would return the names in 
  NWSM_DATA_SET_NAME_LIST in UTF8 format */
  scanControl->returnNameSpaceType = NWSM_ALL_NAME_SPACES_UTF8;
  /* NOTE: If engines want all names in both UTF-8 and MBCS set the above
  to NWSM_ALL_NAME_SPACES_FORMATS instead of NWSM_ALL_NAME_SPACES, as
  the latter will return only the MBCS name space types to maintain
  backward compatability */
  /* NOTE: Some engines may scan in only a particular name space like
  OS2NameSpace, in such cases pass in the returnNameSpaceType as
  LONGNameSpaceUtf8Type */
  }
  else
  {
  /* If there are any errors, or the API is unsupported, use the older mechanisim of backing up names */
  scanControl->returnNameSpaceType = NWSM_ALL_NAME_SPACES;
  }
  /* Start the backup of data sets by calling NWSMTSScanDataSetBegin with
  the above scanControl. 
  Refer to NWSMTSScanNextDataSet,NWSMTSOpenDataSetForBackup, and NWSMTSReadDataSet for further details on how
  to backup data sets */