/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        A J O U T   E V E N T U E L   D ' U N   ' $K_NL '   A U   B O U T   D ' U N   F I C H I E R  :                             */
/*                                                                                                                                   */
/*                                                                                                                                   */
/*        Author of '$xcp/ferme_K_NL$K' :                                                                                            */
/*                                                                                                                                   */
/*                    Jean-Francois COLONNA (LACTAMME, 1997??????????).                                                              */
/*                                                                                                                                   */
/*************************************************************************************************************************************/

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        I N T E R F A C E   ' listG '  :                                                                                           */
/*                                                                                                                                   */
/*                                                                                                                                   */
/*        :Debut_listG:                                                                                                              */
/*        :Fin_listG:                                                                                                                */
/*                                                                                                                                   */
/*************************************************************************************************************************************/

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        D I R E C T I V E S   S P E C I F I Q U E S   D E   C O M P I L A T I O N  :                                               */
/*                                                                                                                                   */
/*************************************************************************************************************************************/
@define   PRAGMA_CL_____PAS_DE_LIBRAIRIES_DYNAMIQUES

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        F I C H I E R S   D ' I N C L U D E S  :                                                                                   */
/*                                                                                                                                   */
/*************************************************************************************************************************************/
#include  INCLUDES_MINI

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        P A R A M E T R E S  :                                                                                                     */
/*                                                                                                                                   */
/*************************************************************************************************************************************/
#define   COMPATIBILITE_20030926                                                                                                        \
                    FAUX                                                                                                                \
                                        /* Permet d'obtenir un comportement compatible a celui anterieur au 20030926095521.          */

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        M A C R O S   U T I L E S  :                                                                                               */
/*                                                                                                                                   */
/*************************************************************************************************************************************/

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        A J O U T   E V E N T U E L   D ' U N   ' $K_NL '   A U   B O U T   D ' U N   F I C H I E R  :                             */
/*                                                                                                                                   */
/*************************************************************************************************************************************/
BCommande(nombre_d_arguments,arguments)
/*-----------------------------------------------------------------------------------------------------------------------------------*/
     Bblock
     DEFV(Logical,INIT(compatibilite_20030926,COMPATIBILITE_20030926));
                                        /* Permet d'obtenir un comportement compatible a celui anterieur au 20030926095521.          */

     DEFV(Char,INIT(caractere_courant,K_UNDEF));
                                        /* Caractere courant.                                                                        */
     DEFV(Char,INIT(caractere_precedent,K_UNDEF));
                                        /* Caractere precedent.                                                                      */
     /*..............................................................................................................................*/
     GET_ARGUMENTS_(nombre_d_arguments
                   ,BLOC(GET_ARGUMENT_L("compatibilite_20030926=",compatibilite_20030926);
                         )
                    );

     Tant(GetcharT(caractere_courant))
          Bblock
                                        /* Le caractere courant de l'entree courante est recupere ; et on boucle                     */
                                        /* sur cette recuperation tant que l'on n'est pas au bout du fichier.                        */
          CALS(Putchar(caractere_courant));
                                        /* Tous les caracteres sont transmis integralement...                                        */

          EGAL(caractere_precedent,caractere_courant);
                                        /* Memorisation du caractere precedente...                                                   */
          Eblock
     ETan

     Test(IFOU(IFET(IL_FAUT(compatibilite_20030926),IFNE(caractere_courant,K_LF))
              ,IFET(IL_NE_FAUT_PAS(compatibilite_20030926),IFNE(caractere_precedent,K_LF))
               )
          )
          Bblock
                                        /* On notera donc qu'anterieurement au 20030926095521 la detection d'un 'K_LF' deja present  */
                                        /* au bout du fichier Argument ; en effet, le 'caractere_courant' au bout d'un fichier est   */
                                        /* necessairement 'PROBLEMES' ('v $xil/defi_c1$vv$DEF GetcharG'). C'est donc le caractere    */
                                        /* precedent ('caractere_precedent') qu'il faut tester...                                    */
          CALS(Putchar(K_LF));
                                        /* Et si besoin est, on rajoute un '$K_NL' au bout. On notera que c'est tres utile, par      */
                                        /* exemple dans le cas ou '$R' a supprime tous les '$K_NL' d'un fichier ('v $xcc/cpp$Z').    */
          Eblock
     ATes
          Bblock
          Eblock
     ETes

     RETU_Commande;
     Eblock
ECommande



Copyright © Jean-François COLONNA, 2019-2024.
Copyright © CMAP (Centre de Mathématiques APpliquées) UMR CNRS 7641 / École polytechnique, Institut Polytechnique de Paris, 2019-2024.