--- rpl/src/instructions_l5.c 2010/08/06 15:33:01 1.12 +++ rpl/src/instructions_l5.c 2012/05/21 17:25:43 1.37 @@ -1,7 +1,7 @@ /* ================================================================================ - RPL/2 (R) version 4.0.18 - Copyright (C) 1989-2010 Dr. BERTRAND Joël + RPL/2 (R) version 4.1.9 + Copyright (C) 1989-2012 Dr. BERTRAND Joël This file is part of RPL/2. @@ -1609,9 +1609,6 @@ instruction_lcase(struct_processus *s_et struct_objet *s_objet_argument; struct_objet *s_objet_resultat; - unsigned char *ptr; - unsigned char registre; - (*s_etat_processus).erreur_execution = d_ex; if ((*s_etat_processus).affichage_arguments == 'Y') @@ -1620,7 +1617,7 @@ instruction_lcase(struct_processus *s_et if ((*s_etat_processus).langue == 'F') { - printf("(converison d'une chaîne de caractères en minuscules)\n\n"); + printf("(conversion d'une chaîne de caractères en minuscules)\n\n"); } else { @@ -1628,6 +1625,7 @@ instruction_lcase(struct_processus *s_et } printf(" 1: %s\n", d_CHN); + printf("-> 1: %s\n", d_CHN); return; } else if ((*s_etat_processus).test_instruction == 'Y') @@ -1661,19 +1659,8 @@ instruction_lcase(struct_processus *s_et } liberation(s_etat_processus, s_objet_argument); - ptr = (unsigned char *) (*s_objet_resultat).objet; - - while((*ptr) != d_code_fin_chaine) - { - registre = tolower((*ptr)); - - if (toupper(registre) == (*ptr)) - { - (*ptr) = registre; - } - - ptr++; - } + conversion_chaine(s_etat_processus, (unsigned char *) + (*s_objet_resultat).objet, 'm'); if (empilement(s_etat_processus, &((*s_etat_processus).l_base_pile), s_objet_resultat) == d_erreur) @@ -1690,6 +1677,80 @@ instruction_lcase(struct_processus *s_et } return; +} + + +/* +================================================================================ + Fonction 'l->t' +================================================================================ + Entrées : pointeur sur une structure struct_processus +-------------------------------------------------------------------------------- + Sorties : +-------------------------------------------------------------------------------- + Effets de bord : néant +================================================================================ +*/ + +void +instruction_l_vers_t(struct_processus *s_etat_processus) +{ + logical1 last; + + (*s_etat_processus).erreur_execution = d_ex; + + if ((*s_etat_processus).affichage_arguments == 'Y') + { + printf("\n L->T "); + + if ((*s_etat_processus).langue == 'F') + { + printf("(converison d'une liste en table)\n\n"); + } + else + { + printf("(convert list to table)\n\n"); + } + + printf(" 1: %s\n", d_LST); + printf("-> 1: %s\n", d_TAB); + return; + } + else if ((*s_etat_processus).test_instruction == 'Y') + { + (*s_etat_processus).nombre_arguments = -1; + return; + } + + if (test_cfsf(s_etat_processus, 31) == d_vrai) + { + last = d_vrai; + cf(s_etat_processus, 31); + + if (empilement_pile_last(s_etat_processus, 1) == d_erreur) + { + return; + } + } + else + { + last = d_faux; + } + + instruction_list_fleche(s_etat_processus); + + if (((*s_etat_processus).erreur_systeme == d_es) && + ((*s_etat_processus).erreur_execution == d_ex)) + { + instruction_fleche_table(s_etat_processus); + } + + if (last == d_vrai) + { + sf(s_etat_processus, 31); + } + + return; } // vim: ts=4