version 1.1.1.1, 2010/01/26 15:22:45
|
version 1.8, 2010/04/07 13:45:05
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.0.9 |
RPL/2 (R) version 4.0.14 |
Copyright (C) 1989-2010 Dr. BERTRAND Joël |
Copyright (C) 1989-2010 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
Line 725 instruction_edit(struct_processus *s_eta
|
Line 725 instruction_edit(struct_processus *s_eta
|
|
|
file *fichier; |
file *fichier; |
|
|
logical1 drapeau; |
|
logical1 drapeau49; |
logical1 drapeau49; |
logical1 drapeau50; |
logical1 drapeau50; |
|
|
Line 738 instruction_edit(struct_processus *s_eta
|
Line 737 instruction_edit(struct_processus *s_eta
|
unsigned char *chaine; |
unsigned char *chaine; |
unsigned char *commande; |
unsigned char *commande; |
unsigned char *nom_fichier; |
unsigned char *nom_fichier; |
|
unsigned char registre; |
|
|
(*s_etat_processus).erreur_execution = d_ex; |
(*s_etat_processus).erreur_execution = d_ex; |
|
|
Line 848 instruction_edit(struct_processus *s_eta
|
Line 848 instruction_edit(struct_processus *s_eta
|
return; |
return; |
} |
} |
|
|
|
registre = (*s_etat_processus).autorisation_conversion_chaine; |
|
(*s_etat_processus).autorisation_conversion_chaine = 'N'; |
|
|
if ((chaine = formateur(s_etat_processus, 0, s_objet)) == NULL) |
if ((chaine = formateur(s_etat_processus, 0, s_objet)) == NULL) |
{ |
{ |
|
(*s_etat_processus).autorisation_conversion_chaine = registre; |
|
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
} |
} |
|
|
|
(*s_etat_processus).autorisation_conversion_chaine = registre; |
|
|
if ((*s_objet).type == CHN) |
if ((*s_objet).type == CHN) |
{ |
{ |
if (fprintf(fichier, "\"%s\"\n", chaine) != (int) (strlen(chaine) + 3)) |
if (fprintf(fichier, "\"%s\"\n", chaine) != (int) (strlen(chaine) + 3)) |
Line 879 instruction_edit(struct_processus *s_eta
|
Line 886 instruction_edit(struct_processus *s_eta
|
return; |
return; |
} |
} |
|
|
do |
if ((commande = malloc((strlen(ds_vim_commande) + strlen(nom_fichier) |
|
- 1) * sizeof(unsigned char))) == NULL) |
{ |
{ |
if ((commande = malloc((strlen(ds_vim_commande) + strlen(nom_fichier) |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
- 1) * sizeof(unsigned char))) == NULL) |
return; |
{ |
} |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
sprintf(commande, ds_vim_commande, nom_fichier); |
sprintf(commande, ds_vim_commande, nom_fichier); |
|
|
if (system(commande) != 0) |
if (system(commande) != 0) |
{ |
{ |
free(commande); |
free(commande); |
|
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
} |
} |
|
|
free(commande); |
free(commande); |
|
|
if ((s_objet_nom = allocation(s_etat_processus, CHN)) == NULL) |
if ((s_objet_nom = allocation(s_etat_processus, CHN)) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
} |
} |
|
|
if (((*s_objet_nom).objet = malloc((strlen(nom_fichier) + 1) |
if (((*s_objet_nom).objet = malloc((strlen(nom_fichier) + 1) |
* sizeof(unsigned char))) == NULL) |
* sizeof(unsigned char))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
} |
} |
|
|
strcpy((unsigned char *) (*s_objet_nom).objet, nom_fichier); |
strcpy((unsigned char *) (*s_objet_nom).objet, nom_fichier); |
|
|
if (empilement(s_etat_processus, &((*s_etat_processus).l_base_pile), |
if (empilement(s_etat_processus, &((*s_etat_processus).l_base_pile), |
s_objet_nom) == d_erreur) |
s_objet_nom) == d_erreur) |
{ |
{ |
return; |
return; |
} |
} |
|
|
registre_pile_last = (*s_etat_processus).l_base_pile_last; |
registre_pile_last = (*s_etat_processus).l_base_pile_last; |
(*s_etat_processus).l_base_pile_last = NULL; |
(*s_etat_processus).l_base_pile_last = NULL; |
|
|
instruction_recall(s_etat_processus); |
instruction_recall(s_etat_processus); |
|
|
// Destruction du fichier temporaire |
if (empilement_pile_last(s_etat_processus, 0) == d_erreur) |
|
{ |
|
return; |
|
} |
|
|
if (destruction_fichier(nom_fichier) == d_erreur) |
(*s_etat_processus).l_base_pile_last = registre_pile_last; |
{ |
|
(*s_etat_processus).erreur_systeme = d_es_erreur_fichier; |
|
return; |
|
} |
|
|
|
free(nom_fichier); |
// Destruction du fichier temporaire |
|
|
if (((*s_etat_processus).erreur_systeme != d_es) || |
if (destruction_fichier(nom_fichier) == d_erreur) |
((*s_etat_processus).erreur_execution != d_ex) || |
{ |
((*s_etat_processus).exception != d_ep)) |
(*s_etat_processus).erreur_systeme = d_es_erreur_fichier; |
{ |
return; |
if (empilement_pile_last(s_etat_processus, 0) == d_erreur) |
} |
{ |
|
return; |
|
} |
|
|
|
(*s_etat_processus).l_base_pile_last = registre_pile_last; |
free(nom_fichier); |
liberation(s_etat_processus, s_objet); |
|
|
|
return; |
if (((*s_etat_processus).erreur_systeme != d_es) || |
} |
((*s_etat_processus).erreur_execution != d_ex) || |
|
((*s_etat_processus).exception != d_ep)) |
|
{ |
|
liberation(s_etat_processus, s_objet); |
|
|
if ((*s_etat_processus).erreur_systeme != d_es) |
return; |
{ |
} |
return; |
|
} |
|
|
|
if ((*s_etat_processus).erreur_execution == d_ex_fichier_vide) |
if ((*s_etat_processus).erreur_systeme != d_es) |
{ |
{ |
if (empilement(s_etat_processus, &((*s_etat_processus).l_base_pile), |
return; |
s_objet) == d_erreur) |
} |
{ |
|
return; |
|
} |
|
|
|
(*s_etat_processus).erreur_execution = d_ex; |
if ((*s_etat_processus).erreur_execution == d_ex_fichier_vide) |
drapeau = d_faux; |
{ |
} |
if (empilement(s_etat_processus, &((*s_etat_processus).l_base_pile), |
else |
s_objet) == d_erreur) |
{ |
{ |
drapeau = d_vrai; |
return; |
} |
} |
} while((*s_etat_processus).erreur_execution != d_ex); |
|
|
|
if (drapeau == d_vrai) |
(*s_etat_processus).erreur_execution = d_ex; |
|
} |
|
else |
{ |
{ |
liberation(s_etat_processus, s_objet); |
liberation(s_etat_processus, s_objet); |
} |
} |