Site hosted by Angelfire.com: Build your free website today!

(c) 2002 - Pedro Flynn <pflynn@microsoftsucks.org>

destroyfunc


typedef
void (destroyfunc)(void*);




    Functions of the type destroyfunc are functions that provides a way to free dynamically allocated data when
a YACLib's data structure is going to be destroyed. (Ex: when a LList is destroyed by calling llist_destroy, or a Graph is destroyed by calling graph_destroy).  Every YACLib's data structure has a member named destroy
that is a pointer to a destroyfunc. This function is passed to the data structure when the structure is created, passing the pointer to the destroyfunc to the function that creates the structure (Ex: llist_create for a LList, heap_create for a Heap, and so on). If the data to be destroyed were dynammically allocated by the malloc(2) function, this pointer should be set to free(2). If data is a structure containing several dynammically allocated data members, this pointer should be set to a user defined function that calls free(2) for each one of the dynammically allocated meber of the structure. If the data should not be freed, this pointer should be set to NULL.