DATASERV (kapputils) functions


LIBRARY ROUTINE

lkcall_free - go through a list of objects and free them using the necesssary routines, typically kfree_and_NULL() or kpds_close_object().

LIBRARY CALL

int lkcall_free(klist *p)

INPUT

none

OUTPUT

none

RETURN VALUE

TRUE if successful, FALSE if a failure occurs.

DESCRIPTION

Given an list of type *klist, step through each entry and free memory resources according the the following scheme: 1) if the client_data for the list entry is "KMALLOC", then call kfree_and_NULL() on the list identifier. If the client_data for the list object is "KOBJECT", then call kpds_close_object() on the list identifier.

By immediately adding items that allocate dynamic memory resources to the klist, a single call to lkcall_free() will return all of those resources in a systematic and reliable manner. This routines is called, for example, by the KCALL() macro, which relieves the programmer of the need to check the return value of each kpds, kdms, or other Data Services call and to clean up if a failure occurs.

Items can be added to or removed from the object list by using the routines klist_add() and klist_delete() from the kutils(3) library.

ADDITIONAL INFORMATION

None.

EXAMPLES

none

SIDE EFFECTS

none

RESTRICTIONS

Restrictions on data or input as applicable

MODIFICATION

none

FILES

$DATASERV/objects/library/kapputils/src/utilities.c

SEE ALSO

kapputils(3), kutils(3)

COPYRIGHT

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