Diff for /rpl/src/rpl.c between versions 1.8 and 1.215

version 1.8, 2010/02/28 14:47:14 version 1.215, 2021/01/20 08:49:33
Line 1 Line 1
 /*  /*
 ================================================================================  ================================================================================
   RPL/2 (R) version 4.0.11    RPL/2 (R) version 4.1.32
   Copyright (C) 1989-2010 Dr. BERTRAND Joël    Copyright (C) 1989-2020 Dr. BERTRAND Joël
   
   This file is part of RPL/2.    This file is part of RPL/2.
   
Line 21 Line 21
   
   
 #define  MAIN_RPL  #define  MAIN_RPL
 #include "rpl.conv.h"  #include "rpl-conv.h"
   
   // Bug de gcc à partir de gcc 4.6 (bug 48544)
   #pragma GCC diagnostic push
   #pragma GCC diagnostic ignored "-Wclobbered"
   
   
 /*  /*
Line 31 Line 35
 */  */
   
 int  int
 rplinit(int argc, char *argv[], unsigned char ***resultats)  rplinit(int argc, char *argv[], char *envp[],
           unsigned char ***resultats, char *rpl_home)
 {  {
 #   include                             "copyright.conv.h"  #   include                             "copyright-conv.h"
 #   include                             "licence.conv.h"  #   include                             "licence-conv.h"
   
       char                                **arg_exec;
   
   #   ifdef HAVE_STACK_OVERFLOW_RECOVERY
       char                                pile_signaux[SIGSTKSZ];
   #   endif
   
   #   define RPL_PATH_MAX                 1024
       char                                repertoire_initial[RPL_PATH_MAX];
   
     file                                *f_source;      file                                *f_source;
   
     int                                 erreur_historique;      int                                 erreur_historique;
     int                                 option_P;      int                                 option_P;
     int                                 status;  
       integer8                            i;
   
     logical1                            core;      logical1                            core;
     logical1                            debug;      logical1                            debug;
Line 71  rplinit(int argc, char *argv[], unsigned Line 86  rplinit(int argc, char *argv[], unsigned
   
     struct_processus                    *s_etat_processus;      struct_processus                    *s_etat_processus;
   
     struct_table_variables_partagees    s_variables_partagees;      struct_liste_chainee                *l_bibliotheques;
       struct_liste_chainee                *l_bibliotheque_courante;
       struct_liste_chainee                *l_nouvelle_bibliotheque;
   
       struct_liste_variables_partagees    *l_element_partage_courant;
       struct_liste_variables_partagees    *l_element_partage_suivant;
   
       struct_liste_variables_statiques    *l_element_statique_courant;
       struct_liste_variables_statiques    *l_element_statique_suivant;
   
       struct_arbre_variables_partagees    *s_arbre_variables_partagees;
       struct_liste_variables_partagees    *l_liste_variables_partagees;
   
     struct sigaction                    action;      struct sigaction                    action;
     struct sigaction                    registre;      struct sigaction                    registre;
Line 90  rplinit(int argc, char *argv[], unsigned Line 116  rplinit(int argc, char *argv[], unsigned
     unsigned char                       *ptr;      unsigned char                       *ptr;
     unsigned char                       *tampon;      unsigned char                       *tampon;
   
     unsigned long                       i;  
     unsigned long                       unite_fichier;      unsigned long                       unite_fichier;
   
     void                                *l_element_courant;      void                                *l_element_courant;
Line 99  rplinit(int argc, char *argv[], unsigned Line 124  rplinit(int argc, char *argv[], unsigned
     volatile int                        erreur;      volatile int                        erreur;
     volatile unsigned char              traitement_fichier_temporaire;      volatile unsigned char              traitement_fichier_temporaire;
   
       errno = 0;
       s_queue_signaux = NULL;
       routine_recursive = 0;
       nombre_threads_surveillance_processus = 0;
       pid_processus_pere = getpid();
   
   #   ifdef DEBUG_PROC
       __proc = 0;
   #   endif
   
   #   ifdef DEBUG_MEMOIRE
       debug_memoire_initialisation();
   #   endif
   
     setvbuf(stdout, NULL, _IOLBF, 0);      setvbuf(stdout, NULL, _IOLBF, 0);
     setvbuf(stderr, NULL, _IOLBF, 0);      setvbuf(stderr, NULL, _IOLBF, 0);
   
     sem_init(&semaphore_liste_threads, 0, 1);      if ((s_etat_processus = sys_malloc(sizeof(struct_processus))) == NULL)
     sem_init(&semaphore_gestionnaires_signaux, 0, 0);      {
     sem_init(&semaphore_gestionnaires_signaux_atomique, 0, 1);          erreur = d_es_allocation_memoire;
   
     if ((s_etat_processus = malloc(sizeof(struct_processus))) == NULL)          if ((langue = getenv("LANG")) != NULL)
           {
               if (strncmp(langue, "fr", 2) == 0)
               {
                   uprintf("+++Système : Mémoire insuffisante\n");
               }
               else
               {
                   uprintf("+++System : Not enough memory\n");
               }
           }
           else
           {
               uprintf("+++System : Not enough memory\n");
           }
   
           return(EXIT_FAILURE);
       }
   
       (*s_etat_processus).erreur_systeme = d_es;
   
       initialisation_allocateur_buffer(s_etat_processus);
   
       if ((*s_etat_processus).erreur_systeme != d_es)
       {
           erreur = d_es_allocation_memoire;
   
           if ((langue = getenv("LANG")) != NULL)
           {
               if (strncmp(langue, "fr", 2) == 0)
               {
                   uprintf("+++Système : Mémoire insuffisante\n");
               }
               else
               {
                   uprintf("+++System : Not enough memory\n");
               }
           }
           else
           {
               uprintf("+++System : Not enough memory\n");
           }
   
           return(EXIT_FAILURE);
       }
   
       if (initialisation_etat_processus_readline() != 0)
     {      {
         erreur = d_es_allocation_memoire;          erreur = d_es_allocation_memoire;
   
           if ((langue = getenv("LANG")) != NULL)
           {
               if (strncmp(langue, "fr", 2) == 0)
               {
                   uprintf("+++Système : Mémoire insuffisante\n");
               }
               else
               {
                   uprintf("+++System : Not enough memory\n");
               }
           }
           else
           {
               uprintf("+++System : Not enough memory\n");
           }
   
           return(EXIT_FAILURE);
       }
   
       if ((langue = getenv("LANG")) != NULL)
       {
           (*s_etat_processus).langue = (strncmp(langue, "fr", 2) == 0)
                   ? 'F' : 'E';
       }
       else
       {
           (*s_etat_processus).langue = 'E';
       }
   
       if (getcwd(repertoire_initial, RPL_PATH_MAX) == NULL)
       {
         if ((*s_etat_processus).langue == 'F')          if ((*s_etat_processus).langue == 'F')
         {          {
             printf("+++Système : Mémoire insuffisante\n");              uprintf("+++Système : Mémoire insuffisante\n");
         }          }
         else          else
         {          {
             printf("+++System : Not enough memory\n");              uprintf("+++System : Not enough memory\n");
         }          }
   
         return(EXIT_FAILURE);          return(EXIT_FAILURE);
     }      }
   
       if ((arg_exec = sys_malloc((((size_t) argc) + 1) * sizeof(char *))) == NULL)
       {
           if ((*s_etat_processus).langue == 'F')
           {
               uprintf("+++Système : Mémoire insuffisante\n");
           }
           else
           {
               uprintf("+++System : Not enough memory\n");
           }
   
           return(EXIT_FAILURE);
       }
   
       for(i = 0; i < argc; i++)
       {
           arg_exec[i] = argv[i];
       }
   
       arg_exec[argc] = NULL;
   
       initialisation_contexte_cas(s_etat_processus);
   
     (*s_etat_processus).exception = d_ep;      (*s_etat_processus).exception = d_ep;
     (*s_etat_processus).erreur_systeme = d_es;      (*s_etat_processus).erreur_systeme = d_es;
     (*s_etat_processus).erreur_execution = d_ex;      (*s_etat_processus).erreur_execution = d_ex;
   
     insertion_thread(s_etat_processus, d_vrai);      (*s_etat_processus).requete_redemarrage = d_faux;
       (*s_etat_processus).rpl_home = rpl_home;
   
     pthread_mutexattr_init(&attributs_mutex);      pthread_mutexattr_init(&attributs_mutex);
     pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_NORMAL);      pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_NORMAL);
     pthread_mutex_init(&((*s_etat_processus).mutex), &attributs_mutex);      pthread_mutex_init(&((*s_etat_processus).mutex_pile_processus),
               &attributs_mutex);
     pthread_mutexattr_destroy(&attributs_mutex);      pthread_mutexattr_destroy(&attributs_mutex);
   
     sem_init(&((*s_etat_processus).semaphore_fork), 0, 0);  
   
     pthread_mutexattr_init(&attributs_mutex);      pthread_mutexattr_init(&attributs_mutex);
     pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_NORMAL);      pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_NORMAL);
     pthread_mutex_init(&((*s_etat_processus).protection_liste_mutexes),      pthread_mutex_init(&((*s_etat_processus).mutex_interruptions),
             &attributs_mutex);              &attributs_mutex);
     pthread_mutexattr_destroy(&attributs_mutex);      pthread_mutexattr_destroy(&attributs_mutex);
   
     (*s_etat_processus).s_liste_variables_partagees = &s_variables_partagees;      pthread_mutexattr_init(&attributs_mutex);
       pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_NORMAL);
       pthread_mutex_init(&((*s_etat_processus).mutex_signaux),
               &attributs_mutex);
       pthread_mutexattr_destroy(&attributs_mutex);
   
     s_variables_partagees.nombre_variables = 0;      pthread_mutexattr_init(&attributs_mutex);
     s_variables_partagees.nombre_variables_allouees = 0;      pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_NORMAL);
     s_variables_partagees.table = NULL;      pthread_mutex_init(&((*s_etat_processus).mutex_allocation),
               &attributs_mutex);
       pthread_mutexattr_destroy(&attributs_mutex);
   
     pthread_mutexattr_init(&attributs_mutex);      pthread_mutexattr_init(&attributs_mutex);
     pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_NORMAL);      pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_NORMAL);
     pthread_mutex_init(&((*((*s_etat_processus).s_liste_variables_partagees))      pthread_mutex_init(&((*s_etat_processus).mutex_allocation_buffer),
             .mutex), &attributs_mutex);              &attributs_mutex);
     pthread_mutexattr_destroy(&attributs_mutex);      pthread_mutexattr_destroy(&attributs_mutex);
   
     if ((langue = getenv("LANG")) != NULL)      pthread_mutexattr_init(&attributs_mutex);
     {      pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_RECURSIVE);
         (*s_etat_processus).langue = (strncmp(langue, "fr", 2) == 0)      pthread_mutex_init(&mutex_sections_critiques, &attributs_mutex);
                 ? 'F' : 'E';      pthread_mutexattr_destroy(&attributs_mutex);
     }  
     else      pthread_mutexattr_init(&attributs_mutex);
       pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_RECURSIVE);
       pthread_mutex_init(&mutex_liste_variables_partagees, &attributs_mutex);
       pthread_mutexattr_destroy(&attributs_mutex);
   
       pthread_mutexattr_init(&attributs_mutex);
       pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_RECURSIVE);
       pthread_mutex_init(&mutex_liste_threads, &attributs_mutex);
       pthread_mutexattr_destroy(&attributs_mutex);
   
       pthread_mutexattr_init(&attributs_mutex);
       pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_RECURSIVE);
       pthread_mutex_init(&mutex_liste_threads_surveillance, &attributs_mutex);
       pthread_mutexattr_destroy(&attributs_mutex);
   
       pthread_mutexattr_init(&attributs_mutex);
       pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_RECURSIVE);
       pthread_mutex_init(&mutex_sigaction, &attributs_mutex);
       pthread_mutexattr_destroy(&attributs_mutex);
   
   #   ifndef SEMAPHORES_NOMMES
           if (sem_init(&((*s_etat_processus).semaphore_fork), 0, 0) != 0)
   #   else
           if (((*s_etat_processus).semaphore_fork = sem_init3(0, getpid(),
                   pthread_self(), SEM_FORK)) == SEM_FAILED)
   #   endif
     {      {
         (*s_etat_processus).langue = 'E';          liberation_contexte_cas(s_etat_processus);
   
           if ((*s_etat_processus).langue == 'F')
           {
               uprintf("+++Système : Mémoire insuffisante\n");
           }
           else
           {
               uprintf("+++System : Not enough memory\n");
           }
   
           return(EXIT_FAILURE);
     }      }
   
     localisation_courante(s_etat_processus);      pthread_mutexattr_init(&attributs_mutex);
       pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_NORMAL);
       pthread_mutex_init(&((*s_etat_processus).protection_liste_mutexes),
               &attributs_mutex);
       pthread_mutexattr_destroy(&attributs_mutex);
   
       (*s_etat_processus).chemin_fichiers_temporaires =
               recherche_chemin_fichiers_temporaires(s_etat_processus);
   
       insertion_thread(s_etat_processus, d_vrai);
       creation_queue_signaux(s_etat_processus);
   
     if ((*s_etat_processus).erreur_systeme != d_es)      if ((*s_etat_processus).erreur_systeme != d_es)
     {      {
   #       ifndef SEMAPHORES_NOMMES
               sem_post(&((*s_etat_processus).semaphore_fork));
               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #       else
               sem_post((*s_etat_processus).semaphore_fork);
               sem_destroy3((*s_etat_processus).semaphore_fork, getpid(),
                       pthread_self(), SEM_FORK);
   #       endif
   
           liberation_contexte_cas(s_etat_processus);
   
         if ((*s_etat_processus).langue == 'F')          if ((*s_etat_processus).langue == 'F')
         {          {
             uprintf("+++Système : Mémoire insuffisante\n");              uprintf("+++Système : Mémoire insuffisante\n");
Line 179  rplinit(int argc, char *argv[], unsigned Line 381  rplinit(int argc, char *argv[], unsigned
         return(EXIT_FAILURE);          return(EXIT_FAILURE);
     }      }
   
     printf("+++RPL/2 (R) version %s (%s)\n", d_version_rpl,      if (d_forced_locale == 0)
             ((*s_etat_processus).langue == 'F') ? d_date_rpl : d_date_en_rpl);  
   
     if ((*s_etat_processus).langue == 'F')  
     {      {
         printf("+++Copyright (C) 1989 à 2009, 2010 BERTRAND Joël\n");          localisation_courante(s_etat_processus);
     }      }
     else      else
     {      {
         printf("+++Copyright (C) 1989 to 2009, 2010 BERTRAND Joel\n");          if (((*s_etat_processus).localisation = malloc((strlen(d_locale)
                   + 1) * sizeof(unsigned char))) == NULL)
           {
   #           ifndef SEMAPHORES_NOMMES
                   sem_post(&((*s_etat_processus).semaphore_fork));
                   sem_destroy(&((*s_etat_processus).semaphore_fork));
   #           else
                   sem_post((*s_etat_processus).semaphore_fork);
                   sem_destroy3((*s_etat_processus).semaphore_fork, getpid(),
                           pthread_self(), SEM_FORK);
   #           endif
   
               liberation_contexte_cas(s_etat_processus);
               destruction_queue_signaux(s_etat_processus);
   
               if ((*s_etat_processus).langue == 'F')
               {
                   uprintf("+++Système : Mémoire insuffisante\n");
               }
               else
               {
                   uprintf("+++System : Not enough memory\n");
               }
   
               return(EXIT_FAILURE);
           }
   
           strcpy((*s_etat_processus).localisation, d_locale);
       }
   
       (*s_etat_processus).erreur_systeme = d_es;
   
       if ((*s_etat_processus).localisation == NULL)
       {
           if (((*s_etat_processus).localisation = malloc((strlen(d_locale) + 1) *
                   sizeof(unsigned char))) == NULL)
           {
   #           ifndef SEMAPHORES_NOMMES
                   sem_post(&((*s_etat_processus).semaphore_fork));
                   sem_destroy(&((*s_etat_processus).semaphore_fork));
   #           else
                   sem_post((*s_etat_processus).semaphore_fork);
                   sem_destroy3((*s_etat_processus).semaphore_fork, getpid(),
                           pthread_self(), SEM_FORK);
   #           endif
   
               liberation_contexte_cas(s_etat_processus);
               destruction_queue_signaux(s_etat_processus);
   
               if ((*s_etat_processus).langue == 'F')
               {
                   uprintf("+++Système : Mémoire insuffisante\n");
               }
               else
               {
                   uprintf("+++System : Not enough memory\n");
               }
   
               return(EXIT_FAILURE);
           }
   
           strcpy((*s_etat_processus).localisation, d_locale);
       }
   
       if (resultats == NULL) // Appel direct
       {
           printf("+++RPL/2 (R) version %s (%s)\n", d_version_rpl,
                   ((*s_etat_processus).langue == 'F')
                   ? d_date_rpl : d_date_en_rpl);
   
           if ((*s_etat_processus).langue == 'F')
           {
               printf("+++Copyright (C) 1989 à 2020, 2021 BERTRAND Joël\n");
           }
           else
           {
               printf("+++Copyright (C) 1989 to 2020, 2021 BERTRAND Joel\n");
           }
     }      }
   
     if (getenv("HOME") != NULL)      if (getenv("HOME") != NULL)
Line 213  rplinit(int argc, char *argv[], unsigned Line 489  rplinit(int argc, char *argv[], unsigned
         home = "";          home = "";
     }      }
   
     // Initialisation d'une clef  #   ifdef HAVE_STACK_OVERFLOW_RECOVERY
           if (stackoverflow_install_handler(interruption_depassement_pile,
                   pile_signaux, sizeof(pile_signaux)) != 0)
           {
   #           ifndef SEMAPHORES_NOMMES
                   sem_post(&((*s_etat_processus).semaphore_fork));
                   sem_destroy(&((*s_etat_processus).semaphore_fork));
   #           else
                   sem_post((*s_etat_processus).semaphore_fork);
                   sem_destroy3((*s_etat_processus).semaphore_fork, getpid(),
                           pthread_self(), SEM_FORK);
   #           endif
   
     if (pthread_key_create(&semaphore_fork_processus_courant, NULL) != 0)              liberation_contexte_cas(s_etat_processus);
     {              destruction_queue_signaux(s_etat_processus);
         if ((*s_etat_processus).langue == 'F')  
         {  
             printf("+++Système : Mémoire insuffisante\n");  
         }  
         else  
         {  
             printf("+++System : Not enough memory\n");  
         }  
   
         return(EXIT_FAILURE);              erreur = d_es_signal;
     }  
   
     if (pthread_setspecific(semaphore_fork_processus_courant,              if ((*s_etat_processus).langue == 'F')
             &((*s_etat_processus).semaphore_fork)) != 0)              {
     {                  printf("+++Système : Initialisation de la pile alternative "
                           "impossible\n");
               }
               else
               {
                   printf("+++System : Initialization of alternate "
                           "stack failed\n");
               }
   
               return(EXIT_FAILURE);
           }
   #   else
         if ((*s_etat_processus).langue == 'F')          if ((*s_etat_processus).langue == 'F')
         {          {
             printf("+++Système : Mémoire insuffisante\n");              printf("+++Attention : Le système ne supporte pas de pile "
                       "alternative\n");
         }          }
         else          else
         {          {
             printf("+++System : Not enough memory\n");              printf("+++Warning : Operating system does not support alternate "
                       "stack\n");
         }          }
   #   endif
   
         return(EXIT_FAILURE);      action.sa_handler = interruption1;
     }      action.sa_flags = 0;
   
     // Initialisation d'une pile de signal pour récupérer les  
     // débordement de pile  
   
     if (((*s_etat_processus).pile_signal.ss_sp =      if (sigaction(SIGINT, &action, NULL) != 0)
             malloc((*s_etat_processus).pile_signal.ss_size =  
             SIGSTKSZ)) == NULL)  
     {      {
         erreur = d_es_allocation_memoire;  #       ifndef SEMAPHORES_NOMMES
               sem_post(&((*s_etat_processus).semaphore_fork));
               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #       else
               sem_post((*s_etat_processus).semaphore_fork);
               sem_destroy3((*s_etat_processus).semaphore_fork, getpid(),
                       pthread_self(), SEM_FORK);
   #       endif
   
           liberation_contexte_cas(s_etat_processus);
           destruction_queue_signaux(s_etat_processus);
   
   #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
               stackoverflow_deinstall_handler();
   #       endif
   
           erreur = d_es_signal;
   
         if ((*s_etat_processus).langue == 'F')          if ((*s_etat_processus).langue == 'F')
         {          {
             printf("+++Système : Mémoire insuffisante\n");              printf("+++Système : Initialisation des signaux POSIX "
                       "impossible\n");
         }          }
         else          else
         {          {
             printf("+++System : Not enough memory\n");              printf("+++System : Initialization of POSIX signals failed\n");
         }          }
   
         return(EXIT_FAILURE);          return(EXIT_FAILURE);
     }      }
   
     (*s_etat_processus).pile_signal.ss_flags = 0;      signal_test = SIGTEST;
       raise(SIGINT);
   
       attente.tv_sec = 0;
       attente.tv_nsec = 1000000;
   
       for(i = 0; (i < 1000) && (signal_test == SIGTEST); i++)
       {
           nanosleep(&attente, NULL);
       }
   
     if (sigaltstack(&((*s_etat_processus).pile_signal), NULL) != 0)      if (signal_test != SIGINT)
     {      {
   #       ifndef SEMAPHORES_NOMMES
               sem_post(&((*s_etat_processus).semaphore_fork));
               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #       else
               sem_post((*s_etat_processus).semaphore_fork);
               sem_destroy3((*s_etat_processus).semaphore_fork, getpid(),
                       pthread_self(), SEM_FORK);
   #       endif
   
           liberation_contexte_cas(s_etat_processus);
           destruction_queue_signaux(s_etat_processus);
   
   #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
               stackoverflow_deinstall_handler();
   #       endif
   
         erreur = d_es_signal;          erreur = d_es_signal;
   
         if ((*s_etat_processus).langue == 'F')          if ((*s_etat_processus).langue == 'F')
         {          {
             printf("+++Système : Initialisation de la pile spécifique de signal"              printf("+++Système : Initialisation des signaux POSIX "
                     " impossible\n");                      "impossible\n");
         }          }
         else          else
         {          {
             printf("+++System : Initialization of signal stack failed\n");              printf("+++System : Initialization of POSIX signals failed\n");
         }          }
   
         return(EXIT_FAILURE);          return(EXIT_FAILURE);
     }      }
   
     action.sa_sigaction = interruption1;      if (sigaction(SIGTERM, &action, NULL) != 0)
     action.sa_flags = SA_ONSTACK | SA_SIGINFO;  
   
     if (sigaction(SIGINT, &action, NULL) != 0)  
     {      {
   #       ifndef SEMAPHORES_NOMMES
               sem_post(&((*s_etat_processus).semaphore_fork));
               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #       else
               sem_post((*s_etat_processus).semaphore_fork);
               sem_destroy3((*s_etat_processus).semaphore_fork, getpid(),
                       pthread_self(), SEM_FORK);
   #       endif
   
           liberation_contexte_cas(s_etat_processus);
           destruction_queue_signaux(s_etat_processus);
   
   #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
               stackoverflow_deinstall_handler();
   #       endif
   
         erreur = d_es_signal;          erreur = d_es_signal;
   
         if ((*s_etat_processus).langue == 'F')          if ((*s_etat_processus).langue == 'F')
Line 304  rplinit(int argc, char *argv[], unsigned Line 646  rplinit(int argc, char *argv[], unsigned
         return(EXIT_FAILURE);          return(EXIT_FAILURE);
     }      }
   
     action.sa_sigaction = interruption2;      signal_test = SIGTEST;
     action.sa_flags = SA_NODEFER | SA_ONSTACK | SA_SIGINFO;      raise(SIGTERM);
   
     if (sigaction(SIGTSTP, &action, NULL) != 0)      attente.tv_sec = 0;
       attente.tv_nsec = 1000000;
   
       for(i = 0; (i < 1000) && (signal_test == SIGTEST); i++)
       {
           nanosleep(&attente, NULL);
       }
   
       if (signal_test != SIGTERM)
     {      {
   #       ifndef SEMAPHORES_NOMMES
               sem_post(&((*s_etat_processus).semaphore_fork));
               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #       else
               sem_post((*s_etat_processus).semaphore_fork);
               sem_destroy3((*s_etat_processus).semaphore_fork, getpid(),
                       pthread_self(), SEM_FORK);
   #       endif
   
           liberation_contexte_cas(s_etat_processus);
           destruction_queue_signaux(s_etat_processus);
   
   #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
               stackoverflow_deinstall_handler();
   #       endif
   
           erreur = d_es_signal;
   
         if ((*s_etat_processus).langue == 'F')          if ((*s_etat_processus).langue == 'F')
         {          {
             printf("+++Système : Initialisation des signaux POSIX "              printf("+++Système : Initialisation des signaux POSIX "
Line 322  rplinit(int argc, char *argv[], unsigned Line 690  rplinit(int argc, char *argv[], unsigned
         return(EXIT_FAILURE);          return(EXIT_FAILURE);
     }      }
   
     action.sa_sigaction = interruption4;      if (sigaction(SIGUSR2, &action, NULL) != 0)
     action.sa_flags = SA_ONSTACK | SA_SIGINFO;  
   
     if (sigaction(SIGSTART, &action, NULL) != 0)  
     {      {
   #       ifndef SEMAPHORES_NOMMES
               sem_post(&((*s_etat_processus).semaphore_fork));
               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #       else
               sem_post((*s_etat_processus).semaphore_fork);
               sem_destroy3((*s_etat_processus).semaphore_fork, getpid(),
                       pthread_self(), SEM_FORK);
   #       endif
   
           liberation_contexte_cas(s_etat_processus);
           destruction_queue_signaux(s_etat_processus);
   
   #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
               stackoverflow_deinstall_handler();
   #       endif
   
           erreur = d_es_signal;
   
         if ((*s_etat_processus).langue == 'F')          if ((*s_etat_processus).langue == 'F')
         {          {
             printf("+++Système : Initialisation des signaux POSIX "              printf("+++Système : Initialisation des signaux POSIX "
Line 340  rplinit(int argc, char *argv[], unsigned Line 723  rplinit(int argc, char *argv[], unsigned
         return(EXIT_FAILURE);          return(EXIT_FAILURE);
     }      }
   
     if (sigaction(SIGCONT, &action, NULL) != 0)      signal_test = SIGTEST;
       raise(SIGUSR2);
   
       attente.tv_sec = 0;
       attente.tv_nsec = 1000000;
   
       for(i = 0; (i < 1000) && (signal_test == SIGTEST); i++)
     {      {
           nanosleep(&attente, NULL);
       }
   
       if (signal_test != SIGUSR2)
       {
   #       ifndef SEMAPHORES_NOMMES
               sem_post(&((*s_etat_processus).semaphore_fork));
               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #       else
               sem_post((*s_etat_processus).semaphore_fork);
               sem_destroy3((*s_etat_processus).semaphore_fork, getpid(),
                       pthread_self(), SEM_FORK);
   #       endif
   
           liberation_contexte_cas(s_etat_processus);
           destruction_queue_signaux(s_etat_processus);
   
   #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
               stackoverflow_deinstall_handler();
   #       endif
   
           erreur = d_es_signal;
   
         if ((*s_etat_processus).langue == 'F')          if ((*s_etat_processus).langue == 'F')
         {          {
             printf("+++Système : Initialisation des signaux POSIX "              printf("+++Système : Initialisation des signaux POSIX "
Line 355  rplinit(int argc, char *argv[], unsigned Line 767  rplinit(int argc, char *argv[], unsigned
         return(EXIT_FAILURE);          return(EXIT_FAILURE);
     }      }
   
     action.sa_sigaction = interruption5;      action.sa_handler = interruption2;
     action.sa_flags = SA_NODEFER | SA_ONSTACK | SA_SIGINFO;      action.sa_flags = 0;
   
     if (sigaction(SIGFSTOP, &action, NULL) != 0)      if (sigaction(SIGTSTP, &action, NULL) != 0)
     {      {
         erreur = d_es_signal;  #       ifndef SEMAPHORES_NOMMES
               sem_post(&((*s_etat_processus).semaphore_fork));
               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #       else
               sem_post((*s_etat_processus).semaphore_fork);
               sem_destroy3((*s_etat_processus).semaphore_fork, getpid(),
                       pthread_self(), SEM_FORK);
   #       endif
   
           liberation_contexte_cas(s_etat_processus);
           destruction_queue_signaux(s_etat_processus);
   
   #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
               stackoverflow_deinstall_handler();
   #       endif
   
         if ((*s_etat_processus).langue == 'F')          if ((*s_etat_processus).langue == 'F')
         {          {
Line 375  rplinit(int argc, char *argv[], unsigned Line 801  rplinit(int argc, char *argv[], unsigned
         return(EXIT_FAILURE);          return(EXIT_FAILURE);
     }      }
   
     action.sa_sigaction = interruption8;      signal_test = SIGTEST;
     action.sa_flags = SA_NODEFER | SA_ONSTACK | SA_SIGINFO;      raise(SIGTSTP);
   
     if (sigaction(SIGURG, &action, NULL) != 0)      attente.tv_sec = 0;
       attente.tv_nsec = 1000000;
   
       for(i = 0; (i < 1000) && (signal_test == SIGTEST); i++)
     {      {
           nanosleep(&attente, NULL);
       }
   
       if (signal_test != SIGTSTP)
       {
   #       ifndef SEMAPHORES_NOMMES
               sem_post(&((*s_etat_processus).semaphore_fork));
               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #       else
               sem_post((*s_etat_processus).semaphore_fork);
               sem_destroy3((*s_etat_processus).semaphore_fork, getpid(),
                       pthread_self(), SEM_FORK);
   #       endif
   
           liberation_contexte_cas(s_etat_processus);
           destruction_queue_signaux(s_etat_processus);
   
   #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
               stackoverflow_deinstall_handler();
   #       endif
   
         erreur = d_es_signal;          erreur = d_es_signal;
   
         if ((*s_etat_processus).langue == 'F')          if ((*s_etat_processus).langue == 'F')
Line 395  rplinit(int argc, char *argv[], unsigned Line 845  rplinit(int argc, char *argv[], unsigned
         return(EXIT_FAILURE);          return(EXIT_FAILURE);
     }      }
   
     action.sa_sigaction = interruption7;      action.sa_handler = interruption5;
     action.sa_flags = SA_NODEFER | SA_ONSTACK | SA_SIGINFO;      action.sa_flags = 0;
   
     if (sigaction(SIGPIPE, &action, NULL) != 0)      if (sigaction(SIGPIPE, &action, NULL) != 0)
     {      {
   #       ifndef SEMAPHORES_NOMMES
               sem_post(&((*s_etat_processus).semaphore_fork));
               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #       else
               sem_post((*s_etat_processus).semaphore_fork);
               sem_destroy3((*s_etat_processus).semaphore_fork, getpid(),
                       pthread_self(), SEM_FORK);
   #       endif
   
           liberation_contexte_cas(s_etat_processus);
           destruction_queue_signaux(s_etat_processus);
   
   #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
               stackoverflow_deinstall_handler();
   #       endif
   
         erreur = d_es_signal;          erreur = d_es_signal;
   
         if ((*s_etat_processus).langue == 'F')          if ((*s_etat_processus).langue == 'F')
Line 415  rplinit(int argc, char *argv[], unsigned Line 881  rplinit(int argc, char *argv[], unsigned
         return(EXIT_FAILURE);          return(EXIT_FAILURE);
     }      }
   
     action.sa_sigaction = interruption6;      signal_test = SIGTEST;
     action.sa_flags = SA_ONSTACK | SA_SIGINFO;      raise(SIGPIPE);
   
     if (sigaction(SIGINJECT, &action, NULL) != 0)      attente.tv_sec = 0;
       attente.tv_nsec = 1000000;
   
       for(i = 0; (i < 1000) && (signal_test == SIGTEST); i++)
     {      {
           nanosleep(&attente, NULL);
       }
   
       if (signal_test != SIGPIPE)
       {
   #       ifndef SEMAPHORES_NOMMES
               sem_post(&((*s_etat_processus).semaphore_fork));
               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #       else
               sem_post((*s_etat_processus).semaphore_fork);
               sem_destroy3((*s_etat_processus).semaphore_fork, getpid(),
                       pthread_self(), SEM_FORK);
   #       endif
   
           liberation_contexte_cas(s_etat_processus);
           destruction_queue_signaux(s_etat_processus);
   
   #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
               stackoverflow_deinstall_handler();
   #       endif
   
         erreur = d_es_signal;          erreur = d_es_signal;
   
         if ((*s_etat_processus).langue == 'F')          if ((*s_etat_processus).langue == 'F')
Line 435  rplinit(int argc, char *argv[], unsigned Line 925  rplinit(int argc, char *argv[], unsigned
         return(EXIT_FAILURE);          return(EXIT_FAILURE);
     }      }
   
     action.sa_sigaction = interruption9;      action.sa_handler = interruption1;
     action.sa_flags = SA_ONSTACK | SA_SIGINFO;      action.sa_flags = 0;
   
     if (sigaction(SIGABORT, &action, NULL) != 0)      if (sigaction(SIGUSR1, &action, NULL) != 0)
     {      {
   #       ifndef SEMAPHORES_NOMMES
               sem_post(&((*s_etat_processus).semaphore_fork));
               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #       else
               sem_post((*s_etat_processus).semaphore_fork);
               sem_destroy3((*s_etat_processus).semaphore_fork, getpid(),
                       pthread_self(), SEM_FORK);
   #       endif
   
           liberation_contexte_cas(s_etat_processus);
           destruction_queue_signaux(s_etat_processus);
   
   #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
               stackoverflow_deinstall_handler();
   #       endif
   
         erreur = d_es_signal;          erreur = d_es_signal;
   
         if ((*s_etat_processus).langue == 'F')          if ((*s_etat_processus).langue == 'F')
Line 455  rplinit(int argc, char *argv[], unsigned Line 961  rplinit(int argc, char *argv[], unsigned
         return(EXIT_FAILURE);          return(EXIT_FAILURE);
     }      }
   
     action.sa_sigaction = interruption1;      signal_test = SIGTEST;
     action.sa_flags = SA_NODEFER | SA_ONSTACK | SA_SIGINFO;      raise(SIGUSR1);
   
       attente.tv_sec = 0;
       attente.tv_nsec = 1000000;
   
     if (sigaction(SIGALRM, &action, NULL) != 0)      for(i = 0; (i < 1000) && (signal_test == SIGTEST); i++)
     {      {
           nanosleep(&attente, NULL);
       }
   
       if (signal_test != SIGUSR1)
       {
   #       ifndef SEMAPHORES_NOMMES
               sem_post(&((*s_etat_processus).semaphore_fork));
               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #       else
               sem_post((*s_etat_processus).semaphore_fork);
               sem_destroy3((*s_etat_processus).semaphore_fork, getpid(),
                       pthread_self(), SEM_FORK);
   #       endif
   
           liberation_contexte_cas(s_etat_processus);
           destruction_queue_signaux(s_etat_processus);
   
   #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
               stackoverflow_deinstall_handler();
   #       endif
   
         erreur = d_es_signal;          erreur = d_es_signal;
   
         if ((*s_etat_processus).langue == 'F')          if ((*s_etat_processus).langue == 'F')
Line 475  rplinit(int argc, char *argv[], unsigned Line 1005  rplinit(int argc, char *argv[], unsigned
         return(EXIT_FAILURE);          return(EXIT_FAILURE);
     }      }
   
     action.sa_sigaction = interruption3;      signal_test = SIGTEST + 1;
     action.sa_flags = SA_NODEFER | SA_ONSTACK | SA_SIGINFO;  
   
     (*s_etat_processus).chemin_fichiers_temporaires =      erreur = d_absence_erreur;
             recherche_chemin_fichiers_temporaires(s_etat_processus);  
   
     erreur = d_os;  
     core = d_faux;      core = d_faux;
     mode_interactif = d_faux;      mode_interactif = d_faux;
     (*s_etat_processus).nom_fichier_source = NULL;      (*s_etat_processus).nom_fichier_source = NULL;
Line 492  rplinit(int argc, char *argv[], unsigned Line 1018  rplinit(int argc, char *argv[], unsigned
     drapeau_encart = 'Y';      drapeau_encart = 'Y';
     debug = d_faux;      debug = d_faux;
     arguments = NULL;      arguments = NULL;
       l_bibliotheques = NULL;
   
     (*s_etat_processus).s_fichiers = NULL;      (*s_etat_processus).s_fichiers = NULL;
     (*s_etat_processus).s_sockets = NULL;      (*s_etat_processus).s_sockets = NULL;
Line 502  rplinit(int argc, char *argv[], unsigned Line 1029  rplinit(int argc, char *argv[], unsigned
   
     if (argc == 1)      if (argc == 1)
     {      {
         erreur = d_os_ligne_de_commande;          erreur = d_erreur;
         informations(s_etat_processus);          informations(s_etat_processus);
     }      }
     else      else
Line 527  rplinit(int argc, char *argv[], unsigned Line 1054  rplinit(int argc, char *argv[], unsigned
         option_t = d_faux;          option_t = d_faux;
         option_v = d_faux;          option_v = d_faux;
   
           // Lorsque le programme est appelé depuis un shebang, argv[0] contient
           // le chemin du programme et argv[1] tous les arguments.
           // argv[2] contient quant à lui le nom du script RPL/2.
           //
           // Exemple :
           // argv[0] : /usr/local/bin/rpl
           // argv[1] : -csdp -t 800
           // argv[2] : ./on_exit.rpl
   
         while((--argc) > 0)          while((--argc) > 0)
         {          {
             if ((*(++argv))[0] == '-')              if ((*(++argv))[0] == '-')
Line 539  rplinit(int argc, char *argv[], unsigned Line 1075  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if (option_a == d_vrai)                              if (option_a == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_destroy3((*s_etat_processus).semaphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : option -a présente "                                      printf("+++Erreur : option -a présente "
Line 554  rplinit(int argc, char *argv[], unsigned Line 1107  rplinit(int argc, char *argv[], unsigned
                             }                              }
   
                             option_a = d_vrai;                              option_a = d_vrai;
                             printf("\n");  
   
                             if ((*s_etat_processus).langue == 'F')  
                             {  
                                 printf("  Auteur: Joël BERTRAND,\n");  
                                 printf("    Email              : "  
                                         "joel.bertrand@systella.fr\n");  
                                 printf("    Liste de diffusion : "  
                                         "rpl2@systella.fr\n");  
                                 printf("    Page               : "  
                                         "http://www.rpl2.fr");  
                                 printf("\n");  
                             }  
                             else  
                             {  
                                 printf("  Author: Joël BERTRAND,\n");  
                                 printf("    Email              : "  
                                         "joel.bertrand@systella.fr\n");  
                                 printf("    Mailing list       : "  
                                         "rpl2@systella.fr\n");  
                                 printf("    Web page           : "  
                                         "http://www.rpl2/net");  
                                 printf("\n");  
                             }  
   
                             break;                              break;
                         }                          }
   
Line 586  rplinit(int argc, char *argv[], unsigned Line 1114  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if (option_A == d_vrai)                              if (option_A == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_destroy3((*s_etat_processus).semaphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : option -A présente "                                      printf("+++Erreur : option -A présente "
Line 610  rplinit(int argc, char *argv[], unsigned Line 1155  rplinit(int argc, char *argv[], unsigned
                                 if ((arguments = malloc((strlen(argv[0]) + 7) *                                  if ((arguments = malloc((strlen(argv[0]) + 7) *
                                         sizeof(unsigned char))) == NULL)                                          sizeof(unsigned char))) == NULL)
                                 {                                  {
   #                                   ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                                   else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_destroy3((*s_etat_processus)
                                               .semaphore_fork, getpid(),
                                               pthread_self(), SEM_FORK);
   #                                   endif
   
                                       liberation_contexte_cas(s_etat_processus);
                                       destruction_queue_signaux(s_etat_processus);
   
   #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                                   endif
   
                                     if ((*s_etat_processus).langue == 'F')                                      if ((*s_etat_processus).langue == 'F')
                                     {                                      {
                                         printf("+++Système : Mémoire "                                          printf("+++Système : Mémoire "
Line 646  rplinit(int argc, char *argv[], unsigned Line 1211  rplinit(int argc, char *argv[], unsigned
                                 if ((arguments = malloc((strlen(argv[0]) + 7) *                                  if ((arguments = malloc((strlen(argv[0]) + 7) *
                                         sizeof(unsigned char))) == NULL)                                          sizeof(unsigned char))) == NULL)
                                 {                                  {
   #                                   ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                                   else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_destroy3((*s_etat_processus)
                                               .semaphore_fork, getpid(),
                                               pthread_self(), SEM_FORK);
   #                                   endif
   
                                       liberation_contexte_cas(s_etat_processus);
                                       destruction_queue_signaux(s_etat_processus);
   
   #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                                   endif
   
                                     if ((*s_etat_processus).langue == 'F')                                      if ((*s_etat_processus).langue == 'F')
                                     {                                      {
                                         printf("+++Système : Mémoire "                                          printf("+++Système : Mémoire "
Line 677  rplinit(int argc, char *argv[], unsigned Line 1262  rplinit(int argc, char *argv[], unsigned
                             }                              }
                             else                              else
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_destroy3((*s_etat_processus).semaphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : Aucune donnée "                                      printf("+++Erreur : Aucune donnée "
Line 698  rplinit(int argc, char *argv[], unsigned Line 1300  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if (option_c == d_vrai)                              if (option_c == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_destroy3((*s_etat_processus).semaphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : option -c présente "                                      printf("+++Erreur : option -c présente "
Line 721  rplinit(int argc, char *argv[], unsigned Line 1340  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if (option_d == d_vrai)                              if (option_d == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_destroy3((*s_etat_processus).semaphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : option -d présente "                                      printf("+++Erreur : option -d présente "
Line 744  rplinit(int argc, char *argv[], unsigned Line 1380  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if (option_D == d_vrai)                              if (option_D == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_destroy3((*s_etat_processus).semaphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : option -D présente "                                      printf("+++Erreur : option -D présente "
Line 766  rplinit(int argc, char *argv[], unsigned Line 1419  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if (option_h == d_vrai)                              if (option_h == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_destroy3((*s_etat_processus).semaphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : option -h présente "                                      printf("+++Erreur : option -h présente "
Line 789  rplinit(int argc, char *argv[], unsigned Line 1459  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if (option_i == d_vrai)                               if (option_i == d_vrai) 
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_destroy3((*s_etat_processus).semaphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : option -i présente "                                      printf("+++Erreur : option -i présente "
Line 804  rplinit(int argc, char *argv[], unsigned Line 1491  rplinit(int argc, char *argv[], unsigned
                             }                              }
                             else if (option_S == d_vrai)                              else if (option_S == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_destroy3((*s_etat_processus).semaphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : options -i et -S "                                      printf("+++Erreur : options -i et -S "
Line 819  rplinit(int argc, char *argv[], unsigned Line 1523  rplinit(int argc, char *argv[], unsigned
                             }                              }
                             else if (option_p == d_vrai)                              else if (option_p == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_destroy3((*s_etat_processus).semaphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : options -i et -p "                                      printf("+++Erreur : options -i et -p "
Line 843  rplinit(int argc, char *argv[], unsigned Line 1564  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if (option_l == d_vrai)                              if (option_l == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_destroy3((*s_etat_processus).semaphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : option -l présente "                                      printf("+++Erreur : option -l présente "
Line 871  rplinit(int argc, char *argv[], unsigned Line 1609  rplinit(int argc, char *argv[], unsigned
                             break;                              break;
                         }                          }
   
                           case 'm' :
                           {
                               while(*(++argv[0]) == ' ');
                               argv[0]--;
   
                               if ((*(++argv[0])) != '\0')
                               {
                                   if ((l_nouvelle_bibliotheque = malloc(
                                           sizeof(struct_liste_chainee))) == NULL)
                                   {
   #                                   ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                                   else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_destroy3((*s_etat_processus)
                                               .semaphore_fork, getpid(),
                                               pthread_self(), SEM_FORK);
   #                                   endif
   
                                       liberation_contexte_cas(s_etat_processus);
                                       destruction_queue_signaux(s_etat_processus);
   
   #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                                   endif
   
                                       if ((*s_etat_processus).langue == 'F')
                                       {
                                           printf("+++Système : Mémoire "
                                                   "insuffisante\n");
                                       }
                                       else
                                       {
                                           printf("+++System : Not enough "
                                                   "memory\n");
                                       }
   
                                       return(EXIT_FAILURE);
                                   }
   
                                   (*l_nouvelle_bibliotheque).suivant =
                                           l_bibliotheques;
   
                                   if (((*l_nouvelle_bibliotheque).donnee =
                                           allocation(s_etat_processus, CHN))
                                           == NULL)
                                   {
   #                                   ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                                   else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_destroy3((*s_etat_processus)
                                               .semaphore_fork, getpid(),
                                               pthread_self(), SEM_FORK);
   #                                   endif
   
                                       liberation_contexte_cas(s_etat_processus);
                                       destruction_queue_signaux(s_etat_processus);
   
   #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                                   endif
   
                                       if ((*s_etat_processus).langue == 'F')
                                       {
                                           printf("+++Système : Mémoire "
                                                   "insuffisante\n");
                                       }
                                       else
                                       {
                                           printf("+++System : Not enough "
                                                   "memory\n");
                                       }
   
                                       return(EXIT_FAILURE);
                                   }
   
                                   if (((*(*l_nouvelle_bibliotheque).donnee)
                                           .objet = malloc((strlen(argv[0]) + 1) *
                                           sizeof(unsigned char))) == NULL)
                                   {
   #                                   ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                                   else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_destroy3((*s_etat_processus)
                                               .semaphore_fork, getpid(),
                                               pthread_self(), SEM_FORK);
   #                                   endif
   
                                       liberation_contexte_cas(s_etat_processus);
                                       destruction_queue_signaux(s_etat_processus);
   
   #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                                   endif
   
                                       if ((*s_etat_processus).langue == 'F')
                                       {
                                           printf("+++Système : Mémoire "
                                                   "insuffisante\n");
                                       }
                                       else
                                       {
                                           printf("+++System : Not enough "
                                                   "memory\n");
                                       }
   
                                       return(EXIT_FAILURE);
                                   }
   
                                   strcpy((*(*l_nouvelle_bibliotheque).donnee)
                                           .objet, argv[0]);
                                   argv[0] += strlen((unsigned char *)
                                           (*(*l_nouvelle_bibliotheque).donnee)
                                           .objet) - 1;
   
                                   l_bibliotheques = l_nouvelle_bibliotheque;
                               }
                               else if ((--argc) > 0)
                               {
                                   argv++;
   
                                   if ((l_nouvelle_bibliotheque = malloc(
                                           sizeof(struct_liste_chainee))) == NULL)
                                   {
   #                                   ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                                   else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_destroy3((*s_etat_processus)
                                               .semaphore_fork, getpid(),
                                               pthread_self(), SEM_FORK);
   #                                   endif
   
                                       liberation_contexte_cas(s_etat_processus);
                                       destruction_queue_signaux(s_etat_processus);
   
   #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                                   endif
   
                                       if ((*s_etat_processus).langue == 'F')
                                       {
                                           printf("+++Système : Mémoire "
                                                   "insuffisante\n");
                                       }
                                       else
                                       {
                                           printf("+++System : Not enough "
                                                   "memory\n");
                                       }
   
                                       return(EXIT_FAILURE);
                                   }
   
                                   (*l_nouvelle_bibliotheque).suivant =
                                           l_bibliotheques;
   
                                   if (((*l_nouvelle_bibliotheque).donnee =
                                           allocation(s_etat_processus, CHN))
                                           == NULL)
                                   {
   #                                   ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                                   else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_destroy3((*s_etat_processus)
                                               .semaphore_fork, getpid(),
                                               pthread_self(), SEM_FORK);
   #                                   endif
   
                                       liberation_contexte_cas(s_etat_processus);
                                       destruction_queue_signaux(s_etat_processus);
   
   #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                                   endif
   
                                       if ((*s_etat_processus).langue == 'F')
                                       {
                                           printf("+++Système : Mémoire "
                                                   "insuffisante\n");
                                       }
                                       else
                                       {
                                           printf("+++System : Not enough "
                                                   "memory\n");
                                       }
   
                                       return(EXIT_FAILURE);
                                   }
   
                                   if (((*(*l_nouvelle_bibliotheque).donnee)
                                           .objet = malloc((strlen(argv[0]) + 1) *
                                           sizeof(unsigned char))) == NULL)
                                   {
   #                                   ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                                   else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_destroy3((*s_etat_processus)
                                               .semaphore_fork, getpid(),
                                               pthread_self(), SEM_FORK);
   #                                   endif
   
                                       liberation_contexte_cas(s_etat_processus);
                                       destruction_queue_signaux(s_etat_processus);
   
   #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                                   endif
   
                                       if ((*s_etat_processus).langue == 'F')
                                       {
                                           printf("+++Système : Mémoire "
                                                   "insuffisante\n");
                                       }
                                       else
                                       {
                                           printf("+++System : Not enough "
                                                   "memory\n");
                                       }
   
                                       return(EXIT_FAILURE);
                                   }
   
                                   strcpy((*(*l_nouvelle_bibliotheque).donnee)
                                           .objet, argv[0]);
                                   argv[0] += strlen((unsigned char *)
                                           (*(*l_nouvelle_bibliotheque).donnee)
                                           .objet) - 1;
   
                                   l_bibliotheques = l_nouvelle_bibliotheque;
                               }
                               else
                               {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_destroy3((*s_etat_processus).semaphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                   if ((*s_etat_processus).langue == 'F')
                                   {
                                       printf("+++Erreur : Aucune bibliothèque "
                                               "spécifiée après l'option -A\n");
                                   }
                                   else
                                   {
                                       printf("+++Error : Library required after "
                                               "-m option\n");
                                   }
   
                                   return(EXIT_FAILURE);
                               }
   
                               break;
                           }
   
                         case 'n' :                          case 'n' :
                         {                          {
                             if (option_n == d_vrai)                              if (option_n == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_destroy3((*s_etat_processus).semaphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : option -n présente "                                      printf("+++Erreur : option -n présente "
Line 898  rplinit(int argc, char *argv[], unsigned Line 1948  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if (option_p == d_vrai)                              if (option_p == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_destroy3((*s_etat_processus).semaphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : option -p présente "                                      printf("+++Erreur : option -p présente "
Line 913  rplinit(int argc, char *argv[], unsigned Line 1980  rplinit(int argc, char *argv[], unsigned
                             }                              }
                             else if (option_i == d_vrai)                              else if (option_i == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_destroy3((*s_etat_processus).semaphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : options -i et -p "                                      printf("+++Erreur : options -i et -p "
Line 936  rplinit(int argc, char *argv[], unsigned Line 2020  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if (option_P > 2)                              if (option_P > 2)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_destroy3((*s_etat_processus).semaphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : option -P présente "                                      printf("+++Erreur : option -P présente "
Line 959  rplinit(int argc, char *argv[], unsigned Line 2060  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if (option_s == d_vrai)                              if (option_s == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_destroy3((*s_etat_processus).semaphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : option -s présente "                                      printf("+++Erreur : option -s présente "
Line 982  rplinit(int argc, char *argv[], unsigned Line 2100  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if (option_S == d_vrai)                              if (option_S == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_destroy3((*s_etat_processus).semaphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : option -S présente "                                      printf("+++Erreur : option -S présente "
Line 997  rplinit(int argc, char *argv[], unsigned Line 2132  rplinit(int argc, char *argv[], unsigned
                             }                              }
                             else if (option_i == d_vrai)                              else if (option_i == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_destroy3((*s_etat_processus).semaphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : options -i et -S "                                      printf("+++Erreur : options -i et -S "
Line 1022  rplinit(int argc, char *argv[], unsigned Line 2174  rplinit(int argc, char *argv[], unsigned
                                         malloc((strlen(argv[0]) + 1) *                                          malloc((strlen(argv[0]) + 1) *
                                         sizeof(unsigned char))) == NULL)                                          sizeof(unsigned char))) == NULL)
                                 {                                  {
   #                                   ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                                   else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_destroy3((*s_etat_processus)
                                               .semaphore_fork, getpid(),
                                               pthread_self(), SEM_FORK);
   #                                   endif
   
                                       liberation_contexte_cas(s_etat_processus);
                                       destruction_queue_signaux(s_etat_processus);
   
   #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                                   endif
   
                                     if ((*s_etat_processus).langue == 'F')                                      if ((*s_etat_processus).langue == 'F')
                                     {                                      {
                                         printf("+++Système : Mémoire "                                          printf("+++Système : Mémoire "
Line 1056  rplinit(int argc, char *argv[], unsigned Line 2228  rplinit(int argc, char *argv[], unsigned
                                         malloc((strlen(argv[0]) + 1) *                                          malloc((strlen(argv[0]) + 1) *
                                         sizeof(unsigned char))) == NULL)                                          sizeof(unsigned char))) == NULL)
                                 {                                  {
   #                                   ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                                   else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_destroy3((*s_etat_processus)
                                               .semaphore_fork, getpid(),
                                               pthread_self(), SEM_FORK);
   #                                   endif
   
                                       liberation_contexte_cas(s_etat_processus);
                                       destruction_queue_signaux(s_etat_processus);
   
   #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                                   endif
   
                                     if ((*s_etat_processus).langue == 'F')                                      if ((*s_etat_processus).langue == 'F')
                                     {                                      {
                                         printf("+++Système : Mémoire "                                          printf("+++Système : Mémoire "
Line 1084  rplinit(int argc, char *argv[], unsigned Line 2276  rplinit(int argc, char *argv[], unsigned
                             }                              }
                             else                              else
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_destroy3((*s_etat_processus).semaphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : Aucun script "                                      printf("+++Erreur : Aucun script "
Line 1099  rplinit(int argc, char *argv[], unsigned Line 2308  rplinit(int argc, char *argv[], unsigned
                             }                              }
   
                             if (((*s_etat_processus).definitions_chainees =                              if (((*s_etat_processus).definitions_chainees =
                                     compactage((*s_etat_processus)                                      compactage(s_etat_processus,
                                     .definitions_chainees)) == NULL)                                      (*s_etat_processus).definitions_chainees))
                                       == NULL)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_destroy3((*s_etat_processus).semaphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Système : Mémoire "                                      printf("+++Système : Mémoire "
Line 1117  rplinit(int argc, char *argv[], unsigned Line 2344  rplinit(int argc, char *argv[], unsigned
                             }                              }
   
                             (*s_etat_processus).longueur_definitions_chainees =                              (*s_etat_processus).longueur_definitions_chainees =
                                     strlen((*s_etat_processus)                                      (integer8) strlen((*s_etat_processus)
                                     .definitions_chainees);                                      .definitions_chainees);
   
                             break;                              break;
Line 1127  rplinit(int argc, char *argv[], unsigned Line 2354  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if (option_t == d_vrai)                              if (option_t == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_destroy3((*s_etat_processus).semaphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : option -t présente "                                      printf("+++Erreur : option -t présente "
Line 1152  rplinit(int argc, char *argv[], unsigned Line 2396  rplinit(int argc, char *argv[], unsigned
                                 if ((type_debug = malloc((strlen(argv[0]) + 1) *                                  if ((type_debug = malloc((strlen(argv[0]) + 1) *
                                         sizeof(unsigned char))) == NULL)                                          sizeof(unsigned char))) == NULL)
                                 {                                  {
   #                                   ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                                   else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_destroy3((*s_etat_processus)
                                               .semaphore_fork, getpid(),
                                               pthread_self(), SEM_FORK);
   #                                   endif
   
                                       liberation_contexte_cas(s_etat_processus);
                                       destruction_queue_signaux(s_etat_processus);
   
   #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                                   endif
   
                                     if ((*s_etat_processus).langue == 'F')                                      if ((*s_etat_processus).langue == 'F')
                                     {                                      {
                                         printf("+++Système : Mémoire "                                          printf("+++Système : Mémoire "
Line 1186  rplinit(int argc, char *argv[], unsigned Line 2450  rplinit(int argc, char *argv[], unsigned
                                         malloc((strlen(argv[0]) + 1) *                                          malloc((strlen(argv[0]) + 1) *
                                         sizeof(unsigned char))) == NULL)                                          sizeof(unsigned char))) == NULL)
                                 {                                  {
   #                                   ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                                   else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_destroy3((*s_etat_processus)
                                               .semaphore_fork, getpid(),
                                               pthread_self(), SEM_FORK);
   #                                   endif
   
                                       liberation_contexte_cas(s_etat_processus);
                                       destruction_queue_signaux(s_etat_processus);
   
   #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                                   endif
   
                                     if ((*s_etat_processus).langue == 'F')                                      if ((*s_etat_processus).langue == 'F')
                                     {                                      {
                                         printf("+++Système : Mémoire "                                          printf("+++Système : Mémoire "
Line 1213  rplinit(int argc, char *argv[], unsigned Line 2497  rplinit(int argc, char *argv[], unsigned
                             }                              }
                             else                              else
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_destroy3((*s_etat_processus).semaphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : Aucun niveau "                                      printf("+++Erreur : Aucun niveau "
Line 1256  rplinit(int argc, char *argv[], unsigned Line 2557  rplinit(int argc, char *argv[], unsigned
   
                                     default:                                      default:
                                     {                                      {
   #                                       ifndef SEMAPHORES_NOMMES
                                           sem_post(&((*s_etat_processus)
                                                   .semaphore_fork));
                                           sem_destroy(&((*s_etat_processus)
                                                   .semaphore_fork));
   #                                       else
                                           sem_post((*s_etat_processus)
                                                   .semaphore_fork);
                                           sem_destroy3((*s_etat_processus)
                                                   .semaphore_fork, getpid(),
                                                   pthread_self(), SEM_FORK);
   #                                       endif
   
                                           liberation_contexte_cas(
                                                   s_etat_processus);
                                           destruction_queue_signaux(
                                                   s_etat_processus);
   
   #                                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                           stackoverflow_deinstall_handler();
   #                                       endif
   
                                         if ((*s_etat_processus).langue == 'F')                                          if ((*s_etat_processus).langue == 'F')
                                         {                                          {
                                             printf("+++Erreur : Niveau "                                              printf("+++Erreur : Niveau "
Line 1279  rplinit(int argc, char *argv[], unsigned Line 2602  rplinit(int argc, char *argv[], unsigned
                             if (sscanf(type_debug, "%llX",                              if (sscanf(type_debug, "%llX",
                                     &((*s_etat_processus).type_debug)) != 1)                                      &((*s_etat_processus).type_debug)) != 1)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_destroy3((*s_etat_processus).semaphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : Niveau "                                      printf("+++Erreur : Niveau "
Line 1293  rplinit(int argc, char *argv[], unsigned Line 2633  rplinit(int argc, char *argv[], unsigned
                                 return(EXIT_FAILURE);                                  return(EXIT_FAILURE);
                             }                              }
   
                               free(type_debug);
                             break;                              break;
                         }                          }
   
Line 1300  rplinit(int argc, char *argv[], unsigned Line 2641  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if (option_v == d_vrai)                              if (option_v == d_vrai)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                               else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_destroy3((*s_etat_processus).semaphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : option -v présente "                                      printf("+++Erreur : option -v présente "
Line 1346  rplinit(int argc, char *argv[], unsigned Line 2704  rplinit(int argc, char *argv[], unsigned
                             break;                              break;
                         }                          }
   
                           case '-':
                           case ' ':
                           {
                               break;
                           }
   
                         default :                          default :
                         {                          {
                             if ((*s_etat_processus).langue == 'F')                              if ((*s_etat_processus).langue == 'F')
Line 1380  rplinit(int argc, char *argv[], unsigned Line 2744  rplinit(int argc, char *argv[], unsigned
                         printf("+++Error : More than one definition\n");                          printf("+++Error : More than one definition\n");
                     }                      }
   
                     erreur = d_os_ligne_de_commande;                      erreur = d_erreur;
                 }                  }
                 else                  else
                 {                  {
Line 1390  rplinit(int argc, char *argv[], unsigned Line 2754  rplinit(int argc, char *argv[], unsigned
             }              }
         }          }
   
           /*
            * Dans le cas où le programme est appelé avec l'option -d,
            * on ne récupère par les signaux de violation d'accès. On
            * tente simplement la récupération des dépassements de pile.
            */
   
         if (debug == d_faux)          if (debug == d_faux)
         {          {
   #   ifdef HAVE_SIGSEGV_RECOVERY
               if (sigsegv_install_handler(interruption_violation_access) != 0)
               {
   #               ifndef SEMAPHORES_NOMMES
                       sem_post(&((*s_etat_processus).semaphore_fork));
                       sem_destroy(&((*s_etat_processus)
                               .semaphore_fork));
   #               else
                       sem_post((*s_etat_processus).semaphore_fork);
                       sem_destroy3((*s_etat_processus).semaphore_fork,
                               getpid(), pthread_self(), SEM_FORK);
   #               endif
   
                   liberation_contexte_cas(s_etat_processus);
                   destruction_queue_signaux(s_etat_processus);
   
   #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                       stackoverflow_deinstall_handler();
   #               endif
   
                   erreur = d_es_signal;
   
                   if ((*s_etat_processus).langue == 'F')
                   {
                       printf("+++Système : Initialisation de la pile alternative "
                               "impossible\n");
                   }
                   else
                   {
                       printf("+++System : Initialization of alternate "
                               "stack failed\n");
                   }
   
                   return(EXIT_FAILURE);
               }
   #   else
               action.sa_handler = interruption3;
               action.sa_flags = 0;
   
             if (sigaction(SIGSEGV, &action, NULL) != 0)              if (sigaction(SIGSEGV, &action, NULL) != 0)
             {              {
   #               ifndef SEMAPHORES_NOMMES
                       sem_post(&((*s_etat_processus).semaphore_fork));
                       sem_destroy(&((*s_etat_processus)
                               .semaphore_fork));
   #               else
                       sem_post((*s_etat_processus).semaphore_fork);
                       sem_destroy3((*s_etat_processus).semaphore_fork,
                               getpid(), pthread_self(), SEM_FORK);
   #               endif
   
                   liberation_contexte_cas(s_etat_processus);
                   destruction_queue_signaux(s_etat_processus);
   
   #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                       stackoverflow_deinstall_handler();
   #               endif
   
                 if ((*s_etat_processus).langue == 'F')                  if ((*s_etat_processus).langue == 'F')
                 {                  {
                     printf("+++Système : Initialisation des signaux POSIX "                      printf("+++Système : Initialisation des signaux POSIX "
Line 1408  rplinit(int argc, char *argv[], unsigned Line 2834  rplinit(int argc, char *argv[], unsigned
                 return(EXIT_FAILURE);                  return(EXIT_FAILURE);
             }              }
   
               signal_test = SIGTEST;
               raise(SIGSEGV);
   
               attente.tv_sec = 0;
               attente.tv_nsec = 1000000;
   
               for(i = 0; (i < 1000) && (signal_test == SIGTEST); i++)
               {
                   nanosleep(&attente, NULL);
               }
   
               if (signal_test != SIGSEGV)
               {
   #               ifndef SEMAPHORES_NOMMES
                       sem_post(&((*s_etat_processus).semaphore_fork));
                       sem_destroy(&((*s_etat_processus)
                               .semaphore_fork));
   #               else
                       sem_post((*s_etat_processus).semaphore_fork);
                       sem_destroy3((*s_etat_processus).semaphore_fork,
                               getpid(), pthread_self(), SEM_FORK);
   #               endif
   
                   liberation_contexte_cas(s_etat_processus);
                   destruction_queue_signaux(s_etat_processus);
   
   #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                       stackoverflow_deinstall_handler();
   #               endif
   
                   erreur = d_es_signal;
   
                   if ((*s_etat_processus).langue == 'F')
                   {
                       printf("+++Système : Initialisation des signaux POSIX "
                               "impossible\n");
                   }
                   else
                   {
                       printf("+++System : Initialization of POSIX signals "
                               "failed\n");
                   }
   
                   return(EXIT_FAILURE);
               }
   #   endif
   
               action.sa_handler = interruption3;
               action.sa_flags = 0;
   
             if (sigaction(SIGBUS, &action, NULL) != 0)              if (sigaction(SIGBUS, &action, NULL) != 0)
             {              {
   #               ifndef SEMAPHORES_NOMMES
                       sem_post(&((*s_etat_processus).semaphore_fork));
                       sem_destroy(&((*s_etat_processus)
                               .semaphore_fork));
   #               else
                       sem_post((*s_etat_processus).semaphore_fork);
                       sem_destroy3((*s_etat_processus).semaphore_fork,
                               getpid(), pthread_self(), SEM_FORK);
   #               endif
   
                   liberation_contexte_cas(s_etat_processus);
                   destruction_queue_signaux(s_etat_processus);
   
   #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                       stackoverflow_deinstall_handler();
   #               endif
   
   #               ifdef HAVE_SIGSEGV_RECOVERY
                       if (debug == d_faux)
                       {
                           sigsegv_deinstall_handler();
                       }
   #               endif
   
                 if ((*s_etat_processus).langue == 'F')                  if ((*s_etat_processus).langue == 'F')
                 {                  {
                     printf("+++Système : Initialisation des signaux POSIX "                      printf("+++Système : Initialisation des signaux POSIX "
Line 1423  rplinit(int argc, char *argv[], unsigned Line 2923  rplinit(int argc, char *argv[], unsigned
   
                 return(EXIT_FAILURE);                  return(EXIT_FAILURE);
             }              }
   
               signal_test = SIGTEST;
               raise(SIGBUS);
   
               attente.tv_sec = 0;
               attente.tv_nsec = 1000000;
   
               for(i = 0; (i < 1000) && (signal_test == SIGTEST); i++)
               {
                   nanosleep(&attente, NULL);
               }
   
               if (signal_test != SIGBUS)
               {
   #               ifndef SEMAPHORES_NOMMES
                       sem_post(&((*s_etat_processus).semaphore_fork));
                       sem_destroy(&((*s_etat_processus)
                               .semaphore_fork));
   #               else
                       sem_post((*s_etat_processus).semaphore_fork);
                       sem_destroy3((*s_etat_processus).semaphore_fork,
                               getpid(), pthread_self(), SEM_FORK);
   #               endif
   
                   liberation_contexte_cas(s_etat_processus);
                   destruction_queue_signaux(s_etat_processus);
   
   #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                       stackoverflow_deinstall_handler();
   #               endif
   
   #               ifdef HAVE_SIGSEGV_RECOVERY
                       if (debug == d_faux)
                       {
                           sigsegv_deinstall_handler();
                       }
   #               endif
   
                   erreur = d_es_signal;
   
                   if ((*s_etat_processus).langue == 'F')
                   {
                       printf("+++Système : Initialisation des signaux POSIX "
                               "impossible\n");
                   }
                   else
                   {
                       printf("+++System : Initialization of POSIX signals "
                               "failed\n");
                   }
   
                   return(EXIT_FAILURE);
               }
   
         }          }
   
         if (option_n == d_vrai)          if (option_n == d_vrai)
         {          {
             action.sa_sigaction = interruption10;              action.sa_handler = interruption4;
             action.sa_flags = SA_ONSTACK | SA_SIGINFO;              action.sa_flags = 0;
   
             if (sigaction(SIGHUP, &action, NULL) != 0)              if (sigaction(SIGHUP, &action, NULL) != 0)
             {              {
   #               ifndef SEMAPHORES_NOMMES
                       sem_post(&((*s_etat_processus).semaphore_fork));
                       sem_destroy(&((*s_etat_processus)
                               .semaphore_fork));
   #               else
                       sem_post((*s_etat_processus).semaphore_fork);
                       sem_destroy3((*s_etat_processus).semaphore_fork,
                               getpid(), pthread_self(), SEM_FORK);
   #               endif
   
                   liberation_contexte_cas(s_etat_processus);
                   destruction_queue_signaux(s_etat_processus);
   
   #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                       stackoverflow_deinstall_handler();
   #               endif
   
   #               ifdef HAVE_SIGSEGV_RECOVERY
                       if (debug == d_faux)
                       {
                           sigsegv_deinstall_handler();
                       }
   #               endif
   
                 if ((*s_etat_processus).langue == 'F')                  if ((*s_etat_processus).langue == 'F')
                 {                  {
                     printf("+++Système : Initialisation des signaux POSIX "                      printf("+++Système : Initialisation des signaux POSIX "
Line 1474  rplinit(int argc, char *argv[], unsigned Line 3052  rplinit(int argc, char *argv[], unsigned
                     creation_nom_fichier(s_etat_processus, (*s_etat_processus)                      creation_nom_fichier(s_etat_processus, (*s_etat_processus)
                     .chemin_fichiers_temporaires)) == NULL)                      .chemin_fichiers_temporaires)) == NULL)
             {              {
   #               ifndef SEMAPHORES_NOMMES
                       sem_post(&((*s_etat_processus).semaphore_fork));
                       sem_destroy(&((*s_etat_processus)
                               .semaphore_fork));
   #               else
                       sem_post((*s_etat_processus).semaphore_fork);
                       sem_destroy3((*s_etat_processus).semaphore_fork,
                               getpid(), pthread_self(), SEM_FORK);
   #               endif
   
                   liberation_contexte_cas(s_etat_processus);
                   destruction_queue_signaux(s_etat_processus);
   
   #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                       stackoverflow_deinstall_handler();
   #               endif
   
   #               ifdef HAVE_SIGSEGV_RECOVERY
                       if (debug == d_faux)
                       {
                           sigsegv_deinstall_handler();
                       }
   #               endif
   
                 if ((*s_etat_processus).langue == 'F')                  if ((*s_etat_processus).langue == 'F')
                 {                  {
                     printf("+++Système : Fichier indisponible\n");                      printf("+++Système : Fichier indisponible\n");
Line 1489  rplinit(int argc, char *argv[], unsigned Line 3091  rplinit(int argc, char *argv[], unsigned
             if ((f_source = fopen(nom_fichier_temporaire, "w"))              if ((f_source = fopen(nom_fichier_temporaire, "w"))
                     == NULL)                      == NULL)
             {              {
   #               ifndef SEMAPHORES_NOMMES
                       sem_post(&((*s_etat_processus).semaphore_fork));
                       sem_destroy(&((*s_etat_processus)
                               .semaphore_fork));
   #               else
                       sem_post((*s_etat_processus).semaphore_fork);
                       sem_destroy3((*s_etat_processus).semaphore_fork,
                               getpid(), pthread_self(), SEM_FORK);
   #               endif
   
                   liberation_contexte_cas(s_etat_processus);
                   destruction_queue_signaux(s_etat_processus);
   
   #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                       stackoverflow_deinstall_handler();
   #               endif
   
   #               ifdef HAVE_SIGSEGV_RECOVERY
                       if (debug == d_faux)
                       {
                           sigsegv_deinstall_handler();
                       }
   #               endif
   
                 if ((*s_etat_processus).langue == 'F')                  if ((*s_etat_processus).langue == 'F')
                 {                  {
                     printf("+++Système : Fichier introuvable\n");                      printf("+++Système : Fichier introuvable\n");
Line 1503  rplinit(int argc, char *argv[], unsigned Line 3129  rplinit(int argc, char *argv[], unsigned
   
             if (fprintf(f_source, "MODE_INTERACTIF\n") < 0)              if (fprintf(f_source, "MODE_INTERACTIF\n") < 0)
             {              {
   #               ifndef SEMAPHORES_NOMMES
                       sem_post(&((*s_etat_processus).semaphore_fork));
                       sem_destroy(&((*s_etat_processus)
                               .semaphore_fork));
   #               else
                       sem_post((*s_etat_processus).semaphore_fork);
                       sem_destroy3((*s_etat_processus).semaphore_fork,
                               getpid(), pthread_self(), SEM_FORK);
   #               endif
   
                   liberation_contexte_cas(s_etat_processus);
                   destruction_queue_signaux(s_etat_processus);
   
   #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                       stackoverflow_deinstall_handler();
   #               endif
   
   #               ifdef HAVE_SIGSEGV_RECOVERY
                       if (debug == d_faux)
                       {
                           sigsegv_deinstall_handler();
                       }
   #               endif
   
                 if ((*s_etat_processus).langue == 'F')                  if ((*s_etat_processus).langue == 'F')
                 {                  {
                     printf("+++Système : Erreur d'écriture dans un fichier\n");                      printf("+++Système : Erreur d'écriture dans un fichier\n");
Line 1518  rplinit(int argc, char *argv[], unsigned Line 3168  rplinit(int argc, char *argv[], unsigned
             if (fprintf(f_source,              if (fprintf(f_source,
                     "<< DO HALT UNTIL FALSE END >>\n") < 0)                      "<< DO HALT UNTIL FALSE END >>\n") < 0)
             {              {
   #               ifndef SEMAPHORES_NOMMES
                       sem_post(&((*s_etat_processus).semaphore_fork));
                       sem_destroy(&((*s_etat_processus)
                               .semaphore_fork));
   #               else
                       sem_post((*s_etat_processus).semaphore_fork);
                       sem_destroy3((*s_etat_processus).semaphore_fork,
                               getpid(), pthread_self(), SEM_FORK);
   #               endif
   
                   liberation_contexte_cas(s_etat_processus);
                   destruction_queue_signaux(s_etat_processus);
   
   #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                       stackoverflow_deinstall_handler();
   #               endif
   
   #               ifdef HAVE_SIGSEGV_RECOVERY
                       if (debug == d_faux)
                       {
                           sigsegv_deinstall_handler();
                       }
   #               endif
   
                 if ((*s_etat_processus).langue == 'F')                  if ((*s_etat_processus).langue == 'F')
                 {                  {
                     printf("+++Système : Erreur d'écriture dans un fichier\n");                      printf("+++Système : Erreur d'écriture dans un fichier\n");
Line 1532  rplinit(int argc, char *argv[], unsigned Line 3206  rplinit(int argc, char *argv[], unsigned
   
             if (fclose(f_source) != 0)              if (fclose(f_source) != 0)
             {              {
   #               ifndef SEMAPHORES_NOMMES
                       sem_post(&((*s_etat_processus).semaphore_fork));
                       sem_destroy(&((*s_etat_processus)
                               .semaphore_fork));
   #               else
                       sem_post((*s_etat_processus).semaphore_fork);
                       sem_destroy3((*s_etat_processus).semaphore_fork,
                               getpid(), pthread_self(), SEM_FORK);
   #               endif
   
                   liberation_contexte_cas(s_etat_processus);
                   destruction_queue_signaux(s_etat_processus);
   
   #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                       stackoverflow_deinstall_handler();
   #               endif
   
   #               ifdef HAVE_SIGSEGV_RECOVERY
                       if (debug == d_faux)
                       {
                           sigsegv_deinstall_handler();
                       }
   #               endif
   
                 if ((*s_etat_processus).langue == 'F')                  if ((*s_etat_processus).langue == 'F')
                 {                  {
                     printf("+++Système : Fichier indisponible\n");                      printf("+++Système : Fichier indisponible\n");
Line 1569  rplinit(int argc, char *argv[], unsigned Line 3267  rplinit(int argc, char *argv[], unsigned
         if (((existence == d_faux) || (erreur_fichier != d_absence_erreur)) &&          if (((existence == d_faux) || (erreur_fichier != d_absence_erreur)) &&
                 (option_S == d_faux))                  (option_S == d_faux))
         {          {
   #           ifndef SEMAPHORES_NOMMES
                   sem_post(&((*s_etat_processus).semaphore_fork));
                   sem_destroy(&((*s_etat_processus).semaphore_fork));
   #           else
                   sem_post((*s_etat_processus).semaphore_fork);
                   sem_destroy3((*s_etat_processus).semaphore_fork,
                           getpid(), pthread_self(), SEM_FORK);
   #           endif
   
               liberation_contexte_cas(s_etat_processus);
               destruction_queue_signaux(s_etat_processus);
   
   #           ifdef HAVE_STACK_OVERFLOW_RECOVERY
                   stackoverflow_deinstall_handler();
   #           endif
   
   #           ifdef HAVE_SIGSEGV_RECOVERY
                   if (debug == d_faux)
                   {
                       sigsegv_deinstall_handler();
                   }
   #           endif
   
             if (presence_definition == 'O')              if (presence_definition == 'O')
             {              {
                 if ((*s_etat_processus).langue == 'F')                  if ((*s_etat_processus).langue == 'F')
Line 1582  rplinit(int argc, char *argv[], unsigned Line 3303  rplinit(int argc, char *argv[], unsigned
                             (*s_etat_processus).nom_fichier_source);                              (*s_etat_processus).nom_fichier_source);
                 }                  }
   
                 erreur = d_os_fichier_introuvable;                  erreur = d_erreur;
             }              }
             else              else
             {              {
Line 1601  rplinit(int argc, char *argv[], unsigned Line 3322  rplinit(int argc, char *argv[], unsigned
   
         if ((*s_etat_processus).chemin_fichiers_temporaires == NULL)          if ((*s_etat_processus).chemin_fichiers_temporaires == NULL)
         {          {
   #           ifndef SEMAPHORES_NOMMES
                   sem_post(&((*s_etat_processus).semaphore_fork));
                   sem_destroy(&((*s_etat_processus).semaphore_fork));
   #           else
                   sem_post((*s_etat_processus).semaphore_fork);
                   sem_destroy3((*s_etat_processus).semaphore_fork,
                           getpid(), pthread_self(), SEM_FORK);
   #           endif
   
               liberation_contexte_cas(s_etat_processus);
               destruction_queue_signaux(s_etat_processus);
   
   #           ifdef HAVE_STACK_OVERFLOW_RECOVERY
                   stackoverflow_deinstall_handler();
   #           endif
   
   #           ifdef HAVE_SIGSEGV_RECOVERY
                   if (debug == d_faux)
                   {
                       sigsegv_deinstall_handler();
                   }
   #           endif
   
             if ((*s_etat_processus).langue == 'F')              if ((*s_etat_processus).langue == 'F')
             {              {
                 printf("+++Système : Chemin des fichiers temporaires nul\n");                  printf("+++Système : Chemin des fichiers temporaires nul\n");
Line 1629  rplinit(int argc, char *argv[], unsigned Line 3373  rplinit(int argc, char *argv[], unsigned
             }              }
         }          }
   
         if ((erreur == d_os) && (presence_definition == 'O'))          if ((erreur == d_absence_erreur) && (presence_definition == 'O'))
         {          {
             (*s_etat_processus).profilage = (option_P != 0) ? d_vrai : d_faux;              (*s_etat_processus).profilage = (option_P != 0) ? d_vrai : d_faux;
             (*s_etat_processus).niveau_profilage = option_P;              (*s_etat_processus).niveau_profilage = option_P;
Line 1638  rplinit(int argc, char *argv[], unsigned Line 3382  rplinit(int argc, char *argv[], unsigned
             gettimeofday(&((*s_etat_processus).horodatage_profilage), NULL);              gettimeofday(&((*s_etat_processus).horodatage_profilage), NULL);
   
             (*s_etat_processus).liste_mutexes = NULL;              (*s_etat_processus).liste_mutexes = NULL;
               (*s_etat_processus).sections_critiques = 0;
               (*s_etat_processus).initialisation_scheduler = d_faux;
   
             (*s_etat_processus).test_instruction = 'N';              (*s_etat_processus).test_instruction = 'N';
             (*s_etat_processus).nombre_arguments = 0;              (*s_etat_processus).nombre_arguments = 0;
             (*s_etat_processus).affichage_arguments = 'N';              (*s_etat_processus).affichage_arguments = 'N';
             (*s_etat_processus).autorisation_conversion_chaine = 'Y';              (*s_etat_processus).autorisation_conversion_chaine = 'Y';
             (*s_etat_processus).autorisation_evaluation_nom = 'Y';              (*s_etat_processus).autorisation_evaluation_nom = 'Y';
   
               if (mode_interactif == d_vrai)
               {
                   (*s_etat_processus).autorisation_nom_implicite = 'Y';
               }
               else
               {
                   (*s_etat_processus).autorisation_nom_implicite = 'N';
               }
   
             (*s_etat_processus).autorisation_empilement_programme = 'N';              (*s_etat_processus).autorisation_empilement_programme = 'N';
             (*s_etat_processus).requete_arret = 'N';              (*s_etat_processus).requete_arret = 'N';
             (*s_etat_processus).evaluation_forcee = 'N';              (*s_etat_processus).evaluation_forcee = 'N';
               (*s_etat_processus).recherche_type = 'N';
   
             (*s_etat_processus).constante_symbolique = 'N';              (*s_etat_processus).constante_symbolique = 'N';
             (*s_etat_processus).traitement_symbolique = 'N';              (*s_etat_processus).traitement_symbolique = 'N';
Line 1658  rplinit(int argc, char *argv[], unsigned Line 3415  rplinit(int argc, char *argv[], unsigned
             (*s_etat_processus).l_base_pile = NULL;              (*s_etat_processus).l_base_pile = NULL;
             (*s_etat_processus).l_base_pile_last = NULL;              (*s_etat_processus).l_base_pile_last = NULL;
   
             (*s_etat_processus).s_liste_variables = NULL;              (*s_etat_processus).s_arbre_variables = NULL;
               (*s_etat_processus).l_liste_variables_par_niveau = NULL;
               (*s_etat_processus).l_liste_variables_statiques = NULL;
             (*s_etat_processus).gel_liste_variables = d_faux;              (*s_etat_processus).gel_liste_variables = d_faux;
             (*s_etat_processus).nombre_variables = 0;              s_arbre_variables_partagees = NULL;
             (*s_etat_processus).nombre_variables_allouees = 0;              l_liste_variables_partagees = NULL;
             (*s_etat_processus).s_liste_variables_statiques = NULL;              (*s_etat_processus).s_arbre_variables_partagees =
             (*s_etat_processus).nombre_variables_statiques = 0;                      &s_arbre_variables_partagees;
             (*s_etat_processus).nombre_variables_statiques_allouees = 0;              (*s_etat_processus).l_liste_variables_partagees =
                       &l_liste_variables_partagees;
               (*s_etat_processus).pointeur_variable_courante = NULL;
               (*s_etat_processus).pointeur_variable_statique_courante = NULL;
               (*s_etat_processus).pointeur_variable_partagee_courante = NULL;
             (*s_etat_processus).niveau_courant = 0;              (*s_etat_processus).niveau_courant = 0;
             (*s_etat_processus).niveau_initial = 0;              (*s_etat_processus).niveau_initial = 0;
             (*s_etat_processus).creation_variables_statiques = d_faux;              (*s_etat_processus).creation_variables_statiques = d_faux;
             (*s_etat_processus).creation_variables_partagees = d_faux;              (*s_etat_processus).creation_variables_partagees = d_faux;
             (*s_etat_processus).position_variable_courante = 0;  
             (*s_etat_processus).position_variable_statique_courante = 0;  
   
             (*s_etat_processus).s_bibliotheques = NULL;              (*s_etat_processus).s_bibliotheques = NULL;
             (*s_etat_processus).s_instructions_externes = NULL;              (*s_etat_processus).s_instructions_externes = NULL;
Line 1791  rplinit(int argc, char *argv[], unsigned Line 3552  rplinit(int argc, char *argv[], unsigned
                 (*s_etat_processus).pile_origine_interruptions[i] = NULL;                  (*s_etat_processus).pile_origine_interruptions[i] = NULL;
             }              }
   
               (*s_etat_processus).at_exit = NULL;
               (*s_etat_processus).at_poke = NULL;
               (*s_etat_processus).traitement_at_poke = 'N';
   
             (*s_etat_processus).pointeurs_caracteres = NULL;              (*s_etat_processus).pointeurs_caracteres = NULL;
             (*s_etat_processus).arbre_instructions = NULL;              (*s_etat_processus).arbre_instructions = NULL;
   
             (*s_etat_processus).tid_processus_pere = pthread_self();              (*s_etat_processus).tid_processus_pere = pthread_self();
               (*s_etat_processus).tid = pthread_self();
             (*s_etat_processus).pid_processus_pere = getpid();              (*s_etat_processus).pid_processus_pere = getpid();
             (*s_etat_processus).processus_detache = d_vrai;              (*s_etat_processus).processus_detache = d_vrai;
             (*s_etat_processus).var_volatile_processus_pere = -1;              (*s_etat_processus).var_volatile_processus_pere = -1;
               (*s_etat_processus).var_volatile_processus_racine = -1;
             (*s_etat_processus).var_volatile_traitement_retarde_stop = 0;              (*s_etat_processus).var_volatile_traitement_retarde_stop = 0;
             (*s_etat_processus).var_volatile_alarme = 0;              (*s_etat_processus).var_volatile_alarme = 0;
             (*s_etat_processus).var_volatile_requete_arret = 0;              (*s_etat_processus).var_volatile_requete_arret = 0;
Line 1806  rplinit(int argc, char *argv[], unsigned Line 3573  rplinit(int argc, char *argv[], unsigned
             (*s_etat_processus).var_volatile_traitement_sigint = 0;              (*s_etat_processus).var_volatile_traitement_sigint = 0;
             (*s_etat_processus).var_volatile_recursivite = 0;              (*s_etat_processus).var_volatile_recursivite = 0;
             (*s_etat_processus).var_volatile_exception_gsl = 0;              (*s_etat_processus).var_volatile_exception_gsl = 0;
               (*s_etat_processus).arret_depuis_abort = 0;
               (*s_etat_processus).pointeur_signal_lecture = 0;
               (*s_etat_processus).pointeur_signal_ecriture = 0;
   
             initialisation_allocateur(s_etat_processus);              initialisation_allocateur(s_etat_processus);
             initialisation_drapeaux(s_etat_processus);              initialisation_drapeaux(s_etat_processus);
               initialisation_variables(s_etat_processus);
               initialisation_instructions(s_etat_processus);
   
             if ((*s_etat_processus).erreur_systeme != d_es)              if ((*s_etat_processus).erreur_systeme != d_es)
             {              {
   #               ifndef SEMAPHORES_NOMMES
                       sem_post(&((*s_etat_processus).semaphore_fork));
                       sem_destroy(&((*s_etat_processus).semaphore_fork));
   #               else
                       sem_post((*s_etat_processus).semaphore_fork);
                       sem_destroy3((*s_etat_processus).semaphore_fork,
                               getpid(), pthread_self(), SEM_FORK);
   #               endif
   
                   liberation_contexte_cas(s_etat_processus);
                   destruction_queue_signaux(s_etat_processus);
   
   #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                       stackoverflow_deinstall_handler();
   #               endif
   
   #               ifdef HAVE_SIGSEGV_RECOVERY
                       if (debug == d_faux)
                       {
                           sigsegv_deinstall_handler();
                       }
   #               endif
   
                 if ((*s_etat_processus).langue == 'F')                  if ((*s_etat_processus).langue == 'F')
                 {                  {
                     printf("+++Système : Mémoire insuffisante\n");                      printf("+++Système : Mémoire insuffisante\n");
Line 1825  rplinit(int argc, char *argv[], unsigned Line 3620  rplinit(int argc, char *argv[], unsigned
             }              }
   
             if (((*s_etat_processus).instruction_derniere_erreur =              if (((*s_etat_processus).instruction_derniere_erreur =
                     malloc(2 * sizeof(unsigned char))) == NULL)                      malloc(sizeof(unsigned char))) == NULL)
             {              {
   #               ifndef SEMAPHORES_NOMMES
                       sem_post(&((*s_etat_processus).semaphore_fork));
                       sem_destroy(&((*s_etat_processus).semaphore_fork));
   #               else
                       sem_post((*s_etat_processus).semaphore_fork);
                       sem_destroy3((*s_etat_processus).semaphore_fork,
                               getpid(), pthread_self(), SEM_FORK);
   #               endif
   
                   liberation_contexte_cas(s_etat_processus);
                   destruction_queue_signaux(s_etat_processus);
   
   #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                       stackoverflow_deinstall_handler();
   #               endif
   
   #               ifdef HAVE_SIGSEGV_RECOVERY
                       if (debug == d_faux)
                       {
                           sigsegv_deinstall_handler();
                       }
   #               endif
   
                 erreur = d_es_allocation_memoire;                  erreur = d_es_allocation_memoire;
   
                 if ((*s_etat_processus).langue == 'F')                  if ((*s_etat_processus).langue == 'F')
Line 1856  rplinit(int argc, char *argv[], unsigned Line 3674  rplinit(int argc, char *argv[], unsigned
             if (((*s_etat_processus).instruction_courante = (unsigned char *)              if (((*s_etat_processus).instruction_courante = (unsigned char *)
                     malloc(sizeof(unsigned char))) == NULL)                      malloc(sizeof(unsigned char))) == NULL)
             {              {
   #               ifndef SEMAPHORES_NOMMES
                       sem_post(&((*s_etat_processus).semaphore_fork));
                       sem_destroy(&((*s_etat_processus).semaphore_fork));
   #               else
                       sem_post((*s_etat_processus).semaphore_fork);
                       sem_destroy3((*s_etat_processus).semaphore_fork,
                               getpid(), pthread_self(), SEM_FORK);
   #               endif
   
                   liberation_contexte_cas(s_etat_processus);
                   destruction_queue_signaux(s_etat_processus);
   
   #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                       stackoverflow_deinstall_handler();
   #               endif
   
   #               ifdef HAVE_SIGSEGV_RECOVERY
                       if (debug == d_faux)
                       {
                           sigsegv_deinstall_handler();
                       }
   #               endif
   
                 erreur = d_es_allocation_memoire;                  erreur = d_es_allocation_memoire;
   
                 if ((*s_etat_processus).langue == 'F')                  if ((*s_etat_processus).langue == 'F')
Line 1876  rplinit(int argc, char *argv[], unsigned Line 3717  rplinit(int argc, char *argv[], unsigned
   
             free((*s_etat_processus).instruction_courante);              free((*s_etat_processus).instruction_courante);
   
             if ((*s_etat_processus).erreur_systeme == d_es_allocation_memoire)              if ((*s_etat_processus).erreur_systeme != d_es)
             {              {
                 erreur = d_es_allocation_memoire;                  erreur = d_es_allocation_memoire;
             }              }
Line 1885  rplinit(int argc, char *argv[], unsigned Line 3726  rplinit(int argc, char *argv[], unsigned
                 (*((*s_etat_processus).l_base_pile_systeme))                  (*((*s_etat_processus).l_base_pile_systeme))
                         .retour_definition = 'Y';                          .retour_definition = 'Y';
   
                 (*s_etat_processus).indep = (struct_objet *) malloc(                  (*s_etat_processus).indep = allocation(s_etat_processus, NON);
                         sizeof(struct_objet));                  (*s_etat_processus).depend = allocation(s_etat_processus, NON);
                 (*s_etat_processus).depend = (struct_objet *) malloc(  
                         sizeof(struct_objet));  
                 (*s_etat_processus).parametres_courbes_de_niveau =                  (*s_etat_processus).parametres_courbes_de_niveau =
                         (struct_objet *) malloc(sizeof(struct_objet));                          allocation(s_etat_processus, NON);
   
                 if (((*s_etat_processus).indep != NULL) &&                  if (((*s_etat_processus).indep != NULL) &&
                         ((*s_etat_processus).depend != NULL) &&                          ((*s_etat_processus).depend != NULL) &&
Line 1920  rplinit(int argc, char *argv[], unsigned Line 3759  rplinit(int argc, char *argv[], unsigned
                             ((*((*s_etat_processus).                              ((*((*s_etat_processus).
                             parametres_courbes_de_niveau)).objet == NULL))                              parametres_courbes_de_niveau)).objet == NULL))
                     {                      {
   #                       ifndef SEMAPHORES_NOMMES
                               sem_post(&((*s_etat_processus).semaphore_fork));
                               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #                       else
                               sem_post((*s_etat_processus).semaphore_fork);
                               sem_destroy3((*s_etat_processus).semaphore_fork,
                                       getpid(), pthread_self(), SEM_FORK);
   #                       endif
   
                           liberation_contexte_cas(s_etat_processus);
                           destruction_queue_signaux(s_etat_processus);
   
   #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
                               stackoverflow_deinstall_handler();
   #                       endif
   
   #                       ifdef HAVE_SIGSEGV_RECOVERY
                               if (debug == d_faux)
                               {
                                   sigsegv_deinstall_handler();
                               }
   #                       endif
   
                         erreur = d_es_allocation_memoire;                          erreur = d_es_allocation_memoire;
                                                   
                         if ((*s_etat_processus).langue == 'F')                          if ((*s_etat_processus).langue == 'F')
Line 1944  rplinit(int argc, char *argv[], unsigned Line 3806  rplinit(int argc, char *argv[], unsigned
                             (*((*s_etat_processus).depend)).objet)).nom ==                              (*((*s_etat_processus).depend)).objet)).nom ==
                             NULL))                              NULL))
                     {                      {
   #                       ifndef SEMAPHORES_NOMMES
                               sem_post(&((*s_etat_processus).semaphore_fork));
                               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #                       else
                               sem_post((*s_etat_processus).semaphore_fork);
                               sem_destroy3((*s_etat_processus).semaphore_fork,
                                       getpid(), pthread_self(), SEM_FORK);
   #                       endif
   
                           liberation_contexte_cas(s_etat_processus);
                           destruction_queue_signaux(s_etat_processus);
   
   #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
                               stackoverflow_deinstall_handler();
   #                       endif
   
   #                       ifdef HAVE_SIGSEGV_RECOVERY
                               if (debug == d_faux)
                               {
                                   sigsegv_deinstall_handler();
                               }
   #                       endif
   
                         erreur = d_es_allocation_memoire;                          erreur = d_es_allocation_memoire;
   
                         if ((*s_etat_processus).langue == 'F')                          if ((*s_etat_processus).langue == 'F')
Line 1996  rplinit(int argc, char *argv[], unsigned Line 3881  rplinit(int argc, char *argv[], unsigned
                             .parametres_courbes_de_niveau)).objet)).donnee                              .parametres_courbes_de_niveau)).objet)).donnee
                             == NULL))                              == NULL))
                     {                      {
   #                       ifndef SEMAPHORES_NOMMES
                               sem_post(&((*s_etat_processus).semaphore_fork));
                               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #                       else
                               sem_post((*s_etat_processus).semaphore_fork);
                               sem_destroy3((*s_etat_processus).semaphore_fork,
                                       getpid(), pthread_self(), SEM_FORK);
   #                       endif
   
                           liberation_contexte_cas(s_etat_processus);
                           destruction_queue_signaux(s_etat_processus);
   
   #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
                               stackoverflow_deinstall_handler();
   #                       endif
   
   #                       ifdef HAVE_SIGSEGV_RECOVERY
                               if (debug == d_faux)
                               {
                                   sigsegv_deinstall_handler();
                               }
   #                       endif
   
                         erreur = d_es_allocation_memoire;                          erreur = d_es_allocation_memoire;
   
                         if ((*s_etat_processus).langue == 'F')                          if ((*s_etat_processus).langue == 'F')
Line 2024  rplinit(int argc, char *argv[], unsigned Line 3932  rplinit(int argc, char *argv[], unsigned
                             .objet = malloc(10 * sizeof(unsigned char)))                              .objet = malloc(10 * sizeof(unsigned char)))
                             == NULL)                              == NULL)
                     {                      {
   #                       ifndef SEMAPHORES_NOMMES
                               sem_post(&((*s_etat_processus).semaphore_fork));
                               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #                       else
                               sem_post((*s_etat_processus).semaphore_fork);
                               sem_destroy3((*s_etat_processus).semaphore_fork,
                                       getpid(), pthread_self(), SEM_FORK);
   #                       endif
   
                           liberation_contexte_cas(s_etat_processus);
                           destruction_queue_signaux(s_etat_processus);
   
   #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
                               stackoverflow_deinstall_handler();
   #                       endif
   
   #                       ifdef HAVE_SIGSEGV_RECOVERY
                               if (debug == d_faux)
                               {
                                   sigsegv_deinstall_handler();
                               }
   #                       endif
   
                         erreur = d_es_allocation_memoire;                          erreur = d_es_allocation_memoire;
   
                         if ((*s_etat_processus).langue == 'F')                          if ((*s_etat_processus).langue == 'F')
Line 2084  rplinit(int argc, char *argv[], unsigned Line 4015  rplinit(int argc, char *argv[], unsigned
                     (*s_etat_processus).my2_lines = d_faux;                      (*s_etat_processus).my2_lines = d_faux;
                     (*s_etat_processus).mz2_lines = d_faux;                      (*s_etat_processus).mz2_lines = d_faux;
   
                     if ((*s_etat_processus).erreur_systeme != d_es)  
                     {  
                         if ((*s_etat_processus).langue == 'F')  
                         {  
                             printf("+++Système : Mémoire insuffisante\n");  
                         }  
                         else  
                         {  
                             printf("+++System : Not enough memory\n");  
                         }  
   
                         return(EXIT_FAILURE);  
                     }  
   
                     (*s_etat_processus).mode_evaluation_expression = 'N';                      (*s_etat_processus).mode_evaluation_expression = 'N';
                     (*s_etat_processus).mode_execution_programme = 'Y';                      (*s_etat_processus).mode_execution_programme = 'Y';
   
Line 2106  rplinit(int argc, char *argv[], unsigned Line 4023  rplinit(int argc, char *argv[], unsigned
                         if ((erreur = chainage(s_etat_processus)) !=                          if ((erreur = chainage(s_etat_processus)) !=
                                 d_absence_erreur)                                  d_absence_erreur)
                         {                          {
   #                           ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                           else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_destroy3((*s_etat_processus).semaphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                           endif
   
                               liberation_contexte_cas(s_etat_processus);
                               destruction_queue_signaux(s_etat_processus);
   
   #                           ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                           endif
   
   #                           ifdef HAVE_SIGSEGV_RECOVERY
                                   if (debug == d_faux)
                                   {
                                       sigsegv_deinstall_handler();
                                   }
   #                           endif
   
                             if ((*s_etat_processus).langue == 'F')                              if ((*s_etat_processus).langue == 'F')
                             {                              {
                                 printf("+++Fatal :"                                  printf("+++Fatal :"
Line 2134  rplinit(int argc, char *argv[], unsigned Line 4075  rplinit(int argc, char *argv[], unsigned
                         }                          }
                     }                      }
   
                       /*
                        * Chargement des bibliothèques pour gérer des
                        * types externes lors des l'analyse syntaxique et
                        * compilation.
                        */
   
                       l_bibliotheque_courante = l_bibliotheques;
   
                       while(l_bibliotheque_courante != NULL)
                       {
                           if (empilement(s_etat_processus, &((*s_etat_processus)
                                   .l_base_pile), (*l_bibliotheque_courante)
                                   .donnee) == d_erreur)
                           {
   #                           ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                           else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_destroy3((*s_etat_processus).semaphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                           endif
   
                               liberation_contexte_cas(s_etat_processus);
                               destruction_queue_signaux(s_etat_processus);
   
   #                           ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                           endif
   
   #                           ifdef HAVE_SIGSEGV_RECOVERY
                                   if (debug == d_faux)
                                   {
                                       sigsegv_deinstall_handler();
                                   }
   #                           endif
   
                               if ((*s_etat_processus).langue == 'F')
                               {
                                   printf("+++Fatal :"
                                           " Chargement de la bibliothèse %s"
                                           " impossible\n", (unsigned char *)
                                           (*(*l_bibliotheque_courante).donnee)
                                           .objet);
                               }
                               else
                               {
                                   printf("+++Fatal : Cannot load library %s\n",
                                           (*(*l_bibliotheque_courante).donnee)
                                           .objet);
                               }
   
                               if (traitement_fichier_temporaire == 'Y')
                               {
                                   if (destruction_fichier(
                                           nom_fichier_temporaire)
                                           == d_erreur)
                                   {
                                       return(EXIT_FAILURE);
                                   }
   
                                   free(nom_fichier_temporaire);
                               }
   
                               return(EXIT_FAILURE);
                           }
   
                           instruction_use(s_etat_processus);
   
                           if (depilement(s_etat_processus, &((*s_etat_processus)
                                   .l_base_pile), &((*l_bibliotheque_courante)
                                   .donnee)) == d_erreur)
                           {
   #                           ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                           else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_destroy3((*s_etat_processus).semaphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                           endif
   
                               liberation_contexte_cas(s_etat_processus);
                               destruction_queue_signaux(s_etat_processus);
   
   #                           ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                           endif
   
   #                           ifdef HAVE_SIGSEGV_RECOVERY
                                   if (debug == d_faux)
                                   {
                                       sigsegv_deinstall_handler();
                                   }
   #                           endif
   
                               if ((*s_etat_processus).langue == 'F')
                               {
                                   printf("+++Fatal :"
                                           " Chargement de la bibliothèse %s"
                                           " impossible\n", (unsigned char *)
                                           (*(*l_bibliotheque_courante).donnee)
                                           .objet);
                               }
                               else
                               {
                                   printf("+++Fatal : Cannot load library %s\n",
                                           (*(*l_bibliotheque_courante).donnee)
                                           .objet);
                               }
   
                               if (traitement_fichier_temporaire == 'Y')
                               {
                                   if (destruction_fichier(
                                           nom_fichier_temporaire)
                                           == d_erreur)
                                   {
                                       return(EXIT_FAILURE);
                                   }
   
                                   free(nom_fichier_temporaire);
                               }
   
                               return(EXIT_FAILURE);
                           }
   
                           l_bibliotheque_courante =
                                   (*l_bibliotheque_courante).suivant;
                       }
   
                     if ((erreur = compilation(s_etat_processus)) !=                      if ((erreur = compilation(s_etat_processus)) !=
                             d_absence_erreur)                              d_absence_erreur)
                     {                      {
   #                       ifndef SEMAPHORES_NOMMES
                               sem_post(&((*s_etat_processus).semaphore_fork));
                               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #                       else
                               sem_post((*s_etat_processus).semaphore_fork);
                               sem_destroy3((*s_etat_processus).semaphore_fork,
                                       getpid(), pthread_self(), SEM_FORK);
   #                       endif
   
                           liberation_contexte_cas(s_etat_processus);
                           destruction_queue_signaux(s_etat_processus);
   
   #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
                               stackoverflow_deinstall_handler();
   #                       endif
   
   #                       ifdef HAVE_SIGSEGV_RECOVERY
                               if (debug == d_faux)
                               {
                                   sigsegv_deinstall_handler();
                               }
   #                       endif
   
                         if (traitement_fichier_temporaire == 'Y')                          if (traitement_fichier_temporaire == 'Y')
                         {                          {
                             if (destruction_fichier(nom_fichier_temporaire)                              if (destruction_fichier(nom_fichier_temporaire)
Line 2194  rplinit(int argc, char *argv[], unsigned Line 4290  rplinit(int argc, char *argv[], unsigned
                     (*s_etat_processus).position_courante = 0;                      (*s_etat_processus).position_courante = 0;
                     (*s_etat_processus).traitement_cycle_exit = 'N';                      (*s_etat_processus).traitement_cycle_exit = 'N';
   
                     if ((*s_etat_processus).nombre_variables == 0)                      if ((*s_etat_processus).s_arbre_variables == NULL)
                     {                      {
   #                       ifndef SEMAPHORES_NOMMES
                               sem_post(&((*s_etat_processus).semaphore_fork));
                               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #                       else
                               sem_post((*s_etat_processus).semaphore_fork);
                               sem_destroy3((*s_etat_processus).semaphore_fork,
                                       getpid(), pthread_self(), SEM_FORK);
   #                       endif
   
                           liberation_contexte_cas(s_etat_processus);
                           destruction_queue_signaux(s_etat_processus);
   
   #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
                               stackoverflow_deinstall_handler();
   #                       endif
   
   #                       ifdef HAVE_SIGSEGV_RECOVERY
                               if (debug == d_faux)
                               {
                                   sigsegv_deinstall_handler();
                               }
   #                       endif
   
                         if ((*s_etat_processus).langue == 'F')                          if ((*s_etat_processus).langue == 'F')
                         {                          {
                             printf("+++Fatal : Aucun point d'entrée\n");                              printf("+++Fatal : Aucun point d'entrée\n");
Line 2216  rplinit(int argc, char *argv[], unsigned Line 4335  rplinit(int argc, char *argv[], unsigned
                     if (recherche_instruction_suivante(s_etat_processus)                      if (recherche_instruction_suivante(s_etat_processus)
                             == d_erreur)                              == d_erreur)
                     {                      {
   #                       ifndef SEMAPHORES_NOMMES
                               sem_post(&((*s_etat_processus).semaphore_fork));
                               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #                       else
                               sem_post((*s_etat_processus).semaphore_fork);
                               sem_destroy3((*s_etat_processus).semaphore_fork,
                                       getpid(), pthread_self(), SEM_FORK);
   #                       endif
   
                           liberation_contexte_cas(s_etat_processus);
                           destruction_queue_signaux(s_etat_processus);
   
   #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
                               stackoverflow_deinstall_handler();
   #                       endif
   
   #                       ifdef HAVE_SIGSEGV_RECOVERY
                               if (debug == d_faux)
                               {
                                   sigsegv_deinstall_handler();
                               }
   #                       endif
   
                         if ((*s_etat_processus).langue == 'F')                          if ((*s_etat_processus).langue == 'F')
                         {                          {
                             printf("+++Fatal : Aucun point d'entrée\n");                              printf("+++Fatal : Aucun point d'entrée\n");
Line 2237  rplinit(int argc, char *argv[], unsigned Line 4379  rplinit(int argc, char *argv[], unsigned
                             (*s_etat_processus)                              (*s_etat_processus)
                             .instruction_courante) == d_faux)                              .instruction_courante) == d_faux)
                     {                      {
   #                       ifndef SEMAPHORES_NOMMES
                               sem_post(&((*s_etat_processus).semaphore_fork));
                               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #                       else
                               sem_post((*s_etat_processus).semaphore_fork);
                               sem_destroy3((*s_etat_processus).semaphore_fork,
                                       getpid(), pthread_self(), SEM_FORK);
   #                       endif
   
                           liberation_contexte_cas(s_etat_processus);
                           destruction_queue_signaux(s_etat_processus);
   
   #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
                               stackoverflow_deinstall_handler();
   #                       endif
   
   #                       ifdef HAVE_SIGSEGV_RECOVERY
                               if (debug == d_faux)
                               {
                                   sigsegv_deinstall_handler();
                               }
   #                       endif
   
                         if ((*s_etat_processus).langue == 'F')                          if ((*s_etat_processus).langue == 'F')
                         {                          {
                             printf("+++Fatal : Aucun point d'entrée\n");                              printf("+++Fatal : Aucun point d'entrée\n");
Line 2254  rplinit(int argc, char *argv[], unsigned Line 4419  rplinit(int argc, char *argv[], unsigned
                         return(EXIT_FAILURE);                          return(EXIT_FAILURE);
                     }                      }
   
                     if ((*s_etat_processus).s_liste_variables                      if ((*(*s_etat_processus).pointeur_variable_courante)
                             [(*s_etat_processus)                              .niveau != 0)
                             .position_variable_courante].niveau != 0)  
                     {                      {
   #                       ifndef SEMAPHORES_NOMMES
                               sem_post(&((*s_etat_processus).semaphore_fork));
                               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #                       else
                               sem_post((*s_etat_processus).semaphore_fork);
                               sem_destroy3((*s_etat_processus).semaphore_fork,
                                       getpid(), pthread_self(), SEM_FORK);
   #                       endif
   
                           liberation_contexte_cas(s_etat_processus);
                           destruction_queue_signaux(s_etat_processus);
   
   #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
                               stackoverflow_deinstall_handler();
   #                       endif
   
   #                       ifdef HAVE_SIGSEGV_RECOVERY
                               if (debug == d_faux)
                               {
                                   sigsegv_deinstall_handler();
                               }
   #                       endif
   
                         if ((*s_etat_processus).langue == 'F')                          if ((*s_etat_processus).langue == 'F')
                         {                          {
                             printf("+++Fatal : Aucun point d'entrée\n");                              printf("+++Fatal : Aucun point d'entrée\n");
Line 2283  rplinit(int argc, char *argv[], unsigned Line 4470  rplinit(int argc, char *argv[], unsigned
                             strlen(ds_fichier_historique) + 2) *                              strlen(ds_fichier_historique) + 2) *
                             sizeof(unsigned char))) == NULL)                              sizeof(unsigned char))) == NULL)
                     {                      {
   #                       ifndef SEMAPHORES_NOMMES
                               sem_post(&((*s_etat_processus).semaphore_fork));
                               sem_destroy(&((*s_etat_processus).semaphore_fork));
   #                       else
                               sem_post((*s_etat_processus).semaphore_fork);
                               sem_destroy3((*s_etat_processus).semaphore_fork,
                                       getpid(), pthread_self(), SEM_FORK);
   #                       endif
   
                           liberation_contexte_cas(s_etat_processus);
                           destruction_queue_signaux(s_etat_processus);
   
   #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
                               stackoverflow_deinstall_handler();
   #                       endif
   
   #                       ifdef HAVE_SIGSEGV_RECOVERY
                               if (debug == d_faux)
                               {
                                   sigsegv_deinstall_handler();
                               }
   #                       endif
   
                         erreur = d_es_allocation_memoire;                          erreur = d_es_allocation_memoire;
   
                         if ((*s_etat_processus).langue == 'F')                          if ((*s_etat_processus).langue == 'F')
Line 2301  rplinit(int argc, char *argv[], unsigned Line 4511  rplinit(int argc, char *argv[], unsigned
                             home, ds_fichier_historique);                              home, ds_fichier_historique);
   
                     using_history();                      using_history();
   
                       // Pour pouvoir utiliser le keymap avant le premier
                       // appel à readline().
                       rl_initialize();
   
                     erreur_historique = read_history(                      erreur_historique = read_history(
                             (*s_etat_processus).nom_fichier_historique);                              (*s_etat_processus).nom_fichier_historique);
   
Line 2310  rplinit(int argc, char *argv[], unsigned Line 4525  rplinit(int argc, char *argv[], unsigned
                     {                      {
                         (*s_etat_processus).erreur_systeme = d_es;                          (*s_etat_processus).erreur_systeme = d_es;
                         encart(s_etat_processus,                          encart(s_etat_processus,
                                 (unsigned long) (5 * 1000000));                                  (integer8) (5 * 1000000));
   
                         if ((*s_etat_processus).erreur_systeme != d_es)                          if ((*s_etat_processus).erreur_systeme != d_es)
                         {                          {
                             if ((message = messages(s_etat_processus))                              if ((message = messages(s_etat_processus))
                                     == NULL)                                      == NULL)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                               else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_destroy3((*s_etat_processus)
                                               .semaphore_fork,
                                               getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                               endif
   
   #                               ifdef HAVE_SIGSEGV_RECOVERY
                                       if (debug == d_faux)
                                       {
                                           sigsegv_deinstall_handler();
                                       }
   #                               endif
   
                                 erreur = d_es_allocation_memoire;                                  erreur = d_es_allocation_memoire;
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
Line 2342  rplinit(int argc, char *argv[], unsigned Line 4584  rplinit(int argc, char *argv[], unsigned
   
                     fflush(stdout);                      fflush(stdout);
   
                     initialisation_instructions(s_etat_processus);  
   
                     if (arguments != NULL)                      if (arguments != NULL)
                     {                      {
                         tampon = (*s_etat_processus).definitions_chainees;                          tampon = (*s_etat_processus).definitions_chainees;
Line 2355  rplinit(int argc, char *argv[], unsigned Line 4595  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if ((*s_etat_processus).erreur_systeme != d_es)                              if ((*s_etat_processus).erreur_systeme != d_es)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                               else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_destroy3((*s_etat_processus)
                                               .semaphore_fork,
                                               getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                               endif
   
   #                               ifdef HAVE_SIGSEGV_RECOVERY
                                       if (debug == d_faux)
                                       {
                                           sigsegv_deinstall_handler();
                                       }
   #                               endif
   
                                 erreur = d_es_allocation_memoire;                                  erreur = d_es_allocation_memoire;
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
Line 2372  rplinit(int argc, char *argv[], unsigned Line 4639  rplinit(int argc, char *argv[], unsigned
                             }                              }
                             else                              else
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                               else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_destroy3((*s_etat_processus)
                                               .semaphore_fork,
                                               getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                               endif
   
   #                               ifdef HAVE_SIGSEGV_RECOVERY
                                       if (debug == d_faux)
                                       {
                                           sigsegv_deinstall_handler();
                                       }
   #                               endif
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
                                 {                                  {
                                     printf("+++Erreur : Erreur de "                                      printf("+++Erreur : Erreur de "
Line 2391  rplinit(int argc, char *argv[], unsigned Line 4685  rplinit(int argc, char *argv[], unsigned
                         (*s_etat_processus).definitions_chainees = tampon;                          (*s_etat_processus).definitions_chainees = tampon;
                         (*s_etat_processus).position_courante = 0;                          (*s_etat_processus).position_courante = 0;
   
                           (*s_etat_processus).type_en_cours = NON;
                         recherche_type(s_etat_processus);                          recherche_type(s_etat_processus);
   
                         if ((*s_etat_processus).erreur_systeme != d_es)                          if ((*s_etat_processus).erreur_systeme != d_es)
                         {                          {
   #                           ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                           else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_destroy3((*s_etat_processus).semaphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                           endif
   
                               liberation_contexte_cas(s_etat_processus);
                               destruction_queue_signaux(s_etat_processus);
   
   #                           ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                           endif
   
   #                           ifdef HAVE_SIGSEGV_RECOVERY
                                   if (debug == d_faux)
                                   {
                                       sigsegv_deinstall_handler();
                                   }
   #                           endif
   
                             if ((message = messages(s_etat_processus))                              if ((message = messages(s_etat_processus))
                                     == NULL)                                      == NULL)
                             {                              {
Line 2425  rplinit(int argc, char *argv[], unsigned Line 4744  rplinit(int argc, char *argv[], unsigned
                             if ((message = messages(s_etat_processus))                              if ((message = messages(s_etat_processus))
                                     == NULL)                                      == NULL)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                               else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_destroy3((*s_etat_processus)
                                               .semaphore_fork,
                                               getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                               endif
   
   #                               ifdef HAVE_SIGSEGV_RECOVERY
                                       if (debug == d_faux)
                                       {
                                           sigsegv_deinstall_handler();
                                       }
   #                               endif
   
                                 erreur = d_es_allocation_memoire;                                  erreur = d_es_allocation_memoire;
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
Line 2444  rplinit(int argc, char *argv[], unsigned Line 4790  rplinit(int argc, char *argv[], unsigned
                             printf("%s [%d]\n", message, (int) getpid());                              printf("%s [%d]\n", message, (int) getpid());
                             free(message);                              free(message);
   
   #                           ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                           else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_destroy3((*s_etat_processus).semaphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                           endif
   
                               liberation_contexte_cas(s_etat_processus);
                               destruction_queue_signaux(s_etat_processus);
   
   #                           ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                           endif
   
   #                           ifdef HAVE_SIGSEGV_RECOVERY
                                   if (debug == d_faux)
                                   {
                                       sigsegv_deinstall_handler();
                                   }
   #                           endif
   
                             return(EXIT_FAILURE);                              return(EXIT_FAILURE);
                         }                          }
   
Line 2454  rplinit(int argc, char *argv[], unsigned Line 4824  rplinit(int argc, char *argv[], unsigned
                             if ((message = messages(s_etat_processus))                              if ((message = messages(s_etat_processus))
                                     == NULL)                                      == NULL)
                             {                              {
   #                               ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                               else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_destroy3((*s_etat_processus)
                                               .semaphore_fork,
                                               getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                               endif
   
   #                               ifdef HAVE_SIGSEGV_RECOVERY
                                       if (debug == d_faux)
                                       {
                                           sigsegv_deinstall_handler();
                                       }
   #                               endif
   
                                   erreur = d_es_allocation_memoire;
                                 erreur = d_es_allocation_memoire;                                  erreur = d_es_allocation_memoire;
   
                                 if ((*s_etat_processus).langue == 'F')                                  if ((*s_etat_processus).langue == 'F')
Line 2473  rplinit(int argc, char *argv[], unsigned Line 4871  rplinit(int argc, char *argv[], unsigned
                             printf("%s [%d]\n", message, (int) getpid());                              printf("%s [%d]\n", message, (int) getpid());
                             free(message);                              free(message);
   
   #                           ifndef SEMAPHORES_NOMMES
                                   sem_post(&((*s_etat_processus).semaphore_fork));
                                   sem_destroy(&((*s_etat_processus)
                                           .semaphore_fork));
   #                           else
                                   sem_post((*s_etat_processus).semaphore_fork);
                                   sem_destroy3((*s_etat_processus).semaphore_fork,
                                           getpid(), pthread_self(), SEM_FORK);
   #                           endif
   
                               liberation_contexte_cas(s_etat_processus);
                               destruction_queue_signaux(s_etat_processus);
   
   #                           ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                   stackoverflow_deinstall_handler();
   #                           endif
   
   #                           ifdef HAVE_SIGSEGV_RECOVERY
                                   if (debug == d_faux)
                                   {
                                       sigsegv_deinstall_handler();
                                   }
   #                           endif
   
                             return(EXIT_FAILURE);                              return(EXIT_FAILURE);
                         }                          }
   
                           empilement_pile_systeme(s_etat_processus);
   
                         if (evaluation(s_etat_processus, s_objet, 'E')                          if (evaluation(s_etat_processus, s_objet, 'E')
                                 == d_erreur)                                  == d_erreur)
                         {                          {
Line 2484  rplinit(int argc, char *argv[], unsigned Line 4908  rplinit(int argc, char *argv[], unsigned
                                 if ((message = messages(s_etat_processus))                                  if ((message = messages(s_etat_processus))
                                         == NULL)                                          == NULL)
                                 {                                  {
   #                                   ifndef SEMAPHORES_NOMMES
                                           sem_post(&((*s_etat_processus)
                                                   .semaphore_fork));
                                           sem_destroy(&((*s_etat_processus)
                                                   .semaphore_fork));
   #                                   else
                                           sem_post((*s_etat_processus)
                                                   .semaphore_fork);
                                           sem_destroy3((*s_etat_processus)
                                                   .semaphore_fork, getpid(),
                                                   pthread_self(), SEM_FORK);
   #                                   endif
   
                                       liberation_contexte_cas(s_etat_processus);
                                       destruction_queue_signaux(s_etat_processus);
   
   #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                           stackoverflow_deinstall_handler();
   #                                   endif
   
   #                                   ifdef HAVE_SIGSEGV_RECOVERY
                                           if (debug == d_faux)
                                           {
                                               sigsegv_deinstall_handler();
                                           }
   #                                   endif
   
                                     erreur = d_es_allocation_memoire;                                      erreur = d_es_allocation_memoire;
   
                                     if ((*s_etat_processus).langue == 'F')                                      if ((*s_etat_processus).langue == 'F')
Line 2504  rplinit(int argc, char *argv[], unsigned Line 4955  rplinit(int argc, char *argv[], unsigned
                                         (int) getpid());                                          (int) getpid());
                                 free(message);                                  free(message);
   
   #                               ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                               else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_destroy3((*s_etat_processus)
                                               .semaphore_fork,
                                               getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                               endif
   
   #                               ifdef HAVE_SIGSEGV_RECOVERY
                                       if (debug == d_faux)
                                       {
                                           sigsegv_deinstall_handler();
                                       }
   #                               endif
   
                                   erreur = d_es_allocation_memoire;
                                 return(EXIT_FAILURE);                                  return(EXIT_FAILURE);
                             }                              }
   
Line 2513  rplinit(int argc, char *argv[], unsigned Line 4992  rplinit(int argc, char *argv[], unsigned
                                 if ((message = messages(s_etat_processus))                                  if ((message = messages(s_etat_processus))
                                         == NULL)                                          == NULL)
                                 {                                  {
   #                                   ifndef SEMAPHORES_NOMMES
                                           sem_post(&((*s_etat_processus)
                                                   .semaphore_fork));
                                           sem_destroy(&((*s_etat_processus)
                                                   .semaphore_fork));
   #                                   else
                                           sem_post((*s_etat_processus)
                                                   .semaphore_fork);
                                           sem_destroy3((*s_etat_processus)
                                                   .semaphore_fork, getpid(),
                                                   pthread_self(), SEM_FORK);
   #                                   endif
   
                                       liberation_contexte_cas(s_etat_processus);
                                       destruction_queue_signaux(s_etat_processus);
   
   #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                           stackoverflow_deinstall_handler();
   #                                   endif
   
   #                                   ifdef HAVE_SIGSEGV_RECOVERY
                                           if (debug == d_faux)
                                           {
                                               sigsegv_deinstall_handler();
                                           }
   #                                   endif
   
                                     erreur = d_es_allocation_memoire;                                      erreur = d_es_allocation_memoire;
   
                                     if ((*s_etat_processus).langue == 'F')                                      if ((*s_etat_processus).langue == 'F')
Line 2533  rplinit(int argc, char *argv[], unsigned Line 5039  rplinit(int argc, char *argv[], unsigned
                                         (int) getpid());                                          (int) getpid());
                                 free(message);                                  free(message);
   
   #                               ifndef SEMAPHORES_NOMMES
                                       sem_post(&((*s_etat_processus)
                                               .semaphore_fork));
                                       sem_destroy(&((*s_etat_processus)
                                               .semaphore_fork));
   #                               else
                                       sem_post((*s_etat_processus)
                                               .semaphore_fork);
                                       sem_destroy3((*s_etat_processus)
                                               .semaphore_fork,
                                               getpid(), pthread_self(), SEM_FORK);
   #                               endif
   
                                   liberation_contexte_cas(s_etat_processus);
                                   destruction_queue_signaux(s_etat_processus);
   
   #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                       stackoverflow_deinstall_handler();
   #                               endif
   
   #                               ifdef HAVE_SIGSEGV_RECOVERY
                                       if (debug == d_faux)
                                       {
                                           sigsegv_deinstall_handler();
                                       }
   #                               endif
   
                                 return(EXIT_FAILURE);                                  return(EXIT_FAILURE);
                             }                              }
                         }                          }
Line 2543  rplinit(int argc, char *argv[], unsigned Line 5076  rplinit(int argc, char *argv[], unsigned
                         free(arguments);                          free(arguments);
                     }                      }
   
                     if (option_D == d_vrai)                      if (option_a == d_vrai)
                     {                      {
                         lancement_daemon(s_etat_processus);                          fprintf(stdout, "%s\n", (*s_etat_processus)
                                   .definitions_chainees);
                     }                      }
                       else
                     if (option_p == d_faux)  
                     {                      {
                         if (setjmp(contexte_initial) == 0)                          if (option_D == d_vrai)
                         {                          {
                             erreur = sequenceur(s_etat_processus);                              lancement_daemon(s_etat_processus);
                         }                          }
                     }  
                     else                          if (option_p == d_faux)
                     {  
                         if (setjmp(contexte_initial) == 0)  
                         {                          {
                             erreur = sequenceur_optimise(s_etat_processus);                              if (setjmp(contexte_initial) == 0)
                               {
                                   erreur = sequenceur(s_etat_processus);
   
                                   if (erreur == d_absence_erreur)
                                   {
                                       if (((*s_etat_processus)
                                               .arret_depuis_abort == 0) &&
                                               ((*s_etat_processus).at_exit
                                               != NULL))
                                       {
                                           // Permet de traiter ATEXIT
                                           // même après réception d'un SIGINT.
                                           (*s_etat_processus)
                                                   .var_volatile_alarme = 0;
                                           (*s_etat_processus)
                                                   .var_volatile_requete_arret = 0;
   
                                           if ((*s_etat_processus).profilage ==
                                                   d_vrai)
                                           {
                                               profilage(s_etat_processus,
                                                       "ATEXIT");
                                           }
   
                                           erreur = evaluation(s_etat_processus,
                                                   (*s_etat_processus).at_exit,
                                                   'E');
   
                                           if ((*s_etat_processus).profilage ==
                                                   d_vrai)
                                           {
                                               profilage(s_etat_processus, NULL);
                                           }
   
                                           if (((*s_etat_processus)
                                                   .erreur_execution != d_ex) ||
                                                   ((*s_etat_processus).exception
                                                   != d_ep) || ((*s_etat_processus)
                                                   .erreur_systeme != d_es))
                                           {
                                               printf("%s [%d]\n", message =
                                                       messages(s_etat_processus),
                                                       (int) getpid());
                                               free(message);
   
                                               if (test_cfsf(s_etat_processus, 51)
                                                       == d_faux)
                                               {
                                                   printf("%s", ds_beep);
                                               }
   
                                               if ((*s_etat_processus).core ==
                                                       d_vrai)
                                               {
                                                   printf("\n");
   
                                                   if ((*s_etat_processus).langue
                                                           == 'F')
                                                   {
                                                       printf("+++Information : Gé"
                                                               "nération du fichie"
                                                               "r rpl-core "
                                                               "[%d]\n", (int)
                                                               getpid());
                                                   }
                                                   else
                                                   {
                                                       printf("+++Information : Wr"
                                                               "iting rpl-core fil"
                                                               "e [%d]\n",
                                                               (int) getpid());
                                                   }
   
                                                   rplcore(s_etat_processus);
   
                                                   if ((*s_etat_processus).langue
                                                           == 'F')
                                                   {
                                                       printf("+++Information : Pr"
                                                               "ocessus tracé [%d]"
                                                               "\n",
                                                               (int) getpid());
                                                   }
                                                   else
                                                   {
                                                       printf("+++Information : Do"
                                                               "ne [%d]\n", (int)
                                                               getpid());
                                                   }
   
                                                   printf("\n");
                                                   fflush(stdout);
                                               }
                                           }
                                       }
                                   }
                               }
                         }                          }
                           else
                           {
                               if (setjmp(contexte_initial) == 0)
                               {
                                   erreur = sequenceur_optimise(s_etat_processus,
                                           l_bibliotheques);
   
                                   if (erreur == d_absence_erreur)
                                   {
                                       if (((*s_etat_processus)
                                               .arret_depuis_abort == 0) &&
                                               ((*s_etat_processus).at_exit
                                               != NULL))
                                       {
                                           // Permet de traiter ATEXIT
                                           // même après réception d'un SIGINT.
                                           (*s_etat_processus)
                                                   .var_volatile_alarme = 0;
                                           (*s_etat_processus)
                                                   .var_volatile_requete_arret = 0;
   
                                           if ((*s_etat_processus).profilage ==
                                                   d_vrai)
                                           {
                                               profilage(s_etat_processus,
                                                       "ATEXIT");
                                           }
   
                                           erreur = evaluation(s_etat_processus,
                                                   (*s_etat_processus).at_exit,
                                                   'E');
   
                                           if ((*s_etat_processus).profilage ==
                                                   d_vrai)
                                           {
                                               profilage(s_etat_processus, NULL);
                                           }
   
                                           if (((*s_etat_processus)
                                                   .erreur_execution != d_ex) ||
                                                   ((*s_etat_processus).exception
                                                   != d_ep) || ((*s_etat_processus)
                                                   .erreur_systeme != d_es))
                                           {
                                               printf("%s [%d]\n", message =
                                                       messages(s_etat_processus),
                                                       (int) getpid());
                                               free(message);
   
                                               if (test_cfsf(s_etat_processus, 51)
                                                       == d_faux)
                                               {
                                                   printf("%s", ds_beep);
                                               }
   
                                               if ((*s_etat_processus).core ==
                                                       d_vrai)
                                               {
                                                   printf("\n");
   
                                                   if ((*s_etat_processus).langue
                                                           == 'F')
                                                   {
                                                       printf("+++Information : Gé"
                                                               "nération du fichie"
                                                               "r rpl-core "
                                                               "[%d]\n", (int)
                                                               getpid());
                                                   }
                                                   else
                                                   {
                                                       printf("+++Information : Wr"
                                                               "iting rpl-core fil"
                                                               "e [%d]\n",
                                                               (int) getpid());
                                                   }
   
                                                   rplcore(s_etat_processus);
   
                                                   if ((*s_etat_processus).langue
                                                           == 'F')
                                                   {
                                                       printf("+++Information : Pr"
                                                               "ocessus tracé [%d]"
                                                               "\n",
                                                               (int) getpid());
                                                   }
                                                   else
                                                   {
                                                       printf("+++Information : Do"
                                                               "ne [%d]\n", (int)
                                                               getpid());
                                                   }
   
                                                   printf("\n");
                                                   fflush(stdout);
                                               }
                                           }
                                       }
                                   }
                               }
                           }
                       }
   
                       for(i = 0; i < (*s_etat_processus).sections_critiques; i++)
                       {
                           pthread_mutex_unlock(&mutex_sections_critiques);
                     }                      }
   
                       liberation(s_etat_processus, (*s_etat_processus).at_exit);
                       liberation(s_etat_processus, (*s_etat_processus).at_poke);
   
                     if ((*s_etat_processus).generateur_aleatoire != NULL)                      if ((*s_etat_processus).generateur_aleatoire != NULL)
                     {                      {
                         liberation_generateur_aleatoire(s_etat_processus);                          liberation_generateur_aleatoire(s_etat_processus);
Line 2571  rplinit(int argc, char *argv[], unsigned Line 5309  rplinit(int argc, char *argv[], unsigned
                     l_element_courant = (*s_etat_processus).liste_mutexes;                      l_element_courant = (*s_etat_processus).liste_mutexes;
                     while(l_element_courant != NULL)                      while(l_element_courant != NULL)
                     {                      {
                         pthread_mutex_trylock(&((*((struct_mutex *)  
                                 (*(*((struct_liste_chainee *)  
                                 l_element_courant)).donnee).objet)).mutex));  
                         pthread_mutex_unlock(&((*((struct_mutex *)  
                                 (*(*((struct_liste_chainee *)  
                                 l_element_courant)).donnee).objet)).mutex));  
                         pthread_mutex_destroy(&((*((struct_mutex *)  
                                 (*(*((struct_liste_chainee *)  
                                 l_element_courant)).donnee).objet)).mutex));  
   
                         liberation(s_etat_processus,                          liberation(s_etat_processus,
                                 (*((struct_liste_chainee *)                                  (*((struct_liste_chainee *)
                                 l_element_courant)).donnee);                                  l_element_courant)).donnee);
Line 2599  rplinit(int argc, char *argv[], unsigned Line 5327  rplinit(int argc, char *argv[], unsigned
                         pthread_cancel((*s_etat_processus).thread_fusible);                          pthread_cancel((*s_etat_processus).thread_fusible);
                     }                      }
   
                     pthread_mutex_lock(&((*s_etat_processus).mutex));                      pthread_mutex_lock(&((*s_etat_processus)
                               .mutex_pile_processus));
   
                     l_element_courant = (void *) (*s_etat_processus)                      l_element_courant = (void *) (*s_etat_processus)
                             .l_base_pile_processus;                              .l_base_pile_processus;
Line 2672  rplinit(int argc, char *argv[], unsigned Line 5401  rplinit(int argc, char *argv[], unsigned
                         {                          {
                             if ((*s_etat_processus).var_volatile_alarme != 0)                              if ((*s_etat_processus).var_volatile_alarme != 0)
                             {                              {
                                 kill((*(*((struct_processus_fils *)                                  envoi_signal_processus(
                                           (*(*((struct_processus_fils *)
                                         (*(*((struct_liste_chainee *)                                          (*(*((struct_liste_chainee *)
                                         l_element_courant)).donnee).objet))                                          l_element_courant)).donnee).objet))
                                         .thread).pid, SIGURG);                                          .thread).pid, rpl_sigurg, d_faux);
                             }                              }
                             else                              else
                             {                              {
                                 kill((*(*((struct_processus_fils *)                                  if ((*s_etat_processus).arret_depuis_abort
                                         (*(*((struct_liste_chainee *)                                          == -1)
                                         l_element_courant)).donnee).objet))                                  {
                                         .thread).pid, SIGFSTOP);                                      envoi_signal_processus(
                                               (*(*((struct_processus_fils *)
                                               (*(*((struct_liste_chainee *)
                                               l_element_courant)).donnee).objet))
                                               .thread).pid, rpl_sigabort, d_faux);
                                   }
                                   else
                                   {
                                       envoi_signal_processus(
                                               (*(*((struct_processus_fils *)
                                               (*(*((struct_liste_chainee *)
                                               l_element_courant)).donnee).objet))
                                               .thread).pid, rpl_sigstop, d_faux);
                                   }
                             }                              }
                         }                          }
                         else                          else
Line 2700  rplinit(int argc, char *argv[], unsigned Line 5443  rplinit(int argc, char *argv[], unsigned
                                 if ((*s_etat_processus).var_volatile_alarme                                  if ((*s_etat_processus).var_volatile_alarme
                                         != 0)                                          != 0)
                                 {                                  {
                                     pthread_kill((*(*((struct_processus_fils *)                                      envoi_signal_thread(s_etat_processus,
                                               (*(*((struct_processus_fils *)
                                             (*(*((struct_liste_chainee *)                                              (*(*((struct_liste_chainee *)
                                             l_element_courant)).donnee).objet))                                              l_element_courant)).donnee).objet))
                                             .thread).tid, SIGURG);                                              .thread).tid, rpl_sigurg);
                                 }                                  }
                                 else                                  else
                                 {                                  {
                                     pthread_kill((*(*((struct_processus_fils *)                                      if ((*s_etat_processus).arret_depuis_abort
                                             (*(*((struct_liste_chainee *)                                              == -1)
                                             l_element_courant)).donnee).objet))                                      {
                                             .thread).tid, SIGFSTOP);                                          envoi_signal_thread(s_etat_processus,
                                                   (*(*((struct_processus_fils *)
                                                   (*(*((struct_liste_chainee *)
                                                   l_element_courant)).donnee)
                                                   .objet)).thread).tid,
                                                   rpl_sigabort);
                                       }
                                       else
                                       {
                                           envoi_signal_thread(s_etat_processus,
                                                   (*(*((struct_processus_fils *)
                                                   (*(*((struct_liste_chainee *)
                                                   l_element_courant)).donnee)
                                                   .objet)).thread).tid,
                                                   rpl_sigstop);
                                       }
                                 }                                  }
                             }                              }
   
Line 2738  rplinit(int argc, char *argv[], unsigned Line 5497  rplinit(int argc, char *argv[], unsigned
   
                     while((*s_etat_processus).l_base_pile_processus != NULL)                      while((*s_etat_processus).l_base_pile_processus != NULL)
                     {                      {
                         status = 0;  
   
                         l_element_courant = (void *)                          l_element_courant = (void *)
                                 (*s_etat_processus).l_base_pile_processus;                                  (*s_etat_processus).l_base_pile_processus;
   
                         if ((*s_etat_processus)                          for(i = 0; i < (*(*((struct_processus_fils *)
                                 .nombre_interruptions_non_affectees != 0)  
                         {  
                             affectation_interruptions_logicielles(  
                                     s_etat_processus);  
                         }  
   
                         for(i = 0; i < (unsigned long)  
                                 (*(*((struct_processus_fils *)  
                                 (*(*((struct_liste_chainee *)                                  (*(*((struct_liste_chainee *)
                                 l_element_courant)).donnee).objet)).thread)                                  l_element_courant)).donnee).objet)).thread)
                                 .nombre_objets_dans_pipe; i++)                                  .nombre_objets_dans_pipe; i++)
Line 2771  rplinit(int argc, char *argv[], unsigned Line 5520  rplinit(int argc, char *argv[], unsigned
                                         .thread).nombre_objets_dans_pipe--;                                          .thread).nombre_objets_dans_pipe--;
   
                                 action.sa_handler = SIG_IGN;                                  action.sa_handler = SIG_IGN;
                                 action.sa_flags = SA_ONSTACK;                                  action.sa_flags = 0;
   
                                 if (sigaction(SIGPIPE, &action, &registre)                                  if (sigaction(SIGPIPE, &action, &registre)
                                         != 0)                                          != 0)
                                 {                                  {
                                     pthread_mutex_unlock(  #                                   ifndef SEMAPHORES_NOMMES
                                             &((*s_etat_processus).mutex));                                          sem_post(&((*s_etat_processus)
                                                   .semaphore_fork));
                                           sem_destroy(&((*s_etat_processus)
                                                   .semaphore_fork));
   #                                   else
                                           sem_post((*s_etat_processus)
                                                   .semaphore_fork);
                                           sem_destroy3((*s_etat_processus)
                                                   .semaphore_fork, getpid(),
                                                   pthread_self(), SEM_FORK);
   #                                   endif
   
                                       liberation_contexte_cas(s_etat_processus);
                                       destruction_queue_signaux(s_etat_processus);
   
   #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                           stackoverflow_deinstall_handler();
   #                                   endif
   
   #                                   ifdef HAVE_SIGSEGV_RECOVERY
                                           if (debug == d_faux)
                                           {
                                               sigsegv_deinstall_handler();
                                           }
   #                                   endif
   
                                       pthread_mutex_unlock(&((*s_etat_processus)
                                               .mutex_pile_processus));
                                     return(EXIT_FAILURE);                                      return(EXIT_FAILURE);
                                 }                                  }
   
Line 2800  rplinit(int argc, char *argv[], unsigned Line 5576  rplinit(int argc, char *argv[], unsigned
                                 if (sigaction(SIGPIPE, &registre, NULL)                                  if (sigaction(SIGPIPE, &registre, NULL)
                                         != 0)                                          != 0)
                                 {                                  {
                                     pthread_mutex_unlock(  #                                   ifndef SEMAPHORES_NOMMES
                                             &((*s_etat_processus).mutex));                                          sem_post(&((*s_etat_processus)
                                                   .semaphore_fork));
                                           sem_destroy(&((*s_etat_processus)
                                                   .semaphore_fork));
   #                                   else
                                           sem_post((*s_etat_processus)
                                                   .semaphore_fork);
                                           sem_destroy3((*s_etat_processus)
                                                   .semaphore_fork, getpid(),
                                                   pthread_self(), SEM_FORK);
   #                                   endif
   
                                       liberation_contexte_cas(s_etat_processus);
                                       destruction_queue_signaux(s_etat_processus);
   
   #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
                                           stackoverflow_deinstall_handler();
   #                                   endif
   
   #                                   ifdef HAVE_SIGSEGV_RECOVERY
                                           if (debug == d_faux)
                                           {
                                               sigsegv_deinstall_handler();
                                           }
   #                                   endif
   
                                       pthread_mutex_unlock(&((*s_etat_processus)
                                               .mutex_pile_processus));
                                     return(EXIT_FAILURE);                                      return(EXIT_FAILURE);
                                 }                                  }
                             }                              }
                         }                          }
   
                         pthread_mutex_unlock(&((*s_etat_processus).mutex));                          pthread_mutex_lock(&((*s_etat_processus)
                                   .mutex_interruptions));
   
                           if ((*s_etat_processus)
                                   .nombre_interruptions_non_affectees != 0)
                           {
                               affectation_interruptions_logicielles(
                                       s_etat_processus);
                           }
   
                           pthread_mutex_unlock(&((*s_etat_processus)
                                   .mutex_interruptions));
                           pthread_mutex_unlock(&((*s_etat_processus)
                                   .mutex_pile_processus));
                         nanosleep(&attente, NULL);                          nanosleep(&attente, NULL);
                         pthread_mutex_lock(&((*s_etat_processus).mutex));                          scrutation_interruptions(s_etat_processus);
                           pthread_mutex_lock(&((*s_etat_processus)
                                   .mutex_pile_processus));
                     }                      }
   
                     pthread_mutex_unlock(&((*s_etat_processus).mutex));                      pthread_mutex_unlock(&((*s_etat_processus)
                               .mutex_pile_processus));
   
                     erreur_historique = write_history(                      erreur_historique = write_history(
                             (*s_etat_processus).nom_fichier_historique);                              (*s_etat_processus).nom_fichier_historique);
Line 2962  rplinit(int argc, char *argv[], unsigned Line 5781  rplinit(int argc, char *argv[], unsigned
                      * le libérer...                       * le libérer...
                      */                       */
   
                     for(i = 0; i < (*s_etat_processus).nombre_variables; i++)                      liberation_arbre_variables_partagees(s_etat_processus,
                     {                              (*(*s_etat_processus).s_arbre_variables_partagees));
                         liberation(s_etat_processus,                      liberation_arbre_variables(s_etat_processus,
                                 (*s_etat_processus).s_liste_variables[i].objet);                              (*s_etat_processus).s_arbre_variables, d_vrai);
                         free((*s_etat_processus).s_liste_variables[i].nom);                      free((*s_etat_processus).pointeurs_caracteres_variables);
                     }  
   
                     free((*s_etat_processus).s_liste_variables);                      l_element_statique_courant = (*s_etat_processus)
                               .l_liste_variables_statiques;
   
                     for(i = 0; i < (*s_etat_processus)                      while(l_element_statique_courant != NULL)
                             .nombre_variables_statiques; i++)  
                     {                      {
                         liberation(s_etat_processus, (*s_etat_processus)                          l_element_statique_suivant =
                                 .s_liste_variables_statiques[i].objet);                              (*l_element_statique_courant).suivant;
                         free((*s_etat_processus)                          free(l_element_statique_courant);
                                 .s_liste_variables_statiques[i].nom);                          l_element_statique_courant = l_element_statique_suivant;
                     }                      }
   
                     free((*s_etat_processus).s_liste_variables_statiques);                      l_element_partage_courant = (*(*s_etat_processus)
                               .l_liste_variables_partagees);
   
                     for(i = 0; i < (*((*s_etat_processus)                      while(l_element_partage_courant != NULL)
                             .s_liste_variables_partagees)).nombre_variables;  
                             i++)  
                     {                      {
                         liberation(s_etat_processus, (*((*s_etat_processus)                          l_element_partage_suivant =
                                 .s_liste_variables_partagees)).table[i].objet);                                  (*l_element_partage_courant).suivant;
                         free((*((*s_etat_processus)                          free(l_element_partage_courant);
                                 .s_liste_variables_partagees)).table[i].nom);                          l_element_partage_courant = l_element_partage_suivant;
                     }                      }
   
                     free((struct_variable_partagee *)  
                             (*((*s_etat_processus).s_liste_variables_partagees))  
                             .table);  
   
                     /*                      /*
                      * Si resultats est non nul, rplinit a été appelé                       * Si resultats est non nul, rplinit a été appelé
                      * depuis rpl() [librpl] et non main().                       * depuis rpl() [librpl] et non main().
Line 3008  rplinit(int argc, char *argv[], unsigned Line 5821  rplinit(int argc, char *argv[], unsigned
                     {                      {
                         if ((*resultats) != NULL)                          if ((*resultats) != NULL)
                         {                          {
                             free((*resultats));                              sys_free((*resultats));
   
                             if (((*resultats) = malloc(((*s_etat_processus)                              if (((*resultats) = sys_malloc(((size_t)
                                     .hauteur_pile_operationnelle + 1)                                      ((*s_etat_processus)
                                       .hauteur_pile_operationnelle + 1))
                                     * sizeof(unsigned char **))) != NULL)                                      * sizeof(unsigned char **))) != NULL)
                             {                              {
                                 (*resultats)[(*s_etat_processus)                                  (*resultats)[(*s_etat_processus)
Line 3096  rplinit(int argc, char *argv[], unsigned Line 5910  rplinit(int argc, char *argv[], unsigned
                         l_element_courant = l_element_suivant;                          l_element_courant = l_element_suivant;
                     }                      }
   
                     for(i = 0; i < (*s_etat_processus)  
                             .nombre_instructions_externes; i++)  
                     {  
                         free((*s_etat_processus).s_instructions_externes[i]  
                                 .nom);  
                         free((*s_etat_processus).s_instructions_externes[i]  
                                 .nom_bibliotheque);  
                     }  
   
                     if ((*s_etat_processus).nombre_instructions_externes != 0)  
                     {  
                         free((*s_etat_processus).s_instructions_externes);  
                     }  
   
                     l_element_courant = (void *) (*s_etat_processus)  
                             .s_bibliotheques;  
                       
                     while(l_element_courant != NULL)  
                     {  
                         l_element_suivant = (*((struct_liste_chainee *)  
                                 l_element_courant)).suivant;  
   
                         free((*((struct_bibliotheque *)  
                                 (*((struct_liste_chainee *)  
                                 l_element_courant)).donnee)).nom);  
                         dlclose((*((struct_bibliotheque *)  
                                 (*((struct_liste_chainee *)  
                                 l_element_courant)).donnee)).descripteur);  
                         free((*((struct_liste_chainee *) l_element_courant))  
                                 .donnee);  
                         free(l_element_courant);  
   
                         l_element_courant = l_element_suivant;  
                     }  
   
                     l_element_courant = (void *) (*s_etat_processus)                      l_element_courant = (void *) (*s_etat_processus)
                             .l_base_pile_last;                              .l_base_pile_last;
                     while(l_element_courant != NULL)                      while(l_element_courant != NULL)
Line 3146  rplinit(int argc, char *argv[], unsigned Line 5925  rplinit(int argc, char *argv[], unsigned
                         l_element_courant = l_element_suivant;                          l_element_courant = l_element_suivant;
                     }                      }
   
                       while((*s_etat_processus).s_bibliotheques != NULL)
                       {
                           retrait_bibliotheque(s_etat_processus,
                                   (struct_bibliotheque *)
                                   (*((struct_liste_chainee *)
                                   (*s_etat_processus).s_bibliotheques)).donnee);
                       }
   
                     l_element_courant = (void *) (*s_etat_processus)                      l_element_courant = (void *) (*s_etat_processus)
                             .l_base_pile_systeme;                              .l_base_pile_systeme;
                     while(l_element_courant != NULL)                      while(l_element_courant != NULL)
Line 3186  rplinit(int argc, char *argv[], unsigned Line 5973  rplinit(int argc, char *argv[], unsigned
                         fclose((*((struct_descripteur_fichier *)                          fclose((*((struct_descripteur_fichier *)
                                 (*((struct_liste_chainee *)                                  (*((struct_liste_chainee *)
                                 l_element_courant)).donnee))                                  l_element_courant)).donnee))
                                 .descripteur);                                  .descripteur_c);
   
                           if ((*((struct_descripteur_fichier *)
                                   (*((struct_liste_chainee *)
                                   l_element_courant)).donnee)).type != 'C')
                           {
                               sqlite3_close((*((struct_descripteur_fichier *)
                                       (*((struct_liste_chainee *)
                                       l_element_courant)).donnee))
                                       .descripteur_sqlite);
                           }
   
                         if ((*((struct_descripteur_fichier *)                          if ((*((struct_descripteur_fichier *)
                                 (*((struct_liste_chainee *)                                  (*((struct_liste_chainee *)
Line 3267  rplinit(int argc, char *argv[], unsigned Line 6064  rplinit(int argc, char *argv[], unsigned
                         l_element_courant = l_element_suivant;                          l_element_courant = l_element_suivant;
                     }                      }
   
                     free((*s_etat_processus).chemin_fichiers_temporaires);  
   
                     l_element_courant = (*s_etat_processus).s_marques;                      l_element_courant = (*s_etat_processus).s_marques;
                     while(l_element_courant != NULL)                      while(l_element_courant != NULL)
                     {                      {
Line 3305  rplinit(int argc, char *argv[], unsigned Line 6100  rplinit(int argc, char *argv[], unsigned
   
         if (traitement_fichier_temporaire == 'Y')          if (traitement_fichier_temporaire == 'Y')
         {          {
             if (destruction_fichier(nom_fichier_temporaire) == d_erreur)              destruction_fichier(nom_fichier_temporaire);
             {  
                 return(EXIT_FAILURE);  
             }  
   
             free(nom_fichier_temporaire);              free(nom_fichier_temporaire);
         }          }
   
Line 3320  rplinit(int argc, char *argv[], unsigned Line 6111  rplinit(int argc, char *argv[], unsigned
         }          }
     }      }
   
     free((*s_etat_processus).pile_signal.ss_sp);  
     closelog();      closelog();
   
     pthread_mutex_destroy(&((*s_etat_processus).protection_liste_mutexes));      pthread_mutex_destroy(&((*s_etat_processus).protection_liste_mutexes));
     pthread_mutex_destroy(&((*((*s_etat_processus).s_liste_variables_partagees))  
             .mutex));  
   
     retrait_thread(s_etat_processus);      retrait_thread(s_etat_processus);
   
     pthread_mutex_destroy(&((*s_etat_processus).mutex));      attente.tv_sec = 0;
       attente.tv_nsec = GRANULARITE_us * 1000;
   
       pthread_mutex_lock(&((*s_etat_processus).mutex_pile_processus));
   
       while(nombre_threads_surveillance_processus != 0)
       {
           pthread_mutex_unlock(&((*s_etat_processus).mutex_pile_processus));
           nanosleep(&attente, NULL);
           INCR_GRANULARITE(attente.tv_nsec);
           pthread_mutex_lock(&((*s_etat_processus).mutex_pile_processus));
       }
   
       pthread_mutex_unlock(&((*s_etat_processus).mutex_pile_processus));
   
       attente.tv_sec = 0;
       attente.tv_nsec = GRANULARITE_us * 1000;
   
       while(pthread_mutex_trylock(&((*s_etat_processus).mutex_pile_processus))
               == EBUSY)
       {
           nanosleep(&attente, NULL);
           INCR_GRANULARITE(attente.tv_nsec);
       }
   
       pthread_mutex_unlock(&((*s_etat_processus).mutex_pile_processus));
       pthread_mutex_destroy(&((*s_etat_processus).mutex_pile_processus));
       pthread_mutex_destroy(&((*s_etat_processus).mutex_allocation));
       pthread_mutex_destroy(&((*s_etat_processus).mutex_interruptions));
       pthread_mutex_destroy(&mutex_sections_critiques);
       pthread_mutex_destroy(&mutex_liste_variables_partagees);
   
       free((*s_etat_processus).localisation);
   
       destruction_queue_signaux(s_etat_processus);
       pthread_mutex_destroy(&((*s_etat_processus).mutex_signaux));
       liberation_contexte_cas(s_etat_processus);
   
   #   ifndef SEMAPHORES_NOMMES
     sem_post(&((*s_etat_processus).semaphore_fork));      sem_post(&((*s_etat_processus).semaphore_fork));
     sem_destroy(&((*s_etat_processus).semaphore_fork));      sem_destroy(&((*s_etat_processus).semaphore_fork));
   #   else
       sem_post((*s_etat_processus).semaphore_fork);
       sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(),
               SEM_FORK);
   #   endif
   
     free((*s_etat_processus).localisation);      free((*s_etat_processus).chemin_fichiers_temporaires);
     free(s_etat_processus);  
       if ((*s_etat_processus).requete_redemarrage == d_vrai)
       {
           if (chdir(repertoire_initial) == 0)
           {
               execvp(arg_exec[0], &(arg_exec[0]));
           }
   
     sem_destroy(&semaphore_liste_threads);          erreur = d_erreur;
     sem_post(&semaphore_gestionnaires_signaux);      }
     sem_destroy(&semaphore_gestionnaires_signaux);  
     sem_destroy(&semaphore_gestionnaires_signaux_atomique);      liberation_etat_processus_readline();
   
       liberation_allocateur_buffer(s_etat_processus);
       pthread_mutex_destroy(&((*s_etat_processus).mutex_allocation_buffer));
       pthread_mutex_destroy(&mutex_liste_threads);
       pthread_mutex_destroy(&mutex_liste_threads_surveillance);
       pthread_mutex_destroy(&mutex_sigaction);
   
       sys_free(s_etat_processus);
       sys_free(arg_exec);
   
 #   ifdef DEBUG_MEMOIRE  #   ifdef DEBUG_MEMOIRE
     debug_memoire_verification(s_etat_processus);      debug_memoire_verification();
       analyse_post_mortem();
 #   endif  #   endif
   
     return((erreur == d_os) ? EXIT_SUCCESS : EXIT_FAILURE);  #   ifdef HAVE_STACK_OVERFLOW_RECOVERY
       stackoverflow_deinstall_handler();
   #   endif
   
   #   ifdef HAVE_SIGSEGV_RECOVERY
       if (debug == d_faux)
       {
           sigsegv_deinstall_handler();
       }
   #   endif
   
       return((erreur == d_absence_erreur) ? EXIT_SUCCESS : EXIT_FAILURE);
 }  }
   
   
Line 3357  informations(struct_processus *s_etat_pr Line 6215  informations(struct_processus *s_etat_pr
     if ((*s_etat_processus).langue == 'F')      if ((*s_etat_processus).langue == 'F')
     {      {
         printf("  rpl [-options] [programme]\n");          printf("  rpl [-options] [programme]\n");
         printf("      -a : informations sur l'auteur\n");          printf("      -a : analyse du code\n");
         printf("      -A : paramètres passés au programme principal\n");          printf("      -A : paramètres passés au programme principal\n");
         printf("      -c : génération de fichier de débogage (rpl-core)\n");          printf("      -c : génération de fichier de débogage (rpl-core)\n");
         printf("      -d : option de déverminage interne\n");          printf("      -d : option de déverminage interne\n");
Line 3366  informations(struct_processus *s_etat_pr Line 6224  informations(struct_processus *s_etat_pr
         printf("      -i : fonctionnement interactif\n");          printf("      -i : fonctionnement interactif\n");
         printf("      -l : licence d'utilisation\n");          printf("      -l : licence d'utilisation\n");
         printf("      -n : ignorance du signal HUP\n");          printf("      -n : ignorance du signal HUP\n");
           printf("      -m : chargement d'un module RPL/SO avant la "
                   "compilation\n");
         printf("      -p : précompilation du script avant exécution\n");          printf("      -p : précompilation du script avant exécution\n");
         printf("      -P : profilage\n");          printf("      -P : profilage (-P ou -PP)\n");
         printf("      -s : empêchement de l'ouverture de l'écran initial\n");          printf("      -s : empêchement de l'ouverture de l'écran initial\n");
         printf("      -S : exécution du script passé en ligne de commande\n");          printf("      -S : exécution du script passé en ligne de commande\n");
         printf("      -t : trace\n");          printf("      -t : trace\n");
Line 3376  informations(struct_processus *s_etat_pr Line 6236  informations(struct_processus *s_etat_pr
     else      else
     {      {
         printf("  rpl [-options] [program]\n");          printf("  rpl [-options] [program]\n");
         printf("      -a : displays informations about the author\n");          printf("      -a : analyzes program\n");
         printf("      -A : sends parameters to main program\n");          printf("      -A : sends parameters to main program\n");
         printf("      -c : allows creation of a rpl-core file, providing a way"          printf("      -c : allows creation of a rpl-core file, providing a way"
                 "\n"                  "\n"
Line 3387  informations(struct_processus *s_etat_pr Line 6247  informations(struct_processus *s_etat_pr
         printf("      -i : runs the RPL/2 sequencer in interactive mode\n");          printf("      -i : runs the RPL/2 sequencer in interactive mode\n");
         printf("      -l : prints the user licence of the software\n");          printf("      -l : prints the user licence of the software\n");
         printf("      -n : ignores HUP signal\n");          printf("      -n : ignores HUP signal\n");
           printf("      -m : loads RPL/SO object before compilation\n");
         printf("      -p : precompiles script\n");          printf("      -p : precompiles script\n");
         printf("      -P : computes profile data\n");          printf("      -P : computes profile data (-P or -PP)\n");
         printf("      -s : disables splash screen\n");          printf("      -s : disables splash screen\n");
         printf("      -S : executes script written in command line\n");          printf("      -S : executes script written in command line\n");
         printf("      -t : enables tracing mode\n");          printf("      -t : enables tracing mode\n");
Line 3400  informations(struct_processus *s_etat_pr Line 6261  informations(struct_processus *s_etat_pr
     return;      return;
 }  }
   
   
   logical1
   controle_integrite(struct_processus *s_etat_processus,
           unsigned char *executable_candidat, unsigned char *executable)
   {
       unsigned char       *md5;
       unsigned char       *sha1;
   
       if (strcmp(executable, "rplpp") == 0)
       {
           md5 = rplpp_md5;
           sha1 = rplpp_sha1;
       }
       else if (strcmp(executable, "rplfile") == 0)
       {
           md5 = rplfile_md5;
           sha1 = rplfile_sha1;
       }
       else if (strcmp(executable, "rpliconv") == 0)
       {
           md5 = rpliconv_md5;
           sha1 = rpliconv_sha1;
       }
       else if (strcmp(executable, "rplawk") == 0)
       {
           md5 = rplawk_md5;
           sha1 = rplawk_sha1;
       }
       else if (strcmp(executable, "rplconvert") == 0)
       {
           md5 = rplconvert_md5;
           sha1 = rplconvert_sha1;
       }
       else
       {
           return(d_faux);
       }
   
       if (controle(s_etat_processus, executable_candidat, "md5", md5) != d_vrai)
       {
           return(d_faux);
       }
   
       if (controle(s_etat_processus, executable_candidat, "sha1", sha1) != d_vrai)
       {
           return(d_faux);
       }
   
       return(d_vrai);
   }
   
   
   unsigned char *
   date_compilation(struct_processus *s_etat_processus)
   {
       unsigned char       *date;
   
       if ((date = malloc((strlen(d_date_en_rpl) + 1) * sizeof(unsigned char)))
               == NULL)
       {
           return(NULL);
       }
   
       strcpy(date, d_date_en_rpl);
   
       return(date);
   }
   
   #pragma GCC diagnostic pop
   
 // vim: ts=4  // vim: ts=4

Removed from v.1.8  
changed lines
  Added in v.1.215


CVSweb interface <joel.bertrand@systella.fr>