//int main(int argc, char *argv[]); // argv = [&"a.out\0", &"test.txt\0", "\0"] int main(int argc, char **argv){ printf("[%s", *argv); for(int i=1; i<argc; i++){ printf(", %s", *(argv+i)); } printf("]\n"); printf("hello world.\n"); printf("# scope\n"); sc_pe(); printf("# bit\n"); b_t(); printf("# pointer\n"); p_inter(); printf("# file\n"); f_le(); printf("# thread\n"); thr_ad(); printf("# struct\n"); str_ct(); printf("# sizeof\n"); s_zeof(); printf("# function\n"); f_nction(); }
unsigned int parsing(const char **av, t_tree **elem, t_tree **err) { int cpt; unsigned int op; int ok; t_both *both; cpt = 1; op = 0; ok = 1; both = (t_both *)malloc(sizeof(t_both)); if (!both) return (ft_error_gestion("malloc failed in parsing()", 2), 0); while (av[cpt] && ok) { op = legal_option(av[cpt], op, &ok); if (ok || (av[cpt][0] == '-' && av[cpt][1] && av[cpt][1] == '-')) cpt++; } both->func = how_option_create(op); while (av[cpt]) { both->s = ft_strdup(av[cpt++]); if (choose_print(op) == normal_print) { ft_putstr(both->s); ft_putendl(" :"); } b_t(both, err, elem, choose_print(op)); } free(both); return (ft_map_tree(*err, print_nofile_ordir), op); }