gtpc2mi3 | C/C++ Language Support User's Guide |
This function sets the TPF collection support (TPFCS) text dump function on or off. TextDump is an OPR dump that TPFCS will issue on any call to the TO2_getErrorText function. Normally, application programs will only issue a TO2_getErrorText request when the program has received an unexpected error code from a TPFCS request. Turning on the TO2_setGetTextDump function allows a dump to be taken and the problem resolved. The state of the TO2_setGetTextDump attribute is saved and restored after every IPL.
Format
#include <c$to2.h> long TO2_setGetTextDump (TO2_ENV_PTR env_ptr, char *state[]);
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_NOT_INIT
TO2_ERROR_PARAM
Programming Considerations
By issuing a TO2_getClassAttributes request for class, TPFCS will retrieve the current attribute value for the TextDump function.
Examples
The following example sets the TextDump attribute state to ON.
#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 */ char textDumpOn[3]="ON"; /* value to turn text dump on */ TO2_ERR_CODE to2_rc=1; /* return code receiver */ TO2_ERR_TEXT_PTR err_textPtr; /* TO2 error code text pointer */
·
·
·
{ if ((to2_rc = TO2_setGetTextDump(env_ptr, textDumpOn)) == TO2_ERROR) { to2_rc = TO2_getErrorCode(env_ptr); err_textPtr = TO2_getErrorText(env_ptr, to2_rc); printf ("TO2_setGetTextDump failed, error code - %d\n ", to2_rc); printf ("TO2 Error Text is %s\n ", err_textPtr); } else printf("TO2 Text Dump turned ON\n"); }
The following example sets the TextDump attribute state to OFF.
#include <c$to2.h> /* Needed for TO2 API Functions */ TO2_ENV_PTR env_ptr; /* Pointer to TO2 environment */ char textDumpOff[4]="OFF"; /* turn text dump off */ TO2_ERR_CODE to2_rc=1; /* return code receiver */ TO2_ERR_TEXT_PTR err_textPtr; /* TO2 error code text pointer */
·
·
·
{ if ((to2_rc = TO2_setGetTextDump(env_ptr, textDumpOff)) == TO2_ERROR) { to2_rc = TO2_getErrorCode(env_ptr); err_textPtr = TO2_getErrorText(env_ptr, to2_rc); printf ("TO2_setGetTextDump failed, error code - %d\n ", to2_rc); printf ("TO2 Error Text is %s\n ", err_textPtr); } else printf("TO2 Text Dump turned OFF\n"); }
Related Information