version 1.67, 2012/12/19 09:58:23
|
version 1.71, 2013/03/22 15:31:19
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.1.12 |
RPL/2 (R) version 4.1.13 |
Copyright (C) 1989-2012 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 284 allocation_tableau_noeuds(struct_process
|
Line 284 allocation_tableau_noeuds(struct_process
|
} |
} |
else |
else |
{ |
{ |
objet = malloc((*s_etat_processus).nombre_caracteres_variables |
objet = malloc(((size_t) (*s_etat_processus) |
|
.nombre_caracteres_variables) |
* sizeof(struct_arbre_variables *)); |
* sizeof(struct_arbre_variables *)); |
} |
} |
|
|
Line 988 recherche_variable(struct_processus *s_e
|
Line 989 recherche_variable(struct_processus *s_e
|
|
|
unsigned char *ptr; |
unsigned char *ptr; |
|
|
unsigned long niveau_appel; |
integer8 niveau_appel; |
|
|
if ((*s_etat_processus).s_arbre_variables == NULL) |
if ((*s_etat_processus).s_arbre_variables == NULL) |
{ |
{ |
Line 1203 retrait_variable(struct_processus *s_eta
|
Line 1204 retrait_variable(struct_processus *s_eta
|
struct_liste_variables *variable_a_supprimer; |
struct_liste_variables *variable_a_supprimer; |
struct_liste_variables *variables_par_niveau; |
struct_liste_variables *variables_par_niveau; |
|
|
unsigned long niveau; |
integer8 niveau; |
|
|
(*s_etat_processus).niveau_supprime = d_faux; |
(*s_etat_processus).niveau_supprime = d_faux; |
|
|
Line 1789 liberation_arbre_variables(struct_proces
|
Line 1790 liberation_arbre_variables(struct_proces
|
================================================================================ |
================================================================================ |
*/ |
*/ |
|
|
static int |
static integer8 |
nombre_variables_locales(struct_processus *s_etat_processus, |
nombre_variables_locales(struct_processus *s_etat_processus, |
struct_arbre_variables *l_element_courant) |
struct_arbre_variables *l_element_courant) |
{ |
{ |
int i; |
integer8 i; |
int n; |
integer8 n; |
|
|
struct_liste_variables *l_variable; |
struct_liste_variables *l_variable; |
struct_liste_variables_statiques *l_variable_statique; |
struct_liste_variables_statiques *l_variable_statique; |
Line 1848 nombre_variables_locales(struct_processu
|
Line 1849 nombre_variables_locales(struct_processu
|
} |
} |
|
|
|
|
static int |
static integer8 |
nombre_variables_partagees(struct_processus *s_etat_processus, |
nombre_variables_partagees(struct_processus *s_etat_processus, |
struct_arbre_variables_partagees *l_element_courant) |
struct_arbre_variables_partagees *l_element_courant) |
{ |
{ |
int i; |
integer8 i; |
int n; |
integer8 n; |
|
|
struct_liste_variables_partagees *l_variable; |
struct_liste_variables_partagees *l_variable; |
|
|
Line 1894 nombre_variables_partagees(struct_proces
|
Line 1895 nombre_variables_partagees(struct_proces
|
} |
} |
|
|
|
|
int |
integer8 |
nombre_variables(struct_processus *s_etat_processus) |
nombre_variables(struct_processus *s_etat_processus) |
{ |
{ |
return(nombre_variables_locales(s_etat_processus, |
return(nombre_variables_locales(s_etat_processus, |
Line 1940 liberation_mutexes_arbre_variables_parta
|
Line 1941 liberation_mutexes_arbre_variables_parta
|
} |
} |
|
|
|
|
static int |
static integer8 |
liste_variables_locales(struct_processus *s_etat_processus, |
liste_variables_locales(struct_processus *s_etat_processus, |
struct_tableau_variables *tableau, int position, |
struct_tableau_variables *tableau, integer8 position, |
struct_arbre_variables *l_element_courant) |
struct_arbre_variables *l_element_courant) |
{ |
{ |
int i; |
integer8 i; |
|
|
struct_liste_variables *l_variable; |
struct_liste_variables *l_variable; |
struct_liste_variables_statiques *l_variable_statique; |
struct_liste_variables_statiques *l_variable_statique; |
Line 2018 liste_variables_locales(struct_processus
|
Line 2019 liste_variables_locales(struct_processus
|
} |
} |
|
|
|
|
static int |
static integer8 |
liste_variables_partagees(struct_processus *s_etat_processus, |
liste_variables_partagees(struct_processus *s_etat_processus, |
struct_tableau_variables *tableau, int position, |
struct_tableau_variables *tableau, integer8 position, |
struct_arbre_variables_partagees *l_element_courant) |
struct_arbre_variables_partagees *l_element_courant) |
{ |
{ |
int i; |
integer8 i; |
|
|
struct_liste_variables_partagees *l_variable; |
struct_liste_variables_partagees *l_variable; |
|
|
Line 2032 liste_variables_partagees(struct_process
|
Line 2033 liste_variables_partagees(struct_process
|
return(0); |
return(0); |
} |
} |
|
|
|
// 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 2086 fonction_ordre_variables(const void *arg
|
Line 2089 fonction_ordre_variables(const void *arg
|
} |
} |
else |
else |
{ |
{ |
return((*a1).niveau - (*a2).niveau); |
return(((((*a1).niveau - (*a2).niveau)) > 0) ? 1 : -1); |
} |
} |
} |
} |
|
|
|
|
int |
integer8 |
liste_variables(struct_processus *s_etat_processus, |
liste_variables(struct_processus *s_etat_processus, |
struct_tableau_variables *tableau) |
struct_tableau_variables *tableau) |
{ |
{ |
int nombre_elements; |
integer8 nombre_elements; |
|
|
nombre_elements = liste_variables_locales(s_etat_processus, |
nombre_elements = liste_variables_locales(s_etat_processus, |
tableau, 0, (*s_etat_processus).s_arbre_variables); |
tableau, 0, (*s_etat_processus).s_arbre_variables); |
Line 2103 liste_variables(struct_processus *s_etat
|
Line 2106 liste_variables(struct_processus *s_etat
|
tableau, nombre_elements, (*(*s_etat_processus) |
tableau, nombre_elements, (*(*s_etat_processus) |
.s_arbre_variables_partagees)); |
.s_arbre_variables_partagees)); |
|
|
qsort(tableau, nombre_elements, sizeof(struct_tableau_variables), |
qsort(tableau, (size_t) nombre_elements, sizeof(struct_tableau_variables), |
fonction_ordre_variables); |
fonction_ordre_variables); |
|
|
return(nombre_elements); |
return(nombre_elements); |
Line 2456 initialisation_variables(struct_processu
|
Line 2459 initialisation_variables(struct_processu
|
} |
} |
|
|
if (((*s_etat_processus).pointeurs_caracteres_variables = |
if (((*s_etat_processus).pointeurs_caracteres_variables = |
malloc(longueur_tableau * sizeof(int))) == NULL) |
malloc(((size_t) longueur_tableau) * sizeof(int))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |