/* Kevin Thorley and Chris Darmetko */

#include <stdio.h>
#include "MyDB.h"

int
main(void) {

  int rc;

  printf("CreateDB:\n");
  if (rc=CreateDB("mydb", "movies.txt")) { error(rc); }
  printf("\n");
  
  printf("\nPrintDB\n");
  if (rc=PrintDB("mydb")) {error(rc);}
 
  printf("\nRecordScan\n");
  if ((rc=RecordScan("mydb", 4, "8.9")) < 0) {error(rc); }

  printf("\nKeyScan\n");
  if ((rc=KeyScan("mydb", "107712")) < 0) {error(rc); }

  printf("\nInsertRecord\n");
  if (rc=InsertRecord("mydb", "59734&Deep Blue See&2000&2&8.8")) {error(rc); }

  printf("\nDeleteRecord\n");
  if (rc=DeleteRecord("mydb", "107712")) {error(rc); }

  printf("\nModifyRecord\n");
  if (rc=ModifyRecord("mydb", "97141", 4, "8.8")) {error(rc); }

  printf("\nPrintDB\n");
  if (rc=PrintDB("mydb")) {error(rc); }

  return 0;
}
