version 1.8, 2010/04/07 13:45:00
|
version 1.16, 2010/05/10 08:30:32
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.0.14 |
RPL/2 (R) version 4.0.15 |
Copyright (C) 1989-2010 Dr. BERTRAND Joël |
Copyright (C) 1989-2010 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
Line 46 creation_instruction(struct_processus *s
|
Line 46 creation_instruction(struct_processus *s
|
|
|
unsigned char *ptr; |
unsigned char *ptr; |
|
|
|
BUG(strlen(instruction) >= d_longueur_maximale_instruction, |
|
printf("%s -> %d >= %d\n", instruction, (int) strlen(instruction), |
|
d_longueur_maximale_instruction)); |
|
|
if ((*s_etat_processus).arbre_instructions == NULL) |
if ((*s_etat_processus).arbre_instructions == NULL) |
{ |
{ |
if (((*s_etat_processus).arbre_instructions = |
if (((*s_etat_processus).arbre_instructions = |
Line 710 initialisation_instructions(struct_proce
|
Line 714 initialisation_instructions(struct_proce
|
|
|
INSTRUCTION("APPEND", instruction_append); |
INSTRUCTION("APPEND", instruction_append); |
INSTRUCTION("ARRY->", instruction_array_fleche); |
INSTRUCTION("ARRY->", instruction_array_fleche); |
|
INSTRUCTION("ATEXIT", instruction_atexit); |
INSTRUCTION("BESSEL", instruction_bessel); |
INSTRUCTION("BESSEL", instruction_bessel); |
INSTRUCTION("CLRERR", instruction_clrerr); |
INSTRUCTION("CLRERR", instruction_clrerr); |
INSTRUCTION("CLRMTX", instruction_clrmtx); |
INSTRUCTION("CLRMTX", instruction_clrmtx); |
Line 788 initialisation_instructions(struct_proce
|
Line 793 initialisation_instructions(struct_proce
|
//f(x,y)=fnct complexe évaluée sur la grille (x,y) et affichée comme une |
//f(x,y)=fnct complexe évaluée sur la grille (x,y) et affichée comme une |
//fonction paramétrique. |
//fonction paramétrique. |
INSTRUCTION("INQUIRE", instruction_inquire); |
INSTRUCTION("INQUIRE", instruction_inquire); |
|
INSTRUCTION("MEMLOCK", instruction_memlock); |
INSTRUCTION("MTXLOCK", instruction_mtxlock); |
INSTRUCTION("MTXLOCK", instruction_mtxlock); |
INSTRUCTION("PERSIST", instruction_persist); |
INSTRUCTION("PERSIST", instruction_persist); |
INSTRUCTION("PLOTTER", instruction_plotter); |
INSTRUCTION("PLOTTER", instruction_plotter); |
Line 827 initialisation_instructions(struct_proce
|
Line 833 initialisation_instructions(struct_proce
|
|
|
INSTRUCTION("AUTOSCALE", instruction_autoscale); |
INSTRUCTION("AUTOSCALE", instruction_autoscale); |
INSTRUCTION("BACKSPACE", instruction_backspace); |
INSTRUCTION("BACKSPACE", instruction_backspace); |
|
INSTRUCTION("CLRATEXIT", instruction_clratexit); |
INSTRUCTION("COPYRIGHT", instruction_copyright); |
INSTRUCTION("COPYRIGHT", instruction_copyright); |
//INSTRUCTION("CYLINDRIC"); |
//INSTRUCTION("CYLINDRIC"); |
INSTRUCTION("DAEMONIZE", instruction_daemonize); |
INSTRUCTION("DAEMONIZE", instruction_daemonize); |
INSTRUCTION("DROPCNTXT", instruction_dropcntxt); |
INSTRUCTION("DROPCNTXT", instruction_dropcntxt); |
INSTRUCTION("EXTERNALS", instruction_externals); |
INSTRUCTION("EXTERNALS", instruction_externals); |
INSTRUCTION("HISTOGRAM", instruction_histogram); |
INSTRUCTION("HISTOGRAM", instruction_histogram); |
|
INSTRUCTION("MEMUNLOCK", instruction_memunlock); |
INSTRUCTION("MTXSTATUS", instruction_mtxstatus); |
INSTRUCTION("MTXSTATUS", instruction_mtxstatus); |
INSTRUCTION("MTXUNLOCK", instruction_mtxunlock); |
INSTRUCTION("MTXUNLOCK", instruction_mtxunlock); |
INSTRUCTION("PARAMETER", instruction_parameter); |
INSTRUCTION("PARAMETER", instruction_parameter); |
Line 872 initialisation_instructions(struct_proce
|
Line 880 initialisation_instructions(struct_proce
|
} |
} |
|
|
|
|
inline void * |
extern inline void * |
analyse_instruction(struct_processus *s_etat_processus, unsigned char *ptr) |
analyse_instruction(struct_processus *s_etat_processus, unsigned char *ptr) |
{ |
{ |
int pointeur; |
int pointeur; |
Line 939 analyse(struct_processus *s_etat_process
|
Line 947 analyse(struct_processus *s_etat_process
|
|
|
unsigned char *position; |
unsigned char *position; |
unsigned char *bibliotheque_candidate; |
unsigned char *bibliotheque_candidate; |
unsigned char *instruction_majuscule; |
unsigned char instruction_majuscule |
|
[d_longueur_maximale_instruction]; |
unsigned char registre_instruction_valide; |
unsigned char registre_instruction_valide; |
|
|
void (*instruction)(); |
void (*instruction)(); |
Line 956 analyse(struct_processus *s_etat_process
|
Line 965 analyse(struct_processus *s_etat_process
|
* On autorise l'exécution d'un fork() dans un thread concurrent. |
* On autorise l'exécution d'un fork() dans un thread concurrent. |
*/ |
*/ |
|
|
|
# ifndef SEMAPHORES_NOMMES |
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
Line 970 analyse(struct_processus *s_etat_process
|
Line 980 analyse(struct_processus *s_etat_process
|
return; |
return; |
} |
} |
} |
} |
|
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
|
scrutation_injection(s_etat_processus); |
while(sem_wait((*s_etat_processus).semaphore_fork) == -1) |
|
|
if (fonction == NULL) |
|
{ |
{ |
if ((instruction_majuscule = conversion_majuscule( |
if (errno != EINTR) |
(*s_etat_processus).instruction_courante)) == NULL) |
|
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
} |
} |
|
} |
|
# endif |
|
|
|
scrutation_injection(s_etat_processus); |
|
|
|
if (fonction == NULL) |
|
{ |
|
conversion_majuscule_limitee((*s_etat_processus).instruction_courante, |
|
instruction_majuscule, d_longueur_maximale_instruction); |
instruction = analyse_instruction(s_etat_processus, |
instruction = analyse_instruction(s_etat_processus, |
instruction_majuscule); |
instruction_majuscule); |
|
|
Line 1010 analyse(struct_processus *s_etat_process
|
Line 1031 analyse(struct_processus *s_etat_process
|
profilage(s_etat_processus, NULL); |
profilage(s_etat_processus, NULL); |
} |
} |
} |
} |
|
|
free(instruction_majuscule); |
|
} |
} |
else |
else |
{ |
{ |