gtpc2mbk | C/C++ Language Support User's Guide |
This function is called to delete the environment block and the environment created when the TO2_createEnv function was called.
Format
#include <c$to2.h> long TO2_deleteEnv (TO2_ENV_PTR env_ptr);
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 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 deletes a TPFCS user environment.
#include <c$to2.h> /* TO2 API function prototypes */ #include <stdio.h> /* APIs for standard I/O functions */ TO2_ENV_PTR env_ptr; /* TO2 environment pointer */
·
·
·
if (TO2_deleteEnv(env_ptr) == TO2_ERROR) printf("deleteEnv failed!\n"); else printf("deleteEnv is successful!\n");
Related Information