/* stringlist.h header file */ /* function declarations */ void addToEnd(struct list, char *); void addToFront(struct list, char *); void setContents(struct node *, char *); void setNext(struct node *, struct node); void setPrev(struct node *, struct node); char *getContents(struct node *); struct node getNext(struct node *); struct node getPrev(struct node *); struct node makeNode(char *, struct node *, struct node *); void advance(struct list); int atEnd(struct list); void printList(struct list); struct node { /* our behind the scenes node struct */ char *contents; /* contents of the node */ struct node *next; /* pointer to the next node */ struct node *prev; /* pointer to the previous node */ }; /* struct node */ struct list { /* wrapper struct (for extra fun) */ struct node *current; /* pointer to our current node */ struct node *front; /* pointer to the front of the list */ struct node *back; /* pointer to the back of the list */ int len; /* the length of our list */ }; /* struct list */