gtpc2mh6 | C/C++ Language Support User's Guide |
Whenever TPF collection support (TPFCS) creates a collection, it will time stamp the collection with the current time. This function copies the created time value from the specified collection and returns it in the field provided.
Format
#include <c$to2.h> long TO2_getCreateTime (const TO2_PID_PTR pid_ptr, TO2_ENV_PTR env_ptr, void *timeRetPtr);
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_PID
TO2_ERROR_ZERO_PID
TO2_ERROR_DELETED_PID
TO2_ERROR_NOT_INIT
Programming Considerations
None.
Examples
The following example copies the created time value for the provided collection.
#include <c$to2.h> /* Needed for TO2 API functions */ long getCreationTime(const TO2_PID_PTR pid_ptr, TO2_ENV_PTR env_ptr, double * timeRetPtr) /* */ /* copy the create time value from the input collection */ /* and return it to the caller. */ /* returns 0 if successful otherwise -1 if an error occurs. */ /* */ {
·
·
·
if (TO2_getCreateTime(pid_ptr, env_ptr, timeRetPtr) == TO2_ERROR) { process_error(env_ptr); return -1; } return 0; }
Related Information