Ive been given this assignment to do, and I have no idea how to go about it. Unluckily the coin toss gave me module B to do which is the hardest!

Module B

Overview:

This module performs the storage and retrieval of all records. The records reside in memory only. On demand, data are passed back to the user-interface module for display.

This module implements only the records database, not user interface.



Module B Application Programming Interface (API):



Module B should provide the public routines specified below. These routines must not use the user interface in any way except in case of debugging. Nothing else is acceptable.

In addition:

Module B must use one file of code only named: database.c

All function prototypes for module B must be declared in a header file database.h, so that userInterface.c can include this.





The following definition must be also provided in database.h:





Code:
typedef struct {

     char surname[21],   /* student surname  */

     char firstname[21], /* buffer to receive message */

     char studentID[7],  /* student identifier */

     int  studentAge     /* age of student in years */

     } STUDENT_RECORD;



Public routines:

studentRecordNew( )
NAME
studentRecordNew ( ) create a new student record

SYNOPSIS
Int studentRecordNew
(STUDENT_RECORD * studentRecord ; /* IN: the data for the new record */)
DESCRIPTION
This routine creates a new student record in the database. It checks if the student already exists.

RETURNS
True: if a new record is created.
False: if student ID already exists. No record is created.


studentRecordUpdate( )
NAME
studentRecordUpdate ( ) update a new student record

SYNOPSIS
Int studentRecordUpdate
(STUDENT_RECORD * studentRecord ; /* IN: the update data */)
DESCRIPTION
This routine updates a student record in the database. It checks if the student already exists. Any parameters that are set will be used to update the record. Unused string parameters must be set to the empty string '\0'. Unused studentAge parameter must be set to -1.

RETURNS
True: if the record is updated.
False: if student ID does not exist or any other problem occurs.





studentRecordGet( )
NAME
studentRecordGet ( ) returns a student record

SYNOPSIS
Int studentRecordGet
(char * studentID; /* IN: id of record to be retrieved */
STUDENT_RECORD * studentRecord ; /* OUT: the student record data */)
DESCRIPTION
Takes as input parameter a possible student ID. The routine checks whether the student exists. If the student exists then the routine returns the data in parameter studentRecord. This function can be used to get the data or just to check that a student exists.

RETURNS
True: if the student exists in the database.
False: if student ID does not exist.

studentRecordDelete( )
NAME
studentRecordDelete( ) deletes a student record from the database

SYNOPSIS
Int studentRecordDelete
(char * studentID; /* IN: id of record to be deleted */)
DESCRIPTION
Takes as input parameter a possible student ID. The routine checks if the student exists. If the student exists then the routine deletes the student from the database.

RETURNS
True: if the deletion is successful.
False: if student ID does not exist.
I would really apreciate any help you can give me. My problems are mainly:

I have no idea what should go in the header file and
How to store the records (array? etc)