/*************************************************************************************************************************************/ /* */ /* D E C A L A G E E N B O U T D E L I G N E D E L ' I N D I C A T E U R D E */ /* " L I G N E - S U I T E " D E S M A C R O S - P R O C E D U R E S D E ' C P P ' */ /* E T C E E N D E U X P A S S E S : */ /* */ /* */ /* Author of '$xcp/adjustK.01$K' : */ /* */ /* Jean-Francois COLONNA (LACTAMME, 1988??????????). */ /* */ /*************************************************************************************************************************************/ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* 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 /* Introduit le 20070713161748 a cause de 'v $xcg/gen$ARG$Z 20070713163308'... */ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* 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 PREMIERE_PASSE \ VRAI \ /* Afin de savoir si c'est la premiere passe ou bien la seconde... */ #define LONGUEUR_D_UNE_LIGNE_SOURCE_01 \ COND(EST_VRAI(premiere_passe) \ ,LONGUEUR_D_UNE_LIGNE_SOURCE \ ,LONGUEUR_D_UNE_LIGNE_SOURCE_ANTI_SLASH \ ) /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* M A C R O S U T I L E S : */ /* */ /*************************************************************************************************************************************/ #define SEND_CARACTERE(caractere) \ Bblock \ CALS(Putchar(caractere)); \ /* Emission du caractere courant. */ \ \ Test(IFEQ(caractere,K_LF)) \ Bblock \ CLIR(compteur_des_caracteres_sur_la_ligne); \ /* Reinitialisation du comptage des caracteres sur la nouvelle ligne courante. */ \ Eblock \ ATes \ Bblock \ Eblock \ ETes \ \ INCR(compteur_des_caracteres_sur_la_ligne,I); \ /* Comptage des caracteres sur la ligne courante. */ \ Eblock /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* D E C A L A G E E N B O U T D E L I G N E D E L ' I N D I C A T E U R D E */ /* " L I G N E - S U I T E " D E S M A C R O S - P R O C E D U R E S D E ' C P P ' */ /* E T C E E N D E U X P A S S E S : */ /* */ /*************************************************************************************************************************************/ BCommande(nombre_d_arguments,arguments) /*-----------------------------------------------------------------------------------------------------------------------------------*/ Bblock DEFV(Logical,INIT(premiere_passe,PREMIERE_PASSE)); /* Afin de savoir si c'est la premiere passe ou bien la seconde... */ DEFV(Int,INIT(compteur_des_caracteres_sur_la_ligne,UN)); /* Ce compteur permet de savoir ou l'on en est a chaque instant sur la ligne courante... */ DEFV(Char,INIT(caractere_courant_00,K_NULL)); /* Caractere courant (00), */ DEFV(Char,INIT(caractere_courant_01,K_NULL)); /* Caractere precedent (01), */ /*..............................................................................................................................*/ GET_ARGUMENTS_(nombre_d_arguments ,BLOC(GET_ARGUMENT_L("premiere=",premiere_passe); ) ); Tant(GetcharT(caractere_courant_00)) 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. */ Test(IFET(IFEQ(caractere_courant_01,K_ANTI_SLASH),IFEQ(caractere_courant_00,K_LF))) Bblock Tant(IFLT(compteur_des_caracteres_sur_la_ligne,LONGUEUR_D_UNE_LIGNE_SOURCE_01)) Bblock SEND_CARACTERE(K_BLANC); /* Insertion de caracteres 'ESPACE' devant un 'ANTI-SLASH' de fin de ligne... */ Eblock ETan SEND_CARACTERE(caractere_courant_01); SEND_CARACTERE(caractere_courant_00); /* Puis, apres les 'ESPACE's on envoie un 'ANTI-SLASH' de fin de ligne... */ Eblock ATes Bblock Test(IFEQ(caractere_courant_01,K_ANTI_SLASH)) Bblock SEND_CARACTERE(caractere_courant_01); /* Emission differee du caractere 'ANTI-SLASH' lorsqu'il n'est pas en fin de ligne... */ Eblock ATes Bblock Eblock ETes Test(IFNE(caractere_courant_00,K_ANTI_SLASH)) Bblock SEND_CARACTERE(caractere_courant_00); /* Re-emission de tous les caracteres, sauf du caractere 'ANTI-SLASH' que l'on differe... */ Eblock ATes Bblock Eblock ETes Eblock ETes Test(IFEQ(caractere_courant_00,K_LF)) Bblock EGAL(caractere_courant_01,K_NULL); /* En bout de ligne, on reinitialise... */ Eblock ATes Bblock EGAL(caractere_courant_01,caractere_courant_00); /* Decalage des derniers caracteres memorises lorsque l'on n'est pas en bout de ligne. */ Eblock ETes EGAL(caractere_courant_00,K_NULL); Eblock ETan RETU_Commande; Eblock ECommande