// Function: handleChoice // Input: Takes chars 'f', 'p', 't' 'w' 'h' or 'q'. Any inccorect input will prompt user to type a valid char. // Output: Various prompts for each choice will ask the user to type in either messages/tweets they wish to post or friends // they wish to become friends with. Can display organize posts or tweets with wall page or home page. // Description: If choice is 'q', will return 1 which closes AubieBook. int Menu::handleChoice(char choice) { int returnValue = 0; switch(choice) { case 'f': // Add friend promptAddFriend(); break; case 'p': // Post a message promptPostMessage(); break; case 't': // Post a message promptTweet(); break; case 'w': // Display Wal Page displayWall(); break; case 'h': // Display Home Page displayHomePage(); break; case 'q': // Exit program displayExit(); returnValue = 1; } return returnValue; }
void error(char *fmt, ...) { va_list ap; cpuExit(); mmuExit(); memoryExit(); timerExit(); displayExit(); keyboardExit(); termExit(); diskExit(); outputExit(); graphExit(); cExit(); va_start(ap, fmt); fprintf(stderr, "Error: "); vfprintf(stderr, fmt, ap); fprintf(stderr, "\n"); va_end(ap); exit(1); }