--- rpl/src/transliteration.c 2010/08/13 21:00:37 1.17 +++ rpl/src/transliteration.c 2010/09/02 07:51:48 1.21 @@ -1,6 +1,6 @@ /* ================================================================================ - RPL/2 (R) version 4.0.18 + RPL/2 (R) version 4.0.19 Copyright (C) 1989-2010 Dr. BERTRAND Joël This file is part of RPL/2. @@ -241,17 +241,6 @@ localisation_courante(struct_processus * verrouillage_threads_concurrents(s_etat_processus); pid = fork(); - -# ifdef OS2 - if (pid == 0) - { - sem_init(&semaphore_liste_threads, 0, 1); - sem_init(&semaphore_gestionnaires_signaux, 0, 0); - sem_init(&semaphore_gestionnaires_signaux_atomique, 0, 1); - sem_init(&((*s_etat_processus).semaphore_fork), 0, 0); - } -# endif - deverrouillage_threads_concurrents(s_etat_processus); pthread_sigmask(SIG_SETMASK, &oldset, NULL); @@ -472,6 +461,8 @@ localisation_courante(struct_processus * return; } + tampon[0] = d_code_fin_chaine; + # ifndef SEMAPHORES_NOMMES if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) # else @@ -607,21 +598,16 @@ localisation_courante(struct_processus * { // Le processus fils renvoie une erreur. -# ifndef SEMAPHORES_NOMMES - while(sem_wait(&((*s_etat_processus).semaphore_fork)) == -1) -# else - while(sem_wait((*s_etat_processus).semaphore_fork) == -1) -# endif + free(tampon); + + if (((*s_etat_processus).localisation = malloc((strlen(d_locale) + + 1) * sizeof(unsigned char))) == NULL) { - if (errno != EINTR) - { - (*s_etat_processus).erreur_systeme = d_es_processus; - return; - } + (*s_etat_processus).erreur_systeme = d_es_processus; + return; } - (*s_etat_processus).erreur_execution = d_ex_erreur_processus; - return; + strcpy((*s_etat_processus).localisation, d_locale); } # ifndef SEMAPHORES_NOMMES @@ -817,6 +803,20 @@ tex_fprintf(struct_processus *s_etat_pro return(ios); } +#undef readline + +unsigned char * +readline_wrapper(unsigned char *invite) +{ + unsigned char *chaine; + + chaine = readline(invite); + printf("\r"); + + return(chaine); +} + + #define fprintf NULL #define printf NULL