DATASERV (kdataman) functions


LIBRARY ROUTINE

kdms_remove_callback - remove a callback associated with an object's data or attribute.

LIBRARY CALL

int
kdms_remove_callback(
   kobject     object,
   char       *segment,
   char       *type,
   kfunc_void  callfunc,
   kaddr       clientData)

INPUT

OUTPUT

none

RETURN VALUE

TRUE on success, FALSE otherwise

DESCRIPTION

This function is used to remove a callback that was previously added on a segment in a data object so that operations can be performed and monitored in an event driven environment.

This function will not remove a callback unless all of the arguments that are passed to it are the same as those passed to the kdms_create_callback previously. This allows for multiple callbacks that are similar in nature to be removed without confusion.

A callback is a mechanism for operating on a data object whenever an asynchronous event occurs rather than in a strictly sequential manner. This function is particularly useful in conjunction with kdms_reference. The callbacks operate on the data, which is shared between referenced objects. Thus object A can set a callback such that when data get changed via object B, operations can be performed on object A.

The object and segment arguments are used to specify which segment and object will have the callback added to.

The type argument specifies what kind of callback should be added. This argument may take on the following values:

KDMS_CALLBACK_CHANGE - generate a callback whenever data on the specified segment is changed (via kdms_put_data or kdms_copy_data). KDMS_CALLBACK_ACCESS - generate a callback whenever data on the specified segment is accessed (via kdms_get_data or kdms_copy_data). KDMS_CALLBACK_DELETE - generate a callback whenever the segment specified is about to be deleted, either through a kdms_destroy_segment() call, or via a kdms_close(). KDMS_CALLBACK_DESTROY - generate a callback whenever the last instance of an object or segment is about to be closed. KDMS_CALLBACK_SAVE - generate a callback whenever the specified segment is about to be changed. This is similar to the KDMS_CALLBACK_CHANGE, except that the callback is generated before the data is changed rather than afterward.

If the segment specified is NULL, then the callback is placed on the entire object. Currently, only DELETE and DESTROY callbacks can be placed on an object.

The callback mechanims in Data Services are analogous to the callback mechanisms that are available in the Xvwidget library or in Xt. The motivation for callbacks in Data Services is that they facilitate functionality in the Xvisual library, where they allow different visual objects tied to a single data object to communicate with each other.

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

none

RESTRICTIONS

Only KDMS_CALLBACK_DELETE and KDMS_CALLBACK_DESTROY callbacks work for objects.

MODIFICATION

none

FILES

$DATASERV/objects/library/kdataman/src/callbacks.c

SEE ALSO

kdataman(3)

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.