version 1.26, 2011/06/27 09:05:00
|
version 1.50, 2013/03/21 11:30:30
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.1.0 |
RPL/2 (R) version 4.1.13 |
Copyright (C) 1989-2011 Dr. BERTRAND Joël |
Copyright (C) 1989-2013 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
|
|
Line 42 instruction_var(struct_processus *s_etat
|
Line 42 instruction_var(struct_processus *s_etat
|
struct_objet *s_objet_resultat; |
struct_objet *s_objet_resultat; |
struct_objet *s_objet_temporaire; |
struct_objet *s_objet_temporaire; |
|
|
unsigned long nombre_colonnes; |
integer8 nombre_colonnes; |
|
|
(*s_etat_processus).erreur_execution = d_ex; |
(*s_etat_processus).erreur_execution = d_ex; |
|
|
Line 237 instruction_version(struct_processus *s_
|
Line 237 instruction_version(struct_processus *s_
|
struct_objet *s_objet_resultat; |
struct_objet *s_objet_resultat; |
|
|
unsigned char texte[] = "RPL/2 version "; |
unsigned char texte[] = "RPL/2 version "; |
|
unsigned char tampon[256 + 1]; |
|
|
(*s_etat_processus).erreur_execution = d_ex; |
(*s_etat_processus).erreur_execution = d_ex; |
|
|
Line 499 instruction_version(struct_processus *s_
|
Line 500 instruction_version(struct_processus *s_
|
return; |
return; |
} |
} |
|
|
if (((*(*l_element_courant).donnee).objet = malloc((strlen(d_date_en_rpl) |
if (((*(*l_element_courant).donnee).objet = date_compilation()) == NULL) |
+ 1) * 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 *) (*(*l_element_courant).donnee).objet, |
|
d_date_en_rpl); |
|
|
|
/* |
/* |
* Ajout des options de compilation |
* Ajout des options de compilation |
*/ |
*/ |
Line 830 instruction_version(struct_processus *s_
|
Line 827 instruction_version(struct_processus *s_
|
return; |
return; |
} |
} |
|
|
#ifdef DEBUG |
#ifdef RPLCAS |
if (((*(*l_element_courant).donnee).objet = malloc(6 * |
if (((*(*l_element_courant).donnee).objet = malloc(8 * |
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 839 instruction_version(struct_processus *s_
|
Line 836 instruction_version(struct_processus *s_
|
} |
} |
|
|
strcpy((unsigned char *) (*(*l_element_courant).donnee).objet, |
strcpy((unsigned char *) (*(*l_element_courant).donnee).objet, |
"DEBUG"); |
"RPL/CAS"); |
#else |
#else |
if (((*(*l_element_courant).donnee).objet = malloc(15 * |
if (((*(*l_element_courant).donnee).objet = malloc(17 * |
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 849 instruction_version(struct_processus *s_
|
Line 846 instruction_version(struct_processus *s_
|
} |
} |
|
|
strcpy((unsigned char *) (*(*l_element_courant).donnee).objet, |
strcpy((unsigned char *) (*(*l_element_courant).donnee).objet, |
"DEBUG DISABLED"); |
"RPL/CAS DISABLED"); |
#endif |
#endif |
|
|
if (((*l_element_courant).suivant = |
if (((*l_element_courant).suivant = |
Line 891 instruction_version(struct_processus *s_
|
Line 888 instruction_version(struct_processus *s_
|
"EXPERIMENTAL CODE DISABLED"); |
"EXPERIMENTAL CODE DISABLED"); |
#endif |
#endif |
|
|
|
if (((*l_element_courant).suivant = |
|
allocation_maillon(s_etat_processus)) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
l_element_courant = (*l_element_courant).suivant; |
|
(*l_element_courant).suivant = NULL; |
|
|
|
if (((*l_element_courant).donnee = allocation(s_etat_processus, CHN)) |
|
== NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
sprintf(tampon, "%zu BITS ABI", sizeof(void *) * 8); |
|
|
|
if (((*(*l_element_courant).donnee).objet = malloc((strlen(tampon) + 1 ) |
|
* sizeof(unsigned char))) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
strcpy((unsigned char *) (*(*l_element_courant).donnee).objet, tampon); |
|
|
|
if (((*l_element_courant).suivant = |
|
allocation_maillon(s_etat_processus)) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
l_element_courant = (*l_element_courant).suivant; |
|
(*l_element_courant).suivant = NULL; |
|
|
|
if (((*l_element_courant).donnee = allocation(s_etat_processus, CHN)) |
|
== NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
if (((*(*l_element_courant).donnee).objet = conversion_majuscule(HOST)) |
|
== NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return; |
|
} |
|
|
/* |
/* |
* Empilement du résultat |
* Empilement du résultat |
*/ |
*/ |
Line 920 instruction_version(struct_processus *s_
|
Line 969 instruction_version(struct_processus *s_
|
void |
void |
instruction_vars(struct_processus *s_etat_processus) |
instruction_vars(struct_processus *s_etat_processus) |
{ |
{ |
int i; |
integer8 i; |
int nb_variables; |
integer8 nb_variables; |
|
|
logical1 variable_partagee; |
logical1 variable_partagee; |
|
|
Line 974 instruction_vars(struct_processus *s_eta
|
Line 1023 instruction_vars(struct_processus *s_eta
|
(*s_objet_resultat).objet = NULL; |
(*s_objet_resultat).objet = NULL; |
l_element_precedent = NULL; |
l_element_precedent = NULL; |
|
|
nb_variables = nombre_variables(s_etat_processus, |
nb_variables = nombre_variables(s_etat_processus); |
(*s_etat_processus).s_arbre_variables); |
|
|
|
if ((tableau = malloc(nb_variables * sizeof(struct_tableau_variables))) |
if ((tableau = malloc(((size_t) nb_variables) * |
== NULL) |
sizeof(struct_tableau_variables))) == NULL) |
{ |
{ |
|
liberation_mutexes_arbre_variables_partagees(s_etat_processus, |
|
(*(*s_etat_processus).s_arbre_variables_partagees)); |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
} |
} |
|
|
liste_variables(s_etat_processus, tableau, 0, |
liste_variables(s_etat_processus, tableau); |
(*s_etat_processus).s_arbre_variables); |
|
|
|
for(i = 0; i < nb_variables; i++) |
for(i = 0; i < nb_variables; i++) |
{ |
{ |
Line 1039 instruction_vars(struct_processus *s_eta
|
Line 1088 instruction_vars(struct_processus *s_eta
|
|
|
if (tableau[i].objet == NULL) |
if (tableau[i].objet == NULL) |
{ |
{ |
if (pthread_mutex_lock(&((*(*s_etat_processus) |
|
.s_liste_variables_partagees).mutex)) != 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
|
|
if (recherche_variable_partagee(s_etat_processus, |
if (recherche_variable_partagee(s_etat_processus, |
tableau[i].nom, tableau[i].variable_partagee, |
tableau[i].nom, tableau[i].variable_partagee, |
tableau[i].origine) == d_faux) |
tableau[i].origine) == NULL) |
{ |
{ |
// La variable partagée n'existe plus. |
// La variable partagée n'existe plus. |
|
|
if (pthread_mutex_unlock(&((*(*s_etat_processus) |
|
.s_liste_variables_partagees).mutex)) != 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
|
|
continue; |
continue; |
} |
} |
|
|
Line 1080 instruction_vars(struct_processus *s_eta
|
Line 1115 instruction_vars(struct_processus *s_eta
|
if (variable_partagee == d_vrai) |
if (variable_partagee == d_vrai) |
{ |
{ |
if (pthread_mutex_unlock(&((*(*s_etat_processus) |
if (pthread_mutex_unlock(&((*(*s_etat_processus) |
.s_liste_variables_partagees).mutex)) != 0) |
.pointeur_variable_partagee_courante).mutex)) != 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
Line 1103 instruction_vars(struct_processus *s_eta
|
Line 1138 instruction_vars(struct_processus *s_eta
|
if (variable_partagee == d_vrai) |
if (variable_partagee == d_vrai) |
{ |
{ |
if (pthread_mutex_unlock(&((*(*s_etat_processus) |
if (pthread_mutex_unlock(&((*(*s_etat_processus) |
.s_liste_variables_partagees).mutex)) != 0) |
.pointeur_variable_partagee_courante).mutex)) != 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
Line 1129 instruction_vars(struct_processus *s_eta
|
Line 1164 instruction_vars(struct_processus *s_eta
|
if (variable_partagee == d_vrai) |
if (variable_partagee == d_vrai) |
{ |
{ |
if (pthread_mutex_unlock(&((*(*s_etat_processus) |
if (pthread_mutex_unlock(&((*(*s_etat_processus) |
.s_liste_variables_partagees).mutex)) != 0) |
.pointeur_variable_partagee_courante).mutex)) != 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
Line 1147 instruction_vars(struct_processus *s_eta
|
Line 1182 instruction_vars(struct_processus *s_eta
|
if (variable_partagee == d_vrai) |
if (variable_partagee == d_vrai) |
{ |
{ |
if (pthread_mutex_unlock(&((*(*s_etat_processus) |
if (pthread_mutex_unlock(&((*(*s_etat_processus) |
.s_liste_variables_partagees).mutex)) != 0) |
.pointeur_variable_partagee_courante).mutex)) != 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
Line 1173 instruction_vars(struct_processus *s_eta
|
Line 1208 instruction_vars(struct_processus *s_eta
|
if (variable_partagee == d_vrai) |
if (variable_partagee == d_vrai) |
{ |
{ |
if (pthread_mutex_unlock(&((*(*s_etat_processus) |
if (pthread_mutex_unlock(&((*(*s_etat_processus) |
.s_liste_variables_partagees).mutex)) != 0) |
.pointeur_variable_partagee_courante).mutex)) != 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
Line 1191 instruction_vars(struct_processus *s_eta
|
Line 1226 instruction_vars(struct_processus *s_eta
|
if (((*(*(*((struct_liste_chainee *) (*((struct_objet *) |
if (((*(*(*((struct_liste_chainee *) (*((struct_objet *) |
(*l_element_courant).donnee)).objet)).suivant).suivant) |
(*l_element_courant).donnee)).objet)).suivant).suivant) |
.donnee = copie_objet(s_etat_processus, |
.donnee = copie_objet(s_etat_processus, |
(*(*s_etat_processus) |
(*(*s_etat_processus).pointeur_variable_partagee_courante) |
.s_liste_variables_partagees).table[(*(*s_etat_processus) |
.objet, 'P')) == NULL) |
.s_liste_variables_partagees).position_variable].objet, |
|
'P')) == NULL) |
|
{ |
{ |
if (pthread_mutex_unlock(&((*(*s_etat_processus) |
if (pthread_mutex_unlock(&((*(*s_etat_processus) |
.s_liste_variables_partagees).mutex)) != 0) |
.pointeur_variable_partagee_courante).mutex)) != 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
Line 1208 instruction_vars(struct_processus *s_eta
|
Line 1241 instruction_vars(struct_processus *s_eta
|
} |
} |
|
|
if (pthread_mutex_unlock(&((*(*s_etat_processus) |
if (pthread_mutex_unlock(&((*(*s_etat_processus) |
.s_liste_variables_partagees).mutex)) != 0) |
.pointeur_variable_partagee_courante).mutex)) != 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
Line 1261 instruction_vars(struct_processus *s_eta
|
Line 1294 instruction_vars(struct_processus *s_eta
|
return; |
return; |
} |
} |
|
|
strcpy((unsigned char *) (*(*(*(*(*((struct_liste_chainee *) |
if (tableau[i].variable_masquee == d_vrai) |
(*((struct_objet *) (*l_element_courant).donnee)).objet)) |
{ |
.suivant).suivant) .suivant).donnee).objet, "STATIC"); |
strcpy((unsigned char *) (*(*(*(*(*((struct_liste_chainee *) |
|
(*((struct_objet *) (*l_element_courant).donnee)) |
|
.objet)).suivant).suivant).suivant).donnee).objet, |
|
"SHADOW"); |
|
} |
|
else |
|
{ |
|
strcpy((unsigned char *) (*(*(*(*(*((struct_liste_chainee *) |
|
(*((struct_objet *) (*l_element_courant).donnee)) |
|
.objet)).suivant).suivant).suivant).donnee).objet, |
|
"STATIC"); |
|
} |
} |
} |
else |
else |
{ |
{ |
Line 1433 instruction_visit(struct_processus *s_et
|
Line 1477 instruction_visit(struct_processus *s_et
|
|
|
struct_objet *s_objet; |
struct_objet *s_objet; |
|
|
unsigned long profondeur_initiale; |
integer8 profondeur_initiale; |
|
|
(*s_etat_processus).erreur_execution = d_ex; |
(*s_etat_processus).erreur_execution = d_ex; |
|
|