#include #include #include #include "list.h" void append( LIST_EL **head, LIST_EL *element ) { LIST_EL *ptr; if( *head == NULL ) { *head = element; return; } ptr = *head; while( ptr->next != NULL ) ptr = ptr->next; ptr->next = element; } LIST_EL *search( LIST_EL *head, char *key ) { LIST_EL *ptr; if( head == NULL ) return( NULL ); ptr = head; while( ptr != NULL ) { if( !strcmp( key, ptr->word ) ) return( ptr ); ptr = ptr->next; } return( NULL ); } void dispose( LIST_EL **head ) { LIST_EL *ptr; while( *head != NULL ) { ptr = *head; *head = ptr->next; free( ptr->word ); free( ptr ); } }