version 1.12, 2010/07/24 18:01:12
|
version 1.23, 2011/04/14 10:32:59
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.0.18 |
RPL/2 (R) version 4.1.0.prerelease.0 |
Copyright (C) 1989-2010 Dr. BERTRAND Joël |
Copyright (C) 1989-2011 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
|
|
Line 20
|
Line 20
|
*/ |
*/ |
|
|
|
|
#include "rpl.conv.h" |
#include "rpl-conv.h" |
|
|
|
|
/* |
/* |
Line 228 creation_variable(struct_processus *s_et
|
Line 228 creation_variable(struct_processus *s_et
|
|
|
for(; i >= 0; i--) |
for(; i >= 0; i--) |
{ |
{ |
if (strcmp((*s_variable).nom, |
if ((strcmp((*s_variable).nom, |
(*s_etat_processus).s_liste_variables[i].nom) == 0) |
(*s_etat_processus).s_liste_variables[i].nom) == 0) |
|
&& ((*s_etat_processus).s_liste_variables[i].niveau |
|
!= 0)) |
{ |
{ |
(*s_etat_processus).s_liste_variables[i + 1] = |
(*s_etat_processus).s_liste_variables[i + 1] = |
(*s_etat_processus).s_liste_variables[i]; |
(*s_etat_processus).s_liste_variables[i]; |
Line 241 creation_variable(struct_processus *s_et
|
Line 243 creation_variable(struct_processus *s_et
|
} |
} |
} |
} |
|
|
if (presence = d_faux) |
if (presence == d_faux) |
{ |
{ |
(*s_etat_processus).s_liste_variables[0] = (*s_variable); |
(*s_etat_processus).s_liste_variables[0] = (*s_variable); |
} |
} |
Line 675 retrait_variable_par_niveau(struct_proce
|
Line 677 retrait_variable_par_niveau(struct_proce
|
{ |
{ |
(*s_etat_processus).erreur_systeme = |
(*s_etat_processus).erreur_systeme = |
d_es_variable_introuvable; |
d_es_variable_introuvable; |
|
return(d_erreur); |
} |
} |
|
|
(*s_etat_processus).s_liste_variables[i].objet = NULL; |
(*s_etat_processus).s_liste_variables[i].objet = NULL; |
Line 708 retrait_variable_par_niveau(struct_proce
|
Line 711 retrait_variable_par_niveau(struct_proce
|
return(d_absence_erreur); |
return(d_absence_erreur); |
} |
} |
|
|
|
|
|
/* |
|
================================================================================ |
|
Procédure de copie de l'arbre des variables |
|
================================================================================ |
|
Entrée : |
|
-------------------------------------------------------------------------------- |
|
Sortie : |
|
-------------------------------------------------------------------------------- |
|
Effets de bord : néant |
|
================================================================================ |
|
*/ |
|
|
|
struct_arbre_variables * |
|
copie_arbre_variables(struct_processus *s_etat_processus) |
|
{ |
|
// Les définitions sont partagées entre tous les threads et ne sont pas |
|
// copiées. |
|
|
|
return(d_absence_erreur); |
|
} |
|
|
|
|
|
/* |
|
================================================================================ |
|
Procédure d'initialisation de la table de correspondance des variables |
|
================================================================================ |
|
Entrée : |
|
-------------------------------------------------------------------------------- |
|
Sortie : |
|
-------------------------------------------------------------------------------- |
|
Effets de bord : néant |
|
================================================================================ |
|
*/ |
|
|
|
/* |
|
* Caractères autorisés dans les instructions |
|
* |
|
* 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 |
|
* _ |
|
* 1 2 3 4 5 6 7 8 9 0 |
|
*/ |
|
|
|
void |
|
initialisation_variables(struct_processus *s_etat_processus) |
|
{ |
|
int decalage; |
|
int i; |
|
int longueur_tableau; |
|
|
|
unsigned char caractere; |
|
|
|
// Récupération de la longueur d'un unsigned char |
|
|
|
longueur_tableau = 1; |
|
decalage = 0; |
|
caractere = 1; |
|
|
|
while((1L << decalage) == (long) ((unsigned char) (caractere << decalage))) |
|
{ |
|
decalage++; |
|
longueur_tableau *= 2; |
|
} |
|
|
|
if (((*s_etat_processus).pointeurs_caracteres_variables = |
|
malloc(longueur_tableau * sizeof(int))) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
for(i = 0; i < longueur_tableau; i++) |
|
{ |
|
(*s_etat_processus).pointeurs_caracteres_variables[i] = -1; |
|
} |
|
|
|
(*s_etat_processus).nombre_caracteres_variables = 0; |
|
|
|
#define DECLARATION_CARACTERE(c) \ |
|
do { (*s_etat_processus).pointeurs_caracteres_variables[c] = \ |
|
(*s_etat_processus).nombre_caracteres_variables++; } while(0) |
|
|
|
DECLARATION_CARACTERE('A'); |
|
DECLARATION_CARACTERE('B'); |
|
DECLARATION_CARACTERE('C'); |
|
DECLARATION_CARACTERE('D'); |
|
DECLARATION_CARACTERE('E'); |
|
DECLARATION_CARACTERE('F'); |
|
DECLARATION_CARACTERE('G'); |
|
DECLARATION_CARACTERE('H'); |
|
DECLARATION_CARACTERE('I'); |
|
DECLARATION_CARACTERE('J'); |
|
DECLARATION_CARACTERE('K'); |
|
DECLARATION_CARACTERE('L'); |
|
DECLARATION_CARACTERE('M'); |
|
DECLARATION_CARACTERE('N'); |
|
DECLARATION_CARACTERE('O'); |
|
DECLARATION_CARACTERE('P'); |
|
DECLARATION_CARACTERE('Q'); |
|
DECLARATION_CARACTERE('R'); |
|
DECLARATION_CARACTERE('S'); |
|
DECLARATION_CARACTERE('T'); |
|
DECLARATION_CARACTERE('U'); |
|
DECLARATION_CARACTERE('V'); |
|
DECLARATION_CARACTERE('W'); |
|
DECLARATION_CARACTERE('X'); |
|
DECLARATION_CARACTERE('Y'); |
|
DECLARATION_CARACTERE('Z'); |
|
|
|
DECLARATION_CARACTERE('a'); |
|
DECLARATION_CARACTERE('b'); |
|
DECLARATION_CARACTERE('c'); |
|
DECLARATION_CARACTERE('d'); |
|
DECLARATION_CARACTERE('e'); |
|
DECLARATION_CARACTERE('f'); |
|
DECLARATION_CARACTERE('g'); |
|
DECLARATION_CARACTERE('h'); |
|
DECLARATION_CARACTERE('i'); |
|
DECLARATION_CARACTERE('j'); |
|
DECLARATION_CARACTERE('k'); |
|
DECLARATION_CARACTERE('l'); |
|
DECLARATION_CARACTERE('m'); |
|
DECLARATION_CARACTERE('n'); |
|
DECLARATION_CARACTERE('o'); |
|
DECLARATION_CARACTERE('p'); |
|
DECLARATION_CARACTERE('q'); |
|
DECLARATION_CARACTERE('r'); |
|
DECLARATION_CARACTERE('s'); |
|
DECLARATION_CARACTERE('t'); |
|
DECLARATION_CARACTERE('u'); |
|
DECLARATION_CARACTERE('v'); |
|
DECLARATION_CARACTERE('w'); |
|
DECLARATION_CARACTERE('x'); |
|
DECLARATION_CARACTERE('y'); |
|
DECLARATION_CARACTERE('z'); |
|
|
|
DECLARATION_CARACTERE('_'); |
|
|
|
DECLARATION_CARACTERE('1'); |
|
DECLARATION_CARACTERE('2'); |
|
DECLARATION_CARACTERE('3'); |
|
DECLARATION_CARACTERE('4'); |
|
DECLARATION_CARACTERE('5'); |
|
DECLARATION_CARACTERE('6'); |
|
DECLARATION_CARACTERE('7'); |
|
DECLARATION_CARACTERE('8'); |
|
DECLARATION_CARACTERE('9'); |
|
DECLARATION_CARACTERE('0'); |
|
#undef DECLARATION_CARACTERE |
|
|
|
return; |
|
} |
// vim: ts=4 |
// vim: ts=4 |