version 1.5, 2010/03/04 17:42:46
|
version 1.78, 2020/01/10 11:15:47
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.0.12 |
RPL/2 (R) version 4.1.32 |
Copyright (C) 1989-2010 Dr. BERTRAND Joël |
Copyright (C) 1989-2020 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
|
|
Line 20
|
Line 20
|
*/ |
*/ |
|
|
|
|
#include "rpl.conv.h" |
#include "rpl-conv.h" |
|
|
|
|
/* |
/* |
Line 353 instruction_rnrm(struct_processus *s_eta
|
Line 353 instruction_rnrm(struct_processus *s_eta
|
struct_objet *s_objet_argument; |
struct_objet *s_objet_argument; |
struct_objet *s_objet_resultat; |
struct_objet *s_objet_resultat; |
|
|
unsigned long i; |
integer8 i; |
unsigned long j; |
integer8 j; |
|
|
void *accumulateur; |
void *accumulateur; |
|
|
Line 410 instruction_rnrm(struct_processus *s_eta
|
Line 410 instruction_rnrm(struct_processus *s_eta
|
|
|
if ((*s_objet_argument).type == VIN) |
if ((*s_objet_argument).type == VIN) |
{ |
{ |
if ((s_objet_resultat = allocation(s_etat_processus, INT)) == NULL) |
depassement = d_faux; |
|
|
|
for(i = 0; i < (*((struct_vecteur *) (*s_objet_argument).objet)).taille; |
|
i++) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
if (((integer8 *) (*((struct_vecteur *) (*s_objet_argument) |
return; |
.objet)).tableau)[i] == INT64_MIN) |
|
{ |
|
depassement = d_vrai; |
|
break; |
|
} |
} |
} |
|
|
(*((integer8 *) (*s_objet_resultat).objet)) = abs(((integer8 *) |
if (depassement == d_faux) |
(*((struct_vecteur *) (*s_objet_argument).objet)).tableau)[0]); |
{ |
|
if ((s_objet_resultat = allocation(s_etat_processus, INT)) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return; |
|
} |
|
|
for(i = 1; i < (*((struct_vecteur *) (*s_objet_argument).objet)).taille; |
(*((integer8 *) (*s_objet_resultat).objet)) = abs(((integer8 *) |
i++) |
(*((struct_vecteur *) (*s_objet_argument).objet)) |
|
.tableau)[0]); |
|
|
|
for(i = 1; i < (*((struct_vecteur *) (*s_objet_argument).objet)) |
|
.taille; i++) |
|
{ |
|
if (abs(((integer8 *) (*((struct_vecteur *) (*s_objet_argument) |
|
.objet)).tableau)[i]) > (*((integer8 *) |
|
(*s_objet_resultat).objet))) |
|
{ |
|
(*((integer8 *) (*s_objet_resultat).objet)) = |
|
abs(((integer8 *) (*((struct_vecteur *) |
|
(*s_objet_argument).objet)).tableau)[i]); |
|
} |
|
} |
|
} |
|
else |
{ |
{ |
if (abs(((integer8 *) (*((struct_vecteur *) (*s_objet_argument) |
if ((s_objet_resultat = allocation(s_etat_processus, REL)) == NULL) |
.objet)).tableau)[i]) > (*((integer8 *) |
|
(*s_objet_resultat).objet))) |
|
{ |
{ |
(*((integer8 *) (*s_objet_resultat).objet)) = |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
abs(((integer8 *) (*((struct_vecteur *) |
return; |
(*s_objet_argument).objet)).tableau)[i]); |
} |
|
|
|
(*((real8 *) (*s_objet_resultat).objet)) = abs((real8) ((integer8 *) |
|
(*((struct_vecteur *) (*s_objet_argument).objet)) |
|
.tableau)[0]); |
|
|
|
for(i = 1; i < (*((struct_vecteur *) (*s_objet_argument).objet)) |
|
.taille; i++) |
|
{ |
|
if (abs((real8) ((integer8 *) (*((struct_vecteur *) |
|
(*s_objet_argument).objet)).tableau)[i]) > (*((real8 *) |
|
(*s_objet_resultat).objet))) |
|
{ |
|
(*((real8 *) (*s_objet_resultat).objet)) = |
|
abs((real8) ((integer8 *) (*((struct_vecteur *) |
|
(*s_objet_argument).objet)).tableau)[i]); |
|
} |
} |
} |
} |
} |
} |
} |
Line 501 instruction_rnrm(struct_processus *s_eta
|
Line 543 instruction_rnrm(struct_processus *s_eta
|
for(j = 0; j < (*((struct_matrice *) (*s_objet_argument).objet)) |
for(j = 0; j < (*((struct_matrice *) (*s_objet_argument).objet)) |
.nombre_colonnes; j++) |
.nombre_colonnes; j++) |
{ |
{ |
|
if (((integer8 **) (*((struct_matrice *) (*s_objet_argument).objet)) |
|
.tableau)[0][j] == INT64_MIN) |
|
{ |
|
depassement = d_vrai; |
|
break; |
|
} |
|
|
entier_courant = abs(((integer8 **) |
entier_courant = abs(((integer8 **) |
(*((struct_matrice *) (*s_objet_argument).objet)) |
(*((struct_matrice *) (*s_objet_argument).objet)) |
.tableau)[0][j]); |
.tableau)[0][j]); |
Line 525 instruction_rnrm(struct_processus *s_eta
|
Line 574 instruction_rnrm(struct_processus *s_eta
|
for(j = 0; j < (*((struct_matrice *) (*s_objet_argument).objet)) |
for(j = 0; j < (*((struct_matrice *) (*s_objet_argument).objet)) |
.nombre_colonnes; j++) |
.nombre_colonnes; j++) |
{ |
{ |
|
if (((integer8 **) (*((struct_matrice *) |
|
(*s_objet_argument).objet)).tableau)[i][j] |
|
== INT64_MIN) |
|
{ |
|
depassement = d_vrai; |
|
break; |
|
} |
|
|
entier_courant = abs(((integer8 **) (*((struct_matrice *) |
entier_courant = abs(((integer8 **) (*((struct_matrice *) |
(*s_objet_argument).objet)).tableau)[i][j]); |
(*s_objet_argument).objet)).tableau)[i][j]); |
|
|
Line 565 instruction_rnrm(struct_processus *s_eta
|
Line 622 instruction_rnrm(struct_processus *s_eta
|
return; |
return; |
} |
} |
|
|
if ((accumulateur = malloc((*((struct_matrice *) |
if ((accumulateur = malloc(((size_t) (*((struct_matrice *) |
(*s_objet_argument).objet)).nombre_colonnes * |
(*s_objet_argument).objet)).nombre_colonnes) * |
sizeof(real8))) == NULL) |
sizeof(real8))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
Line 614 instruction_rnrm(struct_processus *s_eta
|
Line 671 instruction_rnrm(struct_processus *s_eta
|
return; |
return; |
} |
} |
|
|
if ((accumulateur = malloc((*((struct_matrice *) |
if ((accumulateur = malloc(((size_t) (*((struct_matrice *) |
(*s_objet_argument).objet)).nombre_colonnes * sizeof(real8))) |
(*s_objet_argument).objet)).nombre_colonnes) * sizeof(real8))) |
== NULL) |
== NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
Line 661 instruction_rnrm(struct_processus *s_eta
|
Line 718 instruction_rnrm(struct_processus *s_eta
|
return; |
return; |
} |
} |
|
|
if ((accumulateur = malloc((*((struct_matrice *) |
if ((accumulateur = malloc(((size_t) (*((struct_matrice *) |
(*s_objet_argument).objet)).nombre_colonnes * sizeof(real8))) |
(*s_objet_argument).objet)).nombre_colonnes) * sizeof(real8))) |
== NULL) |
== NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
Line 741 instruction_rnrm(struct_processus *s_eta
|
Line 798 instruction_rnrm(struct_processus *s_eta
|
void |
void |
instruction_rceq(struct_processus *s_etat_processus) |
instruction_rceq(struct_processus *s_etat_processus) |
{ |
{ |
logical1 presence_variable; |
|
|
|
long i; |
|
|
|
struct_objet *s_objet_variable; |
struct_objet *s_objet_variable; |
|
|
(*s_etat_processus).erreur_execution = d_ex; |
(*s_etat_processus).erreur_execution = d_ex; |
Line 766 instruction_rceq(struct_processus *s_eta
|
Line 819 instruction_rceq(struct_processus *s_eta
|
" %s, %s, %s, %s, %s,\n" |
" %s, %s, %s, %s, %s,\n" |
" %s, %s, %s, %s, %s,\n" |
" %s, %s, %s, %s, %s,\n" |
" %s, %s, %s, %s,\n" |
" %s, %s, %s, %s,\n" |
" %s, %s\n", |
" %s, %s, %s\n", |
d_INT, d_REL, d_CPL, d_VIN, d_VRL, d_VCX, d_MIN, d_MRL, d_MCX, |
d_INT, d_REL, d_CPL, d_VIN, d_VRL, d_VCX, d_MIN, d_MRL, d_MCX, |
d_TAB, d_BIN, d_NOM, d_CHN, d_LST, d_ALG, d_RPN, d_FCH, d_SCK, |
d_TAB, d_BIN, d_NOM, d_CHN, d_LST, d_ALG, d_RPN, d_FCH, d_SCK, |
d_SQL, d_SLB, d_PRC, d_MTX); |
d_SQL, d_SLB, d_PRC, d_MTX, d_REC); |
|
|
return; |
return; |
} |
} |
Line 787 instruction_rceq(struct_processus *s_eta
|
Line 840 instruction_rceq(struct_processus *s_eta
|
} |
} |
} |
} |
|
|
if (recherche_variable(s_etat_processus, "EQ") == d_vrai) |
if (recherche_variable_globale(s_etat_processus, "EQ") == d_faux) |
{ |
{ |
i = (*s_etat_processus).position_variable_courante; |
(*s_etat_processus).erreur_systeme = d_es; |
presence_variable = d_faux; |
|
|
|
while(i >= 0) |
|
{ |
|
if ((strcmp((*s_etat_processus).s_liste_variables[i].nom, "EQ") |
|
== 0) && ((*s_etat_processus).s_liste_variables[i] |
|
.niveau == 1)) |
|
{ |
|
presence_variable = d_vrai; |
|
break; |
|
} |
|
|
|
i--; |
|
} |
|
|
|
(*s_etat_processus).position_variable_courante = i; |
|
|
|
if (presence_variable == d_faux) |
if ((*s_etat_processus).erreur_execution == d_ex) |
{ |
{ |
(*s_etat_processus).erreur_execution = d_ex_variable_non_definie; |
(*s_etat_processus).erreur_execution = d_ex_variable_non_definie; |
return; |
|
} |
} |
|
|
if ((*s_etat_processus).s_liste_variables[i].objet == NULL) |
|
{ |
|
(*s_etat_processus).erreur_execution = d_ex_variable_partagee; |
|
return; |
|
} |
|
} |
|
else |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es; |
|
(*s_etat_processus).erreur_execution = d_ex_variable_non_definie; |
|
return; |
return; |
} |
} |
|
|
if ((s_objet_variable = copie_objet(s_etat_processus, |
if ((s_objet_variable = copie_objet(s_etat_processus, |
((*s_etat_processus).s_liste_variables) |
(*(*s_etat_processus).pointeur_variable_courante).objet, 'P')) |
[(*s_etat_processus).position_variable_courante].objet, 'P')) |
|
== NULL) |
== NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
Line 961 instruction_recall(struct_processus *s_e
|
Line 986 instruction_recall(struct_processus *s_e
|
int caractere; |
int caractere; |
int ios; |
int ios; |
|
|
|
logical1 drapeau_fin; |
|
logical1 indicateur_48; |
|
logical1 presence_chaine; |
|
|
long i; |
long i; |
long nombre_caracteres_source; |
long nombre_caracteres_source; |
|
|
struct_objet *s_objet; |
struct_objet *s_objet; |
struct_objet *s_objet_temporaire; |
|
|
|
|
unsigned char autorisation_empilement_programme; |
|
unsigned char *chaine; |
unsigned char *commande; |
unsigned char *commande; |
|
unsigned char *executable_candidat; |
|
|
|
# ifndef OS2 |
unsigned char *instructions = "%s/bin/rpliconv %s " |
unsigned char *instructions = "%s/bin/rpliconv %s " |
"`%s/bin/rplfile " |
"`%s/bin/rplfile " |
"-m %s/share/rplfiles -i %s | awk " |
"-m %s/share/rplfiles -i %s | " |
"'{ print $3; }' | awk -F= '{ if " |
"%s/bin/rplawk " |
|
"'{ print $3; }' | %s/bin/rplawk -F= '{ if " |
"($2 != \"\") printf(\"-f %%s\", $2); }'` " |
"($2 != \"\") printf(\"-f %%s\", $2); }'` " |
"-t `locale charmap` | %s/bin/%s -o %s"; |
"-t `locale charmap` | %s/bin/%s -o %s"; |
|
# else |
|
unsigned char *instructions = BOURNE_SHELL |
|
" -c \"%s/bin/rpliconv %s " |
|
"`%s/bin/rplfile " |
|
"-m %s/share/rplfiles -i %s | " |
|
"%s/bin/rplawk " |
|
"'{ print $3; }' | %s/bin/rplawk -F= '{ if " |
|
"($2 != \\\"\\\") printf(\\\"-f %%s\\\", " |
|
"$2); }'` -t `" d_locale |
|
"` | %s/bin/%s -o %s\""; |
|
# endif |
|
|
unsigned char *nom_fichier_temporaire; |
unsigned char *nom_fichier_temporaire; |
|
unsigned char *tampon_definitions_chainees; |
|
unsigned char *tampon_instruction_courante; |
|
|
|
integer8 position_courante; |
|
|
(*s_etat_processus).erreur_execution = d_ex; |
(*s_etat_processus).erreur_execution = d_ex; |
|
|
Line 1048 instruction_recall(struct_processus *s_e
|
Line 1098 instruction_recall(struct_processus *s_e
|
{ |
{ |
if ((commande = malloc((strlen(ds_preprocesseur) + |
if ((commande = malloc((strlen(ds_preprocesseur) + |
(2 * strlen((unsigned char *) (*s_objet).objet)) + |
(2 * strlen((unsigned char *) (*s_objet).objet)) + |
(4 * strlen(d_exec_path)) + |
(6 * strlen(d_exec_path)) + |
strlen(nom_fichier_temporaire) + strlen(instructions) - 11) |
strlen(nom_fichier_temporaire) + strlen(instructions) - 19) |
* 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; |
Line 1060 instruction_recall(struct_processus *s_e
|
Line 1110 instruction_recall(struct_processus *s_e
|
(unsigned char *) (*s_objet).objet, |
(unsigned char *) (*s_objet).objet, |
d_exec_path, d_exec_path, |
d_exec_path, d_exec_path, |
(unsigned char *) (*s_objet).objet, |
(unsigned char *) (*s_objet).objet, |
|
d_exec_path, d_exec_path, |
d_exec_path, ds_preprocesseur, nom_fichier_temporaire); |
d_exec_path, ds_preprocesseur, nom_fichier_temporaire); |
|
|
|
if (alsprintf(s_etat_processus, &executable_candidat, |
|
"%s/bin/rpliconv", d_exec_path) < 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
if (controle_integrite(s_etat_processus, executable_candidat, |
|
"rpliconv") != d_vrai) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_somme_controle; |
|
return; |
|
} |
|
|
|
free(executable_candidat); |
|
|
|
if (alsprintf(s_etat_processus, &executable_candidat, |
|
"%s/bin/rplfile", d_exec_path) < 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
if (controle_integrite(s_etat_processus, executable_candidat, |
|
"rplfile") != d_vrai) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_somme_controle; |
|
return; |
|
} |
|
|
|
free(executable_candidat); |
|
|
|
if (alsprintf(s_etat_processus, &executable_candidat, |
|
"%s/bin/rplpp", d_exec_path) < 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
if (controle_integrite(s_etat_processus, executable_candidat, |
|
"rplpp") != d_vrai) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_somme_controle; |
|
return; |
|
} |
|
|
|
free(executable_candidat); |
|
|
|
if (alsprintf(s_etat_processus, &executable_candidat, |
|
"%s/bin/rplawk", d_exec_path) < 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
if (controle_integrite(s_etat_processus, executable_candidat, |
|
"rplawk") != d_vrai) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_somme_controle; |
|
return; |
|
} |
|
|
|
free(executable_candidat); |
} |
} |
else |
else |
{ |
{ |
if ((commande = malloc((strlen(ds_preprocesseur) + |
if ((commande = malloc((strlen(ds_preprocesseur) + |
(2 * strlen((unsigned char *) (*s_objet).objet)) + |
(2 * strlen((unsigned char *) (*s_objet).objet)) + |
(4 * strlen((*s_etat_processus).rpl_home)) + |
(6 * strlen((*s_etat_processus).rpl_home)) + |
strlen(nom_fichier_temporaire) + strlen(instructions) - 11) |
strlen(nom_fichier_temporaire) + strlen(instructions) - 19) |
* 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; |
Line 1078 instruction_recall(struct_processus *s_e
|
Line 1193 instruction_recall(struct_processus *s_e
|
(unsigned char *) (*s_objet).objet, |
(unsigned char *) (*s_objet).objet, |
(*s_etat_processus).rpl_home, (*s_etat_processus).rpl_home, |
(*s_etat_processus).rpl_home, (*s_etat_processus).rpl_home, |
(unsigned char *) (*s_objet).objet, |
(unsigned char *) (*s_objet).objet, |
|
(*s_etat_processus).rpl_home, (*s_etat_processus).rpl_home, |
(*s_etat_processus).rpl_home, ds_preprocesseur, |
(*s_etat_processus).rpl_home, ds_preprocesseur, |
nom_fichier_temporaire); |
nom_fichier_temporaire); |
|
|
|
if (alsprintf(s_etat_processus, &executable_candidat, |
|
"%s/bin/rpliconv", (*s_etat_processus).rpl_home) < 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
if (controle_integrite(s_etat_processus, executable_candidat, |
|
"rpliconv") != d_vrai) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_somme_controle; |
|
return; |
|
} |
|
|
|
free(executable_candidat); |
|
|
|
if (alsprintf(s_etat_processus, &executable_candidat, |
|
"%s/bin/rplfile", (*s_etat_processus).rpl_home) < 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
if (controle_integrite(s_etat_processus, executable_candidat, |
|
"rplfile") != d_vrai) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_somme_controle; |
|
return; |
|
} |
|
|
|
free(executable_candidat); |
|
|
|
if (alsprintf(s_etat_processus, &executable_candidat, |
|
"%s/bin/rplpp", (*s_etat_processus).rpl_home) < 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
if (controle_integrite(s_etat_processus, executable_candidat, |
|
"rplpp") != d_vrai) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_somme_controle; |
|
return; |
|
} |
|
|
|
free(executable_candidat); |
|
|
|
if (alsprintf(s_etat_processus, &executable_candidat, |
|
"%s/bin/rplawk", d_exec_path) < 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
if (controle_integrite(s_etat_processus, executable_candidat, |
|
"rplawk") != d_vrai) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_somme_controle; |
|
return; |
|
} |
|
|
|
free(executable_candidat); |
} |
} |
|
|
if ((pipe = popen(commande, "r")) == NULL) |
if ((pipe = popen(commande, "r")) == NULL) |
Line 1139 instruction_recall(struct_processus *s_e
|
Line 1319 instruction_recall(struct_processus *s_e
|
return; |
return; |
} |
} |
|
|
if ((s_objet_temporaire = allocation(s_etat_processus, CHN)) == NULL) |
if ((chaine = malloc((((size_t) nombre_caracteres_source) + 1) |
{ |
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
if (((*s_objet_temporaire).objet = malloc((nombre_caracteres_source + 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; |
Line 1155 instruction_recall(struct_processus *s_e
|
Line 1329 instruction_recall(struct_processus *s_e
|
rewind(pipe); |
rewind(pipe); |
|
|
i = 0; |
i = 0; |
while((caractere = getc(pipe)) != EOF) |
drapeau_fin = d_faux; |
|
presence_chaine = d_faux; |
|
|
|
while(drapeau_fin == d_faux) |
{ |
{ |
if ((caractere == d_code_retour_chariot) || |
if ((caractere = getc(pipe)) != EOF) |
(caractere == d_code_tabulation)) |
|
{ |
{ |
do |
if ((caractere == d_code_retour_chariot) || |
|
(caractere == d_code_tabulation) || |
|
((caractere == d_code_espace) && |
|
(presence_chaine == d_faux))) |
{ |
{ |
caractere = getc(pipe); |
do |
} while(((caractere == d_code_retour_chariot) || |
{ |
(caractere == d_code_tabulation)) && |
caractere = getc(pipe); |
(caractere != EOF)); |
} while(((caractere == d_code_retour_chariot) || |
|
(caractere == d_code_tabulation) || |
|
((caractere == d_code_espace) && |
|
(presence_chaine == d_faux))) && |
|
(caractere != EOF)); |
|
|
|
if (caractere != EOF) |
|
{ |
|
chaine[i++] = d_code_espace; |
|
} |
|
else |
|
{ |
|
drapeau_fin = d_vrai; |
|
} |
|
} |
|
|
if (caractere != EOF) |
if ((chaine[i] = (unsigned char) caractere) == '\"') |
{ |
{ |
((unsigned char *) (*s_objet_temporaire).objet)[i++] = |
if (i > 0) |
d_code_espace; |
{ |
|
if (chaine[i - 1] != '\\') |
|
{ |
|
presence_chaine = (presence_chaine == d_faux) |
|
? d_vrai : d_faux; |
|
} |
|
} |
|
|
|
i++; |
|
} |
|
else |
|
{ |
|
i++; |
} |
} |
} |
} |
|
else |
((unsigned char *) (*s_objet_temporaire).objet)[i++] = |
{ |
caractere; |
drapeau_fin = d_vrai; |
|
} |
} |
} |
|
|
if (caractere == EOF) |
if ((caractere == EOF) && (i > 0)) |
{ |
{ |
i--; |
i--; |
} |
} |
|
|
((unsigned char *) (*s_objet_temporaire).objet)[i] = d_code_fin_chaine; |
chaine[i] = d_code_fin_chaine; |
|
|
if (fclose(pipe) != 0) |
if (fclose(pipe) != 0) |
{ |
{ |
Line 1191 instruction_recall(struct_processus *s_e
|
Line 1397 instruction_recall(struct_processus *s_e
|
return; |
return; |
} |
} |
|
|
if (empilement(s_etat_processus, &((*s_etat_processus).l_base_pile), |
indicateur_48 = test_cfsf(s_etat_processus, 48); |
s_objet_temporaire) == d_erreur) |
cf(s_etat_processus, 48); |
|
|
|
tampon_definitions_chainees = (*s_etat_processus).definitions_chainees; |
|
tampon_instruction_courante = (*s_etat_processus).instruction_courante; |
|
position_courante = (*s_etat_processus).position_courante; |
|
autorisation_empilement_programme = (*s_etat_processus) |
|
.autorisation_empilement_programme; |
|
|
|
(*s_etat_processus).instruction_courante = NULL; |
|
|
|
if (((*s_etat_processus).definitions_chainees = transliteration( |
|
s_etat_processus, chaine, "UTF-8", d_locale)) == NULL) |
|
{ |
|
if (indicateur_48 == d_vrai) |
|
{ |
|
sf(s_etat_processus, 48); |
|
} |
|
else |
|
{ |
|
cf(s_etat_processus, 48); |
|
} |
|
|
|
if (destruction_fichier(nom_fichier_temporaire) == d_erreur) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_erreur_fichier; |
|
return; |
|
} |
|
|
|
free(nom_fichier_temporaire); |
|
free((*s_etat_processus).instruction_courante); |
|
free(chaine); |
|
|
|
(*s_etat_processus).position_courante = position_courante; |
|
(*s_etat_processus).instruction_courante = |
|
tampon_instruction_courante; |
|
(*s_etat_processus).definitions_chainees = |
|
tampon_definitions_chainees; |
|
(*s_etat_processus).autorisation_empilement_programme = |
|
autorisation_empilement_programme; |
|
|
|
liberation(s_etat_processus, s_objet); |
|
return; |
|
} |
|
|
|
(*s_etat_processus).autorisation_empilement_programme = 'Y'; |
|
(*s_etat_processus).position_courante = 0; |
|
|
|
if (analyse_syntaxique(s_etat_processus) == d_erreur) |
|
{ |
|
if (indicateur_48 == d_vrai) |
|
{ |
|
sf(s_etat_processus, 48); |
|
} |
|
else |
|
{ |
|
cf(s_etat_processus, 48); |
|
} |
|
|
|
if (destruction_fichier(nom_fichier_temporaire) == d_erreur) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_erreur_fichier; |
|
return; |
|
} |
|
|
|
free(nom_fichier_temporaire); |
|
free((*s_etat_processus).instruction_courante); |
|
free((*s_etat_processus).definitions_chainees); |
|
free(chaine); |
|
|
|
(*s_etat_processus).position_courante = position_courante; |
|
(*s_etat_processus).instruction_courante = |
|
tampon_instruction_courante; |
|
(*s_etat_processus).definitions_chainees = |
|
tampon_definitions_chainees; |
|
(*s_etat_processus).autorisation_empilement_programme = |
|
autorisation_empilement_programme; |
|
|
|
liberation(s_etat_processus, s_objet); |
|
return; |
|
} |
|
|
|
(*s_etat_processus).position_courante = 0; |
|
|
|
if (recherche_instruction_suivante(s_etat_processus) != |
|
d_absence_erreur) |
{ |
{ |
|
if (indicateur_48 == d_vrai) |
|
{ |
|
sf(s_etat_processus, 48); |
|
} |
|
else |
|
{ |
|
cf(s_etat_processus, 48); |
|
} |
|
|
|
if (destruction_fichier(nom_fichier_temporaire) == d_erreur) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_erreur_fichier; |
|
return; |
|
} |
|
|
free(nom_fichier_temporaire); |
free(nom_fichier_temporaire); |
|
free((*s_etat_processus).instruction_courante); |
|
free((*s_etat_processus).definitions_chainees); |
|
free(chaine); |
|
|
|
(*s_etat_processus).position_courante = position_courante; |
|
(*s_etat_processus).instruction_courante = |
|
tampon_instruction_courante; |
|
(*s_etat_processus).definitions_chainees = |
|
tampon_definitions_chainees; |
|
(*s_etat_processus).autorisation_empilement_programme = |
|
autorisation_empilement_programme; |
|
|
|
liberation(s_etat_processus, s_objet); |
return; |
return; |
} |
} |
|
|
instruction_str_fleche(s_etat_processus); |
(*s_etat_processus).type_en_cours = NON; |
|
recherche_type(s_etat_processus); |
|
|
|
while((*s_etat_processus).definitions_chainees |
|
[(*s_etat_processus).position_courante] != d_code_fin_chaine) |
|
{ |
|
if ((*s_etat_processus).definitions_chainees |
|
[(*s_etat_processus).position_courante++] != d_code_espace) |
|
{ |
|
(*s_etat_processus).erreur_execution = d_ex_syntaxe; |
|
} |
|
} |
|
|
|
free((*s_etat_processus).instruction_courante); |
|
free((*s_etat_processus).definitions_chainees); |
|
free(chaine); |
|
|
|
(*s_etat_processus).position_courante = position_courante; |
|
(*s_etat_processus).instruction_courante = |
|
tampon_instruction_courante; |
|
(*s_etat_processus).definitions_chainees = |
|
tampon_definitions_chainees; |
|
(*s_etat_processus).autorisation_empilement_programme = |
|
autorisation_empilement_programme; |
|
|
|
if (indicateur_48 == d_vrai) |
|
{ |
|
sf(s_etat_processus, 48); |
|
} |
|
else |
|
{ |
|
cf(s_etat_processus, 48); |
|
} |
|
|
if (destruction_fichier(nom_fichier_temporaire) == d_erreur) |
if (destruction_fichier(nom_fichier_temporaire) == d_erreur) |
{ |
{ |
Line 1238 instruction_rcws(struct_processus *s_eta
|
Line 1588 instruction_rcws(struct_processus *s_eta
|
{ |
{ |
struct_objet *s_objet_resultat; |
struct_objet *s_objet_resultat; |
|
|
unsigned long i; |
integer8 i; |
unsigned long j; |
integer8 j; |
unsigned long longueur; |
integer8 longueur; |
|
|
(*s_etat_processus).erreur_execution = d_ex; |
(*s_etat_processus).erreur_execution = d_ex; |
|
|
Line 1318 instruction_rcws(struct_processus *s_eta
|
Line 1668 instruction_rcws(struct_processus *s_eta
|
void |
void |
instruction_rcls(struct_processus *s_etat_processus) |
instruction_rcls(struct_processus *s_etat_processus) |
{ |
{ |
logical1 presence_variable; |
|
|
|
long i; |
|
|
|
struct_objet *s_objet_variable; |
struct_objet *s_objet_variable; |
|
|
(*s_etat_processus).erreur_execution = d_ex; |
(*s_etat_processus).erreur_execution = d_ex; |
Line 1362 instruction_rcls(struct_processus *s_eta
|
Line 1708 instruction_rcls(struct_processus *s_eta
|
} |
} |
} |
} |
|
|
if (recherche_variable(s_etat_processus, ds_sdat) == d_vrai) |
if (recherche_variable_globale(s_etat_processus, ds_sdat) == d_faux) |
{ |
{ |
i = (*s_etat_processus).position_variable_courante; |
(*s_etat_processus).erreur_systeme = d_es; |
presence_variable = d_faux; |
|
|
|
while(i >= 0) |
|
{ |
|
if ((strcmp((*s_etat_processus).s_liste_variables[i].nom, ds_sdat) |
|
== 0) && ((*s_etat_processus).s_liste_variables[i] |
|
.niveau == 1)) |
|
{ |
|
presence_variable = d_vrai; |
|
break; |
|
} |
|
|
|
i--; |
|
} |
|
|
|
(*s_etat_processus).position_variable_courante = i; |
|
|
|
if (presence_variable == d_faux) |
if ((*s_etat_processus).erreur_execution == d_ex) |
{ |
{ |
(*s_etat_processus).erreur_execution = d_ex_variable_non_definie; |
(*s_etat_processus).erreur_execution = d_ex_variable_non_definie; |
return; |
|
} |
} |
|
|
if ((*s_etat_processus).s_liste_variables[i].objet == NULL) |
|
{ |
|
(*s_etat_processus).erreur_execution = d_ex_variable_partagee; |
|
return; |
|
} |
|
} |
|
else |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es; |
|
(*s_etat_processus).erreur_execution = d_ex_variable_non_definie; |
|
return; |
return; |
} |
} |
|
|
if ((s_objet_variable = copie_objet(s_etat_processus, |
if ((s_objet_variable = copie_objet(s_etat_processus, |
((*s_etat_processus).s_liste_variables) |
(*(*s_etat_processus).pointeur_variable_courante).objet, 'O')) |
[(*s_etat_processus).position_variable_courante].objet, 'O')) |
|
== NULL) |
== NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |