gtpc2mhx | C/C++ Language Support User's Guide |
This function returns a sequence collection containing the head of chain file address for the collection specified for use by recoup.
Format
#include <c$to2.h> long TO2_recoupCollection (const TO2_PID_PTR pid_ptr, TO2_ENV_PTR env_ptr, TO2_PID_PTR rpid_ptr);
Normal Return
The sequence collection contains one 8-byte element per pool file chain for the target collection. The format of this element (representing the head of the file chain) is as follows:
struct chainElement { u_char recordID[2]; u_char reserved[2]; u_char file_Address[8]; }
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_RECOUP_ABORT
Programming Considerations
When the caller is done with the returned collection, delete the collection by using the TO2_deleteCollection function.
Examples
The following example recoups the specified collection.
#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, TO2_PID returnPidPtr;
·
·
·
if (TO2_recoupCollection(&collect, env_ptr, &returnPidPtr) == TO2_ERROR) { printf("TO2_recoupCollection failed!\n"); process_error(env_ptr); } else { printf("TO2_recoupCollection successful!\n"); }
Related Information