NWSMTSFixDataSetName

Formats a fully qualified parent directory path according to the specified name space specifications.

Syntax

  #include <smstsapi.h> 
   
  CCODE NWSMTSFixDataSetName (
     UINT32          connection, 
     STRING          dataSetName, 
     UINT32          nameSpaceType, 
     NWBOOLEAN       isParent, 
     NWBOOLEAN       wildAllowedOnTerminal, 
     STRING_BUFFER **newDataSetName);
  

Parameters

connection

(IN) Specifies the connection information returned by NWSMConnectToTSA.

dataSetName

(IN/OUT) Specifies the path to be fixed.

nameSpaceType

(IN) Specifies the name space type of dataSetName. (see nameSpaceType Values)

isParent

(IN) Specifies the type of path contained in dataSetName:

  • TRUE Specifies a fully qualified parent path
  • FALSE Specifies a fully qualified child path or a terminal name
wildAllowedOnTerminal

(IN) Specifies if the path contains wild cards only in the terminal path node:

  • TRUE Wildcards allowed only in the terminal path
  • FALSE Wildcards allowed elsewhere in the path
newDataSetName

(OUT) Points to the buffer to receive the fixed up path.

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

0xFFFDFFE7

NWSMTS_INVALID_CONNECTION_HANDL

0xFFFDFFE0

NWSMTS_INVALID_NAME_SPACE_TYPE

0xFFFDFFC9

NWSMTS_OUT_OF_MEMORY

0xFFFDFFDC

NWSMTS_INVALID_PATH

0xFFFEFFFF

NWSMDR_INVALID_CONNECTION

0xFFFEFFFE

NWSMDR_INVALID_PARAMETER

Remarks

If dataSetName contains a fully qualified path, NWSMTSFixDataSetName ensures that the path has a separator and proper case. NWSMTSFixDataSetName also adds a separator to the terminal path node if isParent is set to TRUE. If the nameSpaceType defines a first separator and the path does not contain a valid separator, NWSMTSFixDataSetName returns NWSMTS_INVALID_PATH.

The fixed up path is returned in newDataSetName. NWSMTSFixDataSetName copies dataSetName to newDataSetName and performs the following fix ups and checks on the path:

  • Converts the appropriate path nodes to upper case as follows:

    • DOS paths are converted to upper case

    • All primary resources before first separator (if supported by the nameSpaceType on the target service) in NFS, FTAM, and OS/2 are converted to upper case.

  • For all non-Macintosh paths the following fixes and checks are performed:

    • All backslashes (\) are converted to forward slashes (/), except for NFSNamespace.

    • Ensures only the terminal path node contains wild cards.

    • If isParent is set to TRUE and dataSetName does not end with first separator (if supported by the nameSpaceType on the target service), backslash (\), or forwardslash (/), a forwardslash (/) is added to the end of the path.

    • If the path contains “:/” or :\,” the slash is removed from the path, if the first separator for the nameSpaceType is a “ : ”.

  • For all Macintosh paths the following checks and fixes are performed:

    • If isParent is TRUE and dataSetName does not end with a colon, a colon is added to the end of the path.

    • If isParent is TRUE, dataSetName is checked to ensure it contains a colon or double colon.

The values that can be set for nameSpaceType is listed in the following table.

Value

Description

0x000

DOSNameSpace

0x001

MACNameSpace

0x002

NFSNameSpace

0x003

FTAMNameSpace

0x004

OS2NameSpace

0x100

DOSNameSpaceUtf8Type

0x101

MACNameSpaceUtf8Type

0x102

NFSNameSpaceUtf8Type

0x104

LONGNameSpaceUtf8Type

The following table lists the wild cards options that can be used in the terminal path node.

Value

Option

Description

0x2A

ASTERISK

Regular asterisk

0x3F

QUESTION

Regular question mark

0xAE

SPERIOD

Special Period-the most significant bit set.

0xAA

SASTERISK

Special Asterisk-the most significant bit set.

0xBF

SQUESTION

Special Question-with the most significant bit set.

If NWSMTSFixDataSetName encounters an error as it tries to fix the path, a NULL string is returned in newDataSetName.

NWSMTS_INVALID_PATH is returned if dataSetname meets one or more of the following conditions:

  • dataSetName is a parent and does not contain valid first separator, if the nameSpaceType supports a first separator on the target service..

  • Non-Macintosh path nodes, other than the terminal path node, contain wild cards.

  • wildAllowedOnTerminal is set to FALSE and non-Macintosh paths contain wild cards.

  • The path is improperly formatted.

The engine is responsible for freeing the memory held by newDataSetName. To free this buffer, call NWSMFreeString. (See Storage Management Services Utility Library).

NOTE:NWSMTSFixDataSetName will eventually replace the utility function NWSMFixDirectoryPath (see Storage Management Services Utility Library).