gtpc2mheC/C++ Language Support User's Guide

TO2_getListDSnames-Retrieve the Defined Data Store Names

This function returns a sequence collection of defined data store (DS) names and other associated information about the data store.

Format

#include <c$to2.h>
long  TO2_getListDSnames (TO2_PID_PTR   pid_ptr,
                          TO2_ENV_PTR   env_ptr);

pid_ptr
The pointer to the field to hold the returned temporary persistent identifier (PID) assigned to the created temporary sequence collection.

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

Normal Return

The sequence collection contains one element per defined data store. The format of the data area of the element is as follows:

struct  dsElement
{
     char      dataStoreName[8];
     char      SSname[4];
     u_char    inventory_pid[32];
}

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 sequence collection of data store names 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;

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

Related Information