TutTimeChangeCbCreate


Name

TutTimeChangeCbCreate — create a time change callback

Synopsis

T_CB TutTimeChangeCbCreate(func, arg) 
T_TIME_CHANGE_CB_FUNC func; 
T_PTR arg; 

Arguments

func — time change callback function to be called

arg — argument to be passed to the callback function

Return Values

Returns pointer to created callback. NULL is returned if callback could not be created.

Diagnostics

None

Description

TutTimeChangeCbCreate creates a time change callback that is called whenever the value of data time changes. The value of data time is changed with the functions TutSetCurrentTime and TutSetCurrentTimeStruct. Whenever the value of time is changed, func is called with arg as the callback argument.

Caution

None

See Also

TutTimeChangeCbLookup, TutSetCurrentTime, TutSetCurrentTimeStruct

Examples

This example creates a time change callback to print the value of time when it changes:

void T_ENTRY time_change_cb(dummy, data, arg) 
T_PTR dummy; /* not used */ 
T_TIME_CHANGE_CB_DATA data; 
T_PTR arg; 
{ 
  TutOut("Data time is: %d.%06d\n", 
       data->time->sec, data->time->usec); 
} 
 
if (TutTimeChangeCbCreate(time_change_cb, NULL) == NULL) { 
  /* error */ 
} 

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