/* liste_test.c */


#include <stdio.h>
#include <ctype.h>
#include "liste.h"

int main(void)
{
  t_data dneu;
  char menu[20];
  int end = 0;

  do {
    printf("Insert, Delete, Show, WritetoFile, ReadfromFile, Exit ? ");
    scanf("%s", menu);
    switch (toupper(menu[0])) {
      case 'I':
        printf("New value : "); scanf(FORMAT, &dneu);
        if (insert(dneu))
          printf("Successfully added!\n");
        show();
        break;
      case 'D':
        printf("Value : "); scanf(FORMAT, &dneu);
        if (delete(dneu))
          printf("Successfully deleted!\n");
        show();
        break;
      case 'S':
        show();
        break;
      case 'W':
        writefile();
        break;
      case 'R':
        readfile();
        break;
      case 'E':
        end = 1;
        break;
      default:
        printf("Unknown command\n");
    }
  } while (!end);

  return 0;
}