--- rpl/src/formateur.c 2017/07/11 16:04:53 1.86 +++ rpl/src/formateur.c 2017/07/12 15:42:42 1.87 @@ -3320,29 +3320,59 @@ formateur(struct_processus *s_etat_proce } else if ((*s_objet).type == EXT) { - if ((__type_disp = dlsym((*s_objet).descripteur_bibliotheque, - "__type_disp")) == NULL) + l_element_courant = (*s_etat_processus).s_bibliotheques; + + while(l_element_courant != NULL) + { + if ((*((struct_bibliotheque *) (*l_element_courant).donnee)) + .descripteur == (*s_objet).descripteur_bibliotheque) + { + if ((__type_disp = dlsym((*s_objet).descripteur_bibliotheque, + "__type_disp")) == NULL) + { + // Symbole externe non affichable + + if ((chaine = malloc((strlen( + "External symbol (disp function not found)") + 1) + * sizeof(unsigned char))) == NULL) + { + (*s_etat_processus).erreur_systeme = + d_es_allocation_memoire; + return(NULL); + } + + strcpy(chaine, "External symbol (disp function not found)"); + } + else + { + // Symbole externe affichable + void **arg; + + arg = (void **) &s_objet; + __type_disp(s_etat_processus, arg); + chaine = (unsigned char *) (*arg); + } + + break; + } + + l_element_courant = (*l_element_courant).suivant; + } + + if (l_element_courant == NULL) { // Symbole externe non affichable if ((chaine = malloc((strlen("External symbol") + 1) * sizeof(unsigned char))) == NULL) { - (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; + (*s_etat_processus).erreur_systeme = + d_es_allocation_memoire; return(NULL); } strcpy(chaine, "External symbol"); } - else - { - // Symbole externe affichable - void **arg; - - arg = (void **) &s_objet; - __type_disp(s_etat_processus, arg); - chaine = (unsigned char *) (*arg); - } } else {