version 1.72, 2013/03/23 16:14:39
|
version 1.92, 2015/02/19 11:01:20
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.1.13 |
RPL/2 (R) version 4.1.21 |
Copyright (C) 1989-2013 Dr. BERTRAND Joël |
Copyright (C) 1989-2015 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
|
|
Line 1531 retrait_variables_par_niveau(struct_proc
|
Line 1531 retrait_variables_par_niveau(struct_proc
|
break; |
break; |
} |
} |
|
|
|
if (((*s_etat_processus).at_exit != NULL) && |
|
((*s_etat_processus).niveau_courant == 0)) |
|
{ |
|
// Il y a une routine ATEXIT enregistrée. On ne détruit pas |
|
// les variables globales qui pourraient y être utilisées. |
|
|
|
break; |
|
} |
|
|
while((*(*s_etat_processus).l_liste_variables_par_niveau).liste |
while((*(*s_etat_processus).l_liste_variables_par_niveau).liste |
!= NULL) |
!= NULL) |
{ |
{ |
Line 1863 nombre_variables_partagees(struct_proces
|
Line 1872 nombre_variables_partagees(struct_proces
|
return(0); |
return(0); |
} |
} |
|
|
|
// Mutex deverrouillé par liste_variables_partagees(); |
if (pthread_mutex_lock(&((*l_element_courant).mutex_feuille)) != 0) |
if (pthread_mutex_lock(&((*l_element_courant).mutex_feuille)) != 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
Line 2000 liste_variables_locales(struct_processus
|
Line 2010 liste_variables_locales(struct_processus
|
(*(*l_variable_statique).variable).variable_statique; |
(*(*l_variable_statique).variable).variable_statique; |
tableau[position].variable_partagee.pointeur = NULL; |
tableau[position].variable_partagee.pointeur = NULL; |
tableau[position].variable_masquee = d_vrai; |
tableau[position].variable_masquee = d_vrai; |
|
tableau[position].mutex = NULL; |
|
|
position++; |
position++; |
} |
} |
Line 2035 liste_variables_partagees(struct_process
|
Line 2046 liste_variables_partagees(struct_process
|
return(position); |
return(position); |
} |
} |
|
|
// mutex_liste_variables_partagees |
|
// et (*l_variable_courante).mutex_feuille |
|
if ((*l_element_courant).feuille != NULL) |
if ((*l_element_courant).feuille != NULL) |
{ |
{ |
l_variable = (*l_element_courant).feuille; |
l_variable = (*l_element_courant).feuille; |
Line 2050 liste_variables_partagees(struct_process
|
Line 2059 liste_variables_partagees(struct_process
|
tableau[position].variable_verrouillee = d_faux; |
tableau[position].variable_verrouillee = d_faux; |
tableau[position].variable_partagee = |
tableau[position].variable_partagee = |
(*(*l_variable).variable).variable_partagee; |
(*(*l_variable).variable).variable_partagee; |
tableau[position].variable_partagee.pointeur = NULL; |
tableau[position].variable_statique.pointeur = NULL; |
tableau[position].variable_masquee = d_faux; |
tableau[position].variable_masquee = d_faux; |
tableau[position].mutex = &((*(*l_variable).variable).mutex); |
tableau[position].mutex = &((*(*l_variable).variable).mutex); |
|
pthread_mutex_lock(tableau[position].mutex); |
|
|
position++; |
position++; |
|
|
Line 2069 liste_variables_partagees(struct_process
|
Line 2079 liste_variables_partagees(struct_process
|
} |
} |
} |
} |
|
|
|
// Mutex verrouillé par nombre_variables_partagees(); |
if (pthread_mutex_unlock(&((*l_element_courant).mutex_feuille)) != 0) |
if (pthread_mutex_unlock(&((*l_element_courant).mutex_feuille)) != 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
Line 2225 copie_arbre_variables(struct_processus *
|
Line 2236 copie_arbre_variables(struct_processus *
|
s_variable = (*((struct_variable *) |
s_variable = (*((struct_variable *) |
(*l_element_courant).donnee)); |
(*l_element_courant).donnee)); |
|
|
if ((s_variable.nom = strdup((*((struct_variable *) |
if ((s_variable.nom = rpl_malloc(s_nouvel_etat_processus, |
(*l_element_courant).donnee)).nom)) == NULL) |
(strlen((*((struct_variable *) |
|
(*l_element_courant).donnee)).nom) + 1) * |
|
sizeof(unsigned char))) == NULL) |
{ |
{ |
(*s_nouvel_etat_processus).erreur_systeme = |
(*s_nouvel_etat_processus).erreur_systeme = |
d_es_allocation_memoire; |
d_es_allocation_memoire; |
return; |
return; |
} |
} |
|
|
|
strcpy(s_variable.nom, (*((struct_variable *) |
|
(*l_element_courant).donnee)).nom); |
|
|
if ((s_variable.objet = copie_objet(s_nouvel_etat_processus, |
if ((s_variable.objet = copie_objet(s_nouvel_etat_processus, |
(*((struct_variable *) (*l_element_courant).donnee)) |
(*((struct_variable *) (*l_element_courant).donnee)) |
.objet, 'P')) == NULL) |
.objet, 'P')) == NULL) |
Line 2400 copie_arbre_variables(struct_processus *
|
Line 2416 copie_arbre_variables(struct_processus *
|
return; |
return; |
} |
} |
|
|
if ((s_variable_statique.nom = malloc((strlen( |
if ((s_variable_statique.nom = rpl_malloc(s_nouvel_etat_processus, |
(*(*l_element_statique_courant).variable).nom) + 1) * |
(strlen((*(*l_element_statique_courant).variable).nom) + 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 2438 copie_arbre_variables(struct_processus *
|
Line 2454 copie_arbre_variables(struct_processus *
|
*/ |
*/ |
|
|
/* |
/* |
* Caractères autorisés dans les instructions |
* Caractères autorisés dans les variables |
* |
* |
* A B C D E F G H I J K L M N O P Q R S T U V W X Y Z |
* A B C D E F G H I J K L M N O P Q R S T U V W X Y Z |
* a b c d e f g h i j k l m n o p q r s t u v w x y z |
* a b c d e f g h i j k l m n o p q r s t u v w x y z |