void ls_l(char *arg) { t_file file; t_file **tab; t_llu llu; llu.total = 0; if (!(fill_tab(&tab, arg, &llu))) return ; sort_tab(&tab, &llu); if (!g_d) print_total(&llu); printfilelist(tab, llu.size, arg); llu.i = 0; while (llu.i < llu.size) { file = *((t_file *)tab[llu.i]); if (g_re && S_ISDIR(file.stats.st_mode) && ft_strcmp(file.name, ".") && ft_strcmp(file.name, "..")) llu.total = 0, ft_putchar('\n'), ft_putstr(ft_burger(arg, '/', file.name)), ft_putendl(":"), ls_l(ft_burger(arg, '/', file.name)); llu.i++; } free_ls(tab, &llu); }
int main(int ac, char **av) { char **tab = malloc(sizeof(char *) * ac); int i = 1; int j = 0; if (ac < 2) { my_putstr("\n"); return 0; } if (av[1] == NULL) { my_putstr("\n"); return 0; } while (i < ac) { if (av[i] != NULL) tab[j] = strdup(av[i]); j++; ++i; } tab[i] = NULL; qsort(&tab[0], tab_len(tab), sizeof(char *), cmpstringp); tab = sort_tab(tab); aff_tab(tab); my_putstr("\n"); return 0; }
void sprite_casting(t_env *e, t_trac_data *d) { t_spricast va; showgun(e); init_sprite_tab(e); sort_tab(e); va.i = -1; while (++(va.i) < e->sprites_nbr) { set_trans_xy(e, &va); set_sprite_draw_strt_nd(&va, d, e); d->x = d->draw_start - 1; while (++(d->x) < d->draw_end) print_my_sprite(e, d, &va); } gun_to_img(e); }