TutCbGetArgument


Name

TutCbGetArgument — get the callback argument of the specified callback

Synopsis

T_BOOL TutCbGetArgument(cb, arg_return) 
T_CB cb; 
T_CB_ARG *arg_return; 

Arguments

cb — callback to get argument for

arg_return — pointer to location for the argument

Return Values

TRUE if successful, FALSE otherwise.

Diagnostics

None

Description

TutCbGetArgument returns the callback argument that is associated with cb.

Caution

Pass in the address of a T_CB_ARG variable; otherwise, unexpected results may occur.

See Also

TutCbSetArgument

Examples

This example gets the argument of a callback and prints it out:

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, argument: %s\n", arg); 
  if (T_STREQI(arg, "hello")) { 
    TutCbSetArgument(data->cb, "bye"); 
  } 
  else { 
    TutCbSetArgument(data->cb, "hello"); 
  } 
} 
T_CB cb; 
T_PTR cb_arg; 
 
cb = TutTimeChangeCbCreate(time_change_cb, "hello"); 
/* other code */ 
 
if (!TutCbGetArgument(cb, &cb_arg)) { 
  /* error */ 
} 
TutOut("Callback argument: %s\n", (T_STR)cb_arg); 

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