gtpc2mhn | C/C++ Language Support User's Guide |
This function returns a temporary sequence collection that, when decoded, describes the attributes of a record file address as they pertain to TPF collection support (TPFCS).
Format
#include <c$to2.h> long TO2_getRecordAttributes (TO2_PID_PTR attrList_ptr, TO2_ENV_PTR env_ptr, void *fileAddr_ptr);
Normal Return
The normal return is a positive value, which indicates that processing was completed normally; it does not necessarily mean that there were no errors reported in the collection for the record at that file address.
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_METHOD
Programming Considerations
Enter an explicit TO2_deleteCollection function call when you have completed processing the returned temporary collection even though the temporary collection is automatically deleted when the entry control block ECB exits to ensure system resources used by that collection are cleanly released back to the system for reuse.
Examples
The following example obtains a temporary sequence collection that, when decoded, describes the attributes of a record file address as they pertain to TPFCS.
#include <c$to2.h> /* Needed for TO2 API Functions */ #include <stdio.h> /* APIs for standard I/O functions */ TO2_PID_PTR attrList_ptr; /* return area for PID */ TO2_ENV_PTR env_ptr; /* Pointer to TO2 environment */ void *fileAddr_ptr;
·
·
·
/* create an environment and set fileAddr_Ptr to point to the file */ /* address of the record whose information you want to display. */
·
·
·
if (TO2_getRecordAttributes(attrList_ptr, env_ptr, fileAddr_ptr) == TO2_ERROR ) { printf("TO2_getRecordAttributes failed!\n"); process_error(env_ptr); } else printf("TO2_getRecordAttributes successful!\n");
·
·
·
TO2_deleteCollection(attrList_ptr, env_ptr);
Related Information