OS1/movies/movies.c

72 lines
1.2 KiB
C
Raw Normal View History

#include "movies.h"
2023-10-13 01:39:26 -07:00
int main(int argc, char** argv) {
2023-10-13 01:39:26 -07:00
if(argc < 2) {
printf("Please Specify Filename\n");
return 64;
}
2023-10-13 01:39:26 -07:00
struct node* head = parse_csv(argv[1]);
2023-10-13 01:39:26 -07:00
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;
}
2023-10-13 01:39:26 -07:00
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");
}