File:  [local] / rpl / src / rpl.c
Revision 1.143: download - view: text, annotated - select for diffs - revision graph
Wed May 22 09:05:20 2013 UTC (10 years, 11 months ago) by bertrand
Branches: MAIN
CVS tags: HEAD
Correction de conditions d'accès concurrents.

    1: /*
    2: ================================================================================
    3:   RPL/2 (R) version 4.1.14
    4:   Copyright (C) 1989-2013 Dr. BERTRAND Joël
    5: 
    6:   This file is part of RPL/2.
    7: 
    8:   RPL/2 is free software; you can redistribute it and/or modify it
    9:   under the terms of the CeCILL V2 License as published by the french
   10:   CEA, CNRS and INRIA.
   11:  
   12:   RPL/2 is distributed in the hope that it will be useful, but WITHOUT
   13:   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   14:   FITNESS FOR A PARTICULAR PURPOSE.  See the CeCILL V2 License
   15:   for more details.
   16:  
   17:   You should have received a copy of the CeCILL License
   18:   along with RPL/2. If not, write to info@cecill.info.
   19: ================================================================================
   20: */
   21: 
   22: 
   23: #define  MAIN_RPL
   24: #include "rpl-conv.h"
   25: 
   26: 
   27: /*
   28: ================================================================================
   29:   Programme principal
   30: ================================================================================
   31: */
   32: 
   33: int
   34: rplinit(int argc, char *argv[], char *envp[],
   35:         unsigned char ***resultats, char *rpl_home)
   36: {
   37: #   include                             "copyright-conv.h"
   38: #   include                             "licence-conv.h"
   39: 
   40:     char                                **arg_exec;
   41: 
   42: #   ifdef HAVE_STACK_OVERFLOW_RECOVERY
   43:     char                                pile_signaux[SIGSTKSZ];
   44: #   endif
   45: 
   46: #   define RPL_PATH_MAX                 1024
   47:     char                                repertoire_initial[RPL_PATH_MAX];
   48: 
   49:     file                                *f_source;
   50: 
   51:     int                                 erreur_historique;
   52:     int                                 option_P;
   53: 
   54:     integer8                            i;
   55: 
   56:     logical1                            core;
   57:     logical1                            debug;
   58:     logical1                            erreur_fichier;
   59:     logical1                            existence;
   60:     logical1                            mode_interactif;
   61:     logical1                            option_a;
   62:     logical1                            option_A;
   63:     logical1                            option_c;
   64:     logical1                            option_d;
   65:     logical1                            option_D;
   66:     logical1                            option_h;
   67:     logical1                            option_i;
   68:     logical1                            option_l;
   69:     logical1                            option_n;
   70:     logical1                            option_p;
   71:     logical1                            option_s;
   72:     logical1                            option_S;
   73:     logical1                            option_t;
   74:     logical1                            option_v;
   75:     logical1                            ouverture;
   76: 
   77:     pthread_mutexattr_t                 attributs_mutex;
   78: 
   79:     ssize_t                             longueur_ecriture;
   80: 
   81:     struct_objet                        *s_objet;
   82: 
   83:     struct_processus                    *s_etat_processus;
   84: 
   85:     struct_liste_variables_partagees    *l_element_partage_courant;
   86:     struct_liste_variables_partagees    *l_element_partage_suivant;
   87: 
   88:     struct_liste_variables_statiques    *l_element_statique_courant;
   89:     struct_liste_variables_statiques    *l_element_statique_suivant;
   90: 
   91:     struct_arbre_variables_partagees    *s_arbre_variables_partagees;
   92:     struct_liste_variables_partagees    *l_liste_variables_partagees;
   93: 
   94:     struct sigaction                    action;
   95:     struct sigaction                    registre;
   96: 
   97:     struct timespec                     attente;
   98: 
   99:     unsigned char                       *arguments;
  100:     unsigned char                       drapeau_encart;
  101:     unsigned char                       *type_debug;
  102:     unsigned char                       *home;
  103:     unsigned char                       *langue;
  104:     unsigned char                       *message;
  105:     unsigned char                       *nom_fichier_temporaire;
  106:     unsigned char                       option;
  107:     unsigned char                       presence_definition;
  108:     unsigned char                       *ptr;
  109:     unsigned char                       *tampon;
  110: 
  111:     unsigned long                       unite_fichier;
  112: 
  113:     void                                *l_element_courant;
  114:     void                                *l_element_suivant;
  115: 
  116:     volatile int                        erreur;
  117:     volatile unsigned char              traitement_fichier_temporaire;
  118: 
  119:     errno = 0;
  120:     s_queue_signaux = NULL;
  121:     routine_recursive = 0;
  122:     pid_processus_pere = getpid();
  123: 
  124: #   ifdef DEBUG_MEMOIRE
  125:     debug_memoire_initialisation();
  126: #   endif
  127: 
  128:     setvbuf(stdout, NULL, _IOLBF, 0);
  129:     setvbuf(stderr, NULL, _IOLBF, 0);
  130: 
  131: #   ifndef SEMAPHORES_NOMMES
  132:     sem_init(&semaphore_gestionnaires_signaux, 0, 0);
  133: #   else
  134:     semaphore_gestionnaires_signaux = sem_init2(0, getpid(), SEM_SIGNAUX);
  135:     
  136:     if (semaphore_gestionnaires_signaux == SEM_FAILED)
  137:     {
  138:         erreur = d_es_allocation_memoire;
  139: 
  140:         if ((langue = getenv("LANG")) != NULL)
  141:         {
  142:             if (strncmp(langue, "fr", 2) == 0)
  143:             {
  144:                 uprintf("+++Système : Mémoire insuffisante\n");
  145:             }
  146:             else
  147:             {
  148:                 uprintf("+++System : Not enough memory\n");
  149:             }
  150:         }
  151:         else
  152:         {
  153:             uprintf("+++System : Not enough memory\n");
  154:         }
  155: 
  156:         return(EXIT_FAILURE);
  157:     }
  158: #   endif
  159: 
  160:     if ((s_etat_processus = malloc(sizeof(struct_processus))) == NULL)
  161:     {
  162: #       ifndef SEMAPHORES_NOMMES
  163:         sem_post(&semaphore_gestionnaires_signaux);
  164:         sem_destroy(&semaphore_gestionnaires_signaux);
  165: #       else
  166:         sem_post(semaphore_gestionnaires_signaux);
  167:         sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX);
  168: #       endif
  169: 
  170:         erreur = d_es_allocation_memoire;
  171: 
  172:         if ((langue = getenv("LANG")) != NULL)
  173:         {
  174:             if (strncmp(langue, "fr", 2) == 0)
  175:             {
  176:                 uprintf("+++Système : Mémoire insuffisante\n");
  177:             }
  178:             else
  179:             {
  180:                 uprintf("+++System : Not enough memory\n");
  181:             }
  182:         }
  183:         else
  184:         {
  185:             uprintf("+++System : Not enough memory\n");
  186:         }
  187: 
  188:         return(EXIT_FAILURE);
  189:     }
  190: 
  191:     if ((langue = getenv("LANG")) != NULL)
  192:     {
  193:         (*s_etat_processus).langue = (strncmp(langue, "fr", 2) == 0)
  194:                 ? 'F' : 'E';
  195:     }
  196:     else
  197:     {
  198:         (*s_etat_processus).langue = 'E';
  199:     }
  200: 
  201:     if (getcwd(repertoire_initial, RPL_PATH_MAX) == NULL)
  202:     {
  203: #       ifndef SEMAPHORES_NOMMES
  204:         sem_post(&semaphore_gestionnaires_signaux);
  205:         sem_destroy(&semaphore_gestionnaires_signaux);
  206: #       else
  207:         sem_post(semaphore_gestionnaires_signaux);
  208:         sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX);
  209: #       endif
  210: 
  211:         if ((*s_etat_processus).langue == 'F')
  212:         {
  213:             uprintf("+++Système : Mémoire insuffisante\n");
  214:         }
  215:         else
  216:         {
  217:             uprintf("+++System : Not enough memory\n");
  218:         }
  219: 
  220:         return(EXIT_FAILURE);
  221:     }
  222: 
  223:     if ((arg_exec = malloc((((size_t) argc) + 1) * sizeof(char *))) == NULL)
  224:     {
  225: #       ifndef SEMAPHORES_NOMMES
  226:         sem_post(&semaphore_gestionnaires_signaux);
  227:         sem_destroy(&semaphore_gestionnaires_signaux);
  228: #       else
  229:         sem_post(semaphore_gestionnaires_signaux);
  230:         sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX);
  231: #       endif
  232: 
  233:         if ((*s_etat_processus).langue == 'F')
  234:         {
  235:             uprintf("+++Système : Mémoire insuffisante\n");
  236:         }
  237:         else
  238:         {
  239:             uprintf("+++System : Not enough memory\n");
  240:         }
  241: 
  242:         return(EXIT_FAILURE);
  243:     }
  244: 
  245:     for(i = 0; i < argc; i++)
  246:     {
  247:         arg_exec[i] = argv[i];
  248:     }
  249: 
  250:     argv[argc] = NULL;
  251: 
  252:     initialisation_contexte_cas(s_etat_processus);
  253: 
  254:     (*s_etat_processus).exception = d_ep;
  255:     (*s_etat_processus).erreur_systeme = d_es;
  256:     (*s_etat_processus).erreur_execution = d_ex;
  257: 
  258:     (*s_etat_processus).requete_redemarrage = d_faux;
  259:     (*s_etat_processus).rpl_home = rpl_home;
  260: 
  261:     pthread_mutexattr_init(&attributs_mutex);
  262:     pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_NORMAL);
  263:     pthread_mutex_init(&((*s_etat_processus).mutex), &attributs_mutex);
  264:     pthread_mutexattr_destroy(&attributs_mutex);
  265: 
  266:     pthread_mutexattr_init(&attributs_mutex);
  267:     pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_NORMAL);
  268:     pthread_mutex_init(&((*s_etat_processus).mutex_allocation),
  269:             &attributs_mutex);
  270:     pthread_mutexattr_destroy(&attributs_mutex);
  271: 
  272:     pthread_mutexattr_init(&attributs_mutex);
  273:     pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_RECURSIVE);
  274:     pthread_mutex_init(&mutex_sections_critiques, &attributs_mutex);
  275:     pthread_mutexattr_destroy(&attributs_mutex);
  276: 
  277:     pthread_mutexattr_init(&attributs_mutex);
  278:     pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_RECURSIVE);
  279:     pthread_mutex_init(&mutex_liste_variables_partagees, &attributs_mutex);
  280:     pthread_mutexattr_destroy(&attributs_mutex);
  281: 
  282: #   ifndef SEMAPHORES_NOMMES
  283:         sem_init(&((*s_etat_processus).semaphore_fork), 0, 0);
  284: #   else
  285:         if (((*s_etat_processus).semaphore_fork = sem_init3(0, getpid(),
  286:                 pthread_self(), SEM_FORK)) == SEM_FAILED)
  287:         {
  288: #           ifndef SEMAPHORES_NOMMES
  289:                 sem_post(&semaphore_gestionnaires_signaux);
  290:                 sem_destroy(&semaphore_gestionnaires_signaux);
  291: #           else
  292:                 sem_post(semaphore_gestionnaires_signaux);
  293:                 sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
  294:                         SEM_SIGNAUX);
  295: #           endif
  296: 
  297:             liberation(contexte_cas(s_etat_processus);
  298: 
  299:             if ((*s_etat_processus).langue == 'F')
  300:             {
  301:                 uprintf("+++Système : Mémoire insuffisante\n");
  302:             }
  303:             else
  304:             {
  305:                 uprintf("+++System : Not enough memory\n");
  306:             }
  307: 
  308:             return(EXIT_FAILURE);
  309:         }
  310: #   endif
  311: 
  312:     pthread_mutexattr_init(&attributs_mutex);
  313:     pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_NORMAL);
  314:     pthread_mutex_init(&((*s_etat_processus).protection_liste_mutexes),
  315:             &attributs_mutex);
  316:     pthread_mutexattr_destroy(&attributs_mutex);
  317: 
  318:     (*s_etat_processus).chemin_fichiers_temporaires =
  319:             recherche_chemin_fichiers_temporaires(s_etat_processus);
  320: 
  321:     insertion_thread(s_etat_processus, d_vrai);
  322:     creation_queue_signaux(s_etat_processus);
  323: 
  324:     if ((*s_etat_processus).erreur_systeme != d_es)
  325:     {
  326: #       ifndef SEMAPHORES_NOMMES
  327:             sem_post(&((*s_etat_processus).semaphore_fork));
  328:             sem_post(&semaphore_gestionnaires_signaux);
  329:             sem_destroy(&semaphore_gestionnaires_signaux);
  330:             sem_destroy(&((*s_etat_processus).semaphore_fork));
  331: #       else
  332:             sem_post((*s_etat_processus).semaphore_fork);
  333:             sem_post(semaphore_gestionnaires_signaux);
  334:             sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
  335:                     SEM_SIGNAUX);
  336:             sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
  337:                     pthread_self(), SEM_FORK);
  338: #       endif
  339: 
  340:         liberation_contexte_cas(s_etat_processus);
  341: 
  342:         if ((*s_etat_processus).langue == 'F')
  343:         {
  344:             uprintf("+++Système : Mémoire insuffisante\n");
  345:         }
  346:         else
  347:         {
  348:             uprintf("+++System : Not enough memory\n");
  349:         }
  350: 
  351:         return(EXIT_FAILURE);
  352:     }
  353: 
  354:     if (d_forced_locale == 0)
  355:     {
  356:         localisation_courante(s_etat_processus);
  357:     }
  358:     else
  359:     {
  360: #       ifndef SEMAPHORES_NOMMES
  361:             sem_post(&((*s_etat_processus).semaphore_fork));
  362:             sem_post(&semaphore_gestionnaires_signaux);
  363:             sem_destroy(&semaphore_gestionnaires_signaux);
  364:             sem_destroy(&((*s_etat_processus).semaphore_fork));
  365: #       else
  366:             sem_post((*s_etat_processus).semaphore_fork);
  367:             sem_post(semaphore_gestionnaires_signaux);
  368:             sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
  369:                     SEM_SIGNAUX);
  370:             sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
  371:                     pthread_self(), SEM_FORK);
  372: #       endif
  373: 
  374:         liberation_contexte_cas(s_etat_processus);
  375:         liberation_queue_signaux(s_etat_processus);
  376: 
  377:         if (((*s_etat_processus).localisation = malloc((strlen(d_locale)
  378:                 + 1) * sizeof(unsigned char))) == NULL)
  379:         {
  380:             if ((*s_etat_processus).langue == 'F')
  381:             {
  382:                 uprintf("+++Système : Mémoire insuffisante\n");
  383:             }
  384:             else
  385:             {
  386:                 uprintf("+++System : Not enough memory\n");
  387:             }
  388: 
  389:             return(EXIT_FAILURE);
  390:         }
  391: 
  392:         strcpy((*s_etat_processus).localisation, d_locale);
  393:     }
  394: 
  395:     (*s_etat_processus).erreur_systeme = d_es;
  396: 
  397:     if ((*s_etat_processus).localisation == NULL)
  398:     {
  399:         if (((*s_etat_processus).localisation = malloc((strlen(d_locale) + 1) *
  400:                 sizeof(unsigned char))) == NULL)
  401:         {
  402: #           ifndef SEMAPHORES_NOMMES
  403:                 sem_post(&((*s_etat_processus).semaphore_fork));
  404:                 sem_post(&semaphore_gestionnaires_signaux);
  405:                 sem_destroy(&semaphore_gestionnaires_signaux);
  406:                 sem_destroy(&((*s_etat_processus).semaphore_fork));
  407: #           else
  408:                 sem_post((*s_etat_processus).semaphore_fork);
  409:                 sem_post(semaphore_gestionnaires_signaux);
  410:                 sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
  411:                         SEM_SIGNAUX);
  412:                 sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
  413:                         pthread_self(), SEM_FORK);
  414: #           endif
  415: 
  416:             liberation_contexte_cas(s_etat_processus);
  417:             liberation_queue_signaux(s_etat_processus);
  418: 
  419:             if ((*s_etat_processus).langue == 'F')
  420:             {
  421:                 uprintf("+++Système : Mémoire insuffisante\n");
  422:             }
  423:             else
  424:             {
  425:                 uprintf("+++System : Not enough memory\n");
  426:             }
  427: 
  428:             return(EXIT_FAILURE);
  429:         }
  430: 
  431:         strcpy((*s_etat_processus).localisation, d_locale);
  432:     }
  433: 
  434:     printf("+++RPL/2 (R) version %s (%s)\n", d_version_rpl,
  435:             ((*s_etat_processus).langue == 'F') ? d_date_rpl : d_date_en_rpl);
  436: 
  437:     if ((*s_etat_processus).langue == 'F')
  438:     {
  439:         printf("+++Copyright (C) 1989 à 2012, 2013 BERTRAND Joël\n");
  440:     }
  441:     else
  442:     {
  443:         printf("+++Copyright (C) 1989 to 2012, 2013 BERTRAND Joel\n");
  444:     }
  445: 
  446:     if (getenv("HOME") != NULL)
  447:     {
  448:         home = getenv("HOME");
  449:     }
  450:     else if ((getenv("USER") != NULL) && (getpwnam(getenv("USER")) != NULL))
  451:     {
  452:         home = getpwnam(getenv("USER"))->pw_dir;
  453:     }
  454:     else if ((getenv("LOGNAME") != NULL) && (getpwnam(getenv("LOGNAME"))
  455:             != NULL))
  456:     {
  457:         home = getpwnam(getenv("LOGNAME"))->pw_dir;
  458:     }
  459:     else if ((getuid() != ((uid_t) -1)) && (getpwuid(getuid()) != NULL))
  460:     {
  461:         home = getpwuid(getuid())->pw_dir;
  462:     }
  463:     else
  464:     {
  465:         home = "";
  466:     }
  467: 
  468: #   ifdef HAVE_STACK_OVERFLOW_RECOVERY
  469:         if (stackoverflow_install_handler(interruption_depassement_pile,
  470:                 pile_signaux, sizeof(pile_signaux)) != 0)
  471:         {
  472: #           ifndef SEMAPHORES_NOMMES
  473:                 sem_post(&((*s_etat_processus).semaphore_fork));
  474:                 sem_post(&semaphore_gestionnaires_signaux);
  475:                 sem_destroy(&semaphore_gestionnaires_signaux);
  476:                 sem_destroy(&((*s_etat_processus).semaphore_fork));
  477: #           else
  478:                 sem_post((*s_etat_processus).semaphore_fork);
  479:                 sem_post(semaphore_gestionnaires_signaux);
  480:                 sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
  481:                         SEM_SIGNAUX);
  482:                 sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
  483:                         pthread_self(), SEM_FORK);
  484: #           endif
  485: 
  486:             liberation_contexte_cas(s_etat_processus);
  487:             liberation_queue_signaux(s_etat_processus);
  488: 
  489:             erreur = d_es_signal;
  490: 
  491:             if ((*s_etat_processus).langue == 'F')
  492:             {
  493:                 printf("+++Système : Initialisation de la pile alternative "
  494:                         "impossible\n");
  495:             }
  496:             else
  497:             {
  498:                 printf("+++System : Initialization of alternate "
  499:                         "stack failed\n");
  500:             }
  501: 
  502:             return(EXIT_FAILURE);
  503:         }
  504: #   else
  505:         if ((*s_etat_processus).langue == 'F')
  506:         {
  507:             printf("+++Attention : Le système ne supporte pas de pile "
  508:                     "alternative\n");
  509:         }
  510:         else
  511:         {
  512:             printf("+++Warning : Operating system does not support alternate "
  513:                     "stack\n");
  514:         }
  515: #   endif
  516: 
  517:     if (lancement_thread_signaux(s_etat_processus) != d_absence_erreur)
  518:     {
  519: #       ifndef SEMAPHORES_NOMMES
  520:             sem_post(&((*s_etat_processus).semaphore_fork));
  521:             sem_post(&semaphore_gestionnaires_signaux);
  522:             sem_destroy(&semaphore_gestionnaires_signaux);
  523:             sem_destroy(&((*s_etat_processus).semaphore_fork));
  524: #       else
  525:             sem_post((*s_etat_processus).semaphore_fork);
  526:             sem_post(semaphore_gestionnaires_signaux);
  527:             sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
  528:                     SEM_SIGNAUX);
  529:             sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
  530:                     pthread_self(), SEM_FORK);
  531: #       endif
  532: 
  533:         liberation_contexte_cas(s_etat_processus);
  534:         liberation_queue_signaux(s_etat_processus);
  535: 
  536: #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
  537:             stackoverflow_deinstall_handler();
  538: #       endif
  539: 
  540:         erreur = d_es_signal;
  541: 
  542:         if ((*s_etat_processus).langue == 'F')
  543:         {
  544:             printf("+++Système : Initialisation des signaux POSIX "
  545:                     "impossible\n");
  546:         }
  547:         else
  548:         {
  549:             printf("+++System : Initialization of POSIX signals failed\n");
  550:         }
  551: 
  552:         return(EXIT_FAILURE);
  553:     }
  554: 
  555:     action.sa_handler = interruption1;
  556:     action.sa_flags = 0;
  557: 
  558:     if (sigaction(SIGINT, &action, NULL) != 0)
  559:     {
  560: #       ifndef SEMAPHORES_NOMMES
  561:             sem_post(&((*s_etat_processus).semaphore_fork));
  562:             sem_post(&semaphore_gestionnaires_signaux);
  563:             sem_destroy(&semaphore_gestionnaires_signaux);
  564:             sem_destroy(&((*s_etat_processus).semaphore_fork));
  565: #       else
  566:             sem_post((*s_etat_processus).semaphore_fork);
  567:             sem_post(semaphore_gestionnaires_signaux);
  568:             sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
  569:                     SEM_SIGNAUX);
  570:             sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
  571:                     pthread_self(), SEM_FORK);
  572: #       endif
  573: 
  574:         liberation_contexte_cas(s_etat_processus);
  575:         liberation_queue_signaux(s_etat_processus);
  576: 
  577: #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
  578:             stackoverflow_deinstall_handler();
  579: #       endif
  580: 
  581:         erreur = d_es_signal;
  582: 
  583:         if ((*s_etat_processus).langue == 'F')
  584:         {
  585:             printf("+++Système : Initialisation des signaux POSIX "
  586:                     "impossible\n");
  587:         }
  588:         else
  589:         {
  590:             printf("+++System : Initialization of POSIX signals failed\n");
  591:         }
  592: 
  593:         return(EXIT_FAILURE);
  594:     }
  595: 
  596:     signal_test = SIGTEST;
  597:     raise(SIGINT);
  598: 
  599:     attente.tv_sec = 0;
  600:     attente.tv_nsec = 1000000;
  601: 
  602:     for(i = 0; (i < 1000) && (signal_test == SIGTEST); i++)
  603:     {
  604:         nanosleep(&attente, NULL);
  605:     }
  606: 
  607:     if (signal_test != SIGINT)
  608:     {
  609: #       ifndef SEMAPHORES_NOMMES
  610:             sem_post(&((*s_etat_processus).semaphore_fork));
  611:             sem_post(&semaphore_gestionnaires_signaux);
  612:             sem_destroy(&semaphore_gestionnaires_signaux);
  613:             sem_destroy(&((*s_etat_processus).semaphore_fork));
  614: #       else
  615:             sem_post((*s_etat_processus).semaphore_fork);
  616:             sem_post(semaphore_gestionnaires_signaux);
  617:             sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
  618:                     SEM_SIGNAUX);
  619:             sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
  620:                     pthread_self(), SEM_FORK);
  621: #       endif
  622: 
  623:         liberation_contexte_cas(s_etat_processus);
  624:         liberation_queue_signaux(s_etat_processus);
  625: 
  626: #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
  627:             stackoverflow_deinstall_handler();
  628: #       endif
  629: 
  630:         erreur = d_es_signal;
  631: 
  632:         if ((*s_etat_processus).langue == 'F')
  633:         {
  634:             printf("+++Système : Initialisation des signaux POSIX "
  635:                     "impossible\n");
  636:         }
  637:         else
  638:         {
  639:             printf("+++System : Initialization of POSIX signals failed\n");
  640:         }
  641: 
  642:         return(EXIT_FAILURE);
  643:     }
  644: 
  645:     if (sigaction(SIGTERM, &action, NULL) != 0)
  646:     {
  647: #       ifndef SEMAPHORES_NOMMES
  648:             sem_post(&((*s_etat_processus).semaphore_fork));
  649:             sem_post(&semaphore_gestionnaires_signaux);
  650:             sem_destroy(&semaphore_gestionnaires_signaux);
  651:             sem_destroy(&((*s_etat_processus).semaphore_fork));
  652: #       else
  653:             sem_post((*s_etat_processus).semaphore_fork);
  654:             sem_post(semaphore_gestionnaires_signaux);
  655:             sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
  656:                     SEM_SIGNAUX);
  657:             sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
  658:                     pthread_self(), SEM_FORK);
  659: #       endif
  660: 
  661:         liberation_contexte_cas(s_etat_processus);
  662:         liberation_queue_signaux(s_etat_processus);
  663: 
  664: #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
  665:             stackoverflow_deinstall_handler();
  666: #       endif
  667: 
  668:         erreur = d_es_signal;
  669: 
  670:         if ((*s_etat_processus).langue == 'F')
  671:         {
  672:             printf("+++Système : Initialisation des signaux POSIX "
  673:                     "impossible\n");
  674:         }
  675:         else
  676:         {
  677:             printf("+++System : Initialization of POSIX signals failed\n");
  678:         }
  679: 
  680:         return(EXIT_FAILURE);
  681:     }
  682: 
  683:     signal_test = SIGTEST;
  684:     raise(SIGTERM);
  685: 
  686:     attente.tv_sec = 0;
  687:     attente.tv_nsec = 1000000;
  688: 
  689:     for(i = 0; (i < 1000) && (signal_test == SIGTEST); i++)
  690:     {
  691:         nanosleep(&attente, NULL);
  692:     }
  693: 
  694:     if (signal_test != SIGTERM)
  695:     {
  696: #       ifndef SEMAPHORES_NOMMES
  697:             sem_post(&((*s_etat_processus).semaphore_fork));
  698:             sem_post(&semaphore_gestionnaires_signaux);
  699:             sem_destroy(&semaphore_gestionnaires_signaux);
  700:             sem_destroy(&((*s_etat_processus).semaphore_fork));
  701: #       else
  702:             sem_post((*s_etat_processus).semaphore_fork);
  703:             sem_post(semaphore_gestionnaires_signaux);
  704:             sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
  705:                     SEM_SIGNAUX);
  706:             sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
  707:                     pthread_self(), SEM_FORK);
  708: #       endif
  709: 
  710:         liberation_contexte_cas(s_etat_processus);
  711:         liberation_queue_signaux(s_etat_processus);
  712: 
  713: #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
  714:             stackoverflow_deinstall_handler();
  715: #       endif
  716: 
  717:         erreur = d_es_signal;
  718: 
  719:         if ((*s_etat_processus).langue == 'F')
  720:         {
  721:             printf("+++Système : Initialisation des signaux POSIX "
  722:                     "impossible\n");
  723:         }
  724:         else
  725:         {
  726:             printf("+++System : Initialization of POSIX signals failed\n");
  727:         }
  728: 
  729:         return(EXIT_FAILURE);
  730:     }
  731: 
  732:     if (sigaction(SIGALRM, &action, NULL) != 0)
  733:     {
  734: #       ifndef SEMAPHORES_NOMMES
  735:             sem_post(&((*s_etat_processus).semaphore_fork));
  736:             sem_post(&semaphore_gestionnaires_signaux);
  737:             sem_destroy(&semaphore_gestionnaires_signaux);
  738:             sem_destroy(&((*s_etat_processus).semaphore_fork));
  739: #       else
  740:             sem_post((*s_etat_processus).semaphore_fork);
  741:             sem_post(semaphore_gestionnaires_signaux);
  742:             sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
  743:                     SEM_SIGNAUX);
  744:             sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
  745:                     pthread_self(), SEM_FORK);
  746: #       endif
  747: 
  748:         liberation_contexte_cas(s_etat_processus);
  749:         liberation_queue_signaux(s_etat_processus);
  750: 
  751: #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
  752:             stackoverflow_deinstall_handler();
  753: #       endif
  754: 
  755:         erreur = d_es_signal;
  756: 
  757:         if ((*s_etat_processus).langue == 'F')
  758:         {
  759:             printf("+++Système : Initialisation des signaux POSIX "
  760:                     "impossible\n");
  761:         }
  762:         else
  763:         {
  764:             printf("+++System : Initialization of POSIX signals failed\n");
  765:         }
  766: 
  767:         return(EXIT_FAILURE);
  768:     }
  769: 
  770:     signal_test = SIGTEST;
  771:     raise(SIGALRM);
  772: 
  773:     attente.tv_sec = 0;
  774:     attente.tv_nsec = 1000000;
  775: 
  776:     for(i = 0; (i < 1000) && (signal_test == SIGTEST); i++)
  777:     {
  778:         nanosleep(&attente, NULL);
  779:     }
  780: 
  781:     if (signal_test != SIGALRM)
  782:     {
  783: #       ifndef SEMAPHORES_NOMMES
  784:             sem_post(&((*s_etat_processus).semaphore_fork));
  785:             sem_post(&semaphore_gestionnaires_signaux);
  786:             sem_destroy(&semaphore_gestionnaires_signaux);
  787:             sem_destroy(&((*s_etat_processus).semaphore_fork));
  788: #       else
  789:             sem_post((*s_etat_processus).semaphore_fork);
  790:             sem_post(semaphore_gestionnaires_signaux);
  791:             sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
  792:                     SEM_SIGNAUX);
  793:             sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
  794:                     pthread_self(), SEM_FORK);
  795: #       endif
  796: 
  797:         liberation_contexte_cas(s_etat_processus);
  798:         liberation_queue_signaux(s_etat_processus);
  799: 
  800: #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
  801:             stackoverflow_deinstall_handler();
  802: #       endif
  803: 
  804:         erreur = d_es_signal;
  805: 
  806:         if ((*s_etat_processus).langue == 'F')
  807:         {
  808:             printf("+++Système : Initialisation des signaux POSIX "
  809:                     "impossible\n");
  810:         }
  811:         else
  812:         {
  813:             printf("+++System : Initialization of POSIX signals failed\n");
  814:         }
  815: 
  816:         return(EXIT_FAILURE);
  817:     }
  818: 
  819:     action.sa_handler = interruption2;
  820:     action.sa_flags = 0;
  821: 
  822:     if (sigaction(SIGTSTP, &action, NULL) != 0)
  823:     {
  824: #       ifndef SEMAPHORES_NOMMES
  825:             sem_post(&((*s_etat_processus).semaphore_fork));
  826:             sem_post(&semaphore_gestionnaires_signaux);
  827:             sem_destroy(&semaphore_gestionnaires_signaux);
  828:             sem_destroy(&((*s_etat_processus).semaphore_fork));
  829: #       else
  830:             sem_post((*s_etat_processus).semaphore_fork);
  831:             sem_post(semaphore_gestionnaires_signaux);
  832:             sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
  833:                     SEM_SIGNAUX);
  834:             sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
  835:                     pthread_self(), SEM_FORK);
  836: #       endif
  837: 
  838:         liberation_contexte_cas(s_etat_processus);
  839:         liberation_queue_signaux(s_etat_processus);
  840: 
  841: #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
  842:             stackoverflow_deinstall_handler();
  843: #       endif
  844: 
  845:         if ((*s_etat_processus).langue == 'F')
  846:         {
  847:             printf("+++Système : Initialisation des signaux POSIX "
  848:                     "impossible\n");
  849:         }
  850:         else
  851:         {
  852:             printf("+++System : Initialization of POSIX signals failed\n");
  853:         }
  854: 
  855:         return(EXIT_FAILURE);
  856:     }
  857: 
  858:     signal_test = SIGTEST;
  859:     raise(SIGTSTP);
  860: 
  861:     attente.tv_sec = 0;
  862:     attente.tv_nsec = 1000000;
  863: 
  864:     for(i = 0; (i < 1000) && (signal_test == SIGTEST); i++)
  865:     {
  866:         nanosleep(&attente, NULL);
  867:     }
  868: 
  869:     if (signal_test != SIGTSTP)
  870:     {
  871: #       ifndef SEMAPHORES_NOMMES
  872:             sem_post(&((*s_etat_processus).semaphore_fork));
  873:             sem_post(&semaphore_gestionnaires_signaux);
  874:             sem_destroy(&semaphore_gestionnaires_signaux);
  875:             sem_destroy(&((*s_etat_processus).semaphore_fork));
  876: #       else
  877:             sem_post((*s_etat_processus).semaphore_fork);
  878:             sem_post(semaphore_gestionnaires_signaux);
  879:             sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
  880:                     SEM_SIGNAUX);
  881:             sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
  882:                     pthread_self(), SEM_FORK);
  883: #       endif
  884: 
  885:         liberation_contexte_cas(s_etat_processus);
  886:         liberation_queue_signaux(s_etat_processus);
  887: 
  888: #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
  889:             stackoverflow_deinstall_handler();
  890: #       endif
  891: 
  892:         erreur = d_es_signal;
  893: 
  894:         if ((*s_etat_processus).langue == 'F')
  895:         {
  896:             printf("+++Système : Initialisation des signaux POSIX "
  897:                     "impossible\n");
  898:         }
  899:         else
  900:         {
  901:             printf("+++System : Initialization of POSIX signals failed\n");
  902:         }
  903: 
  904:         return(EXIT_FAILURE);
  905:     }
  906: 
  907:     action.sa_handler = interruption5;
  908:     action.sa_flags = 0;
  909: 
  910:     if (sigaction(SIGPIPE, &action, NULL) != 0)
  911:     {
  912: #       ifndef SEMAPHORES_NOMMES
  913:             sem_post(&((*s_etat_processus).semaphore_fork));
  914:             sem_post(&semaphore_gestionnaires_signaux);
  915:             sem_destroy(&semaphore_gestionnaires_signaux);
  916:             sem_destroy(&((*s_etat_processus).semaphore_fork));
  917: #       else
  918:             sem_post((*s_etat_processus).semaphore_fork);
  919:             sem_post(semaphore_gestionnaires_signaux);
  920:             sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
  921:                     SEM_SIGNAUX);
  922:             sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
  923:                     pthread_self(), SEM_FORK);
  924: #       endif
  925: 
  926:         liberation_contexte_cas(s_etat_processus);
  927:         liberation_queue_signaux(s_etat_processus);
  928: 
  929: #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
  930:             stackoverflow_deinstall_handler();
  931: #       endif
  932: 
  933:         erreur = d_es_signal;
  934: 
  935:         if ((*s_etat_processus).langue == 'F')
  936:         {
  937:             printf("+++Système : Initialisation des signaux POSIX "
  938:                     "impossible\n");
  939:         }
  940:         else
  941:         {
  942:             printf("+++System : Initialization of POSIX signals failed\n");
  943:         }
  944: 
  945:         return(EXIT_FAILURE);
  946:     }
  947: 
  948:     signal_test = SIGTEST;
  949:     raise(SIGPIPE);
  950: 
  951:     attente.tv_sec = 0;
  952:     attente.tv_nsec = 1000000;
  953: 
  954:     for(i = 0; (i < 1000) && (signal_test == SIGTEST); i++)
  955:     {
  956:         nanosleep(&attente, NULL);
  957:     }
  958: 
  959:     if (signal_test != SIGPIPE)
  960:     {
  961: #       ifndef SEMAPHORES_NOMMES
  962:             sem_post(&((*s_etat_processus).semaphore_fork));
  963:             sem_post(&semaphore_gestionnaires_signaux);
  964:             sem_destroy(&semaphore_gestionnaires_signaux);
  965:             sem_destroy(&((*s_etat_processus).semaphore_fork));
  966: #       else
  967:             sem_post((*s_etat_processus).semaphore_fork);
  968:             sem_post(semaphore_gestionnaires_signaux);
  969:             sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
  970:                     SEM_SIGNAUX);
  971:             sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
  972:                     pthread_self(), SEM_FORK);
  973: #       endif
  974: 
  975:         liberation_contexte_cas(s_etat_processus);
  976:         liberation_queue_signaux(s_etat_processus);
  977: 
  978: #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
  979:             stackoverflow_deinstall_handler();
  980: #       endif
  981: 
  982:         erreur = d_es_signal;
  983: 
  984:         if ((*s_etat_processus).langue == 'F')
  985:         {
  986:             printf("+++Système : Initialisation des signaux POSIX "
  987:                     "impossible\n");
  988:         }
  989:         else
  990:         {
  991:             printf("+++System : Initialization of POSIX signals failed\n");
  992:         }
  993: 
  994:         return(EXIT_FAILURE);
  995:     }
  996: 
  997:     action.sa_handler = interruption1;
  998:     action.sa_flags = 0;
  999: 
 1000:     if (sigaction(SIGUSR1, &action, NULL) != 0)
 1001:     {
 1002: #       ifndef SEMAPHORES_NOMMES
 1003:             sem_post(&((*s_etat_processus).semaphore_fork));
 1004:             sem_post(&semaphore_gestionnaires_signaux);
 1005:             sem_destroy(&semaphore_gestionnaires_signaux);
 1006:             sem_destroy(&((*s_etat_processus).semaphore_fork));
 1007: #       else
 1008:             sem_post((*s_etat_processus).semaphore_fork);
 1009:             sem_post(semaphore_gestionnaires_signaux);
 1010:             sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
 1011:                     SEM_SIGNAUX);
 1012:             sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
 1013:                     pthread_self(), SEM_FORK);
 1014: #       endif
 1015: 
 1016:         liberation_contexte_cas(s_etat_processus);
 1017:         liberation_queue_signaux(s_etat_processus);
 1018: 
 1019: #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
 1020:             stackoverflow_deinstall_handler();
 1021: #       endif
 1022: 
 1023:         erreur = d_es_signal;
 1024: 
 1025:         if ((*s_etat_processus).langue == 'F')
 1026:         {
 1027:             printf("+++Système : Initialisation des signaux POSIX "
 1028:                     "impossible\n");
 1029:         }
 1030:         else
 1031:         {
 1032:             printf("+++System : Initialization of POSIX signals failed\n");
 1033:         }
 1034: 
 1035:         return(EXIT_FAILURE);
 1036:     }
 1037: 
 1038:     signal_test = SIGTEST;
 1039:     raise(SIGUSR1);
 1040: 
 1041:     attente.tv_sec = 0;
 1042:     attente.tv_nsec = 1000000;
 1043: 
 1044:     for(i = 0; (i < 1000) && (signal_test == SIGTEST); i++)
 1045:     {
 1046:         nanosleep(&attente, NULL);
 1047:     }
 1048: 
 1049:     if (signal_test != SIGUSR1)
 1050:     {
 1051: #       ifndef SEMAPHORES_NOMMES
 1052:             sem_post(&((*s_etat_processus).semaphore_fork));
 1053:             sem_post(&semaphore_gestionnaires_signaux);
 1054:             sem_destroy(&semaphore_gestionnaires_signaux);
 1055:             sem_destroy(&((*s_etat_processus).semaphore_fork));
 1056: #       else
 1057:             sem_post((*s_etat_processus).semaphore_fork);
 1058:             sem_post(semaphore_gestionnaires_signaux);
 1059:             sem_destroy2(semaphore_gestionnaires_signaux, getpid(),
 1060:                     SEM_SIGNAUX);
 1061:             sem_destroy3((*s_etat_processus).semphore_fork, getpid(),
 1062:                     pthread_self(), SEM_FORK);
 1063: #       endif
 1064: 
 1065:         liberation_contexte_cas(s_etat_processus);
 1066:         liberation_queue_signaux(s_etat_processus);
 1067: 
 1068: #       ifdef HAVE_STACK_OVERFLOW_RECOVERY
 1069:             stackoverflow_deinstall_handler();
 1070: #       endif
 1071: 
 1072:         erreur = d_es_signal;
 1073: 
 1074:         if ((*s_etat_processus).langue == 'F')
 1075:         {
 1076:             printf("+++Système : Initialisation des signaux POSIX "
 1077:                     "impossible\n");
 1078:         }
 1079:         else
 1080:         {
 1081:             printf("+++System : Initialization of POSIX signals failed\n");
 1082:         }
 1083: 
 1084:         return(EXIT_FAILURE);
 1085:     }
 1086: 
 1087:     signal_test = SIGTEST + 1;
 1088: 
 1089:     erreur = d_absence_erreur;
 1090:     core = d_faux;
 1091:     mode_interactif = d_faux;
 1092:     (*s_etat_processus).nom_fichier_source = NULL;
 1093:     (*s_etat_processus).definitions_chainees = NULL;
 1094:     (*s_etat_processus).type_debug = 0;
 1095:     traitement_fichier_temporaire = 'N';
 1096:     option = ' ';
 1097:     drapeau_encart = 'Y';
 1098:     debug = d_faux;
 1099:     arguments = NULL;
 1100: 
 1101:     (*s_etat_processus).s_fichiers = NULL;
 1102:     (*s_etat_processus).s_sockets = NULL;
 1103:     (*s_etat_processus).s_connecteurs_sql = NULL;
 1104: 
 1105:     setlogmask(LOG_MASK(LOG_NOTICE));
 1106:     openlog(argv[0], LOG_ODELAY | LOG_PID, LOG_USER);
 1107: 
 1108:     if (argc == 1)
 1109:     {
 1110:         erreur = d_erreur;
 1111:         informations(s_etat_processus);
 1112:     }
 1113:     else
 1114:     {
 1115:         presence_definition = 'N';
 1116:         (*s_etat_processus).debug = d_faux;
 1117:         (*s_etat_processus).lancement_interactif = d_faux;
 1118: 
 1119:         option_a = d_faux;
 1120:         option_A = d_faux;
 1121:         option_c = d_faux;
 1122:         option_d = d_faux;
 1123:         option_D = d_faux;
 1124:         option_h = d_faux;
 1125:         option_i = d_faux;
 1126:         option_l = d_faux;
 1127:         option_n = d_faux;
 1128:         option_p = d_faux;
 1129:         option_P = 0;
 1130:         option_s = d_faux;
 1131:         option_S = d_faux;
 1132:         option_t = d_faux;
 1133:         option_v = d_faux;
 1134: 
 1135:         // Lorsque le programme est appelé depuis un shebang, argv[0] contient
 1136:         // le chemin du programme et argv[1] tous les arguments.
 1137:         // argv[2] contient quant à lui le nom du script RPL/2.
 1138:         //
 1139:         // Exemple :
 1140:         // argv[0] : /usr/local/bin/rpl
 1141:         // argv[1] : -csdp -t 800
 1142:         // argv[2] : ./on_exit.rpl
 1143: 
 1144:         while((--argc) > 0)
 1145:         {
 1146:             if ((*(++argv))[0] == '-')
 1147:             {
 1148:                 while((option = *(++argv[0])) != '\0')
 1149:                 {
 1150:                     switch(option)
 1151:                     {
 1152:                         case 'a' :
 1153:                         {
 1154:                             if (option_a == d_vrai)
 1155:                             {
 1156: #                               ifndef SEMAPHORES_NOMMES
 1157:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 1158:                                 sem_post(&semaphore_gestionnaires_signaux);
 1159:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 1160:                                 sem_destroy(&((*s_etat_processus)
 1161:                                         .semaphore_fork));
 1162: #                               else
 1163:                                 sem_post((*s_etat_processus).semaphore_fork);
 1164:                                 sem_post(semaphore_gestionnaires_signaux);
 1165:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 1166:                                         getpid(), SEM_SIGNAUX);
 1167:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 1168:                                         getpid(), pthread_self(), SEM_FORK);
 1169: #                               endif
 1170: 
 1171:                                 liberation_contexte_cas(s_etat_processus);
 1172:                                 liberation_queue_signaux(s_etat_processus);
 1173: 
 1174: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 1175:                                 stackoverflow_deinstall_handler();
 1176: #                               endif
 1177: 
 1178:                                 if ((*s_etat_processus).langue == 'F')
 1179:                                 {
 1180:                                     printf("+++Erreur : option -a présente "
 1181:                                             "plus d'une fois\n");
 1182:                                 }
 1183:                                 else
 1184:                                 {
 1185:                                     printf("+++Error : more than one -a "
 1186:                                             "on command line");
 1187:                                 }
 1188: 
 1189:                                 return(EXIT_FAILURE);
 1190:                             }
 1191: 
 1192:                             option_a = d_vrai;
 1193:                             break;
 1194:                         }
 1195: 
 1196:                         case 'A' :
 1197:                         {
 1198:                             if (option_A == d_vrai)
 1199:                             {
 1200: #                               ifndef SEMAPHORES_NOMMES
 1201:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 1202:                                 sem_post(&semaphore_gestionnaires_signaux);
 1203:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 1204:                                 sem_destroy(&((*s_etat_processus)
 1205:                                         .semaphore_fork));
 1206: #                               else
 1207:                                 sem_post((*s_etat_processus).semaphore_fork);
 1208:                                 sem_post(semaphore_gestionnaires_signaux);
 1209:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 1210:                                         getpid(), SEM_SIGNAUX);
 1211:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 1212:                                         getpid(), pthread_self(), SEM_FORK);
 1213: #                               endif
 1214: 
 1215:                                 liberation_contexte_cas(s_etat_processus);
 1216:                                 liberation_queue_signaux(s_etat_processus);
 1217: 
 1218: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 1219:                                 stackoverflow_deinstall_handler();
 1220: #                               endif
 1221: 
 1222:                                 if ((*s_etat_processus).langue == 'F')
 1223:                                 {
 1224:                                     printf("+++Erreur : option -A présente "
 1225:                                             "plus d'une fois\n");
 1226:                                 }
 1227:                                 else
 1228:                                 {
 1229:                                     printf("+++Error : more than one -A "
 1230:                                             "on command line");
 1231:                                 }
 1232: 
 1233:                                 return(EXIT_FAILURE);
 1234:                             }
 1235: 
 1236:                             option_A = d_vrai;
 1237: 
 1238:                             while(*(++argv[0]) == ' ');
 1239:                             argv[0]--;
 1240: 
 1241:                             if ((*(++argv[0])) != '\0')
 1242:                             {
 1243:                                 if ((arguments = malloc((strlen(argv[0]) + 7) *
 1244:                                         sizeof(unsigned char))) == NULL)
 1245:                                 {
 1246: #                                   ifndef SEMAPHORES_NOMMES
 1247:                                     sem_post(&((*s_etat_processus)
 1248:                                             .semaphore_fork));
 1249:                                     sem_post(&semaphore_gestionnaires_signaux);
 1250:                                     sem_destroy(
 1251:                                             &semaphore_gestionnaires_signaux);
 1252:                                     sem_destroy(&((*s_etat_processus)
 1253:                                             .semaphore_fork));
 1254: #                                   else
 1255:                                     sem_post((*s_etat_processus)
 1256:                                             .semaphore_fork);
 1257:                                     sem_post(semaphore_gestionnaires_signaux);
 1258:                                     sem_destroy2(
 1259:                                             semaphore_gestionnaires_signaux,
 1260:                                             getpid(), SEM_SIGNAUX);
 1261:                                     sem_destroy3((*s_etat_processus)
 1262:                                             .semphore_fork, getpid(),
 1263:                                             pthread_self(), SEM_FORK);
 1264: #                                   endif
 1265: 
 1266:                                     liberation_contexte_cas(s_etat_processus);
 1267:                                     liberation_queue_signaux(s_etat_processus);
 1268: 
 1269: #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
 1270:                                     stackoverflow_deinstall_handler();
 1271: #                                   endif
 1272: 
 1273:                                     if ((*s_etat_processus).langue == 'F')
 1274:                                     {
 1275:                                         printf("+++Système : Mémoire "
 1276:                                                 "insuffisante\n");
 1277:                                     }
 1278:                                     else
 1279:                                     {
 1280:                                         printf("+++System : Not enough "
 1281:                                                 "memory\n");
 1282:                                     }
 1283: 
 1284:                                     return(EXIT_FAILURE);
 1285:                                 }
 1286: 
 1287:                                 ptr = arguments;
 1288:                                 (*ptr) = d_code_fin_chaine;
 1289:                                 strcat(ptr, "<< ");
 1290:                                 ptr += 3;
 1291: 
 1292:                                 while(*(argv[0]) != '\0')
 1293:                                 {
 1294:                                     *(ptr++) = *(argv[0]++);
 1295:                                 }
 1296: 
 1297:                                 (*ptr) = '\0';
 1298: 
 1299:                                 strcat(arguments, " >>");
 1300:                                 argv[0]--;
 1301:                             }
 1302:                             else if ((--argc) > 0)
 1303:                             {
 1304:                                 argv++;
 1305: 
 1306:                                 if ((arguments = malloc((strlen(argv[0]) + 7) *
 1307:                                         sizeof(unsigned char))) == NULL)
 1308:                                 {
 1309: #                                   ifndef SEMAPHORES_NOMMES
 1310:                                     sem_post(&((*s_etat_processus)
 1311:                                             .semaphore_fork));
 1312:                                     sem_post(&semaphore_gestionnaires_signaux);
 1313:                                     sem_destroy(
 1314:                                             &semaphore_gestionnaires_signaux);
 1315:                                     sem_destroy(&((*s_etat_processus)
 1316:                                             .semaphore_fork));
 1317: #                                   else
 1318:                                     sem_post((*s_etat_processus)
 1319:                                             .semaphore_fork);
 1320:                                     sem_post(semaphore_gestionnaires_signaux);
 1321:                                     sem_destroy2(
 1322:                                             semaphore_gestionnaires_signaux,
 1323:                                             getpid(), SEM_SIGNAUX);
 1324:                                     sem_destroy3((*s_etat_processus)
 1325:                                             .semphore_fork, getpid(),
 1326:                                             pthread_self(), SEM_FORK);
 1327: #                                   endif
 1328: 
 1329:                                     liberation_contexte_cas(s_etat_processus);
 1330:                                     liberation_queue_signaux(s_etat_processus);
 1331: 
 1332: #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
 1333:                                     stackoverflow_deinstall_handler();
 1334: #                                   endif
 1335: 
 1336:                                     if ((*s_etat_processus).langue == 'F')
 1337:                                     {
 1338:                                         printf("+++Système : Mémoire "
 1339:                                                 "insuffisante\n");
 1340:                                     }
 1341:                                     else
 1342:                                     {
 1343:                                         printf("+++System : Not enough "
 1344:                                                 "memory\n");
 1345:                                     }
 1346: 
 1347:                                     return(EXIT_FAILURE);
 1348:                                 }
 1349: 
 1350:                                 ptr = arguments;
 1351:                                 (*ptr) = d_code_fin_chaine;
 1352:                                 strcat(ptr, "<< ");
 1353:                                 ptr += 3;
 1354: 
 1355:                                 while(*(argv[0]) != '\0')
 1356:                                 {
 1357:                                     *(ptr++) = *(argv[0]++);
 1358:                                 }
 1359: 
 1360:                                 (*ptr) = '\0';
 1361: 
 1362:                                 strcat(arguments, " >>");
 1363:                                 argv[0]--;
 1364:                             }
 1365:                             else
 1366:                             {
 1367: #                               ifndef SEMAPHORES_NOMMES
 1368:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 1369:                                 sem_post(&semaphore_gestionnaires_signaux);
 1370:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 1371:                                 sem_destroy(&((*s_etat_processus)
 1372:                                         .semaphore_fork));
 1373: #                               else
 1374:                                 sem_post((*s_etat_processus).semaphore_fork);
 1375:                                 sem_post(semaphore_gestionnaires_signaux);
 1376:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 1377:                                         getpid(), SEM_SIGNAUX);
 1378:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 1379:                                         getpid(), pthread_self(), SEM_FORK);
 1380: #                               endif
 1381: 
 1382:                                 liberation_contexte_cas(s_etat_processus);
 1383:                                 liberation_queue_signaux(s_etat_processus);
 1384: 
 1385: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 1386:                                 stackoverflow_deinstall_handler();
 1387: #                               endif
 1388: 
 1389:                                 if ((*s_etat_processus).langue == 'F')
 1390:                                 {
 1391:                                     printf("+++Erreur : Aucune donnée "
 1392:                                             "spécifié après l'option -A\n");
 1393:                                 }
 1394:                                 else
 1395:                                 {
 1396:                                     printf("+++Error : Data required after "
 1397:                                             "-A option\n");
 1398:                                 }
 1399: 
 1400:                                 return(EXIT_FAILURE);
 1401:                             }
 1402: 
 1403:                             break;
 1404:                         }
 1405: 
 1406:                         case 'c' :
 1407:                         {
 1408:                             if (option_c == d_vrai)
 1409:                             {
 1410: #                               ifndef SEMAPHORES_NOMMES
 1411:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 1412:                                 sem_post(&semaphore_gestionnaires_signaux);
 1413:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 1414:                                 sem_destroy(&((*s_etat_processus)
 1415:                                         .semaphore_fork));
 1416: #                               else
 1417:                                 sem_post((*s_etat_processus).semaphore_fork);
 1418:                                 sem_post(semaphore_gestionnaires_signaux);
 1419:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 1420:                                         getpid(), SEM_SIGNAUX);
 1421:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 1422:                                         getpid(), pthread_self(), SEM_FORK);
 1423: #                               endif
 1424: 
 1425:                                 liberation_contexte_cas(s_etat_processus);
 1426:                                 liberation_queue_signaux(s_etat_processus);
 1427: 
 1428: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 1429:                                 stackoverflow_deinstall_handler();
 1430: #                               endif
 1431: 
 1432:                                 if ((*s_etat_processus).langue == 'F')
 1433:                                 {
 1434:                                     printf("+++Erreur : option -c présente "
 1435:                                             "plus d'une fois\n");
 1436:                                 }
 1437:                                 else
 1438:                                 {
 1439:                                     printf("+++Error : more than one -c "
 1440:                                             "on command line");
 1441:                                 }
 1442: 
 1443:                                 return(EXIT_FAILURE);
 1444:                             }
 1445: 
 1446:                             option_c = d_vrai;
 1447:                             core = d_vrai;
 1448:                             break;
 1449:                         }
 1450: 
 1451:                         case 'd' :
 1452:                         {
 1453:                             if (option_d == d_vrai)
 1454:                             {
 1455: #                               ifndef SEMAPHORES_NOMMES
 1456:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 1457:                                 sem_post(&semaphore_gestionnaires_signaux);
 1458:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 1459:                                 sem_destroy(&((*s_etat_processus)
 1460:                                         .semaphore_fork));
 1461: #                               else
 1462:                                 sem_post((*s_etat_processus).semaphore_fork);
 1463:                                 sem_post(semaphore_gestionnaires_signaux);
 1464:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 1465:                                         getpid(), SEM_SIGNAUX);
 1466:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 1467:                                         getpid(), pthread_self(), SEM_FORK);
 1468: #                               endif
 1469: 
 1470:                                 liberation_contexte_cas(s_etat_processus);
 1471:                                 liberation_queue_signaux(s_etat_processus);
 1472: 
 1473: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 1474:                                 stackoverflow_deinstall_handler();
 1475: #                               endif
 1476: 
 1477:                                 if ((*s_etat_processus).langue == 'F')
 1478:                                 {
 1479:                                     printf("+++Erreur : option -d présente "
 1480:                                             "plus d'une fois\n");
 1481:                                 }
 1482:                                 else
 1483:                                 {
 1484:                                     printf("+++Error : more than one -d "
 1485:                                             "on command line");
 1486:                                 }
 1487: 
 1488:                                 return(EXIT_FAILURE);
 1489:                             }
 1490: 
 1491:                             option_d = d_vrai;
 1492:                             debug = d_vrai;
 1493:                             break;
 1494:                         }
 1495: 
 1496:                         case 'D' :
 1497:                         {
 1498:                             if (option_D == d_vrai)
 1499:                             {
 1500: #                               ifndef SEMAPHORES_NOMMES
 1501:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 1502:                                 sem_post(&semaphore_gestionnaires_signaux);
 1503:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 1504:                                 sem_destroy(&((*s_etat_processus)
 1505:                                         .semaphore_fork));
 1506: #                               else
 1507:                                 sem_post((*s_etat_processus).semaphore_fork);
 1508:                                 sem_post(semaphore_gestionnaires_signaux);
 1509:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 1510:                                         getpid(), SEM_SIGNAUX);
 1511:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 1512:                                         getpid(), pthread_self(), SEM_FORK);
 1513: #                               endif
 1514: 
 1515:                                 liberation_contexte_cas(s_etat_processus);
 1516:                                 liberation_queue_signaux(s_etat_processus);
 1517: 
 1518: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 1519:                                 stackoverflow_deinstall_handler();
 1520: #                               endif
 1521: 
 1522:                                 if ((*s_etat_processus).langue == 'F')
 1523:                                 {
 1524:                                     printf("+++Erreur : option -D présente "
 1525:                                             "plus d'une fois\n");
 1526:                                 }
 1527:                                 else
 1528:                                 {
 1529:                                     printf("+++Error : more than one -D "
 1530:                                             "on command line");
 1531:                                 }
 1532: 
 1533:                                 return(EXIT_FAILURE);
 1534:                             }
 1535: 
 1536:                             option_D = d_vrai;
 1537:                             break;
 1538:                         }
 1539: 
 1540:                         case 'h' :
 1541:                         {
 1542:                             if (option_h == d_vrai)
 1543:                             {
 1544: #                               ifndef SEMAPHORES_NOMMES
 1545:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 1546:                                 sem_post(&semaphore_gestionnaires_signaux);
 1547:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 1548:                                 sem_destroy(&((*s_etat_processus)
 1549:                                         .semaphore_fork));
 1550: #                               else
 1551:                                 sem_post((*s_etat_processus).semaphore_fork);
 1552:                                 sem_post(semaphore_gestionnaires_signaux);
 1553:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 1554:                                         getpid(), SEM_SIGNAUX);
 1555:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 1556:                                         getpid(), pthread_self(), SEM_FORK);
 1557: #                               endif
 1558: 
 1559:                                 liberation_contexte_cas(s_etat_processus);
 1560:                                 liberation_queue_signaux(s_etat_processus);
 1561: 
 1562: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 1563:                                 stackoverflow_deinstall_handler();
 1564: #                               endif
 1565: 
 1566:                                 if ((*s_etat_processus).langue == 'F')
 1567:                                 {
 1568:                                     printf("+++Erreur : option -h présente "
 1569:                                             "plus d'une fois\n");
 1570:                                 }
 1571:                                 else
 1572:                                 {
 1573:                                     printf("+++Error : more than one -h "
 1574:                                             "on command line");
 1575:                                 }
 1576: 
 1577:                                 return(EXIT_FAILURE);
 1578:                             }
 1579: 
 1580:                             option_h = d_vrai;
 1581:                             informations(s_etat_processus);
 1582:                             break;
 1583:                         }
 1584: 
 1585:                         case 'i' :
 1586:                         {
 1587:                             if (option_i == d_vrai) 
 1588:                             {
 1589: #                               ifndef SEMAPHORES_NOMMES
 1590:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 1591:                                 sem_post(&semaphore_gestionnaires_signaux);
 1592:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 1593:                                 sem_destroy(&((*s_etat_processus)
 1594:                                         .semaphore_fork));
 1595: #                               else
 1596:                                 sem_post((*s_etat_processus).semaphore_fork);
 1597:                                 sem_post(semaphore_gestionnaires_signaux);
 1598:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 1599:                                         getpid(), SEM_SIGNAUX);
 1600:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 1601:                                         getpid(), pthread_self(), SEM_FORK);
 1602: #                               endif
 1603: 
 1604:                                 liberation_contexte_cas(s_etat_processus);
 1605:                                 liberation_queue_signaux(s_etat_processus);
 1606: 
 1607: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 1608:                                 stackoverflow_deinstall_handler();
 1609: #                               endif
 1610: 
 1611:                                 if ((*s_etat_processus).langue == 'F')
 1612:                                 {
 1613:                                     printf("+++Erreur : option -i présente "
 1614:                                             "plus d'une fois\n");
 1615:                                 }
 1616:                                 else
 1617:                                 {
 1618:                                     printf("+++Error : more than one -i "
 1619:                                             "on command line");
 1620:                                 }
 1621: 
 1622:                                 return(EXIT_FAILURE);
 1623:                             }
 1624:                             else if (option_S == d_vrai)
 1625:                             {
 1626: #                               ifndef SEMAPHORES_NOMMES
 1627:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 1628:                                 sem_post(&semaphore_gestionnaires_signaux);
 1629:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 1630:                                 sem_destroy(&((*s_etat_processus)
 1631:                                         .semaphore_fork));
 1632: #                               else
 1633:                                 sem_post((*s_etat_processus).semaphore_fork);
 1634:                                 sem_post(semaphore_gestionnaires_signaux);
 1635:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 1636:                                         getpid(), SEM_SIGNAUX);
 1637:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 1638:                                         getpid(), pthread_self(), SEM_FORK);
 1639: #                               endif
 1640: 
 1641:                                 liberation_contexte_cas(s_etat_processus);
 1642:                                 liberation_queue_signaux(s_etat_processus);
 1643: 
 1644: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 1645:                                 stackoverflow_deinstall_handler();
 1646: #                               endif
 1647: 
 1648:                                 if ((*s_etat_processus).langue == 'F')
 1649:                                 {
 1650:                                     printf("+++Erreur : options -i et -S "
 1651:                                             "incompatibles\n");
 1652:                                 }
 1653:                                 else
 1654:                                 {
 1655:                                     printf("+++Error : incompatible options -i "
 1656:                                             "and -S\n");
 1657:                                 }
 1658: 
 1659:                                 return(EXIT_FAILURE);
 1660:                             }
 1661:                             else if (option_p == d_vrai)
 1662:                             {
 1663: #                               ifndef SEMAPHORES_NOMMES
 1664:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 1665:                                 sem_post(&semaphore_gestionnaires_signaux);
 1666:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 1667:                                 sem_destroy(&((*s_etat_processus)
 1668:                                         .semaphore_fork));
 1669: #                               else
 1670:                                 sem_post((*s_etat_processus).semaphore_fork);
 1671:                                 sem_post(semaphore_gestionnaires_signaux);
 1672:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 1673:                                         getpid(), SEM_SIGNAUX);
 1674:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 1675:                                         getpid(), pthread_self(), SEM_FORK);
 1676: #                               endif
 1677: 
 1678:                                 liberation_contexte_cas(s_etat_processus);
 1679:                                 liberation_queue_signaux(s_etat_processus);
 1680: 
 1681: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 1682:                                 stackoverflow_deinstall_handler();
 1683: #                               endif
 1684: 
 1685:                                 if ((*s_etat_processus).langue == 'F')
 1686:                                 {
 1687:                                     printf("+++Erreur : options -i et -p "
 1688:                                             "incompatibles\n");
 1689:                                 }
 1690:                                 else
 1691:                                 {
 1692:                                     printf("+++Error : incompatible options -i "
 1693:                                             "and -p\n");
 1694:                                 }
 1695: 
 1696:                                 return(EXIT_FAILURE);
 1697:                             }
 1698: 
 1699:                             option_i = d_vrai;
 1700:                             mode_interactif = d_vrai;
 1701:                             presence_definition = 'O';
 1702:                             break;
 1703:                         }
 1704: 
 1705:                         case 'l' :
 1706:                         {
 1707:                             if (option_l == d_vrai)
 1708:                             {
 1709: #                               ifndef SEMAPHORES_NOMMES
 1710:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 1711:                                 sem_post(&semaphore_gestionnaires_signaux);
 1712:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 1713:                                 sem_destroy(&((*s_etat_processus)
 1714:                                         .semaphore_fork));
 1715: #                               else
 1716:                                 sem_post((*s_etat_processus).semaphore_fork);
 1717:                                 sem_post(semaphore_gestionnaires_signaux);
 1718:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 1719:                                         getpid(), SEM_SIGNAUX);
 1720:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 1721:                                         getpid(), pthread_self(), SEM_FORK);
 1722: #                               endif
 1723: 
 1724:                                 liberation_contexte_cas(s_etat_processus);
 1725:                                 liberation_queue_signaux(s_etat_processus);
 1726: 
 1727: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 1728:                                 stackoverflow_deinstall_handler();
 1729: #                               endif
 1730: 
 1731:                                 if ((*s_etat_processus).langue == 'F')
 1732:                                 {
 1733:                                     printf("+++Erreur : option -l présente "
 1734:                                             "plus d'une fois\n");
 1735:                                 }
 1736:                                 else
 1737:                                 {
 1738:                                     printf("+++Error : more than one -l "
 1739:                                             "on command line");
 1740:                                 }
 1741: 
 1742:                                 return(EXIT_FAILURE);
 1743:                             }
 1744: 
 1745:                             option_l = d_vrai;
 1746: 
 1747:                             if ((*s_etat_processus).langue == 'F')
 1748:                             {
 1749:                                 printf("%s\n\n", CeCILL_fr);
 1750:                             }
 1751:                             else
 1752:                             {
 1753:                                 printf("%s\n\n", CeCILL_en);
 1754:                             }
 1755: 
 1756:                             break;
 1757:                         }
 1758: 
 1759:                         case 'n' :
 1760:                         {
 1761:                             if (option_n == d_vrai)
 1762:                             {
 1763: #                               ifndef SEMAPHORES_NOMMES
 1764:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 1765:                                 sem_post(&semaphore_gestionnaires_signaux);
 1766:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 1767:                                 sem_destroy(&((*s_etat_processus)
 1768:                                         .semaphore_fork));
 1769: #                               else
 1770:                                 sem_post((*s_etat_processus).semaphore_fork);
 1771:                                 sem_post(semaphore_gestionnaires_signaux);
 1772:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 1773:                                         getpid(), SEM_SIGNAUX);
 1774:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 1775:                                         getpid(), pthread_self(), SEM_FORK);
 1776: #                               endif
 1777: 
 1778:                                 liberation_contexte_cas(s_etat_processus);
 1779:                                 liberation_queue_signaux(s_etat_processus);
 1780: 
 1781: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 1782:                                 stackoverflow_deinstall_handler();
 1783: #                               endif
 1784: 
 1785:                                 if ((*s_etat_processus).langue == 'F')
 1786:                                 {
 1787:                                     printf("+++Erreur : option -n présente "
 1788:                                             "plus d'une fois\n");
 1789:                                 }
 1790:                                 else
 1791:                                 {
 1792:                                     printf("+++Error : more than one -n "
 1793:                                             "on command line");
 1794:                                 }
 1795: 
 1796:                                 return(EXIT_FAILURE);
 1797:                             }
 1798: 
 1799:                             option_n = d_vrai;
 1800: 
 1801:                             break;
 1802:                         }
 1803: 
 1804:                         case 'p' :
 1805:                         {
 1806:                             if (option_p == d_vrai)
 1807:                             {
 1808: #                               ifndef SEMAPHORES_NOMMES
 1809:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 1810:                                 sem_post(&semaphore_gestionnaires_signaux);
 1811:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 1812:                                 sem_destroy(&((*s_etat_processus)
 1813:                                         .semaphore_fork));
 1814: #                               else
 1815:                                 sem_post((*s_etat_processus).semaphore_fork);
 1816:                                 sem_post(semaphore_gestionnaires_signaux);
 1817:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 1818:                                         getpid(), SEM_SIGNAUX);
 1819:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 1820:                                         getpid(), pthread_self(), SEM_FORK);
 1821: #                               endif
 1822: 
 1823:                                 liberation_contexte_cas(s_etat_processus);
 1824:                                 liberation_queue_signaux(s_etat_processus);
 1825: 
 1826: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 1827:                                 stackoverflow_deinstall_handler();
 1828: #                               endif
 1829: 
 1830:                                 if ((*s_etat_processus).langue == 'F')
 1831:                                 {
 1832:                                     printf("+++Erreur : option -p présente "
 1833:                                             "plus d'une fois\n");
 1834:                                 }
 1835:                                 else
 1836:                                 {
 1837:                                     printf("+++Error : more than one -p "
 1838:                                             "on command line");
 1839:                                 }
 1840: 
 1841:                                 return(EXIT_FAILURE);
 1842:                             }
 1843:                             else if (option_i == d_vrai)
 1844:                             {
 1845: #                               ifndef SEMAPHORES_NOMMES
 1846:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 1847:                                 sem_post(&semaphore_gestionnaires_signaux);
 1848:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 1849:                                 sem_destroy(&((*s_etat_processus)
 1850:                                         .semaphore_fork));
 1851: #                               else
 1852:                                 sem_post((*s_etat_processus).semaphore_fork);
 1853:                                 sem_post(semaphore_gestionnaires_signaux);
 1854:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 1855:                                         getpid(), SEM_SIGNAUX);
 1856:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 1857:                                         getpid(), pthread_self(), SEM_FORK);
 1858: #                               endif
 1859: 
 1860:                                 liberation_contexte_cas(s_etat_processus);
 1861:                                 liberation_queue_signaux(s_etat_processus);
 1862: 
 1863: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 1864:                                 stackoverflow_deinstall_handler();
 1865: #                               endif
 1866: 
 1867:                                 if ((*s_etat_processus).langue == 'F')
 1868:                                 {
 1869:                                     printf("+++Erreur : options -i et -p "
 1870:                                             "incompatibles\n");
 1871:                                 }
 1872:                                 else
 1873:                                 {
 1874:                                     printf("+++Error : incompatible options -i "
 1875:                                             "and -p\n");
 1876:                                 }
 1877: 
 1878:                                 return(EXIT_FAILURE);
 1879:                             }
 1880: 
 1881:                             option_p = d_vrai;
 1882: 
 1883:                             break;
 1884:                         }
 1885: 
 1886:                         case 'P' :
 1887:                         {
 1888:                             if (option_P > 2)
 1889:                             {
 1890: #                               ifndef SEMAPHORES_NOMMES
 1891:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 1892:                                 sem_post(&semaphore_gestionnaires_signaux);
 1893:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 1894:                                 sem_destroy(&((*s_etat_processus)
 1895:                                         .semaphore_fork));
 1896: #                               else
 1897:                                 sem_post((*s_etat_processus).semaphore_fork);
 1898:                                 sem_post(semaphore_gestionnaires_signaux);
 1899:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 1900:                                         getpid(), SEM_SIGNAUX);
 1901:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 1902:                                         getpid(), pthread_self(), SEM_FORK);
 1903: #                               endif
 1904: 
 1905:                                 liberation_contexte_cas(s_etat_processus);
 1906:                                 liberation_queue_signaux(s_etat_processus);
 1907: 
 1908: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 1909:                                 stackoverflow_deinstall_handler();
 1910: #                               endif
 1911: 
 1912:                                 if ((*s_etat_processus).langue == 'F')
 1913:                                 {
 1914:                                     printf("+++Erreur : option -P présente "
 1915:                                             "plus de deux fois\n");
 1916:                                 }
 1917:                                 else
 1918:                                 {
 1919:                                     printf("+++Error : more than two -P "
 1920:                                             "on command line");
 1921:                                 }
 1922: 
 1923:                                 return(EXIT_FAILURE);
 1924:                             }
 1925: 
 1926:                             option_P++;
 1927: 
 1928:                             break;
 1929:                         }
 1930: 
 1931:                         case 's' :
 1932:                         {
 1933:                             if (option_s == d_vrai)
 1934:                             {
 1935: #                               ifndef SEMAPHORES_NOMMES
 1936:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 1937:                                 sem_post(&semaphore_gestionnaires_signaux);
 1938:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 1939:                                 sem_destroy(&((*s_etat_processus)
 1940:                                         .semaphore_fork));
 1941: #                               else
 1942:                                 sem_post((*s_etat_processus).semaphore_fork);
 1943:                                 sem_post(semaphore_gestionnaires_signaux);
 1944:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 1945:                                         getpid(), SEM_SIGNAUX);
 1946:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 1947:                                         getpid(), pthread_self(), SEM_FORK);
 1948: #                               endif
 1949: 
 1950:                                 liberation_contexte_cas(s_etat_processus);
 1951:                                 liberation_queue_signaux(s_etat_processus);
 1952: 
 1953: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 1954:                                 stackoverflow_deinstall_handler();
 1955: #                               endif
 1956: 
 1957:                                 if ((*s_etat_processus).langue == 'F')
 1958:                                 {
 1959:                                     printf("+++Erreur : option -s présente "
 1960:                                             "plus d'une fois\n");
 1961:                                 }
 1962:                                 else
 1963:                                 {
 1964:                                     printf("+++Error : more than one -s "
 1965:                                             "on command line");
 1966:                                 }
 1967: 
 1968:                                 return(EXIT_FAILURE);
 1969:                             }
 1970: 
 1971:                             option_s = d_vrai;
 1972:                             drapeau_encart = 'N';
 1973:                             break;
 1974:                         }
 1975: 
 1976:                         case 'S' :
 1977:                         {
 1978:                             if (option_S == d_vrai)
 1979:                             {
 1980: #                               ifndef SEMAPHORES_NOMMES
 1981:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 1982:                                 sem_post(&semaphore_gestionnaires_signaux);
 1983:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 1984:                                 sem_destroy(&((*s_etat_processus)
 1985:                                         .semaphore_fork));
 1986: #                               else
 1987:                                 sem_post((*s_etat_processus).semaphore_fork);
 1988:                                 sem_post(semaphore_gestionnaires_signaux);
 1989:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 1990:                                         getpid(), SEM_SIGNAUX);
 1991:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 1992:                                         getpid(), pthread_self(), SEM_FORK);
 1993: #                               endif
 1994: 
 1995:                                 liberation_contexte_cas(s_etat_processus);
 1996:                                 liberation_queue_signaux(s_etat_processus);
 1997: 
 1998: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 1999:                                 stackoverflow_deinstall_handler();
 2000: #                               endif
 2001: 
 2002:                                 if ((*s_etat_processus).langue == 'F')
 2003:                                 {
 2004:                                     printf("+++Erreur : option -S présente "
 2005:                                             "plus d'une fois\n");
 2006:                                 }
 2007:                                 else
 2008:                                 {
 2009:                                     printf("+++Error : more than one -S "
 2010:                                             "on command line");
 2011:                                 }
 2012: 
 2013:                                 return(EXIT_FAILURE);
 2014:                             }
 2015:                             else if (option_i == d_vrai)
 2016:                             {
 2017: #                               ifndef SEMAPHORES_NOMMES
 2018:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 2019:                                 sem_post(&semaphore_gestionnaires_signaux);
 2020:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 2021:                                 sem_destroy(&((*s_etat_processus)
 2022:                                         .semaphore_fork));
 2023: #                               else
 2024:                                 sem_post((*s_etat_processus).semaphore_fork);
 2025:                                 sem_post(semaphore_gestionnaires_signaux);
 2026:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 2027:                                         getpid(), SEM_SIGNAUX);
 2028:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 2029:                                         getpid(), pthread_self(), SEM_FORK);
 2030: #                               endif
 2031: 
 2032:                                 liberation_contexte_cas(s_etat_processus);
 2033:                                 liberation_queue_signaux(s_etat_processus);
 2034: 
 2035: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 2036:                                 stackoverflow_deinstall_handler();
 2037: #                               endif
 2038: 
 2039:                                 if ((*s_etat_processus).langue == 'F')
 2040:                                 {
 2041:                                     printf("+++Erreur : options -i et -S "
 2042:                                             "incompatibles\n");
 2043:                                 }
 2044:                                 else
 2045:                                 {
 2046:                                     printf("+++Error : incompatible options -S "
 2047:                                             "and -i\n");
 2048:                                 }
 2049: 
 2050:                                 return(EXIT_FAILURE);
 2051:                             }
 2052: 
 2053:                             option_S = d_vrai;
 2054: 
 2055:                             while(*(++argv[0]) == ' ');
 2056:                             argv[0]--;
 2057: 
 2058:                             if ((*(++argv[0])) != '\0')
 2059:                             {
 2060:                                 if (((*s_etat_processus).definitions_chainees =
 2061:                                         malloc((strlen(argv[0]) + 1) *
 2062:                                         sizeof(unsigned char))) == NULL)
 2063:                                 {
 2064: #                                   ifndef SEMAPHORES_NOMMES
 2065:                                     sem_post(&((*s_etat_processus)
 2066:                                             .semaphore_fork));
 2067:                                     sem_post(&semaphore_gestionnaires_signaux);
 2068:                                     sem_destroy(
 2069:                                             &semaphore_gestionnaires_signaux);
 2070:                                     sem_destroy(&((*s_etat_processus)
 2071:                                             .semaphore_fork));
 2072: #                                   else
 2073:                                     sem_post((*s_etat_processus)
 2074:                                             .semaphore_fork);
 2075:                                     sem_post(semaphore_gestionnaires_signaux);
 2076:                                     sem_destroy2(
 2077:                                             semaphore_gestionnaires_signaux,
 2078:                                             getpid(), SEM_SIGNAUX);
 2079:                                     sem_destroy3((*s_etat_processus)
 2080:                                             .semphore_fork, getpid(),
 2081:                                             pthread_self(), SEM_FORK);
 2082: #                                   endif
 2083: 
 2084:                                     liberation_contexte_cas(s_etat_processus);
 2085:                                     liberation_queue_signaux(s_etat_processus);
 2086: 
 2087: #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
 2088:                                     stackoverflow_deinstall_handler();
 2089: #                                   endif
 2090: 
 2091:                                     if ((*s_etat_processus).langue == 'F')
 2092:                                     {
 2093:                                         printf("+++Système : Mémoire "
 2094:                                                 "insuffisante\n");
 2095:                                     }
 2096:                                     else
 2097:                                     {
 2098:                                         printf("+++System : Not enough "
 2099:                                                 "memory\n");
 2100:                                     }
 2101: 
 2102:                                     return(EXIT_FAILURE);
 2103:                                 }
 2104: 
 2105:                                 ptr = (*s_etat_processus).definitions_chainees;
 2106: 
 2107:                                 while(*(argv[0]) != '\0')
 2108:                                 {
 2109:                                     *(ptr++) = *(argv[0]++);
 2110:                                 }
 2111: 
 2112:                                 (*ptr) = '\0';
 2113: 
 2114:                                 argv[0]--;
 2115:                                 presence_definition = 'O';
 2116:                             }
 2117:                             else if ((--argc) > 0)
 2118:                             {
 2119:                                 argv++;
 2120: 
 2121:                                 if (((*s_etat_processus).definitions_chainees =
 2122:                                         malloc((strlen(argv[0]) + 1) *
 2123:                                         sizeof(unsigned char))) == NULL)
 2124:                                 {
 2125: #                                   ifndef SEMAPHORES_NOMMES
 2126:                                     sem_post(&((*s_etat_processus)
 2127:                                             .semaphore_fork));
 2128:                                     sem_post(&semaphore_gestionnaires_signaux);
 2129:                                     sem_destroy(
 2130:                                             &semaphore_gestionnaires_signaux);
 2131:                                     sem_destroy(&((*s_etat_processus)
 2132:                                             .semaphore_fork));
 2133: #                                   else
 2134:                                     sem_post((*s_etat_processus)
 2135:                                             .semaphore_fork);
 2136:                                     sem_post(semaphore_gestionnaires_signaux);
 2137:                                     sem_destroy2(
 2138:                                             semaphore_gestionnaires_signaux,
 2139:                                             getpid(), SEM_SIGNAUX);
 2140:                                     sem_destroy3((*s_etat_processus)
 2141:                                             .semphore_fork, getpid(),
 2142:                                             pthread_self(), SEM_FORK);
 2143: #                                   endif
 2144: 
 2145:                                     liberation_contexte_cas(s_etat_processus);
 2146:                                     liberation_queue_signaux(s_etat_processus);
 2147: 
 2148: #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
 2149:                                     stackoverflow_deinstall_handler();
 2150: #                                   endif
 2151: 
 2152:                                     if ((*s_etat_processus).langue == 'F')
 2153:                                     {
 2154:                                         printf("+++Système : Mémoire "
 2155:                                                 "insuffisante\n");
 2156:                                     }
 2157:                                     else
 2158:                                     {
 2159:                                         printf("+++System : Not enough "
 2160:                                                 "memory\n");
 2161:                                     }
 2162: 
 2163:                                     return(EXIT_FAILURE);
 2164:                                 }
 2165: 
 2166:                                 ptr = (*s_etat_processus).definitions_chainees;
 2167: 
 2168:                                 while(*(argv[0]) != '\0')
 2169:                                 {
 2170:                                     *(ptr++) = *(argv[0]++);
 2171:                                 }
 2172: 
 2173:                                 (*ptr) = '\0';
 2174: 
 2175:                                 argv[0]--;
 2176:                                 presence_definition = 'O';
 2177:                             }
 2178:                             else
 2179:                             {
 2180: #                               ifndef SEMAPHORES_NOMMES
 2181:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 2182:                                 sem_post(&semaphore_gestionnaires_signaux);
 2183:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 2184:                                 sem_destroy(&((*s_etat_processus)
 2185:                                         .semaphore_fork));
 2186: #                               else
 2187:                                 sem_post((*s_etat_processus).semaphore_fork);
 2188:                                 sem_post(semaphore_gestionnaires_signaux);
 2189:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 2190:                                         getpid(), SEM_SIGNAUX);
 2191:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 2192:                                         getpid(), pthread_self(), SEM_FORK);
 2193: #                               endif
 2194: 
 2195:                                 liberation_contexte_cas(s_etat_processus);
 2196:                                 liberation_queue_signaux(s_etat_processus);
 2197: 
 2198: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 2199:                                 stackoverflow_deinstall_handler();
 2200: #                               endif
 2201: 
 2202:                                 if ((*s_etat_processus).langue == 'F')
 2203:                                 {
 2204:                                     printf("+++Erreur : Aucun script "
 2205:                                             "spécifié après l'option -S\n");
 2206:                                 }
 2207:                                 else
 2208:                                 {
 2209:                                     printf("+++Error : Script required after "
 2210:                                             "-S option\n");
 2211:                                 }
 2212: 
 2213:                                 return(EXIT_FAILURE);
 2214:                             }
 2215: 
 2216:                             if (((*s_etat_processus).definitions_chainees =
 2217:                                     compactage((*s_etat_processus)
 2218:                                     .definitions_chainees)) == NULL)
 2219:                             {
 2220: #                               ifndef SEMAPHORES_NOMMES
 2221:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 2222:                                 sem_post(&semaphore_gestionnaires_signaux);
 2223:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 2224:                                 sem_destroy(&((*s_etat_processus)
 2225:                                         .semaphore_fork));
 2226: #                               else
 2227:                                 sem_post((*s_etat_processus).semaphore_fork);
 2228:                                 sem_post(semaphore_gestionnaires_signaux);
 2229:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 2230:                                         getpid(), SEM_SIGNAUX);
 2231:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 2232:                                         getpid(), pthread_self(), SEM_FORK);
 2233: #                               endif
 2234: 
 2235:                                 liberation_contexte_cas(s_etat_processus);
 2236:                                 liberation_queue_signaux(s_etat_processus);
 2237: 
 2238: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 2239:                                 stackoverflow_deinstall_handler();
 2240: #                               endif
 2241: 
 2242:                                 if ((*s_etat_processus).langue == 'F')
 2243:                                 {
 2244:                                     printf("+++Système : Mémoire "
 2245:                                             "insuffisante\n");
 2246:                                 }
 2247:                                 else
 2248:                                 {
 2249:                                     printf("+++System : Not enough "
 2250:                                             "memory\n");
 2251:                                 }
 2252: 
 2253:                                 return(EXIT_FAILURE);
 2254:                             }
 2255: 
 2256:                             (*s_etat_processus).longueur_definitions_chainees =
 2257:                                     (integer8) strlen((*s_etat_processus)
 2258:                                     .definitions_chainees);
 2259: 
 2260:                             break;
 2261:                         }
 2262: 
 2263:                         case 't' :
 2264:                         {
 2265:                             if (option_t == d_vrai)
 2266:                             {
 2267: #                               ifndef SEMAPHORES_NOMMES
 2268:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 2269:                                 sem_post(&semaphore_gestionnaires_signaux);
 2270:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 2271:                                 sem_destroy(&((*s_etat_processus)
 2272:                                         .semaphore_fork));
 2273: #                               else
 2274:                                 sem_post((*s_etat_processus).semaphore_fork);
 2275:                                 sem_post(semaphore_gestionnaires_signaux);
 2276:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 2277:                                         getpid(), SEM_SIGNAUX);
 2278:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 2279:                                         getpid(), pthread_self(), SEM_FORK);
 2280: #                               endif
 2281: 
 2282:                                 liberation_contexte_cas(s_etat_processus);
 2283:                                 liberation_queue_signaux(s_etat_processus);
 2284: 
 2285: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 2286:                                 stackoverflow_deinstall_handler();
 2287: #                               endif
 2288: 
 2289:                                 if ((*s_etat_processus).langue == 'F')
 2290:                                 {
 2291:                                     printf("+++Erreur : option -t présente "
 2292:                                             "plus d'une fois\n");
 2293:                                 }
 2294:                                 else
 2295:                                 {
 2296:                                     printf("+++Error : more than one -t "
 2297:                                             "on command line");
 2298:                                 }
 2299: 
 2300:                                 return(EXIT_FAILURE);
 2301:                             }
 2302: 
 2303:                             option_t = d_vrai;
 2304:                             (*s_etat_processus).debug = d_vrai;
 2305: 
 2306:                             while(*(++argv[0]) == ' ');
 2307:                             argv[0]--;
 2308: 
 2309:                             if ((*(++argv[0])) != '\0')
 2310:                             {
 2311:                                 if ((type_debug = malloc((strlen(argv[0]) + 1) *
 2312:                                         sizeof(unsigned char))) == NULL)
 2313:                                 {
 2314: #                                   ifndef SEMAPHORES_NOMMES
 2315:                                     sem_post(&((*s_etat_processus)
 2316:                                             .semaphore_fork));
 2317:                                     sem_post(&semaphore_gestionnaires_signaux);
 2318:                                     sem_destroy(
 2319:                                             &semaphore_gestionnaires_signaux);
 2320:                                     sem_destroy(&((*s_etat_processus)
 2321:                                             .semaphore_fork));
 2322: #                                   else
 2323:                                     sem_post((*s_etat_processus)
 2324:                                             .semaphore_fork);
 2325:                                     sem_post(semaphore_gestionnaires_signaux);
 2326:                                     sem_destroy2(
 2327:                                             semaphore_gestionnaires_signaux,
 2328:                                             getpid(), SEM_SIGNAUX);
 2329:                                     sem_destroy3((*s_etat_processus)
 2330:                                             .semphore_fork, getpid(),
 2331:                                             pthread_self(), SEM_FORK);
 2332: #                                   endif
 2333: 
 2334:                                     liberation_contexte_cas(s_etat_processus);
 2335:                                     liberation_queue_signaux(s_etat_processus);
 2336: 
 2337: #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
 2338:                                     stackoverflow_deinstall_handler();
 2339: #                                   endif
 2340: 
 2341:                                     if ((*s_etat_processus).langue == 'F')
 2342:                                     {
 2343:                                         printf("+++Système : Mémoire "
 2344:                                                 "insuffisante\n");
 2345:                                     }
 2346:                                     else
 2347:                                     {
 2348:                                         printf("+++System : Not enough "
 2349:                                                 "memory\n");
 2350:                                     }
 2351: 
 2352:                                     return(EXIT_FAILURE);
 2353:                                 }
 2354: 
 2355:                                 ptr = type_debug;
 2356: 
 2357:                                 while((*(argv[0]) != '\0') &&
 2358:                                         (*(argv[0]) != ' '))
 2359:                                 {
 2360:                                     *(ptr++) = *(argv[0]++);
 2361:                                 }
 2362: 
 2363:                                 (*ptr) = '\0';
 2364: 
 2365:                                 argv[0]--;
 2366:                             }
 2367:                             else if ((--argc) > 0)
 2368:                             {
 2369:                                 argv++;
 2370: 
 2371:                                 if ((type_debug =
 2372:                                         malloc((strlen(argv[0]) + 1) *
 2373:                                         sizeof(unsigned char))) == NULL)
 2374:                                 {
 2375: #                                   ifndef SEMAPHORES_NOMMES
 2376:                                     sem_post(&((*s_etat_processus)
 2377:                                             .semaphore_fork));
 2378:                                     sem_post(&semaphore_gestionnaires_signaux);
 2379:                                     sem_destroy(
 2380:                                             &semaphore_gestionnaires_signaux);
 2381:                                     sem_destroy(&((*s_etat_processus)
 2382:                                             .semaphore_fork));
 2383: #                                   else
 2384:                                     sem_post((*s_etat_processus)
 2385:                                             .semaphore_fork);
 2386:                                     sem_post(semaphore_gestionnaires_signaux);
 2387:                                     sem_destroy2(
 2388:                                             semaphore_gestionnaires_signaux,
 2389:                                             getpid(), SEM_SIGNAUX);
 2390:                                     sem_destroy3((*s_etat_processus)
 2391:                                             .semphore_fork, getpid(),
 2392:                                             pthread_self(), SEM_FORK);
 2393: #                                   endif
 2394: 
 2395:                                     liberation_contexte_cas(s_etat_processus);
 2396:                                     liberation_queue_signaux(s_etat_processus);
 2397: 
 2398: #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
 2399:                                     stackoverflow_deinstall_handler();
 2400: #                                   endif
 2401: 
 2402:                                     if ((*s_etat_processus).langue == 'F')
 2403:                                     {
 2404:                                         printf("+++Système : Mémoire "
 2405:                                                 "insuffisante\n");
 2406:                                     }
 2407:                                     else
 2408:                                     {
 2409:                                         printf("+++System : Not enough "
 2410:                                                 "memory\n");
 2411:                                     }
 2412: 
 2413:                                     return(EXIT_FAILURE);
 2414:                                 }
 2415: 
 2416:                                 ptr = type_debug;
 2417: 
 2418:                                 while(*(argv[0]) != '\0')
 2419:                                 {
 2420:                                     *(ptr++) = *(argv[0]++);
 2421:                                 }
 2422: 
 2423:                                 (*ptr) = '\0';
 2424: 
 2425:                                 argv[0]--;
 2426:                             }
 2427:                             else
 2428:                             {
 2429: #                               ifndef SEMAPHORES_NOMMES
 2430:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 2431:                                 sem_post(&semaphore_gestionnaires_signaux);
 2432:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 2433:                                 sem_destroy(&((*s_etat_processus)
 2434:                                         .semaphore_fork));
 2435: #                               else
 2436:                                 sem_post((*s_etat_processus).semaphore_fork);
 2437:                                 sem_post(semaphore_gestionnaires_signaux);
 2438:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 2439:                                         getpid(), SEM_SIGNAUX);
 2440:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 2441:                                         getpid(), pthread_self(), SEM_FORK);
 2442: #                               endif
 2443: 
 2444:                                 liberation_contexte_cas(s_etat_processus);
 2445:                                 liberation_queue_signaux(s_etat_processus);
 2446: 
 2447: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 2448:                                 stackoverflow_deinstall_handler();
 2449: #                               endif
 2450: 
 2451:                                 if ((*s_etat_processus).langue == 'F')
 2452:                                 {
 2453:                                     printf("+++Erreur : Aucun niveau "
 2454:                                             "de débogage spécifié après "
 2455:                                             "l'option -t\n");
 2456:                                 }
 2457:                                 else
 2458:                                 {
 2459:                                     printf("+++Error : Debug level not "
 2460:                                             "specified after -t option\n");
 2461:                                 }
 2462: 
 2463:                                 return(EXIT_FAILURE);
 2464:                             }
 2465: 
 2466:                             ptr = type_debug;
 2467: 
 2468:                             while(*ptr != '\0')
 2469:                             {
 2470:                                 switch(*ptr)
 2471:                                 {
 2472:                                     case '0':
 2473:                                     case '1':
 2474:                                     case '2':
 2475:                                     case '3':
 2476:                                     case '4':
 2477:                                     case '5':
 2478:                                     case '6':
 2479:                                     case '7':
 2480:                                     case '8':
 2481:                                     case '9':
 2482:                                     case 'A':
 2483:                                     case 'B':
 2484:                                     case 'C':
 2485:                                     case 'D':
 2486:                                     case 'E':
 2487:                                     case 'F':
 2488:                                     {
 2489:                                         break;
 2490:                                     }
 2491: 
 2492:                                     default:
 2493:                                     {
 2494: #                                       ifndef SEMAPHORES_NOMMES
 2495:                                         sem_post(&((*s_etat_processus)
 2496:                                                 .semaphore_fork));
 2497:                                         sem_post(
 2498:                                                 &semaphore_gestionnaires_signaux
 2499:                                                 );
 2500:                                         sem_destroy(
 2501:                                                 &semaphore_gestionnaires_signaux
 2502:                                                 );
 2503:                                         sem_destroy(&((*s_etat_processus)
 2504:                                                 .semaphore_fork));
 2505: #                                       else
 2506:                                         sem_post((*s_etat_processus)
 2507:                                                 .semaphore_fork);
 2508:                                         sem_post(
 2509:                                                 semaphore_gestionnaires_signaux
 2510:                                                 );
 2511:                                         sem_destroy2(
 2512:                                                 semaphore_gestionnaires_signaux,
 2513:                                                 getpid(), SEM_SIGNAUX);
 2514:                                         sem_destroy3((*s_etat_processus)
 2515:                                                 .semphore_fork, getpid(),
 2516:                                                 pthread_self(), SEM_FORK);
 2517: #                                       endif
 2518: 
 2519:                                         liberation_contexte_cas(
 2520:                                                 s_etat_processus);
 2521:                                         liberation_queue_signaux(
 2522:                                                 s_etat_processus);
 2523: 
 2524: #                                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
 2525:                                         stackoverflow_deinstall_handler();
 2526: #                                       endif
 2527: 
 2528:                                         if ((*s_etat_processus).langue == 'F')
 2529:                                         {
 2530:                                             printf("+++Erreur : Niveau "
 2531:                                                     "de débogage non "
 2532:                                                     "hexadécimal\n");
 2533:                                         }
 2534:                                         else
 2535:                                         {
 2536:                                             printf("+++Error : Debug level must"
 2537:                                                     " be hexadecimal "
 2538:                                                     "integer\n");
 2539:                                         }
 2540: 
 2541:                                         return(EXIT_FAILURE);
 2542:                                     }
 2543:                                 }
 2544: 
 2545:                                 ptr++;
 2546:                             }
 2547: 
 2548:                             if (sscanf(type_debug, "%llX",
 2549:                                     &((*s_etat_processus).type_debug)) != 1)
 2550:                             {
 2551: #                               ifndef SEMAPHORES_NOMMES
 2552:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 2553:                                 sem_post(&semaphore_gestionnaires_signaux);
 2554:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 2555:                                 sem_destroy(&((*s_etat_processus)
 2556:                                         .semaphore_fork));
 2557: #                               else
 2558:                                 sem_post((*s_etat_processus).semaphore_fork);
 2559:                                 sem_post(semaphore_gestionnaires_signaux);
 2560:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 2561:                                         getpid(), SEM_SIGNAUX);
 2562:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 2563:                                         getpid(), pthread_self(), SEM_FORK);
 2564: #                               endif
 2565: 
 2566:                                 liberation_contexte_cas(s_etat_processus);
 2567:                                 liberation_queue_signaux(s_etat_processus);
 2568: 
 2569: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 2570:                                 stackoverflow_deinstall_handler();
 2571: #                               endif
 2572: 
 2573:                                 if ((*s_etat_processus).langue == 'F')
 2574:                                 {
 2575:                                     printf("+++Erreur : Niveau "
 2576:                                             "de débogage non entier\n");
 2577:                                 }
 2578:                                 else
 2579:                                 {
 2580:                                     printf("+++Error : Debug level must"
 2581:                                             " be integer\n");
 2582:                                 }
 2583: 
 2584:                                 return(EXIT_FAILURE);
 2585:                             }
 2586: 
 2587:                             free(type_debug);
 2588:                             break;
 2589:                         }
 2590: 
 2591:                         case 'v' :
 2592:                         {
 2593:                             if (option_v == d_vrai)
 2594:                             {
 2595: #                               ifndef SEMAPHORES_NOMMES
 2596:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 2597:                                 sem_post(&semaphore_gestionnaires_signaux);
 2598:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 2599:                                 sem_destroy(&((*s_etat_processus)
 2600:                                         .semaphore_fork));
 2601: #                               else
 2602:                                 sem_post((*s_etat_processus).semaphore_fork);
 2603:                                 sem_post(semaphore_gestionnaires_signaux);
 2604:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 2605:                                         getpid(), SEM_SIGNAUX);
 2606:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 2607:                                         getpid(), pthread_self(), SEM_FORK);
 2608: #                               endif
 2609: 
 2610:                                 liberation_contexte_cas(s_etat_processus);
 2611:                                 liberation_queue_signaux(s_etat_processus);
 2612: 
 2613: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 2614:                                 stackoverflow_deinstall_handler();
 2615: #                               endif
 2616: 
 2617:                                 if ((*s_etat_processus).langue == 'F')
 2618:                                 {
 2619:                                     printf("+++Erreur : option -v présente "
 2620:                                             "plus d'une fois\n");
 2621:                                 }
 2622:                                 else
 2623:                                 {
 2624:                                     printf("+++Error : more than one -v "
 2625:                                             "on command line");
 2626:                                 }
 2627: 
 2628:                                 return(EXIT_FAILURE);
 2629:                             }
 2630: 
 2631:                             option_v = d_vrai;
 2632:                             printf("\n");
 2633: 
 2634:                             if ((*s_etat_processus).langue == 'F')
 2635:                             {
 2636:                                 printf("  Reverse Polish Lisp/2 version %s "
 2637:                                         "pour systèmes "
 2638:                                         "POSIX\n", d_version_rpl);
 2639:                                 printf("      Langage procédural de très haut "
 2640:                                         "niveau, semi-compilé, "
 2641:                                         "extensible,\n");
 2642:                                 printf("      destiné principalement aux "
 2643:                                         "calculs scientifiques et "
 2644:                                         "symboliques\n");
 2645:                                 printf("%s\n", copyright);
 2646:                             }
 2647:                             else
 2648:                             {
 2649:                                 printf("  Reverse Polish Lisp/2 version %s "
 2650:                                         "for POSIX operating systems\n",
 2651:                                         d_version_rpl);
 2652:                                 printf("      Half-compiled, high-level "
 2653:                                         "procedural language,\n");
 2654:                                 printf("      mainly aiming at scientific "
 2655:                                         "calculations\n");
 2656:                                 printf("%s\n", copyright_anglais);
 2657:                             }
 2658: 
 2659:                             printf("\n");
 2660:                             break;
 2661:                         }
 2662: 
 2663:                         case '-':
 2664:                         case ' ':
 2665:                         {
 2666:                             break;
 2667:                         }
 2668: 
 2669:                         default :
 2670:                         {
 2671:                             if ((*s_etat_processus).langue == 'F')
 2672:                             {
 2673:                                 printf("+++Information : Option -%c inconnue\n",
 2674:                                         option);
 2675:                             }
 2676:                             else
 2677:                             {
 2678:                                 printf("+++Warning : -%c option unknown\n",
 2679:                                         option);
 2680:                             }
 2681: 
 2682:                             informations(s_etat_processus);
 2683:                             break;
 2684:                         }
 2685:                     }
 2686:                 }
 2687:             }
 2688:             else
 2689:             {
 2690:                 if (presence_definition == 'O')
 2691:                 {
 2692:                     argc = 0;
 2693: 
 2694:                     if ((*s_etat_processus).langue == 'F')
 2695:                     {
 2696:                         printf("+++Erreur : Plusieurs définitions\n");
 2697:                     }
 2698:                     else
 2699:                     {
 2700:                         printf("+++Error : More than one definition\n");
 2701:                     }
 2702: 
 2703:                     erreur = d_erreur;
 2704:                 }
 2705:                 else
 2706:                 {
 2707:                     (*s_etat_processus).nom_fichier_source = argv[0];
 2708:                     presence_definition = 'O';
 2709:                 }
 2710:             }
 2711:         }
 2712: 
 2713:         /*
 2714:          * Dans le cas où le programme est appelé avec l'option -d,
 2715:          * on ne récupère par les signaux de violation d'accès. On
 2716:          * tente simplement la récupération des dépassements de pile.
 2717:          */
 2718: 
 2719:         if (debug == d_faux)
 2720:         {
 2721: #   ifdef HAVE_SIGSEGV_RECOVERY
 2722:             if (sigsegv_install_handler(interruption_violation_access) != 0)
 2723:             {
 2724: #               ifndef SEMAPHORES_NOMMES
 2725:                     sem_post(&((*s_etat_processus).semaphore_fork));
 2726:                     sem_post(&semaphore_gestionnaires_signaux);
 2727:                     sem_destroy(&semaphore_gestionnaires_signaux);
 2728:                     sem_destroy(&((*s_etat_processus)
 2729:                             .semaphore_fork));
 2730: #               else
 2731:                     sem_post((*s_etat_processus).semaphore_fork);
 2732:                     sem_post(semaphore_gestionnaires_signaux);
 2733:                     sem_destroy2(semaphore_gestionnaires_signaux,
 2734:                             getpid(), SEM_SIGNAUX);
 2735:                     sem_destroy3((*s_etat_processus).semphore_fork,
 2736:                             getpid(), pthread_self(), SEM_FORK);
 2737: #               endif
 2738: 
 2739:                 liberation_contexte_cas(s_etat_processus);
 2740:                 liberation_queue_signaux(s_etat_processus);
 2741: 
 2742: #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 2743:                     stackoverflow_deinstall_handler();
 2744: #               endif
 2745: 
 2746:                 erreur = d_es_signal;
 2747: 
 2748:                 if ((*s_etat_processus).langue == 'F')
 2749:                 {
 2750:                     printf("+++Système : Initialisation de la pile alternative "
 2751:                             "impossible\n");
 2752:                 }
 2753:                 else
 2754:                 {
 2755:                     printf("+++System : Initialization of alternate "
 2756:                             "stack failed\n");
 2757:                 }
 2758: 
 2759:                 return(EXIT_FAILURE);
 2760:             }
 2761: #   else
 2762:             action.sa_handler = interruption3;
 2763:             action.sa_flags = 0;
 2764: 
 2765:             if (sigaction(SIGSEGV, &action, NULL) != 0)
 2766:             {
 2767: #               ifndef SEMAPHORES_NOMMES
 2768:                     sem_post(&((*s_etat_processus).semaphore_fork));
 2769:                     sem_post(&semaphore_gestionnaires_signaux);
 2770:                     sem_destroy(&semaphore_gestionnaires_signaux);
 2771:                     sem_destroy(&((*s_etat_processus)
 2772:                             .semaphore_fork));
 2773: #               else
 2774:                     sem_post((*s_etat_processus).semaphore_fork);
 2775:                     sem_post(semaphore_gestionnaires_signaux);
 2776:                     sem_destroy2(semaphore_gestionnaires_signaux,
 2777:                             getpid(), SEM_SIGNAUX);
 2778:                     sem_destroy3((*s_etat_processus).semphore_fork,
 2779:                             getpid(), pthread_self(), SEM_FORK);
 2780: #               endif
 2781: 
 2782:                 liberation_contexte_cas(s_etat_processus);
 2783:                 liberation_queue_signaux(s_etat_processus);
 2784: 
 2785: #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 2786:                     stackoverflow_deinstall_handler();
 2787: #               endif
 2788: 
 2789:                 if ((*s_etat_processus).langue == 'F')
 2790:                 {
 2791:                     printf("+++Système : Initialisation des signaux POSIX "
 2792:                             "impossible\n");
 2793:                 }
 2794:                 else
 2795:                 {
 2796:                     printf("+++System : Initialization of POSIX signals "
 2797:                             "failed\n");
 2798:                 }
 2799: 
 2800:                 return(EXIT_FAILURE);
 2801:             }
 2802: 
 2803:             signal_test = SIGTEST;
 2804:             raise(SIGSEGV);
 2805: 
 2806:             attente.tv_sec = 0;
 2807:             attente.tv_nsec = 1000000;
 2808: 
 2809:             for(i = 0; (i < 1000) && (signal_test == SIGTEST); i++)
 2810:             {
 2811:                 nanosleep(&attente, NULL);
 2812:             }
 2813: 
 2814:             if (signal_test != SIGSEGV)
 2815:             {
 2816: #               ifndef SEMAPHORES_NOMMES
 2817:                     sem_post(&((*s_etat_processus).semaphore_fork));
 2818:                     sem_post(&semaphore_gestionnaires_signaux);
 2819:                     sem_destroy(&semaphore_gestionnaires_signaux);
 2820:                     sem_destroy(&((*s_etat_processus)
 2821:                             .semaphore_fork));
 2822: #               else
 2823:                     sem_post((*s_etat_processus).semaphore_fork);
 2824:                     sem_post(semaphore_gestionnaires_signaux);
 2825:                     sem_destroy2(semaphore_gestionnaires_signaux,
 2826:                             getpid(), SEM_SIGNAUX);
 2827:                     sem_destroy3((*s_etat_processus).semphore_fork,
 2828:                             getpid(), pthread_self(), SEM_FORK);
 2829: #               endif
 2830: 
 2831:                 liberation_contexte_cas(s_etat_processus);
 2832:                 liberation_queue_signaux(s_etat_processus);
 2833: 
 2834: #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 2835:                     stackoverflow_deinstall_handler();
 2836: #               endif
 2837: 
 2838:                 erreur = d_es_signal;
 2839: 
 2840:                 if ((*s_etat_processus).langue == 'F')
 2841:                 {
 2842:                     printf("+++Système : Initialisation des signaux POSIX "
 2843:                             "impossible\n");
 2844:                 }
 2845:                 else
 2846:                 {
 2847:                     printf("+++System : Initialization of POSIX signals "
 2848:                             "failed\n");
 2849:                 }
 2850: 
 2851:                 return(EXIT_FAILURE);
 2852:             }
 2853: #   endif
 2854: 
 2855:             action.sa_handler = interruption3;
 2856:             action.sa_flags = 0;
 2857: 
 2858:             if (sigaction(SIGBUS, &action, NULL) != 0)
 2859:             {
 2860: #               ifndef SEMAPHORES_NOMMES
 2861:                     sem_post(&((*s_etat_processus).semaphore_fork));
 2862:                     sem_post(&semaphore_gestionnaires_signaux);
 2863:                     sem_destroy(&semaphore_gestionnaires_signaux);
 2864:                     sem_destroy(&((*s_etat_processus)
 2865:                             .semaphore_fork));
 2866: #               else
 2867:                     sem_post((*s_etat_processus).semaphore_fork);
 2868:                     sem_post(semaphore_gestionnaires_signaux);
 2869:                     sem_destroy2(semaphore_gestionnaires_signaux,
 2870:                             getpid(), SEM_SIGNAUX);
 2871:                     sem_destroy3((*s_etat_processus).semphore_fork,
 2872:                             getpid(), pthread_self(), SEM_FORK);
 2873: #               endif
 2874: 
 2875:                 liberation_contexte_cas(s_etat_processus);
 2876:                 liberation_queue_signaux(s_etat_processus);
 2877: 
 2878: #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 2879:                     stackoverflow_deinstall_handler();
 2880: #               endif
 2881: 
 2882: #               ifdef HAVE_SIGSEGV_RECOVERY
 2883:                     if (debug == d_faux)
 2884:                     {
 2885:                         sigsegv_deinstall_handler();
 2886:                     }
 2887: #               endif
 2888: 
 2889:                 if ((*s_etat_processus).langue == 'F')
 2890:                 {
 2891:                     printf("+++Système : Initialisation des signaux POSIX "
 2892:                             "impossible\n");
 2893:                 }
 2894:                 else
 2895:                 {
 2896:                     printf("+++System : Initialization of POSIX signals "
 2897:                             "failed\n");
 2898:                 }
 2899: 
 2900:                 return(EXIT_FAILURE);
 2901:             }
 2902: 
 2903:             signal_test = SIGTEST;
 2904:             raise(SIGBUS);
 2905: 
 2906:             attente.tv_sec = 0;
 2907:             attente.tv_nsec = 1000000;
 2908: 
 2909:             for(i = 0; (i < 1000) && (signal_test == SIGTEST); i++)
 2910:             {
 2911:                 nanosleep(&attente, NULL);
 2912:             }
 2913: 
 2914:             if (signal_test != SIGBUS)
 2915:             {
 2916: #               ifndef SEMAPHORES_NOMMES
 2917:                     sem_post(&((*s_etat_processus).semaphore_fork));
 2918:                     sem_post(&semaphore_gestionnaires_signaux);
 2919:                     sem_destroy(&semaphore_gestionnaires_signaux);
 2920:                     sem_destroy(&((*s_etat_processus)
 2921:                             .semaphore_fork));
 2922: #               else
 2923:                     sem_post((*s_etat_processus).semaphore_fork);
 2924:                     sem_post(semaphore_gestionnaires_signaux);
 2925:                     sem_destroy2(semaphore_gestionnaires_signaux,
 2926:                             getpid(), SEM_SIGNAUX);
 2927:                     sem_destroy3((*s_etat_processus).semphore_fork,
 2928:                             getpid(), pthread_self(), SEM_FORK);
 2929: #               endif
 2930: 
 2931:                 liberation_contexte_cas(s_etat_processus);
 2932:                 liberation_queue_signaux(s_etat_processus);
 2933: 
 2934: #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 2935:                     stackoverflow_deinstall_handler();
 2936: #               endif
 2937: 
 2938: #               ifdef HAVE_SIGSEGV_RECOVERY
 2939:                     if (debug == d_faux)
 2940:                     {
 2941:                         sigsegv_deinstall_handler();
 2942:                     }
 2943: #               endif
 2944: 
 2945:                 erreur = d_es_signal;
 2946: 
 2947:                 if ((*s_etat_processus).langue == 'F')
 2948:                 {
 2949:                     printf("+++Système : Initialisation des signaux POSIX "
 2950:                             "impossible\n");
 2951:                 }
 2952:                 else
 2953:                 {
 2954:                     printf("+++System : Initialization of POSIX signals "
 2955:                             "failed\n");
 2956:                 }
 2957: 
 2958:                 return(EXIT_FAILURE);
 2959:             }
 2960: 
 2961:         }
 2962: 
 2963:         if (option_n == d_vrai)
 2964:         {
 2965:             action.sa_handler = interruption4;
 2966:             action.sa_flags = 0;
 2967: 
 2968:             if (sigaction(SIGHUP, &action, NULL) != 0)
 2969:             {
 2970: #               ifndef SEMAPHORES_NOMMES
 2971:                     sem_post(&((*s_etat_processus).semaphore_fork));
 2972:                     sem_post(&semaphore_gestionnaires_signaux);
 2973:                     sem_destroy(&semaphore_gestionnaires_signaux);
 2974:                     sem_destroy(&((*s_etat_processus)
 2975:                             .semaphore_fork));
 2976: #               else
 2977:                     sem_post((*s_etat_processus).semaphore_fork);
 2978:                     sem_post(semaphore_gestionnaires_signaux);
 2979:                     sem_destroy2(semaphore_gestionnaires_signaux,
 2980:                             getpid(), SEM_SIGNAUX);
 2981:                     sem_destroy3((*s_etat_processus).semphore_fork,
 2982:                             getpid(), pthread_self(), SEM_FORK);
 2983: #               endif
 2984: 
 2985:                 liberation_contexte_cas(s_etat_processus);
 2986:                 liberation_queue_signaux(s_etat_processus);
 2987: 
 2988: #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 2989:                     stackoverflow_deinstall_handler();
 2990: #               endif
 2991: 
 2992: #               ifdef HAVE_SIGSEGV_RECOVERY
 2993:                     if (debug == d_faux)
 2994:                     {
 2995:                         sigsegv_deinstall_handler();
 2996:                     }
 2997: #               endif
 2998: 
 2999:                 if ((*s_etat_processus).langue == 'F')
 3000:                 {
 3001:                     printf("+++Système : Initialisation des signaux POSIX "
 3002:                             "impossible\n");
 3003:                 }
 3004:                 else
 3005:                 {
 3006:                     printf("+++System : Initialization of POSIX signals "
 3007:                             "failed\n");
 3008:                 }
 3009: 
 3010:                 return(EXIT_FAILURE);
 3011:             }
 3012:         }
 3013: 
 3014:         if (mode_interactif == d_vrai)
 3015:         {
 3016:             printf("\n");
 3017: 
 3018:             if ((*s_etat_processus).langue == 'F')
 3019:             {
 3020:                 printf("+++Ce logiciel est un logiciel libre"
 3021:                         " sans aucune garantie de "
 3022:                         "fonctionnement.\n");
 3023:                 printf("+++Pour plus de détails, utilisez la "
 3024:                         "commande 'warranty'.\n");
 3025:             }
 3026:             else
 3027:             {
 3028:                 printf("+++This is a free software with "
 3029:                         "absolutely no warranty.\n");
 3030:                 printf("+++For details, type 'warranty'.\n");
 3031:             }
 3032: 
 3033:             printf("\n");
 3034: 
 3035:             traitement_fichier_temporaire = 'Y';
 3036: 
 3037:             if ((nom_fichier_temporaire =
 3038:                     creation_nom_fichier(s_etat_processus, (*s_etat_processus)
 3039:                     .chemin_fichiers_temporaires)) == NULL)
 3040:             {
 3041: #               ifndef SEMAPHORES_NOMMES
 3042:                     sem_post(&((*s_etat_processus).semaphore_fork));
 3043:                     sem_post(&semaphore_gestionnaires_signaux);
 3044:                     sem_destroy(&semaphore_gestionnaires_signaux);
 3045:                     sem_destroy(&((*s_etat_processus)
 3046:                             .semaphore_fork));
 3047: #               else
 3048:                     sem_post((*s_etat_processus).semaphore_fork);
 3049:                     sem_post(semaphore_gestionnaires_signaux);
 3050:                     sem_destroy2(semaphore_gestionnaires_signaux,
 3051:                             getpid(), SEM_SIGNAUX);
 3052:                     sem_destroy3((*s_etat_processus).semphore_fork,
 3053:                             getpid(), pthread_self(), SEM_FORK);
 3054: #               endif
 3055: 
 3056:                 liberation_contexte_cas(s_etat_processus);
 3057:                 liberation_queue_signaux(s_etat_processus);
 3058: 
 3059: #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 3060:                     stackoverflow_deinstall_handler();
 3061: #               endif
 3062: 
 3063: #               ifdef HAVE_SIGSEGV_RECOVERY
 3064:                     if (debug == d_faux)
 3065:                     {
 3066:                         sigsegv_deinstall_handler();
 3067:                     }
 3068: #               endif
 3069: 
 3070:                 if ((*s_etat_processus).langue == 'F')
 3071:                 {
 3072:                     printf("+++Système : Fichier indisponible\n");
 3073:                 }
 3074:                 else
 3075:                 {
 3076:                     printf("+++System : File unavailable\n");
 3077:                 }
 3078: 
 3079:                 return(EXIT_FAILURE);
 3080:             }
 3081: 
 3082:             if ((f_source = fopen(nom_fichier_temporaire, "w"))
 3083:                     == NULL)
 3084:             {
 3085: #               ifndef SEMAPHORES_NOMMES
 3086:                     sem_post(&((*s_etat_processus).semaphore_fork));
 3087:                     sem_post(&semaphore_gestionnaires_signaux);
 3088:                     sem_destroy(&semaphore_gestionnaires_signaux);
 3089:                     sem_destroy(&((*s_etat_processus)
 3090:                             .semaphore_fork));
 3091: #               else
 3092:                     sem_post((*s_etat_processus).semaphore_fork);
 3093:                     sem_post(semaphore_gestionnaires_signaux);
 3094:                     sem_destroy2(semaphore_gestionnaires_signaux,
 3095:                             getpid(), SEM_SIGNAUX);
 3096:                     sem_destroy3((*s_etat_processus).semphore_fork,
 3097:                             getpid(), pthread_self(), SEM_FORK);
 3098: #               endif
 3099: 
 3100:                 liberation_contexte_cas(s_etat_processus);
 3101:                 liberation_queue_signaux(s_etat_processus);
 3102: 
 3103: #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 3104:                     stackoverflow_deinstall_handler();
 3105: #               endif
 3106: 
 3107: #               ifdef HAVE_SIGSEGV_RECOVERY
 3108:                     if (debug == d_faux)
 3109:                     {
 3110:                         sigsegv_deinstall_handler();
 3111:                     }
 3112: #               endif
 3113: 
 3114:                 if ((*s_etat_processus).langue == 'F')
 3115:                 {
 3116:                     printf("+++Système : Fichier introuvable\n");
 3117:                 }
 3118:                 else
 3119:                 {
 3120:                     printf("+++System : File not found\n");
 3121:                 }
 3122: 
 3123:                 return(EXIT_FAILURE);
 3124:             }
 3125: 
 3126:             if (fprintf(f_source, "MODE_INTERACTIF\n") < 0)
 3127:             {
 3128: #               ifndef SEMAPHORES_NOMMES
 3129:                     sem_post(&((*s_etat_processus).semaphore_fork));
 3130:                     sem_post(&semaphore_gestionnaires_signaux);
 3131:                     sem_destroy(&semaphore_gestionnaires_signaux);
 3132:                     sem_destroy(&((*s_etat_processus)
 3133:                             .semaphore_fork));
 3134: #               else
 3135:                     sem_post((*s_etat_processus).semaphore_fork);
 3136:                     sem_post(semaphore_gestionnaires_signaux);
 3137:                     sem_destroy2(semaphore_gestionnaires_signaux,
 3138:                             getpid(), SEM_SIGNAUX);
 3139:                     sem_destroy3((*s_etat_processus).semphore_fork,
 3140:                             getpid(), pthread_self(), SEM_FORK);
 3141: #               endif
 3142: 
 3143:                 liberation_contexte_cas(s_etat_processus);
 3144:                 liberation_queue_signaux(s_etat_processus);
 3145: 
 3146: #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 3147:                     stackoverflow_deinstall_handler();
 3148: #               endif
 3149: 
 3150: #               ifdef HAVE_SIGSEGV_RECOVERY
 3151:                     if (debug == d_faux)
 3152:                     {
 3153:                         sigsegv_deinstall_handler();
 3154:                     }
 3155: #               endif
 3156: 
 3157:                 if ((*s_etat_processus).langue == 'F')
 3158:                 {
 3159:                     printf("+++Système : Erreur d'écriture dans un fichier\n");
 3160:                 }
 3161:                 else
 3162:                 {
 3163:                     printf("+++System : Cannot write in file\n");
 3164:                 }
 3165: 
 3166:                 return(EXIT_FAILURE);
 3167:             }
 3168: 
 3169:             if (fprintf(f_source,
 3170:                     "<< DO HALT UNTIL FALSE END >>\n") < 0)
 3171:             {
 3172: #               ifndef SEMAPHORES_NOMMES
 3173:                     sem_post(&((*s_etat_processus).semaphore_fork));
 3174:                     sem_post(&semaphore_gestionnaires_signaux);
 3175:                     sem_destroy(&semaphore_gestionnaires_signaux);
 3176:                     sem_destroy(&((*s_etat_processus)
 3177:                             .semaphore_fork));
 3178: #               else
 3179:                     sem_post((*s_etat_processus).semaphore_fork);
 3180:                     sem_post(semaphore_gestionnaires_signaux);
 3181:                     sem_destroy2(semaphore_gestionnaires_signaux,
 3182:                             getpid(), SEM_SIGNAUX);
 3183:                     sem_destroy3((*s_etat_processus).semphore_fork,
 3184:                             getpid(), pthread_self(), SEM_FORK);
 3185: #               endif
 3186: 
 3187:                 liberation_contexte_cas(s_etat_processus);
 3188:                 liberation_queue_signaux(s_etat_processus);
 3189: 
 3190: #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 3191:                     stackoverflow_deinstall_handler();
 3192: #               endif
 3193: 
 3194: #               ifdef HAVE_SIGSEGV_RECOVERY
 3195:                     if (debug == d_faux)
 3196:                     {
 3197:                         sigsegv_deinstall_handler();
 3198:                     }
 3199: #               endif
 3200: 
 3201:                 if ((*s_etat_processus).langue == 'F')
 3202:                 {
 3203:                     printf("+++Système : Erreur d'écriture dans un fichier\n");
 3204:                 }
 3205:                 else
 3206:                 {
 3207:                     printf("+++System : Cannot write in file\n");
 3208:                 }
 3209: 
 3210:                 return(EXIT_FAILURE);
 3211:             }
 3212: 
 3213:             if (fclose(f_source) != 0)
 3214:             {
 3215: #               ifndef SEMAPHORES_NOMMES
 3216:                     sem_post(&((*s_etat_processus).semaphore_fork));
 3217:                     sem_post(&semaphore_gestionnaires_signaux);
 3218:                     sem_destroy(&semaphore_gestionnaires_signaux);
 3219:                     sem_destroy(&((*s_etat_processus)
 3220:                             .semaphore_fork));
 3221: #               else
 3222:                     sem_post((*s_etat_processus).semaphore_fork);
 3223:                     sem_post(semaphore_gestionnaires_signaux);
 3224:                     sem_destroy2(semaphore_gestionnaires_signaux,
 3225:                             getpid(), SEM_SIGNAUX);
 3226:                     sem_destroy3((*s_etat_processus).semphore_fork,
 3227:                             getpid(), pthread_self(), SEM_FORK);
 3228: #               endif
 3229: 
 3230:                 liberation_contexte_cas(s_etat_processus);
 3231:                 liberation_queue_signaux(s_etat_processus);
 3232: 
 3233: #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 3234:                     stackoverflow_deinstall_handler();
 3235: #               endif
 3236: 
 3237: #               ifdef HAVE_SIGSEGV_RECOVERY
 3238:                     if (debug == d_faux)
 3239:                     {
 3240:                         sigsegv_deinstall_handler();
 3241:                     }
 3242: #               endif
 3243: 
 3244:                 if ((*s_etat_processus).langue == 'F')
 3245:                 {
 3246:                     printf("+++Système : Fichier indisponible\n");
 3247:                 }
 3248:                 else
 3249:                 {
 3250:                     printf("+++System : File unavailable\n");
 3251:                 }
 3252: 
 3253:                 return(EXIT_FAILURE);
 3254:             }
 3255: 
 3256:             (*s_etat_processus).lancement_interactif = d_vrai;
 3257:             (*s_etat_processus).nom_fichier_source =
 3258:                     nom_fichier_temporaire;
 3259: 
 3260:             presence_definition = 'O';
 3261:         }
 3262:         else
 3263:         {
 3264:             nom_fichier_temporaire = NULL;
 3265:         }
 3266: 
 3267:         if ((*s_etat_processus).nom_fichier_source == NULL)
 3268:         {
 3269:             erreur_fichier = d_erreur;
 3270:         }
 3271:         else
 3272:         {
 3273:             erreur_fichier = caracteristiques_fichier(s_etat_processus,
 3274:                     (*s_etat_processus).nom_fichier_source,
 3275:                     &existence, &ouverture, &unite_fichier);
 3276:         }
 3277: 
 3278:         if (((existence == d_faux) || (erreur_fichier != d_absence_erreur)) &&
 3279:                 (option_S == d_faux))
 3280:         {
 3281: #           ifndef SEMAPHORES_NOMMES
 3282:                 sem_post(&((*s_etat_processus).semaphore_fork));
 3283:                 sem_post(&semaphore_gestionnaires_signaux);
 3284:                 sem_destroy(&semaphore_gestionnaires_signaux);
 3285:                 sem_destroy(&((*s_etat_processus).semaphore_fork));
 3286: #           else
 3287:                 sem_post((*s_etat_processus).semaphore_fork);
 3288:                 sem_post(semaphore_gestionnaires_signaux);
 3289:                 sem_destroy2(semaphore_gestionnaires_signaux,
 3290:                         getpid(), SEM_SIGNAUX);
 3291:                 sem_destroy3((*s_etat_processus).semphore_fork,
 3292:                         getpid(), pthread_self(), SEM_FORK);
 3293: #           endif
 3294: 
 3295:             liberation_contexte_cas(s_etat_processus);
 3296:             liberation_queue_signaux(s_etat_processus);
 3297: 
 3298: #           ifdef HAVE_STACK_OVERFLOW_RECOVERY
 3299:                 stackoverflow_deinstall_handler();
 3300: #           endif
 3301: 
 3302: #           ifdef HAVE_SIGSEGV_RECOVERY
 3303:                 if (debug == d_faux)
 3304:                 {
 3305:                     sigsegv_deinstall_handler();
 3306:                 }
 3307: #           endif
 3308: 
 3309:             if (presence_definition == 'O')
 3310:             {
 3311:                 if ((*s_etat_processus).langue == 'F')
 3312:                 {
 3313:                     printf("+++Erreur : Fichier %s inexistant\n",
 3314:                             (*s_etat_processus).nom_fichier_source);
 3315:                 }
 3316:                 else
 3317:                 {
 3318:                     printf("+++Error : File %s not found\n",
 3319:                             (*s_etat_processus).nom_fichier_source);
 3320:                 }
 3321: 
 3322:                 erreur = d_erreur;
 3323:             }
 3324:             else
 3325:             {
 3326:                 if ((*s_etat_processus).langue == 'F')
 3327:                 {
 3328:                     printf("+++Erreur : Absence de définition à exécuter\n");
 3329:                 }
 3330:                 else
 3331:                 {
 3332:                     printf("+++Error : Any executable definition\n");
 3333:                 }
 3334:             }
 3335: 
 3336:             return(EXIT_FAILURE);
 3337:         }
 3338: 
 3339:         if ((*s_etat_processus).chemin_fichiers_temporaires == NULL)
 3340:         {
 3341: #           ifndef SEMAPHORES_NOMMES
 3342:                 sem_post(&((*s_etat_processus).semaphore_fork));
 3343:                 sem_post(&semaphore_gestionnaires_signaux);
 3344:                 sem_destroy(&semaphore_gestionnaires_signaux);
 3345:                 sem_destroy(&((*s_etat_processus).semaphore_fork));
 3346: #           else
 3347:                 sem_post((*s_etat_processus).semaphore_fork);
 3348:                 sem_post(semaphore_gestionnaires_signaux);
 3349:                 sem_destroy2(semaphore_gestionnaires_signaux,
 3350:                         getpid(), SEM_SIGNAUX);
 3351:                 sem_destroy3((*s_etat_processus).semphore_fork,
 3352:                         getpid(), pthread_self(), SEM_FORK);
 3353: #           endif
 3354: 
 3355:             liberation_contexte_cas(s_etat_processus);
 3356:             liberation_queue_signaux(s_etat_processus);
 3357: 
 3358: #           ifdef HAVE_STACK_OVERFLOW_RECOVERY
 3359:                 stackoverflow_deinstall_handler();
 3360: #           endif
 3361: 
 3362: #           ifdef HAVE_SIGSEGV_RECOVERY
 3363:                 if (debug == d_faux)
 3364:                 {
 3365:                     sigsegv_deinstall_handler();
 3366:                 }
 3367: #           endif
 3368: 
 3369:             if ((*s_etat_processus).langue == 'F')
 3370:             {
 3371:                 printf("+++Système : Chemin des fichiers temporaires nul\n");
 3372:             }
 3373:             else
 3374:             {
 3375:                 printf("+++System : Null temporary files path\n");
 3376:             }
 3377: 
 3378:             return(EXIT_FAILURE);
 3379:         }
 3380: 
 3381:         if ((*s_etat_processus).debug == d_vrai)
 3382:         {
 3383:             if ((*s_etat_processus).langue == 'F')
 3384:             {
 3385:                 printf("[%d] Chemin des fichiers temporaires %s\n\n",
 3386:                         (int) getpid(),
 3387:                         (*s_etat_processus).chemin_fichiers_temporaires);
 3388:             }
 3389:             else
 3390:             {
 3391:                 printf("[%d] Temporary files path %s\n\n",
 3392:                         (int) getpid(),
 3393:                         (*s_etat_processus).chemin_fichiers_temporaires);
 3394:             }
 3395:         }
 3396: 
 3397:         if ((erreur == d_absence_erreur) && (presence_definition == 'O'))
 3398:         {
 3399:             (*s_etat_processus).profilage = (option_P != 0) ? d_vrai : d_faux;
 3400:             (*s_etat_processus).niveau_profilage = option_P;
 3401:             (*s_etat_processus).pile_profilage = NULL;
 3402:             (*s_etat_processus).pile_profilage_fonctions = NULL;
 3403:             gettimeofday(&((*s_etat_processus).horodatage_profilage), NULL);
 3404: 
 3405:             (*s_etat_processus).liste_mutexes = NULL;
 3406:             (*s_etat_processus).sections_critiques = 0;
 3407:             (*s_etat_processus).initialisation_scheduler = d_faux;
 3408: 
 3409:             (*s_etat_processus).test_instruction = 'N';
 3410:             (*s_etat_processus).nombre_arguments = 0;
 3411:             (*s_etat_processus).affichage_arguments = 'N';
 3412:             (*s_etat_processus).autorisation_conversion_chaine = 'Y';
 3413:             (*s_etat_processus).autorisation_evaluation_nom = 'Y';
 3414: 
 3415:             if (mode_interactif == d_vrai)
 3416:             {
 3417:                 (*s_etat_processus).autorisation_nom_implicite = 'Y';
 3418:             }
 3419:             else
 3420:             {
 3421:                 (*s_etat_processus).autorisation_nom_implicite = 'N';
 3422:             }
 3423: 
 3424:             (*s_etat_processus).autorisation_empilement_programme = 'N';
 3425:             (*s_etat_processus).requete_arret = 'N';
 3426:             (*s_etat_processus).evaluation_forcee = 'N';
 3427:             (*s_etat_processus).recherche_type = 'N';
 3428: 
 3429:             (*s_etat_processus).constante_symbolique = 'N';
 3430:             (*s_etat_processus).traitement_symbolique = 'N';
 3431: 
 3432:             (*s_etat_processus).expression_courante = NULL;
 3433:             (*s_etat_processus).objet_courant = NULL;
 3434:             (*s_etat_processus).evaluation_expression_compilee = 'N';
 3435: 
 3436:             (*s_etat_processus).l_base_pile = NULL;
 3437:             (*s_etat_processus).l_base_pile_last = NULL;
 3438: 
 3439:             (*s_etat_processus).s_arbre_variables = NULL;
 3440:             (*s_etat_processus).l_liste_variables_par_niveau = NULL;
 3441:             (*s_etat_processus).l_liste_variables_statiques = NULL;
 3442:             (*s_etat_processus).gel_liste_variables = d_faux;
 3443:             s_arbre_variables_partagees = NULL;
 3444:             l_liste_variables_partagees = NULL;
 3445:             (*s_etat_processus).s_arbre_variables_partagees =
 3446:                     &s_arbre_variables_partagees;
 3447:             (*s_etat_processus).l_liste_variables_partagees =
 3448:                     &l_liste_variables_partagees;
 3449:             (*s_etat_processus).pointeur_variable_courante = NULL;
 3450:             (*s_etat_processus).pointeur_variable_statique_courante = NULL;
 3451:             (*s_etat_processus).pointeur_variable_partagee_courante = NULL;
 3452:             (*s_etat_processus).niveau_courant = 0;
 3453:             (*s_etat_processus).niveau_initial = 0;
 3454:             (*s_etat_processus).creation_variables_statiques = d_faux;
 3455:             (*s_etat_processus).creation_variables_partagees = d_faux;
 3456: 
 3457:             (*s_etat_processus).s_bibliotheques = NULL;
 3458:             (*s_etat_processus).s_instructions_externes = NULL;
 3459:             (*s_etat_processus).nombre_instructions_externes = 0;
 3460: 
 3461:             (*s_etat_processus).systeme_axes = 0;
 3462: 
 3463:             (*s_etat_processus).x_min = -10.;
 3464:             (*s_etat_processus).x_max = 10.;
 3465:             (*s_etat_processus).y_min = -10.;
 3466:             (*s_etat_processus).y_max = 10.;
 3467:             (*s_etat_processus).z_min = -10.;
 3468:             (*s_etat_processus).z_max = 10.;
 3469: 
 3470:             (*s_etat_processus).x2_min = -10.;
 3471:             (*s_etat_processus).x2_max = 10.;
 3472:             (*s_etat_processus).y2_min = -10.;
 3473:             (*s_etat_processus).y2_max = 10.;
 3474:             (*s_etat_processus).z2_min = -10.;
 3475:             (*s_etat_processus).z2_max = 10.;
 3476: 
 3477:             (*s_etat_processus).resolution = .01;
 3478: 
 3479:             (*s_etat_processus).souris_active = d_faux;
 3480: 
 3481:             (*s_etat_processus).echelle_automatique_x = d_faux;
 3482:             (*s_etat_processus).echelle_automatique_y = d_faux;
 3483:             (*s_etat_processus).echelle_automatique_z = d_faux;
 3484: 
 3485:             (*s_etat_processus).echelle_automatique_x2 = d_faux;
 3486:             (*s_etat_processus).echelle_automatique_y2 = d_faux;
 3487:             (*s_etat_processus).echelle_automatique_z2 = d_faux;
 3488: 
 3489:             (*s_etat_processus).echelle_log_x = d_faux;
 3490:             (*s_etat_processus).echelle_log_y = d_faux;
 3491:             (*s_etat_processus).echelle_log_z = d_faux;
 3492: 
 3493:             (*s_etat_processus).echelle_log_x2 = d_faux;
 3494:             (*s_etat_processus).echelle_log_y2 = d_faux;
 3495:             (*s_etat_processus).echelle_log_z2 = d_faux;
 3496: 
 3497:             (*s_etat_processus).point_de_vue_theta = 4 * atan((real8) 1) / 6;
 3498:             (*s_etat_processus).point_de_vue_phi = 4 * atan((real8) 1) / 3;
 3499:             (*s_etat_processus).echelle_3D = 1;
 3500: 
 3501:             strcpy((*s_etat_processus).type_trace_eq, "FONCTION");
 3502:             strcpy((*s_etat_processus).type_trace_sigma, "POINTS");
 3503:             (*s_etat_processus).fichiers_graphiques = NULL;
 3504:             (*s_etat_processus).nom_fichier_impression = NULL;
 3505:             strcpy((*s_etat_processus).format_papier, "a4paper");
 3506:             (*s_etat_processus).entree_standard = NULL;
 3507:             (*s_etat_processus).s_marques = NULL;
 3508:             (*s_etat_processus).requete_nouveau_plan = d_vrai;
 3509:             (*s_etat_processus).mise_a_jour_trace_requise = d_faux;
 3510: 
 3511:             (*s_etat_processus).l_base_pile = NULL;
 3512:             (*s_etat_processus).hauteur_pile_operationnelle = 0;
 3513:             (*s_etat_processus).l_base_pile_contextes = NULL;
 3514:             (*s_etat_processus).l_base_pile_taille_contextes = NULL;
 3515: 
 3516:             (*s_etat_processus).position_courante = 0;
 3517: 
 3518:             (*s_etat_processus).l_base_pile_systeme = NULL;
 3519:             (*s_etat_processus).hauteur_pile_systeme = 0;
 3520: 
 3521:             (*s_etat_processus).l_base_pile_processus = NULL;
 3522:             (*s_etat_processus).presence_pipes = d_faux;
 3523:             (*s_etat_processus).pipe_donnees = 0;
 3524:             (*s_etat_processus).pipe_acquittement = 0;
 3525:             (*s_etat_processus).pipe_injections = 0;
 3526:             (*s_etat_processus).pipe_nombre_injections = 0;
 3527:             (*s_etat_processus).nombre_objets_injectes = 0;
 3528:             (*s_etat_processus).nombre_objets_envoyes_non_lus = 0;
 3529:             (*s_etat_processus).pourcentage_maximal_cpu = 100;
 3530:             (*s_etat_processus).temps_maximal_cpu = 0;
 3531:             (*s_etat_processus).thread_fusible = 0;
 3532:             (*s_etat_processus).presence_fusible = d_faux;
 3533: 
 3534:             (*s_etat_processus).niveau_recursivite = 0;
 3535:             (*s_etat_processus).generateur_aleatoire = NULL;
 3536:             (*s_etat_processus).type_generateur_aleatoire = NULL;
 3537: 
 3538:             (*s_etat_processus).colonne_statistique_1 = 1; 
 3539:             (*s_etat_processus).colonne_statistique_2 = 2; 
 3540: 
 3541:             (*s_etat_processus).debug_programme = d_faux;
 3542:             (*s_etat_processus).execution_pas_suivant = d_faux;
 3543:             (*s_etat_processus).traitement_instruction_halt = d_faux;
 3544: 
 3545:             (*s_etat_processus).derniere_exception = d_ep;
 3546:             (*s_etat_processus).derniere_erreur_systeme = d_es;
 3547:             (*s_etat_processus).derniere_erreur_execution = d_ex;
 3548:             (*s_etat_processus).derniere_erreur_evaluation = d_ex;
 3549:             (*s_etat_processus).derniere_erreur_fonction_externe = 0;
 3550: 
 3551:             (*s_etat_processus).erreur_processus_fils = d_faux;
 3552:             (*s_etat_processus).erreur_systeme_processus_fils = d_es;
 3553:             (*s_etat_processus).erreur_execution_processus_fils = d_ex;
 3554:             (*s_etat_processus).pid_erreur_processus_fils = 0;
 3555:             (*s_etat_processus).exception_processus_fils = d_ep;
 3556:             (*s_etat_processus).core = core;
 3557:             (*s_etat_processus).invalidation_message_erreur = d_faux;
 3558:             (*s_etat_processus).s_objet_errone = NULL;
 3559:             (*s_etat_processus).s_objet_erreur = NULL;
 3560: 
 3561:             (*s_etat_processus).retour_routine_evaluation = 'N';
 3562: 
 3563:             (*s_etat_processus).traitement_interruption = 'N';
 3564:             (*s_etat_processus).traitement_interruptible = 'Y';
 3565:             (*s_etat_processus).nombre_interruptions_en_queue = 0;
 3566:             (*s_etat_processus).nombre_interruptions_non_affectees = 0;
 3567: 
 3568:             for(i = 0; i < d_NOMBRE_INTERRUPTIONS; i++)
 3569:             {
 3570:                 (*s_etat_processus).masque_interruptions[i] = 'N';
 3571:                 (*s_etat_processus).queue_interruptions[i] = 0;
 3572:                 (*s_etat_processus).corps_interruptions[i] = NULL;
 3573:                 (*s_etat_processus).pile_origine_interruptions[i] = NULL;
 3574:             }
 3575: 
 3576:             (*s_etat_processus).at_exit = NULL;
 3577:             (*s_etat_processus).at_poke = NULL;
 3578:             (*s_etat_processus).traitement_at_poke = 'N';
 3579: 
 3580:             (*s_etat_processus).pointeurs_caracteres = NULL;
 3581:             (*s_etat_processus).arbre_instructions = NULL;
 3582: 
 3583:             (*s_etat_processus).tid_processus_pere = pthread_self();
 3584:             (*s_etat_processus).tid = pthread_self();
 3585:             (*s_etat_processus).pid_processus_pere = getpid();
 3586:             (*s_etat_processus).processus_detache = d_vrai;
 3587:             (*s_etat_processus).var_volatile_processus_pere = -1;
 3588:             (*s_etat_processus).var_volatile_processus_racine = -1;
 3589:             (*s_etat_processus).var_volatile_traitement_retarde_stop = 0;
 3590:             (*s_etat_processus).var_volatile_alarme = 0;
 3591:             (*s_etat_processus).var_volatile_requete_arret = 0;
 3592:             (*s_etat_processus).var_volatile_requete_arret2 = 0;
 3593:             (*s_etat_processus).var_volatile_traitement_retarde_stop = 0;
 3594:             (*s_etat_processus).var_volatile_traitement_sigint = 0;
 3595:             (*s_etat_processus).var_volatile_recursivite = 0;
 3596:             (*s_etat_processus).var_volatile_exception_gsl = 0;
 3597:             (*s_etat_processus).arret_depuis_abort = 0;
 3598:             (*s_etat_processus).pointeur_signal_lecture = 0;
 3599:             (*s_etat_processus).pointeur_signal_ecriture = 0;
 3600: 
 3601:             initialisation_allocateur(s_etat_processus);
 3602:             initialisation_drapeaux(s_etat_processus);
 3603:             initialisation_variables(s_etat_processus);
 3604:             initialisation_instructions(s_etat_processus);
 3605: 
 3606:             if ((*s_etat_processus).erreur_systeme != d_es)
 3607:             {
 3608: #               ifndef SEMAPHORES_NOMMES
 3609:                     sem_post(&((*s_etat_processus).semaphore_fork));
 3610:                     sem_post(&semaphore_gestionnaires_signaux);
 3611:                     sem_destroy(&semaphore_gestionnaires_signaux);
 3612:                     sem_destroy(&((*s_etat_processus).semaphore_fork));
 3613: #               else
 3614:                     sem_post((*s_etat_processus).semaphore_fork);
 3615:                     sem_post(semaphore_gestionnaires_signaux);
 3616:                     sem_destroy2(semaphore_gestionnaires_signaux,
 3617:                             getpid(), SEM_SIGNAUX);
 3618:                     sem_destroy3((*s_etat_processus).semphore_fork,
 3619:                             getpid(), pthread_self(), SEM_FORK);
 3620: #               endif
 3621: 
 3622:                 liberation_contexte_cas(s_etat_processus);
 3623:                 liberation_queue_signaux(s_etat_processus);
 3624: 
 3625: #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 3626:                     stackoverflow_deinstall_handler();
 3627: #               endif
 3628: 
 3629: #               ifdef HAVE_SIGSEGV_RECOVERY
 3630:                     if (debug == d_faux)
 3631:                     {
 3632:                         sigsegv_deinstall_handler();
 3633:                     }
 3634: #               endif
 3635: 
 3636:                 if ((*s_etat_processus).langue == 'F')
 3637:                 {
 3638:                     printf("+++Système : Mémoire insuffisante\n");
 3639:                 }
 3640:                 else
 3641:                 {
 3642:                     printf("+++System : Not enough memory\n");
 3643:                 }
 3644: 
 3645:                 return(EXIT_FAILURE);
 3646:             }
 3647: 
 3648:             if (((*s_etat_processus).instruction_derniere_erreur =
 3649:                     malloc(sizeof(unsigned char))) == NULL)
 3650:             {
 3651: #               ifndef SEMAPHORES_NOMMES
 3652:                     sem_post(&((*s_etat_processus).semaphore_fork));
 3653:                     sem_post(&semaphore_gestionnaires_signaux);
 3654:                     sem_destroy(&semaphore_gestionnaires_signaux);
 3655:                     sem_destroy(&((*s_etat_processus).semaphore_fork));
 3656: #               else
 3657:                     sem_post((*s_etat_processus).semaphore_fork);
 3658:                     sem_post(semaphore_gestionnaires_signaux);
 3659:                     sem_destroy2(semaphore_gestionnaires_signaux,
 3660:                             getpid(), SEM_SIGNAUX);
 3661:                     sem_destroy3((*s_etat_processus).semphore_fork,
 3662:                             getpid(), pthread_self(), SEM_FORK);
 3663: #               endif
 3664: 
 3665:                 liberation_contexte_cas(s_etat_processus);
 3666:                 liberation_queue_signaux(s_etat_processus);
 3667: 
 3668: #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 3669:                     stackoverflow_deinstall_handler();
 3670: #               endif
 3671: 
 3672: #               ifdef HAVE_SIGSEGV_RECOVERY
 3673:                     if (debug == d_faux)
 3674:                     {
 3675:                         sigsegv_deinstall_handler();
 3676:                     }
 3677: #               endif
 3678: 
 3679:                 erreur = d_es_allocation_memoire;
 3680: 
 3681:                 if ((*s_etat_processus).langue == 'F')
 3682:                 {
 3683:                     printf("+++Système : Mémoire insuffisante\n");
 3684:                 }
 3685:                 else
 3686:                 {
 3687:                     printf("+++System : Not enough memory\n");
 3688:                 }
 3689: 
 3690:                 return(EXIT_FAILURE);
 3691:             }
 3692: 
 3693:             strcpy((*s_etat_processus).instruction_derniere_erreur, "");
 3694:             (*s_etat_processus).niveau_derniere_erreur = 0;
 3695: 
 3696:             if (traitement_fichier_temporaire == 'Y')
 3697:             {
 3698:                 (*s_etat_processus).mode_interactif = 'Y';
 3699:             }
 3700:             else
 3701:             {
 3702:                 (*s_etat_processus).mode_interactif = 'N';
 3703:             }
 3704: 
 3705:             if (((*s_etat_processus).instruction_courante = (unsigned char *)
 3706:                     malloc(sizeof(unsigned char))) == NULL)
 3707:             {
 3708: #               ifndef SEMAPHORES_NOMMES
 3709:                     sem_post(&((*s_etat_processus).semaphore_fork));
 3710:                     sem_post(&semaphore_gestionnaires_signaux);
 3711:                     sem_destroy(&semaphore_gestionnaires_signaux);
 3712:                     sem_destroy(&((*s_etat_processus).semaphore_fork));
 3713: #               else
 3714:                     sem_post((*s_etat_processus).semaphore_fork);
 3715:                     sem_post(semaphore_gestionnaires_signaux);
 3716:                     sem_destroy2(semaphore_gestionnaires_signaux,
 3717:                             getpid(), SEM_SIGNAUX);
 3718:                     sem_destroy3((*s_etat_processus).semphore_fork,
 3719:                             getpid(), pthread_self(), SEM_FORK);
 3720: #               endif
 3721: 
 3722:                 liberation_contexte_cas(s_etat_processus);
 3723:                 liberation_queue_signaux(s_etat_processus);
 3724: 
 3725: #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 3726:                     stackoverflow_deinstall_handler();
 3727: #               endif
 3728: 
 3729: #               ifdef HAVE_SIGSEGV_RECOVERY
 3730:                     if (debug == d_faux)
 3731:                     {
 3732:                         sigsegv_deinstall_handler();
 3733:                     }
 3734: #               endif
 3735: 
 3736:                 erreur = d_es_allocation_memoire;
 3737: 
 3738:                 if ((*s_etat_processus).langue == 'F')
 3739:                 {
 3740:                     printf("+++Système : Mémoire insuffisante\n");
 3741:                 }
 3742:                 else
 3743:                 {
 3744:                     printf("+++System : Not enough memory\n");
 3745:                 }
 3746: 
 3747:                 return(EXIT_FAILURE);
 3748:             }
 3749: 
 3750:             (*s_etat_processus).instruction_courante[0] = d_code_fin_chaine;
 3751: 
 3752:             empilement_pile_systeme(s_etat_processus);
 3753: 
 3754:             free((*s_etat_processus).instruction_courante);
 3755: 
 3756:             if ((*s_etat_processus).erreur_systeme != d_es)
 3757:             {
 3758:                 erreur = d_es_allocation_memoire;
 3759:             }
 3760:             else
 3761:             {
 3762:                 (*((*s_etat_processus).l_base_pile_systeme))
 3763:                         .retour_definition = 'Y';
 3764: 
 3765:                 (*s_etat_processus).indep = allocation(s_etat_processus, NON);
 3766:                 (*s_etat_processus).depend = allocation(s_etat_processus, NON);
 3767:                 (*s_etat_processus).parametres_courbes_de_niveau =
 3768:                         allocation(s_etat_processus, NON);
 3769: 
 3770:                 if (((*s_etat_processus).indep != NULL) &&
 3771:                         ((*s_etat_processus).depend != NULL) &&
 3772:                         ((*s_etat_processus).parametres_courbes_de_niveau
 3773:                         != NULL))
 3774:                 {
 3775:                     (*((*s_etat_processus).indep)).type = NOM;
 3776:                     (*((*s_etat_processus).depend)).type = NOM;
 3777:                     (*((*s_etat_processus).
 3778:                             parametres_courbes_de_niveau)).type = LST;
 3779: 
 3780:                     initialisation_objet((*s_etat_processus).indep);
 3781:                     initialisation_objet((*s_etat_processus).depend);
 3782:                     initialisation_objet((*s_etat_processus)
 3783:                             .parametres_courbes_de_niveau);
 3784: 
 3785:                     (*((*s_etat_processus).indep)).objet = (struct_nom *)
 3786:                             malloc(sizeof(struct_nom));
 3787:                     (*((*s_etat_processus).depend)).objet = (struct_nom *)
 3788:                             malloc(sizeof(struct_nom));
 3789:                     (*((*s_etat_processus).parametres_courbes_de_niveau))
 3790:                             .objet = (struct_liste_chainee *)
 3791:                             malloc(sizeof(struct_liste_chainee));
 3792: 
 3793:                     if (((*((*s_etat_processus).depend)).objet == NULL) ||
 3794:                             ((*((*s_etat_processus).depend)).objet == NULL) ||
 3795:                             ((*((*s_etat_processus).
 3796:                             parametres_courbes_de_niveau)).objet == NULL))
 3797:                     {
 3798: #                       ifndef SEMAPHORES_NOMMES
 3799:                             sem_post(&((*s_etat_processus).semaphore_fork));
 3800:                             sem_post(&semaphore_gestionnaires_signaux);
 3801:                             sem_destroy(&semaphore_gestionnaires_signaux);
 3802:                             sem_destroy(&((*s_etat_processus).semaphore_fork));
 3803: #                       else
 3804:                             sem_post((*s_etat_processus).semaphore_fork);
 3805:                             sem_post(semaphore_gestionnaires_signaux);
 3806:                             sem_destroy2(semaphore_gestionnaires_signaux,
 3807:                                     getpid(), SEM_SIGNAUX);
 3808:                             sem_destroy3((*s_etat_processus).semphore_fork,
 3809:                                     getpid(), pthread_self(), SEM_FORK);
 3810: #                       endif
 3811: 
 3812:                         liberation_contexte_cas(s_etat_processus);
 3813:                         liberation_queue_signaux(s_etat_processus);
 3814: 
 3815: #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
 3816:                             stackoverflow_deinstall_handler();
 3817: #                       endif
 3818: 
 3819: #                       ifdef HAVE_SIGSEGV_RECOVERY
 3820:                             if (debug == d_faux)
 3821:                             {
 3822:                                 sigsegv_deinstall_handler();
 3823:                             }
 3824: #                       endif
 3825: 
 3826:                         erreur = d_es_allocation_memoire;
 3827:                         
 3828:                         if ((*s_etat_processus).langue == 'F')
 3829:                         {
 3830:                             printf("+++Système : Mémoire insuffisante\n");
 3831:                         }
 3832:                         else
 3833:                         {
 3834:                             printf("+++System : Not enough memory\n");
 3835:                         }
 3836: 
 3837:                         return(EXIT_FAILURE);
 3838:                     }
 3839: 
 3840:                     (*((struct_nom *) (*((*s_etat_processus).indep)).objet))
 3841:                             .nom = malloc(2 * sizeof(unsigned char));
 3842:                     (*((struct_nom *) (*((*s_etat_processus).depend)).objet))
 3843:                             .nom = malloc(2 * sizeof(unsigned char));
 3844: 
 3845:                     if (((*((struct_nom *) (*((*s_etat_processus).indep))
 3846:                             .objet)).nom == NULL) || ((*((struct_nom *)
 3847:                             (*((*s_etat_processus).depend)).objet)).nom ==
 3848:                             NULL))
 3849:                     {
 3850: #                       ifndef SEMAPHORES_NOMMES
 3851:                             sem_post(&((*s_etat_processus).semaphore_fork));
 3852:                             sem_post(&semaphore_gestionnaires_signaux);
 3853:                             sem_destroy(&semaphore_gestionnaires_signaux);
 3854:                             sem_destroy(&((*s_etat_processus).semaphore_fork));
 3855: #                       else
 3856:                             sem_post((*s_etat_processus).semaphore_fork);
 3857:                             sem_post(semaphore_gestionnaires_signaux);
 3858:                             sem_destroy2(semaphore_gestionnaires_signaux,
 3859:                                     getpid(), SEM_SIGNAUX);
 3860:                             sem_destroy3((*s_etat_processus).semphore_fork,
 3861:                                     getpid(), pthread_self(), SEM_FORK);
 3862: #                       endif
 3863: 
 3864:                         liberation_contexte_cas(s_etat_processus);
 3865:                         liberation_queue_signaux(s_etat_processus);
 3866: 
 3867: #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
 3868:                             stackoverflow_deinstall_handler();
 3869: #                       endif
 3870: 
 3871: #                       ifdef HAVE_SIGSEGV_RECOVERY
 3872:                             if (debug == d_faux)
 3873:                             {
 3874:                                 sigsegv_deinstall_handler();
 3875:                             }
 3876: #                       endif
 3877: 
 3878:                         erreur = d_es_allocation_memoire;
 3879: 
 3880:                         if ((*s_etat_processus).langue == 'F')
 3881:                         {
 3882:                             printf("+++Système : Mémoire insuffisante\n");
 3883:                         }
 3884:                         else
 3885:                         {
 3886:                             printf("+++System : Not enough memory\n");
 3887:                         }
 3888: 
 3889:                         return(EXIT_FAILURE);
 3890:                     }
 3891: 
 3892:                     strcpy((*((struct_nom *) (*((*s_etat_processus).indep))
 3893:                             .objet)).nom, "X");
 3894:                     strcpy((*((struct_nom *) (*((*s_etat_processus).depend))
 3895:                             .objet)).nom, "Y");
 3896: 
 3897:                     (*((struct_nom *) (*((*s_etat_processus).indep))
 3898:                             .objet)).symbole = d_vrai;
 3899:                     (*((struct_nom *) (*((*s_etat_processus).depend))
 3900:                             .objet)).symbole = d_vrai;
 3901: 
 3902:                     (*((struct_liste_chainee *) (*((*s_etat_processus)
 3903:                             .parametres_courbes_de_niveau)).objet)).suivant
 3904:                             = NULL;
 3905: 
 3906:                     (*((struct_liste_chainee *) (*((*s_etat_processus)
 3907:                             .parametres_courbes_de_niveau)).objet)).donnee
 3908:                             = malloc(sizeof(struct_objet));
 3909: 
 3910:                     (*s_etat_processus).legende =
 3911:                             malloc(sizeof(unsigned char));
 3912:                     (*s_etat_processus).label_x =
 3913:                             malloc(sizeof(unsigned char));
 3914:                     (*s_etat_processus).label_y =
 3915:                             malloc(sizeof(unsigned char));
 3916:                     (*s_etat_processus).label_z =
 3917:                             malloc(sizeof(unsigned char));
 3918:                     (*s_etat_processus).titre =
 3919:                             malloc(sizeof(unsigned char));
 3920: 
 3921:                     if (((*s_etat_processus).label_x == NULL) ||
 3922:                             ((*s_etat_processus).label_y == NULL) ||
 3923:                             ((*s_etat_processus).label_z == NULL) ||
 3924:                             ((*s_etat_processus).titre == NULL) ||
 3925:                             ((*s_etat_processus).legende == NULL) ||
 3926:                             ((*((struct_liste_chainee *) (*((*s_etat_processus)
 3927:                             .parametres_courbes_de_niveau)).objet)).donnee
 3928:                             == NULL))
 3929:                     {
 3930: #                       ifndef SEMAPHORES_NOMMES
 3931:                             sem_post(&((*s_etat_processus).semaphore_fork));
 3932:                             sem_post(&semaphore_gestionnaires_signaux);
 3933:                             sem_destroy(&semaphore_gestionnaires_signaux);
 3934:                             sem_destroy(&((*s_etat_processus).semaphore_fork));
 3935: #                       else
 3936:                             sem_post((*s_etat_processus).semaphore_fork);
 3937:                             sem_post(semaphore_gestionnaires_signaux);
 3938:                             sem_destroy2(semaphore_gestionnaires_signaux,
 3939:                                     getpid(), SEM_SIGNAUX);
 3940:                             sem_destroy3((*s_etat_processus).semphore_fork,
 3941:                                     getpid(), pthread_self(), SEM_FORK);
 3942: #                       endif
 3943: 
 3944:                         liberation_contexte_cas(s_etat_processus);
 3945:                         liberation_queue_signaux(s_etat_processus);
 3946: 
 3947: #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
 3948:                             stackoverflow_deinstall_handler();
 3949: #                       endif
 3950: 
 3951: #                       ifdef HAVE_SIGSEGV_RECOVERY
 3952:                             if (debug == d_faux)
 3953:                             {
 3954:                                 sigsegv_deinstall_handler();
 3955:                             }
 3956: #                       endif
 3957: 
 3958:                         erreur = d_es_allocation_memoire;
 3959: 
 3960:                         if ((*s_etat_processus).langue == 'F')
 3961:                         {
 3962:                             printf("+++Système : Mémoire insuffisante\n");
 3963:                         }
 3964:                         else
 3965:                         {
 3966:                             printf("+++System : Not enough memory\n");
 3967:                         }
 3968: 
 3969:                         return(EXIT_FAILURE);
 3970:                     }
 3971: 
 3972:                     (*(*((struct_liste_chainee *) (*((*s_etat_processus)
 3973:                             .parametres_courbes_de_niveau)).objet)).donnee)
 3974:                             .type = CHN;
 3975: 
 3976:                     initialisation_objet((*((struct_liste_chainee *)
 3977:                             (*((*s_etat_processus)
 3978:                             .parametres_courbes_de_niveau))
 3979:                             .objet)).donnee);
 3980: 
 3981:                     if (((*(*((struct_liste_chainee *) (*((*s_etat_processus)
 3982:                             .parametres_courbes_de_niveau)).objet)).donnee)
 3983:                             .objet = malloc(10 * sizeof(unsigned char)))
 3984:                             == NULL)
 3985:                     {
 3986: #                       ifndef SEMAPHORES_NOMMES
 3987:                             sem_post(&((*s_etat_processus).semaphore_fork));
 3988:                             sem_post(&semaphore_gestionnaires_signaux);
 3989:                             sem_destroy(&semaphore_gestionnaires_signaux);
 3990:                             sem_destroy(&((*s_etat_processus).semaphore_fork));
 3991: #                       else
 3992:                             sem_post((*s_etat_processus).semaphore_fork);
 3993:                             sem_post(semaphore_gestionnaires_signaux);
 3994:                             sem_destroy2(semaphore_gestionnaires_signaux,
 3995:                                     getpid(), SEM_SIGNAUX);
 3996:                             sem_destroy3((*s_etat_processus).semphore_fork,
 3997:                                     getpid(), pthread_self(), SEM_FORK);
 3998: #                       endif
 3999: 
 4000:                         liberation_contexte_cas(s_etat_processus);
 4001:                         liberation_queue_signaux(s_etat_processus);
 4002: 
 4003: #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4004:                             stackoverflow_deinstall_handler();
 4005: #                       endif
 4006: 
 4007: #                       ifdef HAVE_SIGSEGV_RECOVERY
 4008:                             if (debug == d_faux)
 4009:                             {
 4010:                                 sigsegv_deinstall_handler();
 4011:                             }
 4012: #                       endif
 4013: 
 4014:                         erreur = d_es_allocation_memoire;
 4015: 
 4016:                         if ((*s_etat_processus).langue == 'F')
 4017:                         {
 4018:                             printf("+++Système : Mémoire insuffisante\n");
 4019:                         }
 4020:                         else
 4021:                         {
 4022:                             printf("+++System : Not enough memory\n");
 4023:                         }
 4024: 
 4025:                         return(EXIT_FAILURE);
 4026:                     }
 4027: 
 4028:                     strcpy((unsigned char *) (*(*((struct_liste_chainee *)
 4029:                             (*((*s_etat_processus)
 4030:                             .parametres_courbes_de_niveau))
 4031:                             .objet)).donnee).objet, "AUTOMATIC");
 4032: 
 4033:                     (*s_etat_processus).label_x[0] = d_code_fin_chaine;
 4034:                     (*s_etat_processus).label_y[0] = d_code_fin_chaine;
 4035:                     (*s_etat_processus).label_z[0] = d_code_fin_chaine;
 4036:                     (*s_etat_processus).titre[0] = d_code_fin_chaine;
 4037:                     (*s_etat_processus).legende[0] = d_code_fin_chaine;
 4038: 
 4039:                     (*s_etat_processus).nom_fichier_gnuplot = NULL;
 4040:                     (*s_etat_processus).type_fichier_gnuplot = NULL;
 4041: 
 4042:                     (*s_etat_processus).x_tics = 0;
 4043:                     (*s_etat_processus).y_tics = 0;
 4044:                     (*s_etat_processus).z_tics = 0;
 4045: 
 4046:                     (*s_etat_processus).x_lines = d_vrai;
 4047:                     (*s_etat_processus).y_lines = d_vrai;
 4048:                     (*s_etat_processus).z_lines = d_vrai;
 4049: 
 4050:                     (*s_etat_processus).mx_tics = -1;
 4051:                     (*s_etat_processus).my_tics = -1;
 4052:                     (*s_etat_processus).mz_tics = -1;
 4053: 
 4054:                     (*s_etat_processus).mx_lines = d_faux;
 4055:                     (*s_etat_processus).my_lines = d_faux;
 4056:                     (*s_etat_processus).mz_lines = d_faux;
 4057: 
 4058:                     (*s_etat_processus).x2_tics = -1;
 4059:                     (*s_etat_processus).y2_tics = -1;
 4060:                     (*s_etat_processus).z2_tics = -1;
 4061: 
 4062:                     (*s_etat_processus).x2_lines = d_faux;
 4063:                     (*s_etat_processus).y2_lines = d_faux;
 4064:                     (*s_etat_processus).z2_lines = d_faux;
 4065: 
 4066:                     (*s_etat_processus).mx2_tics = -1;
 4067:                     (*s_etat_processus).my2_tics = -1;
 4068:                     (*s_etat_processus).mz2_tics = -1;
 4069: 
 4070:                     (*s_etat_processus).mx2_lines = d_faux;
 4071:                     (*s_etat_processus).my2_lines = d_faux;
 4072:                     (*s_etat_processus).mz2_lines = d_faux;
 4073: 
 4074:                     (*s_etat_processus).mode_evaluation_expression = 'N';
 4075:                     (*s_etat_processus).mode_execution_programme = 'Y';
 4076: 
 4077:                     if ((*s_etat_processus).definitions_chainees == NULL)
 4078:                     {
 4079:                         if ((erreur = chainage(s_etat_processus)) !=
 4080:                                 d_absence_erreur)
 4081:                         {
 4082: #                           ifndef SEMAPHORES_NOMMES
 4083:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 4084:                                 sem_post(&semaphore_gestionnaires_signaux);
 4085:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 4086:                                 sem_destroy(&((*s_etat_processus)
 4087:                                         .semaphore_fork));
 4088: #                           else
 4089:                                 sem_post((*s_etat_processus).semaphore_fork);
 4090:                                 sem_post(semaphore_gestionnaires_signaux);
 4091:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 4092:                                         getpid(), SEM_SIGNAUX);
 4093:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 4094:                                         getpid(), pthread_self(), SEM_FORK);
 4095: #                           endif
 4096: 
 4097:                             liberation_contexte_cas(s_etat_processus);
 4098:                             liberation_queue_signaux(s_etat_processus);
 4099: 
 4100: #                           ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4101:                                 stackoverflow_deinstall_handler();
 4102: #                           endif
 4103: 
 4104: #                           ifdef HAVE_SIGSEGV_RECOVERY
 4105:                                 if (debug == d_faux)
 4106:                                 {
 4107:                                     sigsegv_deinstall_handler();
 4108:                                 }
 4109: #                           endif
 4110: 
 4111:                             if ((*s_etat_processus).langue == 'F')
 4112:                             {
 4113:                                 printf("+++Fatal :"
 4114:                                         " Chaînage des définitions"
 4115:                                         " impossible\n");
 4116:                             }
 4117:                             else
 4118:                             {
 4119:                                 printf("+++Fatal : Error in "
 4120:                                         "compilation\n");
 4121:                             }
 4122: 
 4123:                             if (traitement_fichier_temporaire == 'Y')
 4124:                             {
 4125:                                 if (destruction_fichier(
 4126:                                         nom_fichier_temporaire)
 4127:                                         == d_erreur)
 4128:                                 {
 4129:                                     return(EXIT_FAILURE);
 4130:                                 }
 4131: 
 4132:                                 free(nom_fichier_temporaire);
 4133:                             }
 4134: 
 4135:                             return(EXIT_FAILURE);
 4136:                         }
 4137:                     }
 4138: 
 4139:                     if ((erreur = compilation(s_etat_processus)) !=
 4140:                             d_absence_erreur)
 4141:                     {
 4142: #                       ifndef SEMAPHORES_NOMMES
 4143:                             sem_post(&((*s_etat_processus).semaphore_fork));
 4144:                             sem_post(&semaphore_gestionnaires_signaux);
 4145:                             sem_destroy(&semaphore_gestionnaires_signaux);
 4146:                             sem_destroy(&((*s_etat_processus).semaphore_fork));
 4147: #                       else
 4148:                             sem_post((*s_etat_processus).semaphore_fork);
 4149:                             sem_post(semaphore_gestionnaires_signaux);
 4150:                             sem_destroy2(semaphore_gestionnaires_signaux,
 4151:                                     getpid(), SEM_SIGNAUX);
 4152:                             sem_destroy3((*s_etat_processus).semphore_fork,
 4153:                                     getpid(), pthread_self(), SEM_FORK);
 4154: #                       endif
 4155: 
 4156:                         liberation_contexte_cas(s_etat_processus);
 4157:                         liberation_queue_signaux(s_etat_processus);
 4158: 
 4159: #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4160:                             stackoverflow_deinstall_handler();
 4161: #                       endif
 4162: 
 4163: #                       ifdef HAVE_SIGSEGV_RECOVERY
 4164:                             if (debug == d_faux)
 4165:                             {
 4166:                                 sigsegv_deinstall_handler();
 4167:                             }
 4168: #                       endif
 4169: 
 4170:                         if (traitement_fichier_temporaire == 'Y')
 4171:                         {
 4172:                             if (destruction_fichier(nom_fichier_temporaire)
 4173:                                     == d_erreur)
 4174:                             {
 4175:                                 return(EXIT_FAILURE);
 4176:                             }
 4177: 
 4178:                             free(nom_fichier_temporaire);
 4179:                         }
 4180: 
 4181:                         printf("%s [%d]\n", message =
 4182:                                 messages(s_etat_processus), (int) getpid());
 4183:                         free(message);
 4184: 
 4185:                         if (test_cfsf(s_etat_processus, 51) == d_faux)
 4186:                         {
 4187:                             printf("%s", ds_beep);
 4188:                         }
 4189: 
 4190:                         if ((*s_etat_processus).core == d_vrai)
 4191:                         {
 4192:                             printf("\n");
 4193:                             
 4194:                             if ((*s_etat_processus).langue == 'F')
 4195:                             {
 4196:                                 printf("+++Information : Génération du fichier "
 4197:                                         "rpl-core [%d]\n", (int) getpid());
 4198:                             }
 4199:                             else
 4200:                             {
 4201:                                 printf("+++Information : Writing rpl-core "
 4202:                                         "file [%d]\n", (int) getpid());
 4203:                             }
 4204: 
 4205:                             rplcore(s_etat_processus);
 4206: 
 4207:                             if ((*s_etat_processus).langue == 'F')
 4208:                             {
 4209:                                 printf("+++Information : Processus tracé "
 4210:                                         "[%d]\n", (int) getpid());
 4211:                             }
 4212:                             else
 4213:                             {
 4214:                                 printf("+++Information : Done [%d]\n",
 4215:                                         (int) getpid());
 4216:                             }
 4217: 
 4218:                             printf("\n");
 4219:                         }
 4220: 
 4221:                         return(EXIT_FAILURE);
 4222:                     }
 4223: 
 4224:                     (*s_etat_processus).position_courante = 0;
 4225:                     (*s_etat_processus).traitement_cycle_exit = 'N';
 4226: 
 4227:                     if ((*s_etat_processus).s_arbre_variables == NULL)
 4228:                     {
 4229: #                       ifndef SEMAPHORES_NOMMES
 4230:                             sem_post(&((*s_etat_processus).semaphore_fork));
 4231:                             sem_post(&semaphore_gestionnaires_signaux);
 4232:                             sem_destroy(&semaphore_gestionnaires_signaux);
 4233:                             sem_destroy(&((*s_etat_processus).semaphore_fork));
 4234: #                       else
 4235:                             sem_post((*s_etat_processus).semaphore_fork);
 4236:                             sem_post(semaphore_gestionnaires_signaux);
 4237:                             sem_destroy2(semaphore_gestionnaires_signaux,
 4238:                                     getpid(), SEM_SIGNAUX);
 4239:                             sem_destroy3((*s_etat_processus).semphore_fork,
 4240:                                     getpid(), pthread_self(), SEM_FORK);
 4241: #                       endif
 4242: 
 4243:                         liberation_contexte_cas(s_etat_processus);
 4244:                         liberation_queue_signaux(s_etat_processus);
 4245: 
 4246: #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4247:                             stackoverflow_deinstall_handler();
 4248: #                       endif
 4249: 
 4250: #                       ifdef HAVE_SIGSEGV_RECOVERY
 4251:                             if (debug == d_faux)
 4252:                             {
 4253:                                 sigsegv_deinstall_handler();
 4254:                             }
 4255: #                       endif
 4256: 
 4257:                         if ((*s_etat_processus).langue == 'F')
 4258:                         {
 4259:                             printf("+++Fatal : Aucun point d'entrée\n");
 4260:                         }
 4261:                         else
 4262:                         {
 4263:                             printf("+++Fatal : Any entry point\n");
 4264:                         }
 4265: 
 4266:                         if (test_cfsf(s_etat_processus, 51) == d_faux)
 4267:                         {
 4268:                             printf("%s", ds_beep);
 4269:                         }
 4270: 
 4271:                         return(EXIT_FAILURE);
 4272:                     }
 4273: 
 4274:                     if (recherche_instruction_suivante(s_etat_processus)
 4275:                             == d_erreur)
 4276:                     {
 4277: #                       ifndef SEMAPHORES_NOMMES
 4278:                             sem_post(&((*s_etat_processus).semaphore_fork));
 4279:                             sem_post(&semaphore_gestionnaires_signaux);
 4280:                             sem_destroy(&semaphore_gestionnaires_signaux);
 4281:                             sem_destroy(&((*s_etat_processus).semaphore_fork));
 4282: #                       else
 4283:                             sem_post((*s_etat_processus).semaphore_fork);
 4284:                             sem_post(semaphore_gestionnaires_signaux);
 4285:                             sem_destroy2(semaphore_gestionnaires_signaux,
 4286:                                     getpid(), SEM_SIGNAUX);
 4287:                             sem_destroy3((*s_etat_processus).semphore_fork,
 4288:                                     getpid(), pthread_self(), SEM_FORK);
 4289: #                       endif
 4290: 
 4291:                         liberation_contexte_cas(s_etat_processus);
 4292:                         liberation_queue_signaux(s_etat_processus);
 4293: 
 4294: #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4295:                             stackoverflow_deinstall_handler();
 4296: #                       endif
 4297: 
 4298: #                       ifdef HAVE_SIGSEGV_RECOVERY
 4299:                             if (debug == d_faux)
 4300:                             {
 4301:                                 sigsegv_deinstall_handler();
 4302:                             }
 4303: #                       endif
 4304: 
 4305:                         if ((*s_etat_processus).langue == 'F')
 4306:                         {
 4307:                             printf("+++Fatal : Aucun point d'entrée\n");
 4308:                         }
 4309:                         else
 4310:                         {
 4311:                             printf("+++Fatal : Any entry point\n");
 4312:                         }
 4313: 
 4314:                         if (test_cfsf(s_etat_processus, 51) == d_faux)
 4315:                         {
 4316:                             printf("%s", ds_beep);
 4317:                         }
 4318: 
 4319:                         return(EXIT_FAILURE);
 4320:                     }
 4321: 
 4322:                     if (recherche_variable(s_etat_processus,
 4323:                             (*s_etat_processus)
 4324:                             .instruction_courante) == d_faux)
 4325:                     {
 4326: #                       ifndef SEMAPHORES_NOMMES
 4327:                             sem_post(&((*s_etat_processus).semaphore_fork));
 4328:                             sem_post(&semaphore_gestionnaires_signaux);
 4329:                             sem_destroy(&semaphore_gestionnaires_signaux);
 4330:                             sem_destroy(&((*s_etat_processus).semaphore_fork));
 4331: #                       else
 4332:                             sem_post((*s_etat_processus).semaphore_fork);
 4333:                             sem_post(semaphore_gestionnaires_signaux);
 4334:                             sem_destroy2(semaphore_gestionnaires_signaux,
 4335:                                     getpid(), SEM_SIGNAUX);
 4336:                             sem_destroy3((*s_etat_processus).semphore_fork,
 4337:                                     getpid(), pthread_self(), SEM_FORK);
 4338: #                       endif
 4339: 
 4340:                         liberation_contexte_cas(s_etat_processus);
 4341:                         liberation_queue_signaux(s_etat_processus);
 4342: 
 4343: #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4344:                             stackoverflow_deinstall_handler();
 4345: #                       endif
 4346: 
 4347: #                       ifdef HAVE_SIGSEGV_RECOVERY
 4348:                             if (debug == d_faux)
 4349:                             {
 4350:                                 sigsegv_deinstall_handler();
 4351:                             }
 4352: #                       endif
 4353: 
 4354:                         if ((*s_etat_processus).langue == 'F')
 4355:                         {
 4356:                             printf("+++Fatal : Aucun point d'entrée\n");
 4357:                         }
 4358:                         else
 4359:                         {
 4360:                             printf("+++Fatal : Any entry point\n");
 4361:                         }
 4362: 
 4363:                         if (test_cfsf(s_etat_processus, 51) == d_faux)
 4364:                         {
 4365:                             printf("%s", ds_beep);
 4366:                         }
 4367: 
 4368:                         return(EXIT_FAILURE);
 4369:                     }
 4370: 
 4371:                     if ((*(*s_etat_processus).pointeur_variable_courante)
 4372:                             .niveau != 0)
 4373:                     {
 4374: #                       ifndef SEMAPHORES_NOMMES
 4375:                             sem_post(&((*s_etat_processus).semaphore_fork));
 4376:                             sem_post(&semaphore_gestionnaires_signaux);
 4377:                             sem_destroy(&semaphore_gestionnaires_signaux);
 4378:                             sem_destroy(&((*s_etat_processus).semaphore_fork));
 4379: #                       else
 4380:                             sem_post((*s_etat_processus).semaphore_fork);
 4381:                             sem_post(semaphore_gestionnaires_signaux);
 4382:                             sem_destroy2(semaphore_gestionnaires_signaux,
 4383:                                     getpid(), SEM_SIGNAUX);
 4384:                             sem_destroy3((*s_etat_processus).semphore_fork,
 4385:                                     getpid(), pthread_self(), SEM_FORK);
 4386: #                       endif
 4387: 
 4388:                         liberation_contexte_cas(s_etat_processus);
 4389:                         liberation_queue_signaux(s_etat_processus);
 4390: 
 4391: #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4392:                             stackoverflow_deinstall_handler();
 4393: #                       endif
 4394: 
 4395: #                       ifdef HAVE_SIGSEGV_RECOVERY
 4396:                             if (debug == d_faux)
 4397:                             {
 4398:                                 sigsegv_deinstall_handler();
 4399:                             }
 4400: #                       endif
 4401: 
 4402:                         if ((*s_etat_processus).langue == 'F')
 4403:                         {
 4404:                             printf("+++Fatal : Aucun point d'entrée\n");
 4405:                         }
 4406:                         else
 4407:                         {
 4408:                             printf("+++Fatal : Any entry point\n");
 4409:                         }
 4410: 
 4411:                         if (test_cfsf(s_etat_processus, 51) == d_faux)
 4412:                         {
 4413:                             printf("%s", ds_beep);
 4414:                         }
 4415: 
 4416:                         return(EXIT_FAILURE);
 4417:                     }
 4418: 
 4419:                     free((*s_etat_processus).instruction_courante);
 4420:                     (*s_etat_processus).position_courante = 0;
 4421: 
 4422:                     if (((*s_etat_processus).nom_fichier_historique =
 4423:                             malloc((strlen(home) +
 4424:                             strlen(ds_fichier_historique) + 2) *
 4425:                             sizeof(unsigned char))) == NULL)
 4426:                     {
 4427: #                       ifndef SEMAPHORES_NOMMES
 4428:                             sem_post(&((*s_etat_processus).semaphore_fork));
 4429:                             sem_post(&semaphore_gestionnaires_signaux);
 4430:                             sem_destroy(&semaphore_gestionnaires_signaux);
 4431:                             sem_destroy(&((*s_etat_processus).semaphore_fork));
 4432: #                       else
 4433:                             sem_post((*s_etat_processus).semaphore_fork);
 4434:                             sem_post(semaphore_gestionnaires_signaux);
 4435:                             sem_destroy2(semaphore_gestionnaires_signaux,
 4436:                                     getpid(), SEM_SIGNAUX);
 4437:                             sem_destroy3((*s_etat_processus).semphore_fork,
 4438:                                     getpid(), pthread_self(), SEM_FORK);
 4439: #                       endif
 4440: 
 4441:                         liberation_contexte_cas(s_etat_processus);
 4442:                         liberation_queue_signaux(s_etat_processus);
 4443: 
 4444: #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4445:                             stackoverflow_deinstall_handler();
 4446: #                       endif
 4447: 
 4448: #                       ifdef HAVE_SIGSEGV_RECOVERY
 4449:                             if (debug == d_faux)
 4450:                             {
 4451:                                 sigsegv_deinstall_handler();
 4452:                             }
 4453: #                       endif
 4454: 
 4455:                         erreur = d_es_allocation_memoire;
 4456: 
 4457:                         if ((*s_etat_processus).langue == 'F')
 4458:                         {
 4459:                             printf("+++Système : Mémoire insuffisante\n");
 4460:                         }
 4461:                         else
 4462:                         {
 4463:                             printf("+++System : Not enough memory\n");
 4464:                         }
 4465: 
 4466:                         return(EXIT_FAILURE);
 4467:                     }
 4468: 
 4469:                     sprintf((*s_etat_processus).nom_fichier_historique, "%s/%s",
 4470:                             home, ds_fichier_historique);
 4471: 
 4472:                     using_history();
 4473: 
 4474:                     // Pour pouvoir utiliser le keymap avant le premier
 4475:                     // appel à readline().
 4476:                     rl_initialize();
 4477: 
 4478:                     erreur_historique = read_history(
 4479:                             (*s_etat_processus).nom_fichier_historique);
 4480: 
 4481:                     gsl_set_error_handler(&traitement_exceptions_gsl);
 4482: 
 4483:                     if (drapeau_encart == 'Y')
 4484:                     {
 4485:                         (*s_etat_processus).erreur_systeme = d_es;
 4486:                         encart(s_etat_processus,
 4487:                                 (integer8) (5 * 1000000));
 4488: 
 4489:                         if ((*s_etat_processus).erreur_systeme != d_es)
 4490:                         {
 4491:                             if ((message = messages(s_etat_processus))
 4492:                                     == NULL)
 4493:                             {
 4494: #                               ifndef SEMAPHORES_NOMMES
 4495:                                     sem_post(&((*s_etat_processus)
 4496:                                             .semaphore_fork));
 4497:                                     sem_post(&semaphore_gestionnaires_signaux);
 4498:                                     sem_destroy(
 4499:                                             &semaphore_gestionnaires_signaux);
 4500:                                     sem_destroy(&((*s_etat_processus)
 4501:                                             .semaphore_fork));
 4502: #                               else
 4503:                                     sem_post((*s_etat_processus)
 4504:                                             .semaphore_fork);
 4505:                                     sem_post(semaphore_gestionnaires_signaux);
 4506:                                     sem_destroy2(
 4507:                                             semaphore_gestionnaires_signaux,
 4508:                                             getpid(), SEM_SIGNAUX);
 4509:                                     sem_destroy3((*s_etat_processus)
 4510:                                             .semphore_fork,
 4511:                                             getpid(), pthread_self(), SEM_FORK);
 4512: #                               endif
 4513: 
 4514:                                 liberation_contexte_cas(s_etat_processus);
 4515:                                 liberation_queue_signaux(s_etat_processus);
 4516: 
 4517: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4518:                                     stackoverflow_deinstall_handler();
 4519: #                               endif
 4520: 
 4521: #                               ifdef HAVE_SIGSEGV_RECOVERY
 4522:                                     if (debug == d_faux)
 4523:                                     {
 4524:                                         sigsegv_deinstall_handler();
 4525:                                     }
 4526: #                               endif
 4527: 
 4528:                                 erreur = d_es_allocation_memoire;
 4529: 
 4530:                                 if ((*s_etat_processus).langue == 'F')
 4531:                                 {
 4532:                                     printf("+++Système : Mémoire "
 4533:                                             "insuffisante\n");
 4534:                                 }
 4535:                                 else
 4536:                                 {
 4537:                                     printf("+++System : Not enough "
 4538:                                             "memory\n");
 4539:                                 }
 4540: 
 4541:                                 return(EXIT_FAILURE);
 4542:                             }
 4543: 
 4544:                             printf("%s [%d]\n", message, (int) getpid());
 4545:                             free(message);
 4546: 
 4547:                             return(EXIT_FAILURE);
 4548:                         }
 4549:                     }
 4550: 
 4551:                     fflush(stdout);
 4552: 
 4553:                     if (arguments != NULL)
 4554:                     {
 4555:                         tampon = (*s_etat_processus).definitions_chainees;
 4556:                         (*s_etat_processus).definitions_chainees =
 4557:                                 arguments;
 4558: 
 4559:                         if (analyse_syntaxique(s_etat_processus) ==
 4560:                                 d_erreur)
 4561:                         {
 4562:                             if ((*s_etat_processus).erreur_systeme != d_es)
 4563:                             {
 4564: #                               ifndef SEMAPHORES_NOMMES
 4565:                                     sem_post(&((*s_etat_processus)
 4566:                                             .semaphore_fork));
 4567:                                     sem_post(&semaphore_gestionnaires_signaux);
 4568:                                     sem_destroy(
 4569:                                             &semaphore_gestionnaires_signaux);
 4570:                                     sem_destroy(&((*s_etat_processus)
 4571:                                             .semaphore_fork));
 4572: #                               else
 4573:                                     sem_post((*s_etat_processus)
 4574:                                             .semaphore_fork);
 4575:                                     sem_post(semaphore_gestionnaires_signaux);
 4576:                                     sem_destroy2(
 4577:                                             semaphore_gestionnaires_signaux,
 4578:                                             getpid(), SEM_SIGNAUX);
 4579:                                     sem_destroy3((*s_etat_processus)
 4580:                                             .semphore_fork,
 4581:                                             getpid(), pthread_self(), SEM_FORK);
 4582: #                               endif
 4583: 
 4584:                                 liberation_contexte_cas(s_etat_processus);
 4585:                                 liberation_queue_signaux(s_etat_processus);
 4586: 
 4587: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4588:                                     stackoverflow_deinstall_handler();
 4589: #                               endif
 4590: 
 4591: #                               ifdef HAVE_SIGSEGV_RECOVERY
 4592:                                     if (debug == d_faux)
 4593:                                     {
 4594:                                         sigsegv_deinstall_handler();
 4595:                                     }
 4596: #                               endif
 4597: 
 4598:                                 erreur = d_es_allocation_memoire;
 4599: 
 4600:                                 if ((*s_etat_processus).langue == 'F')
 4601:                                 {
 4602:                                     printf("+++Système : Mémoire "
 4603:                                             "insuffisante\n");
 4604:                                 }
 4605:                                 else
 4606:                                 {
 4607:                                     printf("+++System : Not enough "
 4608:                                             "memory\n");
 4609:                                 }
 4610: 
 4611:                                 return(EXIT_FAILURE);
 4612:                             }
 4613:                             else
 4614:                             {
 4615: #                               ifndef SEMAPHORES_NOMMES
 4616:                                     sem_post(&((*s_etat_processus)
 4617:                                             .semaphore_fork));
 4618:                                     sem_post(&semaphore_gestionnaires_signaux);
 4619:                                     sem_destroy(
 4620:                                             &semaphore_gestionnaires_signaux);
 4621:                                     sem_destroy(&((*s_etat_processus)
 4622:                                             .semaphore_fork));
 4623: #                               else
 4624:                                     sem_post((*s_etat_processus)
 4625:                                             .semaphore_fork);
 4626:                                     sem_post(semaphore_gestionnaires_signaux);
 4627:                                     sem_destroy2(
 4628:                                             semaphore_gestionnaires_signaux,
 4629:                                             getpid(), SEM_SIGNAUX);
 4630:                                     sem_destroy3((*s_etat_processus)
 4631:                                             .semphore_fork,
 4632:                                             getpid(), pthread_self(), SEM_FORK);
 4633: #                               endif
 4634: 
 4635:                                 liberation_contexte_cas(s_etat_processus);
 4636:                                 liberation_queue_signaux(s_etat_processus);
 4637: 
 4638: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4639:                                     stackoverflow_deinstall_handler();
 4640: #                               endif
 4641: 
 4642: #                               ifdef HAVE_SIGSEGV_RECOVERY
 4643:                                     if (debug == d_faux)
 4644:                                     {
 4645:                                         sigsegv_deinstall_handler();
 4646:                                     }
 4647: #                               endif
 4648: 
 4649:                                 if ((*s_etat_processus).langue == 'F')
 4650:                                 {
 4651:                                     printf("+++Erreur : Erreur de "
 4652:                                             "syntaxe\n");
 4653:                                 }
 4654:                                 else
 4655:                                 {
 4656:                                     printf("+++Error : Syntax error\n");
 4657:                                 }
 4658: 
 4659:                                 return(EXIT_FAILURE);
 4660:                             }
 4661:                         }
 4662: 
 4663:                         (*s_etat_processus).instruction_courante
 4664:                                 = arguments;
 4665:                         (*s_etat_processus).definitions_chainees = tampon;
 4666:                         (*s_etat_processus).position_courante = 0;
 4667: 
 4668:                         recherche_type(s_etat_processus);
 4669: 
 4670:                         if ((*s_etat_processus).erreur_systeme != d_es)
 4671:                         {
 4672: #                           ifndef SEMAPHORES_NOMMES
 4673:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 4674:                                 sem_post(&semaphore_gestionnaires_signaux);
 4675:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 4676:                                 sem_destroy(&((*s_etat_processus)
 4677:                                         .semaphore_fork));
 4678: #                           else
 4679:                                 sem_post((*s_etat_processus).semaphore_fork);
 4680:                                 sem_post(semaphore_gestionnaires_signaux);
 4681:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 4682:                                         getpid(), SEM_SIGNAUX);
 4683:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 4684:                                         getpid(), pthread_self(), SEM_FORK);
 4685: #                           endif
 4686: 
 4687:                             liberation_contexte_cas(s_etat_processus);
 4688:                             liberation_queue_signaux(s_etat_processus);
 4689: 
 4690: #                           ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4691:                                 stackoverflow_deinstall_handler();
 4692: #                           endif
 4693: 
 4694: #                           ifdef HAVE_SIGSEGV_RECOVERY
 4695:                                 if (debug == d_faux)
 4696:                                 {
 4697:                                     sigsegv_deinstall_handler();
 4698:                                 }
 4699: #                           endif
 4700: 
 4701:                             if ((message = messages(s_etat_processus))
 4702:                                     == NULL)
 4703:                             {
 4704:                                 erreur = d_es_allocation_memoire;
 4705: 
 4706:                                 if ((*s_etat_processus).langue == 'F')
 4707:                                 {
 4708:                                     printf("+++Système : Mémoire "
 4709:                                             "insuffisante\n");
 4710:                                 }
 4711:                                 else
 4712:                                 {
 4713:                                     printf("+++System : Not enough "
 4714:                                             "memory\n");
 4715:                                 }
 4716: 
 4717:                                 return(EXIT_FAILURE);
 4718:                             }
 4719: 
 4720:                             printf("%s [%d]\n", message, (int) getpid());
 4721:                             free(message);
 4722: 
 4723:                             return(EXIT_FAILURE);
 4724:                         }
 4725: 
 4726:                         if ((*s_etat_processus).erreur_execution != d_ex)
 4727:                         {
 4728:                             if ((message = messages(s_etat_processus))
 4729:                                     == NULL)
 4730:                             {
 4731: #                               ifndef SEMAPHORES_NOMMES
 4732:                                     sem_post(&((*s_etat_processus)
 4733:                                             .semaphore_fork));
 4734:                                     sem_post(&semaphore_gestionnaires_signaux);
 4735:                                     sem_destroy(
 4736:                                             &semaphore_gestionnaires_signaux);
 4737:                                     sem_destroy(&((*s_etat_processus)
 4738:                                             .semaphore_fork));
 4739: #                               else
 4740:                                     sem_post((*s_etat_processus)
 4741:                                             .semaphore_fork);
 4742:                                     sem_post(semaphore_gestionnaires_signaux);
 4743:                                     sem_destroy2(
 4744:                                             semaphore_gestionnaires_signaux,
 4745:                                             getpid(), SEM_SIGNAUX);
 4746:                                     sem_destroy3((*s_etat_processus)
 4747:                                             .semphore_fork,
 4748:                                             getpid(), pthread_self(), SEM_FORK);
 4749: #                               endif
 4750: 
 4751:                                 liberation_contexte_cas(s_etat_processus);
 4752:                                 liberation_queue_signaux(s_etat_processus);
 4753: 
 4754: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4755:                                     stackoverflow_deinstall_handler();
 4756: #                               endif
 4757: 
 4758: #                               ifdef HAVE_SIGSEGV_RECOVERY
 4759:                                     if (debug == d_faux)
 4760:                                     {
 4761:                                         sigsegv_deinstall_handler();
 4762:                                     }
 4763: #                               endif
 4764: 
 4765:                                 erreur = d_es_allocation_memoire;
 4766: 
 4767:                                 if ((*s_etat_processus).langue == 'F')
 4768:                                 {
 4769:                                     printf("+++Erreur : Mémoire "
 4770:                                             "insuffisante\n");
 4771:                                 }
 4772:                                 else
 4773:                                 {
 4774:                                     printf("+++Error : Not enough "
 4775:                                             "memory\n");
 4776:                                 }
 4777: 
 4778:                                 return(EXIT_FAILURE);
 4779:                             }
 4780: 
 4781:                             printf("%s [%d]\n", message, (int) getpid());
 4782:                             free(message);
 4783: 
 4784: #                           ifndef SEMAPHORES_NOMMES
 4785:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 4786:                                 sem_post(&semaphore_gestionnaires_signaux);
 4787:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 4788:                                 sem_destroy(&((*s_etat_processus)
 4789:                                         .semaphore_fork));
 4790: #                           else
 4791:                                 sem_post((*s_etat_processus).semaphore_fork);
 4792:                                 sem_post(semaphore_gestionnaires_signaux);
 4793:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 4794:                                         getpid(), SEM_SIGNAUX);
 4795:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 4796:                                         getpid(), pthread_self(), SEM_FORK);
 4797: #                           endif
 4798: 
 4799:                             liberation_contexte_cas(s_etat_processus);
 4800:                             liberation_queue_signaux(s_etat_processus);
 4801: 
 4802: #                           ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4803:                                 stackoverflow_deinstall_handler();
 4804: #                           endif
 4805: 
 4806: #                           ifdef HAVE_SIGSEGV_RECOVERY
 4807:                                 if (debug == d_faux)
 4808:                                 {
 4809:                                     sigsegv_deinstall_handler();
 4810:                                 }
 4811: #                           endif
 4812: 
 4813:                             return(EXIT_FAILURE);
 4814:                         }
 4815: 
 4816:                         if (depilement(s_etat_processus,
 4817:                                 &((*s_etat_processus).l_base_pile),
 4818:                                 &s_objet) == d_erreur)
 4819:                         {
 4820:                             if ((message = messages(s_etat_processus))
 4821:                                     == NULL)
 4822:                             {
 4823: #                               ifndef SEMAPHORES_NOMMES
 4824:                                     sem_post(&((*s_etat_processus)
 4825:                                             .semaphore_fork));
 4826:                                     sem_post(&semaphore_gestionnaires_signaux);
 4827:                                     sem_destroy(
 4828:                                             &semaphore_gestionnaires_signaux);
 4829:                                     sem_destroy(&((*s_etat_processus)
 4830:                                             .semaphore_fork));
 4831: #                               else
 4832:                                     sem_post((*s_etat_processus)
 4833:                                             .semaphore_fork);
 4834:                                     sem_post(semaphore_gestionnaires_signaux);
 4835:                                     sem_destroy2(
 4836:                                             semaphore_gestionnaires_signaux,
 4837:                                             getpid(), SEM_SIGNAUX);
 4838:                                     sem_destroy3((*s_etat_processus)
 4839:                                             .semphore_fork,
 4840:                                             getpid(), pthread_self(), SEM_FORK);
 4841: #                               endif
 4842: 
 4843:                                 liberation_contexte_cas(s_etat_processus);
 4844:                                 liberation_queue_signaux(s_etat_processus);
 4845: 
 4846: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4847:                                     stackoverflow_deinstall_handler();
 4848: #                               endif
 4849: 
 4850: #                               ifdef HAVE_SIGSEGV_RECOVERY
 4851:                                     if (debug == d_faux)
 4852:                                     {
 4853:                                         sigsegv_deinstall_handler();
 4854:                                     }
 4855: #                               endif
 4856: 
 4857:                                 erreur = d_es_allocation_memoire;
 4858:                                 erreur = d_es_allocation_memoire;
 4859: 
 4860:                                 if ((*s_etat_processus).langue == 'F')
 4861:                                 {
 4862:                                     printf("+++Erreur : Mémoire "
 4863:                                             "insuffisante\n");
 4864:                                 }
 4865:                                 else
 4866:                                 {
 4867:                                     printf("+++Error : Not enough "
 4868:                                             "memory\n");
 4869:                                 }
 4870: 
 4871:                                 return(EXIT_FAILURE);
 4872:                             }
 4873: 
 4874:                             printf("%s [%d]\n", message, (int) getpid());
 4875:                             free(message);
 4876: 
 4877: #                           ifndef SEMAPHORES_NOMMES
 4878:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 4879:                                 sem_post(&semaphore_gestionnaires_signaux);
 4880:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 4881:                                 sem_destroy(&((*s_etat_processus)
 4882:                                         .semaphore_fork));
 4883: #                           else
 4884:                                 sem_post((*s_etat_processus).semaphore_fork);
 4885:                                 sem_post(semaphore_gestionnaires_signaux);
 4886:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 4887:                                         getpid(), SEM_SIGNAUX);
 4888:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 4889:                                         getpid(), pthread_self(), SEM_FORK);
 4890: #                           endif
 4891: 
 4892:                             liberation_contexte_cas(s_etat_processus);
 4893:                             liberation_queue_signaux(s_etat_processus);
 4894: 
 4895: #                           ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4896:                                 stackoverflow_deinstall_handler();
 4897: #                           endif
 4898: 
 4899: #                           ifdef HAVE_SIGSEGV_RECOVERY
 4900:                                 if (debug == d_faux)
 4901:                                 {
 4902:                                     sigsegv_deinstall_handler();
 4903:                                 }
 4904: #                           endif
 4905: 
 4906:                             return(EXIT_FAILURE);
 4907:                         }
 4908: 
 4909:                         empilement_pile_systeme(s_etat_processus);
 4910: 
 4911:                         if (evaluation(s_etat_processus, s_objet, 'E')
 4912:                                 == d_erreur)
 4913:                         {
 4914:                             if ((*s_etat_processus).erreur_systeme != d_es)
 4915:                             {
 4916:                                 if ((message = messages(s_etat_processus))
 4917:                                         == NULL)
 4918:                                 {
 4919: #                                   ifndef SEMAPHORES_NOMMES
 4920:                                         sem_post(&((*s_etat_processus)
 4921:                                                 .semaphore_fork));
 4922:                                         sem_post(
 4923:                                                 &semaphore_gestionnaires_signaux
 4924:                                                 );
 4925:                                         sem_destroy(
 4926:                                                 &semaphore_gestionnaires_signaux
 4927:                                                 );
 4928:                                         sem_destroy(&((*s_etat_processus)
 4929:                                                 .semaphore_fork));
 4930: #                                   else
 4931:                                         sem_post((*s_etat_processus)
 4932:                                                 .semaphore_fork);
 4933:                                         sem_post(
 4934:                                                 semaphore_gestionnaires_signaux
 4935:                                                 );
 4936:                                         sem_destroy2(
 4937:                                                 semaphore_gestionnaires_signaux,
 4938:                                                 getpid(), SEM_SIGNAUX);
 4939:                                         sem_destroy3((*s_etat_processus)
 4940:                                                 .semphore_fork, getpid(),
 4941:                                                 pthread_self(), SEM_FORK);
 4942: #                                   endif
 4943: 
 4944:                                     liberation_contexte_cas(s_etat_processus);
 4945:                                     liberation_queue_signaux(s_etat_processus);
 4946: 
 4947: #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4948:                                         stackoverflow_deinstall_handler();
 4949: #                                   endif
 4950: 
 4951: #                                   ifdef HAVE_SIGSEGV_RECOVERY
 4952:                                         if (debug == d_faux)
 4953:                                         {
 4954:                                             sigsegv_deinstall_handler();
 4955:                                         }
 4956: #                                   endif
 4957: 
 4958:                                     erreur = d_es_allocation_memoire;
 4959: 
 4960:                                     if ((*s_etat_processus).langue == 'F')
 4961:                                     {
 4962:                                         printf("+++Système : Mémoire "
 4963:                                                 "insuffisante\n");
 4964:                                     }
 4965:                                     else
 4966:                                     {
 4967:                                         printf("+++System : Not enough "
 4968:                                                 "memory\n");
 4969:                                     }
 4970: 
 4971:                                     return(EXIT_FAILURE);
 4972:                                 }
 4973: 
 4974:                                 printf("%s [%d]\n", message,
 4975:                                         (int) getpid());
 4976:                                 free(message);
 4977: 
 4978: #                               ifndef SEMAPHORES_NOMMES
 4979:                                     sem_post(&((*s_etat_processus)
 4980:                                             .semaphore_fork));
 4981:                                     sem_post(&semaphore_gestionnaires_signaux);
 4982:                                     sem_destroy(
 4983:                                             &semaphore_gestionnaires_signaux);
 4984:                                     sem_destroy(&((*s_etat_processus)
 4985:                                             .semaphore_fork));
 4986: #                               else
 4987:                                     sem_post((*s_etat_processus)
 4988:                                             .semaphore_fork);
 4989:                                     sem_post(semaphore_gestionnaires_signaux);
 4990:                                     sem_destroy2(
 4991:                                             semaphore_gestionnaires_signaux,
 4992:                                             getpid(), SEM_SIGNAUX);
 4993:                                     sem_destroy3((*s_etat_processus)
 4994:                                             .semphore_fork,
 4995:                                             getpid(), pthread_self(), SEM_FORK);
 4996: #                               endif
 4997: 
 4998:                                 liberation_contexte_cas(s_etat_processus);
 4999:                                 liberation_queue_signaux(s_etat_processus);
 5000: 
 5001: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 5002:                                     stackoverflow_deinstall_handler();
 5003: #                               endif
 5004: 
 5005: #                               ifdef HAVE_SIGSEGV_RECOVERY
 5006:                                     if (debug == d_faux)
 5007:                                     {
 5008:                                         sigsegv_deinstall_handler();
 5009:                                     }
 5010: #                               endif
 5011: 
 5012:                                 erreur = d_es_allocation_memoire;
 5013:                                 return(EXIT_FAILURE);
 5014:                             }
 5015: 
 5016:                             if ((*s_etat_processus).erreur_execution
 5017:                                     != d_ex)
 5018:                             {
 5019:                                 if ((message = messages(s_etat_processus))
 5020:                                         == NULL)
 5021:                                 {
 5022: #                                   ifndef SEMAPHORES_NOMMES
 5023:                                         sem_post(&((*s_etat_processus)
 5024:                                                 .semaphore_fork));
 5025:                                         sem_post(
 5026:                                                 &semaphore_gestionnaires_signaux
 5027:                                                 );
 5028:                                         sem_destroy(
 5029:                                                 &semaphore_gestionnaires_signaux
 5030:                                                 );
 5031:                                         sem_destroy(&((*s_etat_processus)
 5032:                                                 .semaphore_fork));
 5033: #                                   else
 5034:                                         sem_post((*s_etat_processus)
 5035:                                                 .semaphore_fork);
 5036:                                         sem_post(
 5037:                                                 semaphore_gestionnaires_signaux
 5038:                                                 );
 5039:                                         sem_destroy2(
 5040:                                                 semaphore_gestionnaires_signaux,
 5041:                                                 getpid(), SEM_SIGNAUX);
 5042:                                         sem_destroy3((*s_etat_processus)
 5043:                                                 .semphore_fork, getpid(),
 5044:                                                 pthread_self(), SEM_FORK);
 5045: #                                   endif
 5046: 
 5047:                                     liberation_contexte_cas(s_etat_processus);
 5048:                                     liberation_queue_signaux(s_etat_processus);
 5049: 
 5050: #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
 5051:                                         stackoverflow_deinstall_handler();
 5052: #                                   endif
 5053: 
 5054: #                                   ifdef HAVE_SIGSEGV_RECOVERY
 5055:                                         if (debug == d_faux)
 5056:                                         {
 5057:                                             sigsegv_deinstall_handler();
 5058:                                         }
 5059: #                                   endif
 5060: 
 5061:                                     erreur = d_es_allocation_memoire;
 5062: 
 5063:                                     if ((*s_etat_processus).langue == 'F')
 5064:                                     {
 5065:                                         printf("+++Erreur : Mémoire "
 5066:                                                 "insuffisante\n");
 5067:                                     }
 5068:                                     else
 5069:                                     {
 5070:                                         printf("+++Error : Not enough "
 5071:                                                 "memory\n");
 5072:                                     }
 5073: 
 5074:                                     return(EXIT_FAILURE);
 5075:                                 }
 5076: 
 5077:                                 printf("%s [%d]\n", message,
 5078:                                         (int) getpid());
 5079:                                 free(message);
 5080: 
 5081: #                               ifndef SEMAPHORES_NOMMES
 5082:                                     sem_post(&((*s_etat_processus)
 5083:                                             .semaphore_fork));
 5084:                                     sem_post(&semaphore_gestionnaires_signaux);
 5085:                                     sem_destroy(
 5086:                                             &semaphore_gestionnaires_signaux);
 5087:                                     sem_destroy(&((*s_etat_processus)
 5088:                                             .semaphore_fork));
 5089: #                               else
 5090:                                     sem_post((*s_etat_processus)
 5091:                                             .semaphore_fork);
 5092:                                     sem_post(semaphore_gestionnaires_signaux);
 5093:                                     sem_destroy2(
 5094:                                             semaphore_gestionnaires_signaux,
 5095:                                             getpid(), SEM_SIGNAUX);
 5096:                                     sem_destroy3((*s_etat_processus)
 5097:                                             .semphore_fork,
 5098:                                             getpid(), pthread_self(), SEM_FORK);
 5099: #                               endif
 5100: 
 5101:                                 liberation_contexte_cas(s_etat_processus);
 5102:                                 liberation_queue_signaux(s_etat_processus);
 5103: 
 5104: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 5105:                                     stackoverflow_deinstall_handler();
 5106: #                               endif
 5107: 
 5108: #                               ifdef HAVE_SIGSEGV_RECOVERY
 5109:                                     if (debug == d_faux)
 5110:                                     {
 5111:                                         sigsegv_deinstall_handler();
 5112:                                     }
 5113: #                               endif
 5114: 
 5115:                                 return(EXIT_FAILURE);
 5116:                             }
 5117:                         }
 5118: 
 5119:                         (*s_etat_processus).instruction_courante = NULL;
 5120:                         liberation(s_etat_processus, s_objet);
 5121: 
 5122:                         free(arguments);
 5123:                     }
 5124: 
 5125:                     if (option_a == d_vrai)
 5126:                     {
 5127:                         fprintf(stdout, "%s\n", (*s_etat_processus)
 5128:                                 .definitions_chainees);
 5129:                     }
 5130:                     else
 5131:                     {
 5132:                         if (option_D == d_vrai)
 5133:                         {
 5134:                             lancement_daemon(s_etat_processus);
 5135:                         }
 5136: 
 5137:                         if (option_p == d_faux)
 5138:                         {
 5139:                             if (setjmp(contexte_initial) == 0)
 5140:                             {
 5141:                                 erreur = sequenceur(s_etat_processus);
 5142: 
 5143:                                 if (erreur == d_absence_erreur)
 5144:                                 {
 5145:                                     if (((*s_etat_processus)
 5146:                                             .arret_depuis_abort == 0) &&
 5147:                                             ((*s_etat_processus).at_exit
 5148:                                             != NULL))
 5149:                                     {
 5150:                                         // Permet de traiter ATEXIT
 5151:                                         // même après réception d'un SIGINT.
 5152:                                         (*s_etat_processus)
 5153:                                                 .var_volatile_alarme = 0;
 5154:                                         (*s_etat_processus)
 5155:                                                 .var_volatile_requete_arret = 0;
 5156: 
 5157:                                         if ((*s_etat_processus).profilage ==
 5158:                                                 d_vrai)
 5159:                                         {
 5160:                                             profilage(s_etat_processus,
 5161:                                                     "ATEXIT");
 5162:                                         }
 5163: 
 5164:                                         erreur = evaluation(s_etat_processus,
 5165:                                                 (*s_etat_processus).at_exit,
 5166:                                                 'E');
 5167: 
 5168:                                         if ((*s_etat_processus).profilage ==
 5169:                                                 d_vrai)
 5170:                                         {
 5171:                                             profilage(s_etat_processus, NULL);
 5172:                                         }
 5173: 
 5174:                                         if (((*s_etat_processus)
 5175:                                                 .erreur_execution != d_ex) ||
 5176:                                                 ((*s_etat_processus).exception
 5177:                                                 != d_ep) || ((*s_etat_processus)
 5178:                                                 .erreur_systeme != d_es))
 5179:                                         {
 5180:                                             printf("%s [%d]\n", message =
 5181:                                                     messages(s_etat_processus),
 5182:                                                     (int) getpid());
 5183:                                             free(message);
 5184: 
 5185:                                             if (test_cfsf(s_etat_processus, 51)
 5186:                                                     == d_faux)
 5187:                                             {
 5188:                                                 printf("%s", ds_beep);
 5189:                                             }
 5190: 
 5191:                                             if ((*s_etat_processus).core ==
 5192:                                                     d_vrai)
 5193:                                             {
 5194:                                                 printf("\n");
 5195: 
 5196:                                                 if ((*s_etat_processus).langue
 5197:                                                         == 'F')
 5198:                                                 {
 5199:                                                     printf("+++Information : Gé"
 5200:                                                             "nération du fichie"
 5201:                                                             "r rpl-core "
 5202:                                                             "[%d]\n", (int)
 5203:                                                             getpid());
 5204:                                                 }
 5205:                                                 else
 5206:                                                 {
 5207:                                                     printf("+++Information : Wr"
 5208:                                                             "iting rpl-core fil"
 5209:                                                             "e [%d]\n",
 5210:                                                             (int) getpid());
 5211:                                                 }
 5212: 
 5213:                                                 rplcore(s_etat_processus);
 5214: 
 5215:                                                 if ((*s_etat_processus).langue
 5216:                                                         == 'F')
 5217:                                                 {
 5218:                                                     printf("+++Information : Pr"
 5219:                                                             "ocessus tracé [%d]"
 5220:                                                             "\n",
 5221:                                                             (int) getpid());
 5222:                                                 }
 5223:                                                 else
 5224:                                                 {
 5225:                                                     printf("+++Information : Do"
 5226:                                                             "ne [%d]\n", (int)
 5227:                                                             getpid());
 5228:                                                 }
 5229: 
 5230:                                                 printf("\n");
 5231:                                                 fflush(stdout);
 5232:                                             }
 5233:                                         }
 5234:                                     }
 5235:                                 }
 5236:                             }
 5237:                         }
 5238:                         else
 5239:                         {
 5240:                             if (setjmp(contexte_initial) == 0)
 5241:                             {
 5242:                                 erreur = sequenceur_optimise(s_etat_processus);
 5243: 
 5244:                                 if (erreur == d_absence_erreur)
 5245:                                 {
 5246:                                     if (((*s_etat_processus)
 5247:                                             .arret_depuis_abort == 0) &&
 5248:                                             ((*s_etat_processus).at_exit
 5249:                                             != NULL))
 5250:                                     {
 5251:                                         // Permet de traiter ATEXIT
 5252:                                         // même après réception d'un SIGINT.
 5253:                                         (*s_etat_processus)
 5254:                                                 .var_volatile_alarme = 0;
 5255:                                         (*s_etat_processus)
 5256:                                                 .var_volatile_requete_arret = 0;
 5257: 
 5258:                                         if ((*s_etat_processus).profilage ==
 5259:                                                 d_vrai)
 5260:                                         {
 5261:                                             profilage(s_etat_processus,
 5262:                                                     "ATEXIT");
 5263:                                         }
 5264: 
 5265:                                         erreur = evaluation(s_etat_processus,
 5266:                                                 (*s_etat_processus).at_exit,
 5267:                                                 'E');
 5268: 
 5269:                                         if ((*s_etat_processus).profilage ==
 5270:                                                 d_vrai)
 5271:                                         {
 5272:                                             profilage(s_etat_processus, NULL);
 5273:                                         }
 5274: 
 5275:                                         if (((*s_etat_processus)
 5276:                                                 .erreur_execution != d_ex) ||
 5277:                                                 ((*s_etat_processus).exception
 5278:                                                 != d_ep) || ((*s_etat_processus)
 5279:                                                 .erreur_systeme != d_es))
 5280:                                         {
 5281:                                             printf("%s [%d]\n", message =
 5282:                                                     messages(s_etat_processus),
 5283:                                                     (int) getpid());
 5284:                                             free(message);
 5285: 
 5286:                                             if (test_cfsf(s_etat_processus, 51)
 5287:                                                     == d_faux)
 5288:                                             {
 5289:                                                 printf("%s", ds_beep);
 5290:                                             }
 5291: 
 5292:                                             if ((*s_etat_processus).core ==
 5293:                                                     d_vrai)
 5294:                                             {
 5295:                                                 printf("\n");
 5296: 
 5297:                                                 if ((*s_etat_processus).langue
 5298:                                                         == 'F')
 5299:                                                 {
 5300:                                                     printf("+++Information : Gé"
 5301:                                                             "nération du fichie"
 5302:                                                             "r rpl-core "
 5303:                                                             "[%d]\n", (int)
 5304:                                                             getpid());
 5305:                                                 }
 5306:                                                 else
 5307:                                                 {
 5308:                                                     printf("+++Information : Wr"
 5309:                                                             "iting rpl-core fil"
 5310:                                                             "e [%d]\n",
 5311:                                                             (int) getpid());
 5312:                                                 }
 5313: 
 5314:                                                 rplcore(s_etat_processus);
 5315: 
 5316:                                                 if ((*s_etat_processus).langue
 5317:                                                         == 'F')
 5318:                                                 {
 5319:                                                     printf("+++Information : Pr"
 5320:                                                             "ocessus tracé [%d]"
 5321:                                                             "\n",
 5322:                                                             (int) getpid());
 5323:                                                 }
 5324:                                                 else
 5325:                                                 {
 5326:                                                     printf("+++Information : Do"
 5327:                                                             "ne [%d]\n", (int)
 5328:                                                             getpid());
 5329:                                                 }
 5330: 
 5331:                                                 printf("\n");
 5332:                                                 fflush(stdout);
 5333:                                             }
 5334:                                         }
 5335:                                     }
 5336:                                 }
 5337:                             }
 5338:                         }
 5339:                     }
 5340: 
 5341:                     for(i = 0; i < (*s_etat_processus).sections_critiques; i++)
 5342:                     {
 5343:                         pthread_mutex_unlock(&mutex_sections_critiques);
 5344:                     }
 5345: 
 5346:                     liberation(s_etat_processus, (*s_etat_processus).at_exit);
 5347:                     liberation(s_etat_processus, (*s_etat_processus).at_poke);
 5348: 
 5349:                     if ((*s_etat_processus).generateur_aleatoire != NULL)
 5350:                     {
 5351:                         liberation_generateur_aleatoire(s_etat_processus);
 5352:                     }
 5353: 
 5354:                     l_element_courant = (*s_etat_processus).liste_mutexes;
 5355:                     while(l_element_courant != NULL)
 5356:                     {
 5357:                         liberation(s_etat_processus,
 5358:                                 (*((struct_liste_chainee *)
 5359:                                 l_element_courant)).donnee);
 5360:                         l_element_suivant = (*((struct_liste_chainee *)
 5361:                                 l_element_courant)).suivant;
 5362:                         free((struct_liste_chainee *) l_element_courant);
 5363:                         l_element_courant = l_element_suivant;
 5364:                     }
 5365: 
 5366:                     /*
 5367:                      * Arrêt des processus fils
 5368:                      */
 5369: 
 5370:                     if ((*s_etat_processus).presence_fusible == d_vrai)
 5371:                     {
 5372:                         pthread_cancel((*s_etat_processus).thread_fusible);
 5373:                     }
 5374: 
 5375:                     pthread_mutex_lock(&((*s_etat_processus).mutex));
 5376: 
 5377:                     l_element_courant = (void *) (*s_etat_processus)
 5378:                             .l_base_pile_processus;
 5379: 
 5380:                     while(l_element_courant != NULL)
 5381:                     {
 5382:                         if ((*s_etat_processus).debug == d_vrai)
 5383:                         {
 5384:                             if (((*s_etat_processus).type_debug &
 5385:                                     d_debug_processus) != 0)
 5386:                             {
 5387:                                 if ((*(*((struct_processus_fils *)
 5388:                                         (*(*((struct_liste_chainee *)
 5389:                                         l_element_courant)).donnee)
 5390:                                         .objet)).thread)
 5391:                                         .processus_detache == d_vrai)
 5392:                                 {
 5393:                                     if ((*s_etat_processus).langue == 'F')
 5394:                                     {
 5395:                                         printf("[%d] Signalement pour arrêt du "
 5396:                                                 "processus %d\n",
 5397:                                                 (int) getpid(), (int)
 5398:                                                 (*(*((struct_processus_fils *)
 5399:                                                 (*(*((struct_liste_chainee *)
 5400:                                                 l_element_courant)).donnee)
 5401:                                                 .objet)).thread).pid);
 5402:                                     }
 5403:                                     else
 5404:                                     {
 5405:                                         printf("[%d] Send stop signal to "
 5406:                                                 "process %d\n",
 5407:                                                 (int) getpid(), (int)
 5408:                                                 (*(*((struct_processus_fils *)
 5409:                                                 (*(*((struct_liste_chainee *)
 5410:                                                 l_element_courant)).donnee)
 5411:                                                 .objet)).thread).pid);
 5412:                                     }
 5413:                                 }
 5414:                                 else
 5415:                                 {
 5416:                                     if ((*s_etat_processus).langue == 'F')
 5417:                                     {
 5418:                                         printf("[%d] Signalement pour arrêt du "
 5419:                                                 "thread %llu\n", (int) getpid(),
 5420:                                                 (unsigned long long)
 5421:                                                 (*(*((struct_processus_fils *)
 5422:                                                 (*(*((struct_liste_chainee *)
 5423:                                                 l_element_courant)).donnee)
 5424:                                                 .objet)).thread).tid);
 5425:                                     }
 5426:                                     else
 5427:                                     {
 5428:                                         printf("[%d] Send stop signal to "
 5429:                                                 "thread %llu\n",
 5430:                                                 (int) getpid(),
 5431:                                                 (unsigned long long)
 5432:                                                 (*(*((struct_processus_fils *)
 5433:                                                 (*(*((struct_liste_chainee *)
 5434:                                                 l_element_courant)).donnee)
 5435:                                                 .objet)).thread).tid);
 5436:                                     }
 5437:                                 }
 5438:                             }
 5439:                         }
 5440: 
 5441:                         if ((*(*((struct_processus_fils *)
 5442:                                 (*(*((struct_liste_chainee *)
 5443:                                 l_element_courant)).donnee).objet))
 5444:                                 .thread).processus_detache == d_vrai)
 5445:                         {
 5446:                             if ((*s_etat_processus).var_volatile_alarme != 0)
 5447:                             {
 5448:                                 envoi_signal_processus(
 5449:                                         (*(*((struct_processus_fils *)
 5450:                                         (*(*((struct_liste_chainee *)
 5451:                                         l_element_courant)).donnee).objet))
 5452:                                         .thread).pid, rpl_sigurg);
 5453:                             }
 5454:                             else
 5455:                             {
 5456:                                 if ((*s_etat_processus).arret_depuis_abort
 5457:                                         == -1)
 5458:                                 {
 5459:                                     envoi_signal_processus(
 5460:                                             (*(*((struct_processus_fils *)
 5461:                                             (*(*((struct_liste_chainee *)
 5462:                                             l_element_courant)).donnee).objet))
 5463:                                             .thread).pid, rpl_sigabort);
 5464:                                 }
 5465:                                 else
 5466:                                 {
 5467:                                     envoi_signal_processus(
 5468:                                             (*(*((struct_processus_fils *)
 5469:                                             (*(*((struct_liste_chainee *)
 5470:                                             l_element_courant)).donnee).objet))
 5471:                                             .thread).pid, rpl_sigstop);
 5472:                                 }
 5473:                             }
 5474:                         }
 5475:                         else
 5476:                         {
 5477:                             pthread_mutex_lock(&((*(*((struct_processus_fils *)
 5478:                                     (*(*((struct_liste_chainee *)
 5479:                                     l_element_courant)).donnee).objet)).thread)
 5480:                                     .mutex));
 5481: 
 5482:                             if ((*(*((struct_processus_fils *)
 5483:                                     (*(*((struct_liste_chainee *)
 5484:                                     l_element_courant)).donnee).objet)).thread)
 5485:                                     .thread_actif == d_vrai)
 5486:                             {
 5487:                                 if ((*s_etat_processus).var_volatile_alarme
 5488:                                         != 0)
 5489:                                 {
 5490:                                     envoi_signal_thread(
 5491:                                             (*(*((struct_processus_fils *)
 5492:                                             (*(*((struct_liste_chainee *)
 5493:                                             l_element_courant)).donnee).objet))
 5494:                                             .thread).tid, rpl_sigurg);
 5495:                                 }
 5496:                                 else
 5497:                                 {
 5498:                                     if ((*s_etat_processus).arret_depuis_abort
 5499:                                             == -1)
 5500:                                     {
 5501:                                         envoi_signal_thread(
 5502:                                                 (*(*((struct_processus_fils *)
 5503:                                                 (*(*((struct_liste_chainee *)
 5504:                                                 l_element_courant)).donnee)
 5505:                                                 .objet)).thread).tid,
 5506:                                                 rpl_sigabort);
 5507:                                     }
 5508:                                     else
 5509:                                     {
 5510:                                         envoi_signal_thread(
 5511:                                                 (*(*((struct_processus_fils *)
 5512:                                                 (*(*((struct_liste_chainee *)
 5513:                                                 l_element_courant)).donnee)
 5514:                                                 .objet)).thread).tid,
 5515:                                                 rpl_sigstop);
 5516:                                     }
 5517:                                 }
 5518:                             }
 5519: 
 5520:                             pthread_mutex_unlock(
 5521:                                     &((*(*((struct_processus_fils *)
 5522:                                     (*(*((struct_liste_chainee *)
 5523:                                     l_element_courant)).donnee).objet)).thread)
 5524:                                     .mutex));
 5525:                         }
 5526: 
 5527:                         l_element_courant = (*((struct_liste_chainee *)
 5528:                                 l_element_courant)).suivant;
 5529:                     }
 5530: 
 5531:                     /*
 5532:                      * Attente de la fin de tous les processus fils
 5533:                      */
 5534: 
 5535:                     for(i = 0; i < d_NOMBRE_INTERRUPTIONS;
 5536:                             (*s_etat_processus).masque_interruptions[i++]
 5537:                             = 'I');
 5538: 
 5539:                     attente.tv_sec = 0;
 5540:                     attente.tv_nsec = GRANULARITE_us * 1000;
 5541: 
 5542:                     while((*s_etat_processus).l_base_pile_processus != NULL)
 5543:                     {
 5544:                         l_element_courant = (void *)
 5545:                                 (*s_etat_processus).l_base_pile_processus;
 5546: 
 5547:                         for(i = 0; i < (*(*((struct_processus_fils *)
 5548:                                 (*(*((struct_liste_chainee *)
 5549:                                 l_element_courant)).donnee).objet)).thread)
 5550:                                 .nombre_objets_dans_pipe; i++)
 5551:                         {
 5552:                             if ((s_objet = lecture_pipe(
 5553:                                     s_etat_processus,
 5554:                                     (*(*((struct_processus_fils *)
 5555:                                     (*(*((struct_liste_chainee *)
 5556:                                     l_element_courant)).donnee).objet)).thread)
 5557:                                     .pipe_objets[0])) != NULL)
 5558:                             {
 5559:                                 liberation(s_etat_processus, s_objet);
 5560: 
 5561:                                 (*(*((struct_processus_fils *)
 5562:                                         (*(*((struct_liste_chainee *)
 5563:                                         l_element_courant)).donnee).objet))
 5564:                                         .thread).nombre_objets_dans_pipe--;
 5565: 
 5566:                                 action.sa_handler = SIG_IGN;
 5567:                                 action.sa_flags = 0;
 5568: 
 5569:                                 if (sigaction(SIGPIPE, &action, &registre)
 5570:                                         != 0)
 5571:                                 {
 5572: #                                   ifndef SEMAPHORES_NOMMES
 5573:                                         sem_post(&((*s_etat_processus)
 5574:                                                 .semaphore_fork));
 5575:                                         sem_post(
 5576:                                                 &semaphore_gestionnaires_signaux
 5577:                                                 );
 5578:                                         sem_destroy(
 5579:                                                 &semaphore_gestionnaires_signaux
 5580:                                                 );
 5581:                                         sem_destroy(&((*s_etat_processus)
 5582:                                                 .semaphore_fork));
 5583: #                                   else
 5584:                                         sem_post((*s_etat_processus)
 5585:                                                 .semaphore_fork);
 5586:                                         sem_post(
 5587:                                                 semaphore_gestionnaires_signaux
 5588:                                                 );
 5589:                                         sem_destroy2(
 5590:                                                 semaphore_gestionnaires_signaux,
 5591:                                                 getpid(), SEM_SIGNAUX);
 5592:                                         sem_destroy3((*s_etat_processus)
 5593:                                                 .semphore_fork, getpid(),
 5594:                                                 pthread_self(), SEM_FORK);
 5595: #                                   endif
 5596: 
 5597:                                     liberation_contexte_cas(s_etat_processus);
 5598:                                     liberation_queue_signaux(s_etat_processus);
 5599: 
 5600: #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
 5601:                                         stackoverflow_deinstall_handler();
 5602: #                                   endif
 5603: 
 5604: #                                   ifdef HAVE_SIGSEGV_RECOVERY
 5605:                                         if (debug == d_faux)
 5606:                                         {
 5607:                                             sigsegv_deinstall_handler();
 5608:                                         }
 5609: #                                   endif
 5610: 
 5611:                                     pthread_mutex_unlock(
 5612:                                             &((*s_etat_processus).mutex));
 5613:                                     return(EXIT_FAILURE);
 5614:                                 }
 5615: 
 5616:                                 while((longueur_ecriture =
 5617:                                         write_atomic(s_etat_processus,
 5618:                                         (*(*((struct_processus_fils *)
 5619:                                         (*(*((struct_liste_chainee *)
 5620:                                         l_element_courant)).donnee).objet))
 5621:                                         .thread).pipe_nombre_injections[1], "+",
 5622:                                         sizeof(unsigned char))) !=
 5623:                                         sizeof(unsigned char))
 5624:                                 {
 5625:                                     if (longueur_ecriture == -1)
 5626:                                     {
 5627:                                         // Le processus n'existe plus.
 5628:                                         break;
 5629:                                     }
 5630:                                 }
 5631: 
 5632:                                 if (sigaction(SIGPIPE, &registre, NULL)
 5633:                                         != 0)
 5634:                                 {
 5635: #                                   ifndef SEMAPHORES_NOMMES
 5636:                                         sem_post(&((*s_etat_processus)
 5637:                                                 .semaphore_fork));
 5638:                                         sem_post(
 5639:                                                 &semaphore_gestionnaires_signaux
 5640:                                                 );
 5641:                                         sem_destroy(
 5642:                                                 &semaphore_gestionnaires_signaux
 5643:                                                 );
 5644:                                         sem_destroy(&((*s_etat_processus)
 5645:                                                 .semaphore_fork));
 5646: #                                   else
 5647:                                         sem_post((*s_etat_processus)
 5648:                                                 .semaphore_fork);
 5649:                                         sem_post(
 5650:                                                 semaphore_gestionnaires_signaux
 5651:                                                 );
 5652:                                         sem_destroy2(
 5653:                                                 semaphore_gestionnaires_signaux,
 5654:                                                 getpid(), SEM_SIGNAUX);
 5655:                                         sem_destroy3((*s_etat_processus)
 5656:                                                 .semphore_fork, getpid(),
 5657:                                                 pthread_self(), SEM_FORK);
 5658: #                                   endif
 5659: 
 5660:                                     liberation_contexte_cas(s_etat_processus);
 5661:                                     liberation_queue_signaux(s_etat_processus);
 5662: 
 5663: #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
 5664:                                         stackoverflow_deinstall_handler();
 5665: #                                   endif
 5666: 
 5667: #                                   ifdef HAVE_SIGSEGV_RECOVERY
 5668:                                         if (debug == d_faux)
 5669:                                         {
 5670:                                             sigsegv_deinstall_handler();
 5671:                                         }
 5672: #                                   endif
 5673: 
 5674:                                     pthread_mutex_unlock(
 5675:                                             &((*s_etat_processus).mutex));
 5676:                                     return(EXIT_FAILURE);
 5677:                                 }
 5678:                             }
 5679:                         }
 5680: 
 5681:                         pthread_mutex_unlock(&((*s_etat_processus).mutex));
 5682: 
 5683:                         if ((*s_etat_processus)
 5684:                                 .nombre_interruptions_non_affectees != 0)
 5685:                         {
 5686:                             affectation_interruptions_logicielles(
 5687:                                     s_etat_processus);
 5688:                         }
 5689: 
 5690:                         nanosleep(&attente, NULL);
 5691:                         scrutation_interruptions(s_etat_processus);
 5692:                         pthread_mutex_lock(&((*s_etat_processus).mutex));
 5693:                     }
 5694: 
 5695:                     pthread_mutex_unlock(&((*s_etat_processus).mutex));
 5696: 
 5697:                     erreur_historique = write_history(
 5698:                             (*s_etat_processus).nom_fichier_historique);
 5699:                     clear_history();
 5700: 
 5701:                     if (erreur_historique != 0)
 5702:                     {
 5703:                         if ((*s_etat_processus).langue == 'F')
 5704:                         {
 5705:                             printf("+++Erreur : L'historique ne peut être "
 5706:                                     "écrit\n");
 5707:                         }
 5708:                         else
 5709:                         {
 5710:                             printf("+++Error : History cannot be "
 5711:                                     "written\n");
 5712:                         }
 5713: 
 5714:                         if (test_cfsf(s_etat_processus, 51) == d_faux)
 5715:                         {
 5716:                             printf("%s", ds_beep);
 5717:                         }
 5718:                     }
 5719: 
 5720:                     free((*s_etat_processus).nom_fichier_historique);
 5721: 
 5722:                     if (((*s_etat_processus).core == d_vrai) &&
 5723:                             (erreur == d_erreur) &&
 5724:                             ((*s_etat_processus).var_volatile_traitement_sigint
 5725:                             == 0))
 5726:                     {
 5727:                         printf("\n");
 5728:                         
 5729:                         if ((*s_etat_processus).langue == 'F')
 5730:                         {
 5731:                             printf("+++Information : Génération du fichier "
 5732:                                     "rpl-core [%d]\n", (int) getpid());
 5733:                         }
 5734:                         else
 5735:                         {
 5736:                             printf("+++Information : Writing rpl-core "
 5737:                                     "file [%d]\n", (int) getpid());
 5738:                         }
 5739: 
 5740:                         rplcore(s_etat_processus);
 5741: 
 5742:                         if ((*s_etat_processus).langue == 'F')
 5743:                         {
 5744:                             printf("+++Information : Processus tracé [%d]\n",
 5745:                                     (int) getpid());
 5746:                         }
 5747:                         else
 5748:                         {
 5749:                             printf("+++Information : Done [%d]\n",
 5750:                                     (int) getpid());
 5751:                         }
 5752: 
 5753:                         printf("\n");
 5754:                     }
 5755: 
 5756:                     free((*s_etat_processus).definitions_chainees);
 5757: 
 5758:                     /*
 5759:                      * Libération de l'arbre des instructions
 5760:                      */
 5761: 
 5762:                     liberation_arbre_instructions(s_etat_processus,
 5763:                             (*s_etat_processus).arbre_instructions);
 5764:                     free((*s_etat_processus).pointeurs_caracteres);
 5765: 
 5766:                     if ((*s_etat_processus).entree_standard != NULL)
 5767:                     {
 5768:                         pclose((*s_etat_processus).entree_standard);
 5769:                         (*s_etat_processus).entree_standard = NULL;
 5770:                     }
 5771: 
 5772:                     if ((*s_etat_processus).nom_fichier_impression != NULL)
 5773:                     {
 5774:                         if (test_cfsf(s_etat_processus, 51) == d_faux)
 5775:                         {
 5776:                             printf("%s", ds_beep);
 5777:                         }
 5778: 
 5779:                         if ((*s_etat_processus).langue == 'F')
 5780:                         {
 5781:                             printf("+++Attention : Queue d'impression "
 5782:                                     "non vide !\n");
 5783:                         }
 5784:                         else
 5785:                         {
 5786:                             printf("+++Warning : Non empty printing "
 5787:                                     "spool queue !\n");
 5788:                         }
 5789: 
 5790:                         instruction_erase(s_etat_processus);
 5791:                     }
 5792: 
 5793:                     if ((*s_etat_processus).fichiers_graphiques != NULL)
 5794:                     {
 5795:                         instruction_cllcd(s_etat_processus);
 5796:                     }
 5797: 
 5798:                     liberation(s_etat_processus, (*s_etat_processus).indep);
 5799:                     liberation(s_etat_processus, (*s_etat_processus).depend);
 5800: 
 5801:                     free((*s_etat_processus).label_x);
 5802:                     free((*s_etat_processus).label_y);
 5803:                     free((*s_etat_processus).label_z);
 5804:                     free((*s_etat_processus).titre);
 5805:                     free((*s_etat_processus).legende);
 5806: 
 5807:                     liberation(s_etat_processus, (*s_etat_processus)
 5808:                             .parametres_courbes_de_niveau);
 5809: 
 5810:                     for(i = 0; i < d_NOMBRE_INTERRUPTIONS; i++)
 5811:                     {
 5812:                         liberation(s_etat_processus,
 5813:                                 (*s_etat_processus).corps_interruptions[i]);
 5814: 
 5815:                         l_element_courant = (*s_etat_processus)
 5816:                                 .pile_origine_interruptions[i];
 5817: 
 5818:                         while(l_element_courant != NULL)
 5819:                         {
 5820:                             l_element_suivant = (*((struct_liste_chainee *)
 5821:                                     l_element_courant)).suivant;
 5822: 
 5823:                             liberation(s_etat_processus,
 5824:                                     (*((struct_liste_chainee *)
 5825:                                     l_element_courant)).donnee);
 5826:                             free(l_element_courant);
 5827: 
 5828:                             l_element_courant = l_element_suivant;
 5829:                         }
 5830:                     }
 5831: 
 5832:                     if ((*s_etat_processus).instruction_derniere_erreur
 5833:                             != NULL)
 5834:                     {
 5835:                         free((*s_etat_processus).instruction_derniere_erreur);
 5836:                         (*s_etat_processus).instruction_derniere_erreur = NULL;
 5837:                     }
 5838: 
 5839:                     /*
 5840:                      * Le pointeur s_etat_processus.nom_fichier_source est
 5841:                      * alloué par le système. Il ne faut donc pas
 5842:                      * le libérer...
 5843:                      */
 5844: 
 5845:                     liberation_arbre_variables_partagees(s_etat_processus,
 5846:                             (*(*s_etat_processus).s_arbre_variables_partagees));
 5847:                     liberation_arbre_variables(s_etat_processus,
 5848:                             (*s_etat_processus).s_arbre_variables, d_vrai);
 5849:                     free((*s_etat_processus).pointeurs_caracteres_variables);
 5850: 
 5851:                     l_element_statique_courant = (*s_etat_processus)
 5852:                             .l_liste_variables_statiques;
 5853: 
 5854:                     while(l_element_statique_courant != NULL)
 5855:                     {
 5856:                         l_element_statique_suivant =
 5857:                             (*l_element_statique_courant).suivant;
 5858:                         free(l_element_statique_courant);
 5859:                         l_element_statique_courant = l_element_statique_suivant;
 5860:                     }
 5861: 
 5862:                     l_element_partage_courant = (*(*s_etat_processus)
 5863:                             .l_liste_variables_partagees);
 5864: 
 5865:                     while(l_element_partage_courant != NULL)
 5866:                     {
 5867:                         l_element_partage_suivant =
 5868:                                 (*l_element_partage_courant).suivant;
 5869:                         free(l_element_partage_courant);
 5870:                         l_element_partage_courant = l_element_partage_suivant;
 5871:                     }
 5872: 
 5873:                     /*
 5874:                      * Si resultats est non nul, rplinit a été appelé
 5875:                      * depuis rpl() [librpl] et non main().
 5876:                      * On copie alors le contenu de la * pile dans un
 5877:                      * tableau **resultats dont le pointeur de base a
 5878:                      * été alloué dans rpl().
 5879:                      */
 5880: 
 5881:                     if (resultats != NULL)
 5882:                     {
 5883:                         if ((*resultats) != NULL)
 5884:                         {
 5885:                             free((*resultats));
 5886: 
 5887:                             if (((*resultats) = malloc(((size_t)
 5888:                                     ((*s_etat_processus)
 5889:                                     .hauteur_pile_operationnelle + 1))
 5890:                                     * sizeof(unsigned char **))) != NULL)
 5891:                             {
 5892:                                 (*resultats)[(*s_etat_processus)
 5893:                                         .hauteur_pile_operationnelle] = NULL;
 5894:                                 l_element_courant = (void *) (*s_etat_processus)
 5895:                                         .l_base_pile;
 5896: 
 5897:                                 for(i = 0; i < (*s_etat_processus)
 5898:                                         .hauteur_pile_operationnelle; i++)
 5899:                                 {
 5900:                                     if (l_element_courant != NULL)
 5901:                                     {
 5902:                                         (*resultats)[i] =
 5903:                                                 formateur(s_etat_processus,
 5904:                                                 0, (*((struct_liste_chainee *)
 5905:                                                 l_element_courant)).donnee);
 5906: 
 5907:                                         if ((*resultats)[i] == NULL)
 5908:                                         {
 5909:                                             i = (*s_etat_processus).
 5910:                                                     hauteur_pile_operationnelle;
 5911:                                         }
 5912:                                         else
 5913:                                         {
 5914:                                             l_element_suivant =
 5915:                                                     (*((struct_liste_chainee *)
 5916:                                                     l_element_courant)).suivant;
 5917:                                         }
 5918:                                     }
 5919:                                 }
 5920:                             }
 5921:                             else
 5922:                             {
 5923:                                 (*resultats) = NULL;
 5924:                                 erreur = d_es_allocation_memoire;
 5925:                             }
 5926:                         }
 5927:                     }
 5928: 
 5929:                     l_element_courant = (void *) (*s_etat_processus)
 5930:                             .l_base_pile;
 5931:                     while(l_element_courant != NULL)
 5932:                     {
 5933:                         l_element_suivant = (*((struct_liste_chainee *)
 5934:                                 l_element_courant)).suivant;
 5935: 
 5936:                         liberation(s_etat_processus,
 5937:                                 (*((struct_liste_chainee *)
 5938:                                 l_element_courant)).donnee);
 5939:                         free((struct_liste_chainee *) l_element_courant);
 5940: 
 5941:                         l_element_courant = l_element_suivant;
 5942:                     }
 5943: 
 5944:                     l_element_courant = (void *) (*s_etat_processus)
 5945:                             .l_base_pile_contextes;
 5946:                     while(l_element_courant != NULL)
 5947:                     {
 5948:                         l_element_suivant = (*((struct_liste_chainee *)
 5949:                                 l_element_courant)).suivant;
 5950: 
 5951:                         liberation(s_etat_processus,
 5952:                                 (*((struct_liste_chainee *)
 5953:                                 l_element_courant)).donnee);
 5954:                         free((struct_liste_chainee *) l_element_courant);
 5955: 
 5956:                         l_element_courant = l_element_suivant;
 5957:                     }
 5958: 
 5959:                     l_element_courant = (void *) (*s_etat_processus)
 5960:                             .l_base_pile_taille_contextes;
 5961:                     while(l_element_courant != NULL)
 5962:                     {
 5963:                         l_element_suivant = (*((struct_liste_chainee *)
 5964:                                 l_element_courant)).suivant;
 5965: 
 5966:                         liberation(s_etat_processus,
 5967:                                 (*((struct_liste_chainee *)
 5968:                                 l_element_courant)).donnee);
 5969:                         free((struct_liste_chainee *) l_element_courant);
 5970: 
 5971:                         l_element_courant = l_element_suivant;
 5972:                     }
 5973: 
 5974:                     for(i = 0; i < (*s_etat_processus)
 5975:                             .nombre_instructions_externes; i++)
 5976:                     {
 5977:                         free((*s_etat_processus).s_instructions_externes[i]
 5978:                                 .nom);
 5979:                         free((*s_etat_processus).s_instructions_externes[i]
 5980:                                 .nom_bibliotheque);
 5981:                     }
 5982: 
 5983:                     if ((*s_etat_processus).nombre_instructions_externes != 0)
 5984:                     {
 5985:                         free((*s_etat_processus).s_instructions_externes);
 5986:                     }
 5987: 
 5988:                     l_element_courant = (void *) (*s_etat_processus)
 5989:                             .s_bibliotheques;
 5990:                     
 5991:                     while(l_element_courant != NULL)
 5992:                     {
 5993:                         l_element_suivant = (*((struct_liste_chainee *)
 5994:                                 l_element_courant)).suivant;
 5995: 
 5996:                         free((*((struct_bibliotheque *)
 5997:                                 (*((struct_liste_chainee *)
 5998:                                 l_element_courant)).donnee)).nom);
 5999:                         dlclose((*((struct_bibliotheque *)
 6000:                                 (*((struct_liste_chainee *)
 6001:                                 l_element_courant)).donnee)).descripteur);
 6002:                         free((*((struct_liste_chainee *) l_element_courant))
 6003:                                 .donnee);
 6004:                         free(l_element_courant);
 6005: 
 6006:                         l_element_courant = l_element_suivant;
 6007:                     }
 6008: 
 6009:                     l_element_courant = (void *) (*s_etat_processus)
 6010:                             .l_base_pile_last;
 6011:                     while(l_element_courant != NULL)
 6012:                     {
 6013:                         l_element_suivant = (*((struct_liste_chainee *)
 6014:                                 l_element_courant)).suivant;
 6015: 
 6016:                         liberation(s_etat_processus,
 6017:                                 (*((struct_liste_chainee *)
 6018:                                 l_element_courant)).donnee);
 6019:                         free((struct_liste_chainee *) l_element_courant);
 6020: 
 6021:                         l_element_courant = l_element_suivant;
 6022:                     }
 6023: 
 6024:                     l_element_courant = (void *) (*s_etat_processus)
 6025:                             .l_base_pile_systeme;
 6026:                     while(l_element_courant != NULL)
 6027:                     {
 6028:                         l_element_suivant = (*((struct_liste_pile_systeme *)
 6029:                                 l_element_courant)).suivant;
 6030: 
 6031:                         liberation(s_etat_processus,
 6032:                                 (*((struct_liste_pile_systeme *)
 6033:                                 l_element_courant)).indice_boucle);
 6034:                         liberation(s_etat_processus,
 6035:                                 (*((struct_liste_pile_systeme *)
 6036:                                 l_element_courant)).limite_indice_boucle);
 6037:                         liberation(s_etat_processus,
 6038:                                 (*((struct_liste_pile_systeme *)
 6039:                                 l_element_courant)).objet_de_test);
 6040: 
 6041:                         if ((*((struct_liste_pile_systeme *)
 6042:                                 l_element_courant)).nom_variable != NULL)
 6043:                         {
 6044:                             free((*((struct_liste_pile_systeme *)
 6045:                                     l_element_courant)).nom_variable);
 6046:                         }
 6047: 
 6048:                         free((struct_liste_pile_systeme *)
 6049:                                 l_element_courant);
 6050: 
 6051:                         l_element_courant = l_element_suivant;
 6052:                     }
 6053: 
 6054:                     l_element_courant = (void *)
 6055:                             (*s_etat_processus).s_fichiers;
 6056:                     while(l_element_courant != NULL)
 6057:                     {
 6058:                         l_element_suivant = (*((struct_liste_chainee *)
 6059:                                 l_element_courant)).suivant;
 6060: 
 6061:                         fclose((*((struct_descripteur_fichier *)
 6062:                                 (*((struct_liste_chainee *)
 6063:                                 l_element_courant)).donnee))
 6064:                                 .descripteur_c);
 6065: 
 6066:                         if ((*((struct_descripteur_fichier *)
 6067:                                 (*((struct_liste_chainee *)
 6068:                                 l_element_courant)).donnee)).type != 'C')
 6069:                         {
 6070:                             sqlite3_close((*((struct_descripteur_fichier *)
 6071:                                     (*((struct_liste_chainee *)
 6072:                                     l_element_courant)).donnee))
 6073:                                     .descripteur_sqlite);
 6074:                         }
 6075: 
 6076:                         if ((*((struct_descripteur_fichier *)
 6077:                                 (*((struct_liste_chainee *)
 6078:                                 l_element_courant)).donnee))
 6079:                                 .effacement == 'Y')
 6080:                         {
 6081:                             unlink((*((struct_descripteur_fichier *)
 6082:                                     (*((struct_liste_chainee *)
 6083:                                     l_element_courant)).donnee))
 6084:                                     .nom);
 6085:                         }
 6086: 
 6087:                         free((*((struct_descripteur_fichier *)
 6088:                                 (*((struct_liste_chainee *)
 6089:                                 l_element_courant)).donnee)).nom);
 6090:                         free((struct_descripteur_fichier *)
 6091:                                 (*((struct_liste_chainee *)
 6092:                                 l_element_courant)).donnee);
 6093:                         free(l_element_courant);
 6094: 
 6095:                         l_element_courant = l_element_suivant;
 6096:                     }
 6097: 
 6098:                     l_element_courant = (void *)
 6099:                             (*s_etat_processus).s_sockets;
 6100:                     while(l_element_courant != NULL)
 6101:                     {
 6102:                         l_element_suivant = (*((struct_liste_chainee *)
 6103:                                 l_element_courant)).suivant;
 6104: 
 6105:                         if ((*((struct_socket *)
 6106:                                 (*(*((struct_liste_chainee *)
 6107:                                 l_element_courant)).donnee).objet))
 6108:                                 .socket_connectee == d_vrai)
 6109:                         {
 6110:                             shutdown((*((struct_socket *)
 6111:                                     (*(*((struct_liste_chainee *)
 6112:                                     l_element_courant)).donnee).objet))
 6113:                                     .socket, SHUT_RDWR);
 6114:                         }
 6115: 
 6116:                         close((*((struct_socket *)
 6117:                                 (*(*((struct_liste_chainee *)
 6118:                                 l_element_courant)).donnee).objet)).socket);
 6119: 
 6120:                         if ((*((struct_socket *) (*(*((struct_liste_chainee *)
 6121:                                 l_element_courant)).donnee).objet)).effacement
 6122:                                 == 'Y')
 6123:                         {
 6124:                             unlink((*((struct_socket *)
 6125:                                     (*(*((struct_liste_chainee *)
 6126:                                     l_element_courant)).donnee).objet))
 6127:                                     .adresse);
 6128:                         }
 6129: 
 6130:                         liberation(s_etat_processus,
 6131:                                 (*((struct_liste_chainee *)
 6132:                                 l_element_courant)).donnee);
 6133:                         free(l_element_courant);
 6134: 
 6135:                         l_element_courant = l_element_suivant;
 6136:                     }
 6137: 
 6138:                     l_element_courant = (void *)
 6139:                             (*s_etat_processus).s_connecteurs_sql;
 6140:                     while(l_element_courant != NULL)
 6141:                     {
 6142:                         l_element_suivant = (*((struct_liste_chainee *)
 6143:                                 l_element_courant)).suivant;
 6144: 
 6145:                         sqlclose((*((struct_liste_chainee *)
 6146:                                 l_element_courant)).donnee);
 6147:                         liberation(s_etat_processus,
 6148:                                 (*((struct_liste_chainee *)
 6149:                                 l_element_courant)).donnee);
 6150:                         free(l_element_courant);
 6151: 
 6152:                         l_element_courant = l_element_suivant;
 6153:                     }
 6154: 
 6155:                     l_element_courant = (*s_etat_processus).s_marques;
 6156:                     while(l_element_courant != NULL)
 6157:                     {
 6158:                         free((*((struct_marque *) l_element_courant)).label);
 6159:                         free((*((struct_marque *) l_element_courant)).position);
 6160:                         l_element_suivant = (*((struct_marque *)
 6161:                                 l_element_courant)).suivant;
 6162:                         free(l_element_courant);
 6163:                         l_element_courant = l_element_suivant;
 6164:                     }
 6165:                 }
 6166:                 else
 6167:                 {
 6168:                     erreur = d_es_allocation_memoire;
 6169: 
 6170:                     if (test_cfsf(s_etat_processus, 51) == d_faux)
 6171:                     {
 6172:                         printf("%s", ds_beep);
 6173:                     }
 6174: 
 6175:                     if ((*s_etat_processus).langue == 'F')
 6176:                     {
 6177:                         printf("+++Système : Mémoire insuffisante\n");
 6178:                     }
 6179:                     else
 6180:                     {
 6181:                         printf("+++System : Not enough memory\n");
 6182:                     }
 6183:                 }
 6184:             }
 6185: 
 6186:             liberation_allocateur(s_etat_processus);
 6187:         }
 6188: 
 6189:         if (traitement_fichier_temporaire == 'Y')
 6190:         {
 6191:             destruction_fichier(nom_fichier_temporaire);
 6192:             free(nom_fichier_temporaire);
 6193:         }
 6194: 
 6195:         if ((*s_etat_processus).profilage == d_vrai)
 6196:         {
 6197:             ecriture_profil(s_etat_processus);
 6198:             liberation_profil(s_etat_processus);
 6199:         }
 6200:     }
 6201: 
 6202:     closelog();
 6203: 
 6204:     pthread_mutex_destroy(&((*s_etat_processus).protection_liste_mutexes));
 6205: 
 6206:     retrait_thread(s_etat_processus);
 6207: 
 6208:     pthread_mutex_destroy(&((*s_etat_processus).mutex));
 6209:     pthread_mutex_destroy(&((*s_etat_processus).mutex_allocation));
 6210:     pthread_mutex_destroy(&mutex_sections_critiques);
 6211:     pthread_mutex_destroy(&mutex_liste_variables_partagees);
 6212: 
 6213: #   ifndef SEMAPHORES_NOMMES
 6214:     sem_post(&((*s_etat_processus).semaphore_fork));
 6215:     sem_destroy(&((*s_etat_processus).semaphore_fork));
 6216: #   else
 6217:     sem_post((*s_etat_processus).semaphore_fork);
 6218:     sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(),
 6219:             SEM_FORK);
 6220: #   endif
 6221: 
 6222:     free((*s_etat_processus).localisation);
 6223: 
 6224: #   ifndef SEMAPHORES_NOMMES
 6225:     sem_post(&semaphore_gestionnaires_signaux);
 6226:     sem_destroy(&semaphore_gestionnaires_signaux);
 6227: #   else
 6228:     sem_post(semaphore_gestionnaires_signaux);
 6229:     sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX);
 6230: #   endif
 6231: 
 6232:     destruction_queue_signaux(s_etat_processus);
 6233:     liberation_contexte_cas(s_etat_processus);
 6234: 
 6235:     free((*s_etat_processus).chemin_fichiers_temporaires);
 6236: 
 6237:     if ((*s_etat_processus).requete_redemarrage == d_vrai)
 6238:     {
 6239:         chdir(repertoire_initial);
 6240:         execvp(arg_exec[0], &(arg_exec[0]));
 6241:         erreur = d_erreur;
 6242:     }
 6243: 
 6244:     free(arg_exec);
 6245:     arret_thread_signaux(s_etat_processus);
 6246:     free(s_etat_processus);
 6247: 
 6248: #   ifdef DEBUG_MEMOIRE
 6249:     debug_memoire_verification();
 6250:     analyse_post_mortem();
 6251: #   endif
 6252: 
 6253: #   ifdef HAVE_STACK_OVERFLOW_RECOVERY
 6254:     stackoverflow_deinstall_handler();
 6255: #   endif
 6256: 
 6257: #   ifdef HAVE_SIGSEGV_RECOVERY
 6258:     if (debug == d_faux)
 6259:     {
 6260:         sigsegv_deinstall_handler();
 6261:     }
 6262: #   endif
 6263: 
 6264:     return((erreur == d_absence_erreur) ? EXIT_SUCCESS : EXIT_FAILURE);
 6265: }
 6266: 
 6267: 
 6268: void
 6269: informations(struct_processus *s_etat_processus)
 6270: {
 6271:     printf("\n");
 6272: 
 6273:     if ((*s_etat_processus).langue == 'F')
 6274:     {
 6275:         printf("  rpl [-options] [programme]\n");
 6276:         printf("      -a : analyse du code\n");
 6277:         printf("      -A : paramètres passés au programme principal\n");
 6278:         printf("      -c : génération de fichier de débogage (rpl-core)\n");
 6279:         printf("      -d : option de déverminage interne\n");
 6280:         printf("      -D : lancement d'un daemon\n");
 6281:         printf("      -h : aide sur la ligne de commande\n");
 6282:         printf("      -i : fonctionnement interactif\n");
 6283:         printf("      -l : licence d'utilisation\n");
 6284:         printf("      -n : ignorance du signal HUP\n");
 6285:         printf("      -p : précompilation du script avant exécution\n");
 6286:         printf("      -P : profilage (-P ou -PP)\n");
 6287:         printf("      -s : empêchement de l'ouverture de l'écran initial\n");
 6288:         printf("      -S : exécution du script passé en ligne de commande\n");
 6289:         printf("      -t : trace\n");
 6290:         printf("      -v : version\n");
 6291:     }
 6292:     else
 6293:     {
 6294:         printf("  rpl [-options] [program]\n");
 6295:         printf("      -a : analyzes program\n");
 6296:         printf("      -A : sends parameters to main program\n");
 6297:         printf("      -c : allows creation of a rpl-core file, providing a way"
 6298:                 "\n"
 6299:                 "           to debug a program\n");
 6300:         printf("      -d : internal debug process\n");
 6301:         printf("      -D : starts in daemon mode\n");
 6302:         printf("      -h : shows a summary of available options\n");
 6303:         printf("      -i : runs the RPL/2 sequencer in interactive mode\n");
 6304:         printf("      -l : prints the user licence of the software\n");
 6305:         printf("      -n : ignores HUP signal\n");
 6306:         printf("      -p : precompiles script\n");
 6307:         printf("      -P : computes profile data (-P or -PP)\n");
 6308:         printf("      -s : disables splash screen\n");
 6309:         printf("      -S : executes script written in command line\n");
 6310:         printf("      -t : enables tracing mode\n");
 6311:         printf("      -v : prints the version number\n");
 6312:     }
 6313: 
 6314:     printf("\n");
 6315: 
 6316:     return;
 6317: }
 6318: 
 6319: 
 6320: logical1
 6321: controle_integrite(struct_processus *s_etat_processus,
 6322:         unsigned char *executable_candidat, unsigned char *executable)
 6323: {
 6324:     unsigned char       *md5;
 6325:     unsigned char       *sha1;
 6326: 
 6327:     if (strcmp(executable, "rplpp") == 0)
 6328:     {
 6329:         md5 = rplpp_md5;
 6330:         sha1 = rplpp_sha1;
 6331:     }
 6332:     else if (strcmp(executable, "rplfile") == 0)
 6333:     {
 6334:         md5 = rplfile_md5;
 6335:         sha1 = rplfile_sha1;
 6336:     }
 6337:     else if (strcmp(executable, "rpliconv") == 0)
 6338:     {
 6339:         md5 = rpliconv_md5;
 6340:         sha1 = rpliconv_sha1;
 6341:     }
 6342:     else if (strcmp(executable, "rplawk") == 0)
 6343:     {
 6344:         md5 = rplawk_md5;
 6345:         sha1 = rplawk_sha1;
 6346:     }
 6347:     else if (strcmp(executable, "rplconvert") == 0)
 6348:     {
 6349:         md5 = rplconvert_md5;
 6350:         sha1 = rplconvert_sha1;
 6351:     }
 6352:     else
 6353:     {
 6354:         return(d_faux);
 6355:     }
 6356: 
 6357:     if (controle(s_etat_processus, executable_candidat, "md5", md5) != d_vrai)
 6358:     {
 6359:         return(d_faux);
 6360:     }
 6361: 
 6362:     if (controle(s_etat_processus, executable_candidat, "sha1", sha1) != d_vrai)
 6363:     {
 6364:         return(d_faux);
 6365:     }
 6366: 
 6367:     return(d_vrai);
 6368: }
 6369: 
 6370: 
 6371: unsigned char *
 6372: date_compilation()
 6373: {
 6374:     unsigned char       *date;
 6375: 
 6376:     if ((date = malloc((strlen(d_date_en_rpl) + 1) * sizeof(unsigned char)))
 6377:             == NULL)
 6378:     {
 6379:         return(NULL);
 6380:     }
 6381: 
 6382:     strcpy(date, d_date_en_rpl);
 6383: 
 6384:     return(date);
 6385: }
 6386: 
 6387: // vim: ts=4

CVSweb interface <joel.bertrand@systella.fr>