#ifndef CLASS_LIST_H #define CLASS_LIST_H #include "Student.h" typedef struct snode { Student* data; struct snode* next; } StudentNode; StudentNode* CreateNode (Student* aStudent); void DestroyNode (StudentNode* aNode); void InitializeList (void); void EmptyList (void); int GetCount (void); void Append (Student* aStudent); void Prepend (Student* aStudent); /* Insert a Student into the list at the specified position. */ /* The positions in the list are numbered beginning with 1. */ /* This function creates a new node and inserts it so that */ /* occupies the specifies position. */ /* */ /* Parameters: */ /* position = Position at which to insert the new node */ /* aStudent = Pointer to a Student structure */ /* */ /* Pre-conditions: */ /* position should be > 0 and <= number of students + 1 */ void Insert (int position, Student* aStudent); /* Delete node from the list at the specified position. */ /* The positions in the list are numbered beginning with 1. */ /* This function destroys the node. */ /* */ /* Parameters: */ /* position = Position at which to delete a node */ /* */ /* Pre-conditions: */ /* position should be > 0 and <= number of students */ void Delete (int position); /* Search the list for Student with the specified Id Number. */ /* */ /* Returns: */ /* 0 if not found */ /* Otherwise, position number where found */ /* */ /* Parameters: */ /* idNum = Student Id Number */ int Find (long idNum); void PrintList (void); /* Dumps the list for debugging purposes. Shows the following */ /* information: */ /* */ /* Current number of nodes */ /* Value of head and tail (addresses) */ /* For each node: */ /* Position number */ /* Address of node */ /* Value of next (an address) */ void DumpList (void); #endif