void pick_sort(t_files *begin, int *flags) { if (!begin) return ; if (flags[3]) sort_rev_alpha(begin); else if (flags[4]) sort_date(begin); else if (flags[5]) sort_rev_date(begin); else sort_alpha(begin); }
void data_proc(t_file *dir) { dir->next = NULL; dir = rewind_lst(dir); if (no_perm(dir) && g_flags[FLAG_R] == 1 && g_flags[FLAG_T] == 1) rsort_date(dir); else if (g_flags[FLAG_R] == 1 && g_flags[FLAG_T] != 1) rsort_dir(dir); else if (no_perm(dir) && g_flags[FLAG_R] != 1 && g_flags[FLAG_T] == 1) sort_date(dir); else sort_dir(dir); if (g_flags[FLAG_RR] != 1) print_dir(dir, 0); else ft_recurs(dir); ft_free_dir_lst(dir); }