--- rpl/src/rpl.h 2014/10/05 19:53:16 1.251 +++ rpl/src/rpl.h 2017/08/03 15:13:04 1.314 @@ -1,7 +1,7 @@ /* ================================================================================ - RPL/2 (R) version 4.1.19 - Copyright (C) 1989-2014 Dr. BERTRAND Joël + RPL/2 (R) version 4.1.27 + Copyright (C) 1989-2017 Dr. BERTRAND Joël This file is part of RPL/2. @@ -38,6 +38,10 @@ # ifdef OpenBSD # define _BSD_SOURCE # endif + +# ifdef FreeBSD +# define __BSD_VISIBLE 1 +# endif #endif #ifdef OS2 @@ -60,6 +64,16 @@ # define SA_ONSTACK 0 #endif +#ifdef BROKEN_SIGSEGV +# undef HAVE_STACK_OVERFLOW_RECOVERY +# undef HAVE_SIGSEGV_RECOVERY +#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)); } /* ================================================================================ @@ -206,13 +220,16 @@ # endif # include "sqlite3.h" -# include "sigsegv.h" + +# ifndef BROKEN_SIGSEGV +# include "sigsegv.h" +# endif + # ifdef OS2 // Bug de libsigsegv # undef HAVE_STACK_OVERFLOW_RECOVERY # endif -# define HAVE_INLINE # define GSL_RANGE_CHECK_OFF # include "gsl/gsl_cdf.h" # include "gsl/gsl_cblas.h" @@ -264,6 +281,7 @@ # define __STATIC_MUTEX_INITIALIZATION__ #endif + /* ================================================================================ Bugs spécifiques @@ -323,6 +341,7 @@ typedef struct queue_signaux volatile logical1 requete_arret; pthread_t thread_signaux; + pid_t controle; volatile struct { @@ -347,11 +366,6 @@ __EXTERN__ int f_queue_signaux; # 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 { @@ -370,6 +384,7 @@ union semun # define SIGSTKSZ 65536 #endif + /* ================================================================================ SÉMAPHORES @@ -515,8 +530,7 @@ union semun __EXTERN__ pid_t pid_processus_pere; - __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; @@ -524,8 +538,9 @@ union semun __EXTERN__ pthread_mutex_t mutex_sem __STATIC_MUTEX_INITIALIZATION__; __EXTERN__ volatile int routine_recursive; + __EXTERN__ volatile int nombre_thread_surveillance_processus; -# define SEM_FORK 0 +# define SEM_FORK 0 # define SEM_QUEUE 1 # define SEM_SIGNALISATION 2 # define SEM_ARRET_SIGNALISATION 3 @@ -568,10 +583,8 @@ union semun 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; \ @@ -593,26 +606,6 @@ union semun # 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__ @@ -635,9 +628,9 @@ union semun } while(0) #ifdef __GLIBC__ -#include -#define __BACKTRACE -#define BACKTRACE(n) \ +# include +# define __BACKTRACE +# define BACKTRACE(n) \ do \ { \ void *buffer[n]; \ @@ -653,7 +646,7 @@ union semun { \ for(i = 0; i < nb; i++) \ uprintf(" %s\n", appels[i]); \ - free(appels); \ + sys_free(appels); \ } \ else \ uprintf("Nullified backtrace\n"); \ @@ -662,7 +655,7 @@ union semun pthread_mutex_unlock(&mutex); \ } while(0) #else -#define BACKTRACE(n) NOTICE("BACKTRACE only defined in glibc") +# define BACKTRACE(n) NOTICE("BACKTRACE only defined in glibc") #endif #ifdef __BACKTRACE @@ -708,23 +701,29 @@ pid_t debug_fork(); #endif #ifdef DEBUG_RETURN -#define return uprintf("[%d] Return from <%s()> at line #%d " \ +# define return uprintf("[%d] Return from <%s()> at line #%d " \ "(%s [%d])\n", (int) getpid(), __FUNCTION__, \ __LINE__, strerror(errno), errno); fflush(stdout); errno = 0; return #endif #ifdef DEBUG_MUTEX -#define pthread_mutex_lock(mutex) uprintf("[%d-%llu] Mutex %s (%p) " \ +# define pthread_mutex_lock(mutex) uprintf("[%d-%llu] Mutex %s (%p) " \ "locking at %s() " \ "line #%d\n", (int) getpid(), (unsigned long long) pthread_self(), \ #mutex, mutex, __FUNCTION__, __LINE__), fflush(stdout), \ pthread_mutex_lock(mutex) -#define pthread_mutex_unlock(mutex) uprintf("[%d-%llu] Mutex %s (%p) " \ +# define pthread_mutex_unlock(mutex) uprintf("[%d-%llu] Mutex %s (%p) " \ "unlocking at " \ "%s() line #%d\n", (int) getpid(), (unsigned long long) \ pthread_self(), #mutex, mutex, __FUNCTION__, __LINE__), \ fflush(stdout), \ pthread_mutex_unlock(mutex) +# define pthread_mutex_trylock(mutex) uprintf("[%d-%llu] Mutex %s (%p) " \ + "trylocking at " \ + "%s() line #%d\n", (int) getpid(), (unsigned long long) \ + pthread_self(), #mutex, mutex, __FUNCTION__, __LINE__), \ + fflush(stdout), \ + pthread_mutex_trylock(mutex) #endif @@ -775,6 +774,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'/" /* -------------------------------------------------------------------------------- @@ -812,16 +812,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 @@ -988,6 +1020,8 @@ pid_t debug_fork(); # define d_ex_chiffrement_indisponible __erreur(90) # define d_ex_longueur_clef_chiffrement __erreur(91) # define d_ex_taille_message __erreur(92) +# define d_ex_type_externe_dup __erreur(93) +# define d_ex_type_externe_drop __erreur(94) #endif @@ -1016,6 +1050,7 @@ pid_t debug_fork(); #define BIN __RPL_BIN #define CHN __RPL_CHN #define CPL __RPL_CPL +#define EXT __RPL_EXT #define FCH __RPL_FCH #define FCT __RPL_FCT #define INT __RPL_INT @@ -1027,6 +1062,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 @@ -1040,8 +1076,8 @@ 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, +enum t_type { ADR = 0, ALG, BIN, CHN, CPL, EXT, FCH, FCT, INT, LST, + MCX, MIN, MRL, MTX, NOM, NON, PRC, REC, REL, RPN, SCK, SLB, SPH, SQL, TBL, VCX, VIN, VRL }; /* @@ -1057,13 +1093,15 @@ 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 *) Sans objet. Type C/Fortran : complex16 + EXT : type géré dans une bibliothèque externe. + FCH : descripteur de fichier (struct_fichier *). FCT : déclaration d'une fonction et de son nombre d'arguments @@ -1129,6 +1167,8 @@ enum t_type { ADR = 0, ALG, BIN, CHN, C typedef struct objet { enum t_type type; + integer8 extension_type; + void *descripteur_bibliotheque; volatile long nombre_occurrences; @@ -1315,6 +1355,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; @@ -1333,6 +1387,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 @@ -1706,10 +1767,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; @@ -1724,6 +1785,7 @@ typedef struct instruction_externe unsigned char *nom; unsigned char *nom_bibliotheque; void *descripteur_bibliotheque; + integer8 position_fleche; } struct_instruction_externe; @@ -1890,6 +1952,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 @@ -1918,6 +2016,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*/ @@ -2327,6 +2426,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; @@ -2361,82 +2461,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); /* @@ -3010,12 +3096,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); @@ -3084,7 +3172,10 @@ void interruption3(int signal); void interruption4(int signal); void interruption5(int signal); void interruption6(int signal); -void interruption_depassement_pile(int urgence, stackoverflow_context_t scp); +#ifdef HAVE_SIGSEGV_RECOVERY + void interruption_depassement_pile(int urgence, + stackoverflow_context_t scp); +#endif void inversion_matrice(struct_processus *s_etat_processus, struct_matrice *s_matrice); void lancement_daemon(struct_processus *s_etat_processus); @@ -3168,7 +3259,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 @@ -3206,16 +3298,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 /* @@ -3251,17 +3347,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, @@ -3287,7 +3387,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, @@ -3353,7 +3454,8 @@ logical1 retrait_variable_statique(struc logical1 retrait_variables_statiques_locales( struct_processus *s_etat_processus); logical1 sequenceur(struct_processus *s_etat_processus); -logical1 sequenceur_optimise(struct_processus *s_etat_processus); +logical1 sequenceur_optimise(struct_processus *s_etat_processus, + struct_liste_chainee *l_bibliotheques); #endif /* @@ -3401,20 +3503,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); @@ -3465,6 +3575,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 -------------------------------------------------------------------------------- */ @@ -3526,22 +3649,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 --------------------------------------------------------------------------------