#include #include #define USAGE "Commands are a single character followed optionally by a number. The valid commands are:\n\t- a (add a number to the list)\n\t- p (print the list)\n\t- r (remove value from the list if present)\n\t- q (quit)" list * create_list(){ } list * add_value(list * l, int num){ } list * remove_value(list * l, int num){ } void print(list * l){ } int main(int argc, char * argv[]){ int done = 0; char input[32]; char cmd; int data; int count; list * l = create_list(); printf("%s\n", USAGE); while (! done){ printf("Enter a command: "); if (fgets(input, 32, stdin) == NULL){ printf("%s\n", USAGE); }else{ count = sscanf(input,"%c %d\n", &cmd, &data); switch (cmd){ case 'a': if (count != 2){ printf("a should be followed by a number to add\n"); }else{ l = add_value(l, data); } break; case 'r': if (count != 2){ printf("r should be followed by a number to remove\n"); }else{ l = remove_value(l, data); } break; case 'p': print(l); break; case 'q': done = 1; break; default: printf("%s\n", USAGE); } } } return 0; }