#include #include #include "ItemInterface.h" #include #include /********************************************************************** * * Function: AssignItem * Input: DLnkNodePtr reciever -- The node to recieve item * MovieNode sender -- The item to insert into the node * * Returns: void * * Description: * This function sets information in the node * * Variables: int count -- a counter * * Called by: SetItem * * Calls: strcpy * toupper * * Author: Tim McGaughey * Revisions: none * Version: 1.0 * * **********************************************************************/ void AssignItem(DLnkNodePtr reciever, MovieNode sender) { for (int count=0;count < filenamelength;count++) sender.filename[count]=toupper(sender.filename[count]); strcpy(reciever->Item.filename,sender.filename); } /********************************************************************** * * Function: EqualTo * Input: DLnkNodePtr comparee -- The new node to compare * DLnkNodePtr comparor -- The node to compare against * * Returns: Boolean TRUE if equal FALSE if not * * Description: * This function tests for equality * * Variables: none * * Called by: Insert * Remove * * Calls: strcmp * * Author: Tim McGaughey * Revisions: none * Version: 1.0 * * **********************************************************************/ Boolean EqualTo(DLnkNodePtr comparee, DLnkNodePtr comparor) { if (!strcmp(comparee->Item.filename, comparor->Item.filename)) return TRUE; else return FALSE; } /********************************************************************** * * Function: LessThan * Input: DLnkNodePtr comparee -- The new node to compare * DLnkNodePtr comparor -- The node to compare against * * Returns: Boolean TRUE if less FALSE if not * * Description: * This function determines if parameter 1 is less than paramater 2 * * Variables: none * * Called by: Insert * Remove * * Calls: strcmp * * Author: Tim McGaughey * Revisions: none * Version: 1.0 * * **********************************************************************/ Boolean LessThan(DLnkNodePtr comparee, DLnkNodePtr comparor) { if (strcmp(comparee->Item.filename , comparor->Item.filename) < 0) return TRUE; else return FALSE; } /********************************************************************** * * Function: GreaterThan * Input: DLnkNodePtr comparee -- The new node to compare * DLnkNodePtr comparor -- The node to compare against * * Returns: Boolean TRUE if greater FALSE if not * * Description: * This function determines if parameter 1 is greater than paramater 2 * * Variables: none * * Called by: Insert * Remove * * Calls: strcmp * * Author: Tim McGaughey * Revisions: none * Version: 1.0 * * **********************************************************************/ Boolean GreaterThan(DLnkNodePtr comparee, DLnkNodePtr comparor) { if (strcmp(comparee->Item.filename,comparor->Item.filename) > 0) return TRUE; else return FALSE; }