#ifndef _LIST_H #define _LIST_H #include "node.h" // list relies on node to work struct list { Node *start; // pointer to start of list Node *end; // pointer to end of list int qty; // running tally of nodes in list }; typedef struct list List; // because we deserve nice things List *mklist(void ); // create/allocate new list struct List *cplist(List *); // copy (duplicate) list List *rmlist(List *); // remove all nodes from list List *insert (List *, Node *, Node *); // add node before given node List *append (List *, Node *, Node *); // add node after given node List *obtain (List *, Node ** ); // obtain/disconnect node from list void displayf(List *, int); // display list from start to end void displayb(List *, int); // display list in reverse order int getpos(List *, Node *); // retrieve position from given node Node *setpos(List *, int ); // seek to indicated node in list Node *searchlist(List *, int); // locate node containing value List *sortlist (List *, int); // sort list (according to mode) List *swapnode(List *, Node *, Node *); // swap positions of given nodes in list #endif