/* Linklist.h */ /* Chris Kern * * This is the header file for the linked list program. */ /* Type definitions */ /* Nodes are defined as having a string field representing the contents, a pointer * to the next node in the list, and a pointer to the previous node in the list. */ struct node { char *item; struct node *next; struct node *previous; }; /* Lists have a first node, a last node, and a cursor. */ struct list { struct node *first; struct node *last; struct node *cursor; }; /* Function prototypes for linklist.c */ struct node *new_list(char *contents); struct node *add_to_end(char *contents, struct node *first); struct node *find_node(char *thing, struct node *first); int delete_node(char *toBeDeleted, struct node *first); int write_list(struct node *first); int f_write_list(char *filename, struct node *first); struct node *f_read_list(char *filename); /* Function prototypes for listwrapper.c */ struct list *CreateList(char *contents); int AddToEnd(char *contents, struct list *list); int AddToFront(char *contents, struct list *list); int AddCurrent(char *contents, struct list *list); char *GetValue(struct list *list); int SetValue(char *new_contents, struct list *list); int Advance(struct list *list); int GoBack(struct list *list); void Reset(struct list *list); int FindElement(char *toFind, struct list *list); int DeleteElement(char *toBeDeleted, struct list *list); int DeleteCurrentElement(struct list *list); int WriteList(struct list *list); int SaveList(char *filename, struct list *list); struct list *LoadList(char *filename); int SortList(struct list *list); /* Function prototypes for listtester.c */ void printinfo(); void clearbuf(); /* Function prototypes for quicksort.c */ struct list *quicksort(struct list *list);