71 lines
1.2 KiB
C
71 lines
1.2 KiB
C
#include "movies.h"
|
|
|
|
int main(int argc, char** argv) {
|
|
|
|
if(argc < 2) {
|
|
printf("Please Specify Filename\n");
|
|
return 64;
|
|
}
|
|
|
|
struct node* head = parse_csv(argv[1]);
|
|
|
|
enum OPTIONS menu_select = 0;
|
|
while(1) {
|
|
|
|
menu_select = menu();
|
|
|
|
switch(menu_select) {
|
|
case YEAR:
|
|
movie_year(head);
|
|
break;
|
|
case RATE:
|
|
movie_rate(head);
|
|
break;
|
|
case LANGUAGE:
|
|
movie_lang(head);
|
|
break;
|
|
case EXIT:
|
|
printf("Goodbye~\n");
|
|
return 0;
|
|
default:
|
|
printf("You naughty~ Pick a correct option next time.\n");
|
|
}
|
|
|
|
}
|
|
print_movies(head);
|
|
|
|
return 0;
|
|
}
|
|
|
|
int menu() {
|
|
|
|
int option = 0;
|
|
|
|
printf("1. Show movies released in the specified year\n");
|
|
printf("2. Show highest rated movie for each year\n");
|
|
printf("3. Show the title and year of release of all movies in a specific language\n");
|
|
printf("4. Exit from the program\n\n");
|
|
|
|
while(option > 4 || option < 1) {
|
|
printf("Enter a choice from 1 to 4: ");
|
|
scanf("%i", &option);
|
|
}
|
|
|
|
return option;
|
|
}
|
|
|
|
void movie_year(struct node* head) {
|
|
printf("stub\n");
|
|
|
|
}
|
|
|
|
void movie_rate(struct node* head) {
|
|
printf("stub\n");
|
|
|
|
}
|
|
|
|
void movie_lang(struct node* head) {
|
|
|
|
printf("stub\n");
|
|
|
|
}
|