gtpc2mbwC/C++ Language Support User's Guide

TO2_associateRecoupIndexWithPID-Create a PID to Index Association

This function associates a recoup index with a collection.

Format

#include <c$to2.h>
long TO2_associateRecoupIndexWithPID (const TO2_PID_PTR  pid_ptr,
                                            TO2_ENV_PTR  env_ptr,
                                      const void        *indexName);

pid_ptr
The pointer to the persistent identifier (PID) assigned to the collection.

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

indexName
The pointer to the 8-byte recoup index name that will be assigned to the collection.

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.

The following error codes are common for this function:

TO2_ERROR_ENV

TO2_ERROR_PID

Programming Considerations

Examples

The following example assigns a recoup index to a collection.

#include <c$to2.h>                  /* Needed for TO2 API Functions    */
#include <stdio.h>                  /* APIs for standard I/O functions */
 
TO2_PID          collect;           /* Target object's PID             */
TO2_ENV_PTR      env_ptr;           /* Pointer to TO2 environment      */
u_char         * indexName;         /* index identifier                */

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

Related Information