--- rpl/src/rpl.h 2013/09/26 14:46:15 1.231 +++ rpl/src/rpl.h 2016/03/29 12:28:02 1.296 @@ -1,7 +1,7 @@ /* ================================================================================ - RPL/2 (R) version 4.1.16 - Copyright (C) 1989-2013 Dr. BERTRAND Joël + RPL/2 (R) version 4.1.25 + Copyright (C) 1989-2016 Dr. BERTRAND Joël This file is part of RPL/2. @@ -18,7 +18,7 @@ along with RPL/2. If not, write to info@cecill.info. ================================================================================ */ -#define DEBUG_ERREURS + #ifndef INCLUSION_RPL #define INCLUSION_RPL @@ -38,6 +38,10 @@ # ifdef OpenBSD # define _BSD_SOURCE # endif + +# ifdef FreeBSD +# define __BSD_VISIBLE 1 +# endif #endif #ifdef OS2 @@ -56,6 +60,15 @@ # define sched_yield(arg) #endif +#ifdef CYGWIN +# define SA_ONSTACK 0 +#endif + +#define DEBUG_TRACE uprintf("[%d/%X] %s(%d)\n", \ + getpid(), pthread_self(), __FILE__, __LINE__); +#define TEST_ABSENCE_FICHIER(nom) \ + { int ios; struct stat *buf; ios = stat(nom, buf); \ + if (ios == 0) BUG(1, uprintf("File %s found!\n", nom)); } /* ================================================================================ @@ -208,7 +221,6 @@ # undef HAVE_STACK_OVERFLOW_RECOVERY # endif -# define HAVE_INLINE # define GSL_RANGE_CHECK_OFF # include "gsl/gsl_cdf.h" # include "gsl/gsl_cblas.h" @@ -314,45 +326,36 @@ enum signaux_rpl #ifndef RPLARGS typedef struct queue_signaux { -# ifndef IPCS_SYSV -# ifndef SEMAPHORES_NOMMES - sem_t semaphore; - sem_t signalisation; - sem_t arret_signalisation; -# endif -# else - sem_t semaphore; - sem_t signalisation; - sem_t arret_signalisation; -# endif - volatile int pointeur_lecture; volatile int pointeur_ecriture; - pthread_t thread_signaux; volatile logical1 requete_arret; + pthread_t thread_signaux; + pid_t controle; + volatile struct { pid_t pid; enum signaux_rpl signal; } queue[LONGUEUR_QUEUE_SIGNAUX]; + +# ifdef OS2 + sem_t semaphore; + sem_t signalisation; + sem_t arret_signalisation; +# endif } struct_queue_signaux; -__EXTERN__ struct_queue_signaux *s_queue_signaux; -__EXTERN__ int f_queue_signaux; +__EXTERN__ struct_queue_signaux *s_queue_signaux; +__EXTERN__ int f_queue_signaux; -# ifdef SEMAPHORES_NOMMES - __EXTERN__ sem_t *semaphore_queue_signaux; - __EXTERN__ sem_t *semaphore_signalisation; - __EXTERN__ sem_t *semaphore_arret_signalisation; +# ifndef OS2 + __EXTERN__ sem_t *semaphore_queue_signaux; + __EXTERN__ sem_t *semaphore_signalisation; + __EXTERN__ sem_t *semaphore_arret_signalisation; # endif #endif -#ifdef OS2 -# define readline(s) readline_wrapper(s) - unsigned char *readline_wrapper(unsigned char *s); -#endif - #if ! defined(UNION_SEMUN) && defined(IPCS_SYSV) union semun { @@ -371,6 +374,7 @@ union semun # define SIGSTKSZ 65536 #endif + /* ================================================================================ SÉMAPHORES @@ -378,16 +382,59 @@ union semun */ #ifdef IPCS_SYSV +# ifdef DEBUG_SEMAPHORES +# define sem_wait(a) ({ int value; sem_getvalue(a, &value); \ + uprintf("[%d-%llu] Semaphore %s (%p) "\ + "waiting at %s() " \ + "line #%d\n", (int) getpid(), (unsigned long long) i\ + pthread_self(), \ + #a, a, __FUNCTION__, __LINE__), fflush(stdout); \ + if (value > 1) BUG(1, uprintf("Value %d\n", value)); \ + sem_wait_SysV(a); }) +# define sem_post(a) ({ int value; sem_getvalue(a, &value); \ + uprintf("[%d-%llu] Semaphore %s (%p) "\ + "posting at %s() " \ + "line #%d\n", (int) getpid(), (unsigned long long) \ + pthread_self(), \ + #a, a, __FUNCTION__, __LINE__), fflush(stdout); \ + if (value > 0) BUG(1, uprintf("Value %d\n", value)); \ + sem_post_SysV(a); }) +# define sem_destroy(a) ({ int value; sem_getvalue(a, &value); \ + if (value == 0) BUG(1, uprintf("Value %d\n", value)); \ + sem_destroy_SysV(a); }) +# else +# define sem_destroy(a) sem_destroy_SysV(a) +# define sem_wait(a) sem_wait_SysV(a) +# define sem_post(a) sem_post_SysV(a) +# endif + # define sem_init(a, b, c) sem_init_SysV(a, b, c) -# define sem_destroy(a) sem_destroy_SysV(a) -# define sem_wait(a) sem_wait_SysV(a) # define sem_trywait(a) sem_trywait_SysV(a) # define sem_timedwait(a, b) sem_timedwait_SysV(a, b) -# define sem_post(a) sem_post_SysV(a) # define sem_getvalue(a, b) sem_getvalue_SysV(a, b) # define sem_open(...) sem_open_SysV(__VA_ARGS__) # define sem_close(a) sem_close_SysV(a) # define sem_unlink(a) sem_unlink_SysV(a) +#else +# ifdef DEBUG_SEMAPHORES +# define sem_wait(a) ({ int value; sem_getvalue(a, &value); \ + uprintf("[%d-%llu] Semaphore %s (%p) "\ + "waiting at %s() " \ + "line #%d\n", (int) getpid(), (unsigned long long) \ + pthread_self(), \ + #a, a, __FUNCTION__, __LINE__), fflush(stdout); \ + if (value > 1) BUG(1, uprintf("Value %d\n", value)); sem_wait(a); }) +# define sem_post(a) ({ int value; sem_getvalue(a, &value); \ + uprintf("[%d-%llu] Semaphore %s (%p) "\ + "posting at %s() " \ + "line #%d\n", (int) getpid(), (unsigned long long) \ + pthread_self(), \ + #a, a, __FUNCTION__, __LINE__), fflush(stdout); \ + if (value > 0) BUG(1, uprintf("Value %d\n", value)); sem_post(a); }) +# define sem_destroy(a) ({ int value; sem_getvalue(a, &value); \ + if (value == 0) BUG(1, uprintf("Value %d\n", value)); \ + sem_destroy(a); }) +# endif #endif @@ -458,9 +505,6 @@ union semun #ifndef RPLARGS # ifdef SEMAPHORES_NOMMES # define LONGUEUR_NOM_SEMAPHORE 64 -# endif - -# ifdef SEMAPHORES_NOMMES # define __PTR__ * # else # define __PTR__ @@ -476,39 +520,35 @@ union semun __EXTERN__ pid_t pid_processus_pere; -# ifdef SEMAPHORES_NOMMES - __EXTERN__ pthread_mutex_t mutex_sem __STATIC_MUTEX_INITIALIZATION__; -# endif - - __EXTERN__ pthread_mutex_t mutex_liste_threads - __STATIC_MUTEX_INITIALIZATION__; + __EXTERN__ pthread_mutex_t mutex_liste_threads; __EXTERN__ pthread_mutex_t mutex_creation_variable_partagee __STATIC_MUTEX_INITIALIZATION__; __EXTERN__ pthread_mutex_t mutex_sections_critiques; __EXTERN__ pthread_mutex_t mutex_liste_variables_partagees; - - __EXTERN__ sem_t __PTR__ semaphore_gestionnaires_signaux; + __EXTERN__ pthread_mutex_t mutex_sem __STATIC_MUTEX_INITIALIZATION__; __EXTERN__ volatile int routine_recursive; -#endif + __EXTERN__ volatile sig_atomic_t + nombre_thread_surveillance_processus; -#ifdef SEMAPHORES_NOMMES -#define SEM_FORK 0 -#define SEM_QUEUE 1 -#define SEM_SIGNAUX 2 -#define SEM_SIGNALISATION 3 -#define SEM_ARRET_SIGNALISATION 4 -sem_t *sem_init2(unsigned int valeur, pid_t pid, int ordre); -sem_t *sem_init3(unsigned int valeur, pid_t pid, pthread_t tid, int ordre); -int sem_destroy2(sem_t *semaphore_p, pid_t pid, int ordre); -int sem_destroy3(sem_t *semaphore_p, pid_t pid, pthread_t tid, int ordre); -int sem_getvalue2(sem_t *semaphore, int *valeur); -sem_t *sem_open2(pid_t pid, int ordre); +# define SEM_FORK 0 +# define SEM_QUEUE 1 +# define SEM_SIGNALISATION 2 +# define SEM_ARRET_SIGNALISATION 3 + + sem_t *sem_init2(unsigned int valeur, pid_t pid, int ordre); + sem_t *sem_init3(unsigned int valeur, pid_t pid, pthread_t tid, int ordre); + int sem_destroy2(sem_t *semaphore_p, pid_t pid, int ordre); + int sem_destroy3(sem_t *semaphore_p, pid_t pid, pthread_t tid, int ordre); + int sem_getvalue2(sem_t *semaphore, int *valeur); + sem_t *sem_open2(pid_t pid, int ordre); +#endif // Le mutex est là uniquement pour pouvoir émuler le comportement // de sem_getvalue() sur un système comme MacOS X qui ne possède pas // cette fonction. +#ifdef Darwin #define sem_getvalue(semaphore, value) sem_getvalue2(semaphore, value) #define sem_post(semaphore) \ ({ int r; pthread_mutex_lock(&mutex_sem); \ @@ -534,10 +574,8 @@ sem_t *sem_open2(pid_t pid, int ordre); stderr, __VA_ARGS__) #define fprintf(flux, ...) transliterated_fprintf(s_etat_processus, \ flux, __VA_ARGS__) -#define uprintf(...) transliterated_fprintf(NULL, \ - stderr, __VA_ARGS__) -#define ufprintf(flux, ...) transliterated_fprintf(NULL, \ - flux, __VA_ARGS__) +#define uprintf(...) std_fprintf(stderr, __VA_ARGS__) +#define ufprintf(flux, ...) std_fprintf(flux, __VA_ARGS__) #ifdef SunOS # define fopen(...) ({ FILE *desc; \ @@ -559,26 +597,6 @@ sem_t *sem_open2(pid_t pid, int ordre); # define fflush(flux) fflush((flux == stdout) ? stderr : flux) #endif -// Ajout d'un timeout sur les fonctions pipe() pour éviter une erreur -// système dans le cas où l'on a atteint le nombre maximale de fichiers -// ouverts. - -#define pipe(descripteurs) \ - ({ \ - struct timespec temporisation; \ - int erreur, nombre_echecs; \ - nombre_echecs = 0; \ - do \ - { \ - if ((erreur = pipe(descripteurs)) == 0) break; \ - nombre_echecs++; \ - temporisation.tv_sec = 0; \ - temporisation.tv_nsec = ((long) 1000000000) * rand(); \ - nanosleep(&temporisation, NULL); \ - } while(nombre_echecs < 100); \ - erreur; \ - }) - // Redéfinition de abs pour un fonctionnement en entier de type long long int #ifdef __GNUC__ @@ -619,7 +637,7 @@ sem_t *sem_open2(pid_t pid, int ordre); { \ for(i = 0; i < nb; i++) \ uprintf(" %s\n", appels[i]); \ - free(appels); \ + sys_free(appels); \ } \ else \ uprintf("Nullified backtrace\n"); \ @@ -693,23 +711,6 @@ pid_t debug_fork(); pthread_mutex_unlock(mutex) #endif -#ifdef DEBUG_SEMAPHORES -#define sem_wait(a) ({ int value; sem_getvalue(a, &value); \ - uprintf("[%d-%llu] Semaphore %s (%p) "\ - "waiting at %s() " \ - "line #%d\n", (int) getpid(), (unsigned long long) pthread_self(), \ - #a, a, __FUNCTION__, __LINE__), fflush(stdout); \ - if (value > 1) BUG(1, uprintf("Value %d\n", value)); sem_wait(a); }) -#define sem_post(a) ({ int value; sem_getvalue(a, &value); \ - uprintf("[%d-%llu] Semaphore %s (%p) "\ - "posting at %s() " \ - "line #%d\n", (int) getpid(), (unsigned long long) pthread_self(), \ - #a, a, __FUNCTION__, __LINE__), fflush(stdout); \ - if (value > 0) BUG(1, uprintf("Value %d\n", value)); sem_post(a); }) -#define sem_destroy(a) ({ int value; sem_getvalue(a, &value); \ - if (value == 0) BUG(1, uprintf("Value %d\n", value)); sem_destroy(a); }) -#endif - /* ================================================================================ @@ -758,6 +759,7 @@ pid_t debug_fork(); #define d_SPH "Semaphore $n 'name'" #define d_TAB "<[ table ]>" #define d_MTX "Mutex $n" +#define d_REC "Record /'name_1', ..., 'name_n'/" /* -------------------------------------------------------------------------------- @@ -795,16 +797,48 @@ pid_t debug_fork(); # else # define __erreur_(i) i # endif -# define __erreur(i) ({ if (strstr(__FUNCTION__, "recherche_variable") \ - == NULL) ufprintf(stderr, \ - "ERROR %d AT %s() FROM %s LINE %d\n", \ - i, __FUNCTION__, __FILE__, __LINE__); i; }) +# define __erreur(i) ({ int ios; ios = errno; \ + if (strstr(__FUNCTION__, "recherche_variable") \ + == NULL) { if(ios != 0) \ + ufprintf(stderr, "LAST ERROR: %s\n", strerror(ios)); \ + ufprintf(stderr, "ERROR %d AT %s() FROM %s LINE %d\n", \ + i, __FUNCTION__, __FILE__, __LINE__); BACKTRACE(16); } i; }) # endif #else # define __erreur(i) i # define __erreur_(i) i #endif +#ifdef DEBUG_FICHIERS +# define open(a, ...) \ + ({ ufprintf(stderr, "[%d] OPEN %s AT %s() FROM %s LINE %d\n", \ + getpid(), a, \ + __FUNCTION__, __FILE__, __LINE__); open(a, __VA_ARGS__); }) +# define pipe(a) \ + ({ ufprintf(stderr, "[%d] PIPE %s AT %s() FROM %s LINE %d\n", \ + getpid(), a, \ + __FUNCTION__, __FILE__, __LINE__); pipe(a); }) +# define shm_open(a, ...) \ + ({ ufprintf(stderr, "[%d] SHM_OPEN %s AT %s() FROM %s LINE %d\n", \ + getpid(), a, \ + __FUNCTION__, __FILE__, __LINE__); shm_open(a, __VA_ARGS__); }) +# define shm_unlink(a) \ + ({ ufprintf(stderr, "[%d] SHM_UNLINK %s AT %s() FROM %s LINE %d\n", \ + getpid(), a, \ + __FUNCTION__, __FILE__, __LINE__); shm_unlink(a); }) +# define sem_open(a, ...) \ + ({ ufprintf(stderr, "[%d] SEM_OPEN %s AT %s() FROM %s LINE %d\n", \ + getpid(), a, \ + __FUNCTION__, __FILE__, __LINE__); sem_open(a, __VA_ARGS__); }) +# define sem_unlink(a) \ + ({ ufprintf(stderr, "[%d] SEM_UNLINK %s AT %s() FROM %s LINE %d\n", \ + getpid(), a, \ + __FUNCTION__, __FILE__, __LINE__); sem_unlink(a); }) +# define close(a) \ + ({ ufprintf(stderr, "[%d] CLOSE %s AT %s() FROM %s LINE %d\n", \ + getpid(), a, \ + __FUNCTION__, __FILE__, __LINE__); close(a); }) +#endif // -1 : erreur provoquée par une bibliothèque externe #ifndef RPLARGS @@ -1010,6 +1044,7 @@ pid_t debug_fork(); #define NOM __RPL_NOM #define NON __RPL_NON #define PRC __RPL_PRC +#define REC __RPL_REC #define REL __RPL_REL #define RPN __RPL_RPN #define SCK __RPL_SCK @@ -1024,7 +1059,7 @@ pid_t debug_fork(); enum t_rplcas_commandes { RPLCAS_INTEGRATION = 0, RPLCAS_LIMITE }; enum t_type { ADR = 0, ALG, BIN, CHN, CPL, FCH, FCT, INT, LST, - MCX, MIN, MRL, MTX, NOM, NON, PRC, REL, RPN, SCK, + MCX, MIN, MRL, MTX, NOM, NON, PRC, REC, REL, RPN, SCK, SLB, SPH, SQL, TBL, VCX, VIN, VRL }; /* @@ -1040,7 +1075,7 @@ enum t_type { ADR = 0, ALG, BIN, CHN, C Sans objet. Type C/Fortran : unsigned integer8 - CHN : chaine de caracteres (character*(*), unsigned char *) + CHN : chaine de caracteres (unsigned char *) Sans objet. CPL : complexe sur 2*64 bits (complex*16, struct_complexe16 *) @@ -1298,6 +1333,20 @@ typedef struct connecteur_sql */ #ifndef RPLARGS + +# define d_BIND_TO_DEVICE 0 +# define d_BROADCAST 1 +# define d_DONT_ROUTE 2 +# define d_KEEP_ALIVE 3 +# define d_PRIORITY 4 +# define d_RECEIVE_BUFFER 5 +# define d_FORCE_RECEIVE_BUFFER 6 +# define d_SEND_BUFFER 7 +# define d_FORCE_SEND_BUFFER 8 +# define d_RECEIVING_TIMEOUT 9 +# define d_SENDING_TIMEOUT 10 +# define d_REUSE_ADDRESS 11 + typedef struct socket { int domaine; @@ -1316,6 +1365,13 @@ typedef struct socket unsigned char protection; unsigned char type[19 + 1]; + integer8 options; + int priorite; + int buffer_reception; + int buffer_emission; + int timeout_emission; + int timeout_reception; + struct_objet *format; } struct_socket; #endif @@ -1689,10 +1745,10 @@ typedef struct tableau typedef struct arbre { - struct_objet *objet; + struct_liste_chainee *feuille; - unsigned long nombre_feuilles; - struct arbre **feuilles; + integer8 nombre_branches; + struct arbre **branches; } struct_arbre; @@ -1873,6 +1929,42 @@ typedef struct liste_variables_partagees } struct_liste_variables_partagees; #endif + +/* +-------------------------------------------------------------------------------- + Structure fonction +-------------------------------------------------------------------------------- +*/ + +#ifndef RPLARGS +typedef struct fonction +{ + unsigned char *nom_fonction; + integer8 nombre_arguments; + + void (*fonction)(struct processus *); + + volatile struct_liste_chainee *prediction_saut; + volatile logical1 prediction_execution; +} struct_fonction; +#endif + + +/* +-------------------------------------------------------------------------------- + Structure buffer +-------------------------------------------------------------------------------- +*/ + +typedef struct buffer +{ + unsigned char *buffer; + + size_t longueur_requise; + int classe; +} struct_buffer; + + /* -------------------------------------------------------------------------------- Structure processus @@ -1901,6 +1993,7 @@ typedef struct processus unsigned char evaluation_forcee; /*Y/N*/ unsigned char instruction_valide; /*Y/N*/ unsigned char instruction_intrinseque; /*Y/I/N*/ + unsigned char instruction_sensible; /*Y/N*/ unsigned char test_instruction; /*Y/N*/ unsigned char affichage_arguments; /*Y/N*/ unsigned char constante_symbolique; /*Y/N*/ @@ -2299,6 +2392,8 @@ typedef struct processus logical1 processus_detache; + enum t_type type_en_cours; + /* Profilage */ logical1 profilage; @@ -2308,6 +2403,7 @@ typedef struct processus struct timeval horodatage_profilage; pthread_mutex_t mutex_allocation; + pthread_mutex_t mutex_allocation_buffer; pthread_mutex_t mutex_interruptions; pthread_mutex_t mutex_pile_processus; pthread_mutex_t mutex_signaux; @@ -2342,82 +2438,68 @@ typedef struct processus integer8 taille_pile_objets; struct_objet *pile_objets; -# define TAILLE_CACHE 1024 - - integer8 *objets_adr[TAILLE_CACHE]; - int pointeur_adr; - - logical8 *objets_bin[TAILLE_CACHE]; - int pointeur_bin; - - complex16 *objets_cpl[TAILLE_CACHE]; - int pointeur_cpl; - - struct fonction *objets_fct[TAILLE_CACHE]; - int pointeur_fct; - - integer8 *objets_int[TAILLE_CACHE]; - int pointeur_int; - - struct_matrice *objets_mat[TAILLE_CACHE]; - int pointeur_mat; - - struct_nom *objets_nom[TAILLE_CACHE]; - int pointeur_nom; - - real8 *objets_rel[TAILLE_CACHE]; - int pointeur_rel; - - struct_tableau *objets_tab[TAILLE_CACHE]; - int pointeur_tab; - - struct_vecteur *objets_vec[TAILLE_CACHE]; - int pointeur_vec; - - struct_liste_chainee *maillons[TAILLE_CACHE]; - int pointeur_maillons; - - struct_arbre_variables *variables_noeud[TAILLE_CACHE]; - int pointeur_variables_noeud; - - struct_arbre_variables_partagees - *variables_partagees_noeud[TAILLE_CACHE]; - int pointeur_variables_partagees_noeud; - - struct_liste_variables *variables_feuille[TAILLE_CACHE]; - int pointeur_variables_feuille; - - struct_variable *variables_variable[TAILLE_CACHE]; - int pointeur_variables_variable; - - struct_arbre_variables **variables_tableau_noeuds[TAILLE_CACHE]; - int pointeur_variables_tableau_noeuds; - - struct_arbre_variables_partagees - **variables_tableau_noeuds_partages - [TAILLE_CACHE]; - int pointeur_variables_tableau_noeuds_partages; +# define TAILLE_CACHE 1024 +# define CACHE(type, nom) \ + type *objets_##nom[TAILLE_CACHE]; \ + volatile int pointeur_##nom; + +# define CACHE2(type, nom) \ + type *nom[TAILLE_CACHE]; \ + volatile int pointeur_##nom; + + CACHE(integer8, adr) + CACHE(logical8, bin) + CACHE(complex16, cpl) + CACHE(struct_fonction, fct) + CACHE(integer8, int) + CACHE(struct_matrice, mat) + CACHE(struct_nom, nom) + CACHE(real8, rel) + CACHE(struct_tableau, tab) + CACHE(struct_vecteur, vec) + + CACHE2(struct_liste_chainee, maillons) + CACHE2(struct_arbre_variables, variables_noeud) + CACHE2(struct_arbre_variables_partagees, variables_partagees_noeud) + CACHE2(struct_liste_variables, variables_feuille) + CACHE2(struct_variable, variables_variable) + CACHE2(struct_arbre_variables *, variables_tableau_noeuds) + CACHE2(struct_arbre_variables_partagees *, + variables_tableau_noeuds_partages) + + CACHE2(struct_buffer, enveloppes_buffers) + unsigned char ***cache_buffer; + int *pointeur_cache_buffer; } struct_processus; #endif -/* --------------------------------------------------------------------------------- - Structure fonction --------------------------------------------------------------------------------- -*/ - -#ifndef RPLARGS -typedef struct fonction -{ - unsigned char *nom_fonction; - integer8 nombre_arguments; - void (*fonction)(struct_processus *); +/* +================================================================================ + MISE EN PLACE DE L'ALLOCATEUR SPÉCIFIQUE +================================================================================*/ - volatile struct_liste_chainee *prediction_saut; - volatile logical1 prediction_execution; -} struct_fonction; -#endif +#ifndef DEBUG_MEMOIRE +# define malloc(a) rpl_malloc(s_etat_processus, a) +# define realloc(a, b) rpl_realloc(s_etat_processus, a, b) +# define free(a) rpl_free(s_etat_processus, a) +#endif + +void *rpl_malloc(struct_processus *s_etat_processus, size_t s); +void *rpl_realloc(struct_processus *s_etat_processus, void *ptr, size_t s); +void rpl_free(struct_processus *s_etat_processus, void *ptr); +void *sys_malloc(size_t s); +void *sys_realloc(void *ptr, size_t s); +void sys_free(void *ptr); + +/* + * Wrapper de readline() pour que la fonction renvoie un pointeur sur un + * buffer alloué par rpl_malloc(). + */ + +#define readline(s) readline_wrapper(s_etat_processus, s) +unsigned char *readline_wrapper(struct_processus *s_etat_processus, + unsigned char *s); /* @@ -2560,6 +2642,7 @@ void instruction_elseif(struct_processus void instruction_end(struct_processus *s_etat_processus); void instruction_eng(struct_processus *s_etat_processus); void instruction_epsilon(struct_processus *s_etat_processus); +void instruction_eqv(struct_processus *s_etat_processus); void instruction_erase(struct_processus *s_etat_processus); void instruction_errm(struct_processus *s_etat_processus); void instruction_errn(struct_processus *s_etat_processus); @@ -2990,12 +3073,14 @@ void conversion_chaine(struct_processus unsigned char *chaine, unsigned char type); void conversion_decimal_vers_hms(real8 *angle); void conversion_degres_vers_radians(real8 *angle); -void conversion_element_tex(unsigned char **element, unsigned char *fonction); +void conversion_element_tex(struct_processus *s_etat_processus, + unsigned char **element, unsigned char *fonction); void conversion_format(struct_processus *s_etat_processus, unsigned char *chaine); void conversion_hms_vers_decimal(real8 *angle); -void conversion_majuscule_limitee(unsigned char *chaine_entree, - unsigned char *chaine_sortie, integer8 longueur); +void conversion_majuscule_limitee( + unsigned char *chaine_entree, unsigned char *chaine_sortie, + integer8 longueur); void conversion_radians_vers_degres(real8 *angle); void copie_arbre_variables(struct_processus *s_etat_processus, struct_processus *s_nouvel_etat_processus); @@ -3148,7 +3233,8 @@ void liberation_queue_signaux(struct_pro void destruction_queue_signaux(struct_processus *s_etat_processus); int envoi_signal_contexte(struct_processus *s_etat_processus, enum signaux_rpl signal); -int envoi_signal_processus(pid_t pid, enum signaux_rpl signal); +int envoi_signal_processus(pid_t pid, enum signaux_rpl signal, + logical1 test_ouverture); int envoi_signal_thread(pthread_t tid, enum signaux_rpl signal); #endif @@ -3186,16 +3272,20 @@ real8 correlation_statistique(struct_mat real8 covariance_statistique(struct_matrice *s_matrice, integer8 colonne_1, integer8 colonne_2, unsigned char type, logical1 *erreur); -struct_vecteur *ecart_type_statistique(struct_matrice *s_matrice, - unsigned char type); -struct_vecteur *moyenne_statistique(struct_matrice *s_matrice); -struct_vecteur *sommation_colonne_statistique(struct_matrice *s_matrice, +struct_vecteur *ecart_type_statistique(struct_processus *s_etat_processus, + struct_matrice *s_matrice, unsigned char type); +struct_vecteur *moyenne_statistique(struct_processus *s_etat_processus, + struct_matrice *s_matrice); +struct_vecteur *sommation_colonne_statistique( + struct_processus *s_etat_processus, struct_matrice *s_matrice, integer8 colonne); -struct_vecteur *sommation_produits_colonnes_statistiques(struct_matrice +struct_vecteur *sommation_produits_colonnes_statistiques( + struct_processus *s_etat_processus, struct_matrice *s_matrice, integer8 colonne_1, integer8 colonne_2); -struct_vecteur *sommation_statistique(struct_matrice *s_matrice); -struct_vecteur *variance_statistique(struct_matrice *s_matrice, - unsigned char type); +struct_vecteur *sommation_statistique(struct_processus *s_etat_processus, + struct_matrice *s_matrice); +struct_vecteur *variance_statistique(struct_processus *s_etat_processus, + struct_matrice *s_matrice, unsigned char type); #endif /* @@ -3231,17 +3321,21 @@ unsigned char *analyse_algebrique(struct unsigned char *chaine_algebrique, struct_liste_chainee **l_base_liste); unsigned char *analyse_flux(struct_processus *s_etat_processus, unsigned char *flux, integer8 longueur); -unsigned char *chiffrement(const EVP_CIPHER *type_chiffrement, +unsigned char *chiffrement(struct_processus *s_etat_processus, + const EVP_CIPHER *type_chiffrement, logical1 encodage, unsigned char *message, integer8 longueur_message, unsigned char *clef, integer8 longueur_clef, unsigned char *vecteur_initialisation, integer8 *longueur_message_chiffre); -unsigned char *compactage(unsigned char *chaine); -unsigned char *conversion_majuscule(unsigned char *chaine); +unsigned char *compactage(struct_processus *s_etat_processus, + unsigned char *chaine); +unsigned char *conversion_majuscule(struct_processus *s_etat_processus, + unsigned char *chaine); unsigned char *creation_nom_fichier(struct_processus *s_etat_processus, unsigned char *chemin); -unsigned char *date_compilation(); -unsigned char *extraction_chaine(unsigned char *chaine, integer8 i, integer8 j); +unsigned char *date_compilation(struct_processus *s_etat_processus); +unsigned char *extraction_chaine(struct_processus *s_etat_processus, + unsigned char *chaine, integer8 i, integer8 j); unsigned char *formateur(struct_processus *s_etat_processus, long offset, struct_objet *s_objet); unsigned char *formateur_fichier(struct_processus *s_etat_processus, @@ -3267,7 +3361,8 @@ unsigned char *formateur_reel(struct_pro unsigned char *messages(struct_processus *s_etat_processus); unsigned char *pointeur_ieme_caractere(struct_processus *s_etat_processus, unsigned char *chaine, integer8 position); -unsigned char *purification_chaine(unsigned char *chaine); +unsigned char *purification_chaine(struct_processus *s_etat_processus, + unsigned char *chaine); unsigned char *recherche_chemin_fichiers_temporaires(struct_processus *s_etat_processus); unsigned char *reencodage(struct_processus *s_etat_processus, @@ -3319,6 +3414,8 @@ logical1 initialisation_fichier_acces_in sqlite3 *sqlite, integer8 position_clef, logical1 binaire); logical1 lancement_thread_signaux(struct_processus *s_etat_processus); logical1 recherche_instruction_suivante(struct_processus *s_etat_processus); +logical1 recherche_instruction_suivante_recursive( + struct_processus *s_etat_processus, integer8 recursivite); logical1 retrait_variable(struct_processus *s_etat_processus, unsigned char *nom_variable, unsigned char type); logical1 retrait_variables_par_niveau(struct_processus *s_etat_processus); @@ -3379,20 +3476,28 @@ ssize_t write_atomic(struct_processus *s -------------------------------------------------------------------------------- */ -int alsprintf(unsigned char **strp, const char *fmt, ...); +int alsprintf(struct_processus *s_etat_processus, + unsigned char **strp, const char *fmt, ...); +#ifndef RPLARGS +int association_etat_processus_readline(); +#endif int interruption_violation_access(void *adresse_fautive, int gravite); #ifndef RPLARGS +int initialisation_etat_processus_readline(); +int liberation_etat_processus_readline(); integer8 liste_variables(struct_processus *s_etat_processus, struct_tableau_variables *tableau); integer8 nombre_variables(struct_processus *s_etat_processus); int readline_analyse_syntaxique(int count, int key); int readline_effacement(int count, int key); #endif +int std_fprintf(file *flux, const char *format, ...); int tex_fprintf(struct_processus *s_etat_processus, file *flux, const char *format, ...); int transliterated_fprintf(struct_processus *s_etat_processus, file *flux, const char *format, ...); -int valsprintf(unsigned char **strp, const char *fmt, va_list ap); +int valsprintf(struct_processus *s_etat_processus, + unsigned char **strp, const char *fmt, va_list ap); int wrapper_instruction_intrinseque(void (*fonction)(), struct_rpl_arguments *rpl_arguments); @@ -3443,6 +3548,19 @@ struct_liste_chainee *analyse_rpn(struct /* -------------------------------------------------------------------------------- + Allocateur de buffers à cache +-------------------------------------------------------------------------------- +*/ + +void initialisation_allocateur_buffer(struct_processus *s_etat_processus); +void liberation_allocateur_buffer(struct_processus *s_etat_pocessus); +struct_buffer *allocation_buffer(struct_processus *s_etat_processus, + size_t longueur); +void liberation_buffer(struct_processus *s_etat_processus, + struct_buffer *buffer); + +/* +-------------------------------------------------------------------------------- Fonctions renvoyant une copie de la structure de description des processus -------------------------------------------------------------------------------- */ @@ -3504,22 +3622,6 @@ struct_liste_variables_partagees *recher #endif /* --------------------------------------------------------------------------------- - Fonctions gérant les arbres de simplification --------------------------------------------------------------------------------- -*/ - -#ifndef RPLARGS -struct_arbre *creation_arbre(struct_processus *s_etat_processus, - struct_objet **t_objets, integer8 indice, integer8 indice_maximal); -void liberation_arbre(struct_processus *s_etat_processus, - struct_arbre *s_noeud); -void parcours_arbre(struct_processus *s_etat_processus, struct_arbre *s_noeud); -void simplification_arbre(struct_processus *s_etat_processus, - struct_arbre *s_noeud); -#endif - -/* -------------------------------------------------------------------------------- Fonctions gérant la complétion automatique --------------------------------------------------------------------------------