/** * Copyright (c): Uwe Schmidt, FH Wedel * * You may study, modify and distribute this source code * FOR NON-COMMERCIAL PURPOSES ONLY. * This copyright message has to remain unchanged. * * Note that this document is provided 'as is', * WITHOUT WARRANTY of any kind either expressed or implied. */ #ifndef LIST_H__ #define LIST_H__ 1 /*--------------------*/ #define eqElement(x,y) (compare((x),(y)) == 0) #define geElement(x,y) (compare((x),(y)) >= 0) /*--------------------*/ typedef struct Node *List; struct Node { Element info; List next; }; /*--------------------*/ extern List mkEmptyList(void); extern int isEmptyList(List l); extern Element head(List l); extern List tail(List l); /*--------------------*/ extern List removeHead(List l); extern List cons(Element e, List l); extern List addElem(Element e, List l); /*--------------------*/ /* consistency check for sorted lists */ extern int invList(List l); /*--------------------*/ #endif