--- rpl/src/instructions_i4.c 2010/03/09 10:18:46 1.5 +++ rpl/src/instructions_i4.c 2010/04/07 13:33:22 1.6 @@ -222,4 +222,111 @@ instruction_in(struct_processus *s_etat_ return; } + +/* +================================================================================ + Fonction 'implicit' +================================================================================ + Entrées : +-------------------------------------------------------------------------------- + Sorties : +-------------------------------------------------------------------------------- + Effets de bord : néant +================================================================================ +*/ + +void +instruction_implicit(struct_processus *s_etat_processus) +{ + struct_objet *s_objet_argument; + + unsigned char *commande; + + (*s_etat_processus).erreur_execution = d_ex; + + if ((*s_etat_processus).affichage_arguments == 'Y') + { + printf("\n IMPLICIT "); + + if ((*s_etat_processus).langue == 'F') + { + printf("(test de l'appartenance à un ensemble)\n\n"); + } + else + { + printf("(check membership)\n\n"); + } + + printf(" 1: %s\n\n", d_CHN); + + if ((*s_etat_processus).langue == 'F') + { + printf(" Utilisation :\n\n"); + } + else + { + printf(" Usage:\n\n"); + } + + printf(" \"NONE\" IMPLICIT\n"); + printf(" \"ALL\" IMPLICIT\n"); + 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) + { + if (empilement_pile_last(s_etat_processus, 1) == d_erreur) + { + return; + } + } + + if (depilement(s_etat_processus, &((*s_etat_processus).l_base_pile), + &s_objet_argument) == d_erreur) + { + (*s_etat_processus).erreur_execution = d_ex_manque_argument; + return; + } + + if ((*s_objet_argument).type == CHN) + { + if ((commande = conversion_majuscule((unsigned char *) + (*s_objet_argument).objet)) == NULL) + { + (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; + return; + } + + if (strcmp(commande, "NONE") == 0) + { + (*s_etat_processus).autorisation_nom_implicite = 'N'; + } + else if (strcmp(commande, "ALL") == 0) + { + (*s_etat_processus).autorisation_nom_implicite = 'Y'; + } + else + { + (*s_etat_processus).erreur_execution = d_ex_argument_invalide; + } + + free(commande); + } + else + { + liberation(s_etat_processus, s_objet_argument); + + (*s_etat_processus).erreur_execution = d_ex_erreur_type_argument; + return; + } + + liberation(s_etat_processus, s_objet_argument); + return; +} + // vim: ts=4