--- rpl/src/rpl.h 2011/04/19 07:31:33 1.83 +++ rpl/src/rpl.h 2011/06/21 15:26:35 1.96 @@ -1,6 +1,6 @@ /* ================================================================================ - RPL/2 (R) version 4.1.0.prerelease.0 + RPL/2 (R) version 4.1.0.prerelease.2 Copyright (C) 1989-2011 Dr. BERTRAND Joël This file is part of RPL/2. @@ -922,6 +922,7 @@ pid_t debug_fork(); # define d_ex_clef_inexistante __erreur(80) # define d_ex_nom_implicite __erreur(81) # define d_ex_version_bibliotheque __erreur(82) +# define d_ex_creation_variable_globale __erreur(83) #endif @@ -1679,7 +1680,7 @@ typedef struct rpl_arguments #ifndef RPLARGS typedef struct instruction { - struct instruction **noeud; + struct instruction **noeuds; void (*feuille)(struct processus *); } struct_instruction; #endif @@ -1694,18 +1695,39 @@ typedef struct instruction typedef struct arbre_variables { unsigned int noeuds_utilises; - struct arbre_variables **noeud; + signed int indice_tableau_pere; + struct arbre_variables *noeud_pere; + struct arbre_variables **noeuds; struct liste_variables *feuille; } struct_arbre_variables; +typedef struct tableau_variables +{ + unsigned char origine; + unsigned char *nom; // pointeur sur la struct_variable + // réelle et non copie de la chaîne + unsigned long niveau; + + struct_objet *objet; // pointeur sur l'objet et non copie + // de l'objet. + + logical1 variable_verrouillee; + union_position_variable variable_statique; + union_position_variable variable_partagee; +} struct_tableau_variables; + typedef struct liste_variables { union { + // Utilisation dans la gestion des variables struct_variable *variable; + // Utilisation dans la pile système (variables par niveau) struct_liste_chainee *liste; }; + struct arbre_variables *noeud_pere; + struct arbre_variables *noeud; struct liste_variables *suivant; struct liste_variables *precedent; } struct_liste_variables; @@ -1833,6 +1855,7 @@ typedef struct processus struct_arbre_variables *s_arbre_variables; struct_liste_variables *l_liste_variables_par_niveau; + logical1 niveau_supprime; struct_variable *pointeur_variable_courante; struct_liste_variables *pointeur_feuille_courante; @@ -2796,6 +2819,8 @@ void conversion_hms_vers_decimal(real8 * void conversion_majuscule_limitee(unsigned char *chaine_entree, unsigned char *chaine_sortie, unsigned long longueur); void conversion_radians_vers_degres(real8 *angle); +void copie_arbre_variables(struct_processus *s_etat_processus, + struct_processus *s_nouvel_etat_processus); void correction_formateur_tex(struct_processus *s_etat_processus, unsigned char **ligne); void depilement_pile_systeme(struct_processus *s_etat_processus); @@ -3089,9 +3114,6 @@ logical1 retrait_variable_statique(struc unsigned char *nom_variable, union_position_variable position); logical1 sequenceur(struct_processus *s_etat_processus); logical1 sequenceur_optimise(struct_processus *s_etat_processus); - -struct_arbre_variables *copie_arbre_variables( - struct_processus *s_etat_processus); #endif /* @@ -3110,6 +3132,8 @@ logical1 ecriture_pipe(struct_processus struct_objet *s_objet); logical1 recherche_variable(struct_processus *s_etat_processus, unsigned char *nom_variable); +logical1 recherche_variable_globale(struct_processus *s_etat_processus, + unsigned char *nom_variable); logical1 recherche_variable_partagee(struct_processus *s_etat_processus, unsigned char *nom_variable, union_position_variable position, unsigned char origine); @@ -3142,6 +3166,11 @@ ssize_t write_atomic(struct_processus *s */ int alsprintf(unsigned char **strp, const char *fmt, ...); +int liste_variables(struct_processus *s_etat_processus, + struct_tableau_variables *tableau, int position, + struct_arbre_variables *l_element_courant); +int nombre_variables(struct_processus *s_etat_processus, + struct_arbre_variables *l_element_courant); int tex_fprintf(struct_processus *s_etat_processus, file *flux, const char *format, ...); int transliterated_fprintf(struct_processus *s_etat_processus, file *flux,