--- rpl/src/rpl.h 2011/09/20 15:45:53 1.131 +++ rpl/src/rpl.h 2011/11/18 09:51:33 1.140 @@ -1,6 +1,6 @@ /* ================================================================================ - RPL/2 (R) version 4.1.3 + RPL/2 (R) version 4.1.4 Copyright (C) 1989-2011 Dr. BERTRAND Joël This file is part of RPL/2. @@ -43,7 +43,6 @@ #ifdef OS2 # ifndef __RPLCAS # define _BSD_SOURCE -# define _XOPEN_SOURCE 600 # endif # include @@ -99,7 +98,9 @@ # endif # include -# include +# ifdef SHARED_MEMORY +# include +# endif # ifndef IPCS_SYSV # include @@ -162,6 +163,11 @@ # include "openssl/evp.h" # include "sqlite3.h" +# include "sigsegv.h" +# ifdef OS2 + // Bug de libsigsegv +# undef HAVE_STACK_OVERFLOW_RECOVERY +# endif # define HAVE_INLINE # define GSL_RANGE_CHECK_OFF @@ -241,6 +247,7 @@ enum signaux_rpl // Elle est projetée dans un segment de mémoire partagée pour qu'elle soit // accessible à la fois du père et des fils. +#ifndef RPLARGS typedef struct queue_signaux { # ifndef IPCS_SYSV @@ -261,7 +268,6 @@ typedef struct queue_signaux } queue[LONGUEUR_QUEUE_SIGNAUX]; } struct_queue_signaux; -#ifndef RPLARGS # ifndef MAIN_RPL extern struct_queue_signaux *s_queue_signaux; extern int f_queue_signaux; @@ -277,13 +283,6 @@ typedef struct queue_signaux # endif #endif -#ifdef OpenBSD -# ifdef PTHREAD_SCOPE_SYSTEM -# undef PTHREAD_SCOPE_SYSTEM -# endif -# define PTHREAD_SCOPE_SYSTEM 0 -#endif - #ifdef OS2 # define readline(s) readline_wrapper(s) unsigned char *readline_wrapper(unsigned char *s); @@ -299,6 +298,13 @@ union semun }; #endif +#ifndef RTLD_LOCAL +# define RTLD_LOCAL 0 +#endif + +#ifndef SIGSTKSZ +# define SIGSTKSZ 65536 +#endif /* ================================================================================ @@ -403,7 +409,8 @@ typedef unsigned char t_8_bits; # endif # ifndef MAIN_RPL - extern jmp_buf contexte; + extern jmp_buf contexte_ecriture; + extern jmp_buf contexte_impression; extern jmp_buf contexte_initial; extern jmp_buf contexte_processus; extern jmp_buf contexte_thread; @@ -424,8 +431,11 @@ typedef unsigned char t_8_bits; * # endif semaphore_gestionnaires_signaux; + + extern volatile int routine_recursive; # else - jmp_buf contexte; + jmp_buf contexte_ecriture; + jmp_buf contexte_impression; jmp_buf contexte_initial; jmp_buf contexte_processus; jmp_buf contexte_thread; @@ -449,6 +459,8 @@ typedef unsigned char t_8_bits; * # endif semaphore_gestionnaires_signaux; + + volatile int routine_recursive; # endif #endif @@ -923,6 +935,7 @@ pid_t debug_fork(); # define d_ex_version_bibliotheque __erreur(82) # define d_ex_creation_variable_globale __erreur(83) # define d_ex_erreur_interne_rplcas __erreur(84) +# define d_ex_fichier_corrompu __erreur(85) #endif @@ -1820,20 +1833,6 @@ typedef struct processus pthread_t thread_fusible; pthread_t thread_surveille_par_fusible; -# if !defined(Cygwin) -# if !(OpenBSD) - stack_t pile_signal; -# else -# ifdef SA_ONSTACK -# undef SA_ONSTACK -# endif -# define SA_ONSTACK 0 -# endif -# else -# define SA_ONSTACK 0 -# define RTLD_LOCAL 0 -# endif - volatile int pointeur_signal_ecriture; volatile int pointeur_signal_lecture; volatile enum signaux_rpl signaux_en_queue[LONGUEUR_QUEUE_SIGNAUX]; @@ -2054,7 +2053,6 @@ typedef struct processus /* Traitement des erreurs */ - unsigned int compteur_violation_d_acces; unsigned int erreur_compilation; unsigned int erreur_execution; unsigned int erreur_systeme; @@ -2906,6 +2904,7 @@ void interruption2(int signal); void interruption3(int signal); void interruption4(int signal); void interruption5(int signal); +void interruption_depassement_pile(int urgence, stackoverflow_context_t scp); void inversion_matrice(struct_processus *s_etat_processus, struct_matrice *s_matrice); void lancement_daemon(struct_processus *s_etat_processus); @@ -2939,7 +2938,11 @@ void retrait_thread(struct_processus *s_ void retrait_thread_surveillance(struct_processus *s_etat_processus, struct_descripteur_thread *s_argument_thread); void rplcore(struct_processus *s_etat_processus); +#endif + void scrutation_injection(struct_processus *s_etat_processus); + +#ifndef RPLARGS void scrutation_interruptions(struct_processus *s_etat_processus); void sf(struct_processus *s_etat_processus, unsigned char indice_drapeau); void *surveillance_processus(void *argument); @@ -3066,6 +3069,7 @@ unsigned char *compactage(unsigned char unsigned char *conversion_majuscule(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, unsigned long i, unsigned long j); unsigned char *formateur(struct_processus *s_etat_processus, long offset, @@ -3079,6 +3083,9 @@ unsigned char *formateur_flux(struct_pro unsigned char *formateur_fichier_nombre(struct_processus *s_etat_processus, void *valeur_numerique, unsigned char type, long longueur, long longueur_champ, unsigned char format); +unsigned char *formateur_fichier_binaire_nombre(struct_processus + *s_etat_processus, void *valeur_numerique, unsigned char type, + long longueur, long *longueur_conversion); unsigned char *formateur_fichier_reel(struct_processus *s_etat_processus, void *valeur_numerique, unsigned char type, long longueur, long longueur_champ, unsigned char format); @@ -3087,6 +3094,8 @@ unsigned char *formateur_nombre(struct_p unsigned char *formateur_reel(struct_processus *s_etat_processus, void *valeur_numerique, unsigned char type); 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 *reencodage(struct_processus *s_etat_processus, unsigned char *chaine_entree, unsigned char *codage_entree, @@ -3172,6 +3181,7 @@ logical1 test_cfsf(struct_processus *s_e unsigned char indice_drapeau); logical1 test_expression_rpn(unsigned char *chaine); logical1 test_fonction(unsigned char *chaine); +logical1 validation_chaine(unsigned char *chaine); #endif /* @@ -3194,11 +3204,14 @@ ssize_t write_atomic(struct_processus *s */ int alsprintf(unsigned char **strp, const char *fmt, ...); +int interruption_violation_access(void *adresse_fautive, int gravite); +#ifndef RPLARGS 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); +#endif int tex_fprintf(struct_processus *s_etat_processus, file *flux, const char *format, ...); int transliterated_fprintf(struct_processus *s_etat_processus, file *flux, @@ -3215,7 +3228,6 @@ int wrapper_instruction_intrinseque(void #ifndef RPLARGS unsigned char longueur_entiers_binaires(struct_processus *s_etat_processus); -unsigned char recherche_longueur_optimale(integer8 parametre); #endif /* @@ -3236,6 +3248,8 @@ logical8 masque_entiers_binaires(struct_ #ifndef RPLARGS integer8 occupation_memoire(struct_objet *s_objet); +integer8 longueur_chaine(struct_processus *s_etat_processus, + unsigned char *chaine); #endif /* @@ -3280,8 +3294,8 @@ struct_descripteur_fichier *descripteur_ struct_objet *copie_objet(struct_processus *s_etat_processus, struct_objet *s_objet, unsigned char type); -#ifndef RPLARGS struct_objet *allocation(struct_processus *s_etat_processus, enum t_type type); +#ifndef RPLARGS struct_objet *formateur_date(struct_processus *s_etat_processus, struct timeval *temps); struct_objet *lecture_pipe(struct_processus *s_etat_processus, int pipe);