Diff for /rpl/src/transliteration.c between versions 1.16 and 1.17

version 1.16, 2010/08/10 18:02:43 version 1.17, 2010/08/13 21:00:37
Line 50  transliteration(struct_processus *s_etat Line 50  transliteration(struct_processus *s_etat
     unsigned char       *codage_sortie_transliteral;      unsigned char       *codage_sortie_transliteral;
     unsigned char       *tampon;      unsigned char       *tampon;
   
 #   ifdef OS2  
     unsigned char       *ptr_e;;  
     unsigned char       *ptr_l;;  
     unsigned char       *tampon2;  
   
     unsigned long       i;  
 #   endif  
   
     if ((codage_sortie_transliteral = malloc((strlen(codage_sortie)      if ((codage_sortie_transliteral = malloc((strlen(codage_sortie)
             + strlen("//TRANSLIT") + 1) * sizeof(unsigned char))) == NULL)              + strlen("//TRANSLIT") + 1) * sizeof(unsigned char))) == NULL)
     {      {
Line 71  transliteration(struct_processus *s_etat Line 63  transliteration(struct_processus *s_etat
             codage_entree, codage_sortie_transliteral);              codage_entree, codage_sortie_transliteral);
     free(codage_sortie_transliteral);      free(codage_sortie_transliteral);
   
 #   ifdef OS2  
   
     i = 0;  
     ptr_l = tampon;  
   
     while((*ptr_l) != d_code_fin_chaine)  
     {  
         if ((*ptr_l) == '\n')  
         {  
             i++;  
         }  
   
         ptr_l++;  
     }  
   
     if ((tampon2 = malloc((strlen(tampon) + i + 1) * sizeof(unsigned char)))  
             == NULL)  
     {  
         (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;  
         return(NULL);  
     }  
   
     ptr_e = tampon2;  
     ptr_l = tampon;  
   
     while((*ptr_l) != d_code_fin_chaine)  
     {  
         (*ptr_e) = (*ptr_l);  
   
         if ((*ptr_l) == '\n')  
         {  
             (*(++ptr_e)) = '\r';  
             ptr_e++;  
             ptr_l++;  
         }  
         else  
         {  
             ptr_e++;  
             ptr_l++;  
         }  
     }  
   
     free(tampon);  
     tampon = tampon2;  
   
 #   endif  
   
     return(tampon);      return(tampon);
 }  }
   
Line 213  reencodage(struct_processus *s_etat_proc Line 158  reencodage(struct_processus *s_etat_proc
 ================================================================================  ================================================================================
   Entrées :    Entrées :
 --------------------------------------------------------------------------------  --------------------------------------------------------------------------------
   Sorties :  
 --------------------------------------------------------------------------------  --------------------------------------------------------------------------------
     iorties :
   Effets de bord : néant    Effets de bord : néant
 ================================================================================  ================================================================================
 */  */
Line 296  localisation_courante(struct_processus * Line 241  localisation_courante(struct_processus *
   
     verrouillage_threads_concurrents(s_etat_processus);      verrouillage_threads_concurrents(s_etat_processus);
     pid = fork();      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);      deverrouillage_threads_concurrents(s_etat_processus);
   
     pthread_sigmask(SIG_SETMASK, &oldset, NULL);      pthread_sigmask(SIG_SETMASK, &oldset, NULL);
Line 600  localisation_courante(struct_processus * Line 556  localisation_courante(struct_processus *
             return;              return;
         }          }
   
         (*s_etat_processus).localisation = tampon;          if (strlen(tampon) > 0)
           {
               (*s_etat_processus).localisation = tampon;
           }
           else
           {
               free(tampon);
   
               if (((*s_etat_processus).localisation = malloc((strlen(d_locale)
                       + 1) * sizeof(unsigned char))) == NULL)
               {
                   (*s_etat_processus).erreur_systeme = d_es_processus;
                   return;
               }
   
               strcpy((*s_etat_processus).localisation, d_locale);
           }
   
         if (sigaction(SIGINT, &action_passee, NULL) != 0)          if (sigaction(SIGINT, &action_passee, NULL) != 0)
         {          {
Line 689  transliterated_fprintf(struct_processus Line 661  transliterated_fprintf(struct_processus
   
     va_start(arguments, format);      va_start(arguments, format);
   
   #   ifdef OS2
       unsigned char       *ptr_e;;
       unsigned char       *ptr_l;;
       unsigned char       *tampon3;
   
       unsigned long       i;
   #   endif
   
     if (valsprintf(&tampon, format, arguments) < 0)      if (valsprintf(&tampon, format, arguments) < 0)
     {      {
         va_end(arguments);          va_end(arguments);
Line 719  transliterated_fprintf(struct_processus Line 699  transliterated_fprintf(struct_processus
         tampon2 = tampon;          tampon2 = tampon;
     }      }
   
   #   ifdef OS2
       i = 0;
       ptr_l = tampon2;
   
       while((*ptr_l) != d_code_fin_chaine)
       {
           if ((*ptr_l) == '\n')
           {
               i++;
           }
   
           ptr_l++;
       }
   
       if ((tampon3 = malloc((strlen(tampon2) + i + 1) * sizeof(unsigned char)))
               == NULL)
       {
           (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
           return(NULL);
       }
   
       ptr_e = tampon3;
       ptr_l = tampon2;
   
       while((*ptr_l) != d_code_fin_chaine)
       {
           (*ptr_e) = (*ptr_l);
   
           if ((*ptr_l) == '\n')
           {
               (*(++ptr_e)) = '\r';
               ptr_e++;
               ptr_l++;
           }
           else
           {
               ptr_e++;
               ptr_l++;
           }
       }
   
       (*ptr_e) = d_code_fin_chaine;
   
       free(tampon2);
       tampon2 = tampon3;
   #   endif
   
 #   ifdef SunOS  #   ifdef SunOS
     while((ios = fprintf(flux, "%s", tampon2)) < 0)      while((ios = fprintf(flux, "%s", tampon2)) < 0)
     {      {

Removed from v.1.16  
changed lines
  Added in v.1.17


CVSweb interface <joel.bertrand@systella.fr>