int my_ls(char *d, char *options) { DIR *dir; t_dirent *file; t_list *list; char *tmp; list = NULL; dir = opendir(d); check_dir_functions(d, dir, 0); while (file = readdir(dir)) { if (file->d_name[0] != '.') { if (find_in_tab(options, 'l') == 0 || find_in_tab(options, 'd') == 0) launch_options(file, options, &list, d); else my_put_in_list(&list, file->d_name, file->d_type, d); } } check_dir_functions(d, dir, 1); if (find_in_tab(options, 'l') == 0) clean_list_syntax(list); my_sort_list(list, options); my_show_long_list(list, options, d); return (0); }
void PauseMenu::treat_choice (int choice) { switch (choice) { case 1: // resume game set_leave_menu_true(); break; case 2: // options launch_options(); break; case 3: // leave game set_leave_game_true(); break; default: break; } }