#include /* #include */ #include #include #include "lists.h" #define NEW(type) (calloc(1,sizeof(type))) /* Inserer un chaine de caracteres en tete de liste */ List list_add(LIST_CONTENT_TYPE *c, List old) { List new=NEW(struct lnode); new->content=c; if(old == NULL) return new; new->next=old; return new; } int list_length(List l) { int i; for(i = 0; l!= NULL; l=l->next,i++) ; return i; } List list_find(const LIST_CONTENT_TYPE *c, List l) { List start=l; for(;l!= NULL; l=l->next) { if(LIST_CONTENT_EGAL(c,l->content)) return l; } return NULL; }