int main(int ac, char **av, char **env) { char *s; ac = ac; av = av; my_env = tab_to_list(env); while (42) { if (signal(SIGINT, sig_handler) == SIG_ERR) printf("Error while trying to catch SIGINT.\n"); prompt(my_env); s = get_next_line(0); if (s != NULL) { if (strlen(s) != 0) parsing(s, 0, &my_env); free(s); } else break ; } my_free_list(my_env); return (0); }
int main(void) { t_data the; the.start = NULL; the.end = NULL; the = information(the); the.list = tab_to_list(the); if (the.start == NULL || the.end == NULL) error(); the = ft_link(the); journey(the); free(the.link); return (0); }
//créé l'arbre de huffman à partir du tableau de répétition Arbre * creer_arbre_huffman(int tab_repetition[]) { Arbre * a; Arbre * a1; Arbre * a2; liste_chainee *liste; int taille_fichier = somme_element(tab_repetition); liste = tab_to_list(tab_repetition); afficher(liste); while(liste->arbre->proba != taille_fichier) { a1 = recherche_mini(liste); liste = supprimerElement(liste, a1); a2 = recherche_mini(liste); liste = supprimerElement(liste, a2); a = ajouter_nouveau_parent(a1,a2,0,((a1->proba) +(a2->proba))); //printf("proba : a1 %d a2 %d a %d \n",a1->proba,a2->proba,a->proba); liste= ajouterElement(liste, a); } return liste->arbre; }