Diff for /rpl/src/formateur_fichiers.c between versions 1.71 and 1.72

version 1.71, 2013/04/19 09:11:57 version 1.72, 2013/04/19 11:05:08
Line 85  formateur_fichier(struct_processus *s_et Line 85  formateur_fichier(struct_processus *s_et
     struct_liste_chainee        *l_liste1;      struct_liste_chainee        *l_liste1;
     struct_liste_chainee        *l_liste2;      struct_liste_chainee        *l_liste2;
   
       struct_objet                *s_format_tmp;
     struct_objet                *s_sous_objet;      struct_objet                *s_sous_objet;
     struct_objet                *s_sous_objet_1;      struct_objet                *s_sous_objet_1;
     struct_objet                *s_sous_objet_2;      struct_objet                *s_sous_objet_2;
Line 1673  formateur_fichier(struct_processus *s_et Line 1674  formateur_fichier(struct_processus *s_et
                                   
                     chaine_sauvegarde = chaine;                      chaine_sauvegarde = chaine;
   
                       // Si le format_sortie vaut 'N', on remplace le format par
                       // { "native*(*)" }. L'intérêt est de pouvoir traiter une
                       // liste par un format "native*(*)".
   
                       if ((format_sortie == 'N') && ((*(*l_element_courant)
                               .donnee).type == LST))
                       {
                           if ((s_format_tmp = allocation(s_etat_processus, LST))
                                   == NULL)
                           {
                               return(NULL);
                           }
   
                           if (((*s_format_tmp).objet = allocation_maillon(
                                   s_etat_processus)) == NULL)
                           {
                               return(NULL);
                           }
   
                           (*((struct_liste_chainee *) (*s_format_tmp).objet))
                                   .suivant = NULL;
   
                           if (((*((struct_liste_chainee *) (*s_format_tmp).objet))
                                   .donnee = allocation(s_etat_processus, CHN))
                                   == NULL)
                           {
                               return(NULL);
                           }
   
                           if (((*(*((struct_liste_chainee *) (*s_format_tmp)
                                   .objet)).donnee).objet = malloc(11 *
                                   sizeof(unsigned char))) == NULL)
                           {
                               (*s_etat_processus).erreur_systeme =
                                       d_es_allocation_memoire;
                               return(NULL);
                           }
   
                           strcpy((unsigned char *) (*(*((struct_liste_chainee *)
                                   (*s_format_tmp).objet)).donnee).objet,
                                   "native*(*)");
                       }
                       else
                       {
                           if ((s_format_tmp = copie_objet(s_etat_processus,
                                   s_format, 'P')) == NULL)
                           {
                               return(NULL);
                           }
                       }
   
                     if ((chaine_formatee = formateur_fichier(s_etat_processus,                      if ((chaine_formatee = formateur_fichier(s_etat_processus,
                             (*l_element_courant).donnee, s_format,                              (*l_element_courant).donnee, s_format,
                             longueur, longueur_champ, format_sortie, type,                              longueur, longueur_champ, format_sortie, type,
                             longueur_effective, recursivite, export_fichier))                              longueur_effective, recursivite, export_fichier))
                             == NULL)                              == NULL)
                     {                      {
                           liberation(s_etat_processus, s_format_tmp);
                         free(chaine);                          free(chaine);
                         return(NULL);                          return(NULL);
                     }                      }
   
                       liberation(s_etat_processus, s_format_tmp);
   
                     if ((*(*l_element_courant).donnee).type == CHN)                      if ((*(*l_element_courant).donnee).type == CHN)
                     {                      {
                         chaine = (unsigned char *)                          chaine = (unsigned char *)
Line 3785  formateur_fichier(struct_processus *s_et Line 3840  formateur_fichier(struct_processus *s_et
                     }                      }
   
                     free(format_chaine);                      free(format_chaine);
                   
                       // Si le format_sortie vaut 'N', on remplace le format par
                       // { "native*(*)" }. L'intérêt est de pouvoir traiter une
                       // liste par un format "native*(*)".
   
                       if ((format_sortie == 'N') && ((*(*l_element_courant)
                               .donnee).type == LST))
                       {
                           if ((s_format_tmp = allocation(s_etat_processus, LST))
                                   == NULL)
                           {
                               return(NULL);
                           }
   
                           if (((*s_format_tmp).objet = allocation_maillon(
                                   s_etat_processus)) == NULL)
                           {
                               return(NULL);
                           }
   
                           (*((struct_liste_chainee *) (*s_format_tmp).objet))
                                   .suivant = NULL;
   
                           if (((*((struct_liste_chainee *) (*s_format_tmp).objet))
                                   .donnee = allocation(s_etat_processus, CHN))
                                   == NULL)
                           {
                               return(NULL);
                           }
   
                           if (((*(*((struct_liste_chainee *) (*s_format_tmp)
                                   .objet)).donnee).objet = malloc(11 *
                                   sizeof(unsigned char))) == NULL)
                           {
                               (*s_etat_processus).erreur_systeme =
                                       d_es_allocation_memoire;
                               return(NULL);
                           }
   
                           strcpy((unsigned char *) (*(*((struct_liste_chainee *)
                                   (*s_format_tmp).objet)).donnee).objet,
                                   "native*(*)");
                       }
                       else
                       {
                           if ((s_format_tmp = copie_objet(s_etat_processus,
                                   s_format, 'P')) == NULL)
                           {
                               return(NULL);
                           }
                       }
   
                     if ((chaine_formatee = formateur_fichier(s_etat_processus,                      if ((chaine_formatee = formateur_fichier(s_etat_processus,
                             (*l_element_courant).donnee, s_format,                              (*l_element_courant).donnee, s_format_tmp,
                             longueur, longueur_champ, format_sortie, type,                              longueur, longueur_champ, format_sortie, type,
                             longueur_effective, recursivite, export_fichier))                              longueur_effective, recursivite, export_fichier))
                             == NULL)                              == NULL)
                     {                      {
                           liberation(s_etat_processus, s_format_tmp);
                         free(chaine);                          free(chaine);
                         return(NULL);                          return(NULL);
                     }                      }
   
                       liberation(s_etat_processus, s_format_tmp);
   
                     if ((chaine = realloc(chaine,                      if ((chaine = realloc(chaine,
                             ((size_t) (longueur_totale + (*longueur_effective)))                              ((size_t) (longueur_totale + (*longueur_effective)))
                             * sizeof(unsigned char))) == NULL)                              * sizeof(unsigned char))) == NULL)
Line 3811  formateur_fichier(struct_processus *s_et Line 3920  formateur_fichier(struct_processus *s_et
                     free(chaine_formatee);                      free(chaine_formatee);
                 }                  }
   
                 nombre_elements++;  
                 l_element_courant = (*l_element_courant).suivant;  
   
                 if (format_sortie != 'N')                  if (format_sortie != 'N')
                 {                  {
                     l_element_courant_format =                      l_element_courant_format =
                             (*l_element_courant_format).suivant;                              (*l_element_courant_format).suivant;
                 }                  }
   
                   nombre_elements++;
                   l_element_courant = (*l_element_courant).suivant;
             }              }
   
             if (format_sortie != 'N')              if (format_sortie != 'N')

Removed from v.1.71  
changed lines
  Added in v.1.72


CVSweb interface <joel.bertrand@systella.fr>