/* Author: Susan Mitchell */ /* File : Inventory.h */ #ifndef INVENTORY_H #define INVENTORY_H #include "Cd.h" typedef struct inode { Cd* info; struct inode* next; } CdNode; void initializeList (); CdNode* createNode (Cd* aCd); void destroyNode (CdNode* aNode); void emptyList (); /* Inserts a node into the list according to the date it was */ /* received by the store, from most recent to oldest. */ /* */ /* Parameters: */ /* aCd = pointer to a cd structure */ void insertNode (Cd* aCd); /* Deletes all nodes that contain cds that are out of stock */ void deleteOutOfStock(); /* Searches the list for a cd based on artist and title. */ /* */ /* Returns: */ /* NULL pointer if not found */ /* Otherwise, pointer to the node */ /* */ /* Parameters: */ /* artist = cd artist to be located */ /* title = cd title to be located */ CdNode* findNode(char* artist, char* title); /* Computes the number of nodes in the list */ /* */ /* Returns: */ /* Number of nodes in the list */ int computeNumNodes(); /* Computes the monetary value of the entire stock of cds */ /* */ /* Returns: */ /* Monetary value of entire stock of cds */ float computeValue(); void printList(); /* Prints the information for all cds that are out of stock */ void printOutOfStock(); #endif