TutCbDestroy


Name

TutCbDestroy — destroy a callback and remove it from the list

Synopsis

T_BOOL TutCbDestroy(cb) 
T_CB cb; 

Arguments

cb — callback to be destroyed

Return Values

TRUE if successful, FALSE otherwise.

Diagnostics

None

Description

This function destroys a callback. cb is removed from the list to which it belongs and is never called again. Once this function is called, cb is no longer valid. The pointer should not be referenced again.

Caution

Do not use cb after destroying it.

See Also

TutCbSetPriority

Examples

This example creates a callback and then destroys it when called. The result is a callback that is processed exactly once.

static void T_ENTRY time_change_cb(dummy, data, arg) 
T_PTR dummy; /* always NULL */ 
T_TIME_CHANGE_CB_DATA data; 
T_CB_ARG arg; 
{ 
  TutOut("Time change callback called\n"); 
  if (!TutCbDestroy(data->cb)) { 
  /* error */ 
  } 
} 
... 
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