+ dprintf(outfd,"[list] list initilaization ...\n");
+
+ list->outfd=outfd;
+ list->start=NULL;
+ list->current=NULL;
+
+ return L_SUCCESS;
+}
+
+int list_del_next(t_list *list,t_list_element *element) {
+
+ t_list_element *tmp;
+
+ if(element==NULL) {
+ dprintf(list->outfd,"[list] empty element\n");
+ return L_INVALID_ELEMENT;
+ }
+
+ if(element->next!=NULL) {
+ dprintf(list->outfd,"[list] destroying element number %d\n"
+ tmp=element->next->next;
+ if(element->next->data!=NULL) free(element->next->data);
+ free(element->next);
+ element->next=tmp;
+ }
+ else {
+ dprintf(list->outfd,"[list] no next element\n");
+ return L_NO_NEXT_ELEMENT;
+ }
+
+ return L_SUCCESS;
+}
+
+int list_destroy(t_list *list) {
+
+ if(list->start==NULL) {
+ dprintf(list->outfd,"[list] empty list\n");
+ return L_EMPTY_LIST;
+ }
+
+ list->current=list->start;
+
+ while(list->current->next!=NULL)
+ list_del_next(list,list->current);