gtpc2mhaC/C++ Language Support User's Guide

TO2_getDSnameForPID-Determine the DS Name for a PID

This function determines the data store (DS) name for a persistent identifier (PID).

Format

#include <c$to2.h>
long  TO2_getDSnameForPID(const TO2_PID_PTR  pid_ptr,
                                TO2_ENV_PTR  env_ptr,
                                char    dsname[TO2_MAX_DSNAME] );

pid_ptr
The pointer to the PID whose DS name will be determined.

env_ptr
The pointer to the environment as returned by the TO2_createEnv function.

dsname
The return field for the DS name. The character string must be 8 characters or greater in length.

Normal Return

The normal return is a positive value.

Error Return

An error return is indicated by a zero. When zero is returned, use the TO2_getErrorCode function to determine the specific error code. For more information, see Error Handling.

Programming Considerations

None.

Examples

The following example retrieves the DS name for the PID indicated.

#include <c$to2.h>             /* Needed for TO2 API functions    */
#include <stdio.h>             /* APIs for standard I/O functions */
long         err_code;
TO2_ENV_PTR  env_ptr;          /* Pointer to TO2 environment      */
TO2_PID      collect;
char         dsname[8];

  ·
  ·
  ·
if (TO2_getDSnameForPID(&collect, env_ptr, dsname) == TO2_ERROR) { printf("TO2_getDSnameForPID failed!\n"); process_error(env_ptr); } else { printf("TO2_getDSnameForPID successful!\n"); }

Related Information