gtpc2mho | C/C++ Language Support User's Guide |
This function is used to get the TPF collection support (TPFCS) recoup index that a persistent identifier (PID) is associated with.
Format
#include <c$to2.h> #include <c$to2r.h> TO2_BUF_PTR TO2_getRecoupIndex ( TO2_PID_PTR pid_ptr, TO2_ENV_PTR env_ptr, const void *indexName);
Normal Return
The normal return is a sequence collection. When there is a normal return, it contains a copy of the data requested in a TO2_RCPIDX structure and is formatted as follows:
When there is a normal return, it contains a copy of the elements of the collection whose PID is returned in a TO2_RCPIDX_ENTRY structure and is formatted as follows:
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 code is common for this function:
TO2_ERROR_ENV
Programming Considerations
This function does not use TPF transaction services on behalf of the caller.
Examples
The following example adds an entry to an index.
#include <c$to2.h> /* Needed for TO2 API Functions */ #include <stdio.h> /* APIs for standard I/O functions */ TO2_ENV_PTR env_ptr; /* Pointer to TO2 environment */ TO2_PID collect; /* */ void *indexName; /* index key */
·
·
·
if (TO2_getRecoupIndex(&collect, env_ptr, indexName) == TO2_ERROR) { process_error() err_code = TO2_getErrorCode(env_ptr); printf ("TO2_getRecoupIndex failed, error code - %d\n ", to2_rc); printf ("TO2 Error Text is %s\n ", err_textPtr); } else printf("Index name is %\n", indexName);
Related Information