TutPtrAryChangeCbCreate create a callback that is called when a pointer array changes
T_CB TutPtrAryChangeCbCreate(ptr_ary, change_func, arg
) T_PTR_ARYptr_ary
; T_PTR_ARY_CHANGE_CB_FUNCchange_func
; T_CB_ARGarg
;
ptr_ary
pointer array to register the change callback for
change_func
callback function
arg
callback function argument
New callback if successful, NULL
otherwise.
If TutPtrAryChangeCbCreate fails, it returns NULL
and sets the global SmartSockets error number to:
TutPtrAryChangeCbCreate attaches the change_func
callback to ptr_ary
. When an item in ptr_ary
is inserted or removed, change_func
is called with three arguments:
The T_ENTRY declaration specifier is required in the definition of all callback functions in addition to their prototypes.
This example displays output when a pointer array changes:
void T_ENTRY PtrAryChanged(ptr_ary, data, arg) T_PTR_ARY ptr_ary; T_PTR_ARY_CHANGE_CB_DATA data; T_CB_ARG arg; { TutOut("Pointer array change reason is %d.\n", data->reason); }/* PtrAryChanged */
.
. . T_CB cb; cb = TutPtrAryChangeCbCreate(ptr_ary, PtrAryChanged, NULL); if (cb == NULL) {/* error */
}
TIBCO SmartSockets™ Utilities Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |