/* Author: Susan Mitchell */ /* File : Inventory.c */ #include #include #include #include "Inventory.h" /* The "static" reserved word restricts the scope of a variable */ /* to the file in which it resides. Therefore, "head" and "tail" */ /* are not global to the entire program. */ static CdNode* head; static CdNode* tail; void initializeList() { head = NULL; tail = NULL; } CdNode* createNode(Cd* aCd) { CdNode* temp = (CdNode*) malloc(sizeof(CdNode)); temp->info = aCd; temp->next = NULL; return temp; } void destroyNode(CdNode* aCd) { destroyCd(aCd->info); free(aCd); } void emptyList(){ CdNode* currNode; CdNode* nextNode; currNode = head; while (currNode != NULL) { nextNode = currNode->next; destroyNode (currNode); currNode = nextNode; } initializeList(); } void insertNode(Cd* aCd) { /* Complete this function */ } void deleteOutOfStock(){ /* Complete this function */ } CdNode* findNode (char* artist, char*title) { /* Complete this function */ } int computeNumNodes() { /* Complete this function */ } float computeValue() { /* Complete this function */ } void printList() { CdNode* currNode; if (head == NULL) printf("List is empty\n"); else { currNode = head; while (currNode != NULL) { printCd(currNode->info); currNode = currNode->next; } } } void printOutOfStock() { /* Complete this function */ }