Diff for /rpl/src/transliteration.c between versions 1.20 and 1.39

version 1.20, 2010/08/26 19:07:42 version 1.39, 2011/08/30 14:19:28
Line 1 Line 1
 /*  /*
 ================================================================================  ================================================================================
   RPL/2 (R) version 4.0.19    RPL/2 (R) version 4.1.3
   Copyright (C) 1989-2010 Dr. BERTRAND Joël    Copyright (C) 1989-2011 Dr. BERTRAND Joël
   
   This file is part of RPL/2.    This file is part of RPL/2.
   
Line 105  reencodage(struct_processus *s_etat_proc Line 105  reencodage(struct_processus *s_etat_proc
   
     chaine_sortie[0] = d_code_fin_chaine;      chaine_sortie[0] = d_code_fin_chaine;
   
     if ((buffer_sortie = malloc((d_LONGUEUR + 1) * sizeof(char))) == NULL)      if ((buffer_sortie = malloc((d_LONGUEUR + 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);          return(NULL);
Line 131  reencodage(struct_processus *s_etat_proc Line 132  reencodage(struct_processus *s_etat_proc
             }              }
         }          }
   
         tampon = (unsigned char *) chaine_sortie;          tampon = chaine_sortie;
         (*pointeur) = d_code_fin_chaine;          (*pointeur) = d_code_fin_chaine;
   
         if ((chaine_sortie = malloc((strlen(tampon) + strlen(buffer_sortie) + 1)          if ((chaine_sortie = malloc((strlen(tampon) + strlen(buffer_sortie) + 1)
Line 158  reencodage(struct_processus *s_etat_proc Line 159  reencodage(struct_processus *s_etat_proc
 ================================================================================  ================================================================================
   Entrées :    Entrées :
 --------------------------------------------------------------------------------  --------------------------------------------------------------------------------
     Sorties :
 --------------------------------------------------------------------------------  --------------------------------------------------------------------------------
   iorties :  
   Effets de bord : néant    Effets de bord : néant
 ================================================================================  ================================================================================
 */  */
Line 175  localisation_courante(struct_processus * Line 176  localisation_courante(struct_processus *
     int                         pipes_sortie[2];      int                         pipes_sortie[2];
     int                         status;      int                         status;
   
     logical1                    drapeau_fin;  
   
     long                        i;      long                        i;
     long                        nombre_arguments;      long                        nombre_arguments;
   
Line 216  localisation_courante(struct_processus * Line 215  localisation_courante(struct_processus *
     arguments[2] = NULL;      arguments[2] = NULL;
   
     nombre_arguments = 2;      nombre_arguments = 2;
     drapeau_fin = d_faux;  
   
     if (pipe(pipes_entree) != 0)      if (pipe(pipes_entree) != 0)
     {      {
Line 686  transliterated_fprintf(struct_processus Line 684  transliterated_fprintf(struct_processus
     }      }
   
 #   ifdef OS2  #   ifdef OS2
     i = 0;      if ((flux == stdin) || (flux == stdout))
     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;          i = 0;
         return(NULL);          ptr_l = tampon2;
     }  
   
     ptr_e = tampon3;          while((*ptr_l) != d_code_fin_chaine)
     ptr_l = tampon2;          {
               if ((*ptr_l) == '\n')
               {
                   i++;
               }
   
     while((*ptr_l) != d_code_fin_chaine)              ptr_l++;
     {          }
         (*ptr_e) = (*ptr_l);  
   
         if ((*ptr_l) == '\n')          if ((tampon3 = malloc((strlen(tampon2) + i + 1) *
                   sizeof(unsigned char))) == NULL)
         {          {
             (*(++ptr_e)) = '\r';              (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
             ptr_e++;              return(NULL);
             ptr_l++;  
         }          }
         else  
           ptr_e = tampon3;
           ptr_l = tampon2;
   
           while((*ptr_l) != d_code_fin_chaine)
         {          {
             ptr_e++;              (*ptr_e) = (*ptr_l);
             ptr_l++;  
               if ((*ptr_l) == '\n')
               {
                   (*(++ptr_e)) = '\r';
                   ptr_e++;
                   ptr_l++;
               }
               else
               {
                   ptr_e++;
                   ptr_l++;
               }
         }          }
     }  
   
     (*ptr_e) = d_code_fin_chaine;          (*ptr_e) = d_code_fin_chaine;
   
     free(tampon2);          free(tampon2);
     tampon2 = tampon3;          tampon2 = tampon3;
       }
 #   endif  #   endif
   
 #   ifdef SunOS  #   ifdef SunOS
Line 803  tex_fprintf(struct_processus *s_etat_pro Line 804  tex_fprintf(struct_processus *s_etat_pro
     return(ios);      return(ios);
 }  }
   
   #undef readline
   
 unsigned char *  unsigned char *
 readline_wrapper(unsigned char *invite)  readline_wrapper(unsigned char *invite)
 {  {
     unsigned char       *chaine;      unsigned char       *chaine;
     unsigned char       *i;  
   
     chaine = readline(invite);      chaine = readline(invite);
     printf("\r");      printf("\r");

Removed from v.1.20  
changed lines
  Added in v.1.39


CVSweb interface <joel.bertrand@systella.fr>