void hdr_Destroy( msg_Headers headers ) { ldestroy( headers->mail ); ldestroy( headers->text ); headers->text = headers->mail = NULL; Free( headers ); }
/* * Free mount-specific data. */ static void lo_freevfs(struct vfs *vfsp) { struct loinfo *li = vtoli(vfsp); ldestroy(li); kmem_free(li, sizeof (struct loinfo)); }
static void del_Header( void * ptr ) { if( ptr ) { msg_Header header = (msg_Header)ptr; Free( header->name ); ldestroy( header->values ); } }
/*-------------------------------------------------- | ldestroy_cb | | destroy an existing list data structure, calling | the user routine 'ucleanup' on the data pointer | of each list element. Allows the user to free | up a list data structure and have this routine | call their function to free up each list element | at the same time. --------------------------------------------------*/ void ldestroy_cb ( LISTID lid, void (*ucleanup)(void * data_ptr) ) { LIST * l; LISTNODE * ln; l = (LIST *)lid; CKLMAGIC(l); ln = l->top; while (ln != NULL) { ucleanup ( ln->data ); ln = ln->next; } ldestroy ( l ); }