--- rpl/src/gestion_variables.c 2011/04/14 10:32:59 1.23 +++ rpl/src/gestion_variables.c 2011/04/14 13:18:54 1.24 @@ -714,6 +714,73 @@ retrait_variable_par_niveau(struct_proce /* ================================================================================ + Procédure de retrait des toutes les variables locales et globales +================================================================================ + Entrée : drapeau indiquant s'il faut retirer les définitions (variables + de niveau 0) +-------------------------------------------------------------------------------- + Sortie : +-------------------------------------------------------------------------------- + Effets de bord : néant +================================================================================ +*/ + +void +liberation_arbre_variables(struct_processus *s_etat_processus, + struct_arbre_variables *arbre, logical1 retrait_definitions) +{ + int i; + + struct_liste_chainee *l_element_courant; + struct_liste_chainee *l_element_suivant; + + for(i = 0; i < (*s_etat_processus).nombre_caracteres_variables; i++) + { + if ((*arbre).noeud[i] != NULL) + { + l_element_courant = (*arbre).l_variables; + + while(l_element_courant != NULL) + { + l_element_suivant = (*l_element_courant).suivant; + + if (retrait_definitions == d_vrai) + { + liberation(s_etat_processus, (*((struct_variable *) + (*l_element_courant).donnee)).objet); + free((*((struct_variable *) (*l_element_courant) + .donnee)).nom); + free((struct_variable *) (*l_element_courant).donnee); + } + else + { + if ((*((struct_variable *) (*l_element_courant).donnee)) + .niveau >= 1) + { + liberation(s_etat_processus, (*((struct_variable *) + (*l_element_courant).donnee)).objet); + free((*((struct_variable *) (*l_element_courant) + .donnee)).nom); + free((struct_variable *) (*l_element_courant).donnee); + } + } + + free(l_element_courant); + l_element_courant = l_element_suivant; + } + + liberation_arbre_variables(s_etat_processus, (*arbre).noeud[i]); + } + } + + free((*arbre).noeud); + free(arbre); + + return; +} + +/* +================================================================================ Procédure de copie de l'arbre des variables ================================================================================ Entrée :