Time Converters


Time converters are used to specify how time is converted from a numeric representation to a string representation, and vice versa. SmartSockets provides a number of standard time converters. You also have the option of building your own converters.

The list of known time converters can be traversed with the function TutTimeCvtTraverse. It uses a traversal function defined in this way:

typedef T_PTR (*T_TIME_CVT_TRAV_FUNC)
   (T_STR name, T_TIME_CVT time_cvt, T_PTR arg); 

The specified traversal function must be defined with these arguments. The traversal function is called for each time converter currently defined, with the name, converter, and user defined argument specified in the call to TutTimeCvtTraverse.

When a time converter is created using TutTimeCvtCreate, the caller must specify two functions that are used to convert between string and numeric representations. These functions are defined in this way:

typedef T_BOOL (*T_TIME_CVT_NUM_TO_STR_FUNC) 
(T_REAL8 time_num, T_STR *time_str_return); 
 
typedef T_BOOL (*T_TIME_CVT_STR_TO_NUM_FUNC) 
(T_STR time_str, T_REAL8 *time_num_return); 

They return TRUE if the conversion was successful, and FALSE otherwise.

When a time converter is destroyed, a user-specified function can be called, if specified in the call to TutTimeCvtCreate. This function is defined in this way:

void (*T_TIME_CVT_DESTROY_FUNC)(void); 

TIBCO SmartSockets™ Utilities
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com